]> Pileus Git - ~andy/gtk/commitdiff
stylecontext: Deprecate direction property
authorBenjamin Otte <otte@redhat.com>
Tue, 18 Dec 2012 17:05:28 +0000 (18:05 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 18 Dec 2012 17:25:42 +0000 (18:25 +0100)
...  and the functions implementing it. Also deprecate the direction
getter on GtkThemingEngine.

gtk/gtkiconfactory.c
gtk/gtkstylecontext.c
gtk/gtkstylecontext.h
gtk/gtkthemingengine.c
gtk/gtkthemingengine.h

index bf418eb49814aa255c3360c80fc55a4726911de6..a3bfea78b7974bcc869870022a368cd0848216e3 100644 (file)
@@ -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);
 
index 54e8bf8b09852ee616d729c0ce3a5533a3f682f8..9e6a913ccb7822e9098a2e7e9fddaa5cac43c553 100644 (file)
@@ -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)
index 3d79c651b80acd30fad54586c1acc44d3f4beeaa..99d0d7418d90c4775867df0b99cc5166be1a65ce 100644 (file)
@@ -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,
index 7930760fd9c5ff9cdb3658ee6713e41f519b4b78..8a0ae4700c65f1ebeef0c0247c051a1dcaf084a0 100644 (file)
@@ -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;
 
index 13e1927c7e3c3a59367dd28ffce119654634f8bb..78768386f55b627a2741916fcb03b253a2b9b016 100644 (file)
@@ -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);