[gtk+] menu: Deprecate GtkTearoffMenuItem
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] menu: Deprecate GtkTearoffMenuItem
- Date: Sat, 1 Oct 2011 04:05:17 +0000 (UTC)
commit b13544171a97a219bf2f18c43e463f88b3f3f222
Author: Benjamin Otte <otte redhat com>
Date: Sat Oct 1 05:49:48 2011 +0200
menu: Deprecate GtkTearoffMenuItem
gtk/gtkmenu.c | 6 +++++-
gtk/gtkmenushell.c | 6 +++++-
gtk/gtktearoffmenuitem.c | 8 ++++++++
gtk/gtktearoffmenuitem.h | 4 ++++
gtk/gtktreemenu.c | 3 ++-
gtk/gtkuimanager.c | 3 ++-
6 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 454336b..bb327b5 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -104,7 +104,6 @@
#include "gtkmenuprivate.h"
#include "gtkmenuitemprivate.h"
#include "gtkmenushellprivate.h"
-#include "gtktearoffmenuitem.h"
#include "gtkwindow.h"
#include "gtkbox.h"
#include "gtkscrollbar.h"
@@ -113,6 +112,11 @@
#include "gtkwidgetprivate.h"
#include "gtkintl.h"
#include "gtktypebuiltins.h"
+
+#undef GTK_DISABLE_DEPRECATED
+#include "gtktearoffmenuitem.h"
+
+
#include "a11y/gtkmenuaccessible.h"
#define NAVIGATION_REGION_OVERSHOOT 50 /* How much the navigation region
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 34337b5..4b6749d 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -49,13 +49,17 @@
#include "gtkmenushellprivate.h"
#include "gtkmenuprivate.h"
#include "gtkmnemonichash.h"
-#include "gtktearoffmenuitem.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtktypebuiltins.h"
+
+#undef GTK_DISABLE_DEPRECATED
+#include "gtktearoffmenuitem.h"
+
#include "a11y/gtkmenushellaccessible.h"
+
#define MENU_SHELL_TIMEOUT 500
#define PACK_DIRECTION(m) \
diff --git a/gtk/gtktearoffmenuitem.c b/gtk/gtktearoffmenuitem.c
index 81c9ec7..dc151ce 100644
--- a/gtk/gtktearoffmenuitem.c
+++ b/gtk/gtktearoffmenuitem.c
@@ -26,6 +26,8 @@
#include "config.h"
+#undef GTK_DISABLE_DEPRECATED
+
#include "gtkmenuprivate.h"
#include "gtkmenuitemprivate.h"
#include "gtktearoffmenuitem.h"
@@ -50,6 +52,9 @@
* as a dotted line which has a left pointing arrow graphic indicating that
* the tearoff menu can be reattached. Activating it will erase the tearoff
* menu window.
+ *
+ * <note>#GtkTearoffMenuItem is deprecated and should not be used in newly
+ * written code. Menus are not meant to be torn around.</note>
*/
@@ -82,6 +87,9 @@ G_DEFINE_TYPE (GtkTearoffMenuItem, gtk_tearoff_menu_item, GTK_TYPE_MENU_ITEM)
* Creates a new #GtkTearoffMenuItem.
*
* Returns: a new #GtkTearoffMenuItem.
+ *
+ * Deprecated: 3.4: #GtkTearoffMenuItem is deprecated and should not be
+ * used in newly written code.
*/
GtkWidget*
gtk_tearoff_menu_item_new (void)
diff --git a/gtk/gtktearoffmenuitem.h b/gtk/gtktearoffmenuitem.h
index 542e2c6..8521d9b 100644
--- a/gtk/gtktearoffmenuitem.h
+++ b/gtk/gtktearoffmenuitem.h
@@ -37,6 +37,8 @@
G_BEGIN_DECLS
+#ifndef GTK_DISABLE_DEPRECATED
+
#define GTK_TYPE_TEAROFF_MENU_ITEM (gtk_tearoff_menu_item_get_type ())
#define GTK_TEAROFF_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEAROFF_MENU_ITEM, GtkTearoffMenuItem))
#define GTK_TEAROFF_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEAROFF_MENU_ITEM, GtkTearoffMenuItemClass))
@@ -72,6 +74,8 @@ struct _GtkTearoffMenuItemClass
GType gtk_tearoff_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_tearoff_menu_item_new (void);
+#endif /* GTK_DISABLE_DEPRECATED */
+
G_END_DECLS
#endif /* __GTK_TEAROFF_MENU_ITEM_H__ */
diff --git a/gtk/gtktreemenu.c b/gtk/gtktreemenu.c
index 3a89eae..4bcdbba 100644
--- a/gtk/gtktreemenu.c
+++ b/gtk/gtktreemenu.c
@@ -38,7 +38,6 @@
#include "gtktreemenu.h"
#include "gtkmarshalers.h"
#include "gtkmenuitem.h"
-#include "gtktearoffmenuitem.h"
#include "gtkseparatormenuitem.h"
#include "gtkcellareabox.h"
#include "gtkcellareacontext.h"
@@ -47,6 +46,8 @@
#include "gtkmenushellprivate.h"
#include "gtkprivate.h"
+#undef GTK_DISABLE_DEPRECATED
+#include "gtktearoffmenuitem.h"
/* GObjectClass */
static GObject *gtk_tree_menu_constructor (GType type,
diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c
index 6f1c625..0a80ce5 100644
--- a/gtk/gtkuimanager.c
+++ b/gtk/gtkuimanager.c
@@ -43,12 +43,13 @@
#include "gtkmenutoolbutton.h"
#include "gtkseparatormenuitem.h"
#include "gtkseparatortoolitem.h"
-#include "gtktearoffmenuitem.h"
#include "gtktoolbar.h"
#include "gtkuimanager.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
+#undef GTK_DISABLE_DEPRECATED
+#include "gtktearoffmenuitem.h"
/**
* SECTION:gtkuimanager
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]