[gtk+/wip/cssnode3: 64/101] cssnode: Move style context function to only user



commit 7260aed8f2b54163e74f081ab24c869adbd6b0d0
Author: Benjamin Otte <otte redhat com>
Date:   Fri Feb 20 17:36:10 2015 +0100

    cssnode: Move style context function to only user

 gtk/gtkcsswidgetnode.c       |   26 +++++++++++++++++++++++++-
 gtk/gtkstylecontext.c        |   30 ------------------------------
 gtk/gtkstylecontextprivate.h |    2 --
 3 files changed, 25 insertions(+), 33 deletions(-)
---
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c
index 1bc2124..42348f9 100644
--- a/gtk/gtkcsswidgetnode.c
+++ b/gtk/gtkcsswidgetnode.c
@@ -85,6 +85,30 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node)
 }
 
 static gboolean
+gtk_css_widget_node_should_create_transitions (GtkCssWidgetNode *widget_node,
+                                               GtkCssStyle      *previous_style)
+{
+  GtkWidget *widget;
+  gboolean animate;
+
+  widget = widget_node->widget;
+  if (widget == NULL)
+    return FALSE;
+
+  if (!gtk_widget_get_mapped (widget))
+    return FALSE;
+
+  if (previous_style == gtk_css_static_style_get_default ())
+    return FALSE;
+
+  g_object_get (gtk_widget_get_settings (widget),
+                "gtk-enable-animations", &animate,
+                NULL);
+
+  return animate;
+}
+
+static gboolean
 gtk_css_static_style_needs_revalidate (GtkCssStaticStyle  *style,
                                        GtkCssChange        change)
 {
@@ -149,7 +173,7 @@ gtk_css_widget_node_validate (GtkCssNode       *node,
                                               parent ? gtk_css_node_get_style (parent) : NULL,
                                               timestamp,
                                               gtk_css_node_get_style_provider (node),
-                                              gtk_style_context_should_create_transitions (context, style) ? 
style : NULL);
+                                              gtk_css_widget_node_should_create_transitions (widget_node, 
style) ? style : NULL);
       
       g_object_unref (new_static_style);
     }
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 907d2d7..c5cd25f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2424,36 +2424,6 @@ gtk_style_context_do_invalidate (GtkStyleContext  *context,
   priv->invalidating_context = NULL;
 }
 
-gboolean
-gtk_style_context_should_create_transitions (GtkStyleContext *context,
-                                             GtkCssStyle     *previous_style)
-{
-  GtkStyleContextPrivate *priv;
-  GtkWidget *widget;
-  gboolean animate;
-
-  priv = context->priv;
-
-  if (GTK_IS_CSS_WIDGET_NODE (priv->cssnode))
-    return FALSE;
-
-  widget = gtk_css_widget_node_get_widget (GTK_CSS_WIDGET_NODE (priv->cssnode));
-  if (widget == NULL)
-    return FALSE;
-
-  if (!gtk_widget_get_mapped (widget))
-    return FALSE;
-
-  if (previous_style == gtk_css_static_style_get_default ())
-    return FALSE;
-
-  g_object_get (gtk_widget_get_settings (widget),
-                "gtk-enable-animations", &animate,
-                NULL);
-
-  return animate;
-}
-
 void
 gtk_style_context_validate (GtkStyleContext  *context,
                             const GtkBitmask *changes)
diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h
index 316b417..af9f4a7 100644
--- a/gtk/gtkstylecontextprivate.h
+++ b/gtk/gtkstylecontextprivate.h
@@ -45,8 +45,6 @@ GtkCssValue   * _gtk_style_context_peek_property             (GtkStyleContext *c
 const GValue * _gtk_style_context_peek_style_property        (GtkStyleContext *context,
                                                               GType            widget_type,
                                                               GParamSpec      *pspec);
-gboolean        gtk_style_context_should_create_transitions  (GtkStyleContext *context,
-                                                              GtkCssStyle     *previous_style);
 void            gtk_style_context_validate                   (GtkStyleContext *context,
                                                               const GtkBitmask*changes);
 gboolean       _gtk_style_context_check_region_name          (const gchar     *str);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]