[gtk+/wip/cssnode3: 74/101] stylecontext: Call get_style(), not create_style()



commit 8f587cd1725e00e18eefb89e3bc3bbc5954a141b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Feb 23 03:06:02 2015 +0100

    stylecontext: Call get_style(), not create_style()
    
    We want to ensure that the style is created properly.
    
    This also allows making the create_Style() function private.

 gtk/gtkcssnode.c        |    2 +-
 gtk/gtkcssnodeprivate.h |    4 +---
 gtk/gtkstylecontext.c   |    2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 8f089e0..64e6a37 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -177,7 +177,7 @@ store_in_global_parent_cache (GtkCssNode                  *node,
                        g_object_ref (style));
 }
 
-GtkCssStyle *
+static GtkCssStyle *
 gtk_css_node_create_style (GtkCssNode *cssnode)
 {
   const GtkCssNodeDeclaration *decl;
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h
index 1b22fe5..00a106a 100644
--- a/gtk/gtkcssnodeprivate.h
+++ b/gtk/gtkcssnodeprivate.h
@@ -131,10 +131,8 @@ GList *                 gtk_css_node_list_regions       (GtkCssNode            *
 
 const GtkCssNodeDeclaration *
                         gtk_css_node_get_declaration    (GtkCssNode            *cssnode);
-
-
 GtkCssStyle *           gtk_css_node_get_style          (GtkCssNode            *cssnode);
-GtkCssStyle *           gtk_css_node_create_style       (GtkCssNode            *cssnode);
+
 
 void                    gtk_css_node_invalidate_style_provider
                                                         (GtkCssNode            *cssnode);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 73aafbf..efdcd5e 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -525,7 +525,7 @@ gtk_style_context_lookup_style_for_state (GtkStyleContext *context,
   node = gtk_css_transient_node_new (context->priv->cssnode);
   gtk_css_node_set_parent (node, gtk_css_node_get_parent (context->priv->cssnode));
   gtk_css_node_set_state (node, state);
-  values = gtk_css_node_create_style (node);
+  values = g_object_ref (gtk_css_node_get_style (node));
   gtk_css_node_set_parent (node, NULL);
   g_object_unref (node);
 


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