[clfswm-cvs] r330 - in clfswm: . src

Philippe Brochard pbrochard at common-lisp.net
Sat Sep 25 19:40:58 UTC 2010


Author: pbrochard
Date: Sat Sep 25 15:40:58 2010
New Revision: 330

Log:
src/xlib-util.lisp (with-handle-event-symbol): Use a filled list with handle-event-fun symbols instead of inspecting clfswm internals symbols on each mode change.

Modified:
   clfswm/ChangeLog
   clfswm/src/bindings-second-mode.lisp
   clfswm/src/bindings.lisp
   clfswm/src/clfswm-expose-mode.lisp
   clfswm/src/clfswm.lisp
   clfswm/src/xlib-util.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sat Sep 25 15:40:58 2010
@@ -1,5 +1,9 @@
 2010-09-25  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/xlib-util.lisp (with-handle-event-symbol): Use a filled list
+	with handle-event-fun symbols instead of inspecting clfswm
+	internals symbols on each mode change.
+
 	* src/clfswm-expose-mode.lisp: Move and rename present*-windows in
 	a separate clfswm-expose-mode.lisp file.
 

Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp	(original)
+++ clfswm/src/bindings-second-mode.lisp	Sat Sep 25 15:40:58 2010
@@ -148,8 +148,8 @@
   (define-second-key ("F10" :shift) 'show-all-frames-info-key)
   (define-second-key ("F10" :shift :mod-1) 'show-all-frames-info)
   (define-second-key ("F10" :shift :control) 'toggle-show-root-frame)
-  (define-second-key ("F10") 'expose-windows)
-  (define-second-key ("F10" :control) 'expose-all-windows)
+  (define-second-key ("F10") 'expose-windows-mode)
+  (define-second-key ("F10" :control) 'expose-all-windows-mode)
   ;; Bind or jump functions
   (define-second-key ("1" :mod-1) 'bind-or-jump 1)
   (define-second-key ("2" :mod-1) 'bind-or-jump 2)

Modified: clfswm/src/bindings.lisp
==============================================================================
--- clfswm/src/bindings.lisp	(original)
+++ clfswm/src/bindings.lisp	Sat Sep 25 15:40:58 2010
@@ -62,8 +62,8 @@
   (define-main-key ("F10" :shift) 'show-all-frames-info-key)
   (define-main-key ("F10" :shift :mod-1) 'show-all-frames-info)
   (define-main-key ("F10" :shift :control) 'toggle-show-root-frame)
-  (define-main-key ("F10") 'expose-windows)
-  (define-main-key ("F10" :control) 'expose-all-windows)
+  (define-main-key ("F10") 'expose-windows-mode)
+  (define-main-key ("F10" :control) 'expose-all-windows-mode)
   (define-main-key (#\b :mod-1) 'banish-pointer)
   ;; Escape
   (define-main-key ("Escape" :control) 'ask-close/kill-current-window)

Modified: clfswm/src/clfswm-expose-mode.lisp
==============================================================================
--- clfswm/src/clfswm-expose-mode.lisp	(original)
+++ clfswm/src/clfswm-expose-mode.lisp	Sat Sep 25 15:40:58 2010
@@ -45,12 +45,12 @@
   (show-all-children *current-root*)
   t)
 
-(defun expose-windows ()
+(defun expose-windows-mode ()
   "Present all windows in the current frame (An expose like)"
   (stop-button-event)
   (expose-windows-generic *current-root* nil))
 
-(defun expose-all-windows ()
+(defun expose-all-windows-mode ()
   "Present all windows in all frames (An expose like)"
   (stop-button-event)
   (switch-to-root-frame :show-later t)

Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp	(original)
+++ clfswm/src/clfswm.lisp	Sat Sep 25 15:40:58 2010
@@ -169,6 +169,7 @@
 
 
 (defun init-display ()
+  (fill-handle-event-fun-symbols)
   (assoc-keyword-handle-event 'main-mode)
   (setf *screen* (first (xlib:display-roots *display*))
 	*root* (xlib:screen-root *screen*)

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Sat Sep 25 15:40:58 2010
@@ -101,11 +101,19 @@
 	  (values (intern (string-upcase (subseq name (+ pos-mod 5))) :keyword)
 		  (subseq name (length "handle-event-fun-") (1- pos-mod))))))))
 
+(defparameter *handle-event-fun-symbols* nil)
+
+(defun fill-handle-event-fun-symbols ()
+  (with-all-internal-symbols (symbol :clfswm)
+    (let ((pos (symbol-search "handle-event-fun-" symbol)))
+      (when (and pos (zerop pos))
+	(pushnew symbol *handle-event-fun-symbols*)))))
+
 
 (defmacro with-handle-event-symbol ((mode) &body body)
   "Bind symbol to all handle event functions available in mode"
   `(let ((pattern (format nil "handle-event-fun-~A" ,mode)))
-     (with-all-internal-symbols (symbol :clfswm)
+     (dolist (symbol *handle-event-fun-symbols*)
        (let ((pos (symbol-search pattern symbol)))
 	 (when (and pos (zerop pos))
 	   , at body)))))




More information about the clfswm-cvs mailing list