]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/ui/gestures/gestures.factor
ui.backend.*: new vocab for keysym handling which is the same on x11 and gtk
[factor.git] / basis / ui / gestures / gestures.factor
index 82cf068164f7f813ded0f99acdb95fcf590df5e2..6c8b3049c584840984a0b52a0adf8e8dfbebdeb0 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2005, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs kernel math math.order models
-namespaces make sequences words strings system hashtables math.parser
-math.vectors classes.tuple classes boxes calendar timers combinators
-sets columns fry deques ui.gadgets ui.gadgets.private ascii
-combinators.short-circuit ;
+USING: accessors arrays ascii assocs boxes calendar classes
+combinators combinators.short-circuit deques fry kernel make math
+math.order math.parser math.vectors namespaces sequences system timers
+ui.gadgets ui.gadgets.private words ;
 IN: ui.gestures
 
 : get-gesture-handler ( gesture gadget -- quot )
@@ -98,13 +97,13 @@ SINGLETONS:
     revert-action close-action ;
 
 UNION: action
-undo-action redo-action
-cut-action copy-action paste-action
-delete-action select-all-action
-left-action right-action up-action down-action
-zoom-in-action zoom-out-action
-new-action open-action save-action save-as-action
-revert-action close-action ;
+    undo-action redo-action
+    cut-action copy-action paste-action
+    delete-action select-all-action
+    left-action right-action up-action down-action
+    zoom-in-action zoom-out-action
+    new-action open-action save-action save-as-action
+    revert-action close-action ;
 
 CONSTANT: action-gestures
     {
@@ -128,7 +127,7 @@ TUPLE: key-gesture mods sym ;
 
 TUPLE: key-down < key-gesture ;
 
-: new-key-gesture ( mods sym action? class -- mods' sym' )
+: new-key-gesture ( mods sym action? class -- key-gesture )
     [ [ [ S+ swap remove f like ] dip ] unless ] dip boa ; inline
 
 : <key-down> ( mods sym action? -- key-down )
@@ -234,10 +233,6 @@ SYMBOL: drag-timer
         focus<<
     ] if ;
 
-: modifier ( mod modifiers -- seq )
-    [ second swap bitand 0 > ] with filter
-    0 <column> members [ f ] [ >array ] if-empty ;
-
 : drag-loc ( -- loc )
     hand-loc get-global hand-click-loc get-global v- ;