[gtkmm/gtkmm-2-22] Make sure that deprecated API is inside an ifdef.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-22] Make sure that deprecated API is inside an ifdef.
- Date: Mon, 13 Sep 2010 20:16:17 +0000 (UTC)
commit 938590dadef8ba4384ad21b5c967d5d21e0e7973
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Sep 13 21:46:36 2010 +0200
Make sure that deprecated API is inside an ifdef.
* gtk/gtkmm/comboboxentrytext.[h|cc]:
* gtk/src/notebook.hg:
* gtk/src/textbuffer.ccg:
* gtk/src/textbuffer.hg:
* gtk/src/widget.hg: Put anything documented with @deprecated in
#ifndef GTKMM_DISABLE_DEPRECATED.
gdk/src/display.hg | 2 +-
gdk/src/gc.hg | 4 +---
gtk/gtkmm/comboboxentrytext.cc | 14 ++++++++------
gtk/gtkmm/comboboxentrytext.h | 2 ++
gtk/src/notebook.hg | 6 +++++-
gtk/src/textbuffer.ccg | 2 ++
gtk/src/textbuffer.hg | 8 ++++----
gtk/src/widget.hg | 3 ---
8 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index fcc6529..798e9cd 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -144,7 +144,7 @@ public:
/** Finds out the DND protocol supported by a window.
*
* @newin{2,2}
- * @deprecated
+ * @deprecated Use the version that takes a GdkNativeWindow.
* @param xid The X id of the destination window.
* @param protocol Location where the supported DND protocol is returned.
* @return The X id of the window where the drop should happen. This
diff --git a/gdk/src/gc.hg b/gdk/src/gc.hg
index 985257c..334e312 100644
--- a/gdk/src/gc.hg
+++ b/gdk/src/gc.hg
@@ -78,9 +78,7 @@ public:
//Note: The rectangle parameter was made const in GTK+ 2.16, but we can't change that in our C++ API. TODO: Change it when we can do an ABI break.
#m4 _CONVERSION(`Rectangle&',`const GdkRectangle*',`($3).gobj()')
- /** @deprecated Use set_clip_rectangle(const Rectangle& rectangle) instead.
- */
- _WRAP_METHOD(void set_clip_rectangle(Rectangle& rectangle), gdk_gc_set_clip_rectangle)
+ _WRAP_METHOD(void set_clip_rectangle(Rectangle& rectangle), gdk_gc_set_clip_rectangle, deprecated "Use set_clip_rectangle(const Rectangle& rectangle) instead.")
_WRAP_METHOD(void set_clip_rectangle(const Rectangle& rectangle), gdk_gc_set_clip_rectangle)
diff --git a/gtk/gtkmm/comboboxentrytext.cc b/gtk/gtkmm/comboboxentrytext.cc
index b2b2e1a..671ca45 100644
--- a/gtk/gtkmm/comboboxentrytext.cc
+++ b/gtk/gtkmm/comboboxentrytext.cc
@@ -80,12 +80,6 @@ void ComboBoxEntryText::prepend_text(const Glib::ustring& text)
}
}
-//deprecated.
-void ComboBoxEntryText::clear()
-{
- clear_items();
-}
-
void ComboBoxEntryText::clear_items()
{
//Ideally, we would just store the ListStore as a member variable, but we forgot to do that and not it would break the ABI.
@@ -118,6 +112,7 @@ void ComboBoxEntryText::remove_text(const Glib::ustring& text)
}
}
+#ifndef GTKMM_DISABLE_DEPRECATED
Glib::ustring ComboBoxEntryText::get_active_text() const
{
Glib::ustring result;
@@ -155,6 +150,13 @@ void ComboBoxEntryText::set_active_text(const Glib::ustring& text)
unset_active();
}
+//deprecated.
+void ComboBoxEntryText::clear()
+{
+ clear_items();
+}
+#endif //GTKMM_DISABLE_DEPRECATED
+
} // namespace Gtk
diff --git a/gtk/gtkmm/comboboxentrytext.h b/gtk/gtkmm/comboboxentrytext.h
index 85d1b5d..ed55f9e 100644
--- a/gtk/gtkmm/comboboxentrytext.h
+++ b/gtk/gtkmm/comboboxentrytext.h
@@ -66,6 +66,7 @@ public:
*/
void prepend_text(const Glib::ustring& text);
+#ifndef GTKMM_DISABLE_DEPRECATED
//@deprecated Use get_entry()->get_text() to get the actual entered text.
Glib::ustring get_active_text() const;
@@ -76,6 +77,7 @@ public:
//TODO: Remove this when we can break API.
/// @deprecated See clear_items(). Since 2.8.
void clear();
+#endif //GTKMM_DISABLE_DEPRECATED
/** Remove all items from the drop-down menu.
*/
diff --git a/gtk/src/notebook.hg b/gtk/src/notebook.hg
index cb289cf..514f773 100644
--- a/gtk/src/notebook.hg
+++ b/gtk/src/notebook.hg
@@ -190,7 +190,6 @@ struct MenuElem : public Element
{
MenuElem(Widget& child, Widget& menu);
};
-_DEPRECATE_IFDEF_END
/*********************************************************************
***** List properties
@@ -299,6 +298,8 @@ protected:
GtkNotebook* gparent_;
};
+_DEPRECATE_IFDEF_END
+
} // Notebook_Helpers
/** Container which shows one of its children at a time, in tabbed windows.
@@ -318,9 +319,12 @@ class Notebook : public Container
_IGNORE(gtk_notebook_set_homogeneous_tabs, gtk_notebook_set_tab_border, gtk_notebook_set_tab_hborder, gtk_notebook_set_tab_vborder)
public:
+
+_DEPRECATE_IFDEF_START
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
*/
typedef Notebook_Helpers::PageList PageList;
+_DEPRECATE_IFDEF_END
_CTOR_DEFAULT
diff --git a/gtk/src/textbuffer.ccg b/gtk/src/textbuffer.ccg
index 3c896dc..56e8d71 100644
--- a/gtk/src/textbuffer.ccg
+++ b/gtk/src/textbuffer.ccg
@@ -523,10 +523,12 @@ static listStrings util_convert_atoms_to_strings(GdkAtom* targets, int n_targets
return listTargets;
}
+_DEPRECATE_IFDEF_START
Glib::ustring TextBuffer::get_text(bool include_hidden_chars)
{
return get_text(begin(), end(), include_hidden_chars);
}
+_DEPRECATE_IFDEF_END
Glib::ustring TextBuffer::get_text(bool include_hidden_chars) const
{
diff --git a/gtk/src/textbuffer.hg b/gtk/src/textbuffer.hg
index 0026c9d..97181b8 100644
--- a/gtk/src/textbuffer.hg
+++ b/gtk/src/textbuffer.hg
@@ -344,15 +344,15 @@ public:
iterator backspace(const iterator& iter, bool interactive = true, bool default_editable = true);
_IGNORE(gtk_text_buffer_backspace)
- /** @deprecated Use get_text(const iterator& start, const iterator& end, bool include_hidden_chars) const
- */
- _WRAP_METHOD(Glib::ustring get_text(const iterator& start, const iterator& end, bool include_hidden_chars = true), gtk_text_buffer_get_text)
+ _WRAP_METHOD(Glib::ustring get_text(const iterator& start, const iterator& end, bool include_hidden_chars = true), gtk_text_buffer_get_text, deprecated "Use get_text(const iterator& start, const iterator& end, bool include_hidden_chars) const")
_WRAP_METHOD(Glib::ustring get_text(const iterator& start, const iterator& end, bool include_hidden_chars = true) const, gtk_text_buffer_get_text)
+_DEPRECATE_IFDEF_START
/** @deprecated Use get_text(bool include_hidden_chars) const.
*/
Glib::ustring get_text(bool include_hidden_chars = true);
+_DEPRECATE_IFDEF_END
/** Returns all the text in the buffer. Excludes undisplayed
* text (text marked with tags that set the invisibility attribute) if
@@ -369,7 +369,7 @@ public:
/** @deprecated Use get_slice(const iterator& start, const iterator& end, bool include_hidden_chars) const.
*/
- _WRAP_METHOD(Glib::ustring get_slice(const iterator& start, const iterator& end, bool include_hidden_chars = true), gtk_text_buffer_get_slice)
+ _WRAP_METHOD(Glib::ustring get_slice(const iterator& start, const iterator& end, bool include_hidden_chars = true), gtk_text_buffer_get_slice, deprecated "Use get_slice(const iterator& start, const iterator& end, bool include_hidden_chars) const.")
_WRAP_METHOD(Glib::ustring get_slice(const iterator& start, const iterator& end, bool include_hidden_chars = true) const, gtk_text_buffer_get_slice)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 464d643..411b2ad 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -641,13 +641,10 @@ _DEPRECATE_IFDEF_START
*/
bool parent_sensitive() const;
- _DEPRECATE_IFDEF_END
-
/** @deprecated: Use has_rc_style() instead.
*/
bool rc_style() const;
- _DEPRECATE_IFDEF_START
/** Returns trye if the widget is a composite child of its parent.
* @deprecated Use the "composite-child" property instead.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]