[mutter/wip/multitouch: 66/73] device-map: Add grab/ungrab_touch() methods



commit d115c90ed18042c50e2228eeac4b1079dd386822
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 2 21:13:54 2011 +0200

    device-map: Add grab/ungrab_touch() methods
    
    These functions deal with passive touch grabs, where
    available

 src/core/device-map-private.h |    9 +++++++++
 src/core/device-map.c         |   30 ++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/src/core/device-map-private.h b/src/core/device-map-private.h
index 00a2fcb..11a6253 100644
--- a/src/core/device-map-private.h
+++ b/src/core/device-map-private.h
@@ -76,6 +76,10 @@ struct _MetaDeviceMapClass
                                Window         xwindow,
                                guint          n_button,
                                guint          modifiers);
+  void     (* grab_touch)     (MetaDeviceMap *pointer,
+                               Window         xwindow);
+  void     (* ungrab_touch)   (MetaDeviceMap *pointer,
+                               Window         xwindow);
 };
 
 GType           meta_device_map_get_type (void) G_GNUC_CONST;
@@ -108,4 +112,9 @@ void     meta_device_map_ungrab_button   (MetaDeviceMap      *device_map,
                                           guint               n_button,
                                           guint               modifiers);
 
+void     meta_device_map_grab_touch      (MetaDeviceMap      *device_map,
+                                          Window              xwindow);
+void     meta_device_map_ungrab_touch    (MetaDeviceMap      *device_map,
+                                          Window              xwindow);
+
 #endif /* META_DEVICE_MAP_PRIVATE_H */
diff --git a/src/core/device-map.c b/src/core/device-map.c
index 33af95a..c8627ed 100644
--- a/src/core/device-map.c
+++ b/src/core/device-map.c
@@ -397,3 +397,33 @@ meta_device_map_ungrab_button (MetaDeviceMap *device_map,
   if (klass->ungrab_button)
     (klass->ungrab_button) (device_map, xwindow, n_button, modifiers);
 }
+
+void
+meta_device_map_grab_touch (MetaDeviceMap *device_map,
+                            Window         xwindow)
+{
+  MetaDeviceMapClass *klass;
+
+  g_return_if_fail (META_IS_DEVICE_MAP (device_map));
+  g_return_if_fail (xwindow != None);
+
+  klass = META_DEVICE_MAP_GET_CLASS (device_map);
+
+  if (klass->grab_touch)
+    (klass->grab_touch) (device_map, xwindow);
+}
+
+void
+meta_device_map_ungrab_touch (MetaDeviceMap *device_map,
+                              Window         xwindow)
+{
+  MetaDeviceMapClass *klass;
+
+  g_return_if_fail (META_IS_DEVICE_MAP (device_map));
+  g_return_if_fail (xwindow != None);
+
+  klass = META_DEVICE_MAP_GET_CLASS (device_map);
+
+  if (klass->ungrab_touch)
+    (klass->ungrab_touch) (device_map, xwindow);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]