[gtkmm] Deprecate some API that is deprecated in the C API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Deprecate some API that is deprecated in the C API.
- Date: Mon, 26 Mar 2012 19:58:39 +0000 (UTC)
commit 99fafc8bbb224b2af279149041ef142fe7c36b35
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Mar 26 21:15:57 2012 +0200
Deprecate some API that is deprecated in the C API.
* gtk/src/button.hg: Deprecated signal_pressed(), signal_released(),
signal_enter() and signal_leave().
* gtk/src/menuitem.hg: Deprecated get/set_right_justified().
* gtk/src/notebook.hg: Deprecated get_tab_hborder() and
get_tab_vborder().
* gtk/src/widget.hg: Deprecated get/set_state() and
signal_state_changed(), adding signal_state_flags_changed().
* demos/gtk-demo/example_menus.cc: Do not use
MenuItem::set_right_justified(). It has already been removed from the
original C vesion of this demo.
Kjell Ahlstedt noticed this deprecated API in bug #655489 comment 16.
ChangeLog | 18 ++++++++++++++++++
demos/gtk-demo/example_menus.cc | 1 -
gtk/src/button.hg | 8 ++++----
gtk/src/menuitem.hg | 9 +++++----
gtk/src/notebook.hg | 4 ++--
gtk/src/widget.hg | 9 ++++++---
6 files changed, 35 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 96bca8b..924fcc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-03-26 Murray Cumming <murrayc murrayc com>
+
+ Deprecate some API that is deprecated in the C API.
+
+ * gtk/src/button.hg: Deprecated signal_pressed(), signal_released(),
+ signal_enter() and signal_leave().
+ * gtk/src/menuitem.hg: Deprecated get/set_right_justified().
+ * gtk/src/notebook.hg: Deprecated get_tab_hborder() and
+ get_tab_vborder().
+ * gtk/src/widget.hg: Deprecated get/set_state() and
+ signal_state_changed(), adding signal_state_flags_changed().
+
+ * demos/gtk-demo/example_menus.cc: Do not use
+ MenuItem::set_right_justified(). It has already been removed from the
+ original C vesion of this demo.
+
+ Kjell Ahlstedt noticed this deprecated API in bug #655489 comment 16.
+
2012-03-26 Murray Cumming <murrayc localhost localdomain>
StyleContext: Added list_classes() and get_parent().
diff --git a/demos/gtk-demo/example_menus.cc b/demos/gtk-demo/example_menus.cc
index 0b0019e..13a9d35 100644
--- a/demos/gtk-demo/example_menus.cc
+++ b/demos/gtk-demo/example_menus.cc
@@ -81,7 +81,6 @@ Example_Menus::Example_Menus()
pMenuItem = Gtk::manage(new Gtk::MenuItem("bar"));
pMenuItem->set_submenu( *(create_menu(4)) );
- pMenuItem->set_right_justified();
m_MenuBar.append(*pMenuItem);
pMenuItem->show();
}
diff --git a/gtk/src/button.hg b/gtk/src/button.hg
index a5eff24..b091c25 100644
--- a/gtk/src/button.hg
+++ b/gtk/src/button.hg
@@ -103,11 +103,11 @@ public:
_WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_event_window(), gtk_button_get_event_window, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_event_window() const, gtk_button_get_event_window, refreturn, constversion)
- _WRAP_SIGNAL(void pressed(), "pressed")
- _WRAP_SIGNAL(void released(), "released")
+ _WRAP_SIGNAL(void pressed(), "pressed", deprecated "Use Widget::signal_button_press_event() instead.")
+ _WRAP_SIGNAL(void released(), "released", deprecated "Use Widget::signal_button_release_event() instead.")
_WRAP_SIGNAL(void clicked(), "clicked")
- _WRAP_SIGNAL(void enter(), "enter")
- _WRAP_SIGNAL(void leave(), "leave")
+ _WRAP_SIGNAL(void enter(), "enter", deprecated "Use Widget::signal_enter_notify_event() instead.")
+ _WRAP_SIGNAL(void leave(), "leave", deprecated "Use Widget::signal_leave_notify_event() instead.")
_WRAP_SIGNAL(void activate(), "activate", deprecated "Use signal_clicked() instead.")
_WRAP_PROPERTY("label", Glib::ustring)
diff --git a/gtk/src/menuitem.hg b/gtk/src/menuitem.hg
index 4ac8936..041d1fe 100644
--- a/gtk/src/menuitem.hg
+++ b/gtk/src/menuitem.hg
@@ -75,9 +75,8 @@ public:
_WRAP_METHOD(void toggle_size_request(int& requisition), gtk_menu_item_toggle_size_request)
_WRAP_METHOD(void toggle_size_allocate(int allocation), gtk_menu_item_toggle_size_allocate)
- //TODO: Deprecate these in gtkmm 3.2:
- _WRAP_METHOD(void set_right_justified(bool right_justified = true), gtk_menu_item_set_right_justified)
- _WRAP_METHOD(bool get_right_justified() const, gtk_menu_item_get_right_justified)
+ _WRAP_METHOD(void set_right_justified(bool right_justified = true), gtk_menu_item_set_right_justified, deprecated "If you insist on using it, use Widget::set_hexpand() and Widget::set_halign().")
+ _WRAP_METHOD(bool get_right_justified() const, gtk_menu_item_get_right_justified, deprecated "See set_right_justified().")
_WRAP_METHOD(void set_accel_path(const Glib::ustring& accel_path), gtk_menu_item_set_accel_path)
void unset_accel_path();
@@ -101,7 +100,9 @@ public:
void accelerate(Window& window);
- _WRAP_PROPERTY("right-justified", bool)
+ //TODO: Deprecate the C property once GTK+ 3.5 has begun. It seems to have been forgotten.
+ _WRAP_PROPERTY("right-justified", bool, deprecated "See set_right_justified.")
+
_WRAP_PROPERTY("submenu", Gtk::Menu*)
_WRAP_PROPERTY("accel-path", Glib::ustring)
_WRAP_PROPERTY("label", Glib::ustring)
diff --git a/gtk/src/notebook.hg b/gtk/src/notebook.hg
index 57de44f..094f239 100644
--- a/gtk/src/notebook.hg
+++ b/gtk/src/notebook.hg
@@ -110,8 +110,8 @@ public:
_WRAP_METHOD(void set_scrollable(bool scrollable = true), gtk_notebook_set_scrollable)
_WRAP_METHOD(bool get_scrollable() const, gtk_notebook_get_scrollable)
- _WRAP_METHOD(guint16 get_tab_hborder() const, gtk_notebook_get_tab_hborder)
- _WRAP_METHOD(guint16 get_tab_vborder() const, gtk_notebook_get_tab_vborder)
+ _WRAP_METHOD(guint16 get_tab_hborder() const, gtk_notebook_get_tab_hborder, deprecated "This method now returns zero.")
+ _WRAP_METHOD(guint16 get_tab_vborder() const, gtk_notebook_get_tab_vborder, deprecated "This method now returns zero.")
_WRAP_METHOD(void popup_enable(), gtk_notebook_popup_enable)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 96c0afd..e858379 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -222,8 +222,8 @@ public:
void unset_name();
_WRAP_METHOD(Glib::ustring get_name() const, gtk_widget_get_name)
- _WRAP_METHOD(void set_state(StateType state), gtk_widget_set_state)
- _WRAP_METHOD(StateType get_state() const, gtk_widget_get_state)
+ _WRAP_METHOD(void set_state(StateType state), gtk_widget_set_state, deprecated "Use set_state_flags() instead.")
+ _WRAP_METHOD(StateType get_state() const, gtk_widget_get_state, deprecated "Use get_state_flags() instead.")
_WRAP_METHOD(void set_state_flags(StateFlags flags, bool clear = true), gtk_widget_set_state_flags)
_WRAP_METHOD(void unset_state_flags(StateFlags flags), gtk_widget_unset_state_flags)
@@ -565,7 +565,10 @@ public:
// and style_set => style_changed
// to avoid confusion with set_parent and set_style.
- _WRAP_SIGNAL(void state_changed(Gtk::StateType previous_state), "state_changed")
+ _WRAP_SIGNAL(void state_changed(Gtk::StateType previous_state), "state_changed", deprecated "Use signal_state_flags_changed() instead)
+
+ //TODO: Remove no_default_handler when we can break ABI:
+ _WRAP_SIGNAL(void state_flags_changed(Gtk::StateFlags previous_state_flags), "state-flags-changed", no_default_handler)
/// Informs objects that their parent changed.
//- The widget passed is the former parent, which may be 0 if
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]