summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-12-18 18:05:28 +0100
committerBenjamin Otte <otte@redhat.com>2012-12-18 18:25:42 +0100
commit52768ee6ec9729f3ab0c201cab2f06942421e290 (patch)
tree912a5b0330af157e4e7977c411d7a03e4ee0897e
parenta73cc55e022c69fb2c7f6b059b0a9c12c3f057e1 (diff)
downloadgtk+-52768ee6ec9729f3ab0c201cab2f06942421e290.tar.gz
stylecontext: Deprecate direction property
... and the functions implementing it. Also deprecate the direction getter on GtkThemingEngine.
-rw-r--r--gtk/gtkiconfactory.c4
-rw-r--r--gtk/gtkstylecontext.c12
-rw-r--r--gtk/gtkstylecontext.h2
-rw-r--r--gtk/gtkthemingengine.c8
-rw-r--r--gtk/gtkthemingengine.h1
5 files changed, 26 insertions, 1 deletions
diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c
index bf418eb498..a3bfea78b7 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 54e8bf8b09..9e6a913ccb 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 3d79c651b8..99d0d7418d 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 7930760fd9..8a0ae4700c 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 13e1927c7e..78768386f5 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);