home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / vtwm-squeezed-window.gwm < prev    next >
Lisp/Scheme  |  1995-07-03  |  5KB  |  105 lines

  1. ;; vtwm-squeezed-window.gwm --- VTWM Squeezed Title Window 
  2. ;;
  3. ;; Author: Anders Holst  (aho@sans.kth.se)  
  4. ;; Copyright (C) 1995  Anders Holst
  5. ;; Version: vtwm-1.0
  6. ;; Last change: 6/6 1995
  7. ;;
  8. ;; This file is copyrighted under the same terms as the rest of GWM
  9. ;; (see the X Inc license for details). There is no warranty that it
  10. ;; works. 
  11. ;;
  12. ;; --------------------------------------------------------------------- 
  13. ;;
  14. ;; This file defines squeezed title style windows for the VTWM profile.
  15. ;; It requires that the normal "vtwm-window.gwm" is already loaded.
  16. ;; Use 'set-window' to specify which windows should have squeezed titles.
  17. ;;
  18.  
  19. (defaults-to 
  20.   vtwm-squeezed-hilite-size 11           ;; Size of area showing focus
  21.   vtwm-squeezed-title-position 'left     ;; Left, right or center
  22. )
  23.  
  24. (defun vtwm-squeezed-innerbar ()
  25.   (with (borderwidth 0
  26.          cols (vtwm-get-color)
  27.          vtwm-title-foreground (or (# 0 cols) vtwm-title-foreground)
  28.          vtwm-title-background (or (# 1 cols) vtwm-title-background)
  29.          property (+ (list 'fg vtwm-title-foreground
  30.                            'bg vtwm-title-background)
  31.                      property)
  32.          background vtwm-title-background
  33.          fsm (vtwm-titlebar-fsm) 
  34.          plug-separator 0
  35.          borderpixel vtwm-bordercolor
  36.          bar-min-width 1 bar-max-width 10000
  37.          bar-list (+ (vtwm-make-pluglist vtwm-left-plugs)
  38.                      (list (vtwm-space-plug 5)
  39.                            (vtwm-name-plug) 
  40.                            (if (and vtwm-squeezed-hilite-size
  41.                                     (> vtwm-squeezed-hilite-size 0))
  42.                              (with (borderwidth 3
  43.                                     borderpixel vtwm-title-background
  44.                                     fsm (vtwm-titlebar-inner-fsm)
  45.                                     bar-min-width vtwm-squeezed-hilite-size
  46.                                     bar-max-width vtwm-squeezed-hilite-size)
  47.                                (bar-make ))
  48.                              (vtwm-space-plug 3))
  49.                            (vtwm-space-plug 2))
  50.                      (vtwm-make-pluglist vtwm-right-plugs)))
  51.     (apply bar-make bar-list)))
  52.  
  53. (defun vtwm-squeezed-titlebar ()
  54.   (with (borderwidth 0
  55.          tile t
  56.          background vtwm-bordercolor
  57.          fsm ()
  58.          bar-max-width 10000
  59.          plug-separator 0)
  60.     (bar-make (bar-make (with (tile t
  61.                                fsm (vtwm-borderbar-fsm)
  62.                                background vtwm-bordercolor
  63.                                bar-min-width vtwm-borderwidth
  64.                                bar-max-width 10000)
  65.                           (if (= vtwm-squeezed-title-position 'right)
  66.                               (bar-make ()
  67.                                         (with (tile ()) (bar-make ))
  68.                                         (with (tile ()) 
  69.                                           (bar-make (bar-make )
  70.                                                     (vtwm-squeezed-innerbar)))
  71.                                         (with (tile ()) (bar-make )))
  72.                             (= vtwm-squeezed-title-position 'center)
  73.                               (bar-make ()
  74.                                         (with (tile ()) (bar-make ))
  75.                                         (with (tile ()) 
  76.                                           (bar-make (bar-make )
  77.                                                     (vtwm-squeezed-innerbar)))
  78.                                         (with (tile ()) (bar-make ))
  79.                                         ())
  80.                             (bar-make (with (tile ()) (bar-make ))
  81.                                       (with (tile ()) 
  82.                                         (bar-make (bar-make )
  83.                                                   (vtwm-squeezed-innerbar)))
  84.                                       (with (tile ()) (bar-make ))
  85.                                       ())))
  86.                         (with (tile ()
  87.                                fsm (vtwm-borderbar-fsm)
  88.                                background vtwm-bordercolor
  89.                                bar-min-width vtwm-borderwidth
  90.                                bar-max-width vtwm-borderwidth)
  91.                           (bar-make ))))))
  92.  
  93.  
  94. (defun vtwm-squeezed-window ()
  95.   (with (inner-borderwidth 0
  96.          borderwidth 0
  97.          fsm (vtwm-titled-window-fsm)
  98.          borderpixel vtwm-bordercolor)
  99.     (window-make (vtwm-squeezed-titlebar)
  100.                  (vtwm-borderbar)
  101.                  (vtwm-borderbar)
  102.                  (vtwm-borderbar)
  103.                  ())))
  104.  
  105.