[gtk+/wip/css: 68/97] styleproperty: Make parse_value() a vfunc



commit f2740bad18fd58f53ca5ba8f326ed7be398c90b8
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 2 00:45:29 2012 +0100

    styleproperty: Make parse_value() a vfunc

 gtk/gtkstyleproperty.c        |   21 +++++++++++++++++++++
 gtk/gtkstylepropertyprivate.h |    4 ++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 35981cd..322ff0a 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -119,6 +119,12 @@ gtk_style_property_get_property (GObject    *object,
     }
 }
 
+static gboolean
+gtk_style_property_real_parse_value (GtkStyleProperty *property,
+                                     GValue           *value,
+                                     GtkCssParser     *parser,
+                                     GFile            *base);
+
 static void
 _gtk_style_property_class_init (GtkStylePropertyClass *klass)
 {
@@ -143,6 +149,8 @@ _gtk_style_property_class_init (GtkStylePropertyClass *klass)
                                                        G_TYPE_NONE,
                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
+  klass->parse_value = gtk_style_property_real_parse_value;
+
   klass->properties = g_hash_table_new (g_str_hash, g_str_equal);
 }
 
@@ -385,10 +393,23 @@ _gtk_style_property_parse_value (GtkStyleProperty *property,
                                  GtkCssParser     *parser,
                                  GFile            *base)
 {
+  GtkStylePropertyClass *klass;
+
   g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), FALSE);
   g_return_val_if_fail (value != NULL, FALSE);
   g_return_val_if_fail (parser != NULL, FALSE);
 
+  klass = GTK_STYLE_PROPERTY_GET_CLASS (property);
+
+  return klass->parse_value (property, value, parser, base);
+}
+
+static gboolean
+gtk_style_property_real_parse_value (GtkStyleProperty *property,
+                                     GValue           *value,
+                                     GtkCssParser     *parser,
+                                     GFile            *base)
+{
   if (_gtk_css_parser_try (parser, "initial", TRUE))
     {
       /* the initial value can be explicitly specified with the
diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h
index 73bd23f..2326a09 100644
--- a/gtk/gtkstylepropertyprivate.h
+++ b/gtk/gtkstylepropertyprivate.h
@@ -78,6 +78,10 @@ struct _GtkStylePropertyClass
                                                             GtkStateFlags           state,
 			                                    GtkStylePropertyContext *context,
                                                             GValue                 *value);
+  gboolean          (* parse_value)                        (GtkStyleProperty *      property,
+                                                            GValue                 *value,
+                                                            GtkCssParser           *parser,
+                                                            GFile                  *base);
 
   GHashTable   *properties;
 };



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