summaryrefslogtreecommitdiffstats
path: root/mono/Message.cs
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-06-22 05:53:06 +0000
committerHavoc Pennington <hp@redhat.com>2003-06-22 05:53:06 +0000
commit93b5a19c9f0979b5f227760af2ce5a0d076521f9 (patch)
tree1704ae1cbebdfacc0ca5d7c98e9c90bf55b27fd3 /mono/Message.cs
parent8e99e853a7abbb5344240c35b66853eeaedca48e (diff)
2003-06-22 Havoc Pennington <hp@pobox.com>
* mono/*, gcj/*, configure.in, Makefile.am: Check in makefiles and subdirs for mono and gcj bindings. Neither binding actually exists, just trying to get through all the build and other boring bits.
Diffstat (limited to 'mono/Message.cs')
-rw-r--r--mono/Message.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/mono/Message.cs b/mono/Message.cs
new file mode 100644
index 00000000..84bd12ec
--- /dev/null
+++ b/mono/Message.cs
@@ -0,0 +1,50 @@
+namespace DBus {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+ public class Message {
+
+ public Message (string name,
+ string dest_service) {
+ raw = dbus_message_new (name, dest_service);
+ }
+
+ public string Name {
+ get {
+ return dbus_message_get_name (raw);
+ }
+ }
+
+ IntPtr raw;
+
+ ~Message () {
+ dbus_message_unref (raw);
+ }
+
+ Message (IntPtr r) {
+ raw = r;
+ dbus_message_ref (r);
+ }
+
+ // static constructor runs before any methods
+ static Message () {
+
+ }
+
+ const string libname = "libdbus-1.so.0";
+
+ [DllImport (libname, EntryPoint="dbus_message_new")]
+ private extern static IntPtr dbus_message_new (string name,
+ string dest_service);
+
+ [DllImport (libname, EntryPoint="dbus_message_unref")]
+ private extern static void dbus_message_unref (IntPtr ptr);
+
+ [DllImport (libname, EntryPoint="dbus_message_ref")]
+ private extern static void dbus_message_ref (IntPtr ptr);
+
+ [DllImport (libname, EntryPoint="dbus_message_get_name")]
+ private extern static string dbus_message_get_name (IntPtr ptr);
+ }
+}