From b0002eb697ec4b1e35846b51d9e6e1a7824e0b03 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Tue, 25 Jan 2005 19:47:13 +0000 Subject: 2005-01-25 Joe Shaw * Land the mono binding changes to conform to the new APIs. * mono/Makefile.am: Remove Custom.cs, DBusType/Custom.cs, DBusType/Dict.cs, and DBusType/Nil.cs from the build. * mono/Arguments.cs (GetCodeAsString): Added. Returns the dbus type code as a string. (InitAppending): Rename dbus_message_append_iter_init() to dbus_message_iter_init_append(). * mono/BusDriver.cs: Rename ServiceEventHandler to NameOwnerChangedHandler. Rename GetServiceOwner to GetOwner. Rename ServiceOwnerChanged to NameOwnerChanged. * mono/Connection.cs: Rename BaseService to UniqueName, and the underlying C call. * mono/Custom.cs: Removed. The CUSTOM type has been removed. * mono/Service.cs: Rename Exists to HasOwner, internally rename dbus_bus_acquire_service() to dbus_bus_request_name(). * mono/DBusType/Array.cs (ctor): Use Type.GetElementType() instead of Type.UnderlyingSystemType to get the correct element type for the array. (ctor): Update code for new APIs: use dbus_message_iter_recurse(), dbus_message_get_{element|arg}_type() instead of dbus_message_iter_init_array_iterator(). (Append): Replace dbus_message_iter_append_array() with dbus_message_iter_open_container() and dbus_message_iter_close_container(). * mono/DBusType/Custom.cs, mono/DBusType/Nil.cs: Removed. These types have been removed. * mono/DBusType/*.cs: Replace calls of dbus_message_iter_get_[type]() to dbus_message_iter_get_basic(), but specify the type in the DllImport extern declaration. Ditto for dbus_message_iter_append_[type]() -> dbus_message_iter_append_basic(). * mono/example/BusListener.cs: Update for ServiceEventHandler -> NameOwnerChangedHandler. --- mono/Arguments.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mono/Arguments.cs') diff --git a/mono/Arguments.cs b/mono/Arguments.cs index b68ed5a3..41e6d15d 100644 --- a/mono/Arguments.cs +++ b/mono/Arguments.cs @@ -183,6 +183,12 @@ namespace DBus return (char) dbusType.InvokeMember("Code", BindingFlags.Static | BindingFlags.GetField, null, null, null); } + // Get the type code for a given D-BUS type as a string + public static string GetCodeAsString (Type dbusType) + { + return GetCode (dbusType).ToString (); + } + // Get a complete method signature public override string ToString() { @@ -201,7 +207,7 @@ namespace DBus key += code; } while (dbus_message_iter_next(iter)); } - + Marshal.FreeCoTaskMem(iter); return key; @@ -217,7 +223,7 @@ namespace DBus // Begin appending public void InitAppending() { - dbus_message_append_iter_init(message.RawMessage, appenderIter); + dbus_message_iter_init_append(message.RawMessage, appenderIter); } // Get the enumerator @@ -277,7 +283,7 @@ namespace DBus } [DllImport("dbus-1")] - private extern static void dbus_message_append_iter_init(IntPtr rawMessage, IntPtr iter); + private extern static void dbus_message_iter_init_append(IntPtr rawMessage, IntPtr iter); [DllImport("dbus-1")] private extern static bool dbus_message_iter_has_next(IntPtr iter); -- cgit