+static AtspiAccessible *_get_object_in_relation(AtspiAccessible * source, AtspiRelationType search_type)
+{
+ GArray *relations;
+ AtspiAccessible *ret = NULL;
+ AtspiRelation *relation;
+ AtspiRelationType type;
+ int i;
+ if (source) {
+ relations = atspi_accessible_get_relation_set(source, NULL);
+ if (relations) {
+ for (i = 0; i < relations->len; i++) {
+ relation = g_array_index(relations, AtspiRelation *, i);
+ type = atspi_relation_get_relation_type(relation);
+
+ if (type == search_type) {
+ ret = atspi_relation_get_target(relation, 0);
+ break;
+ }
+ }
+ g_array_free(relations, TRUE);
+ }
+ }
+ return ret;
+}
+