[clfswm-cvs] r141 - in clfswm: . doc src

pbrochard at common-lisp.net pbrochard at common-lisp.net
Tue Jun 3 21:20:55 UTC 2008


Author: pbrochard
Date: Tue Jun  3 17:20:53 2008
New Revision: 141

Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/doc/keys.html
   clfswm/doc/keys.txt
   clfswm/doc/menu.html
   clfswm/doc/menu.txt
   clfswm/src/bindings.lisp
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-util.lisp
   clfswm/src/package.lisp
   clfswm/src/xlib-util.lisp
Log:
frame-lower-child, frame-raise-child: New functions to raise/lower a child in its frame.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Tue Jun  3 17:20:53 2008
@@ -1,5 +1,9 @@
 2008-06-03  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-internal.lisp (frame-lower-child)
+	(frame-raise-child): New functions to raise/lower a child in its
+	frame.
+
 	* src/clfswm-util.lisp (have-to-present-windows)
 	(have-to-present-all-windows): New functions to have an MaxOS
 	expose like on mouse click in screen corner.

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Tue Jun  3 17:20:53 2008
@@ -9,8 +9,6 @@
 
 - Use conpressed motion events for clisp. [Philippe]
 
-- Raise/lower child - this can be done with children order [Philippe]
-
 - Show config -> list and display documentation for all tweakable global variables. [Philippe]
 
 - A Gimp layout example [Philippe]

Modified: clfswm/doc/keys.html
==============================================================================
--- clfswm/doc/keys.html	(original)
+++ clfswm/doc/keys.html	Tue Jun  3 17:20:53 2008
@@ -145,6 +145,28 @@
            Mod-1 
         </td>
         <td align="center" nowrap>
+          Page_up
+        </td>
+        <td style="color:#0000ff" nowrap>
+          Lower the child in the current frame
+        </td>
+      </tr>
+      <tr>
+        <td align="right" style="color:#ff0000" nowrap>
+           Mod-1 
+        </td>
+        <td align="center" nowrap>
+          Page_down
+        </td>
+        <td style="color:#0000ff" nowrap>
+          Raise the child in the current frame
+        </td>
+      </tr>
+      <tr>
+        <td align="right" style="color:#ff0000" nowrap>
+           Mod-1 
+        </td>
+        <td align="center" nowrap>
           Home
         </td>
         <td style="color:#0000ff" nowrap>
@@ -408,7 +430,9 @@
           1
         </td>
         <td style="color:#0000ff" nowrap>
-          Move and focus the current frame or focus the current window parent
+          Move and focus the current frame or focus the current window parent.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
         </td>
       </tr>
       <tr>
@@ -419,7 +443,9 @@
           3
         </td>
         <td style="color:#0000ff" nowrap>
-          Resize and focus the current frame or focus the current window parent
+          Resize and focus the current frame or focus the current window parent.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
         </td>
       </tr>
       <tr>
@@ -1192,7 +1218,9 @@
           1
         </td>
         <td style="color:#0000ff" nowrap>
-          Move and focus the current child - Create a new frame on the root window
+          Move and focus the current child - Create a new frame on the root window.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
         </td>
       </tr>
       <tr>
@@ -1203,7 +1231,9 @@
           3
         </td>
         <td style="color:#0000ff" nowrap>
-          Resize and focus the current child - Create a new frame on the root window
+          Resize and focus the current child - Create a new frame on the root window.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
         </td>
       </tr>
       <tr>

Modified: clfswm/doc/keys.txt
==============================================================================
--- clfswm/doc/keys.txt	(original)
+++ clfswm/doc/keys.txt	Tue Jun  3 17:20:53 2008
@@ -16,6 +16,8 @@
 Mod-1 Shift          Tab             Select the previous child
 Mod-1                Return          Enter in the selected frame - ie make it the root frame
 Mod-1 Shift          Return          Leave the selected frame - ie make its parent the root frame
+Mod-1                Page_up         Lower the child in the current frame
+Mod-1                Page_down       Raise the child in the current frame
 Mod-1                Home            Switch to the root frame
 Mod-1 Shift          Home            Switch and select the root frame
                      Menu            Show all frames info windows until a key is release
@@ -43,8 +45,12 @@
 Mouse buttons actions in main mode:
 ----------------------------------
 
-                     1               Move and focus the current frame or focus the current window parent
-                     3               Resize and focus the current frame or focus the current window parent
+                     1               Move and focus the current frame or focus the current window parent.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
+                     3               Resize and focus the current frame or focus the current window parent.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
 Mod-1                1               Move and focus the current child - Create a new frame on the root window
 Mod-1                3               Resize and focus the current child - Create a new frame on the root window
 Mod-1 Control        1               Move the window under the mouse cursor to another frame
@@ -121,8 +127,12 @@
 Mouse buttons actions in second mode:
 ------------------------------------
 
-                     1               Move and focus the current child - Create a new frame on the root window
-                     3               Resize and focus the current child - Create a new frame on the root window
+                     1               Move and focus the current child - Create a new frame on the root window.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
+                     3               Resize and focus the current child - Create a new frame on the root window.
+On *present-windows-corner*: Present windows in the current root.
+On *present-all-windows-corner*: Present all windows in all frames.
 Mod-1                1               Move and focus the current child - Create a new frame on the root window
 Mod-1                3               Resize and focus the current child - Create a new frame on the root window
 Mod-1 Control        1               Move the window under the mouse cursor to another frame

Modified: clfswm/doc/menu.html
==============================================================================
--- clfswm/doc/menu.html	(original)
+++ clfswm/doc/menu.html	Tue Jun  3 17:20:53 2008
@@ -18,6 +18,9 @@
       <a name="MAIN"></a><a href="#Top">Main</a>
     </h3>
     <p>
+      c: <a href="#CHILD-MENU">< Child menu ></a>
+    </p>
+    <p>
       f: <a href="#FRAME-MENU">< Frame menu ></a>
     </p>
     <p>
@@ -37,6 +40,31 @@
     </p>
     <hr>
     <h3>
+      <a name="CHILD-MENU"></a><a href="#MAIN">Child-Menu</a>
+    </h3>
+    <p>
+      r: Rename the current child
+    </p>
+    <p>
+      x: Remove the current child from the CLFSWM tree
+    </p>
+    <p>
+      Delete: Remove the current child from its parent frame
+    </p>
+    <p>
+      h: Hide the current child
+    </p>
+    <p>
+      u: Unhide a child in the current frame
+    </p>
+    <p>
+      f: Unhide a child from all frames in the current frame
+    </p>
+    <p>
+      a: Unhide all current frame hidden children
+    </p>
+    <hr>
+    <h3>
       <a name="FRAME-MENU"></a><a href="#MAIN">Frame-Menu</a>
     </h3>
     <p>
@@ -58,16 +86,7 @@
       w: <a href="#MANAGED-WINDOW-MENU">< Managed window type menu ></a>
     </p>
     <p>
-      i: <a href="#FRAME-INFO-MENU">< Frame info menu ></a>
-    </p>
-    <p>
-      r: Rename the current child
-    </p>
-    <p>
-      u: Renumber the current frame
-    </p>
-    <p>
-      x: Create a new frame for each window in frame
+      s: <a href="#FRAME-MISCELLANEOUS-MENU">< Frame miscallenous menu ></a>
     </p>
     <hr>
     <h3>
@@ -254,13 +273,25 @@
     </p>
     <hr>
     <h3>
-      <a name="FRAME-INFO-MENU"></a><a href="#FRAME-MENU">Frame-Info-Menu</a>
+      <a name="FRAME-MISCELLANEOUS-MENU"></a><a href="#FRAME-MENU">Frame-Miscellaneous-Menu</a>
     </h3>
     <p>
       s: Show all frames info windows
     </p>
     <p>
-      h: Hide all frames info windows
+      i: Hide all frames info windows
+    </p>
+    <p>
+      h: Hide the current frame window
+    </p>
+    <p>
+      w: Show the current frame window
+    </p>
+    <p>
+      u: Renumber the current frame
+    </p>
+    <p>
+      x: Create a new frame for each window in frame
     </p>
     <hr>
     <h3>

Modified: clfswm/doc/menu.txt
==============================================================================
--- clfswm/doc/menu.txt	(original)
+++ clfswm/doc/menu.txt	Tue Jun  3 17:20:53 2008
@@ -2,6 +2,7 @@
 (By default it is bound on second-mode + m)
 
 Main
+c: < Child menu >
 f: < Frame menu >
 w: < Window menu >
 s: < Selection menu >
@@ -9,6 +10,15 @@
 u: < Action by number menu >
 y: < Utility menu >
 
+Child-Menu
+r: Rename the current child
+x: Remove the current child from the CLFSWM tree
+Delete: Remove the current child from its parent frame
+h: Hide the current child
+u: Unhide a child in the current frame
+f: Unhide a child from all frames in the current frame
+a: Unhide all current frame hidden children
+
 Frame-Menu
 a: < Adding frame menu >
 l: < Frame layout menu >
@@ -16,10 +26,7 @@
 n: < Frame new window hook menu >
 m: < Frame movement menu >
 w: < Managed window type menu >
-i: < Frame info menu >
-r: Rename the current child
-u: Renumber the current frame
-x: Create a new frame for each window in frame
+s: < Frame miscallenous menu >
 
 Frame-Adding-Menu
 a: Add a default frame in the current frame
@@ -88,9 +95,13 @@
 n: Manage only normal window type
 u: Do not manage any window type
 
-Frame-Info-Menu
+Frame-Miscellaneous-Menu
 s: Show all frames info windows
-h: Hide all frames info windows
+i: Hide all frames info windows
+h: Hide the current frame window
+w: Show the current frame window
+u: Renumber the current frame
+x: Create a new frame for each window in frame
 
 Window-Menu
 i: Display information on the current window

Modified: clfswm/src/bindings.lisp
==============================================================================
--- clfswm/src/bindings.lisp	(original)
+++ clfswm/src/bindings.lisp	Tue Jun  3 17:20:53 2008
@@ -51,6 +51,10 @@
 (define-main-key ("Return" :mod-1) 'enter-frame)
 (define-main-key ("Return" :mod-1 :shift) 'leave-frame)
 
+(define-main-key ("Page_Up" :mod-1) 'frame-lower-child)
+(define-main-key ("Page_Down" :mod-1) 'frame-raise-child)
+
+
 (define-main-key ("Home" :mod-1) 'switch-to-root-frame)
 (define-main-key ("Home" :mod-1 :shift) 'switch-and-select-root-frame)
 

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Tue Jun  3 17:20:53 2008
@@ -77,6 +77,19 @@
 
 
 
+
+
+(defun frame-selected-child (frame)
+  (when (frame-p frame)
+    (with-slots (child selected-pos) frame
+      (let ((len (length child)))
+	(cond ((minusp selected-pos) (setf selected-pos 0))
+	      ((>= selected-pos len) (setf selected-pos (max (1- len) 0)))))
+      (nth selected-pos child))))
+
+
+
+
 ;;; Frame data manipulation functions
 (defun frame-data-slot (frame slot)
   "Return the value associated to data slot"
@@ -446,14 +459,14 @@
 
 
 
-(defun raise-if-needed (window raise-p first-p)
+(defun raise-if-needed (window raise-p selected-p)
   (when (or (eql raise-p t)
-	    (and (eql raise-p :first-only) first-p))
+	    (and (eql raise-p :first-only) selected-p))
     (raise-window window)))
 
-(defgeneric show-child (child parent display-p raise-p first-p))
+(defgeneric show-child (child parent display-p raise-p selected-p))
 
-(defmethod show-child ((frame frame) parent display-p raise-p first-p)
+(defmethod show-child ((frame frame) parent display-p raise-p selected-p)
   (declare (ignore parent))
   (with-xlib-protect
     (with-slots (window show-window-p) frame
@@ -462,22 +475,22 @@
 	    (when (or *show-root-frame-p* (not (equal frame *current-root*)))
 	      (setf (xlib:window-background window) (get-color "Black"))
 	      (xlib:map-window window)
-	      (raise-if-needed window raise-p first-p)))
+	      (raise-if-needed window raise-p selected-p)))
 	  (hide-window window)))
     (display-frame-info frame)))
 
 
-(defmethod show-child ((window xlib:window) parent display-p raise-p first-p)
+(defmethod show-child ((window xlib:window) parent display-p raise-p selected-p)
   (with-xlib-protect
     (if (or (managed-window-p window parent)
 	    (equal parent *current-child*))
 	(when display-p
 	  (xlib:map-window window)
-	  (raise-if-needed window raise-p first-p))
+	  (raise-if-needed window raise-p selected-p))
 	(hide-window window))))
 
-(defmethod show-child (child parent display-p raise-p first-p)
-  (declare (ignore child parent display-p raise-p first-p))
+(defmethod show-child (child parent display-p raise-p selected-p)
+  (declare (ignore child parent display-p raise-p selected-p))
   ())
 
 
@@ -532,7 +545,7 @@
   (labels ((rec (child)
 	     (typecase child
 	       (xlib:window (focus-window child))
-	       (frame (rec (first (frame-child child)))))))
+	       (frame (rec (frame-selected-child child))))))
     (no-focus)
     (rec *current-child*)))
 
@@ -544,17 +557,17 @@
   "Show all children from *current-root*. Start the effective display
 only for display-child and its children"
   (let ((geometry-change nil))
-    (labels ((rec (root parent first-p first-parent display-p)
+    (labels ((rec (root parent selected-p selected-parent-p display-p)
 	       (multiple-value-bind (raise-p change)
 		   (adapt-child-to-parent root parent)
 		 (when change (setf geometry-change change))
-		 (show-child root parent display-p raise-p first-p))
+		 (show-child root parent display-p raise-p selected-p))
 	       (select-child root (if (equal root *current-child*) t
-				      (if (and first-p first-parent) :maybe nil)))
+				      (if (and selected-p selected-parent-p) :maybe nil)))
 	       (when (frame-p root)
-		 (let ((first-child (first (frame-child root))))
+		 (let ((selected-child (frame-selected-child root)))
 		   (dolist (child (reverse (frame-child root)))
-		     (rec child root (equal child first-child) (and first-p first-parent)
+		     (rec child root (equal child selected-child) (and selected-p selected-parent-p)
 			  (or display-p (equal root display-child))))))))
       (rec *current-root* nil t t (equal display-child *current-root*))
       (set-focus-to-current-child)
@@ -582,10 +595,10 @@
   "Focus child - Return true if something has change"
   (when (and (frame-p parent)
 	     (member child (frame-child parent)))
-    (when (not (equal child (first (frame-child parent))))
-      (loop until (equal child (first (frame-child parent)))
-	 do (setf (frame-child parent) (rotate-list (frame-child parent))))
-      t)))
+      (when (not (equal child (frame-selected-child parent)))
+	(loop until (equal child (frame-selected-child parent))
+	   do (setf (frame-child parent) (rotate-list (frame-child parent))))
+	t)))
 
 (defun focus-child-rec (child parent)
   "Focus child and its parents - Return true if something has change"
@@ -648,7 +661,7 @@
       (when (frame-p parent)
 	(with-slots (child) parent
 	  (setf child (funcall fun-rotate child))
-	  (setf *current-child* (first child)))))
+	  (setf *current-child* (frame-selected-child parent)))))
     (when frame-is-root?
       (setf *current-root* *current-child*))
     (show-all-children *current-root*)))
@@ -667,7 +680,7 @@
   "Select the next level in frame"
   (select-current-frame :maybe)
   (when (frame-p *current-child*)
-    (awhen (first (frame-child *current-child*))
+    (awhen (frame-selected-child *current-child*)
       (setf *current-child* it)))
   (show-all-children))
 
@@ -715,6 +728,32 @@
   (show-all-children *current-root*))
 
 
+
+
+(defun frame-lower-child ()
+  "Lower the child in the current frame"
+  (when (frame-p *current-child*)
+    (with-slots (child selected-pos) *current-child*
+      (unless (>= selected-pos (length child))
+	(when (nth (1+ selected-pos) child)
+	  (rotatef (nth selected-pos child)
+		   (nth (1+ selected-pos) child)))
+	(incf selected-pos)))
+    (show-all-children)))
+
+
+(defun frame-raise-child ()
+  "Raise the child in the current frame"
+  (when (frame-p *current-child*)
+    (with-slots (child selected-pos) *current-child*
+      (unless (< selected-pos 1)
+	(when (nth (1- selected-pos) child)
+	  (rotatef (nth selected-pos child)
+		   (nth (1- selected-pos) child)))
+	(decf selected-pos)))
+    (show-all-children)))
+
+
 (defun switch-to-root-frame (&key (show-later nil))
   "Switch to the root frame"
   (hide-all *current-root*)

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Tue Jun  3 17:20:53 2008
@@ -899,7 +899,7 @@
 (defun get-current-window ()
   (typecase *current-child*
     (xlib:window  *current-child*)
-    (frame (first (frame-child *current-child*)))))
+    (frame (frame-selected-child *current-child*))))
 
 (defmacro with-current-window (&body body)
   "Bind 'window' to the current window"

Modified: clfswm/src/package.lisp
==============================================================================
--- clfswm/src/package.lisp	(original)
+++ clfswm/src/package.lisp	Tue Jun  3 17:20:53 2008
@@ -102,8 +102,8 @@
    (show-window-p :initarg :show-window-p :accessor frame-show-window-p :initform t)
    (hidden-children :initarg :hidden-children :accessor frame-hidden-children :initform nil
 		    :documentation "A list of hidden children")
-   (n-focused-child :initarg :n-focused-child :accessor frame-n-focused-child :initform 0
-		    :documentation "A number to choose which child to focus")
+   (selected-pos :initarg :selected-pos :accessor frame-selected-pos :initform 0
+		 :documentation "The position in the child list of the selected child")
    (window :initarg :window :accessor frame-window :initform nil)
    (gc :initarg :gc :accessor frame-gc :initform nil)
    (child :initarg :child :accessor frame-child :initform nil)

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Tue Jun  3 17:20:53 2008
@@ -340,7 +340,6 @@
   "Give the window focus."
   (when window
     (with-xlib-protect
-      (raise-window window)
       (xlib:set-input-focus *display* window :parent))))
 
 



More information about the clfswm-cvs mailing list