From 5b9c1723c5661b9d573b56af3673b488bf2136d7 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Tue, 14 May 2013 10:53:45 -0500 Subject: 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 --- atspi/atspi-accessible.c | 209 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) (limited to 'atspi/atspi-accessible.c') diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index 534912e4..322ebac1 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -1082,6 +1082,9 @@ atspi_accessible_is_value (AtspiAccessible *obj) * * Returns: (transfer full): a pointer to an #AtspiAction interface * instance, or NULL if @obj does not implement #AtspiAction. + * + * Deprecated: 2.10: Use atspi_accessible_get_action_iface instead. + * Rename to: atspi_accessible_get_action_iface **/ AtspiAction * atspi_accessible_get_action (AtspiAccessible *accessible) @@ -1090,6 +1093,22 @@ atspi_accessible_get_action (AtspiAccessible *accessible) g_object_ref (ATSPI_ACTION (accessible)) : NULL); } +/** + * atspi_accessible_get_action_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiAction interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiAction interface + * instance, or NULL if @obj does not implement #AtspiAction. + **/ +AtspiAction * +atspi_accessible_get_action_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_action) ? + g_object_ref (ATSPI_ACTION (accessible)) : NULL); +} + /** * atspi_accessible_get_collection: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1098,6 +1117,9 @@ atspi_accessible_get_action (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiCollection interface * instance, or NULL if @obj does not implement #AtspiCollection. + * + * Deprecated: 2.10: Use atspi_accessible_get_collection_iface instead. + * Rename to: atspi_accessible_get_collection_iface **/ AtspiCollection * atspi_accessible_get_collection (AtspiAccessible *accessible) @@ -1106,6 +1128,22 @@ atspi_accessible_get_collection (AtspiAccessible *accessible) g_object_ref (ATSPI_COLLECTION (accessible)) : NULL); } +/** + * atspi_accessible_get_collection_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiCollection interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiCollection interface + * instance, or NULL if @obj does not implement #AtspiCollection. + **/ +AtspiCollection * +atspi_accessible_get_collection_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_collection) ? + g_object_ref (ATSPI_COLLECTION (accessible)) : NULL); +} + /** * atspi_accessible_get_component: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1114,6 +1152,9 @@ atspi_accessible_get_collection (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiComponent interface * instance, or NULL if @obj does not implement #AtspiComponent. + * + * Deprecated: 2.10: Use atspi_accessible_get_component_iface instead. + * Rename to: atspi_accessible_get_component_iface **/ AtspiComponent * atspi_accessible_get_component (AtspiAccessible *obj) @@ -1122,6 +1163,22 @@ atspi_accessible_get_component (AtspiAccessible *obj) g_object_ref (ATSPI_COMPONENT (obj)) : NULL); } +/** + * atspi_accessible_get_component_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiComponent interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiComponent interface + * instance, or NULL if @obj does not implement #AtspiComponent. + **/ +AtspiComponent * +atspi_accessible_get_component_iface (AtspiAccessible *obj) +{ + return (_atspi_accessible_is_a (obj, atspi_interface_component) ? + g_object_ref (ATSPI_COMPONENT (obj)) : NULL); +} + /** * atspi_accessible_get_document: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1130,6 +1187,9 @@ atspi_accessible_get_component (AtspiAccessible *obj) * * Returns: (transfer full): a pointer to an #AtspiDocument interface * instance, or NULL if @obj does not implement #AtspiDocument. + * + * Deprecated: 2.10: Use atspi_accessible_get_document_iface instead. + * Rename to: atspi_accessible_get_document_iface **/ AtspiDocument * atspi_accessible_get_document (AtspiAccessible *accessible) @@ -1138,6 +1198,22 @@ atspi_accessible_get_document (AtspiAccessible *accessible) g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL); } +/** + * atspi_accessible_get_document_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiDocument interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiDocument interface + * instance, or NULL if @obj does not implement #AtspiDocument. + **/ +AtspiDocument * +atspi_accessible_get_document_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_document) ? + g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL); +} + /** * atspi_accessible_get_editable_text: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1146,6 +1222,9 @@ atspi_accessible_get_document (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiEditableText interface * instance, or NULL if @obj does not implement #AtspiEditableText. + * + * Deprecated: 2.10: Use atspi_accessible_get_editable_text_iface instead. + * Rename to: atspi_accessible_get_editable_text_iface **/ AtspiEditableText * atspi_accessible_get_editable_text (AtspiAccessible *accessible) @@ -1154,6 +1233,22 @@ atspi_accessible_get_editable_text (AtspiAccessible *accessible) g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL); } +/** + * atspi_accessible_get_editable_text_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiEditableText interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiEditableText interface + * instance, or NULL if @obj does not implement #AtspiEditableText. + **/ +AtspiEditableText * +atspi_accessible_get_editable_text_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_editable_text) ? + g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL); +} + /** * atspi_accessible_get_hyperlink: * @obj: a pointer to the #AtspiAccessible object on which to operate. @@ -1178,6 +1273,9 @@ atspi_accessible_get_hyperlink (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiHypertext interface * instance, or NULL if @obj does not implement #AtspiHypertext. + * + * Deprecated: 2.10: Use atspi_accessible_get_hypertext_iface instead. + * Rename to: atspi_accessible_get_hypertext_iface **/ AtspiHypertext * atspi_accessible_get_hypertext (AtspiAccessible *accessible) @@ -1186,6 +1284,22 @@ atspi_accessible_get_hypertext (AtspiAccessible *accessible) g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL); } +/** + * atspi_accessible_get_hypertext_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiHypertext interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiHypertext interface + * instance, or NULL if @obj does not implement #AtspiHypertext. + **/ +AtspiHypertext * +atspi_accessible_get_hypertext_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_hypertext) ? + g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL); +} + /** * atspi_accessible_get_image: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1194,6 +1308,9 @@ atspi_accessible_get_hypertext (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiImage interface instance, or * NULL if @obj does not implement #AtspiImage. + * + * Deprecated: 2.10: Use atspi_accessible_get_image_iface instead. + * Rename to: atspi_accessible_get_image_iface **/ AtspiImage * atspi_accessible_get_image (AtspiAccessible *accessible) @@ -1202,6 +1319,22 @@ atspi_accessible_get_image (AtspiAccessible *accessible) g_object_ref (ATSPI_IMAGE (accessible)) : NULL); } +/** + * atspi_accessible_get_image_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiImage interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiImage interface instance, or + * NULL if @obj does not implement #AtspiImage. + **/ +AtspiImage * +atspi_accessible_get_image_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_image) ? + g_object_ref (ATSPI_IMAGE (accessible)) : NULL); +} + /** * atspi_accessible_get_selection: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1210,6 +1343,9 @@ atspi_accessible_get_image (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiSelection interface * instance, or NULL if @obj does not implement #AtspiSelection. + * + * Deprecated: 2.10: Use atspi_accessible_get_selection_iface instead. + * Rename to: atspi_accessible_get_selection_iface **/ AtspiSelection * atspi_accessible_get_selection (AtspiAccessible *accessible) @@ -1218,6 +1354,22 @@ atspi_accessible_get_selection (AtspiAccessible *accessible) g_object_ref (ATSPI_SELECTION (accessible)) : NULL); } +/** + * atspi_accessible_get_selection_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiSelection interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiSelection interface + * instance, or NULL if @obj does not implement #AtspiSelection. + **/ +AtspiSelection * +atspi_accessible_get_selection_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_selection) ? + g_object_ref (ATSPI_SELECTION (accessible)) : NULL); +} + #if 0 /** * atspi_accessible_get_streamable_content: @@ -1244,6 +1396,9 @@ atspi_accessible_get_streamable_content (AtspiAccessible *accessible) * * Returns: (transfer full): a pointer to an #AtspiTable interface instance, or * NULL if @obj does not implement #AtspiTable. + * + * Deprecated: 2.10: Use atspi_accessible_get_table_iface instead. + * Rename to: atspi_accessible_get_table_iface **/ AtspiTable * atspi_accessible_get_table (AtspiAccessible *obj) @@ -1252,6 +1407,22 @@ atspi_accessible_get_table (AtspiAccessible *obj) g_object_ref (ATSPI_TABLE (obj)) : NULL); } +/** + * atspi_accessible_get_table_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiTable interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiTable interface instance, or + * NULL if @obj does not implement #AtspiTable. + **/ +AtspiTable * +atspi_accessible_get_table_iface (AtspiAccessible *obj) +{ + return (_atspi_accessible_is_a (obj, atspi_interface_table) ? + g_object_ref (ATSPI_TABLE (obj)) : NULL); +} + /** * atspi_accessible_get_text: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1260,6 +1431,9 @@ atspi_accessible_get_table (AtspiAccessible *obj) * * Returns: (transfer full): a pointer to an #AtspiText interface instance, or * NULL if @obj does not implement #AtspiText. + * + * Deprecated: 2.10: Use atspi_accessible_get_text_iface instead. + * Rename to: atspi_accessible_get_text_iface **/ AtspiText * atspi_accessible_get_text (AtspiAccessible *obj) @@ -1268,6 +1442,22 @@ atspi_accessible_get_text (AtspiAccessible *obj) g_object_ref (ATSPI_TEXT (obj)) : NULL); } +/** + * atspi_accessible_get_text_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiTable interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiText interface instance, or + * NULL if @obj does not implement #AtspiText. + **/ +AtspiText * +atspi_accessible_get_text_iface (AtspiAccessible *obj) +{ + return (_atspi_accessible_is_a (obj, atspi_interface_text) ? + g_object_ref (ATSPI_TEXT (obj)) : NULL); +} + /** * atspi_accessible_get_value: * @obj: a pointer to the #AtspiAccessible instance to query. @@ -1276,6 +1466,9 @@ atspi_accessible_get_text (AtspiAccessible *obj) * * Returns: (transfer full): a pointer to an #AtspiValue interface instance, or * NULL if @obj does not implement #AtspiValue. + * + * Deprecated: 2.10: Use atspi_accessible_get_value_iface instead. + * Rename to: atspi_accessible_get_value_iface **/ AtspiValue * atspi_accessible_get_value (AtspiAccessible *accessible) @@ -1284,6 +1477,22 @@ atspi_accessible_get_value (AtspiAccessible *accessible) g_object_ref (ATSPI_VALUE (accessible)) : NULL); } +/** + * atspi_accessible_get_value_iface: + * @obj: a pointer to the #AtspiAccessible instance to query. + * + * Gets the #AtspiTable interface for an #AtspiAccessible. + * + * Returns: (transfer full): a pointer to an #AtspiValue interface instance, or + * NULL if @obj does not implement #AtspiValue. + **/ +AtspiValue * +atspi_accessible_get_value_iface (AtspiAccessible *accessible) +{ + return (_atspi_accessible_is_a (accessible, atspi_interface_value) ? + g_object_ref (ATSPI_VALUE (accessible)) : NULL); +} + static void append_const_val (GArray *array, const gchar *val) { -- cgit v1.2.1