[gtkmm] Deprecate Gtk::UIManager, Gtk::Action etc.



commit 8aec4abb76a3552b56161977259267eca1478b96
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Jul 13 08:46:39 2016 +0200

    Deprecate Gtk::UIManager, Gtk::Action etc.
    
    Deprecate Gtk::UIManager, Gtk::Action (almost), ActionGroup,
    Activatable (almost), RadioAction, RecentAction and ToggleAction.
    The corresponding gtk+ classes have been deprecated since gtk+ 3.10.
    Activatable can't be completely deprecated because it's a base class of some
    widgets. Gtk::Action can't be completely deprecated (at least not without
    complications) because it's used in virtual methods in Activatable.
    Bug #768573.

 gtk/gtkmm/radiobuttongroup.cc |    2 +
 gtk/gtkmm/radiobuttongroup.h  |   14 ++-
 gtk/src/action.ccg            |   17 +---
 gtk/src/action.hg             |  178 ++++++++++++++++++++++++-----------------
 gtk/src/actiongroup.hg        |    8 +-
 gtk/src/activatable.hg        |   21 +++---
 gtk/src/filelist.am           |   12 ++--
 gtk/src/radioaction.hg        |   11 ++-
 gtk/src/recentaction.hg       |   13 ++--
 gtk/src/toggleaction.hg       |   10 ++-
 gtk/src/uimanager.hg          |    8 ++-
 11 files changed, 168 insertions(+), 126 deletions(-)
---
diff --git a/gtk/gtkmm/radiobuttongroup.cc b/gtk/gtkmm/radiobuttongroup.cc
index de28d3c..e0d6a24 100644
--- a/gtk/gtkmm/radiobuttongroup.cc
+++ b/gtk/gtkmm/radiobuttongroup.cc
@@ -65,6 +65,7 @@ void RadioButtonGroup::add(RadioMenuItem& item)
   group_ = gtk_radio_menu_item_get_group(item.gobj());
 }
 
+#ifndef GTKMM_DISABLE_DEPRECATED
 void RadioButtonGroup::add(const Glib::RefPtr<RadioAction>& item)
 {
   item->set_group(*this);
@@ -72,6 +73,7 @@ void RadioButtonGroup::add(const Glib::RefPtr<RadioAction>& item)
   //probably not necessary:
   group_ = gtk_radio_action_get_group(item->gobj());
 }
+#endif // GTKMM_DISABLE_DEPRECATED
 
 void RadioButtonGroup::add(RadioToolButton& item)
 {
diff --git a/gtk/gtkmm/radiobuttongroup.h b/gtk/gtkmm/radiobuttongroup.h
index b896a70..0776ca1 100644
--- a/gtk/gtkmm/radiobuttongroup.h
+++ b/gtk/gtkmm/radiobuttongroup.h
@@ -1,7 +1,5 @@
 #ifndef _GTKMM_RADIOBUTTONGROUP_H
 #define _GTKMM_RADIOBUTTONGROUP_H
-/* $Id$ */
-
 /* radiobuttongroup.h
  *
  * Copyright(C) 2001-2002 The gtkmm Development Team
@@ -21,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <gtkmmconfig.h> // Can define GTKMM_DISABLE_DEPRECATED
+
 #include <glibmm/object.h> //For Glib::RefPtr<> and std::size_t
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -35,10 +35,10 @@ namespace Gtk
 
 class RadioButton;
 class RadioMenuItem;
-class RadioAction;
+class RadioAction; //deprecated
 class RadioToolButton;
 
-/** RadioButtonGroup identifier for RadioButtons
+/** RadioButtonGroup, identifier for RadioButtons.
  * To set up this RadioButtonGroup, construct a RadioButtonGroup and then pass it
  * to the constructor of all radio items.  You do not need
  * to keep the RadioButtonGroup beyond the initial construction.
@@ -57,7 +57,7 @@ protected:
 
   friend class Gtk::RadioButton;
   friend class Gtk::RadioMenuItem;
-  friend class Gtk::RadioAction;
+  friend class Gtk::RadioAction; //deprecated
   friend class Gtk::RadioToolButton;
 
 
@@ -66,7 +66,11 @@ protected:
   //      Would that anything useful other than being tidy? murrayc
   void add(RadioButton& item);
   void add(RadioMenuItem& item);
+#ifndef GTKMM_DISABLE_DEPRECATED
+  /** @deprecated Because Gtk::RadioAction is deprecated.
+   */
   void add(const Glib::RefPtr<RadioAction>& item);
+#endif // GTKMM_DISABLE_DEPRECATED
   void add(RadioToolButton& item);
 
   void* operator new(std::size_t); // not implemented
diff --git a/gtk/src/action.ccg b/gtk/src/action.ccg
index ddbf99c..7fbc3c2 100644
--- a/gtk/src/action.ccg
+++ b/gtk/src/action.ccg
@@ -35,40 +35,29 @@ Action::Action(const Glib::ustring& name, const Gtk::StockID& stock_id, const Gl
 :
   _CONSTRUCT("name", name.c_str(), "stock_id", stock_id.get_c_str(), "label", (label.empty() ? nullptr : 
label.c_str()),  "tooltip", (tooltip.empty() ? nullptr : tooltip.c_str()))
 {}
-_DEPRECATE_IFDEF_END
 
 Action::Action(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label, const 
Glib::ustring& tooltip)
 :
   _CONSTRUCT("name", name.c_str(), "icon_name", icon_name.c_str(), "label", (label.empty() ? nullptr : 
label.c_str()),  "tooltip", (tooltip.empty() ? nullptr : tooltip.c_str()))
 {}
+_DEPRECATE_IFDEF_END
 
+_DEPRECATE_IFDEF_START
 Glib::RefPtr<Action> Action::create(const Glib::ustring& name, const Glib::ustring& label, const 
Glib::ustring& tooltip)
 {
-_DEPRECATE_IFDEF_START
   return Glib::RefPtr<Action>( new Action(name, Gtk::StockID(), label, tooltip) );
-#else // GTKMM_DISABLE_DEPRECATED
-  // StockID is deprecated. Can't call the constructor that takes a StockID.
-  Glib::RefPtr<Action> action(new Action());
-  action->set_name(name);
-  if (!label.empty())
-    action->set_label(label);
-  if (!tooltip.empty())
-    action->set_tooltip(tooltip);
-  return action;
-_DEPRECATE_IFDEF_END
 }
 
-_DEPRECATE_IFDEF_START
 Glib::RefPtr<Action> Action::create(const Glib::ustring& name, const Gtk::StockID& stock_id, const 
Glib::ustring& label, const Glib::ustring& tooltip)
 {
   return Glib::RefPtr<Action>( new Action(name, stock_id, label, tooltip) );
 }
-_DEPRECATE_IFDEF_END
 
 Glib::RefPtr<Action> Action::create_with_icon_name(const Glib::ustring& name, const Glib::ustring& 
icon_name, const Glib::ustring& label, const Glib::ustring& tooltip)
 {
   return Glib::RefPtr<Action>( new Action(name, icon_name, label, tooltip) );
 }
+_DEPRECATE_IFDEF_END
 
 } // namespace Gtk
 
diff --git a/gtk/src/action.hg b/gtk/src/action.hg
index 1005245..e8f2a85 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -21,7 +21,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 
 #include <gtkmm/widget.h>
 #include <gtkmm/accelgroup.h>
-//Deprecated: #include <gtkmm/stockid.h>
 #include <giomm/icon.h>
 
 _DEFS(gtkmm,gtk)
@@ -32,20 +31,20 @@ _PINCLUDE(glibmm/private/object_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
+//TODO: Do this when we can stop using Gtk::Action in virtual functions in Gtk::Activatable, when we break 
ABI:
 //_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
-class ActionGroup;
+class ActionGroup; //deprecated
 class Menu;
 class MenuItem;
 class ToolItem;
 class Image;
 class StockID; //deprecated
 
-/** An action which can be triggered by a menu or toolbar item.
+/** A deprecated action which can be triggered by a menu or toolbar item.
  *
  * Actions represent operations that the user can perform, along with
  * some information about how it should be presented in the user interface.
@@ -73,7 +72,20 @@ class StockID; //deprecated
  * Other actions can be implemented as Gtk::Action subclasses.
  *
  * Each action can have one or more proxy menu item, toolbar button or other proxy widgets.
- * Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should 
change when the action's state changes. When the proxy is activated, it should activate its action.
+ * Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc),
+ * and should change when the action's state changes. When the proxy is activated,
+ * it should activate its action.
+ *
+ * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions
+ * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with
+ * Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).<br>
+ * Some gtkmm widgets don't derive from Gtk::Actionable, although the corresponding
+ * gtk+ widgets implement the GtkActionable interface. This discrepancy can't be
+ * fixed until we can break ABI. You can sometimes work around this problem
+ * by using a widget's %gobj() method and calling a gtk_actionable_*() method
+ * directly. Several examples in the
+ * <a href="https://developer.gnome.org/gtkmm-tutorial/stable/";>Programming with gtkmm 3</a>
+ * book use Gio::SimpleAction, such as the menus and toolbars examples.
  */
 class Action
   : public Glib::Object,
@@ -97,10 +109,9 @@ _DEPRECATE_IFDEF_START
    *                 action.
    * @param label    The label displayed in menu items and on buttons.
    * @param tooltip  A tooltip for the action.
-   * @deprecated Stock IDs are deprecated, so use another constructor.
+   * @deprecated There is no corresponding replacement when using Gio::Action.
    */
   explicit Action(const Glib::ustring& name, const StockID& stock_id = StockID(), const Glib::ustring& label 
= Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
-_DEPRECATE_IFDEF_END
 
   /** Creates an action with an icon name.
    * The action's icon will reflect the specified icon name in the user's
@@ -111,14 +122,18 @@ _DEPRECATE_IFDEF_END
    *                  action.
    * @param label     The label displayed in menu items and on buttons.
    * @param tooltip   A tooltip for the action.
+   * @deprecated See set_icon_name(), set_label() and set_tooltip() for
+   *             replacements when using Gio::Action.
    */
   explicit Action(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label = 
Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
+_DEPRECATE_IFDEF_END
 
 public:
   //Note that gtk_action_new() does not allow name to be NULL, which suggests that we should not have a 
default constructor,
   //but it's OK to set the name later:
   _WRAP_CREATE()
 
+_DEPRECATE_IFDEF_START
   /** Creates an action.
    *
    * @param name    A unique name for the action.
@@ -126,10 +141,10 @@ public:
    * @param tooltip A tooltip for the action.
    *
    * @return A new Action.
+   * @deprecated See set_label() and set_tooltip() for replacements when using Gio::Action.
    */
   static Glib::RefPtr<Action> create(const Glib::ustring& name, const Glib::ustring& label = 
Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
 
-_DEPRECATE_IFDEF_START
   /** Creates an action with a stock ID.
    * The stock ID is used to set a default icon, text and accelerator for the
    * action.
@@ -141,10 +156,9 @@ _DEPRECATE_IFDEF_START
    * @param tooltip  A tooltip for the action.
    *
    * @return A new Action.
-   * @deprecated Stock IDs are deprecated, so use another create() method.
+   * @deprecated There is no corresponding replacement when using Gio::Action.
    */
   static Glib::RefPtr<Action> create(const Glib::ustring& name, const Gtk::StockID& stock_id, const 
Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
-_DEPRECATE_IFDEF_END
 
   /** Create an action with an icon name.
    * The action's icon will reflect the specified icon name in the user's
@@ -157,92 +171,112 @@ _DEPRECATE_IFDEF_END
    * @param tooltip   A tooltip for the action.
    *
    * @return A new Action.
+   * @deprecated See set_icon_name(), set_label() and set_tooltip() for
+   *             replacements when using Gio::Action.
    */
   static Glib::RefPtr<Action> create_with_icon_name(const Glib::ustring& name, const Glib::ustring& 
icon_name, const Glib::ustring& label, const Glib::ustring& tooltip);
+_DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(Glib::ustring get_name() const, gtk_action_get_name)
+  _WRAP_METHOD(Glib::ustring get_name() const, gtk_action_get_name, deprecated "Use Gio::Action::get_name() 
on a Gio::Action instead.")
 
-  _WRAP_METHOD(bool is_sensitive() const, gtk_action_is_sensitive)
-  _WRAP_METHOD(bool get_sensitive() const, gtk_action_get_sensitive)
+  _WRAP_METHOD(bool is_sensitive() const, gtk_action_is_sensitive, deprecated "Use 
Gio::Action::get_enabled() on a Gio::Action instead.")
+  _WRAP_METHOD(bool get_sensitive() const, gtk_action_get_sensitive, deprecated "Use 
Gio::Action::get_enabled() on a Gio::Action instead.")
 
-  _WRAP_METHOD(void set_sensitive(bool sensitive = true), gtk_action_set_sensitive)
+  _WRAP_METHOD(void set_sensitive(bool sensitive = true), gtk_action_set_sensitive, deprecated "Use 
Gio::SimpleAction::set_enabled() on a Gio::SimpleAction instead.")
 
-  _WRAP_METHOD(bool is_visible() const, gtk_action_is_visible)
-  _WRAP_METHOD(bool get_visible() const, gtk_action_get_visible)
-  _WRAP_METHOD(void set_visible(bool visible = true), gtk_action_set_visible)
+  _WRAP_METHOD(bool is_visible() const, gtk_action_is_visible, deprecated "Use Gio::Action instead, and 
control and monitor the state of Gtk::Actionable widgets directly.")
+  _WRAP_METHOD(bool get_visible() const, gtk_action_get_visible, deprecated "Use Gio::Action instead, and 
control and monitor the state of Gtk::Actionable widgets directly.")
+  _WRAP_METHOD(void set_visible(bool visible = true), gtk_action_set_visible, deprecated "Use Gio::Action 
instead, and control and monitor the state of Gtk::Actionable widgets directly.")
 
-  _WRAP_METHOD(void activate(), gtk_action_activate)
-  _WRAP_METHOD(Image* create_icon(IconSize icon_size), gtk_action_create_icon)
-  _WRAP_METHOD(MenuItem* create_menu_item(), gtk_action_create_menu_item)
-  _WRAP_METHOD(ToolItem* create_tool_item(), gtk_action_create_tool_item)
-  _WRAP_METHOD(Menu* create_menu(), gtk_action_create_menu)
+  _WRAP_METHOD(void activate(), gtk_action_activate, deprecated "Use Gio::ActionGroup::activate_action() on 
a Gio::Action instead.")
+  _WRAP_METHOD(Image* create_icon(IconSize icon_size), gtk_action_create_icon,
+    deprecated "Use Gio::MenuItem::set_icon() to set an icon on a Gio::MenuItem, or Gtk::Container::add() to 
add a Gtk::Image to a Gtk::Button.")
+  _WRAP_METHOD(MenuItem* create_menu_item(), gtk_action_create_menu_item, deprecated "Use a Gio::MenuItem 
and associate it with a Gio::Action instead.")
+  _WRAP_METHOD(ToolItem* create_tool_item(), gtk_action_create_tool_item,
+    deprecated "Use a Gtk::ToolItem and associate it with a Gio::Action using 
Gtk::Actionable::set_action_name() instead. (Impossible until GtkToolItem implements the GActionable 
interface.)")
+  _WRAP_METHOD(Menu* create_menu(), gtk_action_create_menu, deprecated "Use Gio::Action and Gio::MenuModel 
instead, and create a Gtk::Menu with Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).")
 
 #m4 dnl // This isn't in convert_gtk.m4, and the default behaviour is wrong.
 #m4 _CONVERSION(`GSList*', `std::vector<Widget*>', `Glib::SListHandler<Widget*>::slist_to_vector($3, 
Glib::OWNERSHIP_NONE)')
 #m4 _CONVERSION(`GSList*', `std::vector<const Widget*>', `Glib::SListHandler<const 
Widget*>::slist_to_vector($3, Glib::OWNERSHIP_NONE)')
 
-  _WRAP_METHOD(std::vector<Widget*> get_proxies(), gtk_action_get_proxies)
-  _WRAP_METHOD(std::vector<const Widget*> get_proxies() const, gtk_action_get_proxies)
+  _WRAP_METHOD(std::vector<Widget*> get_proxies(), gtk_action_get_proxies, deprecated "There is no 
corresponding replacement when using Gio::Action.")
+  _WRAP_METHOD(std::vector<const Widget*> get_proxies() const, gtk_action_get_proxies, deprecated "There is 
no corresponding replacement when using Gio::Action.")
 
-  _WRAP_METHOD(void connect_accelerator(), gtk_action_connect_accelerator)
-  _WRAP_METHOD(void disconnect_accelerator(), gtk_action_disconnect_accelerator)
+  _WRAP_METHOD(void connect_accelerator(), gtk_action_connect_accelerator, deprecated "Use Gio::Action and 
the accelerator group on an associated Gtk::Menu instead.")
+  _WRAP_METHOD(void disconnect_accelerator(), gtk_action_disconnect_accelerator, deprecated "Use Gio::Action 
and the accelerator group on an associated Gtk::Menu instead.")
 
-  _WRAP_METHOD(Glib::ustring get_accel_path() const, gtk_action_get_accel_path)
+  _WRAP_METHOD(Glib::ustring get_accel_path() const, gtk_action_get_accel_path, deprecated "Use Gio::Action 
and the accelerator path on an associated Gtk::Menu instead.")
 
   /// For instance, void on_activate();
   typedef sigc::slot<void> SlotActivate;
 
-  _WRAP_SIGNAL(void activate(), "activate")
+  _WRAP_SIGNAL(void activate(), "activate", deprecated "Use Gio::SimpleAction::signal_activate() instead.")
 
   //Used by AccelGroup:
-  _WRAP_METHOD(void set_accel_path(const Glib::ustring& accel_path), gtk_action_set_accel_path)
-  _WRAP_METHOD(void set_accel_group(const Glib::RefPtr<AccelGroup>& accel_group), gtk_action_set_accel_group)
-
-  _WRAP_METHOD(void set_label(const Glib::ustring& label), gtk_action_set_label)
-  _WRAP_METHOD(Glib::ustring get_label() const, gtk_action_get_label)
-  _WRAP_METHOD(void set_short_label(const Glib::ustring& short_label), gtk_action_set_short_label)
-  _WRAP_METHOD(Glib::ustring get_short_label() const, gtk_action_get_short_label)
-  _WRAP_METHOD(void set_tooltip(const Glib::ustring& tooltip), gtk_action_set_tooltip)
-  _WRAP_METHOD(Glib::ustring get_tooltip() const, gtk_action_get_tooltip)
-  _WRAP_METHOD(void set_stock_id(const StockID& stock_id), gtk_action_set_stock_id, deprecated "Use 
set_icon_name() instead.")
-  _WRAP_METHOD(StockID get_stock_id() const, gtk_action_get_stock_id, deprecated "Use get_icon_name() 
instead.")
-  _WRAP_METHOD(void set_gicon(const Glib::RefPtr<Gio::Icon>& icon), gtk_action_set_gicon)
-  _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_gicon(), gtk_action_get_gicon, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_gicon() const, gtk_action_get_gicon, refreturn, 
constversion)
-  _WRAP_METHOD(void set_icon_name(const Glib::ustring& icon_name), gtk_action_set_icon_name)
-  _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_action_get_icon_name)
-  _WRAP_METHOD(void set_visible_horizontal(bool visible_horizontal = true), 
gtk_action_set_visible_horizontal)
-  _WRAP_METHOD(bool get_visible_horizontal() const, gtk_action_get_visible_horizontal)
-  _WRAP_METHOD(void set_visible_vertical(bool visible_vertical = true), gtk_action_set_visible_vertical)
-  _WRAP_METHOD(bool get_visible_vertical() const, gtk_action_get_visible_vertical)
-  _WRAP_METHOD(void set_is_important(bool is_important = true), gtk_action_set_is_important)
-  _WRAP_METHOD(bool get_is_important() const, gtk_action_get_is_important)
-
-  _WRAP_METHOD(void set_always_show_image(bool always_show = true), gtk_action_set_always_show_image)
-  _WRAP_METHOD(bool get_always_show_image() const, gtk_action_get_always_show_image)
-
-  _WRAP_METHOD(void block_activate(), gtk_action_block_activate)
-  _WRAP_METHOD(void unblock_activate(), gtk_action_unblock_activate)
+  _WRAP_METHOD(void set_accel_path(const Glib::ustring& accel_path), gtk_action_set_accel_path,
+    deprecated "Use Gio::Action and the accelerator path on an associated Gtk::Menu instead.")
+  _WRAP_METHOD(void set_accel_group(const Glib::RefPtr<AccelGroup>& accel_group), gtk_action_set_accel_group,
+    deprecated "Use Gio::Action and the accelerator group on an associated Gtk::Menu instead.")
+
+  _WRAP_METHOD(void set_label(const Glib::ustring& label), gtk_action_set_label,
+    deprecated "Use Gio::Action instead, and set a label on a menu item with Gio::MenuItem::set_label(). For 
Gtk::Actionable widgets, use the widget-specific API to set a label.")
+  _WRAP_METHOD(Glib::ustring get_label() const, gtk_action_get_label,
+    deprecated "Use Gio::Action instead, and get a label from a menu item with 
Gio::MenuItem::get_attribute_value(). For Gtk::Actionable widgets, use the widget-specific API to get a 
label.")
+  _WRAP_METHOD(void set_short_label(const Glib::ustring& short_label), gtk_action_set_short_label, 
deprecated "There is no corresponding replacement when using Gio::Action.")
+  _WRAP_METHOD(Glib::ustring get_short_label() const, gtk_action_get_short_label, deprecated "There is no 
corresponding replacement when using Gio::Action.")
+  _WRAP_METHOD(void set_tooltip(const Glib::ustring& tooltip), gtk_action_set_tooltip,
+    deprecated "Use Gio::Action instead, and set tooltips on associated Gtk::Actionable widgets with 
Gtk::Widget::set_tooltip_text().")
+  _WRAP_METHOD(Glib::ustring get_tooltip() const, gtk_action_get_tooltip,
+    deprecated "Use Gio::Action instead, and get tooltips from associated Gtk::Actionable widgets with 
Gtk::Widget::get_tooltip_text().")
+  _WRAP_METHOD(void set_stock_id(const StockID& stock_id), gtk_action_set_stock_id, deprecated "There is no 
corresponding replacement when using Gio::Action.")
+  _WRAP_METHOD(StockID get_stock_id() const, gtk_action_get_stock_id, deprecated "There is no corresponding 
replacement when using Gio::Action.")
+  _WRAP_METHOD(void set_gicon(const Glib::RefPtr<Gio::Icon>& icon), gtk_action_set_gicon,
+    deprecated "Use Gio::Action instead, and Gio::MenuItem::set_icon() to set an icon on a Gio::MenuItem 
associated with a Gio::Action, or Gtk::Container::add() to add a Gtk::Image to a Gtk::Button.")
+  _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_gicon(), gtk_action_get_gicon, refreturn,
+    deprecated "Use Gio::Action instead, and Gio::MenuItem::get_attribute_value() to get an icon from a 
Gio::MenuItem associated with a Gio::Action.")
+  _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_gicon() const, gtk_action_get_gicon, refreturn, 
constversion,
+    deprecated "Use Gio::Action instead, and Gio::MenuItem::get_attribute_value() to get an icon from a 
Gio::MenuItem associated with a Gio::Action.")
+  _WRAP_METHOD(void set_icon_name(const Glib::ustring& icon_name), gtk_action_set_icon_name,
+    deprecated "Use Gio::Action instead, and Gio::MenuItem::set_icon() to set an icon on a Gio::MenuItem 
associated with a Gio::Action, or Gtk::Container::add() to add a Gtk::Image to a Gtk::Button.")
+  _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_action_get_icon_name,
+    deprecated "Use Gio::Action instead, and Gio::MenuItem::get_attribute_value() to get an icon from a 
Gio::MenuItem associated with a Gio::Action.")
+  _WRAP_METHOD(void set_visible_horizontal(bool visible_horizontal = true), 
gtk_action_set_visible_horizontal,
+    deprecated "Use Gio::Action instead, and control and monitor the visibility of associated widgets and 
menu items directly.")
+  _WRAP_METHOD(bool get_visible_horizontal() const, gtk_action_get_visible_horizontal,
+    deprecated "Use Gio::Action instead, and control and monitor the visibility of associated widgets and 
menu items directly.")
+  _WRAP_METHOD(void set_visible_vertical(bool visible_vertical = true), gtk_action_set_visible_vertical,
+    deprecated "Use Gio::Action instead, and control and monitor the visibility of associated widgets and 
menu items directly.")
+  _WRAP_METHOD(bool get_visible_vertical() const, gtk_action_get_visible_vertical,
+    deprecated "Use Gio::Action instead, and control and monitor the visibility of associated widgets and 
menu items directly.")
+  _WRAP_METHOD(void set_is_important(bool is_important = true), gtk_action_set_is_important, deprecated "Use 
Gio::Action instead, and control and monitor whether labels are shown directly.")
+  _WRAP_METHOD(bool get_is_important() const, gtk_action_get_is_important, deprecated "Use Gio::Action 
instead, and control and monitor whether labels are shown directly.")
+
+  _WRAP_METHOD(void set_always_show_image(bool always_show = true), gtk_action_set_always_show_image, 
deprecated "Use Gio::MenuItem::set_icon() on a Gio::MenuItem instead, if the item should have an image.")
+  _WRAP_METHOD(bool get_always_show_image() const, gtk_action_get_always_show_image, deprecated "Use 
Gio::MenuItem::get_attribute_value() on a Gio::MenuItem instead.")
+
+  _WRAP_METHOD(void block_activate(), gtk_action_block_activate, deprecated "Use 
Gio::SimpleAction::set_enabled() to disable the Gio::SimpleAction instead.")
+  _WRAP_METHOD(void unblock_activate(), gtk_action_unblock_activate, deprecated "Use 
Gio::SimpleAction::set_enabled() to enable the Gio::SimpleAction instead.")
 
   //gtk_action_get_accel_closure() is too C-specific:
   _IGNORE(gtk_action_get_accel_closure)
 
-  _WRAP_PROPERTY("name", Glib::ustring)
-  _WRAP_PROPERTY("label", Glib::ustring)
-  _WRAP_PROPERTY("short_label", Glib::ustring)
-  _WRAP_PROPERTY("tooltip", Glib::ustring)
-  _WRAP_PROPERTY("stock_id", StockID, deprecated "Use property_icon_name() instead.")
-  _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
-  _WRAP_PROPERTY("icon_name", Glib::ustring)
-  _WRAP_PROPERTY("visible_horizontal", bool)
-  _WRAP_PROPERTY("visible_vertical", bool)
-  _WRAP_PROPERTY("visible_overflown", bool)
-  _WRAP_PROPERTY("is_important", bool)
-  _WRAP_PROPERTY("hide_if_empty", bool)
-  _WRAP_PROPERTY("sensitive", bool)
-  _WRAP_PROPERTY("visible", bool)
-  _WRAP_PROPERTY("action_group", Glib::RefPtr<ActionGroup>)
-  _WRAP_PROPERTY("always-show-image", bool)
+  _WRAP_PROPERTY("name", Glib::ustring, deprecated "Use Gio::Action::property_name() instead.")
+  _WRAP_PROPERTY("label", Glib::ustring, deprecated "Use the 'label' attribute on Gio::MenuItem instead.")
+  _WRAP_PROPERTY("short_label", Glib::ustring, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("tooltip", Glib::ustring, deprecated "Use Gtk::Widget::set_tooltip_text() and 
Gtk::Widget::get_tooltip_text() instead.")
+  _WRAP_PROPERTY("stock_id", StockID, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>, deprecated "Use the 'icon' attribute on Gio::MenuItem 
instead.")
+  _WRAP_PROPERTY("icon_name", Glib::ustring, deprecated "Use the 'icon' attribute on Gio::MenuItem instead.")
+  _WRAP_PROPERTY("visible_horizontal", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("visible_vertical", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("visible_overflown", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("is_important", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("hide_if_empty", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
+  _WRAP_PROPERTY("sensitive", bool, deprecated "Use Gio::Action::property_enabled() and 
Gio::SimpleAction::property_enabled() instead.")
+  _WRAP_PROPERTY("visible", bool, deprecated "There is no corresponding replacement when using Gio::Action.")
+  _WRAP_PROPERTY("action_group", Glib::RefPtr<ActionGroup>, deprecated "Lookup the Gio::Action using 
Gio::ActionMap::lookup_action() instead.")
+  _WRAP_PROPERTY("always-show-image", bool, deprecated "There is no corresponding replacement when using 
Gio::Action.")
 
 protected:
   //Widget-creation routines:
diff --git a/gtk/src/actiongroup.hg b/gtk/src/actiongroup.hg
index 6962e81..fe801a7 100644
--- a/gtk/src/actiongroup.hg
+++ b/gtk/src/actiongroup.hg
@@ -30,12 +30,13 @@ _PINCLUDE(glibmm/private/object_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
-//_IS_DEPRECATED // This whole file is deprecated.
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
+/** @deprecated Use Gio::ActionGroup and Gio::Action instead.
+ */
 class ActionGroup
   : public Glib::Object,
     public Buildable
@@ -86,7 +87,7 @@ public:
   _WRAP_METHOD(void remove(const Glib::RefPtr<Action>& action), gtk_action_group_remove_action)
 
    //TODO: We probably need to use this in our add_actions() implementation.
-   //But this whole class will be deprecated soon anyway.
+   //But this whole class is deprecated anyway.
   _WRAP_METHOD(Glib::ustring translate_string(const Glib::ustring& string) const, 
gtk_action_group_translate_string)
 
 
@@ -110,4 +111,3 @@ public:
 };
 
 } // namespace Gtk
-
diff --git a/gtk/src/activatable.hg b/gtk/src/activatable.hg
index 405c726..7f5f966 100644
--- a/gtk/src/activatable.hg
+++ b/gtk/src/activatable.hg
@@ -43,22 +43,24 @@ namespace Gtk
  * as it is responsible for activating the related action.
  *
  * @newin{2,16}
+ *
+ * @deprecated Use Gio::Action instead of Gtk::Action.
  */
 class Activatable : public Glib::Interface
 {
   _CLASS_INTERFACE(Activatable, GtkActivatable, GTK_ACTIVATABLE, GtkActivatableIface)
 
 public:
-  _WRAP_METHOD(void do_set_related_action(const Glib::RefPtr<Action>& action), 
gtk_activatable_do_set_related_action)
-  _WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_activatable_get_related_action, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_activatable_get_related_action, 
refreturn, constversion)
-  _WRAP_METHOD(bool get_use_action_appearance() const, gtk_activatable_get_use_action_appearance)
-  _WRAP_METHOD(void sync_action_properties(const Glib::RefPtr<Action>& action), 
gtk_activatable_sync_action_properties)
-  _WRAP_METHOD(void set_related_action(const Glib::RefPtr<Action>& action), 
gtk_activatable_set_related_action)
-  _WRAP_METHOD(void set_use_action_appearance(bool use_appearance = true), 
gtk_activatable_set_use_action_appearance)
+  _WRAP_METHOD(void do_set_related_action(const Glib::RefPtr<Action>& action), 
gtk_activatable_do_set_related_action, deprecated "Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_activatable_get_related_action, refreturn, 
deprecated "Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_activatable_get_related_action, 
refreturn, constversion, deprecated "Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(bool get_use_action_appearance() const, gtk_activatable_get_use_action_appearance, deprecated 
"Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(void sync_action_properties(const Glib::RefPtr<Action>& action), 
gtk_activatable_sync_action_properties, deprecated "Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(void set_related_action(const Glib::RefPtr<Action>& action), 
gtk_activatable_set_related_action, deprecated "Use Gio::Action instead of Gtk::Action.")
+  _WRAP_METHOD(void set_use_action_appearance(bool use_appearance = true), 
gtk_activatable_set_use_action_appearance, deprecated "Use Gio::Action instead of Gtk::Action.")
 
-  _WRAP_PROPERTY("related-action", Glib::RefPtr<Action>)
-  _WRAP_PROPERTY("use-action-appearance", bool)
+  _WRAP_PROPERTY("related-action", Glib::RefPtr<Action>, deprecated "Use Gio::Action instead of 
Gtk::Action.")
+  _WRAP_PROPERTY("use-action-appearance", bool, deprecated "Use Gio::Action instead of Gtk::Action.")
 
 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
 #m4 _CONVERSION(`GtkAction*',`const Glib::RefPtr<Action>&',`Glib::wrap($3, true)')
@@ -67,4 +69,3 @@ public:
 };
 
 } // namespace Gtk
-
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 901d833..a39924d 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -17,7 +17,6 @@ gtkmm_files_any_hg =          \
        action.hg               \
        actionable.hg           \
        actionbar.hg            \
-       actiongroup.hg          \
        activatable.hg          \
        adjustment.hg           \
        appchooser.hg           \
@@ -137,12 +136,10 @@ gtkmm_files_any_hg =              \
        printoperationpreview.hg\
        printsettings.hg        \
        progressbar.hg          \
-       radioaction.hg          \
        radiobutton.hg          \
        radiomenuitem.hg        \
        radiotoolbutton.hg      \
        range.hg                \
-       recentaction.hg         \
        recentchooser.hg        \
        recentchooserdialog.hg  \
        recentchoosermenu.hg    \
@@ -187,7 +184,6 @@ gtkmm_files_any_hg =                \
        texttag.hg              \
        texttagtable.hg         \
        textview.hg             \
-       toggleaction.hg         \
        togglebutton.hg         \
        toggletoolbutton.hg     \
        toolbar.hg              \
@@ -210,7 +206,6 @@ gtkmm_files_any_hg =                \
        treestore.hg            \
        treeview.hg             \
        treeviewcolumn.hg       \
-       uimanager.hg \
        viewport.hg             \
        volumebutton.hg         \
        widget.hg               \
@@ -229,6 +224,7 @@ gtkmm_files_x11_hg =            \
        socket.hg
 
 gtkmm_files_deprecated_hg =    \
+       actiongroup.hg          \
        alignment.hg            \
        arrow.hg                \
        colorselection.hg       \
@@ -244,10 +240,14 @@ gtkmm_files_deprecated_hg =       \
        iconsource.hg           \
        imagemenuitem.hg        \
        numerableicon.hg        \
+       radioaction.hg          \
+       recentaction.hg         \
        statusicon.hg           \
        stockitem.hg            \
        table.hg                \
-       tearoffmenuitem.hg
+       tearoffmenuitem.hg \
+       toggleaction.hg         \
+       uimanager.hg
 
 if HOST_WINDOWS_NATIVE
 gtkmm_files_arch_hg =
diff --git a/gtk/src/radioaction.hg b/gtk/src/radioaction.hg
index 80b6f77..539ae21 100644
--- a/gtk/src/radioaction.hg
+++ b/gtk/src/radioaction.hg
@@ -26,19 +26,23 @@ _PINCLUDE(gtkmm/private/toggleaction_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
-//_IS_DEPRECATED // This whole file is deprecated.
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
 class StockID; //Deprecated.
 
-/** An action of which only one in a group can be active.
+/** A deprecated action of which only one in a group can be active.
  *
  * A Gtk::RadioAction is similar to Gtk::RadioMenuItem. A number of
  * radio actions can be linked together so that only one may be active
  * at any one time.
+ *
+ * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions
+ * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with
+ * Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).
+ * See the Gtk::Action base class for more information about the deprecation.
  */
 class RadioAction : public Gtk::ToggleAction
 {
@@ -144,6 +148,7 @@ _DEPRECATE_IFDEF_END
 
   _WRAP_PROPERTY("value", int)
   //Probably wouldn't work: _WRAP_PROPERTY("group", Group)
+  _IGNORE_PROPERTY(group)
   _WRAP_PROPERTY("current-value", int)
 };
 
diff --git a/gtk/src/recentaction.hg b/gtk/src/recentaction.hg
index a0a3652..29c2bd1 100644
--- a/gtk/src/recentaction.hg
+++ b/gtk/src/recentaction.hg
@@ -18,7 +18,6 @@
 #include <gtkmm/action.h>
 #include <gtkmm/recentchooser.h>
 #include <gtkmm/recentmanager.h>
-//deprecated: #include <gtkmm/stockid.h>
 
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/action_p.h)
@@ -28,15 +27,14 @@ _PINCLUDE(gtkmm/private/action_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
-//_IS_DEPRECATED // This whole file is deprecated.
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
 class StockID; //Deprecated.
 
-/** An action of which represents a list of recently used files.
+/** A deprecated action of which represents a list of recently used files.
  *
  * A Gtk::RecentAction represents a list of recently used files,
  * which can be shown by widgets such as Gtk::RecentChooserDialog or
@@ -46,10 +44,13 @@ class StockID; //Deprecated.
  * toolbutton showing the recently used files in the popup menu, use a
  * Gtk::RecentAction as the action for a \<toolitem\> element.
  *
- * See also the methods in the RecentChooser base class.
- *
  * @newin{2,12}
  *
+ * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions
+ * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with
+ * Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).
+ * See the Gtk::Action base class for more information about the deprecation.
+ *
  * @ingroup RecentFiles
  */
 class RecentAction
diff --git a/gtk/src/toggleaction.hg b/gtk/src/toggleaction.hg
index 03d8e82..ca773e8 100644
--- a/gtk/src/toggleaction.hg
+++ b/gtk/src/toggleaction.hg
@@ -15,7 +15,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-//Deprecated: #include <gtkmm/stockid.h>
 #include <gtkmm/action.h>
 
 _DEFS(gtkmm,gtk)
@@ -26,17 +25,20 @@ _PINCLUDE(gtkmm/private/action_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
-//_IS_DEPRECATED // This whole file is deprecated.
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
-/** An action which can be toggled between two states.
+/** A deprecated action which can be toggled between two states.
  *
  * A Gtk::ToggleAction corresponds roughly to a Gtk::CheckMenuItem.
  * It has an "active" state specifying whether the action has been checked or not.
  *
+ * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions
+ * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with
+ * Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).
+ * See the Gtk::Action base class for more information about the deprecation.
  */
 class ToggleAction : public Gtk::Action
 {
diff --git a/gtk/src/uimanager.hg b/gtk/src/uimanager.hg
index 79dc29b..11c0764 100644
--- a/gtk/src/uimanager.hg
+++ b/gtk/src/uimanager.hg
@@ -30,8 +30,7 @@ _PINCLUDE(glibmm/private/object_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
-//TODO: Deprecate this when we are ready. It is already deprecated in GTK+.
-//_IS_DEPRECATED // This whole file is deprecated.
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
@@ -179,6 +178,11 @@ _WRAP_ENUM(UIManagerItemType, GtkUIManagerItemType)
  * The behaviour is chosen based on the "hide_if_empty" property of the action to which the submenu is 
associated.
  *
  * @newin{2,4}
+ *
+ * @deprecated Use Gtk::Builder instead.<br>
+ * The menus and toolbars examples in the
+ * <a href="https://developer.gnome.org/gtkmm-tutorial/stable/";>Programming with gtkmm 3</a>
+ * book show how to construct menus and toolbars with Gtk::Builder.
  */
 class UIManager : public Glib::Object
 {


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