diff options
author | Benjamin Otte <otte@redhat.com> | 2012-03-27 23:23:11 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-17 08:59:13 +0200 |
commit | 6ef76f4a924a241a7900542e6ef8bc6fa7a79b82 (patch) | |
tree | f287818acbc23aeb08e146940ff8246ee500ad2b /gtk/gtkcsscustomproperty.c | |
parent | c8e57d63ecbf099f54949cc5e3151d04c1115d75 (diff) | |
download | gtk+-6ef76f4a924a241a7900542e6ef8bc6fa7a79b82.tar.gz |
customproperty: Add our own query_value function
I'm about to change the CssStyleProperty one, so better copy things
here.
Diffstat (limited to 'gtk/gtkcsscustomproperty.c')
-rw-r--r-- | gtk/gtkcsscustomproperty.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/gtkcsscustomproperty.c b/gtk/gtkcsscustomproperty.c index 7785895f82..9da425fe7a 100644 --- a/gtk/gtkcsscustomproperty.c +++ b/gtk/gtkcsscustomproperty.c @@ -84,11 +84,29 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property, } static void +gtk_css_custom_property_query (GtkStyleProperty *property, + GValue *value, + GtkStyleQueryFunc query_func, + gpointer query_data) +{ + GtkCssStyleProperty *style = GTK_CSS_STYLE_PROPERTY (property); + GtkCssValue *css_value; + + css_value = (* query_func) (_gtk_css_style_property_get_id (style), query_data); + if (css_value == NULL) + css_value =_gtk_css_style_property_get_initial_value (style); + + _gtk_css_value_init_gvalue (css_value, value); + g_assert (GTK_CSS_CUSTOM_PROPERTY (property)->pspec->value_type == G_VALUE_TYPE (value)); +} + +static void _gtk_css_custom_property_class_init (GtkCssCustomPropertyClass *klass) { GtkStylePropertyClass *property_class = GTK_STYLE_PROPERTY_CLASS (klass); property_class->parse_value = gtk_css_custom_property_parse_value; + property_class->query = gtk_css_custom_property_query; } static GtkCssValue * |