summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimage.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-07-12 03:43:15 +0200
committerBenjamin Otte <otte@redhat.com>2012-08-28 15:40:56 +0200
commit9b4ed662181cabde506248cf8b344420a0300a3e (patch)
tree50063700a3f95fa1af072c20202c0387ffff4040 /gtk/gtkcssimage.c
parent9b953829fbf1332d00c2ca8a99c7da5e4bda8c64 (diff)
downloadgtk+-9b4ed662181cabde506248cf8b344420a0300a3e.tar.gz
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.
Diffstat (limited to 'gtk/gtkcssimage.c')
-rw-r--r--gtk/gtkcssimage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index f92d4e9d6e..e10de72d03 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -58,6 +58,7 @@ gtk_css_image_real_get_aspect_ratio (GtkCssImage *image)
static GtkCssImage *
gtk_css_image_real_compute (GtkCssImage *image,
+ guint property_id,
GtkStyleContext *context)
{
return g_object_ref (image);
@@ -115,6 +116,7 @@ _gtk_css_image_get_aspect_ratio (GtkCssImage *image)
GtkCssImage *
_gtk_css_image_compute (GtkCssImage *image,
+ guint property_id,
GtkStyleContext *context)
{
GtkCssImageClass *klass;
@@ -124,7 +126,7 @@ _gtk_css_image_compute (GtkCssImage *image,
klass = GTK_CSS_IMAGE_GET_CLASS (image);
- return klass->compute (image, context);
+ return klass->compute (image, property_id, context);
}
void