[gtkmm] Deprecate Gtk::ActionGroup, *Action, Activatable (sort of), UIManager.



commit d1cfb5b5d805b2033334c8fb8845522e79333814
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Jul 2 19:41:50 2013 +0200

    Deprecate Gtk::ActionGroup, *Action, Activatable (sort of), UIManager.
    
    * gtk/gtkmm/radiobuttongroup.[h|cc]: Deprecate the add() that takes a RadioAction.
    * gtk/src/action.hg: Deprecate Action.
    * gtk/src/actiongroup.hg: Deprecate ActionGroup.
    * gtk/src/activatable.hg: Add a comment that interface Activatable is
    deprecated. Can't do more than that without breaking ABI. It's a base class
    of several classes.
    * gtk/src/radioaction.hg: Deprecate RadioAction.
    * gtk/src/recentaction.hg: Deprecate RecentAction.
    * gtk/src/toggleaction.hg: Deprecate ToggleAction.
    * gtk/src/uimanager.hg: Deprecate UIManager.
    
    This together with the previous 4 commits should fix the build with
    --enable-warnings=fatal until more API is deprecated in gtk+.
    These commits don't fix 'make check'. The demos use deprecated API.

 ChangeLog                     |   19 +++++++++++++++++++
 gtk/gtkmm/radiobuttongroup.cc |    5 +++++
 gtk/gtkmm/radiobuttongroup.h  |    4 ++++
 gtk/src/action.hg             |    9 +++++++++
 gtk/src/actiongroup.hg        |    8 ++++++++
 gtk/src/activatable.hg        |    9 +++++++++
 gtk/src/radioaction.hg        |    8 ++++++++
 gtk/src/recentaction.hg       |    7 +++++++
 gtk/src/toggleaction.hg       |    7 +++++++
 gtk/src/uimanager.hg          |    5 ++++-
 10 files changed, 80 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1e68bc7..9fd986f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2013-07-02  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
+       Deprecate Gtk::ActionGroup, *Action, Activatable (sort of), UIManager.
+
+       * gtk/gtkmm/radiobuttongroup.[h|cc]: Deprecate the add() that takes a RadioAction.
+       * gtk/src/action.hg: Deprecate Action.
+       * gtk/src/actiongroup.hg: Deprecate ActionGroup.
+       * gtk/src/activatable.hg: Add a comment that interface Activatable is
+       deprecated. Can't do more than that without breaking ABI. It's a base class
+       of several classes.
+       * gtk/src/radioaction.hg: Deprecate RadioAction.
+       * gtk/src/recentaction.hg: Deprecate RecentAction.
+       * gtk/src/toggleaction.hg: Deprecate ToggleAction.
+       * gtk/src/uimanager.hg: Deprecate UIManager.
+
+       This together with the previous 4 commits should fix the build with
+       --enable-warnings=fatal until more API is deprecated in gtk+.
+       These commits don't fix 'make check'. The demos use deprecated API.
+
+2013-07-02  Kjell Ahlstedt  <kjell ahlstedt bredband net>
+
        Deprecate Gtk::ImageMenuItem.
 
        * gtk/src/imagemenuitem.hg: Deprecate ImageMenuItem.
diff --git a/gtk/gtkmm/radiobuttongroup.cc b/gtk/gtkmm/radiobuttongroup.cc
index ec8f72c..2cde83a 100644
--- a/gtk/gtkmm/radiobuttongroup.cc
+++ b/gtk/gtkmm/radiobuttongroup.cc
@@ -17,6 +17,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+
 #include <gtkmm/radiobuttongroup.h>
 
 #include <gtkmm/radiobutton.h>
@@ -64,6 +67,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);
@@ -71,6 +75,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 2c0ed1a..b303268 100644
--- a/gtk/gtkmm/radiobuttongroup.h
+++ b/gtk/gtkmm/radiobuttongroup.h
@@ -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 Use a class that implements interface Gio::Action, such as Gio::SimpleAction, instead of 
Gtk::RadioAction.
+   */
   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.hg b/gtk/src/action.hg
index 78b5432..7e6d674 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -27,6 +27,13 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
+
 namespace Gtk
 {
 
@@ -65,6 +72,8 @@ class Image;
  *
  * 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.
+ *
+ * @deprecated Use a class that implements interface Gio::Action, such as Gio::SimpleAction.
  */
 class Action
   : public Glib::Object,
diff --git a/gtk/src/actiongroup.hg b/gtk/src/actiongroup.hg
index 1aa191e..5cb8c0c 100644
--- a/gtk/src/actiongroup.hg
+++ b/gtk/src/actiongroup.hg
@@ -25,10 +25,18 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
 
+/** @deprecated Use a class that implements interface Gio::ActionGroup, such as Gio::SimpleActionGroup.
+ */
 class ActionGroup
   : public Glib::Object,
     public Buildable
diff --git a/gtk/src/activatable.hg b/gtk/src/activatable.hg
index 9bd2590..62bafd6 100644
--- a/gtk/src/activatable.hg
+++ b/gtk/src/activatable.hg
@@ -20,6 +20,14 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/interface_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+//TODO: Do this when we can stop using this as a base class elsewhere, when we break ABI:
+//_IS_DEPRECATED // This whole file is deprecated.
+
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 extern "C"
 {
@@ -35,6 +43,7 @@ namespace Gtk
  * as it is responsible for activating the related action.
  *
  * @newin{2,16}
+ * @deprecated Use a class that implements interface Gio::Action, such as Gio::SimpleAction, instead of 
Gtk::Action.
  */
 class Activatable : public Glib::Interface
 {
diff --git a/gtk/src/radioaction.hg b/gtk/src/radioaction.hg
index 082d3d3..fa517cc 100644
--- a/gtk/src/radioaction.hg
+++ b/gtk/src/radioaction.hg
@@ -21,6 +21,12 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/toggleaction_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
@@ -30,6 +36,8 @@ namespace Gtk
  * 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 a class that implements interface Gio::Action, such as Gio::SimpleAction.
  */
 class RadioAction : public Gtk::ToggleAction
 {
diff --git a/gtk/src/recentaction.hg b/gtk/src/recentaction.hg
index 6430873..8dd094d 100644
--- a/gtk/src/recentaction.hg
+++ b/gtk/src/recentaction.hg
@@ -23,6 +23,12 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/action_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
@@ -40,6 +46,7 @@ namespace Gtk
  * See also the methods in the RecentChooser base class.
  *
  * @newin{2,12}
+ * @deprecated Use a class that implements interface Gio::Action, such as Gio::SimpleAction.
  *
  * @ingroup RecentFiles
  */
diff --git a/gtk/src/toggleaction.hg b/gtk/src/toggleaction.hg
index 1015f4c..af57880 100644
--- a/gtk/src/toggleaction.hg
+++ b/gtk/src/toggleaction.hg
@@ -20,6 +20,12 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/action_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
 
 namespace Gtk
 {
@@ -29,6 +35,7 @@ namespace Gtk
  * 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 a class that implements interface Gio::Action, such as Gio::SimpleAction.
  */
 class ToggleAction : public Gtk::Action
 {
diff --git a/gtk/src/uimanager.hg b/gtk/src/uimanager.hg
index 10ba321..c787d99 100644
--- a/gtk/src/uimanager.hg
+++ b/gtk/src/uimanager.hg
@@ -30,6 +30,8 @@ _PINCLUDE(glibmm/private/object_p.h)
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
+_IS_DEPRECATED // This whole file is deprecated.
+
 namespace Gtk
 {
 
@@ -176,6 +178,7 @@ _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}
+ * @depreacted Use Gtk::Builder instead.
  */
 class UIManager : public Glib::Object
 {
@@ -261,7 +264,7 @@ public:
   _WRAP_SIGNAL(void pre_activate(const Glib::RefPtr<Action>& action), pre_activate)
   _WRAP_SIGNAL(void post_activate(const Glib::RefPtr<Action>& action), post_activate)
 
-  _WRAP_PROPERTY("add_tearoffs", bool)
+  _WRAP_PROPERTY("add_tearoffs", bool, deprecated "Tearoff menus are deprecated and should not be used in 
newly written code.")
   _WRAP_PROPERTY("ui", Glib::ustring)
 
 };


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