Add back a private api to list controllers

This will let us show them in the inspector.
This commit is contained in:
Matthias Clasen 2014-05-16 13:14:13 -04:00 committed by Carlos Garnacho
parent 2ba89256f4
commit a727c41e4a
2 changed files with 24 additions and 0 deletions

View File

@ -16889,3 +16889,25 @@ _gtk_widget_remove_controller (GtkWidget *widget,
g_object_unref (data->controller);
data->controller = NULL;
}
GList *
_gtk_widget_list_controllers (GtkWidget *widget,
GtkPropagationPhase phase)
{
EventControllerData *data;
GtkWidgetPrivate *priv;
GList *l, *retval = NULL;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
priv = widget->priv;
for (l = priv->event_controllers; l; l = l->next)
{
data = l->data;
if (data->phase == phase && data->controller != NULL)
retval = g_list_prepend (retval, data->controller);
}
return retval;
}

View File

@ -157,6 +157,8 @@ void _gtk_widget_add_controller (GtkWidget
GtkPropagationPhase phase);
void _gtk_widget_remove_controller (GtkWidget *widget,
GtkEventController *controller);
GList * _gtk_widget_list_controllers (GtkWidget *widget,
GtkPropagationPhase phase);
G_END_DECLS