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.
This commit is contained in:
Carlos Garnacho 2014-05-26 12:08:55 +02:00
parent ef61c9c58b
commit 2e903243c6
6 changed files with 7 additions and 53 deletions

View File

@ -7899,8 +7899,6 @@ gtk_popover_get_modal
<TITLE>GtkEventController</TITLE>
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

View File

@ -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)
{

View File

@ -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);

View File

@ -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__ */

View File

@ -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"

View File

@ -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