[Eclipse-cvs] CVS update: eclipse/gestures.lisp eclipse/misc.lisp eclipse/move-resize.lisp eclipse/virtual-screen.lisp eclipse/wm.lisp

Iban Hatchondo ihatchondo at common-lisp.net
Wed Nov 19 10:29:09 UTC 2003


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

Modified Files:
	gestures.lisp misc.lisp move-resize.lisp virtual-screen.lisp 
	wm.lisp 
Log Message:
More hacking. 
change get-screen-content for screen-content. Some keyword parameter added.


Date: Wed Nov 19 05:29:08 2003
Author: ihatchondo

Index: eclipse/gestures.lisp
diff -u eclipse/gestures.lisp:1.10 eclipse/gestures.lisp:1.11
--- eclipse/gestures.lisp:1.10	Thu Nov 13 06:12:28 2003
+++ eclipse/gestures.lisp	Wed Nov 19 05:29:08 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
-;;; $Id: gestures.lisp,v 1.10 2003/11/13 11:12:28 ihatchondo Exp $
+;;; $Id: gestures.lisp,v 1.11 2003/11/19 10:29:08 ihatchondo Exp $
 ;;;
 ;;; ECLIPSE. The Common Lisp Window Manager.
 ;;; Copyright (C) 2002 Iban HATCHONDO
@@ -343,7 +343,7 @@
   (unless *current-widget-info*
     (setf *current-widget-info* (create-message-box nil :parent root-window)))
   (let ((i (current-vscreen root-window)))
-    (setf *windows* (reverse (get-screen-content i :iconify-p *cycle-icons-p*))
+    (setf *windows* (reverse (screen-content i :iconify-p *cycle-icons-p*))
 	  *depth* 0)))
 
 (defun circulate-window-modifier-callback (event)


Index: eclipse/misc.lisp
diff -u eclipse/misc.lisp:1.13 eclipse/misc.lisp:1.14
--- eclipse/misc.lisp:1.13	Thu Nov 13 06:12:28 2003
+++ eclipse/misc.lisp	Wed Nov 19 05:29:08 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
-;;; $Id: misc.lisp,v 1.13 2003/11/13 11:12:28 ihatchondo Exp $
+;;; $Id: misc.lisp,v 1.14 2003/11/19 10:29:08 ihatchondo Exp $
 ;;;
 ;;; This file is part of Eclipse.
 ;;; Copyright (C) 2002 Iban HATCHONDO
@@ -152,7 +152,7 @@
   virtual screen that the given `window' argument belongs to. The given
   window will be filtered."
   (loop with n = (if (eql i +any-desktop+) (current-desk) i)
-	for w in (get-screen-content n)
+	for w in (screen-content n)
         for nwm-state = (netwm:net-wm-state w)
         unless (xlib:window-equal w window)
           if (member :_net_wm_state_above nwm-state) collect w into aboves


Index: eclipse/move-resize.lisp
diff -u eclipse/move-resize.lisp:1.8 eclipse/move-resize.lisp:1.9
--- eclipse/move-resize.lisp:1.8	Thu Oct  9 11:04:08 2003
+++ eclipse/move-resize.lisp	Wed Nov 19 05:29:08 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
-;;; $Id: move-resize.lisp,v 1.8 2003/10/09 15:04:08 ihatchondo Exp $
+;;; $Id: move-resize.lisp,v 1.9 2003/11/19 10:29:08 ihatchondo Exp $
 ;;;
 ;;; ECLIPSE. The Common Lisp Window Manager.
 ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
@@ -366,7 +366,7 @@
   (with-slots (window active-p) widget
     (setf (window-priority window) :above)
     (setf active-p  t
-	  *screen-windows* (get-screen-content (current-desk))
+	  *screen-windows* (screen-content (current-desk))
 	  *delta-x* (- (event-root-x event) (xlib:drawable-x window))
 	  *delta-y* (- (event-root-y event) (xlib:drawable-y window)))))
 


Index: eclipse/virtual-screen.lisp
diff -u eclipse/virtual-screen.lisp:1.11 eclipse/virtual-screen.lisp:1.12
--- eclipse/virtual-screen.lisp:1.11	Thu Nov 13 06:12:28 2003
+++ eclipse/virtual-screen.lisp	Wed Nov 19 05:29:08 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
-;;; $Id: virtual-screen.lisp,v 1.11 2003/11/13 11:12:28 ihatchondo Exp $
+;;; $Id: virtual-screen.lisp,v 1.12 2003/11/19 10:29:08 ihatchondo Exp $
 ;;;
 ;;; Copyright (C) 2002 Iban HATCHONDO
 ;;; contact : hatchond at yahoo.fr
@@ -23,17 +23,23 @@
 
 ;;;; Private
 
-(defun window-belongs-to-vscreen-p (win scr-num iconify-p)
+(defun window-belongs-to-vscreen-p
+    (win scr-num iconify-p skip-taskbar skip-desktop skip-dock)
   (when (lookup-widget win)
     (let ((n (or (window-desktop-num win) -1))
 	  (wm-state (car (wm-state win)))
-	  (netwm-type (netwm:net-wm-window-type win)))
+	  (netwm-type (netwm:net-wm-window-type win))
+	  (netwm-state (netwm:net-wm-state win)))
       (and (or (= n scr-num) (= n +any-desktop+))
 	   (or (eq wm-state 1) (and iconify-p (eq wm-state 3)))
-	   (not (member :win_hints_skip_taskbar (gnome:win-hints win)))
-	   (not (member :_net_wm_state_skip_taskbar (netwm:net-wm-state win)))
-	   (not (member :_net_wm_window_type_desktop netwm-type))
-	   (not (member :_net_wm_window_type_dock netwm-type))))))
+	   (not (and skip-taskbar
+		     (member :_net_wm_state_skip_taskbar netwm-state)))
+	   (not (and skip-taskbar
+		     (member :win_hints_skip_taskbar (gnome:win-hints win))))
+	   (not (and skip-desktop
+		     (member :_net_wm_window_type_desktop netwm-type)))
+	   (not (and skip-dock
+		     (member :_net_wm_window_type_dock netwm-type)))))))
 
 (defun map-or-unmap-vscreen (fun scr-num)
   (loop for widget being each hash-value in *widget-table*
@@ -109,16 +115,28 @@
 			     (or (nth new (workspace-names window))
 				 (format nil "WORKSPACE ~D" new))))))))
 
-(defun get-screen-content (scr-num &key iconify-p)
+
+(defun screen-content (scr-num 
+		       &key (predicate #'window-belongs-to-vscreen-p) iconify-p
+		            (skip-taskbar t) (skip-desktop t) (skip-dock t))
   "Returns the list of application's windows that represent the contents
-  of the given virtual screen. Use :iconify-p t to includes iconfied windows"
-  (loop for win in (query-application-tree *root-window*)
-	when (window-belongs-to-vscreen-p win scr-num iconify-p) collect win))
+  of the given virtual screen. 
+   :iconify-p to include or not iconfied windows (default nil).
+   :skip-taskbar to include window with skip-taskbar hint (default t).
+   :skip-desktop to include window with desktop window type (default t).
+   :skip-dock to include window with dock window type (default t).
+   :predicate a function of six arguments:
+     window screen-number iconify-p skip-taskbar-p skip-desktop-p skip-dock-p."
+  (loop with i = (if (eql scr-num +any-desktop+) (current-desk) scr-num)
+	for w in (query-application-tree *root-window*)
+	when (funcall 
+	         predicate w i iconify-p skip-taskbar skip-desktop skip-dock)
+	collect w))
 
 (defun give-focus-to-next-widget-in-desktop ()
   "Gives the focus to the window that is on top of the stacking order."
   (loop	with given-p = nil
-	for window in (reverse (get-screen-content (current-desk)))
+	for window in (reverse (screen-content (current-desk)))
 	when (eq :viewable (xlib:window-map-state window))
 	do (with-slots (input-model) (lookup-widget window)
 	     (unless (eq input-model :no-input)
@@ -132,7 +150,7 @@
 (defmethod circulate-window
     ((root root) &key direction (nth 0) icon-p windows (desk (current-desk)))
   (unless windows
-    (setf windows (reverse (get-screen-content desk :iconify-p icon-p))))
+    (setf windows (reverse (screen-content desk :iconify-p icon-p))))
   (or windows (return-from circulate-window nil))
   (let ((length (length windows)))
     (setf nth (mod nth length))


Index: eclipse/wm.lisp
diff -u eclipse/wm.lisp:1.22 eclipse/wm.lisp:1.23
--- eclipse/wm.lisp:1.22	Thu Oct  9 07:37:08 2003
+++ eclipse/wm.lisp	Wed Nov 19 05:29:08 2003
@@ -1,5 +1,5 @@
 ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
-;;; $Id: wm.lisp,v 1.22 2003/10/09 11:37:08 ihatchondo Exp $
+;;; $Id: wm.lisp,v 1.23 2003/11/19 10:29:08 ihatchondo Exp $
 ;;;
 ;;; ECLIPSE. The Common Lisp Window Manager.
 ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
@@ -590,7 +590,7 @@
 	     (3 (uniconify (slot-value (lookup-widget window) 'icon))))
 	   (put-on-top (lookup-widget window))))
        (make-desktop-entries (index)
-	 (loop for w in (get-screen-content index :iconify-p t)
+	 (loop for w in (screen-content index :iconify-p t)
 	       for state = (= 1 (first (wm-state w)))
 	       collect (cons (format nil "~:[[ ~A ]~;~A~]" state (wm-name w))
 			     (raise w index)))))





More information about the Eclipse-cvs mailing list