[gtkmm/gtkmm-2-24] Make sure that all deprecated API is in an ifdef.



commit 98004db949f7a30f0611a516b341515ae0446771
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Feb 1 12:15:58 2011 +0100

    Make sure that all deprecated API is in an ifdef.
    
    * gdk/src/display.ccg:
    * gdk/src/display.hg:
    * gdk/src/dragcontext.hg:
    * gdk/src/image.hg:
    * gtk/gtkmm/comboboxtext.cc:
    * gtk/src/treemodel.hg: Add ifdefs around all deprecated API,
    making it easier to avoid using that API.

 ChangeLog                 |   12 ++++++++++++
 gdk/src/display.ccg       |    4 +++-
 gdk/src/display.hg        |    2 ++
 gdk/src/dragcontext.hg    |    4 ++++
 gdk/src/image.hg          |    3 ++-
 gtk/gtkmm/comboboxtext.cc |    2 ++
 gtk/src/treemodel.hg      |    1 +
 7 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3cb00b1..b6b81af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2011-02-01  Murray Cumming  <murrayc murrayc com>
 
+	Make sure that all deprecated API is in an ifdef.
+
+	* gdk/src/display.ccg:
+	* gdk/src/display.hg:
+	* gdk/src/dragcontext.hg:
+	* gdk/src/image.hg:
+	* gtk/gtkmm/comboboxtext.cc:
+	* gtk/src/treemodel.hg: Add ifdefs around all deprecated API, 
+	making it easier to avoid using that API.
+
+2011-02-01  Murray Cumming  <murrayc murrayc com>
+
 	Gdk::Image: Added get_pixel().
 
 	* gdk/src/image.hg: Added get_pixel(), wrapping 
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 98dc7c9..a2509d3 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -37,11 +37,13 @@ Glib::RefPtr<Window> Display::get_selection_owner(const Glib::ustring& selection
 }
 
 #ifdef G_OS_WIN32
+_DEPRECATE_IFDEF_START
 guint32 Display::get_drag_protocol(guint32 xid, GdkDragProtocol& protocol)
 {
   return GPOINTER_TO_UINT(gdk_drag_get_protocol_for_display(gobj(), GUINT_TO_POINTER(xid), &(protocol)));
 }
-
+_DEPRECATE_IFDEF_END
+  
 void Display::selection_send_notify(guint32 requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_)
 {
   gdk_selection_send_notify_for_display(gobj(), GUINT_TO_POINTER(requestor), Gdk::AtomString::to_c_type(selection), Gdk::AtomString::to_c_type(target), Gdk::AtomString::to_c_type(property), time_);
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 9753b46..ac05b13 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -146,6 +146,7 @@ public:
   _WRAP_METHOD(static Glib::RefPtr<Display> open_default_libgtk_only(), gdk_display_open_default_libgtk_only, refreturn)
 
 #ifdef G_OS_WIN32
+_DEPRECATE_IFDEF_START
   /** Finds out the DND protocol supported by a window.
    *
    * @newin{2,2}
@@ -161,6 +162,7 @@ public:
    * can't be overloaded therefore. But the ABI stays the same anyway.
    */
   guint32 get_drag_protocol(guint32 xid, GdkDragProtocol& protocol);
+_DEPRECATE_IFDEF_END
 #endif
 
   _WRAP_METHOD(GdkNativeWindow get_drag_protocol(GdkNativeWindow xid, GdkDragProtocol& protocol), gdk_drag_get_protocol_for_display)
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index 26dafb0..c7f8bd8 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -46,14 +46,18 @@ class DragContext : public Glib::Object
   _IGNORE(gdk_drag_context_ref, gdk_drag_context_unref)
 protected:
 
+  _DEPRECATE_IFDEF_START
   /** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
    */
   _CTOR_DEFAULT
+  _DEPRECATE_IFDEF_END
 
 public:
+  _DEPRECATE_IFDEF_START
   /** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
    */
   _WRAP_CREATE()
+  _DEPRECATE_IFDEF_END
 
   _WRAP_METHOD(void drag_status(DragAction action, guint32 time), gdk_drag_status)
 
diff --git a/gdk/src/image.hg b/gdk/src/image.hg
index 27844e4..f083d3a 100644
--- a/gdk/src/image.hg
+++ b/gdk/src/image.hg
@@ -91,11 +91,12 @@ public:
   _WRAP_METHOD(void* get_pixels(), gdk_image_get_pixels)
   _WRAP_METHOD(const void* get_pixels() const, gdk_image_get_pixels)
 
+_DEPRECATE_IFDEF_START
   //This memory block is not read-only, apparently:
   /** @deprecated Use get_pixels().
    */
   _MEMBER_GET_PTR(mem, mem, void*, gpointer)
-
+_DEPRECATE_IFDEF_END
 
   //TODO: This should be const really.
   _MEMBER_GET(windowing_data, windowing_data, void*, gpointer)
diff --git a/gtk/gtkmm/comboboxtext.cc b/gtk/gtkmm/comboboxtext.cc
index b3969e3..d5b36e0 100644
--- a/gtk/gtkmm/comboboxtext.cc
+++ b/gtk/gtkmm/comboboxtext.cc
@@ -126,11 +126,13 @@ Glib::ustring ComboBoxText::get_active_text() const
   return result;
 }
 
+#ifndef GTKMM_DISABLE_DEPRECATED
 //deprecated.
 void ComboBoxText::clear()
 {
   remove_all();
 }
+#endif //GTKMM_DISABLE_DEPRECATED
 
 void ComboBoxText::clear_items()
 {
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index 378b6aa..67720af 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -394,6 +394,7 @@ dnl
    */
   _WRAP_VFUNC(void get_value(const iterator& iter, int column, Glib::ValueBase& value) const, get_value)
 
+  //We don't put an deprecation ifdef around this because it would break ABI.
   /** Override and implement this in a derived TreeModel class.
    * @note This virtual method is not recommended.  To check
    * whether an iterator is valid, call TreeStore::iter_is_valid(),



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