[gtk+/parasite2] inspector: Add cell areas into the tree
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parasite2] inspector: Add cell areas into the tree
- Date: Sat, 10 May 2014 16:31:05 +0000 (UTC)
commit 3da9802553c2ea979c650f0b3733f9b971fb404e
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 9 22:28:45 2014 -0400
inspector: Add cell areas into the tree
modules/inspector/widget-tree.c | 37 ++++++++++++++++++++++++++-----------
1 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/modules/inspector/widget-tree.c b/modules/inspector/widget-tree.c
index 4b63cb8..8518740 100644
--- a/modules/inspector/widget-tree.c
+++ b/modules/inspector/widget-tree.c
@@ -186,6 +186,7 @@ typedef struct
{
GtkInspectorWidgetTree *wt;
GtkTreeIter *iter;
+ GObject *parent;
} FindAllData;
static void
@@ -196,6 +197,18 @@ on_container_forall (GtkWidget *widget,
gtk_inspector_widget_tree_append_object (d->wt, G_OBJECT (widget), d->iter, NULL);
}
+static gboolean
+cell_callback (GtkCellRenderer *renderer,
+ gpointer data)
+{
+ FindAllData *d = data;
+
+ g_object_set_data (G_OBJECT (renderer), "gtk-inspector-cell-area", d->parent);
+ gtk_inspector_widget_tree_append_object (d->wt, G_OBJECT (renderer), d->iter, NULL);
+
+ return FALSE;
+}
+
void
gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
GObject *object,
@@ -276,6 +289,7 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
data.wt = wt;
data.iter = &iter;
+ data.parent = object;
gtk_container_forall (GTK_CONTAINER (object), on_container_forall, &data);
}
@@ -293,21 +307,22 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
}
}
- if (GTK_IS_CELL_LAYOUT (object))
+ if (GTK_IS_CELL_AREA (object))
+ {
+ FindAllData data;
+
+ data.wt = wt;
+ data.iter = &iter;
+ data.parent = object;
+
+ gtk_cell_area_foreach (GTK_CELL_AREA (object), cell_callback, &data);
+ }
+ else if (GTK_IS_CELL_LAYOUT (object))
{
- GList *cells, *l;
- GObject *cell;
GtkCellArea *area;
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (object));
- cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (object));
- for (l = cells; l; l = l->next)
- {
- cell = l->data;
- g_object_set_data (cell, "gtk-inspector-cell-area", area);
- gtk_inspector_widget_tree_append_object (wt, cell, &iter, NULL);
- }
- g_list_free (cells);
+ gtk_inspector_widget_tree_append_object (wt, G_OBJECT (area), &iter, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]