1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
22 #include "gtkprivate.h"
23 #include "gtkstyleprovider.h"
26 static void gtk_style_provider_iface_init (gpointer g_iface);
29 gtk_style_provider_get_type (void)
31 static GType style_provider_type = 0;
33 if (!style_provider_type)
34 style_provider_type = g_type_register_static_simple (G_TYPE_INTERFACE,
35 I_("GtkStyleProvider"),
36 sizeof (GtkStyleProviderIface),
37 (GClassInitFunc) gtk_style_provider_iface_init,
39 return style_provider_type;
43 gtk_style_provider_iface_init (gpointer g_iface)
48 gtk_style_provider_get_style (GtkStyleProvider *provider,
51 GtkStyleProviderIface *iface;
53 g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
55 iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
57 if (!iface->get_style)
60 return iface->get_style (provider, path);
64 gtk_style_provider_get_style_property (GtkStyleProvider *provider,
65 GtkWidgetPath *widget_path,
66 const gchar *property_name,
69 GtkStyleProviderIface *iface;
71 g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), FALSE);
72 g_return_val_if_fail (widget_path != NULL, FALSE);
73 g_return_val_if_fail (property_name != NULL, FALSE);
74 g_return_val_if_fail (value != NULL, FALSE);
76 iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
78 if (!iface->get_style_property)
81 return iface->get_style_property (provider, widget_path, property_name, value);
85 gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
88 GtkStyleProviderIface *iface;
90 g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
91 g_return_val_if_fail (path != NULL, NULL);
93 iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
95 if (!iface->get_icon_factory)
98 return iface->get_icon_factory (provider, path);