2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008 Novell, Inc.
6 * Copyright 2001, 2002 Sun Microsystems Inc.,
7 * Copyright 2001, 2002 Ximian, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
28 #include <droute/droute.h>
30 #include "spi-common/spi-dbus.h"
33 impl_get_minimumValue (DBusMessageIter * iter,
36 AtkValue *value = (AtkValue *) user_data;
41 g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
43 atk_value_get_minimum_value (value, &src);
44 g_value_init (&dest, G_TYPE_DOUBLE);
46 if (g_value_transform (&src, &dest))
48 dub = g_value_get_double (&dest);
49 dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &dub);
59 impl_get_maximumValue (DBusMessageIter * iter,
62 AtkValue *value = (AtkValue *) user_data;
67 g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
69 atk_value_get_maximum_value (value, &src);
70 g_value_init (&dest, G_TYPE_DOUBLE);
72 if (g_value_transform (&src, &dest))
74 dub = g_value_get_double (&dest);
75 dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &dub);
85 impl_get_minimumIncrement (DBusMessageIter * iter,
88 AtkValue *value = (AtkValue *) user_data;
93 g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
95 atk_value_get_minimum_increment (value, &src);
96 g_value_init (&dest, G_TYPE_DOUBLE);
98 if (g_value_transform (&src, &dest))
100 dub = g_value_get_double (&dest);
101 dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &dub);
111 impl_get_currentValue (DBusMessageIter * iter,
114 AtkValue *value = (AtkValue *) user_data;
119 g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
121 atk_value_get_current_value (value, &src);
122 g_value_init (&dest, G_TYPE_DOUBLE);
124 if (g_value_transform (&src, &dest))
126 dub = g_value_get_double (&dest);
127 dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &dub);
137 impl_set_currentValue (DBusMessageIter * iter,
140 AtkValue *value = (AtkValue *) user_data;
145 g_return_val_if_fail (ATK_IS_VALUE (user_data), FALSE);
147 dbus_message_iter_get_basic (iter, &dub);
148 g_value_init (&src, G_TYPE_DOUBLE);
149 g_value_set_double (&src, dub);
151 atk_value_get_current_value (value, &dest);
153 if (g_value_transform (&src, &dest))
155 atk_value_set_current_value (value, &dest);
164 static DRouteProperty properties[] = {
165 {impl_get_minimumValue, NULL, "minimumValue"},
166 {impl_get_maximumValue, NULL, "maximumValue"},
167 {impl_get_minimumIncrement, NULL, "minimumIncrement"},
168 {impl_get_currentValue, impl_set_currentValue, "currentValue"},
173 spi_initialize_value (DRoutePath *path)
175 droute_path_add_interface (path,
176 SPI_DBUS_INTERFACE_VALUE,