From 2dabf20cfd1193baec6082ec90c5d723bb010ad4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 6 Aug 2010 12:05:42 +0200 Subject: [PATCH] GtkStyleContext: Add gtk_style_context_list_classes(). --- gtk/gtkstylecontext.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index cfe7a5e0f7..647d09078f 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -844,6 +844,32 @@ gtk_style_context_has_class (GtkStyleContext *context, return FALSE; } +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) {