[gtk+] stylecontext: Deprecate gtk_style_context_get_font()



commit 9ae96491886716ba56ba87442dd9a93dcf21e027
Author: Benjamin Otte <otte redhat com>
Date:   Thu Dec 6 02:55:22 2012 +0100

    stylecontext: Deprecate gtk_style_context_get_font()
    
    This is for a very simple reason: The getter is returning a const value
    and the font isn't const anymore. So we need to store the font
    description somewhere but we can't reuse it as it's changing all the
    time (yay animations, yay inherited values). Sucks.
    
    So keep the hack in here but deprecate the function.

 gtk/gtkstylecontext.c  |    3 +++
 gtk/gtkstylecontext.h  |    2 ++
 gtk/gtkthemingengine.c |    4 ++++
 gtk/gtkthemingengine.h |    1 +
 4 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index fbd8e17..8c99d8f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3468,6 +3468,9 @@ gtk_style_context_get_margin (GtkStyleContext *context,
  *          freed.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_style_context_get() for "font" or
+ *     subproperties instead.
  **/
 const PangoFontDescription *
 gtk_style_context_get_font (GtkStyleContext *context,
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 8731cba..3d79c65 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -879,6 +879,8 @@ void gtk_style_context_get_background_color (GtkStyleContext *context,
 void gtk_style_context_get_border_color     (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
+
+GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get)
 const PangoFontDescription *
      gtk_style_context_get_font             (GtkStyleContext *context,
                                              GtkStateFlags    state);
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 409e34d..7930760 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -853,6 +853,8 @@ gtk_theming_engine_get_margin (GtkThemingEngine *engine,
  *          freed.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_theming_engine_get()
  **/
 const PangoFontDescription *
 gtk_theming_engine_get_font (GtkThemingEngine *engine,
@@ -862,8 +864,10 @@ gtk_theming_engine_get_font (GtkThemingEngine *engine,
 
   g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   priv = engine->priv;
   return gtk_style_context_get_font (priv->context, state);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 /* GtkThemingModule */
diff --git a/gtk/gtkthemingengine.h b/gtk/gtkthemingengine.h
index 0bdc3a1..13e1927 100644
--- a/gtk/gtkthemingengine.h
+++ b/gtk/gtkthemingengine.h
@@ -249,6 +249,7 @@ void gtk_theming_engine_get_margin  (GtkThemingEngine *engine,
                                      GtkStateFlags     state,
                                      GtkBorder        *margin);
 
+GDK_DEPRECATED_IN_3_8_FOR(gtk_theming_engine_get)
 const PangoFontDescription * gtk_theming_engine_get_font (GtkThemingEngine *engine,
                                                           GtkStateFlags     state);
 



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