From ed12be7e81808b39ad7c90a6a2147ada1c28ef0c Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 10 May 2012 10:31:06 -0400 Subject: [PATCH] styleproperty: make background-repeat an array property --- gtk/gtkcssstylepropertyimpl.c | 14 ++++++++++---- gtk/gtkthemingbackground.c | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index cde6ee5117..5fbc5930e6 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -835,8 +835,7 @@ compute_border_width (GtkCssStyleProperty *property, } static GtkCssValue * -background_repeat_value_parse (GtkCssStyleProperty *property, - GtkCssParser *parser) +background_repeat_value_parse_one (GtkCssParser *parser) { GtkCssValue *value = _gtk_css_background_repeat_value_try_parse (parser); @@ -849,6 +848,13 @@ background_repeat_value_parse (GtkCssStyleProperty *property, return value; } +static GtkCssValue * +background_repeat_value_parse (GtkCssStyleProperty *property, + GtkCssParser *parser) +{ + return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one, FALSE); +} + static GtkCssValue * background_size_parse (GtkCssStyleProperty *property, GtkCssParser *parser) @@ -1362,8 +1368,8 @@ _gtk_css_style_property_init_properties (void) NULL, NULL, NULL, - _gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT, - GTK_CSS_REPEAT_STYLE_REPEAT)); + _gtk_css_array_value_new (_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT, + GTK_CSS_REPEAT_STYLE_REPEAT))); gtk_css_style_property_register ("background-image", GTK_CSS_PROPERTY_BACKGROUND_IMAGE, CAIRO_GOBJECT_TYPE_PATTERN, diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c index 4c7e44bbfc..1bedb784d6 100644 --- a/gtk/gtkthemingbackground.c +++ b/gtk/gtkthemingbackground.c @@ -135,7 +135,7 @@ _gtk_theming_background_paint (GtkThemingBackground *bg, GtkCssRepeatStyle hrepeat, vrepeat; pos = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_POSITION); - repeat = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_REPEAT); + repeat = _gtk_css_array_value_get_nth (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_REPEAT), 0); hrepeat = _gtk_css_background_repeat_value_get_x (repeat); vrepeat = _gtk_css_background_repeat_value_get_y (repeat); width = bg->image_rect.width;