[gtk+/wip/cssnode3: 16/101] stylecontext: Export gtk_style_context_get_root()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 16/101] stylecontext: Export gtk_style_context_get_root()
- Date: Wed, 11 Mar 2015 00:20:57 +0000 (UTC)
commit 31830993cee0fbe22c42964f2a0031c2f5f080f6
Author: Benjamin Otte <otte redhat com>
Date: Fri Jan 30 11:42:22 2015 +0100
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 4545259..0344d61 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 91e183c..eef5164 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 c35b7dd..3f2fa50 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);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]