summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Fraser-Green <owen@discobabe.net>2004-06-07 11:40:20 +0000
committerJohn Palmieri <johnp@remedyz.boston.redhat.com>2006-06-28 08:15:38 -0400
commit3366e96c97d90c75d8ffee74c04bdff82ceca347 (patch)
tree5984b07118ea51ed113b4a937a51199f745b31ae
parentd79636e179891ee09a778f6418fa352d806f9ce5 (diff)
Changes in-line with new object_path param changes. Also bumped required mono version and use new -pkg flag.
-rw-r--r--mono/DBusType/ObjectPath.cs18
-rw-r--r--mono/Handler.cs29
-rw-r--r--mono/Makefile.am2
-rw-r--r--mono/example/Makefile.am2
4 files changed, 19 insertions, 32 deletions
diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs
index 5dc9505..a7014b5 100644
--- a/mono/DBusType/ObjectPath.cs
+++ b/mono/DBusType/ObjectPath.cs
@@ -12,7 +12,7 @@ namespace DBus.DBusType
public class ObjectPath : IDBusType
{
public const char Code = 'o';
- private string pathName = null;
+ private string path = null;
private object val = null;
private Service service = null;
@@ -29,25 +29,25 @@ namespace DBus.DBusType
public ObjectPath(IntPtr iter, Service service)
{
- this.pathName = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
+ this.path = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
this.service = service;
}
- private string PathName
+ private string Path
{
get {
- if (this.pathName == null && this.val != null) {
+ if (this.path == null && this.val != null) {
Handler handler = this.service.GetHandler(this.val);
- this.pathName = handler.PathName;
+ this.path = handler.Path;
}
- return this.pathName;
+ return this.path;
}
}
public void Append(IntPtr iter)
{
- if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(PathName)))
+ if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(Path)))
throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
}
@@ -84,7 +84,7 @@ namespace DBus.DBusType
public object Get(System.Type type)
{
try {
- return this.service.GetObject(type, PathName);
+ return this.service.GetObject(type, Path);
} catch(Exception ex) {
throw new ArgumentException("Cannot cast object pointed to by Object Path to type '" + type.ToString() + "': " + ex);
}
@@ -94,6 +94,6 @@ namespace DBus.DBusType
private extern static IntPtr dbus_message_iter_get_object_path(IntPtr iter);
[DllImport("dbus-1")]
- private extern static bool dbus_message_iter_append_object_path(IntPtr iter, IntPtr pathName);
+ private extern static bool dbus_message_iter_append_object_path(IntPtr iter, IntPtr path);
}
}
diff --git a/mono/Handler.cs b/mono/Handler.cs
index ce3974b..91569e9 100644
--- a/mono/Handler.cs
+++ b/mono/Handler.cs
@@ -15,8 +15,7 @@ namespace DBus
internal class Handler : IDisposable
{
- private string[] path = null;
- private string pathName = null;
+ private string path = null;
private Introspector introspector = null;
private object handledObject = null;
private DBusObjectPathVTable vTable;
@@ -69,7 +68,7 @@ namespace DBus
service = null;
// Clean up unmanaged resources
- if (Connection != null && Connection.RawConnection != IntPtr.Zero && path != null) {
+ if (Connection != null && Connection.RawConnection != IntPtr.Zero && Path != null) {
dbus_connection_unregister_object_path(Connection.RawConnection,
Path);
}
@@ -88,17 +87,13 @@ namespace DBus
}
public Handler(object handledObject,
- string pathName,
+ string path,
Service service)
{
Service = service;
Connection = service.Connection;
HandledObject = handledObject;
-
- // Strip the leading / off if there is one and get the path as an array
- pathName = pathName.TrimStart('/');
- this.path = pathName.Split('/');
- this.pathName = "/" + pathName;
+ this.path = path;
// Create the vTable and register the path
vTable = new DBusObjectPathVTable(new DBusObjectPathUnregisterFunction(Unregister_Called),
@@ -115,7 +110,7 @@ namespace DBus
private void RegisterSignalHandlers()
{
- ProxyBuilder proxyBuilder = new ProxyBuilder(Service, HandledObject.GetType(), this.pathName);
+ ProxyBuilder proxyBuilder = new ProxyBuilder(Service, HandledObject.GetType(), Path);
foreach (DictionaryEntry interfaceEntry in this.introspector.InterfaceProxies) {
InterfaceProxy interfaceProxy = (InterfaceProxy) interfaceEntry.Value;
@@ -195,7 +190,7 @@ namespace DBus
return Result.Handled;
}
- internal string[] Path
+ internal string Path
{
get
{
@@ -203,14 +198,6 @@ namespace DBus
}
}
- public string PathName
- {
- get
- {
- return pathName;
- }
- }
-
internal Connection Connection
{
get
@@ -238,10 +225,10 @@ namespace DBus
}
[DllImport ("dbus-1")]
- private extern static bool dbus_connection_register_object_path (IntPtr rawConnection, string[] path, ref DBusObjectPathVTable vTable, IntPtr userData);
+ private extern static bool dbus_connection_register_object_path (IntPtr rawConnection, string path, ref DBusObjectPathVTable vTable, IntPtr userData);
[DllImport ("dbus-1")]
- private extern static void dbus_connection_unregister_object_path (IntPtr rawConnection, string[] path);
+ private extern static void dbus_connection_unregister_object_path (IntPtr rawConnection, string path);
}
}
diff --git a/mono/Makefile.am b/mono/Makefile.am
index 4b61816..2c62368 100644
--- a/mono/Makefile.am
+++ b/mono/Makefile.am
@@ -54,7 +54,7 @@ dbus-sharp.dll: $(DBUS_SHARP_FILES)
$(CSC) --unsafe --target library -o dbus-sharp.dll $(DBUS_SHARP_FILES) AssemblyInfo.cs
test-dbus-sharp.exe: $(TEST_DBUS_SHARP_FILES)
- $(CSC) --unsafe --target exe -L . -r dbus-sharp.dll -r gtk-sharp.dll -o test-dbus-sharp.exe $(TEST_DBUS_SHARP_FILES)
+ $(CSC) --unsafe --target exe -L . -r dbus-sharp.dll -pkg:gtk-sharp -o test-dbus-sharp.exe $(TEST_DBUS_SHARP_FILES)
clean:
rm -f $(TARGET) $(NOINST_EXES)
diff --git a/mono/example/Makefile.am b/mono/example/Makefile.am
index e7fd9b6..65a466a 100644
--- a/mono/example/Makefile.am
+++ b/mono/example/Makefile.am
@@ -5,7 +5,7 @@ NOINST_EXES=echo-server.exe echo-client.exe
all: $(NOINST_EXES)
echo-server.exe: EchoServer.cs Echoer.cs
- $(CSC) --target exe -L .. -r:../dbus-sharp.dll -r gtk-sharp -o echo-server.exe EchoServer.cs Echoer.cs
+ $(CSC) --target exe -L .. -r:../dbus-sharp.dll -pkg:gtk-sharp -o echo-server.exe EchoServer.cs Echoer.cs
echo-client.exe: EchoClient.cs Echoer.cs
$(CSC) --target exe -L .. -r:../dbus-sharp.dll -o echo-client.exe EchoClient.cs Echoer.cs