[maemo-commits] [maemo-commits] r16188 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Sep 23 14:40:10 EEST 2008
Author: kris
Date: 2008-09-23 14:40:07 +0300 (Tue, 23 Sep 2008)
New Revision: 16188

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkwidget.c
Log:
2008-09-23  Kristian Rietveld  <kris at imendio.com>

	* gtk/gtkwidget.c (gtk_widget_class_init),
	(gtk_widget_tap_and_hold_query_accumulator): implement a custom
	boolean accumulator for the tap-and-hold-query signal that stops
	emission when FALSE is returned by the signal handler.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2008-09-23 11:34:09 UTC (rev 16187)
+++ projects/haf/trunk/gtk+/ChangeLog	2008-09-23 11:40:07 UTC (rev 16188)
@@ -1,3 +1,10 @@
+2008-09-23  Kristian Rietveld  <kris at imendio.com>
+
+	* gtk/gtkwidget.c (gtk_widget_class_init),
+	(gtk_widget_tap_and_hold_query_accumulator): implement a custom
+	boolean accumulator for the tap-and-hold-query signal that stops
+	emission when FALSE is returned by the signal handler.
+
 2008-09-15  Claudio Saavedra  <csaavedra at igalia.com>
 
 	Released 2:2.12.9-1maemo1

Modified: projects/haf/trunk/gtk+/gtk/gtkwidget.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkwidget.c	2008-09-23 11:34:09 UTC (rev 16187)
+++ projects/haf/trunk/gtk+/gtk/gtkwidget.c	2008-09-23 11:40:07 UTC (rev 16188)
@@ -324,22 +324,27 @@
 
 
 /* --- Tap And Hold --- */
-static gboolean gtk_widget_tap_and_hold_timeout      (GtkWidget                *widget);
-static gboolean gtk_widget_tap_and_hold_button_press (GtkWidget                *widget,
-						      GdkEvent                 *event,
-						      TahData                  *td);
-static gboolean gtk_widget_tap_and_hold_event_stop   (GtkWidget                *widget,
-						      gpointer                  unused,
-						      TahData                  *td);
-static void     gtk_widget_real_tap_and_hold_setup   (GtkWidget                *widget,
-						      GtkWidget                *menu,
-						      GtkCallback               func,
-						      GtkWidgetTapAndHoldFlags  flags );
-static void     gtk_widget_real_tap_and_hold         (GtkWidget                *widget);
-static gboolean gtk_widget_tap_and_hold_query        (GtkWidget                *widget,
-						      GdkEvent                 *event);
-static gboolean gtk_widget_real_tap_and_hold_query   (GtkWidget                *widget,
-						      GdkEvent                 *event);
+static gboolean gtk_widget_tap_and_hold_timeout           (GtkWidget                *widget);
+static gboolean gtk_widget_tap_and_hold_button_press      (GtkWidget                *widget,
+                                                           GdkEvent                 *event,
+                                                           TahData                  *td);
+static gboolean gtk_widget_tap_and_hold_event_stop        (GtkWidget                *widget,
+                                                           gpointer                  unused,
+                                                           TahData                  *td);
+static void     gtk_widget_real_tap_and_hold_setup        (GtkWidget                *widget,
+                                                           GtkWidget                *menu,
+                                                           GtkCallback               func,
+                                                           GtkWidgetTapAndHoldFlags  flags );
+static void     gtk_widget_real_tap_and_hold              (GtkWidget                *widget);
+static gboolean gtk_widget_tap_and_hold_query             (GtkWidget                *widget,
+                                                           GdkEvent                 *event);
+static gboolean gtk_widget_real_tap_and_hold_query        (GtkWidget                *widget,
+                                                           GdkEvent                 *event);
+
+static gboolean gtk_widget_tap_and_hold_query_accumulator (GSignalInvocationHint    *ihint,
+                                                           GValue                   *return_accu,
+                                                           const GValue             *handler_return,
+                                                           gpointer                  dummy);
 #endif /* MAEMO_CHANGES */
 
 
@@ -2348,7 +2353,7 @@
                              G_TYPE_FROM_CLASS (gobject_class),
                              G_SIGNAL_RUN_LAST,
                              G_CALLBACK (gtk_widget_real_tap_and_hold_query),
-                             _gtk_boolean_handled_accumulator, NULL,
+                             gtk_widget_tap_and_hold_query_accumulator, NULL,
                              _gtk_marshal_BOOLEAN__BOXED,
                              G_TYPE_BOOLEAN, 1,
                              GDK_TYPE_EVENT);
@@ -10564,6 +10569,30 @@
 }
 
 static gboolean
+gtk_widget_tap_and_hold_query_accumulator (GSignalInvocationHint *ihint,
+                                           GValue                *return_accu,
+                                           const GValue          *handler_return,
+                                           gpointer               dummy)
+{
+  gboolean continue_emission;
+  gboolean tap_and_hold_not_allowed;
+
+  /* The semantics of the tap-and-hold-query return value differs from
+   * the normal event signal handlers.
+   */
+
+  tap_and_hold_not_allowed = g_value_get_boolean (handler_return);
+  g_value_set_boolean (return_accu, tap_and_hold_not_allowed);
+
+  /* tap_and_hold_not_allowed == FALSE means invoke tap-and-hold,
+   * in this case we do not continue emission.
+   */
+  continue_emission = (tap_and_hold_not_allowed != FALSE);
+
+  return continue_emission;
+}
+
+static gboolean
 gtk_widget_real_tap_and_hold_query (GtkWidget *widget,
 				    GdkEvent  *event)
 {


More information about the maemo-commits mailing list