*never-managed-window-list*: Structure change to be more flexible. Let the choice...
[clfswm.git] / src / package.lisp
blob3e8dcfa4fcbe32cb6eb4b3288d028198a6633642
1 ;;; --------------------------------------------------------------------------
2 ;;; CLFSWM - FullScreen Window Manager
3 ;;;
4 ;;; --------------------------------------------------------------------------
5 ;;; Documentation: Package definition
6 ;;; --------------------------------------------------------------------------
7 ;;;
8 ;;; (C) 2010 Philippe Brochard <hocwp@free.fr>
9 ;;;
10 ;;; This program is free software; you can redistribute it and/or modify
11 ;;; it under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or
13 ;;; (at your option) any later version.
14 ;;;
15 ;;; This program is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with this program; if not, write to the Free Software
22 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 ;;;
24 ;;; --------------------------------------------------------------------------
26 (in-package :cl-user)
28 (defpackage clfswm
29 (:use :common-lisp :my-html :tools :version)
30 ;; (:shadow :defun)
31 (:export :main
32 :reload-clfswm
33 :reset-clfswm
34 :exit-clfswm))
38 (in-package :clfswm)
42 ;;; Compress motion notify ?
43 ;;; Note: this variable is overwriten in config.lisp
44 (defparameter *have-to-compress-notify* t
45 "Config(): Compress event notify?
46 This variable may be useful to speed up some slow version of CLX.
47 It is particulary useful with CLISP/MIT-CLX.")
49 (defparameter *modifier-alias* '((:alt :mod-1) (:alt-l :mod-1)
50 (:numlock :mod-2)
51 (:super_l :mod-4)
52 (:alt-r :mod-5) (:alt-gr :mod-5)
53 (:capslock :lock))
54 "Syntax: (modifier-alias effective-modifier)")
57 (defparameter *display* nil)
58 (defparameter *screen* nil)
59 (defparameter *root* nil)
60 (defparameter *no-focus-window* nil)
62 (defparameter *loop-timeout* 0.1
63 "Config(): Maximum time (in seconds) to wait before calling *loop-hook*")
65 (defparameter *pixmap-buffer* nil)
67 (defparameter *contrib-dir* "")
69 (defparameter *default-font* nil)
70 ;;(defparameter *default-font-string* "9x15")
71 (defparameter *default-font-string* "fixed"
72 "Config(): The default font used in clfswm")
75 (defparameter *child-selection* nil)
77 ;;; CONFIG - Default frame datas
78 (defparameter *default-frame-data*
79 (list '(:tile-size 0.8) '(:tile-space-size 0.1)
80 '(:fast-layout (tile-left-layout tile-layout))
81 '(:main-layout-windows nil))
82 "Config(): Default slots set in frame date")
85 ;;; CONFIG - Default managed window type for a frame
86 ;;; type can be :all, :normal, :transient, :maxsize, :desktop, :dock, :toolbar, :menu, :utility, :splash, :dialog
87 (defparameter *default-managed-type* '(:normal)
88 "Config(): Default managed window types")
89 ;;(defparameter *default-managed-type* '(:normal :maxsize :transient))
90 ;;(defparameter *default-managed-type* '(:normal :transient :maxsize :desktop :dock :toolbar :menu :utility :splash :dialog))
91 ;;(defparameter *default-managed-type* '())
92 ;;(defparameter *default-managed-type* '(:all))
95 ;;; CONFIG - Default focus policy
96 (defparameter *default-focus-policy* :click
97 "Config(): Default mouse focus policy. One of :click, :sloppy, :sloppy-strict or :sloppy-select.")
100 (defclass frame ()
101 ((name :initarg :name :accessor frame-name :initform nil)
102 (number :initarg :number :accessor frame-number :initform 0)
103 ;;; Float size between 0 and 1 - Manipulate only this variable and not real size
104 (x :initarg :x :accessor frame-x :initform 0.1)
105 (y :initarg :y :accessor frame-y :initform 0.1)
106 (w :initarg :w :accessor frame-w :initform 0.8)
107 (h :initarg :h :accessor frame-h :initform 0.8)
108 ;;; Real size (integer) in screen size - Don't set directly this variables
109 ;;; they may be recalculated by the layout manager.
110 (rx :initarg :rx :accessor frame-rx :initform 0)
111 (ry :initarg :ry :accessor frame-ry :initform 0)
112 (rw :initarg :rw :accessor frame-rw :initform 800)
113 (rh :initarg :rh :accessor frame-rh :initform 600)
114 (layout :initarg :layout :accessor frame-layout :initform nil
115 :documentation "Layout to display windows on a frame")
116 (nw-hook :initarg :nw-hook :accessor frame-nw-hook :initform nil
117 :documentation "Hook done by the frame when a new window is mapped")
118 (managed-type :initarg :managed-type :accessor frame-managed-type
119 :initform *default-managed-type*
120 :documentation "Managed window type")
121 (forced-managed-window :initarg :forced-managed-window
122 :accessor frame-forced-managed-window
123 :initform nil
124 :documentation "A list of forced managed windows (wm-name or window)")
125 (forced-unmanaged-window :initarg :forced-unmanaged-window
126 :accessor frame-forced-unmanaged-window
127 :initform nil
128 :documentation "A list of forced unmanaged windows (wm-name or window)")
129 (show-window-p :initarg :show-window-p :accessor frame-show-window-p :initform t)
130 (hidden-children :initarg :hidden-children :accessor frame-hidden-children :initform nil
131 :documentation "A list of hidden children")
132 (selected-pos :initarg :selected-pos :accessor frame-selected-pos :initform 0
133 :documentation "The position in the child list of the selected child")
134 (focus-policy :initarg :focus-ploicy :accessor frame-focus-policy
135 :initform *default-focus-policy*)
136 (window :initarg :window :accessor frame-window :initform nil)
137 (gc :initarg :gc :accessor frame-gc :initform nil)
138 (child :initarg :child :accessor frame-child :initform nil)
139 (data :initarg :data :accessor frame-data
140 :initform *default-frame-data*
141 :documentation "An assoc list to store additional data")))
145 (defparameter *root-frame* nil
146 "Root of the root - ie the root frame")
147 (defparameter *current-root* nil
148 "The current fullscreen maximized child")
149 (defparameter *current-child* nil
150 "The current child with the focus")
152 (defparameter *show-root-frame-p* nil)
155 (defparameter *main-keys* nil)
156 (defparameter *main-mouse* nil)
157 (defparameter *second-keys* nil)
158 (defparameter *second-mouse* nil)
159 (defparameter *info-keys* nil)
160 (defparameter *info-mouse* nil)
161 (defparameter *query-keys* nil)
162 (defparameter *circulate-keys* nil)
163 (defparameter *circulate-keys-release* nil)
164 (defparameter *expose-keys* nil)
165 (defparameter *expose-mouse* nil)
168 (defparameter *other-window-manager* nil)
171 (defstruct menu name item doc)
172 (defstruct menu-item key value)
175 (defparameter *menu* (make-menu :name 'main :doc "Main menu"))
180 (defparameter *binding-hook* nil
181 "Config(Hook group): Hook executed when keys/buttons are bounds")
183 (defparameter *loop-hook* nil
184 "Config(Hook group): Hook executed on each event loop")
186 (defparameter *main-entrance-hook* nil
187 "Config(Hook group): Hook executed on the main function entrance after
188 loading configuration file and before opening the display.")
191 (defparameter *in-second-mode* nil)
194 ;;; Placement variables. A list of two absolute coordinates
195 ;;; or a function: 'Y-X-placement' for absolute placement or
196 ;;; 'Y-X-child-placement' for child relative placement.
197 ;;; Where Y-X are one of:
199 ;;; top-left top-middle top-right
200 ;;; middle-left middle-middle middle-right
201 ;;; bottom-left bottom-middle bottom-right
203 (defparameter *banish-pointer-placement* 'bottom-right-placement
204 "Config(Placement group): Pointer banishment placement")
205 (defparameter *second-mode-placement* 'top-middle-placement
206 "Config(Placement group): Second mode window placement")
207 (defparameter *info-mode-placement* 'top-left-placement
208 "Config(Placement group): Info mode window placement")
209 (defparameter *query-mode-placement* 'top-left-placement
210 "Config(Placement group): Query mode window placement")
211 (defparameter *circulate-mode-placement* 'bottom-middle-placement
212 "Config(Placement group): Circulate mode window placement")
213 (defparameter *expose-mode-placement* 'top-left-child-placement
214 "Config(Placement group): Expose mode window placement (Selection keys position)")
215 (defparameter *notify-window-placement* 'bottom-right-placement
216 "Config(Placement group): Notify window placement")
220 (defparameter *in-process-existing-windows* nil)
222 ;; For debug - redefine defun
223 ;;(shadow :defun)
225 ;;(defmacro defun (name args &body body)
226 ;; `(progn
227 ;; (format t "defun: ~A ~A~%" ',name ',args)
228 ;; (force-output)
229 ;; (cl:defun ,name ,args
230 ;; (handler-case
231 ;; (progn
232 ;; ,@body)
233 ;; (error (c)
234 ;; (format t "New defun: Error in ~A : ~A~%" ',name c)
235 ;; (format t "Root tree=~A~%All windows=~A~%"
236 ;; (xlib:query-tree *root*) (get-all-windows))
237 ;; (force-output))))))