2.34.0
[platform/upstream/at-spi2-core.git] / atspi / atspi-value.c
index 32966d2..28acade 100644 (file)
@@ -7,19 +7,19 @@
  * Copyright 2010, 2011 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
+ * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU Library General Public
+ * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #include "atspi-private.h"
@@ -28,7 +28,7 @@
  * 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.
  *
@@ -48,7 +48,7 @@ atspi_value_get_minimum_value (AtspiValue *obj, GError **error)
  * 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.
  **/
@@ -68,7 +68,7 @@ atspi_value_get_current_value (AtspiValue *obj, GError **error)
  * 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.
  **/
@@ -87,9 +87,9 @@ atspi_value_get_maximum_value (AtspiValue *obj, GError **error)
 /**
  * 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.
@@ -104,11 +104,19 @@ atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GError **erro
   AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
 
   g_return_val_if_fail (accessible != NULL, FALSE);
+
+  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 NULL;
+      return FALSE;
     dbus_message_append_args (message, DBUS_TYPE_STRING, &atspi_interface_value,
                                DBUS_TYPE_STRING, &str_curval,
                               DBUS_TYPE_INVALID);
@@ -126,7 +134,7 @@ atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GError **erro
  * 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.