[glibmm] giomm: DBus Introspection Data Classes: Add const methods.



commit 8a99a56a5e00f0fa7b497793b2c69d5d278b0880
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Thu Sep 9 16:46:23 2010 -0400

    	giomm: DBus Introspection Data Classes: Add const methods.
    
    	* gio/src/dbusintrospection.hg: Add const methods returning
    	DBusMethodInfo, DBusSignalInfo, DBusPropertyInfo and DBusInterfaceInfo
    	classes to the DBusInterfaceInfo and DBusNodeInfo classes.
    	* gio/src/dbusmethodinvocation.hg (get_method_info): Remove the
    	non-const verrsion of this method because the C API only has a version
    	returning a const GDBusMethodInfo.
    	* tools/m4/convert_gio.m4: Move the conversion
    	DBusMethodInvocation::get_method_info() over to the local .hg file
    	because it is specific to that method.

 ChangeLog                       |   14 ++++++++++++++
 gio/src/dbusintrospection.hg    |    6 ++++++
 gio/src/dbusmethodinvocation.hg |    5 +++--
 tools/m4/convert_gio.m4         |    1 -
 4 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 444cab4..2d1dae9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-09  José Alburquerque  <jaalburqu svn gnome org>
+
+	giomm: DBus Introspection Data Classes: Add const methods.
+
+	* gio/src/dbusintrospection.hg: Add const methods returning
+	DBusMethodInfo, DBusSignalInfo, DBusPropertyInfo and DBusInterfaceInfo
+	classes to the DBusInterfaceInfo and DBusNodeInfo classes.
+	* gio/src/dbusmethodinvocation.hg (get_method_info): Remove the
+	non-const verrsion of this method because the C API only has a version
+	returning a const GDBusMethodInfo.
+	* tools/m4/convert_gio.m4: Move the conversion
+	DBusMethodInvocation::get_method_info() over to the local .hg file
+	because it is specific to that method. 
+
 2010-09-07  José Alburquerque  <jaalburqu svn gnome org>
 
 	giomm: DBusProxy: Correct the use of the DBusInterfaceInfo class.
diff --git a/gio/src/dbusintrospection.hg b/gio/src/dbusintrospection.hg
index 2ad85f3..075a1fc 100644
--- a/gio/src/dbusintrospection.hg
+++ b/gio/src/dbusintrospection.hg
@@ -95,8 +95,13 @@ class DBusInterfaceInfo
 
 public:
   _WRAP_METHOD(Glib::RefPtr<DBusMethodInfo> lookup_method(const Glib::ustring& name), g_dbus_interface_info_lookup_method)
+  _WRAP_METHOD(Glib::RefPtr<const DBusMethodInfo> lookup_method(const Glib::ustring& name) const, g_dbus_interface_info_lookup_method, constversion)
+
   _WRAP_METHOD(Glib::RefPtr<DBusSignalInfo> lookup_signal(const Glib::ustring& name), g_dbus_interface_info_lookup_signal)
+  _WRAP_METHOD(Glib::RefPtr<const DBusSignalInfo> lookup_signal(const Glib::ustring& name) const, g_dbus_interface_info_lookup_signal, constversion)
+
   _WRAP_METHOD(Glib::RefPtr<DBusPropertyInfo> lookup_property(const Glib::ustring& name), g_dbus_interface_info_lookup_property)
+  _WRAP_METHOD(Glib::RefPtr<const DBusPropertyInfo> lookup_property(const Glib::ustring& name) const, g_dbus_interface_info_lookup_property, constversion)
 
   //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_interface_info_generate_xml)
 };
@@ -116,6 +121,7 @@ public:
   _WRAP_METHOD(static Glib::RefPtr<DBusNodeInfo> new_for_xml(const Glib::ustring& xml_data), g_dbus_node_info_new_for_xml, errthrow)
 
   _WRAP_METHOD(Glib::RefPtr<DBusInterfaceInfo> lookup_interface(const Glib::ustring& name), g_dbus_node_info_lookup_interface)
+  _WRAP_METHOD(Glib::RefPtr<const DBusInterfaceInfo> lookup_interface(const Glib::ustring& name) const, g_dbus_node_info_lookup_interface, constversion)
 
   //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_node_info_generate_xml)
 };
diff --git a/gio/src/dbusmethodinvocation.hg b/gio/src/dbusmethodinvocation.hg
index 957f655..f6fb6f2 100644
--- a/gio/src/dbusmethodinvocation.hg
+++ b/gio/src/dbusmethodinvocation.hg
@@ -54,8 +54,9 @@ public:
   _WRAP_METHOD(Glib::ustring get_interface_name() const, g_dbus_method_invocation_get_interface_name)
   _WRAP_METHOD(Glib::ustring get_method_name() const, g_dbus_method_invocation_get_method_name)
 
-  _WRAP_METHOD(Glib::RefPtr<DBusMethodInfo> get_method_info(), g_dbus_method_invocation_get_method_info)
-  _WRAP_METHOD(Glib::RefPtr<const DBusMethodInfo> get_method_info() const, g_dbus_method_invocation_get_method_info, constversion)
+#m4 _CONVERSION(`const GDBusMethodInfo*', `Glib::RefPtr<const DBusMethodInfo>', `Glib::wrap(const_cast<GDBusMethodInfo*>($3))')
+  // The C API only returns a const GDBusMethodInfo.
+  _WRAP_METHOD(Glib::RefPtr<const DBusMethodInfo> get_method_info() const, g_dbus_method_invocation_get_method_info)
 
   _WRAP_METHOD(Glib::RefPtr<DBusConnection> get_connection(), g_dbus_method_invocation_get_connection)
   _WRAP_METHOD(Glib::RefPtr<const DBusConnection> get_connection() const, g_dbus_method_invocation_get_connection, constversion)
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index c3b411d..2550764 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -80,7 +80,6 @@ _CONVERSION(`GDBusNodeInfo*',`Glib::RefPtr<DBusNodeInfo>',`Glib::wrap($3)')
 _CONVERSION(`GDBusInterfaceInfo*',`Glib::RefPtr<DBusInterfaceInfo>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<DBusInterfaceInfo>&',`GDBusInterfaceInfo*',`Glib::unwrap($3)')
 _CONVERSION(`GDBusInterfaceInfo*',`const Glib::RefPtr<DBusInterfaceInfo>',`Glib::wrap($3)')
-_CONVERSION(`const GDBusMethodInfo*', `Glib::RefPtr<DBusMethodInfo>', `Glib::wrap(const_cast<GDBusMethodInfo*>($3))')
 
 # DBusProxy
 _CONVERSION(`GDBusProxy*',`Glib::RefPtr<DBusProxy>',`Glib::wrap($3)')



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