]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstylecascade.c
filechooserbutton: whitespace fixes
[~andy/gtk] / gtk / gtkstylecascade.c
index 9f54e37d13a56eb537e7916535e2a8595bf55bd9..ea63fc86f6637c56c2a05f3e0cf29150ebfe0f38 100644 (file)
@@ -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,
@@ -127,30 +117,42 @@ gtk_style_cascade_get_style_property (GtkStyleProvider *provider,
   return FALSE;
 }
 
-static GtkIconFactory *
-gtk_style_cascade_get_icon_factory (GtkStyleProvider *provider,
-                                   GtkWidgetPath    *path)
-{
-  /* If anyone ever implements get_icon_factory(), I'll
-   * look at this function. Until then I'll just: */
-  return NULL;
-}
-
 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;
-  iface->get_icon_factory = gtk_style_cascade_get_icon_factory;
 }
 
-static GtkSymbolicColor *
+static GtkSettings *
+gtk_style_cascade_get_settings (GtkStyleProviderPrivate *provider)
+{
+  GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
+  GtkStyleCascadeIter iter;
+  GtkSettings *settings;
+  GtkStyleProvider *item;
+
+  for (item = gtk_style_cascade_iter_init (cascade, &iter);
+       item;
+       item = gtk_style_cascade_iter_next (cascade, &iter))
+    {
+      if (!GTK_IS_STYLE_PROVIDER_PRIVATE (item))
+        continue;
+          
+      settings = _gtk_style_provider_private_get_settings (GTK_STYLE_PROVIDER_PRIVATE (item));
+      if (settings)
+        return settings;
+    }
+
+  return NULL;
+}
+
+static GtkCssValue *
 gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
                              const char              *name)
 {
   GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
   GtkStyleCascadeIter iter;
-  GtkSymbolicColor *symbolic;
+  GtkCssValue *color;
   GtkStyleProvider *item;
 
   for (item = gtk_style_cascade_iter_init (cascade, &iter);
@@ -159,9 +161,9 @@ gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
     {
       if (GTK_IS_STYLE_PROVIDER_PRIVATE (item))
         {
-          symbolic = _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (item), name);
-          if (symbolic)
-            return symbolic;
+          color = _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (item), name);
+          if (color)
+            return color;
         }
       else
         {
@@ -254,6 +256,7 @@ static void
 gtk_style_cascade_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface)
 {
   iface->get_color = gtk_style_cascade_get_color;
+  iface->get_settings = gtk_style_cascade_get_settings;
   iface->get_keyframes = gtk_style_cascade_get_keyframes;
   iface->lookup = gtk_style_cascade_lookup;
   iface->get_change = gtk_style_cascade_get_change;