[gtk+/wip/css: 18/154] css: Pass the parent context to _gtk_css_lookup_resolve()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/css: 18/154] css: Pass the parent context to _gtk_css_lookup_resolve()
- Date: Sat, 7 Jan 2012 14:49:24 +0000 (UTC)
commit a5450ead18427ec31e8ed92337de3207e00a7429
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 29 13:38:45 2011 +0100
css: Pass the parent context to _gtk_css_lookup_resolve()
This way, we can resolve inherit properties.
gtk/gtkcsslookup.c | 6 +++++-
gtk/gtkcsslookupprivate.h | 4 +++-
gtk/gtkstylecontext.c | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c
index 5badd7b..c5fd148 100644
--- a/gtk/gtkcsslookup.c
+++ b/gtk/gtkcsslookup.c
@@ -94,6 +94,8 @@ _gtk_css_lookup_set (GtkCssLookup *lookup,
/**
* _gtk_css_lookup_resolve:
* @lookup: the lookup
+ * @parent: the parent properties to look up inherited values from or %NULL
+ * if none
*
* Resolves the current lookup into a styleproperties object. This is done
* by converting from the "winning declaration" to the "computed value".
@@ -104,12 +106,14 @@ _gtk_css_lookup_set (GtkCssLookup *lookup,
* Returns: a new #GtkStyleProperties
**/
GtkStyleProperties *
-_gtk_css_lookup_resolve (GtkCssLookup *lookup)
+_gtk_css_lookup_resolve (GtkCssLookup *lookup,
+ GtkStyleContext *parent)
{
GtkStyleProperties *props;
guint i, n;
g_return_val_if_fail (lookup != NULL, NULL);
+ g_return_val_if_fail (parent == NULL || GTK_IS_STYLE_CONTEXT (parent), NULL);
n = _gtk_style_property_get_count ();
props = gtk_style_properties_new ();
diff --git a/gtk/gtkcsslookupprivate.h b/gtk/gtkcsslookupprivate.h
index b1d6d5e..19001d8 100644
--- a/gtk/gtkcsslookupprivate.h
+++ b/gtk/gtkcsslookupprivate.h
@@ -22,6 +22,7 @@
#include <glib-object.h>
#include "gtk/gtkbitmaskprivate.h"
+#include "gtk/gtkstylecontext.h"
#include "gtk/gtkstyleproperties.h"
@@ -38,7 +39,8 @@ gboolean _gtk_css_lookup_is_missing (const GtkCssLoo
void _gtk_css_lookup_set (GtkCssLookup *lookup,
guint id,
const GValue *value);
-GtkStyleProperties * _gtk_css_lookup_resolve (GtkCssLookup *lookup);
+GtkStyleProperties * _gtk_css_lookup_resolve (GtkCssLookup *lookup,
+ GtkStyleContext *context);
G_END_DECLS
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 21205c3..bbcdc2a 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -987,7 +987,7 @@ build_properties (GtkStyleContext *context,
}
}
- style_data->store = _gtk_css_lookup_resolve (lookup);
+ style_data->store = _gtk_css_lookup_resolve (lookup, priv->parent);
_gtk_style_properties_set_color_lookup_func (style_data->store,
gtk_style_context_color_lookup_func,
context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]