From 2e903243c69a5c9c6b6498a77a10d49b7e78846f Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 26 May 2014 12:08:55 +0200 Subject: [PATCH] eventcontroller: Make the event-mask property and methods private. This will rarely have any use if no subclassing is allowed, so just make it private for our own. --- docs/reference/gtk/gtk3-sections.txt | 2 -- gtk/gtkeventcontroller.c | 45 +--------------------------- gtk/gtkeventcontroller.h | 6 ---- gtk/gtkeventcontrollerprivate.h | 4 +++ gtk/gtkgesture.c | 1 + gtk/inspector/gestures.c | 2 +- 6 files changed, 7 insertions(+), 53 deletions(-) diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index 00aafed652..f850febafc 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -7899,8 +7899,6 @@ gtk_popover_get_modal GtkEventController GtkEventController gtk_event_controller_handle_event -gtk_event_controller_get_event_mask -gtk_event_controller_set_event_mask gtk_event_controller_get_widget gtk_event_controller_reset diff --git a/gtk/gtkeventcontroller.c b/gtk/gtkeventcontroller.c index c43024ebc8..84a2702b69 100644 --- a/gtk/gtkeventcontroller.c +++ b/gtk/gtkeventcontroller.c @@ -40,8 +40,7 @@ typedef struct _GtkEventControllerPrivate GtkEventControllerPrivate; enum { - PROP_WIDGET = 1, - PROP_EVENT_MASK + PROP_WIDGET = 1 }; enum { @@ -82,9 +81,6 @@ gtk_event_controller_set_property (GObject *object, case PROP_WIDGET: priv->widget = g_value_get_object (value); break; - case PROP_EVENT_MASK: - priv->evmask = g_value_get_flags (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -105,9 +101,6 @@ gtk_event_controller_get_property (GObject *object, case PROP_WIDGET: g_value_set_object (value, priv->widget); break; - case PROP_EVENT_MASK: - g_value_set_flags (value, priv->evmask); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -139,20 +132,6 @@ gtk_event_controller_class_init (GtkEventControllerClass *klass) GTK_TYPE_WIDGET, GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - /** - * GtkEventController:event-mask: - * - * Set of events that the controller handles. - * - * Since: 3.14 - */ - g_object_class_install_property (object_class, - PROP_EVENT_MASK, - g_param_spec_flags ("event-mask", - P_("Event mask"), - P_("Event mask the controller handles"), - GDK_TYPE_EVENT_MASK, 0, - GTK_PARAM_READWRITE)); /** * GtkEventController::handle-event: * @controller: the object which receives the signal @@ -223,17 +202,6 @@ gtk_event_controller_handle_event (GtkEventController *controller, return retval; } -/** - * gtk_event_controller_set_event_mask: - * @controller: a #GtkEventController - * @event_mask: mask for the events the controller handles - * - * Sets the event mask that the controller handles. This is only - * meant for #GtkEventController implementations and should not be - * called in applications. - * - * Since: 3.14 - **/ void gtk_event_controller_set_event_mask (GtkEventController *controller, GdkEventMask event_mask) @@ -248,19 +216,8 @@ gtk_event_controller_set_event_mask (GtkEventController *controller, return; priv->evmask = event_mask; - g_object_notify (G_OBJECT (controller), "event-mask"); } -/** - * gtk_event_controller_get_event_mask: - * @controller: a #GtkEventController - * - * Returns the event mask necessary for the events handled by @controller. - * - * Returns: the controller event mask - * - * Since: 3.14 - **/ GdkEventMask gtk_event_controller_get_event_mask (GtkEventController *controller) { diff --git a/gtk/gtkeventcontroller.h b/gtk/gtkeventcontroller.h index 9bf0531911..3069cef670 100644 --- a/gtk/gtkeventcontroller.h +++ b/gtk/gtkeventcontroller.h @@ -47,12 +47,6 @@ GType gtk_event_controller_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_3_14 GtkWidget * gtk_event_controller_get_widget (GtkEventController *controller); -GDK_AVAILABLE_IN_3_14 -void gtk_event_controller_set_event_mask (GtkEventController *controller, - GdkEventMask event_mask); -GDK_AVAILABLE_IN_3_14 -GdkEventMask gtk_event_controller_get_event_mask (GtkEventController *controller); - GDK_AVAILABLE_IN_3_14 gboolean gtk_event_controller_handle_event (GtkEventController *controller, const GdkEvent *event); diff --git a/gtk/gtkeventcontrollerprivate.h b/gtk/gtkeventcontrollerprivate.h index 0fa3c55027..603da71a7d 100644 --- a/gtk/gtkeventcontrollerprivate.h +++ b/gtk/gtkeventcontrollerprivate.h @@ -39,4 +39,8 @@ struct _GtkEventControllerClass gpointer padding[10]; }; +void gtk_event_controller_set_event_mask (GtkEventController *controller, + GdkEventMask event_mask); +GdkEventMask gtk_event_controller_get_event_mask (GtkEventController *controller); + #endif /* __GTK_EVENT_CONTROLLER_PRIVATE_H__ */ diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index bb16c86562..d4b400d1e2 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -113,6 +113,7 @@ #include "config.h" #include "gtkgesture.h" #include "gtkwidgetprivate.h" +#include "gtkeventcontrollerprivate.h" #include "gtkgestureprivate.h" #include "gtktypebuiltins.h" #include "gtkprivate.h" diff --git a/gtk/inspector/gestures.c b/gtk/inspector/gestures.c index b2cca152a6..8424c1e710 100644 --- a/gtk/inspector/gestures.c +++ b/gtk/inspector/gestures.c @@ -74,7 +74,7 @@ phase_changed_cb (GtkComboBox *combo, GtkInspectorGestures *sl) phase = gtk_combo_box_get_active (combo); row = gtk_widget_get_ancestor (GTK_WIDGET (combo), GTK_TYPE_LIST_BOX_ROW); gesture = GTK_GESTURE (g_object_get_data (G_OBJECT (row), "gesture")); - gtk_gesture_attach (gesture, phase); + gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), phase); } static void