[gtk+/xi21: 11/12] Add multitouch-event signal and vfunc to GtkWidget



commit f48204d4af13a733de6a5e72202961557b40f23d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Mar 11 21:25:30 2011 +0100

    Add multitouch-event signal and vfunc to GtkWidget

 gtk/gtkmain.c   |    3 +++
 gtk/gtkwidget.c |   15 +++++++++++++++
 gtk/gtkwidget.h |    5 ++++-
 3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 234dc98..3c1ccc8 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1872,6 +1872,9 @@ gtk_main_do_event (GdkEvent *event)
     case GDK_TOUCH_MOTION:
     case GDK_TOUCH_PRESS:
     case GDK_TOUCH_RELEASE:
+    case GDK_MULTITOUCH_ADDED:
+    case GDK_MULTITOUCH_REMOVED:
+    case GDK_MULTITOUCH_UPDATED:
       gtk_propagate_event (grab_widget, event);
       break;
 
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 343cc03..27fce36 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -471,6 +471,7 @@ enum {
   QUERY_TOOLTIP,
   DRAG_FAILED,
   STYLE_UPDATED,
+  MULTITOUCH_EVENT,
   LAST_SIGNAL
 };
 
@@ -2844,6 +2845,15 @@ gtk_widget_class_init (GtkWidgetClass *klass)
 		  G_TYPE_BOOLEAN, 1,
 		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
 
+  widget_signals[MULTITOUCH_EVENT] =
+    g_signal_new (I_("multitouch-event"),
+		  G_TYPE_FROM_CLASS (klass),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (GtkWidgetClass, multitouch_event),
+		  _gtk_boolean_handled_accumulator, NULL,
+		  _gtk_marshal_BOOLEAN__BOXED,
+		  G_TYPE_BOOLEAN, 1,
+		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   /**
    * GtkWidget::query-tooltip:
    * @widget: the object which received the signal
@@ -6072,6 +6082,11 @@ gtk_widget_event_internal (GtkWidget *widget,
 	case GDK_DAMAGE:
 	  signal_num = DAMAGE_EVENT;
 	  break;
+        case GDK_MULTITOUCH_ADDED:
+        case GDK_MULTITOUCH_REMOVED:
+        case GDK_MULTITOUCH_UPDATED:
+          signal_num = MULTITOUCH_EVENT;
+          break;
 	default:
 	  g_warning ("gtk_widget_event(): unhandled event type: %d", event->type);
 	  signal_num = -1;
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index c391b22..c1953cd 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -423,6 +423,10 @@ struct _GtkWidgetClass
 
   void         (* style_updated)          (GtkWidget *widget);
 
+  /* Multitouch */
+  gboolean (* multitouch_event) (GtkWidget          *widget,
+                                 GdkEventMultiTouch *event);
+
   /*< private >*/
 
   /* Padding for future expansion */
@@ -433,7 +437,6 @@ struct _GtkWidgetClass
   void (*_gtk_reserved5) (void);
   void (*_gtk_reserved6) (void);
   void (*_gtk_reserved7) (void);
-  void (*_gtk_reserved8) (void);
 };
 
 struct _GtkWidgetAuxInfo



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