From 52768ee6ec9729f3ab0c201cab2f06942421e290 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 18 Dec 2012 18:05:28 +0100 Subject: [PATCH] stylecontext: Deprecate direction property ... and the functions implementing it. Also deprecate the direction getter on GtkThemingEngine. --- gtk/gtkiconfactory.c | 4 ++++ gtk/gtkstylecontext.c | 12 ++++++++++++ gtk/gtkstylecontext.h | 2 ++ gtk/gtkthemingengine.c | 8 +++++++- gtk/gtkthemingengine.h | 1 + 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index bf418eb49..a3bfea78b 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1731,7 +1731,9 @@ gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set, else state = GTK_STATE_NORMAL; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS; direction = gtk_style_context_get_direction (context); +G_GNUC_END_IGNORE_DEPRECATIONS; if (icon_set->sources) { @@ -1826,7 +1828,9 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set, } gtk_style_context_set_state (context, flags); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_style_context_set_direction (context, direction); +G_GNUC_END_IGNORE_DEPRECATIONS; icon = gtk_icon_set_render_icon_pixbuf (icon_set, context, size); diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 54e8bf8b0..9e6a913cc 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -881,8 +881,10 @@ gtk_style_context_impl_set_property (GObject *object, g_value_get_object (value)); break; case PROP_DIRECTION: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_style_context_set_direction (style_context, g_value_get_enum (value)); + G_GNUC_END_IGNORE_DEPRECATIONS; break; case PROP_PARENT: gtk_style_context_set_parent (style_context, @@ -912,7 +914,9 @@ gtk_style_context_impl_get_property (GObject *object, g_value_set_object (value, priv->screen); break; case PROP_DIRECTION: + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; g_value_set_enum (value, gtk_style_context_get_direction (style_context)); + G_GNUC_END_IGNORE_DEPRECATIONS; break; case PROP_PARENT: g_value_set_object (value, priv->parent); @@ -2622,6 +2626,10 @@ gtk_style_context_get_screen (GtkStyleContext *context) * call this yourself. * * Since: 3.0 + * + * Deprecated: 3.8: Use gtk_style_context_set_state() with + * #GTK_STATE_FLAG_DIR_LTR and #GTK_STATE_FLAG_DIR_RTL + * instead. **/ void gtk_style_context_set_direction (GtkStyleContext *context, @@ -2661,6 +2669,10 @@ gtk_style_context_set_direction (GtkStyleContext *context, * Returns: the widget direction * * Since: 3.0 + * + * Deprecated: 3.8: Use gtk_style_context_get_state() and + * check for #GTK_STATE_FLAG_DIR_LTR and + * #GTK_STATE_FLAG_DIR_RTL instead. **/ GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context) diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h index 3d79c651b..99d0d7418 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -836,8 +836,10 @@ void gtk_style_context_set_screen (GtkStyleContext *context, GdkScreen *screen); GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context); +GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_set_state) void gtk_style_context_set_direction (GtkStyleContext *context, GtkTextDirection direction); +GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get_state) GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context); void gtk_style_context_set_junction_sides (GtkStyleContext *context, diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 7930760fd..8a0ae4700 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -670,6 +670,10 @@ gtk_theming_engine_has_region (GtkThemingEngine *engine, * Returns: the widget direction * * Since: 3.0 + * + * Deprecated: 3.8: Use gtk_theming_engine_get_state() and + * check for #GTK_STATE_FLAG_DIR_LTR and + * #GTK_STATE_FLAG_DIR_RTL instead. **/ GtkTextDirection gtk_theming_engine_get_direction (GtkThemingEngine *engine) @@ -679,7 +683,9 @@ gtk_theming_engine_get_direction (GtkThemingEngine *engine) g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), GTK_TEXT_DIR_LTR); priv = engine->priv; + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; return gtk_style_context_get_direction (priv->context); + G_GNUC_END_IGNORE_DEPRECATIONS; } /** @@ -1808,7 +1814,7 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine, gtk_theming_engine_get_color (engine, flags, &fg_color); gtk_theming_engine_get_border_color (engine, flags, &outline_color); - is_rtl = (gtk_theming_engine_get_direction (engine) == GTK_TEXT_DIR_RTL); + is_rtl = (gtk_theming_engine_get_state (engine) & GTK_STATE_FLAG_DIR_RTL); line_width = 1; progress = (flags & GTK_STATE_FLAG_ACTIVE) ? 1 : 0; diff --git a/gtk/gtkthemingengine.h b/gtk/gtkthemingengine.h index 13e1927c7..78768386f 100644 --- a/gtk/gtkthemingengine.h +++ b/gtk/gtkthemingengine.h @@ -224,6 +224,7 @@ gboolean gtk_theming_engine_state_is_running (GtkThemingEngine *engine, GtkStateType state, gdouble *progress); +GDK_DEPRECATED_IN_3_8_FOR(gtk_theming_engine_get_state) GtkTextDirection gtk_theming_engine_get_direction (GtkThemingEngine *engine); GtkJunctionSides gtk_theming_engine_get_junction_sides (GtkThemingEngine *engine); -- 2.43.2