css: Introduce dependencies for value computations

When values are computed, they might depend on various other values and
we need to track this so we can update the values when those other
values change. This is the first step in making that happen.

This patch does not do any dependency tracking at all, instead it uses
GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
This commit is contained in:
Benjamin Otte
2012-07-16 14:48:43 +02:00
parent 9e7e65ca6e
commit 0e2f35ed88
24 changed files with 153 additions and 85 deletions

View File

@ -41,9 +41,10 @@ gtk_css_value_array_free (GtkCssValue *value)
}
static GtkCssValue *
gtk_css_value_array_compute (GtkCssValue *value,
guint property_id,
GtkStyleContext *context)
gtk_css_value_array_compute (GtkCssValue *value,
guint property_id,
GtkStyleContext *context,
GtkCssDependencies *dependencies)
{
GtkCssValue *result;
gboolean changed = FALSE;
@ -52,10 +53,12 @@ gtk_css_value_array_compute (GtkCssValue *value,
if (value->n_values == 0)
return _gtk_css_value_ref (value);
*dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
for (i = 0; i < value->n_values; i++)
{
result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context);
result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context, NULL);
changed |= (result->values[i] != value->values[i]);
}