[gtk+] styleproperty: Move property_parse_func member



commit 3375dd2a5f94a9671033a0ec51ccbd556418693f
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 2 10:41:41 2012 +0100

    styleproperty: Move property_parse_func member
    
    It belongs in GtkCssCustomProperty

 gtk/gtkcsscustomproperty.c        |   13 ++++++++-----
 gtk/gtkcsscustompropertyprivate.h |    2 ++
 gtk/gtkstylepropertyprivate.h     |    1 -
 3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcsscustomproperty.c b/gtk/gtkcsscustomproperty.c
index bb9aa41..9d4c61f 100644
--- a/gtk/gtkcsscustomproperty.c
+++ b/gtk/gtkcsscustomproperty.c
@@ -35,11 +35,12 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property,
                                      GtkCssParser     *parser,
                                      GFile            *base)
 {
+  GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (property);
   gboolean success;
 
   g_value_init (value, _gtk_style_property_get_value_type (property));
 
-  if (property->property_parse_func)
+  if (custom->property_parse_func)
     {
       GError *error = NULL;
       char *value_str;
@@ -47,7 +48,7 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property,
       value_str = _gtk_css_parser_read_value (parser);
       if (value_str != NULL)
         {
-          success = (*property->property_parse_func) (value_str, value, &error);
+          success = (* custom->property_parse_func) (value_str, value, &error);
           g_free (value_str);
         }
       else
@@ -147,7 +148,7 @@ gtk_theming_engine_register_property (const gchar            *name_space,
                                       GtkStylePropertyParser  parse_func,
                                       GParamSpec             *pspec)
 {
-  GtkStyleProperty *node;
+  GtkCssCustomProperty *node;
   GValue initial = { 0, };
   gchar *name;
 
@@ -186,7 +187,7 @@ void
 gtk_style_properties_register_property (GtkStylePropertyParser  parse_func,
                                         GParamSpec             *pspec)
 {
-  GtkStyleProperty *node;
+  GtkCssCustomProperty *node;
   GValue initial = { 0, };
 
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
@@ -232,11 +233,13 @@ gtk_style_properties_lookup_property (const gchar             *property_name,
 
   if (GTK_IS_CSS_CUSTOM_PROPERTY (node))
     {
+      GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (node);
+
       if (pspec)
         *pspec = GTK_CSS_STYLE_PROPERTY (node)->pspec;
 
       if (parse_func)
-        *parse_func = node->property_parse_func;
+        *parse_func = custom->property_parse_func;
 
       found = TRUE;
     }
diff --git a/gtk/gtkcsscustompropertyprivate.h b/gtk/gtkcsscustompropertyprivate.h
index 483dd6d..e4eb364 100644
--- a/gtk/gtkcsscustompropertyprivate.h
+++ b/gtk/gtkcsscustompropertyprivate.h
@@ -38,6 +38,8 @@ typedef struct _GtkCssCustomPropertyClass      GtkCssCustomPropertyClass;
 struct _GtkCssCustomProperty
 {
   GtkCssStyleProperty parent;
+
+  GtkStylePropertyParser property_parse_func;
 };
 
 struct _GtkCssCustomPropertyClass
diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h
index 6070199..b2c7b92 100644
--- a/gtk/gtkstylepropertyprivate.h
+++ b/gtk/gtkstylepropertyprivate.h
@@ -58,7 +58,6 @@ struct _GtkStyleProperty
   char *name;
   GType value_type;
 
-  GtkStylePropertyParser    property_parse_func;
   GtkStyleUnpackFunc        unpack_func;
   GtkStylePackFunc          pack_func;
   GtkStyleParseFunc         parse_func;



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