[gtk+/touchscreens: 1/65] gdk: Add GDK_SOURCE_TOUCH
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touchscreens: 1/65] gdk: Add GDK_SOURCE_TOUCH
- Date: Tue, 13 Dec 2011 18:56:10 +0000 (UTC)
commit 343cc54b31c8a112de9c47e4c018edb290d43913
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 afa9f54..9d5787c 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]