[gtk/shortcuts-rebased-again: 3/159] widget: Bring back _gtk_widget_list_controllers()



commit ed14154cabe3dc7319b63f89f5f0a3f402982dc9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon May 13 16:22:25 2019 -0300

    widget: Bring back _gtk_widget_list_controllers()
    
    Will be used by shourtcuts.

 gtk/gtkwidget.c        | 21 +++++++++++++++++++++
 gtk/gtkwidgetprivate.h |  2 ++
 2 files changed, 23 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 1768e3cd99..091d954811 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12587,6 +12587,27 @@ gtk_widget_remove_controller (GtkWidget          *widget,
     gtk_list_list_model_item_removed (priv->controller_observer, before);
 }
 
+GList *
+_gtk_widget_list_controllers (GtkWidget           *widget,
+                              GtkPropagationPhase  phase)
+{
+  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+  GList *l, *retval = NULL;
+
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+  for (l = priv->event_controllers; l; l = l->next)
+    {
+      GtkEventController *controller = l->data;
+
+      if (controller != NULL &&
+          phase == gtk_event_controller_get_propagation_phase (controller))
+        retval = g_list_prepend (retval, controller);
+    }
+
+  return retval;
+}
+
 gboolean
 _gtk_widget_consumes_motion (GtkWidget        *widget,
                              GdkEventSequence *sequence)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 26df307cc2..dd56f60a9c 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -297,6 +297,8 @@ void              _gtk_widget_update_parent_muxer          (GtkWidget    *widget
 GtkActionMuxer *  _gtk_widget_get_action_muxer             (GtkWidget    *widget,
                                                             gboolean      create);
 
+GList *           _gtk_widget_list_controllers             (GtkWidget           *widget,
+                                                            GtkPropagationPhase  phase);
 gboolean          _gtk_widget_consumes_motion              (GtkWidget           *widget,
                                                             GdkEventSequence    *sequence);
 


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