[gtk/wip/ebassi/shortcut: 215/267] widget: Add private accessor to event controllers
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/shortcut: 215/267] widget: Add private accessor to event controllers
- Date: Thu, 6 Feb 2020 18:21:56 +0000 (UTC)
commit f4350eca55d6b4064ccd7166d82bbdf858946c09
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Feb 6 14:21:10 2020 +0000
widget: Add private accessor to event controllers
gtk/gtkwidget.c | 18 ++++++++++++++++++
gtk/gtkwidgetprivate.h | 3 +++
2 files changed, 21 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d68e6e31c2..22e25db309 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12258,6 +12258,24 @@ gtk_widget_reset_controllers (GtkWidget *widget)
}
}
+GList *
+gtk_widget_list_controllers (GtkWidget *widget,
+ GtkPropagationPhase phase)
+{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+ GList *res = NULL, *l;
+
+ for (l = priv->event_controllers; l; l = l->next)
+ {
+ GtkEventController *controller = l->data;
+
+ if (gtk_event_controller_get_propagation_phase (controller) == phase)
+ res = g_list_prepend (res, controller);
+ }
+
+ return g_list_reverse (res);
+}
+
static inline void
gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
GtkSnapshot *snapshot)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 80cbbf9cd0..6f992c4699 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -298,6 +298,9 @@ gboolean gtk_widget_has_size_request (GtkWidget *widget);
void gtk_widget_reset_controllers (GtkWidget *widget);
+GList * gtk_widget_list_controllers (GtkWidget *widget,
+ GtkPropagationPhase phase);
+
gboolean gtk_widget_query_tooltip (GtkWidget *widget,
gint x,
gint y,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]