[gtkmm] Deprecate Gtk::StockID, StockItem, BuiltinStockID, namespace Gtk::Stock.



commit b4f7774d1ecaeb0b586136244e8cf59141ae8713
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Jul 2 19:36:02 2013 +0200

    Deprecate Gtk::StockID, StockItem, BuiltinStockID, namespace Gtk::Stock.
    
    * gtk/gtkmm/stock.[h|cc]: Deprecate struct BuiltinStockID and all functions in
    namespace Gtk::Stock.
    * gtk/gtkmm/stockid.[h|cc]: Deprecate StockID.
    * gtk/src/stockitem.hg: Deprecate StockItem.
    * gdk/src/dragcontext.hg:
    * gtk/src/button.[hg|ccg]:
    * gtk/src/cellrendererpixbuf.hg:
    * gtk/src/dialog.hg:
    * gtk/src/entry.[hg|ccg]:
    * gtk/src/infobar.hg:
    * gtk/src/menutoolbutton.[hg|ccg]:
    * gtk/src/radiotoolbutton.[hg|ccg]:
    * gtk/src/statusicon.[hg|ccg]:
    * gtk/src/togglebutton.[hg|ccg]:
    * gtk/src/toggletoolbutton.[hg|ccg]:
    * gtk/src/toolbutton.[hg|ccg]:
    * gtk/src/tooltip.hg: Deprecate all constructors, methods and properties
    that take a StockID parameter or return a StockID.
    
    It remains to copy deprecation messages from gtk+ to all the BuiltinStockID
    constants in stock.h.

 ChangeLog                     |   26 ++++++++++++++++++++++++++
 gdk/src/dragcontext.hg        |    7 ++++++-
 gtk/gtkmm/stock.cc            |    6 ++++++
 gtk/gtkmm/stock.h             |   14 +++++++++++---
 gtk/gtkmm/stockid.cc          |    5 +++++
 gtk/gtkmm/stockid.h           |   11 ++++++++---
 gtk/src/button.ccg            |    2 ++
 gtk/src/button.hg             |   13 ++++++++++---
 gtk/src/cellrendererpixbuf.hg |    2 +-
 gtk/src/dialog.hg             |    2 +-
 gtk/src/entry.ccg             |    5 -----
 gtk/src/entry.hg              |   14 ++++++--------
 gtk/src/infobar.hg            |    2 +-
 gtk/src/menutoolbutton.ccg    |   10 ++++++++++
 gtk/src/menutoolbutton.hg     |    8 +++++++-
 gtk/src/radiotoolbutton.ccg   |    2 ++
 gtk/src/radiotoolbutton.hg    |    3 +++
 gtk/src/statusicon.ccg        |   16 ++++++++++++++++
 gtk/src/statusicon.hg         |   31 ++++++++++++++++++++++++++-----
 gtk/src/stockitem.hg          |    9 +++++++++
 gtk/src/togglebutton.ccg      |    3 ++-
 gtk/src/togglebutton.hg       |    3 +++
 gtk/src/toggletoolbutton.ccg  |   10 ++++++++++
 gtk/src/toggletoolbutton.hg   |    8 +++++++-
 gtk/src/toolbutton.ccg        |    8 ++++++++
 gtk/src/toolbutton.hg         |   19 +++++++++++++++----
 gtk/src/tooltip.hg            |    7 ++++++-
 27 files changed, 207 insertions(+), 39 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9ed783a..cc13547 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
 2013-07-02  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
+       Deprecate Gtk::StockID, StockItem, BuiltinStockID, namespace Gtk::Stock.
+
+       * gtk/gtkmm/stock.[h|cc]: Deprecate struct BuiltinStockID and all functions in
+       namespace Gtk::Stock.
+       * gtk/gtkmm/stockid.[h|cc]: Deprecate StockID.
+       * gtk/src/stockitem.hg: Deprecate StockItem.
+       * gdk/src/dragcontext.hg:
+       * gtk/src/button.[hg|ccg]:
+       * gtk/src/cellrendererpixbuf.hg:
+       * gtk/src/dialog.hg:
+       * gtk/src/entry.[hg|ccg]:
+       * gtk/src/infobar.hg:
+       * gtk/src/menutoolbutton.[hg|ccg]:
+       * gtk/src/radiotoolbutton.[hg|ccg]:
+       * gtk/src/statusicon.[hg|ccg]:
+       * gtk/src/togglebutton.[hg|ccg]:
+       * gtk/src/toggletoolbutton.[hg|ccg]:
+       * gtk/src/toolbutton.[hg|ccg]:
+       * gtk/src/tooltip.hg: Deprecate all constructors, methods and properties
+       that take a StockID parameter or return a StockID.
+
+       It remains to copy deprecation messages from gtk+ to all the BuiltinStockID
+       constants in stock.h.
+
+2013-07-02  Kjell Ahlstedt  <kjell ahlstedt bredband net>
+
        Deprecate Deprecate Gtk::IconFactory, IconSet, IconSource.
 
        * gtk/gtkmm/wrap_init.h: Add GDK_DISABLE_DEPRECATION_WARNINGS, which is now
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index 65ae646..d0846fa 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -27,6 +27,11 @@
 _DEFS(gdkmm,gdk)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GDK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gdk
 {
 
@@ -78,7 +83,7 @@ public:
   // The first argument was changed from StockID to ustring to avoid
   // cross-dependence between gdkmm and gtkmm.
   // See http://bugzilla.gnome.org/show_bug.cgi?id=79124 for details
-  _WRAP_METHOD(void set_icon(const Glib::ustring& stock_id, int hot_x, int hot_y), gtk_drag_set_icon_stock)
+  _WRAP_METHOD(void set_icon(const Glib::ustring& stock_id, int hot_x, int hot_y), gtk_drag_set_icon_stock, 
deprecated "Use set_icon_name() instead.")
 
   _WRAP_METHOD(void set_icon_name(const Glib::ustring& name, int hot_x, int hot_y), gtk_drag_set_icon_name)
   _WRAP_METHOD(void set_icon(), gtk_drag_set_icon_default)
diff --git a/gtk/gtkmm/stock.cc b/gtk/gtkmm/stock.cc
index 230f7a7..fde715c 100644
--- a/gtk/gtkmm/stock.cc
+++ b/gtk/gtkmm/stock.cc
@@ -1,4 +1,9 @@
 // -*- c++ -*-
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+
+#ifndef GTKMM_DISABLE_DEPRECATED // This whole file is deprecated.
+
 /* $Id$ */
 
 /* Copyright (C) 2002 The gtkmm Development Team
@@ -173,3 +178,4 @@ std::vector<Gtk::StockID> get_ids()
 
 } // namespace Gtk
 
+#endif // GTKMM_DISABLE_DEPRECATED
diff --git a/gtk/gtkmm/stock.h b/gtk/gtkmm/stock.h
index 1fab4b4..bbe6303 100644
--- a/gtk/gtkmm/stock.h
+++ b/gtk/gtkmm/stock.h
@@ -2,6 +2,8 @@
 #ifndef _GTKMM_STOCK_H
 #define _GTKMM_STOCK_H
 
+#ifndef GTKMM_DISABLE_DEPRECATED // This whole file is deprecated.
+
 /* $Id$ */
 
 /* Copyright (C) 2002 The gtkmm Development Team
@@ -44,6 +46,7 @@ namespace Gtk
 // const BuiltinStockID DIALOG_INFO = { GTK_STOCK_DIALOG_INFO }
 
 /** See the list of pre-defined stock items, in the Stock namespace.
+ * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
  */
 struct BuiltinStockID
 {
@@ -182,9 +185,9 @@ extern GTKMM_API const Gtk::BuiltinStockID ZOOM_IN;          /*!< @image html gt
 extern GTKMM_API const Gtk::BuiltinStockID ZOOM_OUT;         /*!< @image html gtk-zoom-out.png            */
 
 /** Add a stock item to the list of registered stock items.
- * @param item StockItem to register.
- * 
- * If an item already exists with the same stock ID the old item gets replaced. 
+ * @param item StockItem to register. If an item already exists with the same
+ *             stock ID the old item gets replaced. 
+ * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
  */
 void add(const Gtk::StockItem& item);
 
@@ -193,6 +196,7 @@ void add(const Gtk::StockItem& item);
   * @param item item to fill in case stockid was found.
   *
   * @return <tt>true</tt> if the item was found - <tt>false</tt> otherwise.
+  * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
   */
 bool lookup(const Gtk::StockID& stock_id, Gtk::StockItem& item);
 
@@ -201,6 +205,7 @@ bool lookup(const Gtk::StockID& stock_id, Gtk::StockItem& item);
   * @param iconset to fill.
   *
   * @return <tt>true</tt> if the item was found - <tt>false</tt> otherwise.
+  * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
   */
 bool lookup(const Gtk::StockID& stock_id, Glib::RefPtr<Gtk::IconSet>& iconset);
 
@@ -210,12 +215,14 @@ bool lookup(const Gtk::StockID& stock_id, Glib::RefPtr<Gtk::IconSet>& iconset);
   * @param image: Image to fill.
   *
   * @return <tt>true</tt> if the item was found - <tt>false</tt> otherwise
+  * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
   */  
 bool lookup(const Gtk::StockID& stock_id, Gtk::IconSize size, Gtk::Image& image);
 
 /** Retrieves a list of all known stock IDs added to an IconFactory or registered with Stock::add().
   *
   * @return list of all known stock IDs.
+  * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
   */
 std::vector<Gtk::StockID> get_ids();
 
@@ -223,6 +230,7 @@ std::vector<Gtk::StockID> get_ids();
 
 } // namespace Gtk
 
+#endif // GTKMM_DISABLE_DEPRECATED
 
 #endif /* _GTKMM_STOCK_H */
 
diff --git a/gtk/gtkmm/stockid.cc b/gtk/gtkmm/stockid.cc
index 1a76371..0b45ddc 100644
--- a/gtk/gtkmm/stockid.cc
+++ b/gtk/gtkmm/stockid.cc
@@ -1,4 +1,7 @@
 // -*- c++ -*-
+
+#ifndef GTKMM_DISABLE_DEPRECATED // This whole file is deprecated.
+
 /* $Id$ */
 
 /* stockid.cc
@@ -82,3 +85,5 @@ const char* StockID::get_c_str() const
 }
 
 } // namespace Gtk
+
+#endif // GTKMM_DISABLE_DEPRECATED
diff --git a/gtk/gtkmm/stockid.h b/gtk/gtkmm/stockid.h
index b2a5ec0..4d48079 100644
--- a/gtk/gtkmm/stockid.h
+++ b/gtk/gtkmm/stockid.h
@@ -2,6 +2,8 @@
 #ifndef _GTKMM_STOCKID_H
 #define _GTKMM_STOCKID_H
 
+#ifndef GTKMM_DISABLE_DEPRECATED // This whole file is deprecated.
+
 /* $Id$ */
 
 /* stockid.h
@@ -32,6 +34,7 @@ namespace Gtk
 struct BuiltinStockID;
 
 /** See also Gtk::BuiltinStockID.
+ * @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
  */
 class StockID
 {
@@ -106,11 +109,13 @@ protected:
   Glib::ustring id_;
 };
 
-/** @relates Gtk::StockID */
+/** @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
+ * @relates Gtk::StockID */
 inline bool operator==(const StockID& lhs, const StockID& rhs)
   { return lhs.equal(rhs); }
 
-/** @relates Gtk::StockID */
+/** @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
+ * @relates Gtk::StockID */
 inline bool operator!=(const StockID& lhs, const StockID& rhs)
   { return !lhs.equal(rhs); }
 
@@ -145,6 +150,6 @@ public:
 } // namespace Glib
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
+#endif // GTKMM_DISABLE_DEPRECATED
 
 #endif /* _GTKMM_STOCKID_H */
-
diff --git a/gtk/src/button.ccg b/gtk/src/button.ccg
index 5019b6e..8ae770e 100644
--- a/gtk/src/button.ccg
+++ b/gtk/src/button.ccg
@@ -28,10 +28,12 @@ Button::Button(const Glib::ustring& label, bool mnemonic)
   _CONSTRUCT("label", label.c_str(), "use_underline", gboolean(mnemonic))
 {}
 
+#ifndef GTKMM_DISABLE_DEPRECATED
 Button::Button(const StockID& stock_id)
 :
   _CONSTRUCT("use_stock", 1, "label", stock_id.get_c_str())
 {}
+#endif //GTKMM_DISABLE_DEPRECATED
 
 } // namespace Gtk
 
diff --git a/gtk/src/button.hg b/gtk/src/button.hg
index 2f2295a..7d74187 100644
--- a/gtk/src/button.hg
+++ b/gtk/src/button.hg
@@ -22,6 +22,10 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/bin_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
 
 namespace Gtk
 {
@@ -65,11 +69,14 @@ public:
    */
   explicit Button(const Glib::ustring& label, bool mnemonic = false);
 
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new Button containing the image and text from a stock item.
    * Stock ids have identifiers like Gtk::Stock::OK and Gtk::Stock::APPLY.
    * @param stock_id The stock item.
+   * @deprecated Use the constructor that takes a Glib::ustring instead.
    */
   explicit Button(const StockID& stock_id);
+#endif //GTKMM_DISABLE_DEPRECATED
 
   _WRAP_METHOD(void clicked(), gtk_button_clicked)
   _IGNORE(gtk_button_pressed, gtk_button_released, gtk_button_enter, gtk_button_leave) //deprecated
@@ -81,8 +88,8 @@ public:
   _WRAP_METHOD(Glib::ustring get_label() const, gtk_button_get_label)
   _WRAP_METHOD(void set_use_underline(bool use_underline = true), gtk_button_set_use_underline)
   _WRAP_METHOD(bool get_use_underline() const, gtk_button_get_use_underline)
-  _WRAP_METHOD(void set_use_stock(bool use_stock = true), gtk_button_set_use_stock)
-  _WRAP_METHOD(bool get_use_stock() const, gtk_button_get_use_stock)
+  _WRAP_METHOD(void set_use_stock(bool use_stock = true), gtk_button_set_use_stock, deprecated "No 
replacement available.")
+  _WRAP_METHOD(bool get_use_stock() const, gtk_button_get_use_stock, deprecated "No replacement available.")
 
   _WRAP_METHOD(void set_focus_on_click(bool focus_on_click = true), gtk_button_set_focus_on_click)
   _WRAP_METHOD(bool get_focus_on_click() const, gtk_button_get_focus_on_click)
@@ -113,7 +120,7 @@ public:
   _WRAP_PROPERTY("label", Glib::ustring)
   _WRAP_PROPERTY("relief", ReliefStyle)
   _WRAP_PROPERTY("use-underline", bool)
-  _WRAP_PROPERTY("use-stock", bool)
+  _WRAP_PROPERTY("use-stock", bool, deprecated "No replacement available.")
   _WRAP_PROPERTY("focus-on-click", bool)
   _WRAP_PROPERTY("xalign", float)
   _WRAP_PROPERTY("yalign", float)
diff --git a/gtk/src/cellrendererpixbuf.hg b/gtk/src/cellrendererpixbuf.hg
index f29ed72..94801f4 100644
--- a/gtk/src/cellrendererpixbuf.hg
+++ b/gtk/src/cellrendererpixbuf.hg
@@ -46,7 +46,7 @@ public:
   _WRAP_PROPERTY("pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
   _WRAP_PROPERTY("pixbuf_expander_open", Glib::RefPtr<Gdk::Pixbuf>)
   _WRAP_PROPERTY("pixbuf_expander_closed", Glib::RefPtr<Gdk::Pixbuf>)
-  _WRAP_PROPERTY("stock_id", Glib::ustring)
+  _WRAP_PROPERTY("stock_id", Glib::ustring, deprecated "Use property_icon_name() instead.")
   _WRAP_PROPERTY("stock_size", guint)
   _WRAP_PROPERTY("stock_detail", Glib::ustring)
   _WRAP_PROPERTY("icon-name", Glib::ustring)
diff --git a/gtk/src/dialog.hg b/gtk/src/dialog.hg
index e9b3ab3..37425c6 100644
--- a/gtk/src/dialog.hg
+++ b/gtk/src/dialog.hg
@@ -76,7 +76,7 @@ public:
 
   _WRAP_METHOD(void add_action_widget(Widget& child, int response_id), gtk_dialog_add_action_widget)
   _WRAP_METHOD(Button* add_button(const Glib::ustring& button_text, int response_id), gtk_dialog_add_button)
-  _WRAP_METHOD(Button* add_button(const Gtk::StockID& stock_id, int response_id), gtk_dialog_add_button)
+  _WRAP_METHOD(Button* add_button(const Gtk::StockID& stock_id, int response_id), gtk_dialog_add_button, 
deprecated "Use the add_button() that takes a Glib::ustring instead.")
   _WRAP_METHOD(void set_response_sensitive(int response_id, bool setting = true), 
gtk_dialog_set_response_sensitive)
   _WRAP_METHOD(void set_default_response(int response_id), gtk_dialog_set_default_response)
   _WRAP_METHOD(Widget* get_widget_for_response(int response_id), gtk_dialog_get_widget_for_response)
diff --git a/gtk/src/entry.ccg b/gtk/src/entry.ccg
index a199ea1..5e16185 100644
--- a/gtk/src/entry.ccg
+++ b/gtk/src/entry.ccg
@@ -27,11 +27,6 @@ void Entry::set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryI
   gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), Glib::unwrap(pixbuf));
 }
 
-void Entry::set_icon_from_stock(const StockID& stock_id, EntryIconPosition icon_pos)
-{
-  gtk_entry_set_icon_from_stock(gobj(), ((GtkEntryIconPosition)(icon_pos)), (stock_id).get_c_str());
-}
-
 void Entry::set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos)
 {
   gtk_entry_set_icon_from_icon_name(gobj(), ((GtkEntryIconPosition)(icon_pos)), icon_name.c_str());
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 711f96c..90110fc 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -135,14 +135,12 @@ public:
   _WRAP_METHOD(Glib::ustring get_placeholder_text() const, gtk_entry_get_placeholder_text)
   _WRAP_METHOD(void set_placeholder_text(const Glib::ustring& text), gtk_entry_set_placeholder_text)
 
-  //We hand-code these so we can change the parameter oder, so we can have a default parameter value:
+  //We hand-code these so we can change the parameter order, so we can have a default parameter value:
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_pixbuf)
   void set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos = 
ENTRY_ICON_PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_pixbuf)
 
-  _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_stock)
-  void set_icon_from_stock(const StockID& stock_id, EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY);
-  _IGNORE(gtk_entry_set_icon_from_stock)
+  _WRAP_METHOD(void set_icon_from_stock(const StockID& stock_id{.}, EntryIconPosition icon_pos{.} = 
ENTRY_ICON_PRIMARY), gtk_entry_set_icon_from_stock, deprecated "Use set_icon_from_icon_name() instead.")
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_icon_name)
   void set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos = 
ENTRY_ICON_PRIMARY);
@@ -165,7 +163,7 @@ public:
   _WRAP_METHOD(ImageType get_icon_storage_type(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const, 
gtk_entry_get_icon_storage_type)
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon_pixbuf(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY), 
gtk_entry_get_icon_pixbuf, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_icon_pixbuf(EntryIconPosition icon_pos = 
ENTRY_ICON_PRIMARY) const, gtk_entry_get_icon_pixbuf, refreturn, constversion)
-  _WRAP_METHOD(StockID get_icon_stock(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const, 
gtk_entry_get_icon_stock)
+  _WRAP_METHOD(StockID get_icon_stock(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const, 
gtk_entry_get_icon_stock, deprecated "Use get_icon_name() instead.")
   _WRAP_METHOD(Glib::ustring get_icon_name(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const, 
gtk_entry_get_icon_name)
   _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon_gicon(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY), 
gtk_entry_get_icon_gicon, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_icon_gicon(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) 
const, gtk_entry_get_icon_gicon, refreturn, constversion)
@@ -250,7 +248,7 @@ public:
   _WRAP_PROPERTY("max-length", int)
   _WRAP_PROPERTY("visibility", bool)
   _WRAP_PROPERTY("has-frame", bool)
-  _WRAP_PROPERTY("inner-border", Border)
+  _WRAP_PROPERTY("inner-border", Border, deprecated "Use the standard border and padding CSS properties 
(through objects like StyleContext and CssProvider); the value of this style property is ignored.")
   _WRAP_PROPERTY("invisible-char", gunichar)
   _WRAP_PROPERTY("invisible-char-set", bool)
   _WRAP_PROPERTY("activates-default", bool)
@@ -267,8 +265,8 @@ public:
   _WRAP_PROPERTY("progress-pulse-step", double)
   _WRAP_PROPERTY("primary-icon-pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
   _WRAP_PROPERTY("secondary-icon-pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
-  _WRAP_PROPERTY("primary-icon-stock", StockID)
-  _WRAP_PROPERTY("secondary-icon-stock", StockID)
+  _WRAP_PROPERTY("primary-icon-stock", StockID, deprecated "Use property_primary_icon_name() instead.")
+  _WRAP_PROPERTY("secondary-icon-stock", StockID, deprecated "Use property_secondary_icon_name() instead.")
   _WRAP_PROPERTY("primary-icon-name", Glib::ustring)
   _WRAP_PROPERTY("secondary-icon-name", Glib::ustring)
   _WRAP_PROPERTY("primary-icon-gicon", Glib::RefPtr<Gio::Icon>)
diff --git a/gtk/src/infobar.hg b/gtk/src/infobar.hg
index ea12150..3b79aac 100644
--- a/gtk/src/infobar.hg
+++ b/gtk/src/infobar.hg
@@ -67,7 +67,7 @@ public:
   _WRAP_METHOD(void add_action_widget(Widget& child, int response_id), gtk_info_bar_add_action_widget)
 
   _WRAP_METHOD(Button* add_button(const Glib::ustring& button_text, int response_id), 
gtk_info_bar_add_button)
-  _WRAP_METHOD(Button* add_button(const Gtk::StockID& stock_id, int response_id), gtk_info_bar_add_button)
+  _WRAP_METHOD(Button* add_button(const Gtk::StockID& stock_id, int response_id), gtk_info_bar_add_button, 
deprecated "Use the add_button() that takes a Glib::ustring instead.")
 
   _IGNORE(gtk_info_bar_add_buttons)
   _WRAP_METHOD(void set_response_sensitive(int response_id, bool setting = true), 
gtk_info_bar_set_response_sensitive)
diff --git a/gtk/src/menutoolbutton.ccg b/gtk/src/menutoolbutton.ccg
index e82c377..7d38c85 100644
--- a/gtk/src/menutoolbutton.ccg
+++ b/gtk/src/menutoolbutton.ccg
@@ -21,6 +21,16 @@
 namespace Gtk
 {
 
+#ifndef GTKMM_DISABLE_DEPRECATED
+MenuToolButton::MenuToolButton(const Gtk::StockID& stock_id)
+:
+  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+  Glib::ObjectBase(0),
+  Gtk::ToolButton(Glib::ConstructParams(menutoolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), 
static_cast<char*>(0)))
+{
+}
+#endif // GTKMM_DISABLE_DEPRECATED
+
 MenuToolButton::MenuToolButton(const Glib::ustring& label)
 :
   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc 
optimisations.
diff --git a/gtk/src/menutoolbutton.hg b/gtk/src/menutoolbutton.hg
index eff52e0..cfe3f02 100644
--- a/gtk/src/menutoolbutton.hg
+++ b/gtk/src/menutoolbutton.hg
@@ -41,13 +41,19 @@ public:
    */
   _CTOR_DEFAULT()
 
+  // _WRAP_CTOR does not take a 'deprecated' parameter.
+  // _WRAP_CTOR(MenuToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock)
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new MenuToolButton from a StockID.
    *
    * The MenuToolButton will be created according to the @a stock_id properties.
    *
    * @param stock_id The StockID which determines the look of the MenuToolButton.
+   * @deprecated Use one of the other constructors instead.
    */
-  _WRAP_CTOR(MenuToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock)
+   explicit MenuToolButton(const Gtk::StockID& stock_id);
+   _IGNORE(gtk_menu_tool_button_new_from_stock)
+#endif // GTKMM_DISABLE_DEPRECATED
 
   /** Creates a new MenuToolButton with a label.
    *
diff --git a/gtk/src/radiotoolbutton.ccg b/gtk/src/radiotoolbutton.ccg
index cd61954..51524fd 100644
--- a/gtk/src/radiotoolbutton.ccg
+++ b/gtk/src/radiotoolbutton.ccg
@@ -31,6 +31,7 @@ RadioToolButton::RadioToolButton(Group& group, const Glib::ustring& label)
   set_group(group);
 }
 
+#ifndef GTKMM_DISABLE_DEPRECATED
 RadioToolButton::RadioToolButton(Group& group, const Gtk::StockID& stock_id)
 :
   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc 
optimisations.
@@ -39,6 +40,7 @@ RadioToolButton::RadioToolButton(Group& group, const Gtk::StockID& stock_id)
   //Based on the source of gtk_radio_tool_button_new_from_stock():
   set_group(group);
 }
+#endif // GTKMM_DISABLE_DEPRECATED
 
 /* This would look too much like a copy constructor:
 RadioToolButton::RadioToolButton(RadioToolButton& group, const Gtk::StockID& stock_id)
diff --git a/gtk/src/radiotoolbutton.hg b/gtk/src/radiotoolbutton.hg
index e3d8623..cdd9b8f 100644
--- a/gtk/src/radiotoolbutton.hg
+++ b/gtk/src/radiotoolbutton.hg
@@ -62,6 +62,7 @@ public:
   explicit RadioToolButton(Group& group, const Glib::ustring& label = Glib::ustring());
   _IGNORE(gtk_radio_tool_button_new)
 
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new Gtk::RadioToolButton in an existing group.
    *
    * The RadioToolButton will be created according to the StockID properties and put into
@@ -71,9 +72,11 @@ public:
    * @param stock_id The StockID which determines the look of the RadioToolButton.
    *
    * @newin{2,4}
+   * @deprecated Use one of the other constructors instead.
    */
   RadioToolButton(Group& group, const Gtk::StockID& stock_id);
   _IGNORE(gtk_radio_tool_button_new_from_stock)
+#endif // GTKMM_DISABLE_DEPRECATED
 
   //This would look to much like a copy constructor:
   //People should use second.set_group(first.get_group()) instead.
diff --git a/gtk/src/statusicon.ccg b/gtk/src/statusicon.ccg
index 72e1a15..55afdad 100644
--- a/gtk/src/statusicon.ccg
+++ b/gtk/src/statusicon.ccg
@@ -21,6 +21,22 @@
 namespace Gtk
 {
 
+#ifndef GTKMM_DISABLE_DEPRECATED
+StatusIcon::StatusIcon(const StockID& stock)
+:
+  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+  Glib::ObjectBase(0),
+  Glib::Object(Glib::ConstructParams(statusicon_class_.init(), "stock", (stock).get_c_str(), 
static_cast<char*>(0)))
+{}
+#endif // GTKMM_DISABLE_DEPRECATED
+
+#ifndef GTKMM_DISABLE_DEPRECATED
+Glib::RefPtr<StatusIcon> StatusIcon::create(const StockID& stock_id)
+{
+  return Glib::RefPtr<StatusIcon>( new StatusIcon(stock_id) );
+}
+#endif // GTKMM_DISABLE_DEPRECATED
+
 Glib::RefPtr<StatusIcon> StatusIcon::create_from_file(const std::string& filename)
 {
   Glib::RefPtr<StatusIcon> status_icon( new StatusIcon() );
diff --git a/gtk/src/statusicon.hg b/gtk/src/statusicon.hg
index 16d0c71..8a048b2 100644
--- a/gtk/src/statusicon.hg
+++ b/gtk/src/statusicon.hg
@@ -20,6 +20,11 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 #include <gtkmm/image.h>
 #include <gtkmm/stockid.h>
 #include <gtkmm/menu.h>
@@ -54,7 +59,15 @@ protected:
   _CTOR_DEFAULT
   _IGNORE(gtk_status_icon_new)
   _WRAP_CTOR(StatusIcon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_status_icon_new_from_pixbuf)
-  _WRAP_CTOR(StatusIcon(const StockID& stock), gtk_status_icon_new_from_stock)
+
+  // _WRAP_CTOR does not take a 'deprecated' parameter.
+  // _WRAP_CTOR(StatusIcon(const StockID& stock), gtk_status_icon_new_from_stock)
+#ifndef GTKMM_DISABLE_DEPRECATED
+  /** @deprecated Use the constructor with the @a icon_name parameter instead.
+   */
+  explicit StatusIcon(const StockID& stock);
+#endif // GTKMM_DISABLE_DEPRECATED
+
   _WRAP_CTOR(StatusIcon(const Glib::ustring& icon_name), gtk_status_icon_new_from_icon_name)
   _WRAP_CTOR(StatusIcon(const Glib::RefPtr<const Gio::Icon>& icon), gtk_status_icon_new_from_gicon)
 
@@ -63,7 +76,15 @@ public:
    * @return A Glib::RefPtr<> to a newly created Gtk::StatusIcon object.
    */
   _WRAP_CREATE(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
-  _WRAP_CREATE(const StockID& stock_id)
+
+  // _WRAP_CREATE does not take a 'deprecated' parameter.
+  // _WRAP_CREATE(const StockID& stock_id)
+#ifndef GTKMM_DISABLE_DEPRECATED
+  /** @deprecated Use create() with the @a icon_name parameter instead.
+   */
+  static Glib::RefPtr<StatusIcon> create(const StockID& stock_id);
+#endif // GTKMM_DISABLE_DEPRECATED
+
   _WRAP_CREATE(const Glib::ustring& icon_name)
 
  /** Creates a status icon displaying the file @a filename.
@@ -80,7 +101,7 @@ public:
 
   _WRAP_METHOD(void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_status_icon_set_from_pixbuf)
   _WRAP_METHOD(void set_from_file(const Glib::ustring& filename), gtk_status_icon_set_from_file)
-  _WRAP_METHOD(void set(const StockID& stock_id), gtk_status_icon_set_from_stock)
+  _WRAP_METHOD(void set(const StockID& stock_id), gtk_status_icon_set_from_stock, deprecated "Use the set() 
with the @a icon_name parameter instead.")
   _WRAP_METHOD(void set(const Glib::ustring& icon_name), gtk_status_icon_set_from_icon_name)
   _WRAP_METHOD(void set(const Glib::RefPtr<const Gio::Icon>& icon), gtk_status_icon_set_from_gicon)
 
@@ -89,7 +110,7 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf(), gtk_status_icon_get_pixbuf)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const, gtk_status_icon_get_pixbuf, constversion)
 
-  _WRAP_METHOD(StockID get_stock() const, gtk_status_icon_get_stock)
+  _WRAP_METHOD(StockID get_stock() const, gtk_status_icon_get_stock, deprecated "Use the get_icon_name() 
instead.")
   _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_status_icon_get_icon_name)
 
   _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon(), gtk_status_icon_get_gicon, refreturn)
@@ -165,7 +186,7 @@ public:
 
   _WRAP_PROPERTY("pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
   _WRAP_PROPERTY("file", std::string)
-  _WRAP_PROPERTY("stock", StockID)
+  _WRAP_PROPERTY("stock", StockID, deprecated "Use property_icon_name() instead.")
   _WRAP_PROPERTY("icon-name", Glib::ustring)
   _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
   _WRAP_PROPERTY("storage-type", ImageType)
diff --git a/gtk/src/stockitem.hg b/gtk/src/stockitem.hg
index 5481964..f271ed9 100644
--- a/gtk/src/stockitem.hg
+++ b/gtk/src/stockitem.hg
@@ -20,6 +20,13 @@
 
 _DEFS(gtkmm,gtk)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+_IS_DEPRECATED // This whole file is deprecated.
+
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 extern "C"
 {
@@ -30,6 +37,8 @@ extern "C"
 namespace Gtk
 {
 
+/** @deprecated Use icon names instead of StockItem, StockID and BuiltinStockID.
+ */
 class StockItem
 {
   _CLASS_OPAQUE_COPYABLE(StockItem, GtkStockItem, NONE, gtk_stock_item_copy, gtk_stock_item_free)
diff --git a/gtk/src/togglebutton.ccg b/gtk/src/togglebutton.ccg
index 81dd08a..7a542f4 100644
--- a/gtk/src/togglebutton.ccg
+++ b/gtk/src/togglebutton.ccg
@@ -26,10 +26,11 @@ ToggleButton::ToggleButton(const Glib::ustring& label, bool mnemonic)
   _CONSTRUCT("label", label.c_str(), "use_underline", gboolean(mnemonic))
 {}
 
+#ifndef GTKMM_DISABLE_DEPRECATED
 ToggleButton::ToggleButton(const StockID& stock_id)
 :
   _CONSTRUCT("use_stock", 1, "label", stock_id.get_c_str())
 {}
+#endif // GTKMM_DISABLE_DEPRECATED
 
 } // namespace Gtk
-
diff --git a/gtk/src/togglebutton.hg b/gtk/src/togglebutton.hg
index 3718dc0..eacec38 100644
--- a/gtk/src/togglebutton.hg
+++ b/gtk/src/togglebutton.hg
@@ -50,11 +50,14 @@ public:
    */
   explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);
 
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a toggle button containing the image and text from a stock item.
    * Stock ids have identifiers like Gtk::Stock::OK and Gtk::Stock::APPLY.
    * @param stock_id The stock item.
+   * @deprecated Use the constructor that takes a Glib::ustring instead.
    */
   explicit ToggleButton(const StockID& stock_id);
+#endif // GTKMM_DISABLE_DEPRECATED
 
   _WRAP_METHOD(void set_mode(bool draw_indicator = true),gtk_toggle_button_set_mode)
   _WRAP_METHOD(bool get_mode() const,gtk_toggle_button_get_mode)
diff --git a/gtk/src/toggletoolbutton.ccg b/gtk/src/toggletoolbutton.ccg
index db4a458..024868e 100644
--- a/gtk/src/toggletoolbutton.ccg
+++ b/gtk/src/toggletoolbutton.ccg
@@ -21,6 +21,16 @@
 namespace Gtk
 {
 
+#ifndef GTKMM_DISABLE_DEPRECATED
+ToggleToolButton::ToggleToolButton(const Gtk::StockID& stock_id)
+:
+  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+  Glib::ObjectBase(0),
+  Gtk::ToolButton(Glib::ConstructParams(toggletoolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), 
static_cast<char*>(0)))
+{
+}
+#endif // GTKMM_DISABLE_DEPRECATED
+
 ToggleToolButton::ToggleToolButton(const Glib::ustring& label)
 :
   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc 
optimisations.
diff --git a/gtk/src/toggletoolbutton.hg b/gtk/src/toggletoolbutton.hg
index 934a50c..89b7814 100644
--- a/gtk/src/toggletoolbutton.hg
+++ b/gtk/src/toggletoolbutton.hg
@@ -42,13 +42,19 @@ public:
    */
   _CTOR_DEFAULT()
 
+  // _WRAP_CTOR does not take a 'deprecated' parameter.
+  // _WRAP_CTOR(ToggleToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock)
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new ToggleToolButton from a StockID.
    *
    * The ToggleToolButton will be created according to the @a stock_id properties.
    *
    * @param stock_id The StockID which determines the look of the ToggleToolButton.
+   * @deprecated Use one of the other constructors instead.
    */
-  _WRAP_CTOR(ToggleToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock)
+  explicit ToggleToolButton(const Gtk::StockID& stock_id);
+  _IGNORE(gtk_toggle_tool_button_new_from_stock)
+#endif // GTKMM_DISABLE_DEPRECATED
 
   /** Creates a new ToggleToolButton with a label.
    *
diff --git a/gtk/src/toolbutton.ccg b/gtk/src/toolbutton.ccg
index 09d32ee..791600e 100644
--- a/gtk/src/toolbutton.ccg
+++ b/gtk/src/toolbutton.ccg
@@ -20,6 +20,14 @@
 
 namespace Gtk
 {
+#ifndef GTKMM_DISABLE_DEPRECATED
+ToolButton::ToolButton(const Gtk::StockID& stock_id)
+:
+  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+  Glib::ObjectBase(0),
+  Gtk::ToolItem(Glib::ConstructParams(toolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), 
static_cast<char*>(0)))
+{}
+#endif // GTKMM_DISABLE_DEPRECATED
 
 ToolButton::ToolButton(const Glib::ustring& label)
 :
diff --git a/gtk/src/toolbutton.hg b/gtk/src/toolbutton.hg
index 15a325d..e2f4e0c 100644
--- a/gtk/src/toolbutton.hg
+++ b/gtk/src/toolbutton.hg
@@ -20,6 +20,11 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/toolitem_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gtk
 {
 
@@ -37,13 +42,19 @@ public:
    */
   _CTOR_DEFAULT()
 
+  // _WRAP_CTOR does not take a 'deprecated' parameter.
+  // _WRAP_CTOR(ToolButton(const Gtk::StockID& stock_id), gtk_tool_button_new_from_stock)
+#ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new ToolButton from a StockID.
    *
    * The ToolButton will be created according to the @a stock_id properties.
    *
    * @param stock_id The StockID which determines the look of the ToolButton.
+   * @deprecated Use the constructor with @a icon_widget and @a label parameters instead.
    */
-  _WRAP_CTOR(ToolButton(const Gtk::StockID& stock_id), gtk_tool_button_new_from_stock)
+   explicit ToolButton(const Gtk::StockID& stock_id);
+   _IGNORE(gtk_tool_button_new_from_stock)
+#endif // GTKMM_DISABLE_DEPRECATED
 
   /** Creates a new ToolButton with a label.
    *
@@ -66,8 +77,8 @@ public:
   _WRAP_METHOD(Glib::ustring get_label() const, gtk_tool_button_get_label)
   _WRAP_METHOD(void set_use_underline(bool use_underline = true), gtk_tool_button_set_use_underline)
   _WRAP_METHOD(bool get_use_underline() const, gtk_tool_button_get_use_underline)
-  _WRAP_METHOD(void set_stock_id(const Gtk::StockID& stock_id), gtk_tool_button_set_stock_id)
-  _WRAP_METHOD(Glib::ustring get_stock_id() const, gtk_tool_button_get_stock_id)
+  _WRAP_METHOD(void set_stock_id(const Gtk::StockID& stock_id), gtk_tool_button_set_stock_id, deprecated 
"Use set_icon_name() instead.")
+  _WRAP_METHOD(Glib::ustring get_stock_id() const, gtk_tool_button_get_stock_id, deprecated "Use 
get_icon_name() instead.")
   _WRAP_METHOD(void set_icon_name(const Glib::ustring& icon_name), gtk_tool_button_set_icon_name)
   _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_tool_button_get_icon_name)
   _WRAP_METHOD(void set_icon_widget(Widget& icon_widget), gtk_tool_button_set_icon_widget)
@@ -83,7 +94,7 @@ public:
   _WRAP_PROPERTY("label", Glib::ustring)
   _WRAP_PROPERTY("use_underline", bool)
   _WRAP_PROPERTY("label_widget", Gtk::Widget*)
-  _WRAP_PROPERTY("stock_id", Glib::ustring)
+  _WRAP_PROPERTY("stock_id", Glib::ustring, deprecated "Use property_icon_name() instead.")
   _WRAP_PROPERTY("icon_name", Glib::ustring)
   _WRAP_PROPERTY("icon_widget", Gtk::Widget)
 };
diff --git a/gtk/src/tooltip.hg b/gtk/src/tooltip.hg
index ed3f15c..dc231df 100644
--- a/gtk/src/tooltip.hg
+++ b/gtk/src/tooltip.hg
@@ -24,6 +24,11 @@
 _DEFS(gtkmm,gtk)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gtk
 {
 
@@ -93,7 +98,7 @@ public:
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gio::Icon>& gicon, IconSize size), 
gtk_tooltip_set_icon_from_gicon)
 
   //TODO: Remove the _from_*() suffixes?
-  _WRAP_METHOD(void set_icon_from_stock(const StockID& stock_id, IconSize size), 
gtk_tooltip_set_icon_from_stock)
+  _WRAP_METHOD(void set_icon_from_stock(const StockID& stock_id, IconSize size), 
gtk_tooltip_set_icon_from_stock, deprecated "Use set_icon_from_icon_name() instead.")
   _WRAP_METHOD(void set_icon_from_icon_name(const Glib::ustring& icon_name, IconSize size), 
gtk_tooltip_set_icon_from_icon_name)
 
   /** Hide the image.


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