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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Thu May 1 20:16:50 UTC 2008


Author: pbrochard
Date: Thu May  1 16:16:48 2008
New Revision: 108

Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/src/clfswm-info.lisp
   clfswm/src/clfswm-internal.lisp
Log:
Add boundaries in the info mode window.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Thu May  1 16:16:48 2008
@@ -1,5 +1,7 @@
 2008-05-01  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-info.lisp (info-mode): Add boundaries in the info mode window.
+
 	* src/menu-def.lisp: New file: move all menu definition in
 	menu-def.lisp.
 

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Thu May  1 16:16:48 2008
@@ -7,12 +7,9 @@
 ===============
 Should handle these soon.
 
-- Produce the autodoc menu for Frame layout menu, Frame layout menu (Set only once)
-  and Frame new window hook menu
-
 - Ensure-unique-number/name (new function) [Philippe]
 
-- Add boundaries in the info window [Philippe]
+- Double buffering for all text windows. [Philippe]
 
 
 MAYBE
@@ -46,8 +43,6 @@
 
 - Undo/redo (any idea to implement this is welcome)
 
-- Double buffering for all text windows.
-
 - Raise/lower frame - this can be done with children order [Philippe]
 
 - Show config -> list and display documentation for all tweakable global variables. [Philippe]

Modified: clfswm/src/clfswm-info.lisp
==============================================================================
--- clfswm/src/clfswm-info.lisp	(original)
+++ clfswm/src/clfswm-info.lisp	Thu May  1 16:16:48 2008
@@ -25,7 +25,7 @@
 
 (in-package :clfswm)
 
-(defstruct info window gc font list ilw ilh x y)
+(defstruct info window gc font list ilw ilh x y max-x max-y)
 
 
 (defun leave-info-mode (info)
@@ -94,25 +94,25 @@
 (define-info-key ("Down")
     (defun info-next-line (info)
       "Move one line down"
-      (incf (info-y info) (info-ilh info))
+      (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info)))
       (draw-info-window info)))
 
 (define-info-key ("Up")
     (defun info-previous-line (info)
       "Move one line up"
-      (decf (info-y info) (info-ilh info))
+      (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0))
       (draw-info-window info)))
 
 (define-info-key ("Left")
     (defun info-previous-char (info)
       "Move one char left"
-      (decf (info-x info) (info-ilw info))
+      (setf (info-x info) (max (- (info-x info) (info-ilw info)) 0))
       (draw-info-window info)))
 
 (define-info-key ("Right")
     (defun info-next-char (info)
       "Move one char right"
-      (incf (info-x info) (info-ilw info))
+      (setf (info-x info) (min (+ (info-x info) (info-ilw info)) (info-max-x info)))
       (draw-info-window info)))
 
 
@@ -153,15 +153,15 @@
 (defun info-begin-grab (window root-x root-y info)
   "Begin grab text"
   (declare (ignore window))
-  (setf *info-start-grab-x* (+ root-x (info-x info))
-	*info-start-grab-y* (+ root-y (info-y info)))
+  (setf *info-start-grab-x* (min (max (+ root-x (info-x info)) 0) (info-max-x info))
+	*info-start-grab-y* (min (max (+ root-y (info-y info)) 0) (info-max-y info)))
   (draw-info-window info))
 
 (defun info-end-grab (window root-x root-y info)
   "End grab"
   (declare (ignore window))
-  (setf (info-x info) (- *info-start-grab-x* root-x)
-	(info-y info) (- *info-start-grab-y* root-y)
+  (setf (info-x info) (min (max (- *info-start-grab-x* root-x) 0) (info-max-x info))
+	(info-y info) (min (max (- *info-start-grab-y* root-y) 0) (info-max-y info))
 	*info-start-grab-x* nil
 	*info-start-grab-y* nil)
   (draw-info-window info))
@@ -183,8 +183,8 @@
   "Grab text"
   (declare (ignore window))
   (when (and *info-start-grab-x* *info-start-grab-y*)
-    (setf (info-x info) (- *info-start-grab-x* root-x)
-	  (info-y info) (- *info-start-grab-y* root-y))
+    (setf (info-x info) (min (max (- *info-start-grab-x* root-x) 0) (info-max-x info))
+	  (info-y info) (min (max (- *info-start-grab-y* root-y) 0) (info-max-y info)))
     (draw-info-window-partial info)))
 
 
@@ -229,7 +229,9 @@
 				     :font font
 				     :line-style :solid))
 	   (info (make-info :window window :gc gc :x 0 :y 0 :list info-list
-							    :font font :ilw ilw :ilh ilh)))
+							    :font font :ilw ilw :ilh ilh
+							    :max-x (* (loop for l in info-list maximize (length l)) ilw)
+							    :max-y (* (length info-list) ilh))))
       (labels ((handle-key (&rest event-slots &key root code state &allow-other-keys)
 		 (declare (ignore event-slots root))
 		 (funcall-key-from-code *info-keys* code state info))

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Thu May  1 16:16:48 2008
@@ -363,7 +363,7 @@
 							 (aif (frame-name child) it "")))))))))
 	(dolist (ch child)
 	  (when (xlib:window-p ch)
-	    (xlib:draw-glyphs window gc 5 (incf pos dy) (ensure-printable (xlib:wm-name ch)))))))))
+	    (xlib:draw-image-glyphs window gc 5 (incf pos dy) (ensure-printable (xlib:wm-name ch)))))))))
 
 
 



More information about the clfswm-cvs mailing list