home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / gwm-dist.tar.gz / gwm-dist.tar / home-gwm / jerq-behavior.gwm < prev    next >
Text File  |  1993-07-07  |  5KB  |  144 lines

  1. ; default behaviors
  2. ; ==================
  3.  
  4. (: move-grid-style 3)
  5. (: resize-grid-style 3)
  6.  
  7. (de btn3menus nil
  8.     (if (= (bitwise-and (current-event-modifier)
  9.                 (together with-alt with-shift)) with-alt)
  10.         (pop-menu alt-root-pop)
  11.         (pop-menu)))
  12.  
  13. (: standard-behavior
  14.     (state-make
  15.     (on (buttonpress 1 alone) (progn (raise-window)(move-window)))
  16.     (on (button 1 with-shift) (lower-window))
  17.     (on (buttonpress 1 with-alt) (progn (raise-window)(move-window)))
  18.     (on (button 1 (together with-shift with-alt)) (lower-window))
  19.     (on (buttonpress 3 any) (btn3menus))
  20.     ))
  21.  
  22. (: window-behavior
  23.     (state-make
  24.     (on (buttonpress 1 alone) (currtop nil))
  25.     (on (buttonpress 1 with-alt) (currtop t))
  26.     (on (buttonpress 2 (together with-shift with-alt with-control))
  27.         (progn
  28.         (? "original wob: " wob "; window x, y:" window-x ", " window-y "\n")
  29.         (with (wob (wob-at-coords (current-event-x) (current-event-y)))
  30.               (? "new wob: " wob "; window x, y:" window-x ", " window-y "\n")
  31.               (? window-property "\n"))))
  32.  
  33.     (on name-change (send-user-event 'name-change))
  34.     (on focus-in (progn (window-property (# 'has-focus window-property t))
  35.                 (unset-grabs (button any any))
  36.                 (eval (+ '(set-grabs) focus-window-grabs))
  37.                 (send-user-event 'focus-in window)))
  38.     (on focus-out (progn (window-property (# 'has-focus window-property ()))
  39.                  (unset-grabs (button any any))
  40.                  (eval (+ '(set-grabs) window-grabs))
  41.                  (send-user-event 'focus-out)))
  42.     (on window-icon-pixmap-change
  43.         (send-user-event 'icon-pixmap-change window-icon))))
  44.  
  45. (: root-behavior
  46.     (state-make
  47.     (on (buttonpress 3 any) (btn3menus))
  48.     (on (key (key-make "BackSpace") with-alt) 
  49.         (execute-string (+ "(? " cut-buffer ")")))
  50.     (on (key (key-make "Delete") with-alt) (end))))
  51.  
  52. ;; icon-specific actions
  53.  
  54. (: icon-behavior
  55.   (state-make
  56.     (on (buttonpress 2 any)
  57.       (icon-group-pop window))
  58. ))
  59.  
  60.  
  61. (: focus-window-grabs
  62.     (list
  63.     (button any with-alt)
  64.     (button 3 (together with-shift with-alt))
  65.     (button any (together with-shift with-alt with-control)))) ; debugging
  66.  
  67. (: grabs
  68.     (: root-grabs
  69.     (: window-grabs
  70.         (: icon-grabs
  71.         (+ focus-window-grabs (list (button any any)))))))
  72.  
  73. (reparse-standard-behaviors)
  74.  
  75. (de currtop (force)
  76.     (if (not (= wob root-window))
  77.     (if (not (# 'has-focus window-property))
  78.         (progn
  79.         (raise-window)
  80.         (if (not (ct-set-focus))
  81.             (bell -50))))))    ; Warn that the turkey window didn't
  82.                         ; take the focus
  83.  
  84. (de ct-set-focus nil
  85.     (with (check-input-focus-flag
  86.        (if force
  87.            1
  88.            check-input-focus-flag))
  89.     (set-focus)))
  90.  
  91. (de current ()
  92.     (if (not (= wob root-window))
  93.     (if (not (# 'has-focus window-property))
  94.         (if (not (set-focus))
  95.         (bell -50)))))    ; Warn that the turkey window didn't
  96.                 ; take the focus
  97.  
  98. (de all-window-info nil
  99.     (? "\nInfo for all windows:\n\n")
  100.     (for window (list-of-windows)
  101.     (? "window " window ": window-client-class: " window-client-class "\n")
  102.     (? "  window-client-height, width, x, y: " window-client-height ", "
  103.        window-client-width ", " window-client-x ", " window-client-y "\n")
  104.     (? "  window-client-name: " window-client-name ", window-icon: "
  105.        window-icon ", window-icon-name: " window-icon-name "\n")
  106.     (? "  window-is-mapped: " window-is-mapped ", window-is-transient-for: "
  107.        window-is-transient-for ", window-machine-name: " window-machine-name
  108.        "\n")
  109.     (? "  window-name: " window-name ", window-property: " window-property
  110.        ", window-size: " window-size "\n")
  111.     (? "  window-starts-iconic: " window-starts-iconic ", window-status: "
  112.        window-status "\n")
  113.     (? "  window-was-on-screen: " window-was-on-screen
  114.        ", window-height, width, x, y: " window-height ", " window-width
  115.        ", " window-x ", " window-y "\n")
  116.     (? "  window-window: " window-window
  117.        ", window-user-set-position, size: " window-user-set-position ", "
  118.        window-user-set-size "\n")
  119.     (? "  wob-property: " wob-property ", wob-status, height, width: "
  120.        wob-status ", " wob-height ", " wob-width "\n")))
  121.  
  122. (de window-info nil
  123.     (? "\nWindow info:\n\n")
  124.     (? "window " window ": window-client-class: " window-client-class "\n")
  125.     (? "  window-client-height, width, x, y: " window-client-height ", "
  126.        window-client-width ", " window-client-x ", " window-client-y "\n")
  127.     (? "  window-client-name: " window-client-name ", window-icon: "
  128.        window-icon ", window-icon-name: " window-icon-name "\n")
  129.     (? "  window-is-mapped: " window-is-mapped ", window-is-transient-for: "
  130.        window-is-transient-for ", window-machine-name: " window-machine-name
  131.        "\n")
  132.     (? "  window-name: " window-name ", window-property: " window-property
  133.        ", window-size: " window-size "\n")
  134.     (? "  window-starts-iconic: " window-starts-iconic ", window-status: "
  135.        window-status "\n")
  136.     (? "  window-was-on-screen: " window-was-on-screen
  137.        ", window-height, width, x, y: " window-height ", " window-width
  138.        ", " window-x ", " window-y "\n")
  139.     (? "  window-window: " window-window
  140.        ", window-user-set-position, size: " window-user-set-position ", "
  141.        window-user-set-size "\n")
  142.     (? "  wob-property: " wob-property ", wob-status, height, width: "
  143.        wob-status ", " wob-height ", " wob-width "\n"))
  144.