[gtk+/wip/cssnode3: 16/46] stylecontext: Export gtk_style_context_get_root()



commit 2d0d28e09b6921cb5333867fcd48d81cbb3d6751
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 08b95d4..5f032eb 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -313,7 +313,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
@@ -373,7 +373,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
@@ -601,7 +601,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;
@@ -887,7 +887,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);
 }
 
 /**
@@ -1488,7 +1488,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);
 }
 
 /**
@@ -2943,16 +2943,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 50c5d6a..384d3f8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -16453,7 +16453,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]