[clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-98-gaccd190

Philippe Brochard pbrochard at common-lisp.net
Fri Aug 24 22:28:37 UTC 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager".

The branch, master has been updated
       via  accd190438b0f42187b1524e21403d5887a0b296 (commit)
      from  fb272618b50bfc23423ff277e9d16e4d0d17f85a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit accd190438b0f42187b1524e21403d5887a0b296
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date:   Sat Aug 25 00:28:32 2012 +0200

    contrib/volume-mode.lisp: Add mouse buttons actions in volume mode. Add a volume button toolbar module.

diff --git a/ChangeLog b/ChangeLog
index 00fe7d0..38a5ace 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-25  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* contrib/volume-mode.lisp: Add mouse buttons actions in volume
+	mode. Add a volume button toolbar module.
+
 2012-08-24  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* contrib/mpd.lisp: New toolbar modules (available only if
diff --git a/contrib/volume-mode.lisp b/contrib/volume-mode.lisp
index 3e925a5..c21770c 100644
--- a/contrib/volume-mode.lisp
+++ b/contrib/volume-mode.lisp
@@ -63,6 +63,8 @@
 (format t "Loading Volume mode code... ")
 
 (defparameter *volume-keys* nil)
+(defparameter *volume-mouse* nil)
+
 (defconfig *volume-mode-placement* 'bottom-middle-root-placement
   'Placement "Volume mode window placement")
 
@@ -104,7 +106,10 @@
   'Volume-mode "Command to start an external mixer program")
 
 (define-init-hash-table-key *volume-keys* "Volume mode keys")
+(define-init-hash-table-key *volume-mouse* "Volume mode mouse button")
+
 (define-define-key "volume" *volume-keys*)
+(define-define-mouse "volume-mouse" *volume-mouse*)
 
 (add-hook *binding-hook* 'init-*volume-keys*)
 
@@ -128,6 +133,11 @@
   (define-volume-key ("Escape") 'leave-volume-mode)
   (define-volume-key ("g" :control) 'leave-volume-mode)
   (define-volume-key ("e") 'run-external-volume-mixer)
+  (define-volume-mouse (1) 'leave-volume-mode)
+  (define-volume-mouse (2) 'run-external-volume-mixer)
+  (define-volume-mouse (3) 'volume-mute)
+  (define-volume-mouse (4) 'volume-raise)
+  (define-volume-mouse (5) 'volume-lower)
   ;;; Main mode
   (define-main-key ("XF86AudioMute") 'volume-mute)
   (define-main-key ("XF86AudioLowerVolume") 'volume-lower)
@@ -159,8 +169,9 @@
                       text))
   (copy-pixmap-buffer *volume-window* *volume-gc*))
 
-(defun leave-volume-mode ()
+(defun leave-volume-mode (&optional window root-x root-y)
   "Leave the volume mode"
+  (declare (ignore window root-x root-y))
   (throw 'exit-volume-loop nil))
 
 (defun update-volume-mode ()
@@ -221,6 +232,10 @@
 (define-handler volume-mode :key-press (code state)
   (funcall-key-from-code *volume-keys* code state))
 
+(define-handler volume-mode :button-press (code state window root-x root-y)
+  (funcall-button-from-code *volume-mouse* code state window root-x root-y *fun-press*))
+
+
 (defun volume-mode ()
   (let ((grab-keyboard-p (xgrab-keyboard-p))
         (grab-pointer-p (xgrab-pointer-p)))
@@ -251,20 +266,44 @@
 (defvar *volume-lower-function* nil)
 (defvar *volume-raise-function* nil)
 
-(defun volume-mute ()
+(defun volume-mute (&optional window root-x root-y)
   "Toggle mute."
+  (declare (ignore window root-x root-y))
   (volume-set *volume-mute-function*))
 
-(defun volume-lower ()
+(defun volume-lower (&optional window root-x root-y)
   "Lower volume."
+  (declare (ignore window root-x root-y))
   (volume-set *volume-lower-function*))
 
-(defun volume-raise ()
+(defun volume-raise (&optional window root-x root-y)
   "Raise volume."
+  (declare (ignore window root-x root-y))
   (volume-set *volume-raise-function*))
 
-(defun run-external-volume-mixer ()
+(defun run-external-volume-mixer (&optional window root-x root-y)
   "Start an external volume mixer"
+  (declare (ignore window root-x root-y))
   (do-shell *volume-external-mixer-cmd*))
 
+
+#+:clfswm-toolbar
+(progn
+  (define-toolbar-color volume-mode-button "Volume mode color")
+
+  (define-toolbar-module (volume-mode-button (text "Vol"))
+    "Volume mode button"
+    (with-set-toolbar-module-rectangle (module)
+      (toolbar-module-text toolbar module (tb-color volume-mode-button) text)))
+
+  (define-toolbar-module-click (volume-mode-button text)
+    "Volume mode"
+    (declare (ignore text module))
+    (if *in-volume-mode*
+        (funcall-button-from-code *volume-mouse* code state (toolbar-window toolbar)
+                                  root-x root-y *fun-press*)
+        (volume-mode))))
+
+
+
 (format t "done~%")

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    5 ++++
 contrib/volume-mode.lisp |   49 +++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 49 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CLFSWM - A(nother) Common Lisp FullScreen Window Manager




More information about the clfswm-cvs mailing list