[gtk+/touch-for-3.4] Rename touch device types
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touch-for-3.4] Rename touch device types
- Date: Wed, 29 Feb 2012 21:51:58 +0000 (UTC)
commit a7f7d5e0cc13de2f037d7884f8101e2de7137a1f
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 29 16:10:32 2012 -0500
Rename touch device types
Instead of GDK_SOURCE_[IN]DIRECT_TOUCH, call then
GDK_SOURCE_TOUCHSCREEN and GDK_SOURCE_TOUCHPAD. This matches
what Qt does, is a better fit with the rest of the enumeration,
and doesn't imply that there won't be further touch device
types down the road.
Update all users.
gdk/gdkdevice.h | 8 ++++----
gdk/gdkdisplay.c | 4 ++--
gdk/gdkwindow.c | 16 ++++++++--------
gdk/x11/gdkdevicemanager-xi2.c | 6 +++---
gtk/gtkmenu.c | 16 ++++++++--------
gtk/gtkmenuitem.c | 2 +-
gtk/gtkmenushell.c | 2 +-
gtk/gtkpaned.c | 2 +-
gtk/gtkrange.c | 6 +++---
gtk/gtkscrolledwindow.c | 6 +++---
gtk/gtktooltip.c | 2 +-
11 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 05a360c..ccd879b 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -61,9 +61,9 @@ 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_DIRECT_TOUCH: the device is a direct-input touch device, such
+ * @GDK_SOURCE_TOUCHSCREEN: the device is a direct-input touch device, such
* as a touchscreen or tablet. This device type has been added in 3.4.
- * @GDK_SOURCE_INDIRECT_TOUCH: the device is an indirect touch device, such
+ * @GDK_SOURCE_TOUCHPAD: the device is an indirect touch device, such
* as a touchpad. This device type has been added in 3.4.
*
* An enumeration describing the type of an input device in general terms.
@@ -75,8 +75,8 @@ typedef enum
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR,
GDK_SOURCE_KEYBOARD,
- GDK_SOURCE_DIRECT_TOUCH,
- GDK_SOURCE_INDIRECT_TOUCH
+ GDK_SOURCE_TOUCHSCREEN,
+ GDK_SOURCE_TOUCHPAD
} GdkInputSource;
/**
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 0619f60..beaea01 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -974,8 +974,8 @@ switch_to_pointer_grab (GdkDisplay *display,
* synthesized when needed.
*/
if (source_device &&
- (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH ||
- gdk_device_get_source (source_device) == GDK_SOURCE_INDIRECT_TOUCH))
+ (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
info->need_touch_press_enter = TRUE;
pointer_window = NULL;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 58c4294..39a84a4 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9267,8 +9267,8 @@ proxy_pointer_event (GdkDisplay *display,
non_linear = TRUE;
if (pointer_info->need_touch_press_enter &&
- gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_DIRECT_TOUCH &&
- gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_INDIRECT_TOUCH &&
+ gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHSCREEN &&
+ gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHPAD &&
(source_event->type != GDK_TOUCH_UPDATE ||
_gdk_event_get_pointer_emulated (source_event)))
{
@@ -9680,8 +9680,8 @@ proxy_button_event (GdkEvent *source_event,
* which synthesized a leave notify event, so synthesize another enter
* notify to tell the pointer is on the window.
*/
- if (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH ||
- gdk_device_get_source (source_device) == GDK_SOURCE_INDIRECT_TOUCH)
+ if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD)
mode = GDK_CROSSING_TOUCH_PRESS;
else
mode = GDK_CROSSING_DEVICE_SWITCH;
@@ -9734,8 +9734,8 @@ proxy_button_event (GdkEvent *source_event,
_gdk_event_button_generate (display, event);
else if (type == GDK_BUTTON_RELEASE &&
pointer_window == pointer_info->window_under_pointer &&
- (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH ||
- gdk_device_get_source (source_device) == GDK_SOURCE_INDIRECT_TOUCH))
+ (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
{
/* Synthesize a leave notify event
* whenever a touch device is released
@@ -9770,8 +9770,8 @@ proxy_button_event (GdkEvent *source_event,
if ((type == GDK_TOUCH_END &&
_gdk_event_get_pointer_emulated (source_event)) &&
pointer_window == pointer_info->window_under_pointer &&
- (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH ||
- gdk_device_get_source (source_device) == GDK_SOURCE_INDIRECT_TOUCH))
+ (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
{
/* Synthesize a leave notify event
* whenever a touch device is released
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index f1044be..c2fd87e 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -271,9 +271,9 @@ is_touch_device (XIAnyClassInfo **classes,
if (class->num_touches > 0)
{
if (class->mode == XIDirectTouch)
- *device_type = GDK_SOURCE_DIRECT_TOUCH;
+ *device_type = GDK_SOURCE_TOUCHSCREEN;
else if (class->mode == XIDependentTouch)
- *device_type = GDK_SOURCE_INDIRECT_TOUCH;
+ *device_type = GDK_SOURCE_TOUCHPAD;
else
continue;
@@ -317,7 +317,7 @@ create_device (GdkDeviceManager *device_manager,
else if (strstr (tmp_name, "finger") ||
(strstr (tmp_name, "touch") &&
!strstr (tmp_name, "touchpad")))
- input_source = GDK_SOURCE_DIRECT_TOUCH;
+ input_source = GDK_SOURCE_TOUCHSCREEN;
else if (strstr (tmp_name, "wacom") ||
strstr (tmp_name, "pen"))
input_source = GDK_SOURCE_PEN;
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1e1b2ee..a7de964 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1679,7 +1679,7 @@ gtk_menu_popup_for_device (GtkMenu *menu,
/* if no item is selected, select the first one */
if (!menu_shell->priv->active_menu_item &&
- source_device && gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
+ source_device && gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
gtk_menu_shell_select_first (menu_shell, TRUE);
/* Once everything is set up correctly, map the toplevel */
@@ -3374,7 +3374,7 @@ gtk_menu_button_press (GtkWidget *widget,
return TRUE;
if (GTK_IS_MENU_ITEM (event_widget) &&
- gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH &&
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN &&
GTK_MENU_ITEM (event_widget)->priv->submenu != NULL &&
!gtk_widget_is_drawable (GTK_MENU_ITEM (event_widget)->priv->submenu))
menu->priv->ignore_button_release = TRUE;
@@ -3647,7 +3647,7 @@ gtk_menu_motion_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
if (GTK_IS_MENU (widget) &&
- gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
+ gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN)
{
GtkMenuPrivate *priv = GTK_MENU(widget)->priv;
@@ -4115,7 +4115,7 @@ gtk_menu_enter_notify (GtkWidget *widget,
menu_item = gtk_get_event_widget ((GdkEvent*) event);
if (GTK_IS_MENU (widget) &&
- gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
+ gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN)
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
@@ -4124,7 +4124,7 @@ gtk_menu_enter_notify (GtkWidget *widget,
event->x_root, event->y_root, TRUE, TRUE);
}
- if (gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH &&
+ if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN &&
GTK_IS_MENU_ITEM (menu_item))
{
GtkWidget *menu = gtk_widget_get_parent (menu_item);
@@ -4197,7 +4197,7 @@ gtk_menu_leave_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
- if (gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
+ if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN)
gtk_menu_handle_scrolling (menu, event->x_root, event->y_root, FALSE, TRUE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
@@ -4279,7 +4279,7 @@ gtk_menu_captured_event (GtkWidget *widget,
case GDK_TOUCH_BEGIN:
case GDK_BUTTON_PRESS:
if ((!gdk_event_get_button (event, &button) || button == 1) &&
- gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH &&
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN &&
pointer_on_menu_widget (menu, x_root, y_root))
{
priv->drag_start_y = event->button.y_root;
@@ -4305,7 +4305,7 @@ gtk_menu_captured_event (GtkWidget *widget,
case GDK_MOTION_NOTIFY:
if ((!gdk_event_get_state (event, &state) || (state & GDK_BUTTON1_MASK)
!= 0) &&
- gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
{
if (!priv->drag_already_pressed)
{
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index cc92824..46556ee 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1702,7 +1702,7 @@ gtk_real_menu_item_select (GtkMenuItem *menu_item)
}
if ((!source_device ||
- gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH) &&
+ gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN) &&
priv->submenu &&
(!gtk_widget_get_mapped (priv->submenu) ||
GTK_MENU (priv->submenu)->priv->tearoff_active))
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 5e541af..24f4dd7 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1088,7 +1088,7 @@ gtk_menu_shell_enter_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
- if (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
+ if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
_gtk_menu_item_popup_submenu (menu_item, TRUE);
}
}
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 4eb5a56..fe4577d 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1920,7 +1920,7 @@ gtk_paned_captured_event (GtkWidget *widget,
gdk_event_get_coords (event, &event_x, &event_y);
if (!source_device ||
- gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
+ gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN)
return FALSE;
switch (event->type)
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index cc3c9e2..e45cffa 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2554,7 +2554,7 @@ gtk_range_button_press (GtkWidget *widget,
return TRUE;
}
- if (source != GDK_SOURCE_DIRECT_TOUCH &&
+ if (source != GDK_SOURCE_TOUCHSCREEN &&
priv->mouse_location == MOUSE_TROUGH &&
event->button == GDK_BUTTON_PRIMARY)
{
@@ -2606,7 +2606,7 @@ gtk_range_button_press (GtkWidget *widget,
return TRUE;
}
else if ((priv->mouse_location == MOUSE_TROUGH &&
- (source == GDK_SOURCE_DIRECT_TOUCH || event->button == GDK_BUTTON_MIDDLE)) ||
+ (source == GDK_SOURCE_TOUCHSCREEN || event->button == GDK_BUTTON_MIDDLE)) ||
priv->mouse_location == MOUSE_SLIDER)
{
gboolean need_value_update = FALSE;
@@ -2616,7 +2616,7 @@ gtk_range_button_press (GtkWidget *widget,
* On button 2 press and touch devices, we warp the slider to
* mouse position, then begin the slider drag.
*/
- if (event->button == GDK_BUTTON_MIDDLE || source == GDK_SOURCE_DIRECT_TOUCH)
+ if (event->button == GDK_BUTTON_MIDDLE || source == GDK_SOURCE_TOUCHSCREEN)
{
gdouble slider_low_value, slider_high_value, new_value;
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 46c9ffb..1acd5f2 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -483,7 +483,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* GtkScrolledWindow:kinetic-scrolling:
*
* The kinetic scrolling behavior flags. Kinetic scrolling
- * only applies to devices with source %GDK_SOURCE_DIRECT_TOUCH
+ * only applies to devices with source %GDK_SOURCE_TOUCHSCREEN
*
* Since: 3.4
*/
@@ -1112,7 +1112,7 @@ gtk_scrolled_window_get_shadow_type (GtkScrolledWindow *scrolled_window)
*
* Turns kinetic scrolling on or off.
* Kinetic scrolling only applies to devices with source
- * %GDK_SOURCE_DIRECT_TOUCH.
+ * %GDK_SOURCE_TOUCHSCREEN.
*
* Since: 3.4
**/
@@ -2673,7 +2673,7 @@ gtk_scrolled_window_captured_button_press (GtkWidget *widget,
source_device = gdk_event_get_source_device (event);
source = gdk_device_get_source (source_device);
- if (source != GDK_SOURCE_DIRECT_TOUCH)
+ if (source != GDK_SOURCE_TOUCHSCREEN)
return FALSE;
event_widget = gtk_get_event_widget (event);
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index a30d99c..a5349d3 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -1560,7 +1560,7 @@ tooltips_enabled (GdkEvent *event)
"gtk-enable-tooltips", &enabled,
NULL);
- if (enabled && source != GDK_SOURCE_DIRECT_TOUCH)
+ if (enabled && source != GDK_SOURCE_TOUCHSCREEN)
return TRUE;
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]