[gtk+/gestures: 177/202] inspector: Minimal support for gestures



commit 1c5f14a9e45ceaed1f167febf54c67e7956086fb
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 16 14:27:58 2014 -0400

    inspector: Minimal support for gestures
    
    We're just showing them as objects in the tree, for now.

 gtk/inspector/widget-tree.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/widget-tree.c b/gtk/inspector/widget-tree.c
index 6b3f69f..62dc1a0 100644
--- a/gtk/inspector/widget-tree.c
+++ b/gtk/inspector/widget-tree.c
@@ -24,6 +24,7 @@
 
 #include "prop-list.h"
 #include "widget-tree.h"
+#include "gtkwidgetprivate.h"
 #include <string.h>
 
 enum
@@ -316,6 +317,33 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
 
   g_free (address);
 
+  if (GTK_IS_WIDGET (object))
+    {
+      struct {
+        GtkPropagationPhase  phase;
+        const gchar         *name;
+      } phases[] = {
+        { GTK_PHASE_CAPTURE, "capture" },
+        { GTK_PHASE_TARGET,  "target" },
+        { GTK_PHASE_BUBBLE,  "bubble" },
+        { GTK_PHASE_NONE,    "" }
+      };
+      gint i;
+
+      for (i = 0; i < G_N_ELEMENTS (phases); i++)
+        {
+          GList *list, *l;
+
+          list = _gtk_widget_list_controllers (GTK_WIDGET (object), phases[i].phase);
+          for (l = list; l; l = l->next)
+            {
+              GObject *controller = l->data;
+              gtk_inspector_widget_tree_append_object (wt, controller, &iter, phases[i].name);
+            }
+          g_list_free (list);
+        }
+    }
+
   if (GTK_IS_CONTAINER (object))
     {
       FindAllData data;


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