[Eclipse-cvs] CVS update: eclipse/lib/gnome-manager.lisp eclipse/lib/manager-commons.lisp eclipse/lib/netwm-manager.lisp

Iban Hatchondo ihatchondo at common-lisp.net
Thu Nov 13 00:03:52 UTC 2003


Update of /project/eclipse/cvsroot/eclipse/lib
In directory common-lisp.net:/tmp/cvs-serv2268

Modified Files:
	gnome-manager.lisp manager-commons.lisp netwm-manager.lisp 
Log Message:
more hacking.
Replace make-window-list-setter by define-window-list-property-accessor, that defines both the reader and the writer for the given property atom.

Date: Wed Nov 12 19:03:51 2003
Author: ihatchondo

Index: eclipse/lib/gnome-manager.lisp
diff -u eclipse/lib/gnome-manager.lisp:1.1 eclipse/lib/gnome-manager.lisp:1.2
--- eclipse/lib/gnome-manager.lisp:1.1	Thu Nov  7 09:23:31 2002
+++ eclipse/lib/gnome-manager.lisp	Wed Nov 12 19:03:50 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: GNOME -*-
-;;; $Id: gnome-manager.lisp,v 1.1 2002/11/07 14:23:31 hatchond Exp $
+;;; $Id: gnome-manager.lisp,v 1.2 2003/11/13 00:03:50 ihatchondo Exp $
 ;;;
 ;;; This is the CLX support for the managing with gnome.
 ;;;
@@ -37,7 +37,7 @@
 		set-workspace-names 
 		set-atoms-property get-atoms-property
 		get-window-property
-		make-window-list-seter)
+		define-window-list-property-accessor)
   (:export
    win-client-list           win-workspace-count
    win-workspace-names       win-workspace
@@ -92,16 +92,18 @@
 
 ;; Each entry is a window-id of a managed client.
 
-(defun win-client-list (window &key window-list)
-  (get-window-property window :_WIN_CLIENT_LIST window-list))
-
-(make-window-list-seter win-client-list :_WIN_CLIENT_LIST :CARDINAL)
-
-(defsetf win-client-list (window &key (mode :replace)) (win)
-  " To set this property give or a single window or a list of window.
-    you can add or remove one window from the property or
-    simply replace the actual value by a new list."
-  `(set-win-client-list ,window ,win ,mode))
+(define-window-list-property-accessor (win-client-list)
+  :property-atom :_WIN_CLIENT_LIST
+  :data-type :CARDINAL
+  :reader-documentation
+  "Returns the _win_client_list property. 
+    - window: a window
+    - window-list: if true the returned list is a list of window. Otherwise 
+      the returned list is the list of window-id."
+  :writer-documentation
+  "To set this property give or a single window or a list of window.
+   You can add or remove one window from the property or simply
+   replace the actual value by a new list.")
 
 ;; _WIN_WORKSPACE_COUNT
 


Index: eclipse/lib/manager-commons.lisp
diff -u eclipse/lib/manager-commons.lisp:1.1 eclipse/lib/manager-commons.lisp:1.2
--- eclipse/lib/manager-commons.lisp:1.1	Thu Nov  7 09:23:31 2002
+++ eclipse/lib/manager-commons.lisp	Wed Nov 12 19:03:50 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: MANAGER-COMMONS -*-
-;;; $Id: manager-commons.lisp,v 1.1 2002/11/07 14:23:31 hatchond Exp $
+;;; $Id: manager-commons.lisp,v 1.2 2003/11/13 00:03:50 ihatchondo Exp $
 ;;;
 ;;; This is the CLX support for the managing with gnome.
 ;;;
@@ -207,19 +207,25 @@
 	   (lambda (id)
 	     (xlib::lookup-window (xlib:drawable-display window) id)))))
 
-(defmacro make-window-list-seter (type atom &optional (data-type :WINDOW))
-  (let ((primary (with-standard-io-syntax (format nil "~A" type)))
-	(setter (with-standard-io-syntax (format nil "SET-~A" type))))
-    `(defun ,(intern setter) (window win mode)
-       (when win
-	 (change-property
-	     window
-	     ,atom
-	     (cond ((eq mode :remove)
-		    (setf mode :replace)
-		    (remove win (,(intern primary) window :window-list t)))
-		   ((listp win) win)
-		   (t (list win)))
-	     ,data-type
-	     32
-	     :mode mode :transform #'xlib:window-id)))))
+(defmacro define-window-list-property-accessor 
+    ((name) &key property-atom (data-type :window)
+                 reader-documentation writer-documentation)
+  (let ((reader (with-standard-io-syntax (format nil "~A" name))))
+    `(progn
+       (defun ,(intern reader) (window &key window-list)
+	 ,@(when reader-documentation `(,reader-documentation))
+	 (get-window-property window ,property-atom window-list))
+       (defsetf ,(intern reader) (window &key (mode :replace)) (win)
+	 ,@(when writer-documentation `(,writer-documentation))
+	 `(when ,win
+	     (change-property
+	       ,window
+	       ,',property-atom
+	       (cond ((eq ,mode :remove)
+		      (remove ,win (,',(intern reader) ,window :window-list t)))
+		     ((listp ,win) ,win)
+		     (t (list ,win)))
+	       ,',data-type
+	       32
+	       :mode (if (eq ,mode :remove) :replace ,mode)
+	       :transform #'xlib:window-id))))))
\ No newline at end of file


Index: eclipse/lib/netwm-manager.lisp
diff -u eclipse/lib/netwm-manager.lisp:1.3 eclipse/lib/netwm-manager.lisp:1.4
--- eclipse/lib/netwm-manager.lisp:1.3	Thu Aug 28 10:40:34 2003
+++ eclipse/lib/netwm-manager.lisp	Wed Nov 12 19:03:50 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: EXTENDED-WINDOW-MANAGER-HINTS -*-
-;;; $Id: netwm-manager.lisp,v 1.3 2003/08/28 14:40:34 hatchond Exp $
+;;; $Id: netwm-manager.lisp,v 1.4 2003/11/13 00:03:50 ihatchondo Exp $
 ;;;
 ;;; This is the CLX support for the managing with gnome.
 ;;;
@@ -37,7 +37,7 @@
 		set-workspace-names 
 		set-atoms-property get-atoms-property
 		get-window-property
-		make-window-list-seter)
+		define-window-list-property-accessor)
   (:export
    net-supported             net-client-list
    net-client-list-stacking  net-number-of-desktops
@@ -140,29 +140,31 @@
 
 ;; _NET_CLIENT_LIST
 
-(defun net-client-list (window &key window-list)
-  (get-window-property window :_NET_CLIENT_LIST window-list))
-
-(make-window-list-seter net-client-list :_NET_CLIENT_LIST)
-
-(defsetf net-client-list (window &key (mode :replace)) (win)
-  " To set this property give or a single window or a list of window.
-    you can add or remove one window from the property or
-    simply replace the actual value by a new list."
-  `(set-net-client-list ,window ,win ,mode))
+(define-window-list-property-accessor (net-client-list)
+  :property-atom :_NET_CLIENT_LIST
+  :reader-documentation
+  "Returns the _net_client_list property. 
+    - window: a window
+    - window-list: if true the returned list is a list of window. Otherwise 
+      the returned list is the list of window-id."
+  :writer-documentation
+  "To set this property give or a single window or a list of window.
+   You can add or remove one window from the property or simply
+   replace the actual value by a new list.")
 
 ;; _NET_CLIENT_LIST_STACKING
 
-(defun net-client-list-stacking (window &key window-list)
-  (get-window-property window :_NET_CLIENT_LIST_STACKING window-list))
-
-(make-window-list-seter net-client-list-stacking :_NET_CLIENT_LIST_STACKING)
-
-(defsetf net-client-list-stacking (window &key (mode :replace)) (win)
-  " To set this property give a single window or a list of window.
-    you can add/remove one window from the property or
-    simply replace the actual value by a new list."
-  `(set-net-client-list-stacking ,window ,win ,mode))
+(define-window-list-property-accessor (net-client-list-stacking)
+    :property-atom :_NET_CLIENT_LIST_STACKING
+    :reader-documentation
+    "Returns the _net_client_list_stacking property. 
+    - window: a window
+    - window-list: if true the returned list is a list of window. Otherwise 
+      the returned list is the list of window-id."
+    :writer-documentation 
+    "To set this property give a single window or a list of window.
+     You can add/remove one window from the property or
+     simply replace the actual value by a new list.")
 
 ;; _NET_NUMBER_OF_DESKTOPS
 
@@ -241,16 +243,17 @@
 
 ;; _NET_VIRTUAL_ROOTS
 
-(defun net-virtual-roots (window &key window-list)
-  (get-window-property window :_NET_VIRTUAL_ROOTS window-list))
-
-(make-window-list-seter net-virtual-roots :_NET_VIRTUAL_ROOTS :CARDINAL)
-
-(defsetf net-virtual-roots (window &key (mode :replace)) (windows)
-  " To set this property give or a single window or a list of window.
-    you can add or remove one window from the property or
-    simply replace the actual value by a new list."
-  `(set-net-virtual-roots ,window ,windows ,mode))
+(define-window-list-property-accessor (net-virtual-roots)
+  :property-atom :_NET_VIRTUAL_ROOTS
+  :reader-documentation
+  "Returns the _net_virtual_roots property. 
+    - window: a window
+    - window-list: if true the returned list is a list of window. Otherwise 
+      the returned list is the list of window-id."
+  :writer-documentation 
+  "To set this property give or a single window or a list of window.
+   You can add or remove one window from the property or simply
+   replace the actual value by a new list.")
 
 ;; _NET_SHOWING_DESKTOP
 





More information about the Eclipse-cvs mailing list