Commit 6990a012 authored by Carlos Garnacho's avatar Carlos Garnacho

GtkStyleProvider: Add method to get widget style properties.

parent eaddc9f2
......@@ -44,7 +44,6 @@ gtk_style_provider_get_type (void)
static void
gtk_style_provider_iface_init (gpointer g_iface)
{
GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
}
GtkStyleSet *
......@@ -63,5 +62,27 @@ gtk_style_provider_get_style (GtkStyleProvider *provider,
return iface->get_style (provider, path);
}
gboolean
gtk_style_provider_get_style_property (GtkStyleProvider *provider,
GtkWidgetPath *widget_path,
const gchar *property_name,
GValue *value)
{
GtkStyleProviderIface *iface;
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), FALSE);
g_return_val_if_fail (widget_path != NULL, FALSE);
g_return_val_if_fail (property_name != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
if (!iface->get_style_property)
return FALSE;
return iface->get_style_property (provider, widget_path, property_name, value);
}
#define __GTK_STYLE_PROVIDER_C__
#include "gtkaliasdef.c"
......@@ -40,19 +40,17 @@ G_BEGIN_DECLS
typedef struct GtkStyleProviderIface GtkStyleProviderIface;
typedef struct GtkStyleProvider GtkStyleProvider; /* dummy typedef */
typedef enum {
GTK_SELECTOR_TYPE_PATH,
GTK_SELECTOR_TYPE_NAME,
GTK_SELECTOR_TYPE_CLASS_PATH,
GTK_SELECTOR_TYPE_CLASS_NAME
} GtkSelectorType;
struct GtkStyleProviderIface
{
GTypeInterface g_iface;
GtkStyleSet * (* get_style) (GtkStyleProvider *provider,
GtkWidgetPath *path);
gboolean (* get_style_property) (GtkStyleProvider *provider,
GtkWidgetPath *path,
const gchar *property_name,
GValue *value);
};
GType gtk_style_provider_get_type (void) G_GNUC_CONST;
......@@ -60,6 +58,10 @@ GType gtk_style_provider_get_type (void) G_GNUC_CONST;
GtkStyleSet *gtk_style_provider_get_style (GtkStyleProvider *provider,
GtkWidgetPath *path);
gboolean gtk_style_provider_get_style_property (GtkStyleProvider *provider,
GtkWidgetPath *path,
const gchar *property_name,
GValue *value);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment