[gtkmm/gtkmm-2-22] Deprecate Notebook::pages() and Table::children().



commit 82b067aecf41118167d8123831c01efaac3811a5
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jul 14 13:37:38 2010 +0200

    Deprecate Notebook::pages() and Table::children().
    
    * gtk/src/notebook.[hg|ccg]:
    * gtk/src/table.[hg|ccg]: Deprecate the STL-style accessors.

 ChangeLog            |    7 +++++++
 gtk/src/notebook.ccg |    8 ++++----
 gtk/src/notebook.hg  |   39 +++++++++++++++++++++++++++++++--------
 gtk/src/table.ccg    |    9 +++++----
 gtk/src/table.hg     |   16 +++++++++++++++-
 5 files changed, 62 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4f5fde4..d7733f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-14  Murray Cumming  <murrayc murrayc com>
+
+	Deprecate Notebook::pages() and Table::children().
+
+	* gtk/src/notebook.[hg|ccg]:
+	* gtk/src/table.[hg|ccg]: Deprecate the STL-style accessors.
+
 2.21.5:
 
 2010-07-14  Murray Cumming  <murrayc murrayc com>
diff --git a/gtk/src/notebook.ccg b/gtk/src/notebook.ccg
index a799b4f..435f8ad 100644
--- a/gtk/src/notebook.ccg
+++ b/gtk/src/notebook.ccg
@@ -53,6 +53,7 @@ static void SignalProxy_WindowCreation_gtk_callback_destroy(void* data)
 namespace Gtk
 {
 
+_DEPRECATE_IFDEF_START
 namespace Notebook_Helpers
 {
 
@@ -151,7 +152,6 @@ Glib::ustring Page::get_menu_label_text() const
   return parent_->get_menu_label_text(*get_child());
 }
 
-_DEPRECATE_IFDEF_START
 void Page::query_tab_label_packing(bool& expand, bool& fill, PackType& pack_type)
 {
   parent_->query_tab_label_packing(*get_child(), expand, fill, pack_type);
@@ -161,7 +161,6 @@ void Page::set_tab_label_packing(bool expand, bool fill, PackType pack_type)
 {
   parent_->set_tab_label_packing(*get_child(), expand, fill, pack_type);
 }
-_DEPRECATE_IFDEF_END
 
 /*********************************************************************
 ***** List properties
@@ -358,8 +357,9 @@ MenuElem::MenuElem(Widget& child, Widget& menu)
 {}
 
 } /* namespace Notebook_Helpers */
+_DEPRECATE_IFDEF_END
 
-
+_DEPRECATE_IFDEF_START
 Notebook::PageList::iterator Notebook::get_current()
 {
   return pages().find(get_current_page());
@@ -376,6 +376,7 @@ const Notebook::PageList& Notebook::pages() const
   pages_proxy_ = PageList(const_cast<GtkNotebook*>(gobj()));
   return pages_proxy_;
 }
+_DEPRECATE_IFDEF_END
 
 /*Widget* Notebook::get_current_page()
 {
@@ -465,4 +466,3 @@ void Notebook::set_window_creation_hook(const SlotWindowCreation& slot)
 }
 
 } //namespace Gtk
-
diff --git a/gtk/src/notebook.hg b/gtk/src/notebook.hg
index 88f043e..f530613 100644
--- a/gtk/src/notebook.hg
+++ b/gtk/src/notebook.hg
@@ -49,8 +49,14 @@ namespace Gtk
 _CC_INCLUDE(gtk/gtk.h)
 _WRAP_ENUM(NotebookTab, GtkNotebookTab)
 
+
+_DEPRECATE_IFDEF_START
+
 class Notebook;
 
+
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ */
 namespace Notebook_Helpers
 {
 /*********************************************************************
@@ -74,6 +80,8 @@ class Page;
  * lead to fragile and unexpected behaviour.
  * (Thanks for this explanation, Daniel!)
  */
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ */
 class PageIterator
 {
 public:
@@ -135,7 +143,6 @@ public:
   void set_menu_label_text(const Glib::ustring& menu_text);
   Glib::ustring get_menu_label_text() const;
 
-  _DEPRECATE_IFDEF_START
   /** @deprecated Query the "tab-expand" and "tab-fill" child properties instead.
    */
   void query_tab_label_packing(bool& expand, bool& fill, PackType& pack_type);
@@ -143,12 +150,13 @@ public:
   /** @deprecated Modify the "tab-expand" and "tab-fill" child properties instead.
    */
   void set_tab_label_packing(bool expand, bool fill, PackType pack_type);
-  _DEPRECATE_IFDEF_END
 };
 
 // Element is the input class
 class PageList;
 
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ */
 class Element
 {
 public:
@@ -166,12 +174,16 @@ protected:
 // Just a widget without a tab
 typedef Element WidgetElem;
 
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ */
 struct TabElem : public Element
 {
   TabElem(Widget& child, Widget& tab);
   TabElem(Widget& child, const Glib::ustring& label, bool mnemonic = false);
 };
 
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ */
 struct MenuElem : public Element
 {
   MenuElem(Widget& child, Widget& menu);
@@ -181,7 +193,8 @@ struct MenuElem : public Element
 ***** List properties
 *********************************************************************/
 
-/** An STL-style container for pages in a Gtk::Notebook.
+/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+ * An STL-style container for pages in a Gtk::Notebook.
  *
  */
 class PageList
@@ -283,15 +296,13 @@ protected:
 };
 
 } // Notebook_Helpers
+_DEPRECATE_IFDEF_END
 
 /** Container which shows one of its children at a time, in tabbed windows.
  *
  * The Gtk::Notebook widget is a Gtk::Container whose children are pages that
  * can be switched between using tab labels along one edge.
  *
- * You can use the PageList returned by pages() as any normal STL container
- * to manipulate the pages.
- *
  * A Notebook widget looks like this:
  * @image html notebook1.png
  *
@@ -304,8 +315,6 @@ 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:
-  typedef Notebook_Helpers::PageList PageList;
-
   _CTOR_DEFAULT
 
   _WRAP_METHOD(int prepend_page(Widget& child, Widget& tab_label), gtk_notebook_prepend_page)
@@ -414,10 +423,24 @@ public:
   _WRAP_METHOD(Widget* get_action_widget(PackType pack_type = PACK_START), gtk_notebook_get_action_widget)
   _WRAP_METHOD(void set_action_widget(Widget* widget, PackType pack_type = PACK_START), gtk_notebook_set_action_widget)
 
+
+_DEPRECATE_IFDEF_START
+  /** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+   */
+  typedef Notebook_Helpers::PageList PageList;
+
+  /** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+   */
   PageList::iterator get_current();
 
+  /** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+   */
   PageList& pages();
+
+  /** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
+   */
   const PageList& pages() const;
+_DEPRECATE_IFDEF_END
 
   _WRAP_SIGNAL(void switch_page(GtkNotebookPage* page, guint page_num), "switch_page")
   _WRAP_SIGNAL(void page_reordered(Widget* page, guint page_num), "page_reordered", no_default_handler)
diff --git a/gtk/src/table.ccg b/gtk/src/table.ccg
index 2aa6d8f..3d16849 100644
--- a/gtk/src/table.ccg
+++ b/gtk/src/table.ccg
@@ -1,7 +1,7 @@
 // -*- c++ -*-
 /* $Id: table.ccg,v 1.1 2003/01/21 13:40:40 murrayc Exp $ */
 
-/* 
+/*
  *
  * Copyright 1998-2002 The gtkmm Development Team
  *
@@ -25,6 +25,7 @@
 namespace Gtk
 {
 
+_DEPRECATE_IFDEF_START
 namespace Table_Helpers
 {
 
@@ -95,7 +96,7 @@ bool Child::get_yfill() const
 
 
 } //namespace Table_Helpers
-
+_DEPRECATE_IFDEF_END
 
 void Table::set_spacings(guint spacing)
 {
@@ -103,6 +104,7 @@ void Table::set_spacings(guint spacing)
   set_col_spacings(spacing);
 }
 
+_DEPRECATE_IFDEF_START
 Table::TableList& Table::children()
 {
   children_proxy_ = TableList(gobj());
@@ -114,7 +116,6 @@ const Table::TableList& Table::children() const
   children_proxy_ = TableList(const_cast<GtkTable*>(gobj()));
   return children_proxy_;
 }
-
+_DEPRECATE_IFDEF_END
 
 } /* namespace Gtk */
-
diff --git a/gtk/src/table.hg b/gtk/src/table.hg
index 62d889d..002693a 100644
--- a/gtk/src/table.hg
+++ b/gtk/src/table.hg
@@ -38,11 +38,16 @@ _PINCLUDE(gtkmm/private/container_p.h)
 namespace Gtk
 {
 
+_DEPRECATE_IFDEF_START
 class Table;
 
+/** @deprecated Use Container::get_children() instead.
+ */
 namespace Table_Helpers
 {
 
+/** @deprecated Use Container::get_children() instead.
+ */
 class Child : protected _GtkTableChild
 {
 private:
@@ -94,6 +99,7 @@ protected:
   GP_LIST_END()
 
 } // namespace Table_Helpers
+_DEPRECATE_IFDEF_END
 
 
 /** Pack widgets in regular patterns.
@@ -171,11 +177,19 @@ public:
   _WRAP_METHOD(void set_homogeneous(bool homogeneous = true), gtk_table_set_homogeneous)
   _WRAP_METHOD(bool get_homogeneous() const, gtk_table_get_homogeneous)
 
+_DEPRECATE_IFDEF_START
+  /** @deprecated Use Container::get_children() instead.
+   */
   typedef Table_Helpers::TableList TableList;
 
-
+  /** @deprecated Use Container::get_children() instead.
+   */
   TableList& children();
+
+  /** @deprecated Use Container::get_children() instead.
+   */
   const TableList& children() const;
+_DEPRECATE_IFDEF_END
 
   _WRAP_PROPERTY("n-rows", guint)
   _WRAP_PROPERTY("n-columns", guint)



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