[clfswm-cvs] r85 - in clfswm: . src
pbrochard at common-lisp.net
pbrochard at common-lisp.net
Fri Apr 25 19:28:57 UTC 2008
Author: pbrochard
Date: Fri Apr 25 15:28:53 2008
New Revision: 85
Modified:
clfswm/ChangeLog
clfswm/src/bindings-second-mode.lisp
clfswm/src/clfswm-internal.lisp
clfswm/src/clfswm-layout.lisp
clfswm/src/clfswm-nw-hooks.lisp
clfswm/src/clfswm-pack.lisp
clfswm/src/clfswm-util.lisp
clfswm/src/clfswm.lisp
Log:
src/*.lisp: Rename all 'father' occurrences to 'parent'.
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Fri Apr 25 15:28:53 2008
@@ -1,5 +1,7 @@
2008-04-25 Philippe Brochard <pbrochard at common-lisp.net>
+ * src/*.lisp: Rename all 'father' occurrences to 'parent'.
+
* src/clfswm-nw-hooks.lisp
(open-in-new-frame-in-parent-frame-nw-hook): New new window hook.
Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp (original)
+++ clfswm/src/bindings-second-mode.lisp Fri Apr 25 15:28:53 2008
@@ -333,7 +333,7 @@
(defun sm-mouse-leave-frame (window root-x root-y)
- "Leave the selected frame - ie make its father the root frame"
+ "Leave the selected frame - ie make its parent the root frame"
(declare (ignore window root-x root-y))
(leave-frame))
Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp (original)
+++ clfswm/src/clfswm-internal.lisp Fri Apr 25 15:28:53 2008
@@ -28,38 +28,38 @@
;;; Conversion functions
;;; Float -> Pixel conversion
-(defun x-fl->px (x father)
+(defun x-fl->px (x parent)
"Convert float X coordinate to pixel"
- (round (+ (* x (frame-rw father)) (frame-rx father))))
+ (round (+ (* x (frame-rw parent)) (frame-rx parent))))
-(defun y-fl->px (y father)
+(defun y-fl->px (y parent)
"Convert float Y coordinate to pixel"
- (round (+ (* y (frame-rh father)) (frame-ry father))))
+ (round (+ (* y (frame-rh parent)) (frame-ry parent))))
-(defun w-fl->px (w father)
+(defun w-fl->px (w parent)
"Convert float Width coordinate to pixel"
- (round (* w (frame-rw father))))
+ (round (* w (frame-rw parent))))
-(defun h-fl->px (h father)
+(defun h-fl->px (h parent)
"Convert float Height coordinate to pixel"
- (round (* h (frame-rh father))))
+ (round (* h (frame-rh parent))))
;;; Pixel -> Float conversion
-(defun x-px->fl (x father)
+(defun x-px->fl (x parent)
"Convert pixel X coordinate to float"
- (/ (- x (frame-rx father)) (frame-rw father)))
+ (/ (- x (frame-rx parent)) (frame-rw parent)))
-(defun y-px->fl (y father)
+(defun y-px->fl (y parent)
"Convert pixel Y coordinate to float"
- (/ (- y (frame-ry father)) (frame-rh father)))
+ (/ (- y (frame-ry parent)) (frame-rh parent)))
-(defun w-px->fl (w father)
+(defun w-px->fl (w parent)
"Convert pixel Width coordinate to float"
- (/ w (frame-rw father)))
+ (/ w (frame-rw parent)))
-(defun h-px->fl (h father)
+(defun h-px->fl (h parent)
"Convert pixel Height coordinate to float"
- (/ h (frame-rh father)))
+ (/ h (frame-rh parent)))
@@ -220,31 +220,31 @@
-(defun add-frame (frame father)
- (push frame (frame-child father))
+(defun add-frame (frame parent)
+ (push frame (frame-child parent))
frame)
-(defun place-frame (frame father prx pry prw prh)
+(defun place-frame (frame parent prx pry prw prh)
"Place a frame from real (pixel) coordinates"
(with-slots (window x y w h) frame
(setf (xlib:drawable-x window) prx
(xlib:drawable-y window) pry
(xlib:drawable-width window) prw
(xlib:drawable-height window) prh
- x (x-px->fl prx father)
- y (y-px->fl pry father)
- w (w-px->fl prw father)
- h (h-px->fl prh father))))
+ x (x-px->fl prx parent)
+ y (y-px->fl pry parent)
+ w (w-px->fl prw parent)
+ h (h-px->fl prh parent))))
-(defun fixe-real-size (frame father)
+(defun fixe-real-size (frame parent)
"Fixe real (pixel) coordinates in float coordinates"
(when (frame-p frame)
(with-slots (x y w h rx ry rw rh) frame
- (setf x (x-px->fl rx father)
- y (y-px->fl ry father)
- w (w-px->fl rw father)
- h (h-px->fl rh father)))))
+ (setf x (x-px->fl rx parent)
+ y (y-px->fl ry parent)
+ w (w-px->fl rw parent)
+ h (h-px->fl rh parent)))))
(defun fixe-real-size-current-child ()
"Fixe real (pixel) coordinates in float coordinates for children in the current child"
@@ -264,11 +264,11 @@
-(defun find-father-frame (to-find &optional (root *root-frame*))
- "Return the father frame of to-find"
+(defun find-parent-frame (to-find &optional (root *root-frame*))
+ "Return the parent frame of to-find"
(with-all-frames (root frame)
(when (member to-find (frame-child frame))
- (return-from find-father-frame frame))))
+ (return-from find-parent-frame frame))))
@@ -353,22 +353,22 @@
-(defun get-father-layout (child father)
- (if (frame-p father)
- (aif (frame-layout father)
- (funcall it child father)
- (no-layout child father))
+(defun get-parent-layout (child parent)
+ (if (frame-p parent)
+ (aif (frame-layout parent)
+ (funcall it child parent)
+ (no-layout child parent))
(get-fullscreen-size)))
-(defgeneric adapt-child-to-father (child father))
+(defgeneric adapt-child-to-parent (child parent))
-(defmethod adapt-child-to-father ((window xlib:window) father)
+(defmethod adapt-child-to-parent ((window xlib:window) parent)
(with-xlib-protect
(if (eql (window-type window) :normal)
(multiple-value-bind (nx ny nw nh raise-p)
- (get-father-layout window father)
+ (get-parent-layout window parent)
(setf nw (max nw 1) nh (max nh 1))
(let ((change (or (/= (xlib:drawable-x window) nx)
(/= (xlib:drawable-y window) ny)
@@ -381,23 +381,23 @@
(values raise-p change)))
(values nil nil))))
-(defmethod adapt-child-to-father ((frame frame) father)
+(defmethod adapt-child-to-parent ((frame frame) parent)
(with-xlib-protect
- (multiple-value-bind (nx ny nw nh raise-p)
- (get-father-layout frame father)
- (with-slots (rx ry rw rh window) frame
- (setf rx nx ry ny
- rw (max nw 1)
- rh (max nh 1))
- (let ((change (or (/= (xlib:drawable-x window) rx)
- (/= (xlib:drawable-y window) ry)
- (/= (xlib:drawable-width window) rw)
- (/= (xlib:drawable-height window) rh))))
- (setf (xlib:drawable-x window) rx
- (xlib:drawable-y window) ry
- (xlib:drawable-width window) rw
- (xlib:drawable-height window) rh)
- (values raise-p change))))))
+ (multiple-value-bind (nx ny nw nh raise-p)
+ (get-parent-layout frame parent)
+ (with-slots (rx ry rw rh window) frame
+ (setf rx nx ry ny
+ rw (max nw 1)
+ rh (max nh 1))
+ (let ((change (or (/= (xlib:drawable-x window) rx)
+ (/= (xlib:drawable-y window) ry)
+ (/= (xlib:drawable-width window) rw)
+ (/= (xlib:drawable-height window) rh))))
+ (setf (xlib:drawable-x window) rx
+ (xlib:drawable-y window) ry
+ (xlib:drawable-width window) rw
+ (xlib:drawable-height window) rh)
+ (values raise-p change))))))
@@ -412,26 +412,26 @@
(defmethod show-child ((frame frame) raise-p first-p)
(with-xlib-protect
- (with-slots (window) frame
- (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)
- (display-frame-info frame)))))
+ (with-slots (window) frame
+ (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)
+ (display-frame-info frame)))))
(defmethod show-child ((window xlib:window) raise-p first-p)
(with-xlib-protect
- (xlib:map-window window)
- (raise-if-needed window raise-p first-p)))
+ (xlib:map-window window)
+ (raise-if-needed window raise-p first-p)))
(defgeneric hide-child (child))
(defmethod hide-child ((frame frame))
(with-xlib-protect
- (with-slots (window) frame
- (xlib:unmap-window window))))
+ (with-slots (window) frame
+ (xlib:unmap-window window))))
(defmethod hide-child ((window xlib:window))
(hide-window window))
@@ -445,18 +445,18 @@
(defmethod select-child ((frame frame) selected)
(with-xlib-protect
- (when (and (frame-p frame) (frame-window frame))
- (setf (xlib:window-border (frame-window frame))
- (get-color (cond ((equal selected :maybe) *color-maybe-selected*)
- ((equal selected nil) *color-unselected*)
- (selected *color-selected*)))))))
+ (when (and (frame-p frame) (frame-window frame))
+ (setf (xlib:window-border (frame-window frame))
+ (get-color (cond ((equal selected :maybe) *color-maybe-selected*)
+ ((equal selected nil) *color-unselected*)
+ (selected *color-selected*)))))))
(defmethod select-child ((window xlib:window) selected)
(with-xlib-protect
- (setf (xlib:window-border window)
- (get-color (cond ((equal selected :maybe) *color-maybe-selected*)
- ((equal selected nil) *color-unselected*)
- (selected *color-selected*))))))
+ (setf (xlib:window-border window)
+ (get-color (cond ((equal selected :maybe) *color-maybe-selected*)
+ ((equal selected nil) *color-unselected*)
+ (selected *color-selected*))))))
(defun select-current-frame (selected)
(select-child *current-child* selected))
@@ -483,18 +483,18 @@
"Show all children from *current-root*. Start the effective display
only for display-child and its children"
(let ((geometry-change nil))
- (labels ((rec (root father first-p first-father display-p)
+ (labels ((rec (root parent first-p first-parent display-p)
(multiple-value-bind (raise-p change)
- (adapt-child-to-father root father)
+ (adapt-child-to-parent root parent)
(when change (setf geometry-change change))
(when display-p
(show-child root raise-p first-p)))
(select-child root (if (equal root *current-child*) t
- (if (and first-p first-father) :maybe nil)))
+ (if (and first-p first-parent) :maybe nil)))
(when (frame-p root)
(let ((first-child (first (frame-child root))))
(dolist (child (reverse (frame-child root)))
- (rec child root (equal child first-child) (and first-p first-father)
+ (rec child root (equal child first-child) (and first-p first-parent)
(or display-p (equal root display-child))))))))
(rec *current-root* nil t t (equal display-child *current-root*))
(set-focus-to-current-child)
@@ -518,24 +518,24 @@
-(defun focus-child (child father)
+(defun focus-child (child parent)
"Focus child - Return true if something has change"
- (when (and (frame-p father)
- (member child (frame-child father)))
- (when (not (equal child (first (frame-child father))))
- (loop until (equal child (first (frame-child father)))
- do (setf (frame-child father) (rotate-list (frame-child father))))
+ (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)))
-(defun focus-child-rec (child father)
- "Focus child and its fathers - Return true if something has change"
+(defun focus-child-rec (child parent)
+ "Focus child and its parents - Return true if something has change"
(let ((change nil))
- (labels ((rec (child father)
- (when (focus-child child father)
+ (labels ((rec (child parent)
+ (when (focus-child child parent)
(setf change t))
- (when father
- (rec father (find-father-frame father)))))
- (rec child father))
+ (when parent
+ (rec parent (find-parent-frame parent)))))
+ (rec child parent))
change))
@@ -544,28 +544,28 @@
(setf *current-child* child)
t))
-(defgeneric set-current-child (child father window-father))
+(defgeneric set-current-child (child parent window-parent))
-(defmethod set-current-child ((child xlib:window) father window-father)
- (set-current-child-generic (if window-father father child)))
+(defmethod set-current-child ((child xlib:window) parent window-parent)
+ (set-current-child-generic (if window-parent parent child)))
-(defmethod set-current-child ((child frame) father window-father)
- (declare (ignore father window-father))
+(defmethod set-current-child ((child frame) parent window-parent)
+ (declare (ignore parent window-parent))
(set-current-child-generic child))
-(defun set-current-root (father)
- "Set current root if father is not in current root"
- (unless (find-child father *current-root*)
- (setf *current-root* father)))
+(defun set-current-root (parent)
+ "Set current root if parent is not in current root"
+ (unless (find-child parent *current-root*)
+ (setf *current-root* parent)))
-(defun focus-all-children (child father &optional (window-father t))
- "Focus child and its fathers -
-For window: set current child to window or its father according to window-father"
- (let ((new-focus (focus-child-rec child father))
- (new-current-child (set-current-child child father window-father))
- (new-root (set-current-root father)))
+(defun focus-all-children (child parent &optional (window-parent t))
+ "Focus child and its parents -
+For window: set current child to window or its parent according to window-parent"
+ (let ((new-focus (focus-child-rec child parent))
+ (new-current-child (set-current-child child parent window-parent))
+ (new-root (set-current-root parent)))
(or new-focus new-current-child new-root)))
@@ -580,9 +580,9 @@
(if frame-is-root?
(hide-all *current-root*)
(select-current-frame nil))
- (let ((father (find-father-frame *current-child*)))
- (when (frame-p father)
- (with-slots (child) father
+ (let ((parent (find-parent-frame *current-child*)))
+ (when (frame-p parent)
+ (with-slots (child) parent
(setf child (funcall fun-rotate child))
(setf *current-child* (first child)))))
(when frame-is-root?
@@ -604,15 +604,15 @@
(select-current-frame :maybe)
(when (frame-p *current-child*)
(awhen (first (frame-child *current-child*))
- (setf *current-child* it)))
+ (setf *current-child* it)))
(select-current-frame t))
(defun select-previous-level ()
"Select the previous level in frame"
(unless (equal *current-child* *current-root*)
(select-current-frame :maybe)
- (awhen (find-father-frame *current-child*)
- (setf *current-child* it))
+ (awhen (find-parent-frame *current-child*)
+ (setf *current-child* it))
(select-current-frame t)))
@@ -643,11 +643,11 @@
(show-all-children *current-root*))
(defun leave-frame ()
- "Leave the selected frame - ie make its father the root frame"
+ "Leave the selected frame - ie make its parent the root frame"
(hide-all *current-root*)
- (awhen (find-father-frame *current-root*)
- (when (frame-p it)
- (setf *current-root* it)))
+ (awhen (find-parent-frame *current-root*)
+ (when (frame-p it)
+ (setf *current-root* it)))
(show-all-children *current-root*))
@@ -691,7 +691,7 @@
(defun remove-child-in-all-frames (child)
"Remove child in all frames from *root-frame*"
(when (equal child *current-root*)
- (setf *current-root* (find-father-frame child)))
+ (setf *current-root* (find-parent-frame child)))
(when (equal child *current-child*)
(setf *current-child* *current-root*))
(remove-child-in-frames child *root-frame*))
Modified: clfswm/src/clfswm-layout.lisp
==============================================================================
--- clfswm/src/clfswm-layout.lisp (original)
+++ clfswm/src/clfswm-layout.lisp Fri Apr 25 15:28:53 2008
@@ -53,12 +53,12 @@
(setf (frame-layout *current-child*) layout)))
-(defun get-managed-child (father)
+(defun get-managed-child (parent)
"Return only window in normal mode who can be tiled"
- (when (frame-p father)
+ (when (frame-p parent)
(remove-if #'(lambda (x)
(and (xlib:window-p x) (not (eql (window-type x) :normal))))
- (frame-child father))))
+ (frame-child parent))))
@@ -90,22 +90,22 @@
;;; No layout
-(defgeneric no-layout (child father)
+(defgeneric no-layout (child parent)
(:documentation "Maximize windows in there frame - leave frame to there size (no layout)"))
-(defmethod no-layout ((child xlib:window) father)
- (with-slots (rx ry rw rh) father
+(defmethod no-layout ((child xlib:window) parent)
+ (with-slots (rx ry rw rh) parent
(values (1+ rx)
(1+ ry)
(- rw 2)
(- rh 2)
:first-only)))
-(defmethod no-layout ((child frame) father)
- (values (x-fl->px (frame-x child) father)
- (y-fl->px (frame-y child) father)
- (w-fl->px (frame-w child) father)
- (h-fl->px (frame-h child) father)
+(defmethod no-layout ((child frame) parent)
+ (values (x-fl->px (frame-x child) parent)
+ (y-fl->px (frame-y child) parent)
+ (w-fl->px (frame-w child) parent)
+ (h-fl->px (frame-h child) parent)
t))
@@ -120,18 +120,18 @@
;;; Tile layout
-(defgeneric tile-layout (child father)
+(defgeneric tile-layout (child parent)
(:documentation "Tile child in its frame"))
-(defmethod tile-layout (child father)
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-layout (child parent)
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (length managed-children))
(n (ceiling (sqrt len)))
- (dx (/ (frame-rw father) n))
- (dy (/ (frame-rh father) (ceiling (/ len n)))))
- (values (round (+ (frame-rx father) (truncate (* (mod pos n) dx)) 1))
- (round (+ (frame-ry father) (truncate (* (truncate (/ pos n)) dy)) 1))
+ (dx (/ (frame-rw parent) n))
+ (dy (/ (frame-rh parent) (ceiling (/ len n)))))
+ (values (round (+ (frame-rx parent) (truncate (* (mod pos n) dx)) 1))
+ (round (+ (frame-ry parent) (truncate (* (truncate (/ pos n)) dy)) 1))
(round (- dx 2))
(round (- dy 2))
t)))
@@ -144,27 +144,27 @@
;;; Tile Left
-(defgeneric tile-left-layout (child father)
+(defgeneric tile-left-layout (child parent)
(:documentation "Tile Left: main child on left and others on right"))
-(defmethod tile-left-layout (child father)
- (with-slots (rx ry rw rh) father
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-left-layout (child parent)
+ (with-slots (rx ry rw rh) parent
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (max (1- (length managed-children)) 1))
(dy (/ rh len))
- (size (or (frame-data-slot father :tile-size) 0.8)))
- (if (= pos 0)
- (values (1+ rx)
- (1+ ry)
- (- (round (* rw size)) 2)
- (- rh 2)
- t)
- (values (1+ (round (+ rx (* rw size))))
- (1+ (round (+ ry (* dy (1- pos)))))
- (- (round (* rw (- 1 size))) 2)
- (- (round dy) 2)
- t)))))
+ (size (or (frame-data-slot parent :tile-size) 0.8)))
+ (if (= pos 0)
+ (values (1+ rx)
+ (1+ ry)
+ (- (round (* rw size)) 2)
+ (- rh 2)
+ t)
+ (values (1+ (round (+ rx (* rw size))))
+ (1+ (round (+ ry (* dy (1- pos)))))
+ (- (round (* rw (- 1 size))) 2)
+ (- (round dy) 2)
+ t)))))
(defun set-tile-left-layout ()
@@ -177,16 +177,16 @@
;;; Tile right
-(defgeneric tile-right-layout (child father)
+(defgeneric tile-right-layout (child parent)
(:documentation "Tile Right: main child on right and others on left"))
-(defmethod tile-right-layout (child father)
- (with-slots (rx ry rw rh) father
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-right-layout (child parent)
+ (with-slots (rx ry rw rh) parent
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (max (1- (length managed-children)) 1))
(dy (/ rh len))
- (size (or (frame-data-slot father :tile-size) 0.8)))
+ (size (or (frame-data-slot parent :tile-size) 0.8)))
(if (= pos 0)
(values (1+ (round (+ rx (* rw (- 1 size)))))
(1+ ry)
@@ -212,27 +212,27 @@
;;; Tile Top
-(defgeneric tile-top-layout (child father)
+(defgeneric tile-top-layout (child parent)
(:documentation "Tile Top: main child on top and others on bottom"))
-(defmethod tile-top-layout (child father)
- (with-slots (rx ry rw rh) father
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-top-layout (child parent)
+ (with-slots (rx ry rw rh) parent
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (max (1- (length managed-children)) 1))
(dx (/ rw len))
- (size (or (frame-data-slot father :tile-size) 0.8)))
- (if (= pos 0)
- (values (1+ rx)
- (1+ ry)
- (- rw 2)
- (- (round (* rh size)) 2)
- t)
- (values (1+ (round (+ rx (* dx (1- pos)))))
- (1+ (round (+ ry (* rh size))))
- (- (round dx) 2)
- (- (round (* rh (- 1 size))) 2)
- t)))))
+ (size (or (frame-data-slot parent :tile-size) 0.8)))
+ (if (= pos 0)
+ (values (1+ rx)
+ (1+ ry)
+ (- rw 2)
+ (- (round (* rh size)) 2)
+ t)
+ (values (1+ (round (+ rx (* dx (1- pos)))))
+ (1+ (round (+ ry (* rh size))))
+ (- (round dx) 2)
+ (- (round (* rh (- 1 size))) 2)
+ t)))))
(defun set-tile-top-layout ()
@@ -245,16 +245,16 @@
;;; Tile Bottom
-(defgeneric tile-bottom-layout (child father)
+(defgeneric tile-bottom-layout (child parent)
(:documentation "Tile Bottom: main child on bottom and others on top"))
-(defmethod tile-bottom-layout (child father)
- (with-slots (rx ry rw rh) father
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-bottom-layout (child parent)
+ (with-slots (rx ry rw rh) parent
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (max (1- (length managed-children)) 1))
(dx (/ rw len))
- (size (or (frame-data-slot father :tile-size) 0.8)))
+ (size (or (frame-data-slot parent :tile-size) 0.8)))
(if (= pos 0)
(values (1+ rx)
(1+ (round (+ ry (* rh (- 1 size)))))
@@ -282,18 +282,18 @@
;;; Space layout
-(defgeneric tile-space-layout (child father)
+(defgeneric tile-space-layout (child parent)
(:documentation "Tile Space: tile child in its frame leaving spaces between them"))
-(defmethod tile-space-layout (child father)
- (with-slots (rx ry rw rh) father
- (let* ((managed-children (get-managed-child father))
+(defmethod tile-space-layout (child parent)
+ (with-slots (rx ry rw rh) parent
+ (let* ((managed-children (get-managed-child parent))
(pos (position child managed-children))
(len (length managed-children))
(n (ceiling (sqrt len)))
(dx (/ rw n))
(dy (/ rh (ceiling (/ len n))))
- (size (or (frame-data-slot father :tile-space-size) 0.1)))
+ (size (or (frame-data-slot parent :tile-space-size) 0.1)))
(when (> size 0.5) (setf size 0.45))
(values (round (+ rx (truncate (* (mod pos n) dx)) (* dx size) 1))
(round (+ ry (truncate (* (truncate (/ pos n)) dy)) (* dy size) 1))
Modified: clfswm/src/clfswm-nw-hooks.lisp
==============================================================================
--- clfswm/src/clfswm-nw-hooks.lisp (original)
+++ clfswm/src/clfswm-nw-hooks.lisp Fri Apr 25 15:28:53 2008
@@ -41,7 +41,7 @@
(defun set-nw-hook (hook)
"Set the hook of the current child"
(let ((frame (if (xlib:window-p *current-child*)
- (find-father-frame *current-child*)
+ (find-parent-frame *current-child*)
*current-child*)))
(setf (frame-nw-hook frame) hook)
(leave-second-mode)))
@@ -52,7 +52,7 @@
(defun default-window-placement (frame window)
(case (window-type window)
- (:normal (adapt-child-to-father window frame))
+ (:normal (adapt-child-to-parent window frame))
(t (place-window-from-hints window))))
(defun leave-if-not-frame (child)
@@ -137,7 +137,7 @@
(defun open-in-new-frame-in-parent-frame-nw-hook (frame window)
"Open the next window in a new frame in the parent frame"
(let ((new-frame (create-frame))
- (parent (find-father-frame frame)))
+ (parent (find-parent-frame frame)))
(when parent
(pushnew new-frame (frame-child parent))
(pushnew window (frame-child new-frame))
Modified: clfswm/src/clfswm-pack.lisp
==============================================================================
--- clfswm/src/clfswm-pack.lisp (original)
+++ clfswm/src/clfswm-pack.lisp Fri Apr 25 15:28:53 2008
@@ -35,9 +35,9 @@
(+ (frame-y frame) (frame-h frame)))
-(defun find-edge-up (current-frame father)
+(defun find-edge-up (current-frame parent)
(let ((y-found 0))
- (dolist (frame (frame-child father))
+ (dolist (frame (frame-child parent))
(when (and (frame-p frame)
(not (equal frame current-frame))
(<= (frame-y2 frame) (frame-y current-frame))
@@ -46,9 +46,9 @@
(setf y-found (max y-found (frame-y2 frame)))))
y-found))
-(defun find-edge-down (current-frame father)
+(defun find-edge-down (current-frame parent)
(let ((y-found 1))
- (dolist (frame (frame-child father))
+ (dolist (frame (frame-child parent))
(when (and (frame-p frame)
(not (equal frame current-frame))
(>= (frame-y frame) (frame-y2 current-frame))
@@ -57,9 +57,9 @@
(setf y-found (min y-found (frame-y frame)))))
y-found))
-(defun find-edge-right (current-frame father)
+(defun find-edge-right (current-frame parent)
(let ((x-found 1))
- (dolist (frame (frame-child father))
+ (dolist (frame (frame-child parent))
(when (and (frame-p frame)
(not (equal frame current-frame))
(>= (frame-x frame) (frame-x2 current-frame))
@@ -69,9 +69,9 @@
x-found))
-(defun find-edge-left (current-frame father)
+(defun find-edge-left (current-frame parent)
(let ((x-found 0))
- (dolist (frame (frame-child father))
+ (dolist (frame (frame-child parent))
(when (and (frame-p frame)
(not (equal frame current-frame))
(<= (frame-x2 frame) (frame-x current-frame))
@@ -85,26 +85,26 @@
;;;,-----
;;;| Pack functions
;;;`-----
-(defun pack-frame-up (frame father)
+(defun pack-frame-up (frame parent)
"Pack frame to up"
- (let ((y-found (find-edge-up frame father)))
+ (let ((y-found (find-edge-up frame parent)))
(setf (frame-y frame) y-found)))
-(defun pack-frame-down (frame father)
+(defun pack-frame-down (frame parent)
"Pack frame to down"
- (let ((y-found (find-edge-down frame father)))
+ (let ((y-found (find-edge-down frame parent)))
(setf (frame-y frame) (- y-found (frame-h frame)))))
-(defun pack-frame-right (frame father)
+(defun pack-frame-right (frame parent)
"Pack frame to right"
- (let ((x-found (find-edge-right frame father)))
+ (let ((x-found (find-edge-right frame parent)))
(setf (frame-x frame) (- x-found (frame-w frame)))))
-(defun pack-frame-left (frame father)
+(defun pack-frame-left (frame parent)
"Pack frame to left"
- (let ((x-found (find-edge-left frame father)))
+ (let ((x-found (find-edge-left frame parent)))
(setf (frame-x frame) x-found)))
@@ -117,30 +117,30 @@
;;;,-----
;;;| Fill functions
;;;`-----
-(defun fill-frame-up (frame father)
+(defun fill-frame-up (frame parent)
"Fill a frame up"
- (let* ((y-found (find-edge-up frame father))
+ (let* ((y-found (find-edge-up frame parent))
(dy (- (frame-y frame) y-found)))
(setf (frame-y frame) y-found
(frame-h frame) (+ (frame-h frame) dy))))
-(defun fill-frame-down (frame father)
+(defun fill-frame-down (frame parent)
"Fill a frame down"
- (let* ((y-found (find-edge-down frame father))
+ (let* ((y-found (find-edge-down frame parent))
(dy (- y-found (frame-y2 frame))))
(setf (frame-h frame) (+ (frame-h frame) dy))))
-(defun fill-frame-left (frame father)
+(defun fill-frame-left (frame parent)
"Fill a frame left"
- (let* ((x-found (find-edge-left frame father))
+ (let* ((x-found (find-edge-left frame parent))
(dx (- (frame-x frame) x-found)))
(setf (frame-x frame) x-found
(frame-w frame) (+ (frame-w frame) dx))))
-(defun fill-frame-right (frame father)
+(defun fill-frame-right (frame parent)
"Fill a frame rigth"
- (let* ((x-found (find-edge-right frame father))
+ (let* ((x-found (find-edge-right frame parent))
(dx (- x-found (frame-x2 frame))))
(setf (frame-w frame) (+ (frame-w frame) dx))))
Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp (original)
+++ clfswm/src/clfswm-util.lisp Fri Apr 25 15:28:53 2008
@@ -102,7 +102,7 @@
(when (and window (not (xlib:window-equal window *no-focus-window*)))
(setf *current-child* *current-root*)
(hide-child window)
- (remove-child-in-frame window (find-father-frame window))
+ (remove-child-in-frame window (find-parent-frame window))
(show-all-children))))
@@ -166,14 +166,14 @@
"Cut the current child to the selection"
(copy-current-child)
(hide-all *current-child*)
- (remove-child-in-frame *current-child* (find-father-frame *current-child* *current-root*))
+ (remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*))
(setf *current-child* *current-root*)
(show-all-children))
(defun remove-current-child ()
- "Remove the current child from its father frame"
+ "Remove the current child from its parent frame"
(hide-all *current-child*)
- (remove-child-in-frame *current-child* (find-father-frame *current-child* *current-root*))
+ (remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*))
(setf *current-child* *current-root*)
(leave-second-mode))
@@ -181,7 +181,7 @@
(defun paste-selection-no-clear ()
"Paste the selection in the current frame - Do not clear the selection after paste"
(let ((frame-dest (typecase *current-child*
- (xlib:window (find-father-frame *current-child* *current-root*))
+ (xlib:window (find-parent-frame *current-child* *current-root*))
(frame *current-child*))))
(when frame-dest
(dolist (child *child-selection*)
@@ -335,9 +335,9 @@
(defun focus-frame-by (frame)
(when (frame-p frame)
(hide-all *current-root*)
- (focus-all-children frame (or (find-father-frame frame *current-root*)
- (find-father-frame frame)
- *root-frame*))
+ (focus-all-children frame (or (find-parent-frame frame *current-root*)
+ (find-parent-frame frame)
+ *root-frame*))
(show-all-children *current-root*)))
@@ -379,7 +379,7 @@
(setf *current-root* *root-frame*))
(when (equal frame *current-child*)
(setf *current-child* *current-root*))
- (remove-child-in-frame frame (find-father-frame frame)))
+ (remove-child-in-frame frame (find-parent-frame frame)))
(show-all-children *current-root*))
@@ -398,7 +398,7 @@
(defun move-current-child-by (child frame-dest)
(when (and child (frame-p frame-dest))
(hide-all *current-root*)
- (remove-child-in-frame child (find-father-frame child))
+ (remove-child-in-frame child (find-parent-frame child))
(pushnew child (frame-child frame-dest))
(focus-all-children child frame-dest)
(show-all-children *current-root*)))
@@ -448,22 +448,22 @@
(defun force-window-in-frame ()
"Force the current window to move in the frame (Useful only for transient windows)"
(when (xlib:window-p *current-child*)
- (let ((father (find-father-frame *current-child*)))
+ (let ((parent (find-parent-frame *current-child*)))
(with-xlib-protect
- (setf (xlib:drawable-x *current-child*) (frame-rx father)
- (xlib:drawable-y *current-child*) (frame-ry father)))))
+ (setf (xlib:drawable-x *current-child*) (frame-rx parent)
+ (xlib:drawable-y *current-child*) (frame-ry parent)))))
(leave-second-mode))
(defun force-window-center-in-frame ()
"Force the current window to move in the center of the frame (Useful only for transient windows)"
(when (xlib:window-p *current-child*)
- (let ((father (find-father-frame *current-child*)))
+ (let ((parent (find-parent-frame *current-child*)))
(with-xlib-protect
- (setf (xlib:drawable-x *current-child*) (truncate (+ (frame-rx father)
- (/ (- (frame-rw father)
+ (setf (xlib:drawable-x *current-child*) (truncate (+ (frame-rx parent)
+ (/ (- (frame-rw parent)
(xlib:drawable-width *current-child*)) 2)))
- (xlib:drawable-y *current-child*) (truncate (+ (frame-ry father)
- (/ (- (frame-rh father)
+ (xlib:drawable-y *current-child*) (truncate (+ (frame-ry parent)
+ (/ (- (frame-rh parent)
(xlib:drawable-height *current-child*)) 2)))))))
(leave-second-mode))
@@ -496,7 +496,7 @@
;;; Mouse utilities
-(defun move-frame (frame father orig-x orig-y)
+(defun move-frame (frame parent orig-x orig-y)
(hide-all-children frame)
(with-slots (window) frame
(raise-window window)
@@ -528,11 +528,11 @@
do (with-xlib-protect
(xlib:display-finish-output *display*)
(xlib:process-event *display* :handler #'handle-event))))
- (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) father)
- (frame-y frame) (y-px->fl (xlib:drawable-y window) father))))))
+ (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent)
+ (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))))))
-(defun resize-frame (frame father orig-x orig-y)
+(defun resize-frame (frame parent orig-x orig-y)
(hide-all-children frame)
(with-slots (window) frame
(raise-window window)
@@ -569,34 +569,34 @@
do (with-xlib-protect
(xlib:display-finish-output *display*)
(xlib:process-event *display* :handler #'handle-event))))
- (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) father)
- (frame-h frame) (h-px->fl (xlib:drawable-height window) father))))))
+ (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent)
+ (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))))))
(defun mouse-click-to-focus-generic (window root-x root-y mouse-fn)
- "Focus the current frame or focus the current window father
+ "Focus the current frame or focus the current window parent
mouse-fun is #'move-frame or #'resize-frame"
(let ((to-replay t)
(child window)
- (father (find-father-frame window *current-root*))
+ (parent (find-parent-frame window *current-root*))
(root-p (or (equal window *root*)
(equal window (frame-window *current-root*)))))
(when (or (not root-p) *create-frame-on-root*)
- (unless father
+ (unless parent
(if root-p
(progn
(setf child (create-frame)
- father *current-root*
+ parent *current-root*
mouse-fn #'resize-frame)
- (place-frame child father root-x root-y 10 10)
+ (place-frame child parent root-x root-y 10 10)
(xlib:map-window (frame-window child))
(pushnew child (frame-child *current-root*)))
(setf child (find-frame-window window *current-root*)
- father (find-father-frame child *current-root*)))
+ parent (find-parent-frame child *current-root*)))
(when child
- (funcall mouse-fn child father root-x root-y)))
- (when (and child father (focus-all-children child father))
+ (funcall mouse-fn child parent root-x root-y)))
+ (when (and child parent (focus-all-children child parent))
(when (show-all-children)
(setf to-replay nil))))
(if to-replay
@@ -604,34 +604,34 @@
(stop-button-event))))
(defun mouse-click-to-focus-and-move (window root-x root-y)
- "Move and focus the current frame or focus the current window father"
+ "Move and focus the current frame or focus the current window parent"
(mouse-click-to-focus-generic window root-x root-y #'move-frame))
(defun mouse-click-to-focus-and-resize (window root-x root-y)
- "Resize and focus the current frame or focus the current window father"
+ "Resize and focus the current frame or focus the current window parent"
(mouse-click-to-focus-generic window root-x root-y #'resize-frame))
-(defun mouse-focus-move/resize-generic (root-x root-y mouse-fn window-father)
- "Focus the current frame or focus the current window father
+(defun mouse-focus-move/resize-generic (root-x root-y mouse-fn window-parent)
+ "Focus the current frame or focus the current window parent
mouse-fun is #'move-frame or #'resize-frame.
-Focus child and its fathers -
-For window: set current child to window or its father according to window-father"
+Focus child and its parents -
+For window: set current child to window or its parent according to window-parent"
(let* ((child (find-child-under-mouse root-x root-y))
- (father (find-father-frame child)))
+ (parent (find-parent-frame child)))
(when (equal child *current-root*)
(setf child (create-frame)
- father *current-root*
+ parent *current-root*
mouse-fn #'resize-frame)
- (place-frame child father root-x root-y 10 10)
- (xlib:map-window (frame-window child))
- (pushnew child (frame-child *current-root*)))
+ (place-frame child parent root-x root-y 10 10)
+ (xlib:map-window (frame-window child))
+ (pushnew child (frame-child *current-root*)))
(typecase child
- (xlib:window (funcall mouse-fn father (find-father-frame father) root-x root-y))
- (frame (funcall mouse-fn child father root-x root-y)))
- (focus-all-children child father window-father)
+ (xlib:window (funcall mouse-fn parent (find-parent-frame parent) root-x root-y))
+ (frame (funcall mouse-fn child parent root-x root-y)))
+ (focus-all-children child parent window-parent)
(show-all-children)))
@@ -674,7 +674,7 @@
(defun mouse-leave-frame (window root-x root-y)
- "Leave the selected frame - ie make its father the root frame"
+ "Leave the selected frame - ie make its parent the root frame"
(declare (ignore root-x root-y))
(let ((frame (find-frame-window window)))
(when (or frame (xlib:window-equal window *root*))
@@ -732,10 +732,10 @@
("BackSpace" remove-binding-on-slot
,(format nil "Remove slot ~A binding on child: ~A" n (child-fullname *current-child*)))
(" - " nil " -")
- ("Tab" jump-to-slot
- ,(format nil "Jump to child: ~A" (aif (aref key-slots current-slot)
- (child-fullname it)
- "Not set - Please, bind it with Return"))))
+ ("Tab" jump-to-slot
+ ,(format nil "Jump to child: ~A" (aif (aref key-slots current-slot)
+ (child-fullname it)
+ "Not set - Please, bind it with Return"))))
(list default-bind))))))
@@ -754,19 +754,19 @@
;;; Pack
(defun current-frame-pack-up ()
"Pack the current frame up"
- (with-movement (pack-frame-up *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (pack-frame-up *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-pack-down ()
"Pack the current frame down"
- (with-movement (pack-frame-down *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (pack-frame-down *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-pack-left ()
"Pack the current frame left"
- (with-movement (pack-frame-left *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (pack-frame-left *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-pack-right ()
"Pack the current frame right"
- (with-movement (pack-frame-right *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (pack-frame-right *current-child* (find-parent-frame *current-child* *current-root*))))
;;; Center
(defun center-current-frame ()
@@ -776,42 +776,42 @@
;;; Fill
(defun current-frame-fill-up ()
"Fill the current frame up"
- (with-movement (fill-frame-up *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (fill-frame-up *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-fill-down ()
"Fill the current frame down"
- (with-movement (fill-frame-down *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (fill-frame-down *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-fill-left ()
"Fill the current frame left"
- (with-movement (fill-frame-left *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (fill-frame-left *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-fill-right ()
"Fill the current frame right"
- (with-movement (fill-frame-right *current-child* (find-father-frame *current-child* *current-root*))))
+ (with-movement (fill-frame-right *current-child* (find-parent-frame *current-child* *current-root*))))
(defun current-frame-fill-all-dir ()
"Fill the current frame in all directions"
(with-movement
- (let ((father (find-father-frame *current-child* *current-root*)))
- (fill-frame-up *current-child* father)
- (fill-frame-down *current-child* father)
- (fill-frame-left *current-child* father)
- (fill-frame-right *current-child* father))))
+ (let ((parent (find-parent-frame *current-child* *current-root*)))
+ (fill-frame-up *current-child* parent)
+ (fill-frame-down *current-child* parent)
+ (fill-frame-left *current-child* parent)
+ (fill-frame-right *current-child* parent))))
(defun current-frame-fill-vertical ()
"Fill the current frame vertically"
(with-movement
- (let ((father (find-father-frame *current-child* *current-root*)))
- (fill-frame-up *current-child* father)
- (fill-frame-down *current-child* father))))
+ (let ((parent (find-parent-frame *current-child* *current-root*)))
+ (fill-frame-up *current-child* parent)
+ (fill-frame-down *current-child* parent))))
(defun current-frame-fill-horizontal ()
"Fill the current frame horizontally"
(with-movement
- (let ((father (find-father-frame *current-child* *current-root*)))
- (fill-frame-left *current-child* father)
- (fill-frame-right *current-child* father))))
+ (let ((parent (find-parent-frame *current-child* *current-root*)))
+ (fill-frame-left *current-child* parent)
+ (fill-frame-right *current-child* parent))))
;;; Resize
@@ -854,7 +854,7 @@
(setf (frame-rw *current-child*) min-width))
(when (and height-p min-height)
(setf (frame-rh *current-child*) min-height))
- (fixe-real-size *current-child* (find-father-frame *current-child*))
+ (fixe-real-size *current-child* (find-parent-frame *current-child*))
(leave-second-mode))))))
(defun adapt-current-frame-to-window-hints ()
Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp (original)
+++ clfswm/src/clfswm.lisp Fri Apr 25 15:28:53 2008
@@ -67,18 +67,18 @@
(when (has-h value-mask) (setf (xlib:drawable-height window) height))
(when (has-w value-mask) (setf (xlib:drawable-width window) width))))
(with-xlib-protect
- (xlib:with-state (window)
- (when (has-bw value-mask)
- (setf (xlib:drawable-border-width window) border-width))
- (if (find-child window *current-root*)
- (case (window-type window)
- (:normal (adapt-child-to-father window (find-father-frame window *current-root*))
- (send-configuration-notify window))
- (t (adjust-from-request)))
- (adjust-from-request))
- (when (has-stackmode value-mask)
- (case stack-mode
- (:above (raise-window window))))))))
+ (xlib:with-state (window)
+ (when (has-bw value-mask)
+ (setf (xlib:drawable-border-width window) border-width))
+ (if (find-child window *current-root*)
+ (case (window-type window)
+ (:normal (adapt-child-to-parent window (find-parent-frame window *current-root*))
+ (send-configuration-notify window))
+ (t (adjust-from-request)))
+ (adjust-from-request))
+ (when (has-stackmode value-mask)
+ (case stack-mode
+ (:above (raise-window window))))))))
@@ -156,21 +156,21 @@
(declare (ignore display))
;;(dbg event-key)
(with-xlib-protect
- (case event-key
- (:button-press (call-hook *button-press-hook* event-slots))
- (:button-release (call-hook *button-release-hook* event-slots))
- (:motion-notify (call-hook *motion-notify-hook* event-slots))
- (:key-press (call-hook *key-press-hook* event-slots))
- (:configure-request (call-hook *configure-request-hook* event-slots))
- (:configure-notify (call-hook *configure-notify-hook* event-slots))
- (:map-request (call-hook *map-request-hook* event-slots))
- (:unmap-notify (call-hook *unmap-notify-hook* event-slots))
- (:destroy-notify (call-hook *destroy-notify-hook* event-slots))
- (:mapping-notify (call-hook *mapping-notify-hook* event-slots))
- (:property-notify (call-hook *property-notify-hook* event-slots))
- (:create-notify (call-hook *create-notify-hook* event-slots))
- (:enter-notify (call-hook *enter-notify-hook* event-slots))
- (:exposure (call-hook *exposure-hook* event-slots))))
+ (case event-key
+ (:button-press (call-hook *button-press-hook* event-slots))
+ (:button-release (call-hook *button-release-hook* event-slots))
+ (:motion-notify (call-hook *motion-notify-hook* event-slots))
+ (:key-press (call-hook *key-press-hook* event-slots))
+ (:configure-request (call-hook *configure-request-hook* event-slots))
+ (:configure-notify (call-hook *configure-notify-hook* event-slots))
+ (:map-request (call-hook *map-request-hook* event-slots))
+ (:unmap-notify (call-hook *unmap-notify-hook* event-slots))
+ (:destroy-notify (call-hook *destroy-notify-hook* event-slots))
+ (:mapping-notify (call-hook *mapping-notify-hook* event-slots))
+ (:property-notify (call-hook *property-notify-hook* event-slots))
+ (:create-notify (call-hook *create-notify-hook* event-slots))
+ (:enter-notify (call-hook *enter-notify-hook* event-slots))
+ (:exposure (call-hook *exposure-hook* event-slots))))
t)
More information about the clfswm-cvs
mailing list