[gtk+/gtk-style-context: 111/490] GtkStyleProvider: Add gtk_style_provider_get_icon_factory().



commit 0d3814957181fed48559dc4a122c034cd2468074
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jun 27 19:35:08 2010 +0200

    GtkStyleProvider: Add gtk_style_provider_get_icon_factory().
    
    With this, style providers have a way to override default icon theme.

 gtk/gtkstyleprovider.c |   16 ++++++++++++++++
 gtk/gtkstyleprovider.h |    7 +++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c
index e67d447..4240176 100644
--- a/gtk/gtkstyleprovider.c
+++ b/gtk/gtkstyleprovider.c
@@ -83,6 +83,22 @@ gtk_style_provider_get_style_property (GtkStyleProvider *provider,
   return iface->get_style_property (provider, widget_path, property_name, value);
 }
 
+GtkIconFactory *
+gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
+				     GtkWidgetPath    *path)
+{
+  GtkStyleProviderIface *iface;
+
+  g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
+  g_return_val_if_fail (path != NULL, NULL);
+
+  iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
+
+  if (!iface->get_icon_factory)
+    return NULL;
+
+  return iface->get_icon_factory (provider, path);
+}
 
 #define __GTK_STYLE_PROVIDER_C__
 #include "gtkaliasdef.c"
diff --git a/gtk/gtkstyleprovider.h b/gtk/gtkstyleprovider.h
index 5fc30ed..6c3a575 100644
--- a/gtk/gtkstyleprovider.h
+++ b/gtk/gtkstyleprovider.h
@@ -22,6 +22,7 @@
 
 #include <glib-object.h>
 #include "gtkwidgetpath.h"
+#include "gtkiconfactory.h"
 #include "gtkstyleset.h"
 #include "gtkenums.h"
 
@@ -51,6 +52,9 @@ struct GtkStyleProviderIface
                                    GtkWidgetPath    *path,
                                    const gchar      *property_name,
                                    GValue           *value);
+
+  GtkIconFactory * (* get_icon_factory) (GtkStyleProvider *provider,
+					 GtkWidgetPath    *path);
 };
 
 GType gtk_style_provider_get_type (void) G_GNUC_CONST;
@@ -63,6 +67,9 @@ gboolean gtk_style_provider_get_style_property (GtkStyleProvider *provider,
                                                 const gchar      *property_name,
                                                 GValue           *value);
 
+GtkIconFactory * gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
+						      GtkWidgetPath    *path);
+
 G_END_DECLS
 
 #endif /* __GTK_STYLE_PROVIDER_H__ */



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