[glibmm] Gio::MenuItem: get/set_attribute(): Deprecated for *_value() methods.



commit df08c661786bacf45e7ff10d45d728f807b64ecb
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Sep 27 12:06:18 2013 +0200

    Gio::MenuItem: get/set_attribute(): Deprecated for *_value() methods.
    
    * gio/src/menuitem.hg: set_attribute(): Deprecate this in favour of
      set_attribute_value() though it was previously the other way around.
      Add get_attribute_value() and deprecate get_attribute() in favour
      of it.
      This lets us, one day, remove those set_attribute() and
      get_attribute() methods and replace them with more pleaseant
      templated set/get_attribute() methods that just call the
      *_value() methods, as in Gio::Action.

 gio/src/menuitem.hg |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gio/src/menuitem.hg b/gio/src/menuitem.hg
index e762b17..dae752b 100644
--- a/gio/src/menuitem.hg
+++ b/gio/src/menuitem.hg
@@ -71,10 +71,12 @@ GMenuItem * g_menu_item_new_section                 (const Glib::ustring& label,
 //                                                     const Glib::RefPtr<MenuModel>& section);
 
   //TODO: Add a set_attribute() templated method to get values directly instead
-  //of requiring a Glib::VariantBase?
+  //of requiring a Glib::VariantBase, when we can break ABI:
+  //template <typename T_Value>
+  //void set_attribute(const Glib::ustring& attribute, const T_Value& value) const;
 
-  _WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), 
g_menu_item_set_attribute_value, deprecated "Use set_attribute() instead.")
-  _WRAP_METHOD(void set_attribute(const Glib::ustring& attribute, const Glib::VariantBase& value), 
g_menu_item_set_attribute_value)
+  _WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), 
g_menu_item_set_attribute_value)
+  _WRAP_METHOD(void set_attribute(const Glib::ustring& attribute, const Glib::VariantBase& value), 
g_menu_item_set_attribute_value, deprecated "Use set_attribute() instead.")
   _IGNORE(g_menu_item_set_attribute)
 
 //These are documented as transfer-full, so we don't need to use refreturn.
@@ -87,9 +89,13 @@ GMenuItem * g_menu_item_new_section                 (const Glib::ustring& label,
   _WRAP_METHOD(void set_section(const Glib::RefPtr<MenuModel>& section), g_menu_item_set_section)
 
   //TODO: Add a get_attribute() templated method to get values directly instead
-  //of returning a Glib::VariantBase?
- 
-  _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& 
expected_type{?}) const, g_menu_item_get_attribute_value)
+  //of returning a Glib::VariantBase, when we can break ABI.
+  //template <typename T_Value>
+  //void get_attribute(const Glib::ustring& attribute, T_Value& value) const;
+  //_WRAP_METHOD(Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const 
Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
+
+  _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& 
expected_type{?}) const, g_menu_item_get_attribute_value, deprecated "Use get_attribute_value() instead.")
+  _WRAP_METHOD(Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const 
Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
 
   // Ignore varargs function.
   _IGNORE(g_menu_item_get_attribute)


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