[glibmm] MenuItem: Add the get_attribute_value() methods.



commit 9bd0060a97dbbe2f645c1536944df27ecd7ddb6a
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Wed Oct 3 20:36:51 2012 -0400

    MenuItem: Add the get_attribute_value() methods.
    
    	* gio/src/menuitem.hg: Add the methods (const and non-const versions)
    	and overloads without the VariantType parameter which can be null,
    	wrapping the g_menu_item_get_attribute_value() function.
    	(MenuItem): Add an overload for the "label" and "submenu" constructor
    	without the label parameter which can be null.
    	(create): Do the same for the create() method of the constructor
    	above.
    	* gio/src/menumodel.hg: Add an _IGNORE (completing a TODO).

 ChangeLog            |   13 +++++++++++++
 gio/src/menuitem.hg  |   16 +++++++++++++---
 gio/src/menumodel.hg |    3 ++-
 3 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 272797e..b9cbfa6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2012-10-03  Josà Alburquerque  <jaalburquerque gmail com>
 
+	MenuItem: Add the get_attribute_value() methods.
+
+	* gio/src/menuitem.hg: Add the methods (const and non-const versions)
+	and overloads without the VariantType parameter which can be null,
+	wrapping the g_menu_item_get_attribute_value() function.
+	(MenuItem): Add an overload for the "label" and "submenu" constructor
+	without the label parameter which can be null.
+	(create): Do the same for the create() method of the constructor
+	above.
+	* gio/src/menumodel.hg: Add an _IGNORE (completing a TODO).
+
+2012-10-03  Josà Alburquerque  <jaalburquerque gmail com>
+
 	IOStream: Add the splice_async() and splice_finish() methods.
 
 	* gio/src/iostream.{ccg,hg}: Add cancellable and non-cancellable
diff --git a/gio/src/menuitem.hg b/gio/src/menuitem.hg
index e5bbf70..04a1a32 100644
--- a/gio/src/menuitem.hg
+++ b/gio/src/menuitem.hg
@@ -35,19 +35,20 @@ class MenuItem : public Glib::Object
 protected:
   _WRAP_CTOR(MenuItem(const Glib::ustring& label = Glib::ustring(), const Glib::ustring& detailed_action = Glib::ustring()), g_menu_item_new)
 
-  //TODO: label can be empty, so reorder these parameters?
-  _WRAP_CTOR(MenuItem(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu), g_menu_item_new_submenu)
+  _WRAP_CTOR(MenuItem(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& submenu), g_menu_item_new_submenu)
 
 public:
   _WRAP_CREATE(const Glib::ustring& label, const Glib::ustring& detailed_action)
 
-  _WRAP_CREATE(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu)
+  _WRAP_CREATE(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& submenu)
 
             
 
 //TODO: GMenuItem * g_menu_item_new_section                 (const Glib::ustring& label,
 //                                                     const Glib::RefPtr<MenuModel>& section);
 
+  //TODO: Maybe this method should just be called set_attribute?  That would
+  //probably require an API/ABI break.
   _WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value)
   _IGNORE(g_menu_item_set_attribute)
 
@@ -58,6 +59,15 @@ public:
   _WRAP_METHOD(void set_label(const Glib::ustring& label), g_menu_item_set_label)
   _WRAP_METHOD(void set_submenu(const Glib::RefPtr<MenuModel>& submenu), g_menu_item_set_submenu)
   _WRAP_METHOD(void set_section(const Glib::RefPtr<MenuModel>& section), g_menu_item_set_section)
+
+  //TODO: Maybe these methods should just be called get_attribute() (they are
+  //called get_attribute_value() for consistency with the already existing
+  //set_attribute_value() method above.
+  _WRAP_METHOD(Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}), g_menu_item_get_attribute_value)
+  _WRAP_METHOD(const Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value, constversion)
+
+  // Ignore varargs function.
+  _IGNORE(g_menu_item_get_attribute)
  
   //TODO: Documentation:
   void set_action_and_target(const Glib::ustring& action);
diff --git a/gio/src/menumodel.hg b/gio/src/menumodel.hg
index 9a3e5a5..155c2fe 100644
--- a/gio/src/menumodel.hg
+++ b/gio/src/menumodel.hg
@@ -136,7 +136,8 @@ dnl See the .ccg implementation for how this conversion works.
   _WRAP_METHOD(Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type), g_menu_model_get_item_attribute_value)
   _WRAP_METHOD(const Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type) const, g_menu_model_get_item_attribute_value, constversion)
 
-  //TODO?: _WRAP_METHOD(bool get_item_attribute(int item_index, MenuAttribute attribute, const Glib::ustring& format_string, ...), g_menu_model_get_item_attribute)
+  // Ignore varargs function
+  _IGNORE(g_menu_model_get_item_attribute)
 
 #m4begin
 dnl See the .ccg implementation for how this conversion works.



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