[gtk+/quartz-integration: 101/108] menuitem: Deprecate gtk_menu_item_set_right_justified()



commit e180a6908eb7fc4925cf4e8777b96e950268378e
Author: Benjamin Otte <otte redhat com>
Date:   Mon May 2 16:49:03 2011 +0200

    menuitem: Deprecate gtk_menu_item_set_right_justified()
    
    And the getter, too: gtk_menu_item_get_right_justified() and the
    corresponding property. Also make the only caller use the private
    structure (as it did before the recent patches).

 gtk/gtkmenubar.c  |    4 ++--
 gtk/gtkmenuitem.c |   13 ++++++++++++-
 gtk/gtkmenuitem.h |    2 ++
 3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 8d97c81..7c07aa6 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -564,7 +564,7 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
               remaining_space.width -= request->minimum_size;
 
 	      if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
-                  gtk_menu_item_get_right_justified (request->data))
+                  GTK_MENU_ITEM (request->data)->priv->right_justify)
                 ltr = !ltr;
 
               if (ltr)
@@ -618,7 +618,7 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
               remaining_space.height -= request->minimum_size;
 
 	      if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
-                  gtk_menu_item_get_right_justified (request->data))
+                  GTK_MENU_ITEM (request->data)->priv->right_justify)
                 ttb = !ttb;
 
               if (ttb)
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index db2b581..ab4b973 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -189,6 +189,12 @@ static void gtk_menu_item_set_related_action         (GtkMenuItem          *menu
 static void gtk_menu_item_set_use_action_appearance  (GtkMenuItem          *menu_item, 
                                                       gboolean              use_appearance);
 
+/* Declare deprecated function that need a declaration */
+#ifdef GTK_DISABLE_DEPRECATED
+void       gtk_menu_item_set_right_justified         (GtkMenuItem          *menu_item,
+                                                      gboolean              right_justified);
+gboolean   gtk_menu_item_get_right_justified         (GtkMenuItem          *menu_item);
+#endif  /* GTK_DISABLE_DEPRECATED */
 
 static guint menu_item_signals[LAST_SIGNAL] = { 0 };
 
@@ -327,7 +333,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
                                                          P_("Right Justified"),
                                                          P_("Sets whether the menu item appears justified at the right side of a menu bar"),
                                                          FALSE,
-                                                         GTK_PARAM_READWRITE));
+                                                         GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
 
   /**
    * GtkMenuItem:submenu:
@@ -2289,6 +2295,9 @@ gtk_menu_item_position_menu (GtkMenu  *menu,
  * menu items, but is now considered a bad idea. (If the widget
  * layout is reversed for a right-to-left language like Hebrew
  * or Arabic, right-justified-menu-items appear at the left.)
+ *
+ * Deprecated: 3.2: If you insist on using it, use
+ *   gtk_widget_set_hexpand() and gtk_widget_set_halign().
  **/
 void
 gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
@@ -2316,6 +2325,8 @@ gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
  *
  * Return value: %TRUE if the menu item will appear at the
  *   far right if added to a menu bar.
+ *
+ * Deprecated: 3.2: See gtk_menu_item_set_right_justified()
  **/
 gboolean
 gtk_menu_item_get_right_justified (GtkMenuItem *menu_item)
diff --git a/gtk/gtkmenuitem.h b/gtk/gtkmenuitem.h
index 6c8dee4..26d86b7 100644
--- a/gtk/gtkmenuitem.h
+++ b/gtk/gtkmenuitem.h
@@ -104,9 +104,11 @@ void       gtk_menu_item_toggle_size_request  (GtkMenuItem         *menu_item,
                                                gint                *requisition);
 void       gtk_menu_item_toggle_size_allocate (GtkMenuItem         *menu_item,
                                                gint                 allocation);
+#ifndef GTK_DISABLE_DEPRECATED
 void       gtk_menu_item_set_right_justified  (GtkMenuItem         *menu_item,
                                                gboolean             right_justified);
 gboolean   gtk_menu_item_get_right_justified  (GtkMenuItem         *menu_item);
+#endif  /* GTK_DISABLE_DEPRECATED */
 void       gtk_menu_item_set_accel_path       (GtkMenuItem         *menu_item,
                                                const gchar         *accel_path);
 G_CONST_RETURN gchar* gtk_menu_item_get_accel_path (GtkMenuItem    *menu_item);



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