[gtk+] Add region details in gtk_widget_get_path().
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add region details in gtk_widget_get_path().
- Date: Sat, 4 Dec 2010 14:49:08 +0000 (UTC)
commit f5adc2a1c3bfd317f2288ba39925e7f7d6b50e38
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Apr 23 02:36:47 2010 +0200
Add region details in gtk_widget_get_path().
gtk/gtkwidget.c | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e4e3e32..8fcff94 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13182,17 +13182,53 @@ _gtk_widget_set_height_request_needed (GtkWidget *widget,
GtkWidgetPath *
gtk_widget_get_path (GtkWidget *widget)
{
+ GtkStyleContext *context;
GtkWidgetPath *path;
+ GtkWidget *parent;
+ GList *regions, *reg;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ parent = widget->priv->parent;
+
path = gtk_widget_path_new ();
+ gtk_widget_path_prepend_type (path, G_OBJECT_TYPE (widget));
+ regions = reg = NULL;
- while (widget)
+ if (widget->priv->name)
+ gtk_widget_path_iter_set_name (path, 0, widget->priv->name);
+
+ context = g_object_get_qdata (G_OBJECT (widget),
+ quark_style_context);
+
+ if (context)
+ regions = reg = gtk_style_context_list_child_classes (context);
+
+ while (reg)
{
- gtk_widget_path_prepend_type (path, G_OBJECT_TYPE (widget));
- widget = widget->parent;
+ GtkChildClassFlags flags;
+ const gchar *region_name;
+
+ region_name = reg->data;
+ reg = reg->next;
+
+ gtk_style_context_has_child_class (context, region_name, &flags);
+ gtk_widget_path_iter_add_region (path, 0, region_name, flags);
+ }
+
+ g_list_free (regions);
+
+ while (parent)
+ {
+ guint position;
+
+ position = gtk_widget_path_prepend_type (path, G_OBJECT_TYPE (parent));
+
+ if (parent->priv->name)
+ gtk_widget_path_iter_set_name (path, position, parent->priv->name);
+
+ parent = parent->priv->parent;
}
return path;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]