From 9b4ed662181cabde506248cf8b344420a0300a3e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 12 Jul 2012 03:43:15 +0200 Subject: 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. --- gtk/gtkcssshadowvalue.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gtk/gtkcssshadowvalue.c') diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index a1adfc9558..dfd3b1c992 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -61,6 +61,7 @@ gtk_css_value_shadow_free (GtkCssValue *shadow) static GtkCssValue * gtk_css_value_shadow_compute (GtkCssValue *shadow, + guint property_id, GtkStyleContext *context) { GdkRGBA transparent = { 0, 0, 0, 0 }; @@ -73,10 +74,10 @@ gtk_css_value_shadow_compute (GtkCssValue *shadow, FALSE); _gtk_css_value_unref (fallback); - return gtk_css_shadow_value_new (_gtk_css_value_compute (shadow->hoffset, context), - _gtk_css_value_compute (shadow->voffset, context), - _gtk_css_value_compute (shadow->radius, context), - _gtk_css_value_compute (shadow->spread, context), + return gtk_css_shadow_value_new (_gtk_css_value_compute (shadow->hoffset, property_id, context), + _gtk_css_value_compute (shadow->voffset, property_id, context), + _gtk_css_value_compute (shadow->radius, property_id, context), + _gtk_css_value_compute (shadow->spread, property_id, context), shadow->inset, color); } -- cgit v1.2.1