aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-05-18 16:59:52 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-05-18 15:04:59 -0700
commit07ad8567dc54d2a1cc729e342281cea8af93a5f0 (patch)
tree77f801cb5c11f06cabe6f50d359f7f4823cce4fa
parent41535f6874e24b8fb056b92bf48678d05c708c9e (diff)
downloadmmsd-07ad8567dc54d2a1cc729e342281cea8af93a5f0.tar.gz
Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their own vector.
-rw-r--r--plugins/ofono.c8
-rw-r--r--src/service.c40
2 files changed, 34 insertions, 14 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 29e8f06..fcdb228 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -115,9 +115,11 @@ static DBusMessage *agent_release(DBusConnection *conn,
}
static const GDBusMethodTable agent_methods[] = {
- { "ReceiveNotification", "aya{sv}", "", agent_receive },
- { "Release", "", "", agent_release,
- G_DBUS_METHOD_FLAG_NOREPLY },
+ { _GDBUS_METHOD("ReceiveNotification", "aya{sv}", "",
+ GDBUS_ARGS({ "notification", "ay" },
+ { "info", "a{sv}" }),
+ NULL, agent_receive) },
+ { _GDBUS_NOREPLY_METHOD("Release", "", "", NULL, NULL, agent_release) },
{ }
};
diff --git a/src/service.c b/src/service.c
index a269556..669d10e 100644
--- a/src/service.c
+++ b/src/service.c
@@ -223,13 +223,14 @@ static DBusMessage *msg_mark_read(DBusConnection *conn,
}
static const GDBusMethodTable message_methods[] = {
- { "MarkRead", "", "", msg_mark_read },
- { "Delete", "", "", msg_delete },
+ { _GDBUS_METHOD("MarkRead", "", "", NULL, NULL, msg_mark_read) },
+ { _GDBUS_METHOD("Delete", "", "", NULL, NULL, msg_delete) },
{ }
};
static const GDBusSignalTable message_signals[] = {
- { "PropertyChanged", "sv" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ }
};
@@ -980,15 +981,27 @@ release_msg:
}
static const GDBusMethodTable service_methods[] = {
- { "SendMessage", "assa(sss)", "o", send_message },
- { "GetMessages", "", "a(oa{sv})", get_messages },
- { "GetConversation", "su", "a(oa{sv})", get_conversation },
+ { _GDBUS_METHOD("SendMessage", "assa(sss)", "o",
+ GDBUS_ARGS({ "recipients", "as" }, { "smil", "s" },
+ { "attachments", "a(sss)" }),
+ GDBUS_ARGS({ "path", "o" }),
+ send_message) },
+ { _GDBUS_METHOD("GetMessages", "", "a(oa{sv})",
+ NULL,
+ GDBUS_ARGS({ "messages_with_properties", "a(oa{sv})" }),
+ get_messages) },
+ { _GDBUS_METHOD("GetConversation", "su", "a(oa{sv})",
+ GDBUS_ARGS({ "number", "s" }, { "count", "s" }),
+ GDBUS_ARGS({ "messages_with_properties", "a(oa{sv}" }),
+ get_conversation) },
{ }
};
static const GDBusSignalTable service_signals[] = {
- { "MessageAdded", "oa{sv}" },
- { "MessageRemoved", "o" },
+ { _GDBUS_SIGNAL("MessageAdded", "oa{sv}",
+ GDBUS_ARGS({ "path", "o" },
+ { "properties", "a{sv}" })) },
+ { _GDBUS_SIGNAL("MessageRemoved", "o", GDBUS_ARGS({ "path", "o" })) },
{ }
};
@@ -2343,13 +2356,18 @@ static DBusMessage *get_services(DBusConnection *conn,
}
static const GDBusMethodTable manager_methods[] = {
- { "GetServices", "", "a(oa{sv})", get_services },
+ { _GDBUS_METHOD("GetServices", "", "a(oa{sv})",
+ NULL,
+ GDBUS_ARGS({ "services_with_properties", "a(oa{sv})" }),
+ get_services) },
{ }
};
static const GDBusSignalTable manager_signals[] = {
- { "ServiceAdded", "oa{sv}" },
- { "ServiceRemoved", "o" },
+ { _GDBUS_SIGNAL("ServiceAdded", "oa{sv}",
+ GDBUS_ARGS({ "path", "o" },
+ { "properties", "a{sv}" })) },
+ { _GDBUS_SIGNAL("ServiceRemoved", "o", GDBUS_ARGS({ "path", "o" })) },
{ }
};