Commit 86de5703 authored by Alastair Bridgewater's avatar Alastair Bridgewater
Browse files

clx-interface: Use a mirrored SHEET to create our window.

  * This is a fairly big milestone, even if some of the design for
the clx-interface / rendering_1 split is starting to seem a poor
fit for a CLIM world.

  * We define a currently-minimal sheet class that can serve as a
child sheet, have it adopted by a graft, force it to be mirrored,
and then use the mirror as our window.  And it all WORKS.
parent 9f50506a
......@@ -8,6 +8,13 @@
(:use :cl
......@@ -16,6 +23,7 @@
......@@ -32,6 +40,7 @@
(defvar *port* nil "The CLIM PORT.")
(defvar *graft* nil "The CLIM GRAFT.")
(defvar *sheet* nil "The CLIM SHEET.")
(defvar *display* nil "The X display connection.")
(defvar *window* nil "The X window we draw in.")
......@@ -50,6 +59,15 @@
(defparameter *default-window-title* "CLX Interface Window")
;; A placeholder SHEET class.
(defclass clx-interface-sheet (mirrored-sheet-mixin
(defun set-window-space-requirement (window space-requirement)
(width min-width max-width height max-height min-height)
......@@ -72,10 +90,14 @@
(height (or (and space-requirement
(space-requirement-height space-requirement))
(window (xlib:create-window :parent (sheet-direct-mirror *graft*)
:x 0 :y 0 :width width :height height)))
(setf *window* window)
(setf *sheet* (make-instance 'clx-interface-sheet))
(setf (sheet-transformation *sheet*) +identity-transformation+)
(resize-sheet *sheet* width height)
(sheet-adopt-child *graft* *sheet*)
(setf *window* (realize-mirror *port* *sheet*))
(setf (xlib:window-background *window*)
......@@ -97,6 +119,7 @@
;; the display automatically releases all server resources.
(setf *window* nil)
(setf *display* nil)
(setf *sheet* nil)
(setf *graft* nil)
(when *port*
(destroy-port *port*))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment