[gnome-settings-daemon] wacom: Add "Touch" device type



commit 79b0258366c3b4b988eb585e1dae49317f6af7a8
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 3 15:09:00 2012 +0000

    wacom: Add "Touch" device type
    
    This would allow touch to be rotated as needed when the rest of
    the tablet is.

 plugins/wacom/gsd-wacom-device.c |    8 +++++++-
 plugins/wacom/gsd-wacom-device.h |    3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 97acb3d..6d22479 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -359,7 +359,7 @@ static GsdWacomDeviceType
 get_device_type (XDeviceInfo *dev)
 {
 	GsdWacomDeviceType ret;
-        static Atom stylus, cursor, eraser, pad, prop;
+        static Atom stylus, cursor, eraser, pad, touch, prop;
         XDevice *device;
         Atom realtype;
         int realformat;
@@ -380,6 +380,8 @@ get_device_type (XDeviceInfo *dev)
                 cursor = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "CURSOR", False);
         if (!pad)
                 pad = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "PAD", False);
+        if (!touch)
+                touch = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "TOUCH", False);
         /* FIXME: Add touch type? */
         if (!prop)
 		prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Wacom Tool Type", False);
@@ -392,6 +394,8 @@ get_device_type (XDeviceInfo *dev)
 		ret = WACOM_TYPE_CURSOR;
 	else if (dev->type == pad)
 		ret = WACOM_TYPE_PAD;
+	else if (dev->type == touch)
+		ret = WACOM_TYPE_TOUCH;
 
 	if (ret == WACOM_TYPE_INVALID)
 		return ret;
@@ -1149,6 +1153,8 @@ gsd_wacom_device_type_to_string (GsdWacomDeviceType type)
 		return "Cursor";
 	case WACOM_TYPE_PAD:
 		return "Pad";
+	case WACOM_TYPE_TOUCH:
+		return "Touch";
 	default:
 		return "Unknown type";
 	}
diff --git a/plugins/wacom/gsd-wacom-device.h b/plugins/wacom/gsd-wacom-device.h
index d1b3b7d..51a1423 100644
--- a/plugins/wacom/gsd-wacom-device.h
+++ b/plugins/wacom/gsd-wacom-device.h
@@ -96,7 +96,8 @@ typedef enum {
         WACOM_TYPE_ERASER  =     (1 << 2),
         WACOM_TYPE_CURSOR  =     (1 << 3),
         WACOM_TYPE_PAD     =     (1 << 4),
-        WACOM_TYPE_ALL     =     WACOM_TYPE_STYLUS | WACOM_TYPE_ERASER | WACOM_TYPE_CURSOR | WACOM_TYPE_PAD
+        WACOM_TYPE_TOUCH   =     (1 << 5),
+        WACOM_TYPE_ALL     =     WACOM_TYPE_STYLUS | WACOM_TYPE_ERASER | WACOM_TYPE_CURSOR | WACOM_TYPE_PAD | WACOM_TYPE_TOUCH
 } GsdWacomDeviceType;
 
 GType gsd_wacom_device_get_type     (void);



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