Commit 8de689ce authored by Iban Hatchondo's avatar Iban Hatchondo
Browse files

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.
parent 0ea4bfd5
;;; -*- Mode: Lisp; Package: GNOME -*-
;;; $Id: gnome-manager.lisp,v 1.3 2002/07/02 14:53:59 hatchond Exp $
;;; $Id: gnome-manager.lisp,v 1.1 2002/11/07 14:23:31 hatchond 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 @@ exist in the server."))
;; 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
......
;;; -*- Mode: Lisp; Package: MANAGER-COMMONS -*-
;;; $Id: $
;;; $Id: manager-commons.lisp,v 1.1 2002/11/07 14:23:31 hatchond 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
;;; -*- Mode: Lisp; Package: EXTENDED-WINDOW-MANAGER-HINTS -*-
;;; $Id: netwm-manager.lisp,v 1.2 2003/03/19 09:18:47 hatchond Exp $
;;; $Id: netwm-manager.lisp,v 1.3 2003/08/28 14:40:34 hatchond 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 @@ In order to use it, you should first call intern-atoms to be sure all
;; _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 @@ In order to use it, you should first call intern-atoms to be sure all
;; _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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment