summaryrefslogtreecommitdiffstats
path: root/src/gprs.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-05-20 02:07:29 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-05-20 02:47:57 -0700
commitb3489f2ee86c1d7ace388b43420a32f9a76b019c (patch)
tree90688955099f3fe63186caa79d9d7bcbb2f82770 /src/gprs.c
parent8e815c100b566e1de1f5e555e0291f6610a08cd7 (diff)
downloadofono-b3489f2ee86c1d7ace388b43420a32f9a76b019c.tar.bz2
Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their own vector.
Diffstat (limited to 'src/gprs.c')
-rw-r--r--src/gprs.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/src/gprs.c b/src/gprs.c
index 83995f33..9a4138e7 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1283,14 +1283,18 @@ static DBusMessage *pri_set_property(DBusConnection *conn,
}
static const GDBusMethodTable context_methods[] = {
- { "GetProperties", "", "a{sv}", pri_get_properties },
- { "SetProperty", "sv", "", pri_set_property,
- G_DBUS_METHOD_FLAG_ASYNC },
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ pri_get_properties) },
+ { _GDBUS_ASYNC_METHOD("SetProperty", "sv", "",
+ GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
+ NULL, pri_set_property) },
{ }
};
static const GDBusSignalTable context_signals[] = {
- { "PropertyChanged", "sv" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ }
};
@@ -2063,22 +2067,34 @@ static DBusMessage *gprs_get_contexts(DBusConnection *conn,
}
static const GDBusMethodTable manager_methods[] = {
- { "GetProperties", "", "a{sv}", gprs_get_properties },
- { "SetProperty", "sv", "", gprs_set_property },
- { "AddContext", "s", "o", gprs_add_context,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "RemoveContext", "o", "", gprs_remove_context,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "DeactivateAll", "", "", gprs_deactivate_all,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "GetContexts", "", "a(oa{sv})", gprs_get_contexts },
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ gprs_get_properties) },
+ { _GDBUS_METHOD("SetProperty", "sv", "",
+ GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
+ NULL, gprs_set_property) },
+ { _GDBUS_ASYNC_METHOD("AddContext", "s", "o",
+ GDBUS_ARGS({ "type", "s" }),
+ GDBUS_ARGS({ "path", "o" }),
+ gprs_add_context) },
+ { _GDBUS_ASYNC_METHOD("RemoveContext", "o", "",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ gprs_remove_context) },
+ { _GDBUS_ASYNC_METHOD("DeactivateAll", "", "", NULL, NULL,
+ gprs_deactivate_all) },
+ { _GDBUS_METHOD("GetContexts", "", "a(oa{sv})",
+ NULL,
+ GDBUS_ARGS({ "contexts_with_properties", "a(oa{sv})" }),
+ gprs_get_contexts) },
{ }
};
static const GDBusSignalTable manager_signals[] = {
- { "PropertyChanged", "sv" },
- { "ContextAdded", "oa{sv}" },
- { "ContextRemoved", "o" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+ { _GDBUS_SIGNAL("ContextAdded", "oa{sv}",
+ GDBUS_ARGS({ "path", "o" }, { "properties", "v" })) },
+ { _GDBUS_SIGNAL("ContextRemoved", "o", GDBUS_ARGS({ "path", "o" })) },
{ }
};