[gtk+/wip/multiple-backgrounds: 2/8] styleproperty: make background-repeat an array property



commit 10680a9617e0b8069aa5a1adb056f8cacf9ec5cb
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 |   16 +++++++++++-----
 gtk/gtkthemingbackground.c    |    2 +-
 2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index c742c09..3b64954 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -858,9 +858,7 @@ compute_border_width (GtkCssStyleProperty    *property,
 }
 
 static GtkCssValue *
-background_repeat_value_parse (GtkCssStyleProperty *property,
-                               GtkCssParser        *parser,
-                               GFile               *base)
+background_repeat_value_parse_one (GtkCssParser *parser)
 {
   GtkCssValue *value = _gtk_css_background_repeat_value_try_parse (parser);
 
@@ -874,6 +872,14 @@ background_repeat_value_parse (GtkCssStyleProperty *property,
 }
 
 static GtkCssValue *
+background_repeat_value_parse (GtkCssStyleProperty *property,
+                               GtkCssParser        *parser,
+                               GFile               *base)
+{
+  return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one, FALSE);
+}
+
+static GtkCssValue *
 background_size_parse (GtkCssStyleProperty *property,
                        GtkCssParser        *parser,
                        GFile               *base)
@@ -1388,8 +1394,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]