[gtk+] styleprovider: Remove (broken) implementations of get_style



commit 932794e10513b6999a742a16b774dc7f4bc52346
Author: Benjamin Otte <otte redhat com>
Date:   Sat Nov 24 21:08:11 2012 +0100

    styleprovider: Remove (broken) implementations of get_style
    
    The implementations were broken and get_style() is deprecated and
    documented to return NULL now.

 gtk/gtkcssprovider.c        |   64 -------------------------------------------
 gtk/gtkcssselector.c        |   13 ---------
 gtk/gtkcssselectorprivate.h |    2 -
 gtk/gtkmodifierstyle.c      |   11 -------
 gtk/gtksettings.c           |   14 ---------
 gtk/gtkstylecascade.c       |   11 -------
 gtk/gtkstyleproperties.c    |    9 ------
 7 files changed, 0 insertions(+), 124 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 98a44575..171becb 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1409,69 +1409,6 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
                                            (GDestroyNotify) _gtk_css_value_unref);
 }
 
-static void
-css_provider_dump_symbolic_colors (GtkCssProvider     *css_provider,
-                                   GtkStyleProperties *props)
-{
-  GtkCssProviderPrivate *priv;
-  GHashTableIter iter;
-  gpointer key, value;
-
-  priv = css_provider->priv;
-  g_hash_table_iter_init (&iter, priv->symbolic_colors);
-
-  while (g_hash_table_iter_next (&iter, &key, &value))
-    {
-      const gchar *name;
-      GtkSymbolicColor *color;
-
-      name = key;
-      color = value;
-
-      gtk_style_properties_map_color (props, name, color);
-    }
-}
-
-static GtkStyleProperties *
-gtk_css_provider_get_style (GtkStyleProvider *provider,
-                            GtkWidgetPath    *path)
-{
-  GtkCssMatcher matcher;
-  GtkCssProvider *css_provider;
-  GtkCssProviderPrivate *priv;
-  GtkStyleProperties *props;
-  guint i, j;
-
-  css_provider = GTK_CSS_PROVIDER (provider);
-  priv = css_provider->priv;
-  props = gtk_style_properties_new ();
-
-  css_provider_dump_symbolic_colors (css_provider, props);
-  if (_gtk_css_matcher_init (&matcher, path, 0))
-    {
-      for (i = 0; i < priv->rulesets->len; i++)
-        {
-          GtkCssRuleset *ruleset;
-
-          ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
-
-          if (ruleset->styles == NULL)
-            continue;
-
-          if (!gtk_css_ruleset_matches (ruleset, &matcher))
-            continue;
-
-          for (j = 0; j < ruleset->n_styles; j++)
-            _gtk_style_properties_set_property_by_property (props,
-                                                            GTK_CSS_STYLE_PROPERTY (ruleset->styles[i].property),
-                                                            _gtk_css_selector_get_state_flags (ruleset->selector),
-                                                            ruleset->styles[i].value);
-        }
-    }
-
-  return props;
-}
-
 static gboolean
 gtk_css_provider_get_style_property (GtkStyleProvider *provider,
                                      GtkWidgetPath    *path,
@@ -1539,7 +1476,6 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
 static void
 gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_css_provider_get_style;
   iface->get_style_property = gtk_css_provider_get_style_property;
 }
 
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index c124bcf..32aef17 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1159,16 +1159,3 @@ _gtk_css_selector_compare (const GtkCssSelector *a,
   return a_elements - b_elements;
 }
 
-GtkStateFlags
-_gtk_css_selector_get_state_flags (const GtkCssSelector *selector)
-{
-  GtkStateFlags state = 0;
-
-  g_return_val_if_fail (selector != NULL, 0);
-
-  for (; selector && selector->class == &GTK_CSS_SELECTOR_NAME; selector = gtk_css_selector_previous (selector))
-    state |= GPOINTER_TO_UINT (selector->data);
-
-  return state;
-}
-
diff --git a/gtk/gtkcssselectorprivate.h b/gtk/gtkcssselectorprivate.h
index 6430054..5c12c6d 100644
--- a/gtk/gtkcssselectorprivate.h
+++ b/gtk/gtkcssselectorprivate.h
@@ -32,8 +32,6 @@ char *            _gtk_css_selector_to_string       (const GtkCssSelector   *sel
 void              _gtk_css_selector_print           (const GtkCssSelector   *selector,
                                                      GString                *str);
 
-GtkStateFlags     _gtk_css_selector_get_state_flags (const GtkCssSelector   *selector);
-
 GtkCssChange      _gtk_css_selector_get_change      (const GtkCssSelector   *selector);
 gboolean          _gtk_css_selector_matches         (const GtkCssSelector   *selector,
                                                      const GtkCssMatcher    *matcher);
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index 9837a0d..5516d0d 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -81,16 +81,6 @@ _gtk_modifier_style_init (GtkModifierStyle *modifier_style)
   priv->style = gtk_style_properties_new ();
 }
 
-static GtkStyleProperties *
-gtk_modifier_style_get_style (GtkStyleProvider *provider,
-                              GtkWidgetPath    *path)
-{
-  GtkModifierStylePrivate *priv;
-
-  priv = GTK_MODIFIER_STYLE (provider)->priv;
-  return g_object_ref (priv->style);
-}
-
 static gboolean
 gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
                                        GtkWidgetPath    *path,
@@ -129,7 +119,6 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
 static void
 gtk_modifier_style_provider_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_modifier_style_get_style;
   iface->get_style_property = gtk_modifier_style_get_style_property;
 }
 
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 34f4211..969b921 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1494,23 +1494,9 @@ settings_ensure_style (GtkSettings *settings)
   g_free (font_name);
 }
 
-static GtkStyleProperties *
-gtk_settings_get_style (GtkStyleProvider *provider,
-                        GtkWidgetPath    *path)
-{
-  GtkSettings *settings;
-
-  settings = GTK_SETTINGS (provider);
-
-  settings_ensure_style (settings);
-
-  return g_object_ref (settings->priv->style);
-}
-
 static void
 gtk_settings_provider_iface_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_settings_get_style;
 }
 
 static GtkSymbolicColor *
diff --git a/gtk/gtkstylecascade.c b/gtk/gtkstylecascade.c
index b6fda51..5061a06 100644
--- a/gtk/gtkstylecascade.c
+++ b/gtk/gtkstylecascade.c
@@ -91,16 +91,6 @@ gtk_style_cascade_iter_init (GtkStyleCascade     *cascade,
   return gtk_style_cascade_iter_next (cascade, iter);
 }
 
-static GtkStyleProperties * 
-gtk_style_cascade_get_style (GtkStyleProvider *provider,
-                             GtkWidgetPath    *path)
-{
-  /* This function is not used anymore by GTK and nobody
-   * else is ever supposed to call it */
-  g_warn_if_reached ();
-  return NULL;
-}
-
 static gboolean
 gtk_style_cascade_get_style_property (GtkStyleProvider *provider,
                                       GtkWidgetPath    *path,
@@ -130,7 +120,6 @@ gtk_style_cascade_get_style_property (GtkStyleProvider *provider,
 static void
 gtk_style_cascade_provider_iface_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_style_cascade_get_style;
   iface->get_style_property = gtk_style_cascade_get_style_property;
 }
 
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 3589535..06407b6 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -279,18 +279,9 @@ gtk_style_properties_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_style_properties_parent_class)->finalize (object);
 }
 
-static GtkStyleProperties *
-gtk_style_properties_get_style (GtkStyleProvider *provider,
-                                GtkWidgetPath    *path)
-{
-  /* Return style set itself */
-  return g_object_ref (provider);
-}
-
 static void
 gtk_style_properties_provider_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_style_properties_get_style;
 }
 
 static GtkSymbolicColor *



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