[gtk+/gtk-style-context: 11/347] GtkStyleContext: Add methods to query composed style.



commit c2127ce30f176b6e6213b8dcaf56b72c77176cf6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Mar 7 01:22:38 2010 +0100

    GtkStyleContext: Add methods to query composed style.

 gtk/gtkstylecontext.c |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 gtk/gtkstylecontext.h |   11 +++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 0a84cda..b5c1f07 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -221,5 +221,54 @@ gtk_style_context_remove_provider (GtkStyleContext  *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__
 #include "gtkaliasdef.c"
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 1ded64e..37d4f15 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -54,6 +54,17 @@ void gtk_style_context_add_provider    (GtkStyleContext  *context,
 void gtk_style_context_remove_provider (GtkStyleContext  *context,
                                         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
 
 #endif /* __GTK_STYLE_CONTEXT_H__ */



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