From 8e1017db355a75f20461fe20761932a9095ad325 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 30 Jan 2015 11:42:22 +0100 Subject: [PATCH] stylecontext: Export gtk_style_context_get_root() .. in the private header. This avoids tiny wrapper functions. --- gtk/gtkstylecontext.c | 20 +++++--------------- gtk/gtkstylecontextprivate.h | 4 ++-- gtk/gtkwidget.c | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 32f1fc7cbc..a141011f03 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -315,7 +315,7 @@ static void gtk_style_context_cascade_changed (GtkStyleCascade *cascade, GtkStyleContext *context) { - _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_SOURCE); + gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_SOURCE); } static void @@ -375,7 +375,7 @@ static void gtk_style_context_update (GdkFrameClock *clock, GtkStyleContext *context) { - _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANIMATE); + gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_ANIMATE); } static gboolean @@ -603,7 +603,7 @@ gtk_style_context_is_saved (GtkStyleContext *context) return context->priv->saved_nodes != NULL; } -static GtkCssNode * +GtkCssNode * gtk_style_context_get_root (GtkStyleContext *context) { GtkStyleContextPrivate *priv; @@ -889,7 +889,7 @@ _gtk_style_context_set_widget (GtkStyleContext *context, _gtk_style_context_update_animating (context); - _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY_SELF); + gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_ANY_SELF); } /** @@ -1490,7 +1490,7 @@ gtk_style_context_set_parent (GtkStyleContext *context, priv->parent = parent; g_object_notify (G_OBJECT (context), "parent"); - _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY_PARENT | GTK_CSS_CHANGE_ANY_SIBLING); + gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_ANY_PARENT | GTK_CSS_CHANGE_ANY_SIBLING); } /** @@ -2945,16 +2945,6 @@ _gtk_style_context_validate (GtkStyleContext *context, _gtk_bitmask_free (changes); } -void -_gtk_style_context_queue_invalidate (GtkStyleContext *context, - GtkCssChange change) -{ - g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); - g_return_if_fail (change != 0); - - gtk_css_node_invalidate (gtk_style_context_get_root (context), change); -} - /** * gtk_style_context_invalidate: * @context: a #GtkStyleContext. diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h index a520bf73b2..08b8ff63c6 100644 --- a/gtk/gtkstylecontextprivate.h +++ b/gtk/gtkstylecontextprivate.h @@ -20,6 +20,7 @@ #include "gtkstylecontext.h" +#include "gtkcssnodeprivate.h" #include "gtkicontheme.h" #include "gtkstyleproviderprivate.h" #include "gtkbitmaskprivate.h" @@ -29,6 +30,7 @@ G_BEGIN_DECLS void _gtk_style_context_set_widget (GtkStyleContext *context, GtkWidget *widget); +GtkCssNode * gtk_style_context_get_root (GtkStyleContext *context); void gtk_style_context_set_id (GtkStyleContext *context, const char *id); const char * gtk_style_context_get_id (GtkStyleContext *context); @@ -46,8 +48,6 @@ void _gtk_style_context_validate (GtkStyleContext *c gint64 timestamp, GtkCssChange change, const GtkBitmask*parent_changes); -void _gtk_style_context_queue_invalidate (GtkStyleContext *context, - GtkCssChange change); gboolean _gtk_style_context_check_region_name (const gchar *str); gboolean _gtk_style_context_resolve_color (GtkStyleContext *context, diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 00c8c4b6d6..396b8fcdea 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -16465,7 +16465,7 @@ _gtk_widget_invalidate_style_context (GtkWidget *widget, if (priv->context == NULL) return; - _gtk_style_context_queue_invalidate (priv->context, change); + gtk_css_node_invalidate (gtk_style_context_get_root (priv->context), change); } /**