From 0a0a1a20a7080171154ac8ae349c159967273415 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 20 Oct 2010 18:04:39 +0200 Subject: [PATCH] GtkCssProvider: Make it able to parse enums. --- gtk/gtkcssprovider.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 001b062f31..045bd64bc4 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -2314,6 +2314,17 @@ css_provider_parse_value (GtkCssProvider *css_provider, else parsed = FALSE; } + else if (G_TYPE_IS_ENUM (type)) + { + GEnumClass *class; + GEnumValue *enum_value; + + class = g_type_class_ref (type); + enum_value = g_enum_get_value_by_nick (class, value_str); + + g_value_set_enum (value, enum_value->value); + g_type_class_unref (class); + } else if (type == GTK_TYPE_9SLICE) { Gtk9Slice *slice;