css: Pass property_id to compute function

This is a reorganization of how value computing should be done.
Previously the GtkCssStyleProperty.compute vfunc was supposed to take
care of special cases when it needed those for computation. However,
this proved to be very complicated in cases where values were nested and
only the last value (of a common type) needed to be special cased.

A common example for this was the fallback handling for unresolvable
colors.

Now, we pass the property's ID along with all compute functions so we
can do the special casing where it's necessary.
Note that no actual changes happen in this commit. This will happen in
follow-ups.
This commit is contained in:
Benjamin Otte
2012-07-12 03:43:15 +02:00
parent 9b953829fb
commit 9b4ed66218
26 changed files with 58 additions and 30 deletions

View File

@ -43,6 +43,7 @@ gtk_css_value_border_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_border_compute (GtkCssValue *value,
guint property_id,
GtkStyleContext *context)
{
GtkCssValue *computed;
@ -56,7 +57,7 @@ gtk_css_value_border_compute (GtkCssValue *value,
{
if (value->values[i])
{
computed->values[i] = _gtk_css_value_compute (value->values[i], context);
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, context);
changed |= (computed->values[i] != value->values[i]);
}
}