css: Introduce _gtk_css_value_compute()

This commit is essentially a large reorganization. Instead of all value
subtypes having their own compute function, there is the general
_gtk_css_value_compute() function that then calls a vfunc on the
subtype.
This commit is contained in:
Benjamin Otte
2012-07-11 06:56:07 +02:00
parent 3f00801e9a
commit 9b953829fb
31 changed files with 355 additions and 275 deletions

View File

@ -34,6 +34,13 @@ gtk_css_value_engine_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_engine_compute (GtkCssValue *value,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_engine_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
@ -67,6 +74,7 @@ gtk_css_value_engine_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_ENGINE = {
gtk_css_value_engine_free,
gtk_css_value_engine_compute,
gtk_css_value_engine_equal,
gtk_css_value_engine_transition,
gtk_css_value_engine_print