[gtk+/gtk-style-context: 60/347] Add GtkWidgetPath parameter to gtk_style_provider_get_style().



commit 53425bc75b9705f2b8e261c4daf52075977fea6e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Apr 11 20:30:24 2010 +0200

    Add GtkWidgetPath parameter to gtk_style_provider_get_style().

 gtk/gtkstylecontext.c  |   11 ++++++++---
 gtk/gtkstyleprovider.c |    5 +++--
 gtk/gtkstyleprovider.h |    7 +++++--
 gtk/gtkstyleset.c      |    3 ++-
 4 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 9bf51e1..f8f6c08 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -136,9 +136,14 @@ rebuild_properties (GtkStyleContext *context)
       data = list->data;
       list = list->next;
 
-      provider_style = gtk_style_provider_get_style (data->provider);
-      gtk_style_set_merge (priv->store, provider_style, TRUE);
-      g_object_unref (provider_style);
+      provider_style = gtk_style_provider_get_style (data->provider,
+                                                     priv->widget_path);
+
+      if (provider_style)
+        {
+          gtk_style_set_merge (priv->store, provider_style, TRUE);
+          g_object_unref (provider_style);
+        }
     }
 }
 
diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c
index 18cca7b..606f4a1 100644
--- a/gtk/gtkstyleprovider.c
+++ b/gtk/gtkstyleprovider.c
@@ -48,7 +48,8 @@ gtk_style_provider_iface_init (gpointer g_iface)
 }
 
 GtkStyleSet *
-gtk_style_provider_get_style (GtkStyleProvider *provider)
+gtk_style_provider_get_style (GtkStyleProvider *provider,
+                              GtkWidgetPath    *path)
 {
   GtkStyleProviderIface *iface;
 
@@ -59,7 +60,7 @@ gtk_style_provider_get_style (GtkStyleProvider *provider)
   if (!iface->get_style)
     return NULL;
 
-  return iface->get_style (provider);
+  return iface->get_style (provider, path);
 }
 
 #define __GTK_STYLE_PROVIDER_C__
diff --git a/gtk/gtkstyleprovider.h b/gtk/gtkstyleprovider.h
index ec5ee99..6e12bb3 100644
--- a/gtk/gtkstyleprovider.h
+++ b/gtk/gtkstyleprovider.h
@@ -21,6 +21,7 @@
 #define __GTK_STYLE_PROVIDER_H__
 
 #include <glib-object.h>
+#include "gtkwidgetpath.h"
 #include "gtkstyleset.h"
 #include "gtkenums.h"
 
@@ -45,12 +46,14 @@ struct GtkStyleProviderIface
 {
   GTypeInterface g_iface;
 
-  GtkStyleSet * (* get_style) (GtkStyleProvider *provider);
+  GtkStyleSet * (* get_style) (GtkStyleProvider *provider,
+                               GtkWidgetPath    *path);
 };
 
 GType gtk_style_provider_get_type (void) G_GNUC_CONST;
 
-GtkStyleSet *gtk_style_provider_get_style (GtkStyleProvider *provider);
+GtkStyleSet *gtk_style_provider_get_style (GtkStyleProvider *provider,
+                                           GtkWidgetPath    *path);
 
 
 G_END_DECLS
diff --git a/gtk/gtkstyleset.c b/gtk/gtkstyleset.c
index 19e1a97..73e33be 100644
--- a/gtk/gtkstyleset.c
+++ b/gtk/gtkstyleset.c
@@ -134,7 +134,8 @@ gtk_style_set_finalize (GObject *object)
 }
 
 GtkStyleSet *
-gtk_style_set_get_style (GtkStyleProvider *provider)
+gtk_style_set_get_style (GtkStyleProvider *provider,
+                         GtkWidgetPath    *path)
 {
   /* Return style set itself */
   return g_object_ref (provider);



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