summaryrefslogtreecommitdiffstats
path: root/gdbus/gdbus.h
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-05-20 02:07:28 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-05-20 02:47:57 -0700
commit8e815c100b566e1de1f5e555e0291f6610a08cd7 (patch)
tree1cd5fed4843a0df025ee4544edfa6da9a5d87d1a /gdbus/gdbus.h
parentd1a1a9bcc999ebfcf09aacd9bfd0acff7d1962a8 (diff)
downloadofono-8e815c100b566e1de1f5e555e0291f6610a08cd7.tar.bz2
gdbus: add and use helpers for table declarations
Diffstat (limited to 'gdbus/gdbus.h')
-rw-r--r--gdbus/gdbus.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index e5e7938d..868c8d56 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -118,6 +118,108 @@ typedef struct {
GDBusSecurityFunction function;
} GDBusSecurityTable;
+#define GDBUS_ARGS(args...) (const GDBusArgInfo[]) { args, { } }
+
+#define _GDBUS_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+ .name = _name, \
+ .signature = _signature, \
+ .reply = _reply, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function
+
+#define _GDBUS_ASYNC_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+ .name = _name, \
+ .signature = _signature, \
+ .reply = _reply, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_ASYNC
+
+#define _GDBUS_DEPRECATED_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+ .name = _name, \
+ .signature = _signature, \
+ .reply = _reply, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define _GDBUS_DEPRECATED_ASYNC_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+ .name = _name, \
+ .signature = _signature, \
+ .reply = _reply, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define _GDBUS_NOREPLY_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+ .name = _name, \
+ .signature = _signature, \
+ .reply = _reply, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_NOREPLY
+
+#define _GDBUS_SIGNAL(_name, _signature, _args) \
+ .name = _name, \
+ .signature = _signature, \
+ .args = _args
+
+#define _GDBUS_DEPRECATED_SIGNAL(_name, _signature, _args) \
+ .name = _name, \
+ .signature = _signature, \
+ .args = _args, \
+ .flags = G_DBUS_SIGNAL_FLAG_DEPRECATED
+
+/* Helpers with no signature and reply */
+
+#define GDBUS_METHOD(_name, _in_args, _out_args, _function) \
+ .name = _name, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function
+
+#define GDBUS_ASYNC_METHOD(_name, _in_args, _out_args, _function) \
+ .name = _name, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_ASYNC
+
+#define GDBUS_DEPRECATED_METHOD(_name, _in_args, _out_args, _function) \
+ .name = _name, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define GDBUS_DEPRECATED_ASYNC_METHOD(_name, _in_args, _out_args, _function) \
+ .name = _name, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define GDBUS_NOREPLY_METHOD(_name, _in_args, _out_args, _function) \
+ .name = _name, \
+ .in_args = _in_args, \
+ .out_args = _out_args, \
+ .function = _function, \
+ .flags = G_DBUS_METHOD_FLAG_NOREPLY
+
+#define GDBUS_SIGNAL(_name, _args) \
+ .name = _name, \
+ .args = _args
+
+#define GDBUS_DEPRECATED_SIGNAL(_name, _args) \
+ .name = _name, \
+ .args = _args, \
+ .flags = G_DBUS_SIGNAL_FLAG_DEPRECATED
+
gboolean g_dbus_register_interface(DBusConnection *connection,
const char *path, const char *name,
const GDBusMethodTable *methods,