GtkStyleContext: Add methods to query composed style.

This commit is contained in:
Carlos Garnacho 2010-03-07 01:22:38 +01:00
parent 2da033b18c
commit 1a3d964615
2 changed files with 60 additions and 0 deletions

View File

@ -221,5 +221,54 @@ gtk_style_context_remove_provider (GtkStyleContext *context,
rebuild_properties (context); rebuild_properties (context);
} }
void
gtk_style_context_get_property (GtkStyleContext *context,
const gchar *property,
GtkStateType state,
GValue *value)
{
GtkStyleContextPrivate *priv;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (property != NULL);
g_return_if_fail (state < GTK_STATE_LAST);
g_return_if_fail (value != NULL);
priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context);
gtk_style_set_get_property (priv->store, property, state, value);
}
void
gtk_style_context_get_valist (GtkStyleContext *context,
GtkStateType state,
va_list args)
{
GtkStyleContextPrivate *priv;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (state < GTK_STATE_LAST);
priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context);
gtk_style_set_get_valist (priv->store, state, args);
}
void
gtk_style_context_get (GtkStyleContext *context,
GtkStateType state,
...)
{
GtkStyleContextPrivate *priv;
va_list args;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (state < GTK_STATE_LAST);
priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context);
va_start (args, state);
gtk_style_context_get_valist (priv->store, state, args);
va_end (args);
}
#define __GTK_STYLE_CONTEXT_C__ #define __GTK_STYLE_CONTEXT_C__
#include "gtkaliasdef.c" #include "gtkaliasdef.c"

View File

@ -54,6 +54,17 @@ void gtk_style_context_add_provider (GtkStyleContext *context,
void gtk_style_context_remove_provider (GtkStyleContext *context, void gtk_style_context_remove_provider (GtkStyleContext *context,
GtkStyleProvider *provider); GtkStyleProvider *provider);
void gtk_style_context_get_property (GtkStyleContext *context,
const gchar *property,
GtkStateType state,
GValue *value);
void gtk_style_context_get_valist (GtkStyleContext *context,
GtkStateType state,
va_list args);
void gtk_style_context_get (GtkStyleContext *context,
GtkStateType state,
...) G_GNUC_NULL_TERMINATED;
G_END_DECLS G_END_DECLS
#endif /* __GTK_STYLE_CONTEXT_H__ */ #endif /* __GTK_STYLE_CONTEXT_H__ */