2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008 Novell, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
26 #include "droute-variant.h"
28 /*---------------------------------------------------------------------------*/
31 droute_return_v_int32 (DBusMessageIter *iter, dbus_int32_t val)
35 if (!dbus_message_iter_open_container
36 (iter, DBUS_TYPE_VARIANT, DBUS_TYPE_INT32_AS_STRING, &sub))
40 dbus_message_iter_append_basic (&sub, DBUS_TYPE_INT32, &val);
41 dbus_message_iter_close_container (iter, &sub);
46 droute_return_v_double (DBusMessageIter *iter, double val)
50 if (!dbus_message_iter_open_container
51 (iter, DBUS_TYPE_VARIANT, DBUS_TYPE_DOUBLE_AS_STRING, &sub))
55 dbus_message_iter_append_basic (&sub, DBUS_TYPE_DOUBLE, &val);
56 dbus_message_iter_close_container (iter, &sub);
61 droute_return_v_string (DBusMessageIter *iter, const char *val)
67 if (!dbus_message_iter_open_container
68 (iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &sub))
72 dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING, &val);
73 dbus_message_iter_close_container (iter, &sub);
78 droute_return_v_object (DBusMessageIter *iter, const char *path)
82 if (!dbus_message_iter_open_container
83 (iter, DBUS_TYPE_VARIANT, DBUS_TYPE_OBJECT_PATH_AS_STRING, &sub))
87 dbus_message_iter_append_basic (&sub, DBUS_TYPE_OBJECT_PATH, &path);
88 dbus_message_iter_close_container (iter, &sub);
92 /*---------------------------------------------------------------------------*/
95 droute_get_v_int32 (DBusMessageIter *iter)
100 // TODO- ensure we have the correct type
101 dbus_message_iter_recurse (iter, &sub);
102 dbus_message_iter_get_basic (&sub, &rv);
107 droute_get_v_string (DBusMessageIter *iter)
112 // TODO- ensure we have the correct type
113 dbus_message_iter_recurse (iter, &sub);
114 dbus_message_iter_get_basic (&sub, &rv);
118 /*END------------------------------------------------------------------------*/