[gtk+/touchscreens: 1/39] gdk: Add GDK_SOURCE_TOUCH
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touchscreens: 1/39] gdk: Add GDK_SOURCE_TOUCH
- Date: Wed, 23 Nov 2011 23:09:48 +0000 (UTC)
commit d3c44d3de2c8515ac9674d2d458f46f5780d5eb0
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Nov 23 19:36:51 2011 +0100
gdk: Add GDK_SOURCE_TOUCH
This device source applies to touch capable devices, most
notably touchscreens.
gdk/gdkdevice.h | 4 +++-
gdk/x11/gdkdevicemanager-xi2.c | 4 ++++
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 9109d65..3cd97d1 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -61,6 +61,7 @@ typedef enum
* of a stylus on a graphics tablet.
* @GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device.
* @GDK_SOURCE_KEYBOARD: the device is a keyboard.
+ * @GDK_SOURCE_TOUCH: the device is a touch capable device.
*
* An enumeration describing the type of an input device in general terms.
*/
@@ -70,7 +71,8 @@ typedef enum
GDK_SOURCE_PEN,
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR,
- GDK_SOURCE_KEYBOARD
+ GDK_SOURCE_KEYBOARD,
+ GDK_SOURCE_TOUCH
} GdkInputSource;
/**
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index c921ce0..6b9c890 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -254,6 +254,10 @@ create_device (GdkDeviceManager *device_manager,
input_source = GDK_SOURCE_ERASER;
else if (strstr (tmp_name, "cursor"))
input_source = GDK_SOURCE_CURSOR;
+ else if (strstr (tmp_name, "finger") ||
+ (strstr (tmp_name, "touch") &&
+ !strstr (tmp_name, "touchpad")))
+ input_source = GDK_SOURCE_TOUCH;
else if (strstr (tmp_name, "wacom") ||
strstr (tmp_name, "pen"))
input_source = GDK_SOURCE_PEN;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]