diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-15 16:51:13 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-15 16:51:13 +0000 |
commit | 2da61c2a5ef423d83a6f91b9a015c125e500ffb7 (patch) | |
tree | e52235f0f2ea9160565dda73fa165e3063c0a62e /navit/binding | |
parent | a416cba4f3f446a3f3a595a06e218831db2e722b (diff) | |
download | navit-svn-2da61c2a5ef423d83a6f91b9a015c125e500ffb7.tar.gz |
Fix:binding_dbus:Implement pcoord encoding
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3179 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/binding')
-rw-r--r-- | navit/binding/dbus/binding_dbus.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/navit/binding/dbus/binding_dbus.c b/navit/binding/dbus/binding_dbus.c index d101342a..4ff77ba2 100644 --- a/navit/binding/dbus/binding_dbus.c +++ b/navit/binding/dbus/binding_dbus.c @@ -241,7 +241,7 @@ static int encode_attr(DBusMessageIter *iter1, struct attr *attr) { char *name=attr_to_name(attr->type); - DBusMessageIter iter2; + DBusMessageIter iter2,iter3; dbus_message_iter_append_basic(iter1, DBUS_TYPE_STRING, &name); if (attr->type >= attr_type_int_begin && attr->type < attr_type_boolean_begin) { dbus_message_iter_open_container(iter1, DBUS_TYPE_VARIANT, DBUS_TYPE_INT32_AS_STRING, &iter2); @@ -256,6 +256,17 @@ encode_attr(DBusMessageIter *iter1, struct attr *attr) if (attr->type >= attr_type_string_begin && attr->type <= attr_type_string_end) { encode_variant_string(iter1, attr->u.str); } + if (attr->type >= attr_type_pcoord_begin && attr->type <= attr_type_pcoord_end) { + dbus_message_iter_open_container(iter1, DBUS_TYPE_VARIANT, "ai", &iter2); + dbus_message_iter_open_container(&iter2, DBUS_TYPE_ARRAY, "i", &iter3); + if (attr->u.pcoord) { + dbus_message_iter_append_basic(&iter3, DBUS_TYPE_INT32, &attr->u.pcoord->pro); + dbus_message_iter_append_basic(&iter3, DBUS_TYPE_INT32, &attr->u.pcoord->x); + dbus_message_iter_append_basic(&iter3, DBUS_TYPE_INT32, &attr->u.pcoord->y); + } + dbus_message_iter_close_container(&iter2, &iter3); + dbus_message_iter_close_container(iter1, &iter2); + } if (attr->type >= attr_type_object_begin && attr->type <= attr_type_object_end) { char *object=object_new(attr_to_name(attr->type), attr->u.data); dbus_message_iter_open_container(iter1, DBUS_TYPE_VARIANT, DBUS_TYPE_OBJECT_PATH_AS_STRING, &iter2); |