[gtk+] Add getter for font description in GtkThemingEngine



commit afca06b362dcd12f08d5170cfe394a5eec0ecc04
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 13 21:36:49 2010 +0100

    Add getter for font description in GtkThemingEngine
    
    This function is analogous to gtk_style_context_get_font().

 gtk/gtkthemingengine.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index e3cde59..7914029 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -874,6 +874,29 @@ gtk_theming_engine_get_margin (GtkThemingEngine *engine,
   gtk_style_context_get_margin (priv->context, state, margin);
 }
 
+/**
+ * gtk_theming_engine_get_font:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve the font for
+ *
+ * Returns the font description for a given state.
+ *
+ * Returns: the #PangoFontDescription for the given state. This
+ *          object is owned by GTK+ and should not be freed.
+ *
+ * Since: 3.0
+ **/
+const PangoFontDescription *
+gtk_theming_engine_get_font (GtkThemingEngine *engine,
+                             GtkStateFlags     state)
+{
+  GtkThemingEnginePrivate *priv;
+
+  g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
+
+  priv = engine->priv;
+  return gtk_style_context_get_font (priv->context, state);
+}
 
 /* GtkThemingModule */
 



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