[gtk+] styleproperty: make background-repeat an array property



commit ed12be7e81808b39ad7c90a6a2147ada1c28ef0c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu May 10 10:31:06 2012 -0400

    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 cde6ee5..5fbc593 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);
 
@@ -850,6 +849,13 @@ background_repeat_value_parse (GtkCssStyleProperty *property,
 }
 
 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 4c7e44b..1bedb78 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;



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