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. --- plugins/hfp_hf.c | 9 +++++---- plugins/push-notification.c | 8 ++++++-- plugins/smart-messaging.c | 21 +++++++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c index 19a362f5..628e034b 100644 --- a/plugins/hfp_hf.c +++ b/plugins/hfp_hf.c @@ -199,10 +199,11 @@ static DBusMessage *hfp_agent_release(DBusConnection *conn, } static const GDBusMethodTable agent_methods[] = { - { "NewConnection", "hq", "", hfp_agent_new_connection, - G_DBUS_METHOD_FLAG_ASYNC }, - { "Release", "", "", hfp_agent_release }, - { NULL, NULL, NULL, NULL } + { _GDBUS_ASYNC_METHOD("NewConnection", "hq", "", + GDBUS_ARGS({ "fd", "h" }, { "version", "q" }), + NULL, hfp_agent_new_connection) }, + { _GDBUS_METHOD("Release", "", "", NULL, NULL, hfp_agent_release) }, + { } }; static int hfp_hf_probe(const char *device, const char *dev_addr, diff --git a/plugins/push-notification.c b/plugins/push-notification.c index 1b8f7296..b916a6a6 100644 --- a/plugins/push-notification.c +++ b/plugins/push-notification.c @@ -152,8 +152,12 @@ static DBusMessage *push_notification_unregister_agent(DBusConnection *conn, } static const GDBusMethodTable push_notification_methods[] = { - { "RegisterAgent", "o", "", push_notification_register_agent }, - { "UnregisterAgent", "o", "", push_notification_unregister_agent }, + { _GDBUS_METHOD("RegisterAgent", "o", "", + GDBUS_ARGS({ "path", "o" }), NULL, + push_notification_register_agent) }, + { _GDBUS_METHOD("UnregisterAgent", "o", "", + GDBUS_ARGS({ "path", "o" }), NULL, + push_notification_unregister_agent) }, { } }; diff --git a/plugins/smart-messaging.c b/plugins/smart-messaging.c index 6820b20e..a924f006 100644 --- a/plugins/smart-messaging.c +++ b/plugins/smart-messaging.c @@ -269,12 +269,21 @@ static DBusMessage *smart_messaging_send_vcal(DBusConnection *conn, } static const GDBusMethodTable smart_messaging_methods[] = { - { "RegisterAgent", "o", "", smart_messaging_register_agent }, - { "UnregisterAgent", "o", "", smart_messaging_unregister_agent }, - { "SendBusinessCard", "say", "o", smart_messaging_send_vcard, - G_DBUS_METHOD_FLAG_ASYNC }, - { "SendAppointment", "say", "o", smart_messaging_send_vcal, - G_DBUS_METHOD_FLAG_ASYNC }, + { _GDBUS_METHOD("RegisterAgent", "o", "", + GDBUS_ARGS({ "path", "o" }), NULL, + smart_messaging_register_agent) }, + { _GDBUS_METHOD("UnregisterAgent", "o", "", + GDBUS_ARGS({ "path", "o" }), NULL, + smart_messaging_unregister_agent) }, + { _GDBUS_ASYNC_METHOD("SendBusinessCard", "say", "o", + GDBUS_ARGS({ "to", "s" }, { "card", "ay" }), + GDBUS_ARGS({ "path", "o" }), + smart_messaging_send_vcard) }, + { _GDBUS_ASYNC_METHOD("SendAppointment", "say", "o", + GDBUS_ARGS({ "to", "s" }, + { "appointment", "ay" }), + GDBUS_ARGS({ "path", "o" }), + smart_messaging_send_vcal) }, { } }; -- cgit v1.2.3