diff options
author | Mike Gorse <mgorse@suse.com> | 2013-05-14 10:53:45 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2013-05-15 15:09:00 -0500 |
commit | 5b9c1723c5661b9d573b56af3673b488bf2136d7 (patch) | |
tree | df634deee63a85be88e9c17b1bba61f1eb2b3ad6 /atspi/atspi-text.c | |
parent | e2661ee0aa213120ef82002518b6f3cf6fe944b5 (diff) | |
download | at-spi2-core-5b9c1723c5661b9d573b56af3673b488bf2136d7.tar.gz |
Rename various functions to avoid name collisions
Having functions with common suffixes (ie, atspi_text_get_attributes and
atspi_document_get_attributes) results in problems for language
bindings. Deprecating these functions in favor of functions with new
names to avoid these collisions.
https://bugzilla.gnome.org/show_bug.cgi?id=700243
Diffstat (limited to 'atspi/atspi-text.c')
-rw-r--r-- | atspi/atspi-text.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c index 733260d7..244000d2 100644 --- a/atspi/atspi-text.c +++ b/atspi/atspi-text.c @@ -154,6 +154,9 @@ atspi_text_get_caret_offset (AtspiText *obj, GError **error) * * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable * describing the attributes at the given character offset. + * + * Deprecated: 2.10: Use atspi_text_get_text_attributes instead. + * Rename to: atspi_text_get_text_attributes **/ GHashTable * atspi_text_get_attributes (AtspiText *obj, @@ -162,6 +165,34 @@ atspi_text_get_attributes (AtspiText *obj, gint *end_offset, GError **error) { + return atspi_text_get_text_attributes (obj, offset, start_offset, end_offset, error); +} + +/** + * atspi_text_get_text_attributes: + * @obj: a pointer to the #AtspiText object to query. + * @offset: a #gint indicating the offset from which the attribute + * search is based. + * @start_offset: (out): a #gint pointer indicating the start of the desired text + * range. + * @end_offset: (out): a #gint pointer indicating the first character past the desired + * range. + * + * Gets the attributes applied to a range of text from an #AtspiText + * object. The text attributes correspond to CSS attributes + * where possible. + * <em>DEPRECATED</em> + * + * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable + * describing the attributes at the given character offset. + **/ +GHashTable * +atspi_text_get_text_attributes (AtspiText *obj, + gint offset, + gint *start_offset, + gint *end_offset, + GError **error) +{ dbus_int32_t d_offset = offset; dbus_int32_t d_start_offset, d_end_offset; DBusMessage *reply; @@ -258,6 +289,9 @@ atspi_text_get_attribute_run (AtspiText *obj, * * Returns: the value of a given attribute at the given offset, or NULL if * not present. + * + * Deprecated: 2.10: Use atspi_text_get_text_attribute_value instead. + * Rename to: atspi_text_get_text_attribute_value **/ gchar * atspi_text_get_attribute_value (AtspiText *obj, @@ -265,6 +299,27 @@ atspi_text_get_attribute_value (AtspiText *obj, gchar *attribute_value, GError **error) { + return atspi_text_get_text_attribute_value (obj, offset, attribute_value, + error); +} + +/** + * atspi_text_get_text_attribute_value: + * @obj: a pointer to the #AtspiText object to query. + * @offset: The character offset at which to query the attribute. + * @attribute_name: The attribute to query. + * + * Gets the value of a named attribute at a given offset. + * + * Returns: the value of a given attribute at the given offset, or NULL if + * not present. + **/ +gchar * +atspi_text_get_text_attribute_value (AtspiText *obj, + gint offset, + gchar *attribute_value, + GError **error) +{ gchar *retval = NULL; g_return_val_if_fail (obj != NULL, NULL); |