struct _Efl_Access_Data
{
- Efl_Access_Role role;
+ Efl_Access_Relation_Set relations;
+ Eina_List *attr_list;
const char *name;
const char *description;
const char *translation_domain;
- Efl_Access_Relation_Set relations;
+ Efl_Access_Role role;
Efl_Access_Type type: 2;
};
EOLIAN Eina_List*
_efl_access_attributes_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
{
- WRN("The %s object does not implement the \"accessible_attributes_set\" function.",
- efl_class_name_get(efl_class_get(obj)));
- return NULL;
+ Eina_List *attr_list = NULL;
+ if (pd->attr_list)
+ {
+ Eina_List *l = NULL;
+ Efl_Access_Attribute *t_attr = NULL;
+ EINA_LIST_FOREACH(pd->attr_list, l, t_attr)
+ {
+ Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr)
+ return attr_list;
+
+ attr->key = eina_stringshare_add(t_attr->key);
+ attr->value = eina_stringshare_add(t_attr->value);
+ attr_list = eina_list_append(attr_list, attr);
+ }
+ }
+ return attr_list;
+}
+
+EOLIAN static void
+_efl_access_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED, const char *key, const char *value)
+{
+ Eina_List *l;
+ Efl_Access_Attribute *attr = NULL;
+
+ if (!key || !value) return;
+
+ /* Check existing attributes has this key */
+ EINA_LIST_FOREACH(pd->attr_list, l, attr)
+ {
+ if (!strcmp((const char *)attr->key, key))
+ {
+ eina_stringshare_replace(&attr->value, value);
+ return;
+ }
+ }
+
+ /* Add new attribute */
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr) return;
+
+ attr->key = eina_stringshare_add(key);
+ attr->value = eina_stringshare_add(value);
+ pd->attr_list = eina_list_append(pd->attr_list, attr);
+}
+
+EOLIAN static void _efl_access_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
+{
+ if (!pd->attr_list) return;
+ Efl_Access_Attribute *attr;
+ EINA_LIST_FREE(pd->attr_list, attr)
+ {
+ eina_stringshare_del(attr->key);
+ eina_stringshare_del(attr->value);
+ free(attr);
+ }
+ pd->attr_list = NULL;
}
EOLIAN static Efl_Access_Role
get {
}
values {
- /* FIXME: API for attribute free */
- attributes: list<ptr(Efl.Access.Attribute) @owned> @owned; [[List of object attributes]]
+ attributes: list<ptr(Efl.Access.Attribute) @owned> @owned; [[List of object attributes, Must be freed by the user]]
}
}
+ attribute_append {
+ [[Add key-value pair identifying object extra attributes
+ ]]
+ params {
+ @in key: const(string); [[The string key to give extra information]]
+ @in value: const(string); [[The string value to give extra information]]
+ }
+ }
+ attributes_clear {
+ [[Removes all attributes in accessible object.
+
+ \@internal
+ ]]
+ }
@property index_in_parent @protected @beta {
[[Gets index of the child in parent's children list.]]
get {
}
eina_hash_free(item->labels);
+ efl_access_attributes_clear(eo_item);
efl_access_removed(eo_item);
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
efl_event_callback_del(sd->manager.provider, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
sd->manager.provider = NULL;
}
-
+ efl_access_attributes_clear(obj);
efl_access_removed(obj);
if (sd->logical.parent)
{
EOLIAN static Eina_List*
_elm_widget_efl_access_attributes_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
- Eina_List *ret = NULL;
- Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (!attr) return NULL;
+ Eina_List *attr_list = NULL;
- attr->key = eina_stringshare_add("type");
- attr->value = eina_stringshare_add(evas_object_type_get(obj));
+ attr_list = efl_access_attributes_get(efl_super(obj, ELM_WIDGET_CLASS));
- ret = eina_list_append(ret, attr);
- return ret;
+ //Add type and style information in addition.
+ Efl_Access_Attribute *attr = NULL;
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("type");
+ attr->value = eina_stringshare_add(elm_widget_type_get(obj));
+ attr_list = eina_list_append(attr_list, attr);
+ }
+
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("style");
+ attr->value = eina_stringshare_add(elm_widget_style_get(obj));
+ attr_list = eina_list_append(attr_list, attr);
+ }
+
+ return attr_list;
+}
+
+EOLIAN static Eina_List *
+_elm_widget_item_efl_access_attributes_get(Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ Eina_List *attr_list = NULL;
+ attr_list = efl_access_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
+ Efl_Access_Attribute *attr = NULL;
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (attr)
+ {
+ attr->key = eina_stringshare_add("style");
+ attr->value = eina_stringshare_add(elm_object_item_style_get(eo_item));
+ attr_list = eina_list_append(attr_list, attr);
+ }
+ return attr_list;
}
EOLIAN static Eina_Rect
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Access.state_set { get; }
+ Efl.Access.attributes { get; }
Efl.Access.Component.extents { get; set; }
Efl.Access.Component.alpha { get; }
Efl.Access.Component.layer { get; }