[gtkmm] ToggleAction, RadioAction: Allow use of deprecated StockID in deprecated API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] ToggleAction, RadioAction: Allow use of deprecated StockID in deprecated API.
- Date: Wed, 9 Oct 2013 10:02:38 +0000 (UTC)
commit c54a3c7b1bca9dcbb314386313f180f4a2ddee49
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Oct 9 11:51:43 2013 +0200
ToggleAction, RadioAction: Allow use of deprecated StockID in deprecated API.
gtk/gtkmm.h | 7 ++++---
gtk/src/radioaction.hg | 16 ++++++++++++++++
gtk/src/toggleaction.hg | 18 ++++++++++++++++++
3 files changed, 38 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index fc65411..b16c4ce 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -91,6 +91,9 @@ extern const int gtkmm_micro_version;
#include <gdkmm.h>
+//Include these first so they can do some undef/re-def magic for StockID.
+#include <gtkmm/toggleaction.h>
+#include <gtkmm/radioaction.h>
#include <gtkmm/object.h>
#include <gtkmm/aboutdialog.h>
@@ -215,7 +218,6 @@ extern const int gtkmm_micro_version;
# include <gtkmm/printunixdialog.h>
#endif
#include <gtkmm/progressbar.h>
-#include <gtkmm/radioaction.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/radiomenuitem.h>
#include <gtkmm/radiotoolbutton.h>
@@ -247,7 +249,6 @@ extern const int gtkmm_micro_version;
#include <gtkmm/statusbar.h>
#include <gtkmm/statusicon.h>
#include <gtkmm/stock.h>
-#include <gtkmm/stockid.h>
#include <gtkmm/stockitem.h>
#include <gtkmm/stylecontext.h>
#include <gtkmm/switch.h>
@@ -260,7 +261,6 @@ extern const int gtkmm_micro_version;
#include <gtkmm/texttag.h>
#include <gtkmm/texttagtable.h>
#include <gtkmm/textview.h>
-#include <gtkmm/toggleaction.h>
#include <gtkmm/togglebutton.h>
#include <gtkmm/toolbar.h>
#include <gtkmm/toolitem.h>
@@ -284,5 +284,6 @@ extern const int gtkmm_micro_version;
#include <gtkmm/widget.h>
#include <gtkmm/widgetpath.h>
#include <gtkmm/window.h>
+#include <gtkmm/stockid.h>
#endif /* #ifndef GTKMM_H */
diff --git a/gtk/src/radioaction.hg b/gtk/src/radioaction.hg
index 81a609c..17af82f 100644
--- a/gtk/src/radioaction.hg
+++ b/gtk/src/radioaction.hg
@@ -15,6 +15,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+// We use StockID in the (deprecated) API, so we must temporarily undef GTKMM_DISABLE_DEPRECATED.
+// Temporarily undef GTKMM_DISABLE_DEPRECATED, redefining it later if appropriate.
+#if defined(GTKMM_DISABLE_DEPRECATED) && !defined(GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED)
+//Stop the deprecation ifdef guards around the API declarations:
+#undef GTKMM_DISABLE_DEPRECATED
+#define GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED 1
+#endif
+
+#include <gtkmm/stockid.h>
+
+// Redefine GTKMM_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
+#if defined(GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED)
+#define GTKMM_DISABLE_DEPRECATED 1
+#undef GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED
+#endif
+
#include <gtkmm/toggleaction.h>
#include <gtkmm/radiobuttongroup.h>
diff --git a/gtk/src/toggleaction.hg b/gtk/src/toggleaction.hg
index 2dc64a8..bbd45ca 100644
--- a/gtk/src/toggleaction.hg
+++ b/gtk/src/toggleaction.hg
@@ -15,6 +15,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+// We use StockID in the (deprecated) API, so we must temporarily undef GTKMM_DISABLE_DEPRECATED.
+// Temporarily undef GTKMM_DISABLE_DEPRECATED, redefining it later if appropriate.
+#if defined(GTKMM_DISABLE_DEPRECATED) && !defined(GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED)
+//Stop the deprecation ifdef guards around the API declarations:
+#undef GTKMM_DISABLE_DEPRECATED
+#define GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED 1
+#endif
+
+#include <gtkmm/stockid.h>
+
+// Redefine GTKMM_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
+#if defined(GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED)
+#define GTKMM_DISABLE_DEPRECATED 1
+#undef GTKMM_GTKMM_DISABLE_DEPRECATED_UNDEFED
+#endif
+
+
#include <gtkmm/action.h>
_DEFS(gtkmm,gtk)
@@ -46,6 +63,7 @@ protected:
_CTOR_DEFAULT
_DEPRECATE_IFDEF_START
+
/** Creates a toggle action.
*
* @param name A unique name for the action.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]