[glibmm] Action, ActionGroup: Wrap virtual functions.
- From: Josà Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Action, ActionGroup: Wrap virtual functions.
- Date: Thu, 22 Sep 2011 21:12:03 +0000 (UTC)
commit 450b1b76756d64954cbcce92bb367f8f194c4f72
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date: Thu Sep 22 15:57:18 2011 -0400
Action, ActionGroup: Wrap virtual functions.
* gio/src/gio_vfuncs.defs: Add virtual function definitions for the
Action and ActionGroup classes.
* gio/src/action.hg:
* gio/src/actiongroup.hg: Wrap the virtual functions.
* tools/m4/convert_gio.m4: Correct a VariantType return conversion.
ChangeLog | 10 ++++
gio/src/action.hg | 19 +++++++-
gio/src/actiongroup.hg | 18 +++++++-
gio/src/gio_vfuncs.defs | 121 +++++++++++++++++++++++++++++++++++++++++++++++
tools/m4/convert_gio.m4 | 2 +-
5 files changed, 167 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 669ed05..6630614 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2011-09-22 Josà Alburquerque <jaalburqu svn gnome org>
+ Action, ActionGroup: Wrap virtual functions.
+
+ * gio/src/gio_vfuncs.defs: Add virtual function definitions for the
+ Action and ActionGroup classes.
+ * gio/src/action.hg:
+ * gio/src/actiongroup.hg: Wrap the virtual functions.
+ * tools/m4/convert_gio.m4: Correct a VariantType return conversion.
+
+2011-09-22 Josà Alburquerque <jaalburqu svn gnome org>
+
giomm: Add SimpleActionGroup.
* gio/src/simpleactiongroup.{ccg,hg}:
diff --git a/gio/src/action.hg b/gio/src/action.hg
index e8d9e4d..3d92bfe 100644
--- a/gio/src/action.hg
+++ b/gio/src/action.hg
@@ -83,7 +83,24 @@ public:
_WRAP_PROPERTY("state", Glib::VariantBase)
_WRAP_PROPERTY("state-type", Glib::VariantType)
-//TODO: Wrap virtual functions.
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
+ _WRAP_VFUNC(Glib::ustring get_name() const, "get_name")
+
+#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()')
+ _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type")
+ _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type")
+
+#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()')
+
+ _WRAP_VFUNC(Glib::VariantBase get_state_hint() const, "get_state_hint")
+
+ _WRAP_VFUNC(bool get_enabled() const, "get_enabled")
+
+ _WRAP_VFUNC(Glib::VariantBase get_state() const, "get_state")
+
+#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)')
+ _WRAP_VFUNC(void change_state(const Glib::VariantBase& value), "change_state")
+ _WRAP_VFUNC(void activate(const Glib::VariantBase& parameter), "activate")
};
} // namespace Gio
diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg
index 0e68500..c385309 100644
--- a/gio/src/actiongroup.hg
+++ b/gio/src/actiongroup.hg
@@ -78,7 +78,23 @@ public:
#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
_WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed")
-//TODO: Wrap virtual functions.
+ _WRAP_VFUNC(bool has_action(const Glib::ustring& name) const, "has_action")
+
+#m4 _CONVERSION(`std::vector<Glib::ustring>',`gchar**',`const_cast<gchar**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+ _WRAP_VFUNC(std::vector<Glib::ustring> list_actions() const, "list_actions")
+
+ _WRAP_VFUNC(bool get_action_enabled(const Glib::ustring& name) const, "get_action_enabled")
+
+#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()')
+ _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, "get_action_parameter_type")
+ _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, "get_action_state_type")
+
+#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()')
+ _WRAP_VFUNC(Glib::VariantBase get_action_state_hint(const Glib::ustring& name) const, "get_action_state_hint")
+ _WRAP_VFUNC(Glib::VariantBase get_action_state(const Glib::ustring& name) const, "get_action_state")
+
+ _WRAP_VFUNC(void change_action_state(const Glib::ustring& name, const Glib::VariantBase& value), "change_action_state")
+ _WRAP_VFUNC(void activate_action(const Glib::ustring& name, const Glib::VariantBase& parameter), "activate_action")
};
} // namespace Gio
diff --git a/gio/src/gio_vfuncs.defs b/gio/src/gio_vfuncs.defs
index 65da5a1..86228b3 100644
--- a/gio/src/gio_vfuncs.defs
+++ b/gio/src/gio_vfuncs.defs
@@ -3,6 +3,127 @@
; define-vfunc is g*mm-specific
; These are hand-written.
+; GAction
+
+(define-vfunc get_name
+ (of-object "GAction")
+ (return-type "const-gchar*")
+)
+
+(define-vfunc get_parameter_type
+ (of-object "GAction")
+ (return-type "const-GVariantType*")
+)
+
+(define-vfunc get_state_type
+ (of-object "GAction")
+ (return-type "const-GVariantType*")
+)
+
+(define-vfunc get_state_hint
+ (of-object "GAction")
+ (return-type "GVariant*")
+)
+
+(define-vfunc get_enabled
+ (of-object "GAction")
+ (return-type "gboolean")
+)
+
+(define-vfunc get_state
+ (of-object "GAction")
+ (return-type "GVariant*")
+)
+
+(define-vfunc change_state
+ (of-object "GAction")
+ (return-type "void")
+ (parameters
+ '("GVariant*" "value")
+ )
+)
+
+(define-vfunc activate
+ (of-object "GAction")
+ (return-type "void")
+ (parameters
+ '("GVariant*" "parameter")
+ )
+)
+
+; GActionGroup
+
+(define-vfunc has_action
+ (of-object "GActionGroup")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc list_actions
+ (of-object "GActionGroup")
+ (return-type "gchar**")
+)
+
+(define-vfunc get_action_enabled
+ (of-object "GActionGroup")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc get_action_parameter_type
+ (of-object "GActionGroup")
+ (return-type "const-GVariantType*")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc get_action_state_type
+ (of-object "GActionGroup")
+ (return-type "const-GVariantType*")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc get_action_state_hint
+ (of-object "GActionGroup")
+ (return-type "GVariant*")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc get_action_state
+ (of-object "GActionGroup")
+ (return-type "GVariant*")
+ (parameters
+ '("const-gchar*" "action_name")
+ )
+)
+
+(define-vfunc change_action_state
+ (of-object "GActionGroup")
+ (return-type "void")
+ (parameters
+ '("const-gchar*" "action_name")
+ '("GVariant*" "value")
+ )
+)
+
+(define-vfunc activate_action
+ (of-object "GActionGroup")
+ (return-type "void")
+ (parameters
+ '("const-gchar*" "action_name")
+ '("GVariant*" "parameter")
+ )
+)
+
; GApplication
(define-vfunc local_command_line
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 77e74fb..a585f93 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -225,7 +225,7 @@ _CONVERSION(`const Glib::VariantBase&',`GVariant*',`const_cast<GVariant*>(($3).g
_CONVERSION(`const Glib::VariantContainerBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
#VariantType
-_CONVERSION(`const GVariantType*',`Glib::VariantType',`Glib::wrap(const_cast<GVariantType*>($3), true)')
+_CONVERSION(`const GVariantType*',`Glib::VariantType',`Glib::wrap(const_cast<GVariantType*>($3), false)')
#Volume
_CONVERSION(`GVolume*',`Glib::RefPtr<Volume>',`Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]