summaryrefslogtreecommitdiff
path: root/unity-private/gesture
diff options
authornjpatel <>2010-08-10 16:13:20 +0100
committernjpatel <>2010-08-10 16:13:20 +0100
commit5e019f2c621c8311ef808b443bd553ddac52e43e (patch)
tree04156db47fb0b4272fe475cb44a5c8934dbacd60 /unity-private/gesture
parent79b3d214e4b638f2a0fb5d7623594d9ddaee62c0 (diff)
Add support for PAN
(bzr r424.1.14)
Diffstat (limited to 'unity-private/gesture')
-rw-r--r--unity-private/gesture/gesture-dispatcher-xcb-glue.c12
-rw-r--r--unity-private/gesture/gesture-event.vala6
2 files changed, 17 insertions, 1 deletions
diff --git a/unity-private/gesture/gesture-dispatcher-xcb-glue.c b/unity-private/gesture/gesture-dispatcher-xcb-glue.c
index 622c2b88e..1a341fa57 100644
--- a/unity-private/gesture/gesture-dispatcher-xcb-glue.c
+++ b/unity-private/gesture/gesture-dispatcher-xcb-glue.c
@@ -86,7 +86,7 @@ unity_gesture_xcb_dispatcher_glue_init (GObject *object)
mask = calloc (1, sizeof(grail_mask_t) * mask_len);
- /* Taps */
+ /* Fiddle */
grail_mask_set (mask, GRAIL_TYPE_TAP3);
grail_mask_set (mask, GRAIL_TYPE_TAP4);
@@ -94,6 +94,10 @@ unity_gesture_xcb_dispatcher_glue_init (GObject *object)
grail_mask_set (mask, GRAIL_TYPE_SCALE);
grail_mask_set (mask, GRAIL_TYPE_PICK);
+ /* Pots and */
+ grail_mask_set (mask, GRAIL_TYPE_SWIPE);
+ grail_mask_set (mask, GRAIL_TYPE_BRUSH);
+
if (set_mask (connection, 0, 0, mask_len, (uint32_t*)mask))
{
g_warning ("Unable to initialize gesture dispatcher xcb");
@@ -104,6 +108,7 @@ unity_gesture_xcb_dispatcher_glue_init (GObject *object)
source->connection = connection;
source->dispatcher = object;
source->gesture_event = unity_gesture_event_new ();
+ source->gesture_event->pan_event = unity_gesture_pan_event_new ();
source->gesture_event->pinch_event = unity_gesture_pinch_event_new ();
source->gesture_event->tap_event = unity_gesture_tap_event_new ();
@@ -168,6 +173,11 @@ unity_gesture_xcb_dispatcher_glue_main_iteration (XCBSource *source)
switch (gesture_event->gesture_type)
{
+ case GRAIL_TYPE_SWIPE:
+ case GRAIL_TYPE_BRUSH:
+ dispatch_event->type = UNITY_GESTURE_TYPE_PAN;
+ dispatch_event->fingers = gesture_event->gesture_type == GRAIL_TYPE_SWIPE ? 3 : 4;
+ break;
case GRAIL_TYPE_SCALE:
case GRAIL_TYPE_PICK:
dispatch_event->type = UNITY_GESTURE_TYPE_PINCH;
diff --git a/unity-private/gesture/gesture-event.vala b/unity-private/gesture/gesture-event.vala
index cf1d1a701..322f1c17d 100644
--- a/unity-private/gesture/gesture-event.vala
+++ b/unity-private/gesture/gesture-event.vala
@@ -54,6 +54,7 @@ namespace Unity.Gesture
public Window event_window;
public Window child_window;
+ public PanEvent pan_event;
public PinchEvent pinch_event;
public TapEvent tap_event;
@@ -117,6 +118,11 @@ namespace Unity.Gesture
}
}
+ public class PanEvent
+ {
+ public float delta;
+ }
+
public class PinchEvent
{
public float delta;