[gtk+/gtk-style-context: 28/347] GtkThemingEngine: Add accessors to style classes.



commit 6ed642665eecbab9439fd4317c28643090abc7a9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Mar 20 14:13:50 2010 +0100

    GtkThemingEngine: Add accessors to style classes.

 gtk/gtkthemingengine.c |   28 ++++++++++++++++++++++++++++
 gtk/gtkthemingengine.h |    6 ++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index d0939db..a705f9f 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -171,6 +171,34 @@ gtk_theming_engine_get_path (GtkThemingEngine *engine)
   return gtk_style_context_get_path (priv->context);
 }
 
+gboolean
+gtk_theming_engine_has_class (GtkThemingEngine *engine,
+                              const gchar      *style_class)
+{
+  GtkThemingEnginePrivate *priv;
+
+  g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+
+  priv = engine->priv;
+  return gtk_style_context_has_class (priv->context, style_class);
+}
+
+gboolean
+gtk_theming_engine_has_child_class (GtkThemingEngine   *engine,
+                                    const gchar        *style_class,
+                                    GtkChildClassFlags *flags)
+{
+  GtkThemingEnginePrivate *priv;
+
+  if (flags)
+    *flags = 0;
+
+  g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+
+  priv = engine->priv;
+  return gtk_style_context_has_child_class (priv->context, style_class, flags);
+}
+
 /* GtkThemingModule */
 
 static gboolean
diff --git a/gtk/gtkthemingengine.h b/gtk/gtkthemingengine.h
index 54547e8..b17c6e1 100644
--- a/gtk/gtkthemingengine.h
+++ b/gtk/gtkthemingengine.h
@@ -68,6 +68,12 @@ void gtk_theming_engine_get          (GtkThemingEngine *engine,
 
 G_CONST_RETURN GtkWidgetPath * gtk_theming_engine_get_path (GtkThemingEngine *engine);
 
+gboolean gtk_theming_engine_has_class        (GtkThemingEngine *engine,
+                                              const gchar      *style_class);
+gboolean gtk_theming_engine_has_child_class (GtkThemingEngine   *engine,
+                                             const gchar        *style_class,
+                                             GtkChildClassFlags *flags);
+
 GtkStateFlags gtk_theming_engine_get_state     (GtkThemingEngine *engine);
 gboolean      gtk__theming_engine_is_state_set (GtkThemingEngine *engine,
                                                 GtkStateType      state);



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