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



commit 94b03777e62d1f514b04af25b172e97c93b804d8
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 6162d63..79eaeb5 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1686,6 +1686,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 214791f..69f897e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -479,6 +479,7 @@ enum {
   QUERY_TOOLTIP,
   DRAG_FAILED,
   STYLE_UPDATED,
+  MULTITOUCH_EVENT,
   LAST_SIGNAL
 };
 
@@ -2865,6 +2866,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
@@ -6121,6 +6131,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 76d192c..0d370a8 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -425,6 +425,10 @@ struct _GtkWidgetClass
 
   void         (* style_updated)          (GtkWidget *widget);
 
+  /* Multitouch */
+  gboolean (* multitouch_event) (GtkWidget          *widget,
+                                 GdkEventMultiTouch *event);
+
   /*< private >*/
 
   GtkWidgetClassPrivate *priv;
@@ -436,7 +440,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]