[gtk+/wip/cssnode3: 59/101] cssnode: Add gtk_css_node_invalidate_style_provider()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 59/101] cssnode: Add gtk_css_node_invalidate_style_provider()
- Date: Wed, 11 Mar 2015 00:24:33 +0000 (UTC)
commit 1c8f9d27804925fe5ee1431bd362ed100b679efa
Author: Benjamin Otte <otte redhat com>
Date: Tue Feb 17 16:11:38 2015 +0100
cssnode: Add gtk_css_node_invalidate_style_provider()
This function not just invalidates the current node, but also all
children.
gtk/gtkcssnode.c | 19 +++++++++++++++++++
gtk/gtkcssnodeprivate.h | 2 ++
gtk/gtkstylecontext.c | 2 +-
3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index d81f061..3a317cd 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -438,6 +438,9 @@ gtk_css_node_reposition (GtkCssNode *node,
{
gtk_css_node_parent_was_unset (node);
}
+
+ if (gtk_css_node_get_style_provider_or_null (node) == NULL)
+ gtk_css_node_invalidate_style_provider (node);
}
if (parent)
@@ -737,6 +740,22 @@ gtk_css_node_get_declaration (GtkCssNode *cssnode)
}
void
+gtk_css_node_invalidate_style_provider (GtkCssNode *cssnode)
+{
+ GtkCssNode *child;
+
+ gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_SOURCE);
+
+ for (child = cssnode->first_child;
+ child;
+ child = child->next_sibling)
+ {
+ if (gtk_css_node_get_style_provider_or_null (child) == NULL)
+ gtk_css_node_invalidate_style_provider (child);
+ }
+}
+
+void
gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change)
{
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h
index 8cfcd2a..7403cd3 100644
--- a/gtk/gtkcssnodeprivate.h
+++ b/gtk/gtkcssnodeprivate.h
@@ -139,6 +139,8 @@ void gtk_css_node_set_style (GtkCssNode *
GtkCssStyle *style);
GtkCssStyle * gtk_css_node_create_style (GtkCssNode *cssnode);
+void gtk_css_node_invalidate_style_provider
+ (GtkCssNode *cssnode);
void gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change);
void gtk_css_node_validate (GtkCssNode *cssnode,
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 63dc7f0..907d2d7 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -289,7 +289,7 @@ static void
gtk_style_context_cascade_changed (GtkStyleCascade *cascade,
GtkStyleContext *context)
{
- gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_SOURCE);
+ gtk_css_node_invalidate_style_provider (gtk_style_context_get_root (context));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]