[gtk+/multitouch: 11/27] Add multitouch-event signal and vfunc to GtkWidget
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch: 11/27] Add multitouch-event signal and vfunc to GtkWidget
- Date: Mon, 5 Dec 2011 01:17:03 +0000 (UTC)
commit 2f97d3a94a8ec1b5bfee5a43ffaae8c0d85e81f7
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 343d524..a468f1d 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1711,6 +1711,9 @@ gtk_main_do_event (GdkEvent *event)
case GDK_PROXIMITY_OUT:
case GDK_TOUCH_MOTION:
case GDK_TOUCH_RELEASE:
+ case GDK_MULTITOUCH_ADDED:
+ case GDK_MULTITOUCH_REMOVED:
+ case GDK_MULTITOUCH_UPDATED:
if ((event->type == GDK_BUTTON_RELEASE ||
event->type == GDK_TOUCH_RELEASE) &&
event->button.button == 1)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b570e83..b439be0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -483,6 +483,7 @@ enum {
STYLE_UPDATED,
CAPTURED_EVENT,
PRESS_AND_HOLD,
+ MULTITOUCH_EVENT,
LAST_SIGNAL
};
@@ -2946,6 +2947,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
@@ -6330,6 +6340,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 653c188..90201c6 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -440,6 +440,10 @@ struct _GtkWidgetClass
GtkPressAndHoldAction action,
gint x,
gint y);
+
+ gboolean (* multitouch_event) (GtkWidget *widget,
+ GdkEventMultiTouch *event);
+
/*< private >*/
GtkWidgetClassPrivate *priv;
@@ -449,7 +453,6 @@ struct _GtkWidgetClass
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
- void (*_gtk_reserved6) (void);
};
struct _GtkWidgetAuxInfo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]