* atspi_value_get_minimum_value:
* @obj: a pointer to the #AtspiValue implementor on which to operate.
*
- * Get the minimum allowed value for an #AtspiValue.
+ * Gets the minimum allowed value for an #AtspiValue.
*
* Returns: the minimum allowed value for this object.
*
* atspi_value_get_current_value:
* @obj: a pointer to the #AtspiValue implementor on which to operate.
*
- * Get the current value for an #AtspiValue.
+ * Gets the current value for an #AtspiValue.
*
* Returns: the current value for this object.
**/
* atspi_value_get_maximum_value:
* @obj: a pointer to the #AtspiValue implementor on which to operate.
*
- * Get the maximum allowed value for an #AtspiValue.
+ * Gets the maximum allowed value for an #AtspiValue.
*
* Returns: the maximum allowed value for this object.
**/
/**
* atspi_value_set_current_value:
* @obj: a pointer to the #AtspiValue implementor on which to operate.
- * @new_value: a #float value which is the desired new value of the object.
+ * @new_value: a #gdouble value which is the desired new value of the object.
*
- * Set the current value of an #AtspiValue.
+ * Sets the current value of an #AtspiValue.
*
* Returns: #TRUE if the value could be assigned the specified value,
* #FALSE otherwise.
atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GError **error)
{
double d_new_value = 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 (obj != NULL, FALSE);
+ g_return_val_if_fail (accessible != NULL, FALSE);
- _atspi_dbus_call (obj, atspi_interface_value, "SetCurrentValue", error, "d", &d_new_value);
+ if (!accessible->parent.app || !accessible->parent.app->bus_name)
+{
+ g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_APPLICATION_GONE,
+ _("The application no longer exists"));
+ return FALSE;
+ }
+
+ message = dbus_message_new_method_call (accessible->parent.app->bus_name,
+ accessible->parent.path,
+ DBUS_INTERFACE_PROPERTIES, "Set");
+ if (!message)
+ return FALSE;
+ 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;
}
* atspi_value_get_minimum_increment:
* @obj: a pointer to the #AtspiValue implementor on which to operate.
*
- * Get the minimum increment by which an #AtspiValue can be adjusted.
+ * Gets the minimum increment by which an #AtspiValue can be adjusted.
*
* Returns: the minimum increment by which the value may be changed, or
* zero if the minimum increment cannot be determined.