Commit 52768ee6 authored by Benjamin Otte's avatar Benjamin Otte

stylecontext: Deprecate direction property

...  and the functions implementing it. Also deprecate the direction
getter on GtkThemingEngine.
parent a73cc55e
......@@ -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);
......
......@@ -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)
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment