[gtk+/wip/cssdep: 9/21] cssstyleproperty: Get rid of unused API



commit ca64ac9cebc97bd4528040d39494327292b41976
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 16 14:28:58 2012 +0200

    cssstyleproperty: Get rid of unused API
    
    Both _gtk_css_style_property_print_value() and
    _gtk_css_style_property_compute_value() aren't necessary anymore and are
    replaced by _gtk_css_value_print() and _gtk_css_value_comptue()
    respectively.

 gtk/gtkcsscomputedvalues.c       |    5 +--
 gtk/gtkcssprovider.c             |    2 +-
 gtk/gtkcssstyleproperty.c        |   67 --------------------------------------
 gtk/gtkcssstylepropertyprivate.h |   12 -------
 gtk/gtkcssvalue.c                |   23 +++++++++++++
 5 files changed, 25 insertions(+), 84 deletions(-)
---
diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c
index 6f99667..caa2251 100644
--- a/gtk/gtkcsscomputedvalues.c
+++ b/gtk/gtkcsscomputedvalues.c
@@ -155,10 +155,7 @@ _gtk_css_computed_values_compute_value (GtkCssComputedValues *values,
 
   if (specified)
     {
-      g_ptr_array_index (values->values, id) =
-	_gtk_css_style_property_compute_value (prop,
-					       context,
-					       specified);
+      g_ptr_array_index (values->values, id) = _gtk_css_value_compute (specified, id, context);
     }
   else
     {
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 137f3ae..d4a3196 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2839,7 +2839,7 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
           g_string_append (str, "  ");
           g_string_append (str, _gtk_style_property_get_name (GTK_STYLE_PROPERTY (prop->property)));
           g_string_append (str, ": ");
-          _gtk_css_style_property_print_value (prop->property, prop->value, str);
+          _gtk_css_value_print (prop->value, str);
           g_string_append (str, ";\n");
         }
 
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 8607af5..98e137d 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -227,27 +227,9 @@ gtk_css_style_property_real_parse_value (GtkCssStyleProperty *property,
 }
 
 static void
-gtk_css_style_property_real_print_value (GtkCssStyleProperty *property,
-                                         const GtkCssValue   *value,
-                                         GString             *string)
-{
-  _gtk_css_value_print (value, string);
-}
-
-static GtkCssValue *
-gtk_css_style_property_real_compute_value (GtkCssStyleProperty *property,
-                                           GtkStyleContext     *context,
-                                           GtkCssValue         *specified)
-{
-  return _gtk_css_value_compute (specified, _gtk_css_style_property_get_id (property), context);
-}
-
-static void
 _gtk_css_style_property_init (GtkCssStyleProperty *property)
 {
   property->parse_value = gtk_css_style_property_real_parse_value;
-  property->print_value = gtk_css_style_property_real_print_value;
-  property->compute_value = gtk_css_style_property_real_compute_value;
 }
 
 /**
@@ -371,52 +353,3 @@ _gtk_css_style_property_get_initial_value (GtkCssStyleProperty *property)
 
   return property->initial_value;
 }
-
-/**
- * _gtk_css_style_property_compute_value:
- * @property: the property
- * @computed: (out): an uninitialized value to be filled with the result
- * @context: the context to use for resolving
- * @specified: the value to compute from
- *
- * Converts the @specified value into the @computed value using the
- * information in @context. This step is explained in detail in
- * <ulink url="http://www.w3.org/TR/css3-cascade/#computed>
- * the CSS documentation</ulink>.
- **/
-GtkCssValue *
-_gtk_css_style_property_compute_value (GtkCssStyleProperty *property,
-                                       GtkStyleContext     *context,
-                                       GtkCssValue         *specified)
-{
-  g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), NULL);
-  g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
-
-  return property->compute_value (property, context, specified);
-}
-
-/**
- * _gtk_css_style_property_print_value:
- * @property: the property
- * @value: the value to print
- * @string: the string to print to
- *
- * Prints @value to the given @string in CSS format. The @value must be a
- * valid specified value as parsed using the parse functions or as assigned
- * via _gtk_style_property_assign().
- **/
-void
-_gtk_css_style_property_print_value (GtkCssStyleProperty    *property,
-                                     GtkCssValue            *value,
-                                     GString                *string)
-{
-  g_return_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property));
-  g_return_if_fail (value != NULL);
-  g_return_if_fail (string != NULL);
-
-  if (_gtk_css_value_is_inherit (value) ||
-      _gtk_css_value_is_initial (value))
-    _gtk_css_value_print (value, string);
-  else
-    property->print_value (property, value, string);
-}
diff --git a/gtk/gtkcssstylepropertyprivate.h b/gtk/gtkcssstylepropertyprivate.h
index 093af5f..b04b267 100644
--- a/gtk/gtkcssstylepropertyprivate.h
+++ b/gtk/gtkcssstylepropertyprivate.h
@@ -36,12 +36,6 @@ typedef struct _GtkCssStylePropertyClass      GtkCssStylePropertyClass;
 
 typedef GtkCssValue *    (* GtkCssStylePropertyParseFunc)  (GtkCssStyleProperty    *property,
                                                             GtkCssParser           *parser);
-typedef void             (* GtkCssStylePropertyPrintFunc)  (GtkCssStyleProperty    *property,
-                                                            const GtkCssValue      *value,
-                                                            GString                *string);
-typedef GtkCssValue  *   (* GtkCssStylePropertyComputeFunc)(GtkCssStyleProperty    *property,
-                                                            GtkStyleContext        *context,
-                                                            GtkCssValue            *specified);
 typedef void             (* GtkCssStylePropertyQueryFunc)  (GtkCssStyleProperty    *property,
                                                             const GtkCssValue      *cssvalue,
                                                             GValue                 *value);
@@ -57,8 +51,6 @@ struct _GtkCssStyleProperty
   guint animated :1;
 
   GtkCssStylePropertyParseFunc parse_value;
-  GtkCssStylePropertyPrintFunc print_value;
-  GtkCssStylePropertyComputeFunc compute_value;
   GtkCssStylePropertyQueryFunc query_value;
   GtkCssStylePropertyAssignFunc assign_value;
 };
@@ -83,10 +75,6 @@ guint                   _gtk_css_style_property_get_id          (GtkCssStyleProp
 GtkCssValue  *          _gtk_css_style_property_get_initial_value
                                                                 (GtkCssStyleProperty    *property);
 
-GtkCssValue *           _gtk_css_style_property_compute_value   (GtkCssStyleProperty    *property,
-                                                                 GtkStyleContext        *context,
-                                                                 GtkCssValue            *specified);
-
 void                    _gtk_css_style_property_print_value     (GtkCssStyleProperty    *property,
                                                                  GtkCssValue            *value,
                                                                  GString                *string);
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c
index d07a1ca..5d5d392 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -61,6 +61,20 @@ _gtk_css_value_unref (GtkCssValue *value)
   value->class->free (value);
 }
 
+/**
+ * _gtk_css_value_compute:
+ * @value: the value to compute from
+ * @property_id: the ID of the property to compute
+ * @context: the context to use for resolving
+ *
+ * Converts the specified @value into the computed value for the CSS
+ * property given by @property_id using the information in @context.
+ * This step is explained in detail in
+ * <ulink url="http://www.w3.org/TR/css3-cascade/#computed>
+ * the CSS documentation</ulink>.
+ *
+ * Returns: the comptued value
+ **/
 GtkCssValue *
 _gtk_css_value_compute (GtkCssValue     *value,
                         guint            property_id,
@@ -124,6 +138,15 @@ _gtk_css_value_to_string (const GtkCssValue *value)
   return g_string_free (string, FALSE);
 }
 
+/**
+ * _gtk_css_value_print:
+ * @value: the value to print
+ * @string: the string to print to
+ *
+ * Prints @value to the given @string in CSS format. The @value must be a
+ * valid specified value as parsed using the parse functions or as assigned
+ * via _gtk_style_property_assign().
+ **/
 void
 _gtk_css_value_print (const GtkCssValue *value,
                       GString           *string)



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