summaryrefslogtreecommitdiff
path: root/gtk/gtkcssvalue.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-07-16 14:48:43 +0200
committerBenjamin Otte <otte@redhat.com>2012-08-28 15:42:23 +0200
commit0e2f35ed882ab11d010866d32f2f65232145b8d0 (patch)
treef8e1af229adca8cdcce0b08808c3f6571615dd22 /gtk/gtkcssvalue.c
parent9e7e65ca6e01246cf9eea156f0153014b58e4d36 (diff)
downloadgtk+-0e2f35ed882ab11d010866d32f2f65232145b8d0.tar.gz
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.
Diffstat (limited to 'gtk/gtkcssvalue.c')
-rw-r--r--gtk/gtkcssvalue.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c
index 5d5d39227f..e057f90b50 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -66,6 +66,9 @@ _gtk_css_value_unref (GtkCssValue *value)
* @value: the value to compute from
* @property_id: the ID of the property to compute
* @context: the context to use for resolving
+ * @dependencies: (out) (allow-none): Set to the dependencies of the
+ * computed values that indicate when this value needs to be
+ * recomputed and how.
*
* Converts the specified @value into the computed value for the CSS
* property given by @property_id using the information in @context.
@@ -73,17 +76,24 @@ _gtk_css_value_unref (GtkCssValue *value)
* <ulink url="http://www.w3.org/TR/css3-cascade/#computed>
* the CSS documentation</ulink>.
*
- * Returns: the comptued value
+ * Returns: the computed value
**/
GtkCssValue *
-_gtk_css_value_compute (GtkCssValue *value,
- guint property_id,
- GtkStyleContext *context)
+_gtk_css_value_compute (GtkCssValue *value,
+ guint property_id,
+ GtkStyleContext *context,
+ GtkCssDependencies *dependencies)
{
+ GtkCssDependencies fallback;
+
g_return_val_if_fail (value != NULL, NULL);
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
- return value->class->compute (value, property_id, context);
+ if (dependencies == NULL)
+ dependencies = &fallback;
+ *dependencies = 0;
+
+ return value->class->compute (value, property_id, context, dependencies);
}
gboolean