From b3489f2ee86c1d7ace388b43420a32f9a76b019c Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sun, 20 May 2012 02:07:29 -0300 Subject: Convert GDBus methods to use macro helpers With these macro helpers we can separate in/out arguments and use their own vector. --- src/handsfree.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/handsfree.c') diff --git a/src/handsfree.c b/src/handsfree.c index a8389528..e2d47d62 100644 --- a/src/handsfree.c +++ b/src/handsfree.c @@ -271,16 +271,21 @@ static DBusMessage *handsfree_request_phone_number(DBusConnection *conn, } static const GDBusMethodTable handsfree_methods[] = { - { "GetProperties", "", "a{sv}", handsfree_get_properties }, - { "SetProperty", "sv", "", handsfree_set_property, - G_DBUS_METHOD_FLAG_ASYNC }, - { "RequestPhoneNumber", "", "s", handsfree_request_phone_number, - G_DBUS_METHOD_FLAG_ASYNC }, - { NULL, NULL, NULL, NULL } + { _GDBUS_METHOD("GetProperties", "", "a{sv}", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + handsfree_get_properties) }, + { _GDBUS_ASYNC_METHOD("SetProperty", "sv", "", + GDBUS_ARGS({ "property", "s" }, { "value", "v" }), + NULL, handsfree_set_property) }, + { _GDBUS_ASYNC_METHOD("RequestPhoneNumber", "", "s", + NULL, GDBUS_ARGS({ "number", "s" }), + handsfree_request_phone_number) }, + { } }; static const GDBusSignalTable handsfree_signals[] = { - { "PropertyChanged", "sv" }, + { _GDBUS_SIGNAL("PropertyChanged", "sv", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, { } }; -- cgit v1.2.3