/[defwm]/Define-Window-Manager/src/application.lisp
ViewVC logotype

Contents of /Define-Window-Manager/src/application.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Thu Feb 26 19:29:52 2004 UTC (10 years, 1 month ago) by rjain
Branch: MAIN, rjain
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Initial import
1 (in-package :define-window-manager)
2
3 (defclass define-window-manager-port (clim-clx::clx-port)
4 ()
5 (:documentation "Here to allow us to intercept clx events"))
6
7 (define-application-frame define-window-manager ()
8 ()
9 (:pointer-documentation t)
10 (:panes
11 (interactor :interactor)
12 (pointer-documentation :pointer-documentation))
13 (:layouts
14 (complete
15 (vertically ()
16 (:fill interactor)
17 pointer-documentation))
18 (interactor-only
19 interactor)
20 (documentation-only
21 pointer-documentation)
22 (hidden
23 ())))
24
25 (defmethod run-frame-toplevel ((frame define-window-manager))
26 (let* ((port (port frame))
27 (original-port-class (class-of port)))
28 (if (subtypep original-port-class 'clim-clx::clx-port)
29 (unwind-protect
30 (progn
31 (initialize-window-manager frame)
32 (call-next-method))
33 (uninitialize-window-manager frame original-port-class))
34 (error "DefWindowManager must be used with McCLIM-CLX!"))))
35
36 (defmethod port-class ((frame define-window-manager))
37 'define-window-manager-port)
38
39 (defmethod root-sheet-class ((frame define-window-manager) (window t))
40 'root-sheet)
41
42 (defmethod initialize-window-manager ((frame define-window-manager))
43 (change-class (port frame) (port-class frame))
44 (multiple-value-bind (children parent root-window)
45 (xlib:query-tree (clim-clx::clx-port-window (port frame)))
46 (declare (ignore parent))
47 (make-instance (root-sheet-class frame root-window) :frame frame :root-window root-window)
48 (setf (xlib:window-event-mask root-window)
49 (logior (xlib:window-event-mask root-window)
50 (xlib:make-event-mask :substructure-redirect :resize-redirect)))
51 (dolist (window children)
52 (manage-window window frame))))
53
54 (defmethod uninitialize-window-manager ((frame define-window-manager) original-port-class)
55 (change-class (port frame) original-port-class)
56 (multiple-value-bind (children parent root-window)
57 (xlib:query-tree (clim-clx::clx-port-window (port frame)))
58 (declare (ignore parent))
59 (setf (xlib:window-event-mask root-window)
60 (logandc2 (xlib:window-event-mask root-window)
61 (xlib:make-event-mask :substructure-redirect :resize-redirect)))
62 (dolist (window children)
63 (unmanage-window window frame))))
64
65 (defclass external-sheet (mute-repainting-mixin sheet-parent-mixin sheet-leaf-mixin mirrored-sheet-mixin sheet-translation-mixin basic-sheet)
66 ())
67
68 (defclass root-sheet (sheet-multiple-child-mixin mirrored-sheet-mixin basic-sheet)
69 ((frame :initarg :frame)
70 (root-window :initarg :root-window)))
71
72 ;; The standard entry point
73 (defun start ()
74 (run-frame-toplevel
75 (make-application-frame 'define-window-manager)))

  ViewVC Help
Powered by ViewVC 1.1.5