[gtk+/wip/css: 73/163] styleproperty: Set a default value for border-*-radius



commit c05062a3bd531ea1d05ab0524db9375c8e3d1c4b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 2 02:45:52 2012 +0100

    styleproperty: Set a default value for border-*-radius
    
    That way, we don't have to check if it is indeed set.

 gtk/gtkstyleproperty.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 78037f3..0bc2275 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -530,6 +530,7 @@ gtk_style_property_init_properties (void)
   GValue value = { 0, };
   char *default_font_family[] = { "Sans", NULL };
   GdkRGBA rgba;
+  GtkCssBorderCornerRadius no_corner_radius = { 0, };
 
   if (G_LIKELY (initialized))
     return;
@@ -703,6 +704,8 @@ gtk_style_property_init_properties (void)
                                                             "Border width at right",
                                                             0, G_MAXINT, 0, 0));
 
+  g_value_init (&value, GTK_TYPE_CSS_BORDER_CORNER_RADIUS);
+  g_value_set_boxed (&value, &no_corner_radius);
   _gtk_style_property_register           (g_param_spec_boxed ("border-top-left-radius",
                                                               "Border top left radius",
                                                               "Border radius of top left corner, in pixels",
@@ -711,7 +714,7 @@ gtk_style_property_init_properties (void)
                                           NULL,
                                           border_corner_radius_value_parse,
                                           border_corner_radius_value_print,
-                                          NULL);
+                                          &value);
   _gtk_style_property_register           (g_param_spec_boxed ("border-top-right-radius",
                                                               "Border top right radius",
                                                               "Border radius of top right corner, in pixels",
@@ -720,7 +723,7 @@ gtk_style_property_init_properties (void)
                                           NULL,
                                           border_corner_radius_value_parse,
                                           border_corner_radius_value_print,
-                                          NULL);
+                                          &value);
   _gtk_style_property_register           (g_param_spec_boxed ("border-bottom-right-radius",
                                                               "Border bottom right radius",
                                                               "Border radius of bottom right corner, in pixels",
@@ -729,7 +732,7 @@ gtk_style_property_init_properties (void)
                                           NULL,
                                           border_corner_radius_value_parse,
                                           border_corner_radius_value_print,
-                                          NULL);
+                                          &value);
   _gtk_style_property_register           (g_param_spec_boxed ("border-bottom-left-radius",
                                                               "Border bottom left radius",
                                                               "Border radius of bottom left corner, in pixels",
@@ -738,7 +741,8 @@ gtk_style_property_init_properties (void)
                                           NULL,
                                           border_corner_radius_value_parse,
                                           border_corner_radius_value_print,
-                                          NULL);
+                                          &value);
+  g_value_unset (&value);
 
   gtk_style_properties_register_property (NULL,
                                           g_param_spec_enum ("border-style",



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