[gtk+/touch-for-3.4: 63/65] gtk: Add a separate ::touch-event signal



commit 468e2957e7912a90b814d1ab643b1921c8959e99
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 24 10:19:59 2012 -0500

    gtk: Add a separate ::touch-event signal
    
    This gets emitted for touch events now.

 gtk/gtkwidget.c |   19 ++++++++++++++++---
 gtk/gtkwidget.h |    4 ++++
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 77a9b80..e477a24 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -485,6 +485,7 @@ enum {
   DRAG_FAILED,
   STYLE_UPDATED,
   CAPTURED_EVENT,
+  TOUCH_EVENT,
   LAST_SIGNAL
 };
 
@@ -1921,6 +1922,15 @@ gtk_widget_class_init (GtkWidgetClass *klass)
 		  G_TYPE_BOOLEAN, 1,
 		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
 
+  widget_signals[TOUCH_EVENT] =
+    g_signal_new (I_("touch-event"),
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (GtkWidgetClass, touch_event),
+                  _gtk_boolean_handled_accumulator, NULL,
+                  _gtk_marshal_BOOLEAN__BOXED,
+                  G_TYPE_BOOLEAN, 1,
+                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   /**
    * GtkWidget::scroll-event:
    * @widget: the object which received the signal.
@@ -6143,18 +6153,21 @@ gtk_widget_event_internal (GtkWidget *widget,
 	case GDK_BUTTON_PRESS:
 	case GDK_2BUTTON_PRESS:
 	case GDK_3BUTTON_PRESS:
-        case GDK_TOUCH_PRESS:
 	  signal_num = BUTTON_PRESS_EVENT;
+          break;
+        case GDK_TOUCH_BEGIN:
+        case GDK_TOUCH_UPDATE:
+        case GDK_TOUCH_END:
+        case GDK_TOUCH_CANCEL:
+	  signal_num = TOUCH_EVENT;
 	  break;
 	case GDK_SCROLL:
 	  signal_num = SCROLL_EVENT;
 	  break;
 	case GDK_BUTTON_RELEASE:
-        case GDK_TOUCH_RELEASE:
 	  signal_num = BUTTON_RELEASE_EVENT;
 	  break;
 	case GDK_MOTION_NOTIFY:
-        case GDK_TOUCH_MOTION:
 	  signal_num = MOTION_NOTIFY_EVENT;
 	  break;
 	case GDK_DELETE:
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 14a1a84..442679b 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -427,6 +427,10 @@ struct _GtkWidgetClass
 
   gboolean     (* captured_event)         (GtkWidget *widget,
                                            GdkEvent  *event);
+
+  gboolean     (* touch_event)            (GtkWidget     *widget,
+                                           GdkEventTouch *event);
+
   /*< private >*/
 
   GtkWidgetClassPrivate *priv;



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