summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-18 17:02:50 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-18 17:02:50 +0000
commitd1ae2b4841f2b16f647903ff48bb82f2ee35b167 (patch)
treeb1c5bf28b43a2aac5ddd7fb49070a867a0767209 /input
parentc6cd1ad500588247d4293b96db66d7a140ee81ec (diff)
Added ListDevices
Diffstat (limited to 'input')
-rw-r--r--input/input-service.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/input/input-service.c b/input/input-service.c
index 23dbce8b..9b5dde45 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -107,7 +107,28 @@ static DBusHandlerResult manager_remove_device(DBusConnection *conn,
static DBusHandlerResult manager_list_devices(DBusConnection *conn,
DBusMessage *msg, void *udata)
{
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ struct input_manager *mgr = udata;
+ DBusMessageIter iter, iter_array;
+ DBusMessage *reply;
+ GList *paths;
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING, &iter_array);
+
+ for (paths = mgr->paths; paths != NULL; paths = paths->next) {
+ const char *ppath = paths->data;
+ dbus_message_iter_append_basic(&iter_array,
+ DBUS_TYPE_STRING, &ppath);
+ }
+
+ dbus_message_iter_close_container(&iter, &iter_array);
+
+ return send_message_and_unref(conn, reply);
}
static DBusHandlerResult manager_message(DBusConnection *conn,