From: Artur Świgoń Date: Wed, 12 Apr 2023 10:21:50 +0000 (+0200) Subject: Backport atspi_value_get_text() from 2.46 X-Git-Tag: accepted/tizen/unified/20230421.103346~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcba1e05746d7dd5525ac72a42e7dc0151074ba1;p=platform%2Fupstream%2Fat-spi2-core.git Backport atspi_value_get_text() from 2.46 This API provides a string value from the Value interface, customizable by the application, which can be read as-is by the ScreenReader. Change-Id: I054cc7253deac9d6ca9629fc2e813f7a5af24709 --- diff --git a/atspi/atspi-value.c b/atspi/atspi-value.c index 28acade..1f90f37 100644 --- a/atspi/atspi-value.c +++ b/atspi/atspi-value.c @@ -152,6 +152,28 @@ atspi_value_get_minimum_increment (AtspiValue *obj, GError **error) return retval; } +/** + * atspi_value_get_text: + * @obj: a pointer to the #AtspiValue implementor on which to operate. + * + * Gets the human readable text alternative associated with the value. + * @text is a newly created string, that must be freed by the + * caller. Can be NULL if no descriptor is available. + * + * Since: 2.46 + **/ +gchar * +atspi_value_get_text (AtspiValue *obj, GError **error) +{ + gchar *retval = NULL; + + g_return_val_if_fail (obj != NULL, NULL); + + _atspi_dbus_get_property (obj, atspi_interface_value, "Text", error, "s", &retval); + + return retval; +} + static void atspi_value_base_init (AtspiValue *klass) { diff --git a/atspi/atspi-value.h b/atspi/atspi-value.h index a012793..478ea95 100644 --- a/atspi/atspi-value.h +++ b/atspi/atspi-value.h @@ -56,6 +56,7 @@ gboolean atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GErr gdouble atspi_value_get_minimum_increment (AtspiValue *obj, GError **error); +gchar *atspi_value_get_text (AtspiValue *obj, GError **error); G_END_DECLS #endif /* _ATSPI_VALUE_H_ */