[gtk+] stylecascade: Remove function



commit f2d4b07f4bb44f7bf433a6178aabd43b12e7be7b
Author: Benjamin Otte <otte redhat com>
Date:   Thu Feb 20 02:08:53 2014 +0100

    stylecascade: Remove function
    
    Inline it.

 gtk/gtkstylecascade.c        |    9 ---------
 gtk/gtkstylecascadeprivate.h |    1 -
 gtk/gtkstylecontext.c        |   18 ++++++++++--------
 3 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkstylecascade.c b/gtk/gtkstylecascade.c
index 7f281b3..d4216f1 100644
--- a/gtk/gtkstylecascade.c
+++ b/gtk/gtkstylecascade.c
@@ -21,7 +21,6 @@
 
 #include "gtkstyleprovider.h"
 #include "gtkstyleproviderprivate.h"
-#include "gtksettingsprivate.h"
 
 typedef struct _GtkStyleCascadeIter GtkStyleCascadeIter;
 typedef struct _GtkStyleProviderData GtkStyleProviderData;
@@ -310,14 +309,6 @@ _gtk_style_cascade_new (void)
   return g_object_new (GTK_TYPE_STYLE_CASCADE, NULL);
 }
 
-GtkStyleCascade *
-_gtk_style_cascade_get_for_screen (GdkScreen *screen)
-{
-  g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
-  return _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
-}
-
 void
 _gtk_style_cascade_set_parent (GtkStyleCascade *cascade,
                                GtkStyleCascade *parent)
diff --git a/gtk/gtkstylecascadeprivate.h b/gtk/gtkstylecascadeprivate.h
index cd29025..0bd0cb2 100644
--- a/gtk/gtkstylecascadeprivate.h
+++ b/gtk/gtkstylecascadeprivate.h
@@ -49,7 +49,6 @@ struct _GtkStyleCascadeClass
 GType                 _gtk_style_cascade_get_type               (void) G_GNUC_CONST;
 
 GtkStyleCascade *     _gtk_style_cascade_new                    (void);
-GtkStyleCascade *     _gtk_style_cascade_get_for_screen         (GdkScreen           *screen);
 
 void                  _gtk_style_cascade_set_parent             (GtkStyleCascade     *cascade,
                                                                  GtkStyleCascade     *parent);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index a42b197..0dd86c4 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -637,7 +637,7 @@ gtk_style_context_init (GtkStyleContext *style_context)
   priv->info->state_flags = GTK_STATE_FLAG_DIR_LTR;
 
   gtk_style_context_set_cascade (style_context,
-                                 _gtk_style_cascade_get_for_screen (priv->screen));
+                                 _gtk_settings_get_style_cascade (gtk_settings_get_for_screen 
(priv->screen)));
 }
 
 static void
@@ -1084,7 +1084,7 @@ gtk_style_context_add_provider (GtkStyleContext  *context,
 
   priv = context->priv;
 
-  if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
+  if (priv->cascade == _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen)))
     {
       GtkStyleCascade *new_cascade;
       
@@ -1120,7 +1120,7 @@ gtk_style_context_remove_provider (GtkStyleContext  *context,
 
   priv = context->priv;
 
-  if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
+  if (priv->cascade == _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen)))
     return;
 
   _gtk_style_cascade_remove_provider (priv->cascade, provider);
@@ -1193,7 +1193,7 @@ gtk_style_context_add_provider_for_screen (GdkScreen        *screen,
   g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
   g_return_if_fail (!GTK_IS_SETTINGS (provider) || _gtk_settings_get_screen (GTK_SETTINGS (provider)) == 
screen);
 
-  cascade = _gtk_style_cascade_get_for_screen (screen);
+  cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
   _gtk_style_cascade_add_provider (cascade, provider, priority);
 }
 
@@ -1216,7 +1216,7 @@ gtk_style_context_remove_provider_for_screen (GdkScreen        *screen,
   g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
   g_return_if_fail (!GTK_IS_SETTINGS (provider));
 
-  cascade = _gtk_style_cascade_get_for_screen (screen);
+  cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
   _gtk_style_cascade_remove_provider (cascade, provider);
 }
 
@@ -2541,6 +2541,7 @@ gtk_style_context_set_screen (GtkStyleContext *context,
                               GdkScreen       *screen)
 {
   GtkStyleContextPrivate *priv;
+  GtkStyleCascade *screen_cascade;
 
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
   g_return_if_fail (GDK_IS_SCREEN (screen));
@@ -2549,13 +2550,14 @@ gtk_style_context_set_screen (GtkStyleContext *context,
   if (priv->screen == screen)
     return;
 
-  if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
+  screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
+  if (priv->cascade == screen_cascade)
     {
-      gtk_style_context_set_cascade (context, _gtk_style_cascade_get_for_screen (screen));
+      gtk_style_context_set_cascade (context, screen_cascade);
     }
   else
     {
-      _gtk_style_cascade_set_parent (priv->cascade, _gtk_style_cascade_get_for_screen (screen));
+      _gtk_style_cascade_set_parent (priv->cascade, screen_cascade);
     }
 
   priv->screen = screen;


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