From afca06b362dcd12f08d5170cfe394a5eec0ecc04 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 13 Dec 2010 21:36:49 +0100 Subject: [PATCH] Add getter for font description in GtkThemingEngine This function is analogous to gtk_style_context_get_font(). --- gtk/gtkthemingengine.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index e3cde59e24..7914029602 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 */