[gtk+/wip/css: 80/154] shorthand: Remove old parse func support



commit 3367fef0b37eac21ddad0e8f12e62639a6eeb2e6
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 2 09:22:35 2012 +0100

    shorthand: Remove old parse func support
    
    It's not used anymore

 gtk/gtkcssshorthandproperty.c     |   54 -------------------------------------
 gtk/gtkcssshorthandpropertyimpl.c |   28 ++++++-------------
 2 files changed, 9 insertions(+), 73 deletions(-)
---
diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c
index 5d86e54..2c6906b 100644
--- a/gtk/gtkcssshorthandproperty.c
+++ b/gtk/gtkcssshorthandproperty.c
@@ -180,64 +180,10 @@ _gtk_css_shorthand_property_class_init (GtkCssShorthandPropertyClass *klass)
   property_class->parse_value = gtk_css_shorthand_property_parse_value;
 }
 
-/* XXX: This function is compat only, don't read it */
-static gboolean
-gtk_css_shorthand_property_parse (GtkCssShorthandProperty *shorthand,
-                                  GValue                  *values,
-                                  GtkCssParser            *parser,
-                                  GFile                   *base)
-{
-  GtkStyleProperty *property = GTK_STYLE_PROPERTY (shorthand);
-  GParameter *parameters;
-  guint i, j, n_parameters;
-
-  GValue val = G_VALUE_INIT;
-
-  g_value_init (&val, _gtk_style_property_get_value_type (property));
-  if (property->parse_func)
-    {
-      if (!(* property->parse_func) (parser, base, &val))
-        {
-          g_value_unset (&val);
-          return FALSE;
-        }
-    }
-  else if (!_gtk_css_style_parse_value (&val, parser, base))
-    {
-      g_value_unset (&val);
-      return FALSE;
-    }
-
-  parameters = property->unpack_func (&val, &n_parameters);
-  g_value_unset (&val);
-
-  for (i = 0; i < shorthand->subproperties->len; i++)
-    {
-      for (j = 0; j < n_parameters; j++)
-        {
-          if (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, i))
-              == _gtk_style_property_lookup (parameters[j].name))
-            {
-              g_value_init (&values[i], G_VALUE_TYPE (&parameters[j].value));
-              g_value_copy (&parameters[j].value, &values[i]);
-              g_value_unset (&parameters[j].value);
-              break;
-            }
-        }
-      g_assert (j < n_parameters);
-    }
-  
-  g_free (parameters);
-
-  return TRUE;
-}
-
 static void
 _gtk_css_shorthand_property_init (GtkCssShorthandProperty *shorthand)
 {
   shorthand->subproperties = g_ptr_array_new_with_free_func (g_object_unref);
-
-  shorthand->parse = gtk_css_shorthand_property_parse;
 }
 
 GtkCssStyleProperty *
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 94b2532..4afa2ee 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -609,8 +609,7 @@ _gtk_css_shorthand_property_register (const char                        *name,
                                       const char                       **subproperties,
                                       GtkCssShorthandPropertyParseFunc   parse_func,
                                       GtkStyleUnpackFunc                 unpack_func,
-                                      GtkStylePackFunc                   pack_func,
-                                      GtkStyleParseFunc                  old_parse_func)
+                                      GtkStylePackFunc                   pack_func)
 {
   GtkStyleProperty *node;
 
@@ -623,11 +622,9 @@ _gtk_css_shorthand_property_register (const char                        *name,
                        "subproperties", subproperties,
                        NULL);
 
-  if (parse_func)
-    GTK_CSS_SHORTHAND_PROPERTY (node)->parse = parse_func;
+  GTK_CSS_SHORTHAND_PROPERTY (node)->parse = parse_func;
   node->pack_func = pack_func;
   node->unpack_func = unpack_func;
-  node->parse_func = old_parse_func;
 }
 
 void
@@ -648,48 +645,41 @@ _gtk_css_shorthand_property_init_properties (void)
                                           font_subproperties,
                                           parse_font,
                                           unpack_font_description,
-                                          pack_font_description,
-                                          NULL);
+                                          pack_font_description);
   _gtk_css_shorthand_property_register   ("margin",
                                           GTK_TYPE_BORDER,
                                           margin_subproperties,
                                           parse_border,
                                           unpack_margin,
-                                          pack_margin,
-                                          NULL);
+                                          pack_margin);
   _gtk_css_shorthand_property_register   ("padding",
                                           GTK_TYPE_BORDER,
                                           padding_subproperties,
                                           parse_border,
                                           unpack_padding,
-                                          pack_padding,
-                                          NULL);
+                                          pack_padding);
   _gtk_css_shorthand_property_register   ("border-width",
                                           GTK_TYPE_BORDER,
                                           border_width_subproperties,
                                           parse_border,
                                           unpack_border_width,
-                                          pack_border_width,
-                                          NULL);
+                                          pack_border_width);
   _gtk_css_shorthand_property_register   ("border-radius",
                                           G_TYPE_INT,
                                           border_radius_subproperties,
                                           parse_border_radius,
                                           unpack_border_radius,
-                                          pack_border_radius,
-                                          NULL);
+                                          pack_border_radius);
   _gtk_css_shorthand_property_register   ("border-color",
                                           GDK_TYPE_RGBA,
                                           border_color_subproperties,
                                           parse_border_color,
                                           unpack_border_color,
-                                          pack_border_color,
-                                          NULL);
+                                          pack_border_color);
   _gtk_css_shorthand_property_register   ("border-image",
                                           GTK_TYPE_BORDER_IMAGE,
                                           border_image_subproperties,
                                           parse_border_image,
                                           _gtk_border_image_unpack,
-                                          _gtk_border_image_pack,
-                                          NULL);
+                                          _gtk_border_image_pack);
 }



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