[gnome-settings-daemon] wacom: Differentiate touch rings from touch strips



commit 125acd83571e293ad4e9911d4fd49b2f292e43f5
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Thu Nov 29 11:21:41 2012 +0100

    wacom: Differentiate touch rings from touch strips
    
    Using "up" and "down" on a ring is ambiguous, better use
    "CW" or "CCW" to indicate the circular motion on touch rings.
    
    Differentiating rings from strips is therefore required to use
    the appropriate terminology depending on the type of elevator.
    
    Replaces the type WACOM_TABLET_BUTTON_TYPE_ELEVATOR with
    WACOM_TABLET_BUTTON_TYPE_RING or WACOM_TABLET_BUTTON_TYPE_STRIP
    and uses "CW" or "CCW" to name touch ring circular motion.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689261

 plugins/wacom/gsd-wacom-device.c  |   16 ++++++++--------
 plugins/wacom/gsd-wacom-device.h  |    3 ++-
 plugins/wacom/gsd-wacom-manager.c |   19 ++++++++++++++++---
 plugins/wacom/list-wacom.c        |    6 ++++--
 4 files changed, 30 insertions(+), 14 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index ef06e28..bcc4154 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -1044,7 +1044,7 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
 			l = g_list_append (l, gsd_wacom_tablet_button_new (_("Left Ring"),
 									   "left-ring-mode-1",
 									   settings_path,
-									   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+									   WACOM_TABLET_BUTTON_TYPE_RING,
 									   group,
 									   0));
 		} else {
@@ -1054,7 +1054,7 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
 				l = g_list_append (l, gsd_wacom_tablet_button_new (name,
 				                                                   id,
 				                                                   settings_path,
-				                                                   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+				                                                   WACOM_TABLET_BUTTON_TYPE_RING,
 				                                                   group,
 				                                                   i - 1));
 				g_free (name);
@@ -1069,7 +1069,7 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
 			l = g_list_append (l, gsd_wacom_tablet_button_new (_("Right Ring"),
 									   "right-ring-mode-1",
 									   settings_path,
-									   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+									   WACOM_TABLET_BUTTON_TYPE_RING,
 									   group,
 									   0));
 		} else {
@@ -1079,7 +1079,7 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
 				l = g_list_append (l, gsd_wacom_tablet_button_new (name,
 				                                                   id,
 				                                                   settings_path,
-				                                                   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+				                                                   WACOM_TABLET_BUTTON_TYPE_RING,
 				                                                   group,
 				                                                   i - 1));
 				g_free (name);
@@ -1116,7 +1116,7 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
 			l = g_list_append (l, gsd_wacom_tablet_button_new (_("Left Touchstrip"),
 									   "left-strip-mode-1",
 									   settings_path,
-									   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+									   WACOM_TABLET_BUTTON_TYPE_STRIP,
 									   group,
 									   0));
 		} else {
@@ -1126,7 +1126,7 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
 				l = g_list_append (l, gsd_wacom_tablet_button_new (name,
 				                                                   id,
 				                                                   settings_path,
-				                                                   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+				                                                   WACOM_TABLET_BUTTON_TYPE_STRIP,
 				                                                   group,
 				                                                   i - 1));
 				g_free (name);
@@ -1141,7 +1141,7 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
 			l = g_list_append (l, gsd_wacom_tablet_button_new (_("Right Touchstrip"),
 									   "right-strip-mode-1",
 									   settings_path,
-									   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+									   WACOM_TABLET_BUTTON_TYPE_STRIP,
 									   group,
 									   0));
 		} else {
@@ -1151,7 +1151,7 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
 				l = g_list_append (l, gsd_wacom_tablet_button_new (name,
 				                                                   id,
 				                                                   settings_path,
-				                                                   WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+				                                                   WACOM_TABLET_BUTTON_TYPE_STRIP,
 				                                                   group,
 				                                                   i - 1));
 				g_free (name);
diff --git a/plugins/wacom/gsd-wacom-device.h b/plugins/wacom/gsd-wacom-device.h
index f24795b..d68353e 100644
--- a/plugins/wacom/gsd-wacom-device.h
+++ b/plugins/wacom/gsd-wacom-device.h
@@ -93,7 +93,8 @@ GsdWacomStylusType gsd_wacom_stylus_get_stylus_type (GsdWacomStylus *stylus);
 /* Tablet Buttons */
 typedef enum {
 	WACOM_TABLET_BUTTON_TYPE_NORMAL,
-	WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
+	WACOM_TABLET_BUTTON_TYPE_STRIP,
+	WACOM_TABLET_BUTTON_TYPE_RING,
 	WACOM_TABLET_BUTTON_TYPE_HARDCODED
 } GsdWacomTabletButtonType;
 
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index bcd14e2..2497a9f 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -1042,7 +1042,8 @@ generate_key (GsdWacomTabletButton *wbutton,
 	int                   n_keys;
 	guint                 i;
 
-	if (wbutton->type == WACOM_TABLET_BUTTON_TYPE_ELEVATOR)
+	if (wbutton->type == WACOM_TABLET_BUTTON_TYPE_STRIP ||
+	    wbutton->type == WACOM_TABLET_BUTTON_TYPE_RING)
 		str = get_elevator_shortcut_string (wbutton->settings, dir);
 	else
 		str = g_settings_get_string (wbutton->settings, KEY_CUSTOM_ACTION);
@@ -1133,6 +1134,19 @@ switch_monitor (GsdWacomDevice *device)
 	gsd_wacom_device_set_display (device, current_monitor);
 }
 
+static const char*
+get_direction_name (GsdWacomTabletButtonType type,
+                    GtkDirectionType         dir)
+{
+        if (type == WACOM_TABLET_BUTTON_TYPE_RING)
+                return (dir == GTK_DIR_UP ? " 'CCW'" : " 'CW'");
+
+        if (type == WACOM_TABLET_BUTTON_TYPE_STRIP)
+                return (dir == GTK_DIR_UP ? " 'up'" : " 'down'");
+
+        return "";
+}
+
 static GdkFilterReturn
 filter_button_events (XEvent          *xevent,
                       GdkEvent        *event,
@@ -1179,8 +1193,7 @@ filter_button_events (XEvent          *xevent,
 	g_debug ("Received event button %s '%s'%s ('%d') on device '%s' ('%d')",
 		 xiev->evtype == XI_ButtonPress ? "press" : "release",
 		 wbutton->id,
-		 wbutton->type == WACOM_TABLET_BUTTON_TYPE_ELEVATOR ?
-		 (dir == GTK_DIR_UP ? " 'up'" : " 'down'") : "",
+		 get_direction_name (wbutton->type, dir),
 		 button,
 		 gsd_wacom_device_get_name (device),
 		 deviceid);
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index 6f19633..76f462b 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -79,8 +79,10 @@ button_type_to_string (GsdWacomTabletButtonType type)
 	switch (type) {
 	case WACOM_TABLET_BUTTON_TYPE_NORMAL:
 		return "normal";
-	case WACOM_TABLET_BUTTON_TYPE_ELEVATOR:
-		return "elevator";
+	case WACOM_TABLET_BUTTON_TYPE_STRIP:
+		return "touch-strip";
+	case WACOM_TABLET_BUTTON_TYPE_RING:
+		return "touch-ring";
 	case WACOM_TABLET_BUTTON_TYPE_HARDCODED:
 		return "hard-coded";
 	default:



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