diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-05-06 18:04:25 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2014-05-23 19:54:29 +0200 |
commit | 0288fd0a88471b63d707be4d9542ad1aab5f4d2a (patch) | |
tree | a1e10dd858439c5458a5bbdb1daf00303a05b3e5 | |
parent | 994c94c25b1a02d8a9df2360f62e346f59c6170e (diff) | |
download | gtk+-0288fd0a88471b63d707be4d9542ad1aab5f4d2a.tar.gz |
gesture: Make gtk_gesture_check() private
-rw-r--r-- | docs/reference/gtk/gtk3-sections.txt | 1 | ||||
-rw-r--r-- | gtk/gtkgesture.c | 46 | ||||
-rw-r--r-- | gtk/gtkgesturelongpress.c | 3 | ||||
-rw-r--r-- | gtk/gtkgesturemultipress.c | 3 | ||||
-rw-r--r-- | gtk/gtkgestureprivate.h | 2 |
5 files changed, 14 insertions, 41 deletions
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index 51729188d9..dd8a07e8ca 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -7923,7 +7923,6 @@ gtk_gesture_get_window gtk_gesture_set_window gtk_gesture_is_active gtk_gesture_is_recognized -gtk_gesture_check GtkEventSequenceState gtk_gesture_get_sequence_state gtk_gesture_set_sequence_state diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 28a07c6206..131d6cabc9 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -104,7 +104,6 @@ enum { }; enum { - CHECK, BEGIN, END, UPDATE, @@ -252,11 +251,15 @@ _gtk_gesture_set_recognized (GtkGesture *gesture, static gboolean _gtk_gesture_do_check (GtkGesture *gesture) { - gboolean retval; + GtkGestureClass *gesture_class; + gboolean retval = FALSE; - g_signal_emit (G_OBJECT (gesture), signals[CHECK], 0, &retval); - retval = retval != FALSE; + gesture_class = GTK_GESTURE_GET_CLASS (gesture); + if (!gesture_class->check) + return retval; + + retval = gesture_class->check (gesture); return retval; } @@ -603,26 +606,6 @@ gtk_gesture_class_init (GtkGestureClass *klass) TRUE, GTK_PARAM_READWRITE)); /** - * GtkGesture::check: - * @gesture: the object which received the signal - * - * This signal is triggered when the number of interacting touch - * points become the expected by @gesture (see the #GtkGesture:n-points - * property). If a handler returns #TRUE, the gesture is recognized. - * - * Return value: #TRUE if the gesture is recognized, #FALSE otherwise. - * - * Since: 3.14 - */ - signals[CHECK] = - g_signal_new ("check", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkGestureClass, check), - g_signal_accumulator_true_handled, - NULL, NULL, - G_TYPE_BOOLEAN, 0); - /** * GtkGesture::begin: * @gesture: the object which received the signal * @sequence: the #GdkEventSequence that made the gesture to be recognized @@ -1216,21 +1199,8 @@ gtk_gesture_is_recognized (GtkGesture *gesture) return priv->recognized; } -/** - * gtk_gesture_check: - * @gesture: a #GtkGesture - * - * Triggers a check on the @gesture, this should only be called by - * implementations of #GtkGesture, in order to force gesture recognition - * to finish if eg. some implementation-dependent criteria doesn't match - * anymore. - * - * Returns: Whether the gesture is recognized. - * - * Since: 3.14 - **/ gboolean -gtk_gesture_check (GtkGesture *gesture) +_gtk_gesture_check (GtkGesture *gesture) { GtkGesturePrivate *priv; diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c index 38e83bd428..f260c43cbf 100644 --- a/gtk/gtkgesturelongpress.c +++ b/gtk/gtkgesturelongpress.c @@ -35,6 +35,7 @@ #include "config.h" #include "gtkgesturelongpress.h" #include "gtkgesturelongpressprivate.h" +#include "gtkgestureprivate.h" #include "gtkmarshalers.h" #include "gtkdnd.h" #include "gtkprivate.h" @@ -152,7 +153,7 @@ gtk_gesture_long_press_update (GtkGesture *gesture, } priv->cancelled = TRUE; - gtk_gesture_check (gesture); + _gtk_gesture_check (gesture); } } diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgesturemultipress.c index 0de8c999ab..5e99f6b0ad 100644 --- a/gtk/gtkgesturemultipress.c +++ b/gtk/gtkgesturemultipress.c @@ -35,6 +35,7 @@ */ #include "config.h" +#include "gtkgestureprivate.h" #include "gtkgesturemultipress.h" #include "gtkgesturemultipressprivate.h" #include "gtkprivate.h" @@ -112,7 +113,7 @@ _gtk_gesture_multi_press_stop (GtkGestureMultiPress *gesture) priv->current_button = 0; priv->n_presses = 0; g_signal_emit (gesture, signals[STOPPED], 0); - gtk_gesture_check (GTK_GESTURE (gesture)); + _gtk_gesture_check (GTK_GESTURE (gesture)); } static gboolean diff --git a/gtk/gtkgestureprivate.h b/gtk/gtkgestureprivate.h index fb3ae7d037..d66b3ee093 100644 --- a/gtk/gtkgestureprivate.h +++ b/gtk/gtkgestureprivate.h @@ -54,6 +54,8 @@ struct _GtkGestureClass G_BEGIN_DECLS +gboolean _gtk_gesture_check (GtkGesture *gesture); + gboolean _gtk_gesture_handled_sequence_press (GtkGesture *gesture, GdkEventSequence *sequence); |