[sawfish] new move-cursor commands for moving diagonally



commit ca7eb1843fdd498e81695eb8e69e70faf0bde07c
Author: chrisb <zanghar freenet de>
Date:   Fri Jul 3 18:28:45 2009 +0200

    new move-cursor commands for moving diagonally

 ChangeLog                               |    8 ++++
 lisp/sawfish/wm/autoload.jl             |    9 ++++
 lisp/sawfish/wm/commands/move-cursor.jl |   67 ++++++++++++++++++++++++++++--
 man/news.texi                           |   19 +++++++++
 man/sawfish.texi                        |    8 ++++
 5 files changed, 106 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d77cf08..145caaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,14 @@
 	* lisp/sawfish/gtk/color-preview.jl: use GtkColorButton instead of
 	GtkPreview (for rep-gtk 0.90.0)
 
+	* lisp/sawfish/wm/commands/move-cursor.jl: added 4 new move-cursor
+	command for moving diagonally (move-cursor -northwest, -northeast,
+	southwest, southeast)
+
+	* man/sawfish.texi: updated doc for new move-cursor-commands
+
+	* man/news.texi: added 1.6.0 section, updated
+
 2009-07-02  Christopher Bratusek <zanghar freenet de>
 	* po/*
 	* configure.in: de-intltoolize sawfish ... is breaking current
diff --git a/lisp/sawfish/wm/autoload.jl b/lisp/sawfish/wm/autoload.jl
index ce43a6f..cbcc1fc 100644
--- a/lisp/sawfish/wm/autoload.jl
+++ b/lisp/sawfish/wm/autoload.jl
@@ -94,6 +94,15 @@
 (autoload-command (quote move-cursor-left-fine) (quote sawfish.wm.commands.move-cursor))
 (autoload-command (quote move-cursor-up-fine) (quote sawfish.wm.commands.move-cursor))
 (autoload-command (quote move-cursor-down-fine) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-northwest) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-northeast) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-southwest) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-southeast) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-northwest-fine) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-northeast-fine) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-southwest-fine) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-southeast-fine) (quote sawfish.wm.commands.move-cursor))
+(autoload-command (quote move-cursor-center) (quote sawfish.wm.commands.move-cursor))
 (autoload-command (quote move-window-interactively) (quote sawfish.wm.commands.move-resize))
 (autoload-command (quote resize-window-interactively) (quote sawfish.wm.commands.move-resize))
 (autoload-command (quote move-selected-window) (quote sawfish.wm.commands.move-resize))
diff --git a/lisp/sawfish/wm/commands/move-cursor.jl b/lisp/sawfish/wm/commands/move-cursor.jl
index 9d7ee26..e65a8a5 100644
--- a/lisp/sawfish/wm/commands/move-cursor.jl
+++ b/lisp/sawfish/wm/commands/move-cursor.jl
@@ -29,13 +29,23 @@
             move-cursor-left
             move-cursor-right
             move-cursor-up
-            move-cursor-down)
+            move-cursor-down
+	    move-cursor-northwest
+	    move-cursor-northeast
+	    move-cursor-southwest
+	    move-cursor-southeast
+            move-cursor-northwest-fine
+	    move-cursor-northeast-fine
+	    move-cursor-southwest-fine
+	    move-cursor-southeast-fine
+            move-cursor-center)
 
     (open rep
 	  sawfish.wm.misc
 	  sawfish.wm.events
 	  sawfish.wm.custom
-	  sawfish.wm.commands)
+	  sawfish.wm.commands
+          sawfish.wm.gaol)
 
   (defcustom move-cursor-increment 16
     "Number of pixels to move pointer in."
@@ -43,8 +53,9 @@
     :type (number 1))
 
   (define (move-cursor right down)
-    (let ((coords (query-pointer)))
-      (warp-cursor (+ (car coords) right) (+ (cdr coords) down))))
+     (let ((coords (query-pointer)))
+       (setq dontmove t)
+         (warp-cursor (+ (car coords) right) (+ (cdr coords) down))))
 
   (define (move-cursor-left)
     "Move the cursor `move-cursor-increment' pixels to the left."
@@ -62,6 +73,22 @@
     "Move the cursor `move-cursor-increment' pixels downwards."
     (move-cursor 0 move-cursor-increment))
 
+  (define (move-cursor-northwest)
+    "Move the cursor `move-cursor-increment' pixels northwest"
+    (move-cursor (- move-cursor-increment) (- move-cursor-increment)))
+
+  (define (move-cursor-northeast)
+    "Move the cursor `move-cursor-increment' pixels northeast"
+    (move-cursor move-cursor-increment (- move-cursor-increment)))
+
+  (define (move-cursor-southwest)
+    "Move the cursor `move-cursor-increment' pixels southwest"
+    (move-cursor (- move-cursor-increment) move-cursor-increment))
+
+  (define (move-cursor-southeast)
+    "Move the cursor `move-cursor-increment' pixels southeast"
+    (move-cursor move-cursor-increment move-cursor-increment))
+
   (define (move-cursor-left-fine)
     "Move the cursor 1 pixel to the left."
     (move-cursor -1 0))
@@ -78,6 +105,26 @@
     "Move the cursor 1 pixel downwards."
     (move-cursor 0 1))
 
+  (define (move-cursor-northwest-fine)
+    "Move the cursor `move-cursor-increment' pixels northwest"
+    (move-cursor -1 -1))
+
+  (define (move-cursor-northeast-fine)
+    "Move the cursor `move-cursor-increment' pixels northeast"
+    (move-cursor 1 -1))
+
+  (define (move-cursor-southwest-fine)
+    "Move the cursor `move-cursor-increment' pixels southwest"
+    (move-cursor -1 1))
+
+  (define (move-cursor-southeast-fine)
+    "Move the cursor `move-cursor-increment' pixels southeast"
+    (move-cursor 1 1))
+
+  (define (move-cursor-center)
+    "Move the cursor to the center of the screen"
+    (warp-cursor (/ (screen-width) 2) (/ (screen-height) 2)))
+
   ;;###autoload
   (define-command 'move-cursor-right move-cursor-right)
   (define-command 'move-cursor-left move-cursor-left)
@@ -86,4 +133,14 @@
   (define-command 'move-cursor-right-fine move-cursor-right-fine)
   (define-command 'move-cursor-left-fine move-cursor-left-fine)
   (define-command 'move-cursor-up-fine move-cursor-up-fine)
-  (define-command 'move-cursor-down-fine move-cursor-down-fine))
+  (define-command 'move-cursor-down-fine move-cursor-down-fine)
+  (define-command 'move-cursor-northwest move-cursor-northwest)
+  (define-command 'move-cursor-northeast move-cursor-northeast)
+  (define-command 'move-cursor-southwest move-cursor-southwest)
+  (define-command 'move-cursor-southeast move-cursor-southeast)
+  (define-command 'move-cursor-down-fine move-cursor-down-fine)
+  (define-command 'move-cursor-northwest-fine move-cursor-northwest-fine)
+  (define-command 'move-cursor-northeast-fine move-cursor-northeast-fine)
+  (define-command 'move-cursor-southwest-fine move-cursor-southwest-fine)
+  (define-command 'move-cursor-southeast-fine move-cursor-southeast-fine)
+  (define-command 'move-cursor-center move-cursor-center))
diff --git a/man/news.texi b/man/news.texi
index 7091daf..2d447fc 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -6,6 +6,25 @@ This lists the user-visible changes made to Sawfish, and which releases
 they occurred between. For more detailed information see the
 @file{ChangeLog} file in the Sawfish source tree.
 
+ heading 1.6.0
+
+ itemize @bullet
+
+ item The 1.6.0 release has new features and bugfixes
+
+ item New/Updated requirements:
+ itemize @minus
+
+ item rep-gtk 0.18.4 -> 0.90.0
+ end itemize
+
+ item New features:
+ itemize @minus
+
+ item 4 new move-cursor command for moving diagonally (move-cursor -northwest, -northeast, -southwest, -southeast) [Christopher Bratusek]
+ end itemize
+ end itemize
+
 @heading 1.5.0
 
 @itemize @bullet
diff --git a/man/sawfish.texi b/man/sawfish.texi
index 1348855..a4109b1 100644
--- a/man/sawfish.texi
+++ b/man/sawfish.texi
@@ -693,6 +693,10 @@ There are also more specialized cursor movement commands.
 @defunx move-cursor-right-fine
 @defunx move-cursor-up-fine
 @defunx move-cursor-down-fine
+ defunx move-cursor-northwest-fine
+ defunx move-cursor-northeast-fine
+ defunx move-cursor-southwest-fine
+ defunx move-cursor-southeast-fine
 Move the cursor 1 pixel in the indicated direction.
 @end defun
 
@@ -700,6 +704,10 @@ Move the cursor 1 pixel in the indicated direction.
 @defunx move-cursor-right
 @defunx move-cursor-up
 @defunx move-cursor-down
+ defunx move-cursor-northwest
+ defunx move-cursor-northeast
+ defunx move-cursor-southwest
+ defunx move-cursor-southeast
 Move the cursor @code{move-cursor-increment} pixels in the indicated
 direction.
 @end defun



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]