[gtk+] GtkStyleContext: Add gtk_style_context_list_child_classes().



commit 104caa74f05a376a7dd65f4b7540c6986c7781f3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 23 02:31:57 2010 +0200

    GtkStyleContext: Add gtk_style_context_list_child_classes().

 gtk/gtkstylecontext.c |   25 +++++++++++++++++++++++++
 gtk/gtkstylecontext.h |    2 ++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index f8f6c08..c4401cc 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -473,6 +473,31 @@ child_style_class_compare (gconstpointer p1,
   return (gint) c1->class_quark - c2->class_quark;
 }
 
+GList *
+gtk_style_context_list_child_classes (GtkStyleContext *context)
+{
+  GtkStyleContextPrivate *priv;
+  GList *classes = NULL;
+  GList *link;
+
+  g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+  priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context);
+  link = priv->child_style_classes;
+
+  while (link)
+    {
+      GtkChildClass *link_class;
+
+      link_class = link->data;
+      classes = g_list_prepend (classes,
+                                g_quark_to_string (link_class->class_quark));
+      link = link->next;
+    }
+
+  return classes;
+}
+
 void
 gtk_style_context_set_child_class (GtkStyleContext    *context,
                                    const gchar        *class_name,
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index a9ddd75..2ef9ee1 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -84,6 +84,8 @@ void     gtk_style_context_unset_class (GtkStyleContext *context,
 gboolean gtk_style_context_has_class   (GtkStyleContext *context,
                                         const gchar     *class_name);
 
+GList *  gtk_style_context_list_child_classes (GtkStyleContext *context);
+
 void     gtk_style_context_set_child_class   (GtkStyleContext    *context,
                                               const gchar        *class_name,
                                               GtkChildClassFlags  flags);



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