[gtk+/gestures] Add back a private api to list controllers



commit cab1898a14a90c6daad18b53f742edcd6f037481
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 16 13:14:13 2014 -0400

    Add back a private api to list controllers
    
    This will let us show them in the inspector.

 gtk/gtkwidget.c        |   22 ++++++++++++++++++++++
 gtk/gtkwidgetprivate.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 99b3dc6..20ee5ac 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -16883,3 +16883,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;
+}
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 3708146..8ae5375 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -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
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]