[gtk+] styleproperty: Add a default value func for border-image-width



commit 7dbea94fd2c41446d4aba9cd99da38ba8d7bee9c
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jun 11 09:23:34 2011 +0200

    styleproperty: Add a default value func for border-image-width
    
    This is necessary because we want to use NULL as the default value. But
    the default value for borders is { 0, 0, 0, 0 } and not NULL.
    
    Fixes border-image-gradient and border-image-repeat reftests.

 gtk/gtkstyleproperty.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 895ba62..73b09dc 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -1679,6 +1679,14 @@ pack_border_radius (GValue             *value,
   g_free (top_left);
 }
 
+/*** default values ***/
+
+static void
+border_image_width_default_value (GtkStyleProperties *props,
+                                  GValue             *value)
+{
+}
+
 /*** API ***/
 
 static void
@@ -2280,11 +2288,17 @@ gtk_style_property_init (void)
                                                               "Border image slice",
                                                               "Border image slice",
                                                               GTK_TYPE_BORDER, 0));
-  gtk_style_properties_register_property (NULL,
-                                          g_param_spec_boxed ("border-image-width",
+  _gtk_style_property_register           (g_param_spec_boxed ("border-image-width",
                                                               "Border image width",
                                                               "Border image width",
-                                                              GTK_TYPE_BORDER, 0));  
+                                                              GTK_TYPE_BORDER, 0),
+                                          0,
+                                          NULL,
+                                          NULL,
+                                          NULL,
+                                          NULL,
+                                          NULL,
+                                          border_image_width_default_value);
   _gtk_style_property_register           (g_param_spec_boxed ("border-image",
                                                               "Border Image",
                                                               "Border Image",



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