[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Fri Nov 24 22:43:03 UTC 2006


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv17330/Drei

Modified Files:
	packages.lisp drei-clim.lisp 
Log Message:
Added new exported `handle-gesture' generic function and used this to
implement the activation-gesture behavior for the text-field gadget,
eliminating use of Drei-internal symbols.


--- /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2006/11/22 21:23:24	1.7
+++ /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2006/11/24 22:43:03	1.8
@@ -226,6 +226,9 @@
            #:with-bound-drei-special-variables
            #:accepting-from-user #:invoke-accepting-from-user
 
+           ;; Gadget interface stuff.
+           #:handle-gesture
+
            ;; Input-editor interface stuff.
            #:drei-input-editing-mixin #:drei-instance
            #:object #:result-type
--- /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp	2006/11/23 15:48:48	1.11
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp	2006/11/24 22:43:03	1.12
@@ -262,7 +262,16 @@
   (setf (active gadget) nil)
   (display-drei gadget))
 
-(defun handle-new-gesture (drei gesture)
+(defgeneric handle-gesture (drei gesture)
+  (:documentation "This generic function is called whenever a
+Drei gadget variant has determined that a keyboard event
+corresponds to a useful gesture that should be handled. A useful
+gesture is, for example, one that is not simply a click on a
+modifier key. When this function is called, the Drei special
+variables (`*current-window*', `*current-buffer*', etc) are
+properly bound."))
+
+(defmethod handle-gesture ((drei drei-gadget-pane) gesture)
   (let ((*command-processor* drei)
         (*abort-gestures* *esa-abort-gestures*))
     ;; It is important that the minibuffer of the Drei object is
@@ -281,9 +290,9 @@
         (when (modified-p (buffer drei))
           (clear-modify (buffer drei))
           (value-changed-callback drei
-                                   (gadget-client drei)
-                                   (gadget-id drei)
-                                   (gadget-value drei)))))))
+                                  (gadget-client drei)
+                                  (gadget-id drei)
+                                  (gadget-value drei)))))))
 
 (defmethod execute-drei-command :after ((drei drei-gadget-pane) command)
   (with-accessors ((buffer buffer)) drei
@@ -301,7 +310,7 @@
         (when (proper-gesture-p gesture)
           (with-bound-drei-special-variables (gadget :prompt (format nil "~A " (gesture-name gesture)))
             (let ((*standard-input* (or *minibuffer* *standard-input*)))
-              (handle-new-gesture gadget gesture))))))))
+              (handle-gesture gadget gesture))))))))
 
 (defmethod invoke-accepting-from-user ((drei drei-gadget-pane) (continuation function))
   ;; When an `accept' is called during the execution of a command for




More information about the Mcclim-cvs mailing list