[gtk+/gtk-style-context: 180/490] GtkStyleContext: Add gtk_style_context_list_classes().



commit a48df65377b717d3f35b088debd85ff98b665bc2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 6 12:05:42 2010 +0200

    GtkStyleContext: Add gtk_style_context_list_classes().

 gtk/gtkstylecontext.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index cfe7a5e..647d090 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -845,6 +845,32 @@ gtk_style_context_has_class (GtkStyleContext *context,
 }
 
 GList *
+gtk_style_context_list_classes (GtkStyleContext *context)
+{
+  GtkStyleContextPrivate *priv;
+  GtkStyleInfo *info;
+  GList *classes = NULL;
+  guint i;
+
+  g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+  priv = context->priv;
+
+  g_assert (priv->info_stack != NULL);
+  info = priv->info_stack->data;
+
+  for (i = 0; i < info->style_classes->len; i++)
+    {
+      GQuark quark;
+
+      quark = g_array_index (info->style_classes, GQuark, i);
+      classes = g_list_prepend (classes, (gchar *) g_quark_to_string (quark));
+    }
+
+  return classes;
+}
+
+GList *
 gtk_style_context_list_regions (GtkStyleContext *context)
 {
   GtkStyleContextPrivate *priv;



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