[gtkmm] Dialog: Deprecates some methods and fix the build with --warnings=fatal



commit d2241737b35ebec6e76754c036fa1e8b6884a6e5
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 28 10:35:44 2014 +0100

    Dialog: Deprecates some methods and fix the build with --warnings=fatal
    
    * dialog.[hg|ccg]: Deprcate set_alternative_button_order_from_array(),
      alternative_button_order() (which have no deprecation advice in
      GTK+, but I have given up filing bugs about that) and
      get_action_area() (which does).

 gtk/src/dialog.ccg |    2 ++
 gtk/src/dialog.hg  |   16 +++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gtk/src/dialog.ccg b/gtk/src/dialog.ccg
index 87aed3a..6558a06 100644
--- a/gtk/src/dialog.ccg
+++ b/gtk/src/dialog.ccg
@@ -35,9 +35,11 @@ Dialog::Dialog(const Glib::ustring& title, bool modal)
   set_modal(modal);
 }
 
+_DEPRECATE_IFDEF_START
 void Dialog::set_alternative_button_order_from_array(const std::vector<int>& new_order)
 {
   gtk_dialog_set_alternative_button_order_from_array(gobj(), new_order.size(), 
const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data()));
 }
+_DEPRECATE_IFDEF_END
 
 } // namespace Gtk
diff --git a/gtk/src/dialog.hg b/gtk/src/dialog.hg
index 526c61d..52d3e69 100644
--- a/gtk/src/dialog.hg
+++ b/gtk/src/dialog.hg
@@ -26,6 +26,12 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/window_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+//Let us use deprecated GTK+ API in or deprecated gtkmm API.
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gtk
 {
 
@@ -83,8 +89,9 @@ public:
   _WRAP_METHOD(const Widget* get_widget_for_response(int response_id) const, 
gtk_dialog_get_widget_for_response, constversion)
   _WRAP_METHOD(int get_response_for_widget(const Gtk::Widget& widget) const, 
gtk_dialog_get_response_for_widget)
 
-  _WRAP_METHOD(static bool alternative_button_order(const Glib::RefPtr<const Gdk::Screen>& screen), 
gtk_alternative_dialog_button_order)
+  _WRAP_METHOD(static bool alternative_button_order(const Glib::RefPtr<const Gdk::Screen>& screen), 
gtk_alternative_dialog_button_order, deprecated "This should no longer be used.")
 
+_DEPRECATE_IFDEF_START
   /** Sets an alternative button order. If the gtk-alternative-button-order
    * setting is set to true, the dialog buttons are reordered according to
    * the order of the response ids in @a new_order.
@@ -101,17 +108,20 @@ public:
    * @param new_order an array of response ids of the dialog's buttons.
    *
    * @newin{2,6}
+   *
+   * @deprecated "This should no longer be used."
    */
   void set_alternative_button_order_from_array(const std::vector<int>& new_order);
   _IGNORE(gtk_dialog_set_alternative_button_order_from_array, gtk_dialog_set_alternative_button_order)
+_DEPRECATE_IFDEF_END
 
   _WRAP_METHOD(void response(int response_id), gtk_dialog_response)
   _WRAP_METHOD(int run(), gtk_dialog_run)
 
   // This previously returned an HButtonBox*, which broke on Maemo Fremantle.
   // Changed post-2.18.2
-  _WRAP_METHOD(ButtonBox* get_action_area(), gtk_dialog_get_action_area)
-  _WRAP_METHOD(const ButtonBox* get_action_area() const, gtk_dialog_get_action_area, constversion)
+  _WRAP_METHOD(ButtonBox* get_action_area(), gtk_dialog_get_action_area, deprecated "Direct access to the 
action area is discouraged. Use add_button(), etc.")
+  _WRAP_METHOD(const ButtonBox* get_action_area() const, gtk_dialog_get_action_area, constversion, "Direct 
access to the action area is discouraged. Use add_button(), etc.")
 
   _WRAP_METHOD(Box* get_vbox(), gtk_dialog_get_content_area, deprecated "Use get_content_area() instead.")
   _WRAP_METHOD(const Box* get_vbox() const, gtk_dialog_get_content_area, constversion, deprecated "Use 
get_content_area() instead.")


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