struct _Efl_Access_Object_Data
{
- Eina_List *relations;
+ Efl_Access_Relation_Set relations;
//TIZEN_ONLY(20190922): add name callback, description callback.
Efl_Access_Reading_Info_Cb_Item name_cb_item;
Efl_Access_Reading_Info_Cb_Item description_cb_item;
{
children = eina_list_append(children, chld);
//TIZEN_ONLY(20181024): Fix parent-children incosistencies in atspi tree
- efl_access_object_access_parent_set(chld, (Eo *)obj);
+ efl_access_object_access_parent_set(chld, obj);
//
}
}
}
//
-EOLIAN Eina_Iterator *
-_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED)
+EOLIAN Efl_Access_Relation_Set
+_efl_access_object_relation_set_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
{
//TIZEN_ONLY(20171115) Fixed the bugs and warnings in atspi relationship APIS
- //return eina_list_iterator_new(pd->relations);
+ //return efl_access_relation_set_clone(pd->relations);
WRN("The %s object does not implement the \"accessible_relation_set\" function.",
efl_class_name_get(efl_class_get(obj)));
return NULL;
return pd->translation_domain;
}
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
-static void
-_efl_access_relation_free(Efl_Access_Relation *relation)
+EAPI void
+efl_access_relation_free(Efl_Access_Relation *relation)
{
eina_list_free(relation->objects);
free(relation);
}
-//
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
+EAPI Efl_Access_Relation *
+efl_access_relation_clone(const Efl_Access_Relation *relation)
+{
+ Efl_Access_Relation *ret = calloc(1, sizeof(Efl_Access_Relation));
+ if (!ret) return NULL;
+
+ ret->type = relation->type;
+ ret->objects = eina_list_clone(relation->objects);
+ return ret;
+}
+
static void
_on_rel_obj_del(void *data, const Efl_Event *event)
{
- Eina_List **relations = data;
-//
-
+ Efl_Access_Relation_Set *set = data;
Efl_Access_Relation *rel;
Eina_List *l, *l2, *p, *p2;
Eo *rel_obj;
- // TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
- EINA_LIST_FOREACH_SAFE(*relations, l, l2, rel)
- //
+ EINA_LIST_FOREACH_SAFE(*set, l, l2, rel)
{
EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
{
- if (rel_obj == event->object)
+ if (rel_obj == event->object)
rel->objects = eina_list_remove_list(rel->objects, p);
}
if (!rel->objects)
{
- // TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
- *relations = eina_list_remove_list(*relations, l);
- //
+ *set = eina_list_remove_list(*set, l);
free(rel);
}
}
}
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
-static void
-_efl_access_relation_set_relation_type_remove(Eina_List **set, Efl_Access_Relation_Type type)
-{
- Eina_List *l;
- Efl_Access_Relation *rel;
- Eo *obj;
-
- EINA_LIST_FOREACH(*set, l, rel)
- {
- if (rel->type == type)
- {
- EINA_LIST_FOREACH(rel->objects, l, obj)
- efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
- *set = eina_list_remove(*set, rel);
- _efl_access_relation_free(rel);
- return;
- }
- }
-}
-
-static void
-_efl_access_relation_set_free(Eina_List **relations)
-{
- Efl_Access_Relation *rel;
- Eo *obj;
-
- EINA_LIST_FREE(*relations, rel)
- {
- Eina_List *l;
-
- EINA_LIST_FOREACH(rel->objects, l, obj)
- efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, relations);
- eina_list_free(rel->objects);
- free(rel);
- }
-}
-//
-
-static void
-efl_access_relation_set_free(Efl_Access_Object_Data *sd)
-{
- // TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
- _efl_access_relation_set_free(&sd->relations);
- //
-}
-
-
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
-static Eina_Bool
-_efl_access_object_relation_append(Eina_List **relations, Efl_Access_Relation_Type type, const Eo *relation)
+EAPI Eina_Bool
+efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj)
{
Efl_Access_Relation *rel;
- //TIZEN_ONLY(20171208): elm: [atspi]Demote relation object if the object exist
Eina_List *l, *ll;
- //
- EINA_LIST_FOREACH(*relations, l, rel)
+ if (!efl_isa(rel_obj, EFL_ACCESS_OBJECT_MIXIN))
+ return EINA_FALSE;
+
+ EINA_LIST_FOREACH(*set, l, rel)
{
if (rel->type == type)
{
- //TIZEN_ONLY(20171208): elm: [atspi]Demote relation object if the object exist
- ll = eina_list_data_find(rel->objects, relation);
+ ll = eina_list_data_find_list(rel->objects, rel_obj);
if (!ll)
- //
{
- rel->objects = eina_list_append(rel->objects, relation);
- efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, relations);
+ rel->objects = eina_list_append(rel->objects, rel_obj);
+ efl_event_callback_add((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
}
- //TIZEN_ONLY(20171208): elm: [atspi]Demote relation object if the object exist
else
{
rel->objects = eina_list_demote_list(rel->objects, ll);
}
- //
return EINA_TRUE;
}
}
if (!rel) return EINA_FALSE;
rel->type = type;
- rel->objects = eina_list_append(rel->objects, relation);
- *relations = eina_list_append(*relations, rel);
-
- efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, relations);
+ rel->objects = eina_list_append(rel->objects, rel_obj);
+ *set = eina_list_append(*set, rel);
+ efl_event_callback_add((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
return EINA_TRUE;
}
-//
-EOLIAN static Eina_Bool
-_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
-{
- // TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
- return _efl_access_object_relation_append(&sd->relations, type, relation);
- //
-}
-
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
-static void
-_efl_access_object_relation_remove(Eina_List** relations, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+EAPI void
+efl_access_relation_set_relation_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj)
{
- Efl_Access_Relation *rel;
Eina_List *l;
+ Efl_Access_Relation *rel;
- EINA_LIST_FOREACH(*relations, l, rel)
+ EINA_LIST_FOREACH(*set, l, rel)
{
if (rel->type == type)
{
- if (relation)
+ if (eina_list_data_find(rel->objects, rel_obj))
{
- if (eina_list_data_find(rel->objects, relation))
- {
- efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, relations);
- rel->objects = eina_list_remove(rel->objects, relation);
- }
- if (!rel->objects)
- {
- *relations = eina_list_remove(*relations, rel);
- free(rel);
- }
+ efl_event_callback_del((Eo *) rel_obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
+ rel->objects = eina_list_remove(rel->objects, rel_obj);
}
- else
+ if (!rel->objects)
{
- Eina_List *ll;
- Eo *ro;
-
- EINA_LIST_FOREACH(rel->objects, ll, ro)
- efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del, relations);
- *relations = eina_list_remove(*relations, rel);
- free(rel);
+ *set = eina_list_remove(*set, rel);
+ efl_access_relation_free(rel);
}
- return ;
+ return;
}
}
}
-//
-EOLIAN static void
-_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+EAPI void
+efl_access_relation_set_relation_type_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type)
{
- // TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
- _efl_access_object_relation_remove(&sd->relations, type, relation);
- //
+ Eina_List *l;
+ Efl_Access_Relation *rel;
+ Eo *obj;
+
+ EINA_LIST_FOREACH(*set, l, rel)
+ {
+ if (rel->type == type)
+ {
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
+ *set = eina_list_remove(*set, rel);
+ efl_access_relation_free(rel);
+ return;
+ }
+ }
}
-// TIZEN_ONLY(20190104): Access: Add the missing patch related by Efl.Access_Object.relations_get
-static Efl_Access_Relation *
-_efl_access_relation_clone(const Efl_Access_Relation *relation)
+//TIZEN_ONLY(20171115) Fixed the bugs and warnings in atspi relationship APIS
+EAPI void
+efl_access_relation_set_free(Efl_Access_Relation_Set *set)
{
- Efl_Access_Relation *ret = calloc(1, sizeof(Efl_Access_Relation));
- if (!ret) return NULL;
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+ Eo *obj;
- ret->type = relation->type;
- ret->objects = eina_list_clone(relation->objects);
- return ret;
+ EINA_LIST_FREE(*set, rel)
+ {
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, set);
+ efl_access_relation_free(rel);
+ }
}
-
-static Eina_List *
-_efl_access_relation_set_clone(const Eina_List **set)
+EAPI Efl_Access_Relation_Set
+efl_access_relation_set_clone(const Efl_Access_Relation_Set *set)
{
- Eina_List *ret = NULL;
+ Efl_Access_Relation_Set ret = NULL;
Eina_List *l;
Efl_Access_Relation *rel;
EINA_LIST_FOREACH(*set, l, rel)
{
- Efl_Access_Relation *cpy = _efl_access_relation_clone(rel);
+ Efl_Access_Relation *cpy = efl_access_relation_clone(rel);
ret = eina_list_append(ret, cpy);
}
}
//
+EOLIAN static Eina_Bool
+_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation_obj)
+{
+ return efl_access_relation_set_relation_append(&sd->relations, type, relation_obj);
+}
+
+EOLIAN static void
+_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation_obj)
+{
+ if (relation_obj)
+ efl_access_relation_set_relation_remove(&sd->relations, type, relation_obj);
+ else
+ efl_access_relation_set_relation_type_remove(&sd->relations, type);
+}
+
EOLIAN static void
_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd)
{
- efl_access_relation_set_free(sd);
+ //TIZEN_ONLY(20171115) Fixed the bugs and warnings in atspi relationship APIS
+ efl_access_relation_set_free(&sd->relations);
+ //
sd->relations = NULL;
}
}
EOLIAN void
-_efl_access_object_efl_object_invalidate(Eo *obj, Efl_Access_Object_Data *pd)
-{
- efl_access_relation_set_free(pd);
-
- efl_invalidate(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN));
-}
-
-EOLIAN void
_efl_access_object_efl_object_destructor(Eo *obj, Efl_Access_Object_Data *pd)
{
eina_stringshare_del(pd->name);
eina_stringshare_del(pd->description);
eina_stringshare_del(pd->translation_domain);
+ efl_access_relation_set_free(&pd->relations);
//TIZEN_ONLY(20181211): Fix for missing unregistration of atspi objects
unregister_atspi_object_in_bridge(obj);
//
EAPI Elm_Atspi_Relation_Set
elm_atspi_accessible_relation_set_get(const Elm_Interface_Atspi_Accessible *obj)
{
- Elm_Atspi_Relation_Set relation_set;
- Eina_Iterator *relations = efl_access_object_relations_get(obj);
- Efl_Access_Relation *rel;
- EINA_ITERATOR_FOREACH(relations, rel)
- {
- relation_set = eina_list_append(relation_set, rel);
- }
- eina_iterator_free(relations);
- return eina_list_clone(relation_set);
+ return efl_access_object_relation_set_get(obj);
}
EAPI void
EAPI void elm_atspi_relation_set_free(Elm_Atspi_Relation_Set *set)
{
- _efl_access_relation_set_free(set);
+ efl_access_relation_set_free(set);
}
EAPI Elm_Atspi_Relation_Set elm_atspi_relation_set_clone(const Elm_Atspi_Relation_Set *set)
{
- return _efl_access_relation_set_clone(set);
+ return efl_access_relation_set_clone(set);
}
EAPI void elm_atspi_relation_free(Elm_Atspi_Relation *relation)
{
- _efl_access_relation_free(relation);
+ efl_access_relation_free(relation);
}
EAPI Elm_Atspi_Relation * elm_atspi_relation_clone(const Elm_Atspi_Relation *relation)
{
- return _efl_access_relation_clone(relation);
+ return efl_access_relation_clone(relation);
}
EAPI Eina_Bool elm_atspi_relation_set_relation_append(Elm_Atspi_Relation_Set *set, Elm_Atspi_Relation_Type type, const Eo *rel_obj)
{
- return _efl_access_object_relation_append(set, type, rel_obj);
+ return efl_access_relation_set_relation_append(set, type, rel_obj);
}
EAPI void elm_atspi_relation_set_relation_remove(Elm_Atspi_Relation_Set *set, Elm_Atspi_Relation_Type type, const Eo *rel_obj)
{
- _efl_access_object_relation_remove(set, type, rel_obj);
+ efl_access_relation_set_relation_remove(set, type, rel_obj);
}
EAPI void elm_atspi_relation_set_relation_type_remove(Elm_Atspi_Relation_Set *set, Elm_Atspi_Relation_Type type)
{
- _efl_access_relation_set_relation_type_remove(set, type);
+ efl_access_relation_set_relation_type_remove(set, type);
}
EAPI void elm_atspi_attributes_list_free(Eina_List *list)
event_time: uint; [[gesture occurance time]]
}
+type Efl.Access.Relation_Set: list<ptr(Efl.Access.Relation)>; [[Elementary Accessibility relation set type]]
+
mixin Efl.Access.Object requires Efl.Object
{
[[Accessibility accessible mixin]]
}
}
//
- relations_get @protected @beta @const {
- [[Gets an all relations between accessible object and other accessible objects.]]
- return: iterator<ptr(Efl.Access.Relation)>; [[Accessible relation set]]
+ @property relation_set @protected @beta {
+ get {
+ [[Gets an all relations between accessible object and other accessible objects.]]
+ }
+ values {
+ relations: Efl.Access.Relation_Set; [[Accessible relation set]]
+ }
}
@property role @beta {
get {
}
implements {
Efl.Object.destructor;
- Efl.Object.invalidate;
}
events {
property,changed: string; [[Called when property has changed]]
*/
EAPI void efl_access_attributes_list_free(Eina_List *list);
+/**
+ * Frees relation.
+ */
+EAPI void efl_access_relation_free(Efl_Access_Relation *relation);
+
+/**
+ * Clones relation.
+ */
+EAPI Efl_Access_Relation * efl_access_relation_clone(const Efl_Access_Relation *relation);
+
+/**
+ * Appends relation to relation set
+ */
+EAPI Eina_Bool efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);
+
+/**
+ * Removes relation from relation set
+ */
+EAPI void efl_access_relation_set_relation_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);
+
+/**
+ * Removes all relation from relation set of a given type
+ */
+EAPI void efl_access_relation_set_relation_type_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type);
+
+//TIZEN_ONLY(20171115) Fixed the bugs and warnings in atspi relationship APIS
+/**
+ * Frees Efl_Access_Relation_Set
+ */
+EAPI void efl_access_relation_set_free(Efl_Access_Relation_Set *set);
+
+/**
+ * Clones Efl_Access_Relation_Set
+ */
+EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Relation_Set *set);
+//
+
#ifdef EFL_EO_API_SUPPORT
/**
// TIZEN_ONLY(20150709) : atspi relations api
if (item->atspi_custom_relations)
- elm_atspi_relation_set_free(&item->atspi_custom_relations);
+ efl_access_relation_set_free(&item->atspi_custom_relations);
//
//TIZEN_ONLY(20150731) : add i18n support for name and description
// TIZEN_ONLY(20150709) : atspi relations api
if (sd->atspi_custom_relations)
- elm_atspi_relation_set_free(&sd->atspi_custom_relations);
+ efl_access_relation_set_free(&sd->atspi_custom_relations);
//
//TIZEN_ONLY(20150717) add widget name setter
}
// TIZEN_ONLY(20150709) : atspi relations api
-EOLIAN static Eina_Iterator *
-_efl_ui_widget_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+EOLIAN static Efl_Access_Relation_Set
+_efl_ui_widget_efl_access_object_relation_set_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
- return eina_list_iterator_new(sd->atspi_custom_relations);
+ return efl_access_relation_set_clone(&sd->atspi_custom_relations);
}
-
EOLIAN static Eina_Bool
_efl_ui_widget_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Efl_Access_Relation_Type type, const Eo *relation_obj)
{
- return elm_atspi_relation_set_relation_append(&sd->atspi_custom_relations, type, relation_obj);
+ return efl_access_relation_set_relation_append(&sd->atspi_custom_relations, type, relation_obj);
}
EOLIAN static void
_efl_ui_widget_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Efl_Access_Relation_Type type, const Eo *relation_obj)
{
- elm_atspi_relation_set_relation_remove(&sd->atspi_custom_relations, type, relation_obj);
+ efl_access_relation_set_relation_remove(&sd->atspi_custom_relations, type, relation_obj);
}
EOLIAN static void
_efl_ui_widget_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
- elm_atspi_relation_set_free(&sd->atspi_custom_relations);
+ efl_access_relation_set_free(&sd->atspi_custom_relations);
sd->atspi_custom_relations = NULL;
}
-EOLIAN static Eina_Iterator *
-_elm_widget_item_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd)
+EOLIAN static Elm_Atspi_Relation_Set
+_elm_widget_item_efl_access_object_relation_set_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd)
{
- return eina_list_iterator_new(sd->atspi_custom_relations);
+ return efl_access_relation_set_clone(&sd->atspi_custom_relations);
}
EOLIAN static Eina_Bool
_elm_widget_item_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd, Efl_Access_Relation_Type type, const Eo *relation_obj)
{
- return elm_atspi_relation_set_relation_append(&sd->atspi_custom_relations, type, relation_obj);
+ return efl_access_relation_set_relation_append(&sd->atspi_custom_relations, type, relation_obj);
}
EOLIAN static void
_elm_widget_item_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd, Efl_Access_Relation_Type type, const Eo *relation_obj)
{
- elm_atspi_relation_set_relation_remove(&sd->atspi_custom_relations, type, relation_obj);
+ efl_access_relation_set_relation_remove(&sd->atspi_custom_relations, type, relation_obj);
}
EOLIAN static void
_elm_widget_item_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd)
{
- elm_atspi_relation_set_free(&sd->atspi_custom_relations);
+ efl_access_relation_set_free(&sd->atspi_custom_relations);
sd->atspi_custom_relations = NULL;
}
//////////////////////////////
//
//TIZEN_ONLY(20150709) : atspi relations api
- Efl.Access.Object.relations_get;
+ Efl.Access.Object.relation_set { get;}
Efl.Access.Object.relationship_append;
Efl.Access.Object.relationship_remove;
Efl.Access.Object.relationships_clear;
Eo *rel_obj, *obj = _bridge_object_from_path(bridge, obj_path);
Eldbus_Message *ret = NULL;
Eldbus_Message_Iter *iter = NULL, *iter_array = NULL, *iter_array2 = NULL, *iter_struct;
- const Efl_Access_Relation *rel;
- Eina_List *l;
- Eina_Iterator *it;
+ Efl_Access_Relation *rel;
+ Eina_List *l, *l2;
+ Efl_Access_Relation_Set rels;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
iter_array = eldbus_message_iter_container_new(iter, 'a', "(ua(so))");
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
- it = efl_access_object_relations_get(obj);
- EINA_ITERATOR_FOREACH(it, rel)
+ rels = efl_access_object_relation_set_get(obj);
+
+ EINA_LIST_FOREACH(rels, l, rel)
{
iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
eldbus_message_iter_basic_append(iter_struct, 'u', _elm_relation_to_atspi_relation(rel->type));
iter_array2 = eldbus_message_iter_container_new(iter_struct, 'a', "(so)");
EINA_SAFETY_ON_NULL_GOTO(iter_array2, fail);
- EINA_LIST_FOREACH(rel->objects, l, rel_obj)
+ EINA_LIST_FOREACH(rel->objects, l2, rel_obj)
{
_bridge_iter_object_reference_append(bridge, iter_array2, rel_obj);
_bridge_object_register(bridge, rel_obj);
eldbus_message_iter_container_close(iter_struct, iter_array2);
eldbus_message_iter_container_close(iter_array, iter_struct);
}
- eina_iterator_free(it);
+ //TIZEN_ONLY(20171115) Fixed the bugs and warnings in atspi relationship APIS
+ efl_access_relation_set_free(&rels);
+ //
eldbus_message_iter_container_close(iter, iter_array);
return ret;
Efl_Access_Role role;
Efl_Access_Attribute *attr;
Efl_Access_State_Set states;
+ Efl_Access_Relation_Set rels = NULL;
Efl_Access_Relation *rel;
Eo *relation_obj = NULL;
Eo *parent = NULL;
Eo *child = NULL;
Eina_Bool is_selected = EINA_FALSE;
AtspiRole atspi_role = ATSPI_ROLE_INVALID;
- Eina_Iterator *it;
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
eldbus_message_iter_basic_append(iter, 's', name);
/* name - LABELED_BY relation */
- it = efl_access_object_relations_get(obj);
- EINA_ITERATOR_FOREACH(it, rel)
+ rels = efl_access_object_relation_set_get(obj);
+ EINA_LIST_FOREACH(rels, l, rel)
{
if (rel->type == EFL_ACCESS_RELATION_LABELLED_BY)
{
eldbus_message_iter_basic_append(iter, 'i', selected_child_count);
/* relation object - DESCRIBED_BY */
- EINA_ITERATOR_FOREACH(it, rel)
+ relation_obj = NULL;
+ EINA_LIST_FOREACH(rels, l, rel)
{
if (rel->type == EFL_ACCESS_RELATION_DESCRIBED_BY)
{
}
}
_bridge_iter_object_reference_append(bridge, iter, relation_obj);
- eina_iterator_free(it);
+ efl_access_relation_set_free(&rels);
return ret;
fail:
- if (it) eina_iterator_free(it);
+ if (rels) efl_access_relation_set_free(&rels);
if (ret) eldbus_message_unref(ret);
return NULL;
}
if (ptr)
{
const Eo *source = ptr;
+ Efl_Access_Relation_Set relations;
Efl_Access_Relation_Type expected_relation_type = _atspi_relation_to_elm_relation(type);
- Eina_Iterator *relations = efl_access_object_relations_get(source);
+ relations = efl_access_object_relation_set_get(source);
Efl_Access_Relation *rel;
- EINA_ITERATOR_FOREACH(relations, rel)
+ Eina_List *l;
+ EINA_LIST_FOREACH(relations, l, rel)
{
if (rel->type == expected_relation_type)
{
Eina_List *event_cb;
//TIZEN_ONLY(20150709) add relations atpi
- Eina_List *atspi_custom_relations; /**< Developer-defined accessiblity relations */
+ Efl_Access_Relation_Set atspi_custom_relations; /**< Developer-defined accessiblity relations */
///////////////////////////////////
//TIZEN_ONLY(20150713) : add widget_item name setter
const char *name;
const char *atspi_translation_domain;
///
//TIZEN_ONLY(20150709) add relations atpi
- Eina_List *atspi_custom_relations; /**< Developer-defined accessiblity relations */
+ Efl_Access_Relation_Set atspi_custom_relations; /**< Developer-defined accessiblity relations */
///////////////////////////////////
/***********************************************************************************
//
//TIZEN_ONLY(20150709) : atspi relations api
- Efl.Access.Object.relations_get;
+ Efl.Access.Object.relation_set { get; }
Efl.Access.Object.relationship_append;
Efl.Access.Object.relationship_remove;
Efl.Access.Object.relationships_clear;
{
generate_app();
+ Efl_Access_Relation_Set set;
Efl_Access_Relation *rel, *rel_to, *rel_from;
- Eina_Iterator *it;
- unsigned int i = 0;
+ Eina_List *l;
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- it = efl_access_object_relations_get(g_btn);
+ set = efl_access_object_relation_set_get(g_btn);
- ck_assert(it != NULL);
+ ck_assert(set != NULL);
+ ck_assert(eina_list_count(set) >= 2);
rel_to = rel_from = NULL;
- EINA_ITERATOR_FOREACH(it, rel)
+ EINA_LIST_FOREACH(set, l, rel)
{
- i++;
-
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
rel_from = rel;
}
- ck_assert(i >= 2);
ck_assert(rel_to != NULL);
ck_assert(eina_list_data_find(rel_to->objects, g_bg) != NULL);
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- eina_iterator_free(it);
+ efl_access_relation_set_free(set);
/* Check if append do not procude duplicated relations */
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
- it = efl_access_object_relations_get(g_btn); i = 0;
+ set = efl_access_object_relation_set_get(g_btn);
rel_to = rel_from = NULL;
- EINA_ITERATOR_FOREACH(it, rel)
+ EINA_LIST_FOREACH(set, l, rel)
{
- i++;
-
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
rel_from->objects = eina_list_remove(rel_from->objects, g_win);
ck_assert(eina_list_data_find(rel_from->objects, g_win) == NULL);
- eina_iterator_free(it);
+ efl_access_relation_set_free(set);
+
}
EFL_END_TEST
{
generate_app();
+ Efl_Access_Relation_Set set;
Efl_Access_Relation *rel, *rel_to, *rel_from;
- Eina_Iterator *it;
- unsigned int i = 0;
+ Eina_List *l;
/* Test if removal of single relationship works */
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win);
efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
- it = efl_access_object_relations_get(g_btn);
+ set = efl_access_object_relation_set_get(g_btn);
- ck_assert(it != NULL);
+ ck_assert(set != NULL);
+ ck_assert(eina_list_count(set) >= 1);
rel_to = rel_from = NULL;
- EINA_ITERATOR_FOREACH(it, rel)
+ EINA_LIST_FOREACH(set, l, rel)
{
- i++;
-
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
rel_from = rel;
}
- ck_assert(i >= 1);
-
if (rel_to) ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL);
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- eina_iterator_free(it);
+ efl_access_relation_set_free(set);
/* Test if removal of type relationship works */
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win);
efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL);
- it = efl_access_object_relations_get(g_btn); i = 0;
+ set = efl_access_object_relation_set_get(g_btn);
rel_to = rel_from = NULL;
- EINA_ITERATOR_FOREACH(it, rel)
+ EINA_LIST_FOREACH(set, l, rel)
{
- i++;
-
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
ck_assert(rel_from != NULL);
ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
- eina_iterator_free(it);
+ efl_access_relation_set_free(set);
/* Test if relationship is implicity removed when object is deleted */
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg);
efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg);
efl_del(g_bg);
- it = efl_access_object_relations_get(g_btn); i = 0;
+ set = efl_access_object_relation_set_get(g_btn);
rel_to = rel_from = NULL;
- EINA_ITERATOR_FOREACH(it, rel)
+ EINA_LIST_FOREACH(set, l, rel)
{
- i++;
-
if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO)
rel_to = rel;
if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM)
if (rel_to) ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL);
if (rel_from) ck_assert(eina_list_data_find(rel_from->objects, g_bg) == NULL);
- eina_iterator_free(it);
+ efl_access_relation_set_free(set);
}
EFL_END_TEST
EFL_START_TEST (test_efl_access_object_relationships_clear)
{
+ Efl_Access_Relation_Set set;
Efl_Access_Relation *rel;
- Eina_Iterator *it;
+ Eina_List *l;
generate_app();
efl_access_object_relationships_clear(g_btn);
- it = efl_access_object_relations_get(g_btn);
- EINA_ITERATOR_FOREACH(it, rel)
+ set = efl_access_object_relation_set_get(g_btn);
+ EINA_LIST_FOREACH(set, l, rel)
{
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win)));
ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win)));
}
- eina_iterator_free(it);
+
+ efl_access_relation_set_free(set);
}
EFL_END_TEST