diff options
author | Mike Gorse <mgorse@novell.com> | 2011-06-22 11:06:19 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2011-06-22 11:06:19 -0500 |
commit | 41cf6649d58dd0d1791a0ed024c6beb09f6868ac (patch) | |
tree | 1d3630a31e14a0d14613e5ff8da987aefdc8f9ea /atspi/atspi-value.c | |
parent | 61c2feddfcabb1b6b2a5f0da91a3e842c434b043 (diff) | |
download | at-spi2-core-41cf6649d58dd0d1791a0ed024c6beb09f6868ac.tar.gz |
BGO#652596: Use DBus property to set value
Diffstat (limited to 'atspi/atspi-value.c')
-rw-r--r-- | atspi/atspi-value.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/atspi/atspi-value.c b/atspi/atspi-value.c index ed2e7df1..32966d27 100644 --- a/atspi/atspi-value.c +++ b/atspi/atspi-value.c @@ -98,10 +98,26 @@ gboolean atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GError **error) { double d_new_value = new_value; - - g_return_val_if_fail (obj != NULL, FALSE); - - _atspi_dbus_call (obj, atspi_interface_value, "SetCurrentValue", error, "d", d_new_value); + DBusMessage *message, *reply; + DBusMessageIter iter, iter_variant; + static const char *str_curval = "CurrentValue"; + AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj); + + g_return_val_if_fail (accessible != NULL, FALSE); + message = dbus_message_new_method_call (accessible->parent.app->bus_name, + accessible->parent.path, + DBUS_INTERFACE_PROPERTIES, "Set"); + if (!message) + return NULL; + dbus_message_append_args (message, DBUS_TYPE_STRING, &atspi_interface_value, + DBUS_TYPE_STRING, &str_curval, + DBUS_TYPE_INVALID); + dbus_message_iter_init_append (message, &iter); + dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, "d", &iter_variant); + dbus_message_iter_append_basic (&iter_variant, DBUS_TYPE_DOUBLE, &d_new_value); + dbus_message_iter_close_container (&iter, &iter_variant); + reply = _atspi_dbus_send_with_reply_and_block (message, error); + dbus_message_unref (reply); return TRUE; } |