[gtk+/wip/multiple-backgrounds: 4/15] styleproperty: make background-size an array property



commit 3bf464deab2f0132073ef8351ea74db7cc273848
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu May 10 10:43:43 2012 -0400

    styleproperty: make background-size an array property

 gtk/gtkcssstylepropertyimpl.c |    6 +++---
 gtk/gtkthemingbackground.c    |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 4c194e4..ad60d93 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -859,7 +859,7 @@ static GtkCssValue *
 background_size_parse (GtkCssStyleProperty *property,
                        GtkCssParser        *parser)
 {
-  return _gtk_css_bg_size_value_parse (parser);
+  return _gtk_css_array_value_parse (parser, _gtk_css_bg_size_value_parse, FALSE);
 }
 
 static GtkCssValue *
@@ -867,7 +867,7 @@ background_size_compute (GtkCssStyleProperty    *property,
                          GtkStyleContext        *context,
                          GtkCssValue            *specified)
 {
-  return _gtk_css_bg_size_value_compute (specified, context);
+  return _gtk_css_array_value_compute (specified, _gtk_css_bg_size_value_compute, context);
 }
 
 static GtkCssValue *
@@ -1285,7 +1285,7 @@ _gtk_css_style_property_init_properties (void)
                                           background_size_compute,
                                           NULL,
                                           NULL,
-                                          _gtk_css_bg_size_value_new (NULL, NULL));
+                                          _gtk_css_array_value_new (_gtk_css_bg_size_value_new (NULL, NULL)));
   gtk_css_style_property_register        ("background-position",
                                           GTK_CSS_PROPERTY_BACKGROUND_POSITION,
                                           G_TYPE_NONE,
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index 6d00677..4bc5d5e 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -141,7 +141,7 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
       width = bg->image_rect.width;
       height = bg->image_rect.height;
 
-      _gtk_css_bg_size_value_compute_size (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_SIZE),
+      _gtk_css_bg_size_value_compute_size (_gtk_css_array_value_get_nth (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_SIZE), 0),
                                            bg->image,
                                            width,
                                            height,



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