home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / icon-groups-old.gwm < prev    next >
Lisp/Scheme  |  1995-07-03  |  3KB  |  88 lines

  1. ; iconification following the "group" hint
  2.  
  3. ;;File: icon-groups.gwm -- iconify-window manage groups
  4. ;;Author: colas@mirsa.inria.fr (Colas NAHABOO) -- Bull Research FRANCE
  5. ;;Revision: 1.2 -- Jan 30 1990
  6. ;;State: Exp
  7. ;;GWM Version: 1.4
  8.  
  9. ; do not manage some groups and manage groups starting iconified
  10.  
  11. (if (not (boundp 'iconify-window-redefined-for-groups))
  12.     (setq opening
  13.       (+ opening
  14.          '((if (and window-group (= window-status 'window))
  15.            (with (leader (# 0 window-group))
  16.              (if (member (atom window-client-class)
  17.                  icon-groups.excluded)
  18.              (window-group ())
  19.                (if (and (not (= leader window))
  20.                                 (not window-is-transient-for)
  21.                 (with (window leader)
  22.                   (and window-starts-iconic
  23.                        (= 'icon (window-wm-state)))))
  24.                (: window-starts-iconic t)))))))))
  25.  
  26. (defaults-to icon-groups.excluded ())
  27.  
  28. ; iconifies a whole group in a single icon
  29.  
  30. (if (not (boundp 'iconify-window-redefined-for-groups))
  31.     (progn
  32.       (: iconify-window-redefined-for-groups iconify-window)
  33.       (de iconify-window ()
  34.       (if window-group    
  35.                     ; we are in a group
  36.           (if (= window-window (# 0 window-group))
  37.                     ; leader
  38.           (if (= window-status 'window)
  39.                     ; iconify leader
  40.               (progn
  41.             (for window window-group
  42.                  (if window-is-mapped
  43.                  (progn (register-group-member window)
  44.                     (unmap-window))))
  45.             (raise-and-map-window window-icon))
  46.                     ; de-iconify leader
  47.             (progn
  48.               (raise-and-map-window window-window)
  49.               (for w window-group 
  50.                (if (is-group-member w)
  51.                    (raise-and-map-window w)))
  52.               (unmap-window window-icon)
  53.               (clear-group-members window-group)
  54.               ))
  55.                     ; member
  56.         (if (= window-status 'window)
  57.                     ; iconify member
  58.             (progn
  59.               (setq window-wm-state-icon 
  60.                 (with (window (# 0 window-group))
  61.                   (raise-and-map-window window-icon)
  62.                   window-icon))
  63.               (register-group-member window)
  64.               (unmap-window window))
  65.                     ; de-iconify member 
  66.                     ; (not possible normally)
  67.           (iconify-window-redefined-for-groups)))
  68.                     ; window do not belong to a group
  69.         (iconify-window-redefined-for-groups)))))
  70.  
  71. ; not to map back withdrawn windows, we maintain a 'group property for mapped
  72. ; windows of the group
  73.  
  74. (de register-group-member (w)
  75.     (## 'group w t))
  76.  
  77. (de is-group-member (w)
  78.     (# 'group w))
  79.  
  80. (de clear-group-members (l)
  81.     (for w l
  82.      (## 'group w ())))
  83.  
  84. (de raise-and-map-window (w)
  85.     (with (window w)
  86.       (raise-window)
  87.       (map-window)))
  88.