[gtk+/touch-for-3.4-2: 10/44] gtk: Add a separate ::touch-event signal



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

    gtk: Add a separate ::touch-event signal

 gtk/gtkwidget.c |   16 ++++++++++++++++
 gtk/gtkwidget.h |    3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ff48312..1330a45 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -482,6 +482,7 @@ enum {
   QUERY_TOOLTIP,
   DRAG_FAILED,
   STYLE_UPDATED,
+  TOUCH_EVENT,
   LAST_SIGNAL
 };
 
@@ -1886,6 +1887,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.
@@ -6068,6 +6078,12 @@ gtk_widget_event_internal (GtkWidget *widget,
 	case GDK_2BUTTON_PRESS:
 	case GDK_3BUTTON_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;
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index a2d586a..4fd7fce 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -423,6 +423,9 @@ struct _GtkWidgetClass
 
   void         (* style_updated)          (GtkWidget *widget);
 
+  gboolean     (* touch_event)            (GtkWidget     *widget,
+                                           GdkEventTouch *event);
+
   /*< private >*/
 
   GtkWidgetClassPrivate *priv;



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