[at-spi2-core/gi: 4/4] Have atspi_accessible_get_host_application return an AtspiAccessible
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core/gi: 4/4] Have atspi_accessible_get_host_application return an AtspiAccessible
- Date: Tue, 9 Nov 2010 09:07:34 +0000 (UTC)
commit 23af25b18fe03202e4fe130e8479936fed6cfec0
Author: Mike Gorse <mgorse novell com>
Date: Tue Nov 9 04:07:52 2010 -0500
Have atspi_accessible_get_host_application return an AtspiAccessible
atspi/atspi-accessible.c | 11 ++++++-----
atspi/atspi-accessible.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index c66ad00..1c441e1 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -480,14 +480,15 @@ atspi_accessible_get_attributes_as_array (AtspiAccessible *obj, GError **error)
*
* Get the containing #AtspiApplication for an object.
*
- * Returns: the containing AtspiApplication instance for this object.
+ * Returns: (transfer full): the containing AtspiApplication instance for
+ * this object.
*/
-AtspiApplication *
+AtspiAccessible *
atspi_accessible_get_host_application (AtspiAccessible *obj, GError **error)
{
- while (obj->accessible_parent) obj = obj->accessible_parent;
- g_warning ("atspi: TODO: Application interface");
- //return atspi_accessible_get_application (obj);
+ while (obj->accessible_parent && atspi_accessible_get_role (obj->accessible_parent, NULL) != ATSPI_ROLE_DESKTOP_FRAME)
+ obj = obj->accessible_parent;
+ return g_object_ref (obj);
}
#if 0 // TODO: interfaces */
diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h
index 9722aee..d22db4c 100644
--- a/atspi/atspi-accessible.h
+++ b/atspi/atspi-accessible.h
@@ -95,7 +95,7 @@ GHashTable * atspi_accessible_get_attributes (AtspiAccessible *obj, GError **err
GArray * atspi_accessible_get_attributes_as_array (AtspiAccessible *obj, GError **error);
-AtspiApplication * atspi_accessible_get_host_application (AtspiAccessible *obj, GError **error);
+AtspiAccessible * atspi_accessible_get_host_application (AtspiAccessible *obj, GError **error);
AtspiComponent * atspi_accessible_get_component (AtspiAccessible *accessible);
#endif /* _ATSPI_ACCESSIBLE_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]