From: JunsuChoi Date: Fri, 26 Jan 2018 09:07:07 +0000 (+0900) Subject: Add attributes_get for widget item. X-Git-Tag: accepted/tizen/unified/20180202.115326~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F168413%2F1;p=platform%2Fupstream%2Felementary.git Add attributes_get for widget item. Add widget item to provide attribute for style. This is also an upstream code. ---------------------------------------------------------------------- efl_access: Add attribute_append, attributes_clear APIs Summary: Add attribute append and attributes clear API, attributes of widget/widget_item helps in adding additional information about the widget/widget item in the form of key-value pair. Test Plan: Query the attributes using atspi_accessible_get_attributes in atspi_client and an hash table consisting of updates attributes should be returned. Signed-Off By: Shilpa Singh Signed-Off By: Lukasz Wlazly Reviewers: kimcinoo, lukasz.stanislawski Subscribers: cedric, govi, rajeshps, jpeg Differential Revision: https://phab.enlightenment.org/D5510 Change-Id: I5c64828b8accab550c980b0f4a80e7bc4770413e --- diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index b759518..7e11a78 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -4863,18 +4863,6 @@ _elm_widget_item_eo_base_destructor(Eo *eo_item, Elm_Widget_Item_Data *item) if (item->atspi_translation_domain) eina_stringshare_del(item->atspi_translation_domain); // - //Tizen Only(20160728) free attribute list - if (item->attr_list) - { - Elm_Atspi_Attribute *attr; - EINA_LIST_FREE(item->attr_list, attr) - { - eina_stringshare_del(attr->key); - eina_stringshare_del(attr->value); - free(attr); - } - } - // //TIZEN_ONLY(20161013): clean up elm color class feature if (item->color_classes) @@ -6332,18 +6320,6 @@ _elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) if (sd->atspi_translation_domain) eina_stringshare_del(sd->atspi_translation_domain); // - //Tizen Only(20160728) free attribute list - if (sd->attr_list) - { - Elm_Atspi_Attribute *attr; - EINA_LIST_FREE(sd->attr_list, attr) - { - eina_stringshare_del(attr->key); - eina_stringshare_del(attr->value); - free(attr); - } - } - // eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor()); sd->on_destroy = EINA_FALSE; @@ -7120,6 +7096,22 @@ _elm_widget_elm_interface_atspi_accessible_attributes_get(Eo *obj, Elm_Widget_Sm return attr_list; } +EOLIAN static Eina_List * +_elm_widget_item_elm_interface_atspi_accessible_attributes_get(Eo *eo_item, Elm_Widget_Item_Data *pd EINA_UNUSED) +{ + Eina_List *attr_list = NULL; + eo_do_super(eo_item, ELM_WIDGET_ITEM_CLASS, attr_list = elm_interface_atspi_accessible_attributes_get()); + Elm_Atspi_Attribute *attr = NULL; + attr = calloc(1, sizeof(Elm_Atspi_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; +} + //TIZEN_ONLY(20150709) : atspi relations api EOLIAN static Elm_Atspi_Relation_Set _elm_widget_elm_interface_atspi_accessible_relation_set_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index 2334f66..2621701 100644 --- a/src/lib/elm_widget.h +++ b/src/lib/elm_widget.h @@ -426,9 +426,6 @@ typedef struct _Elm_Widget_Smart_Data //TIZEN_ONLY(20150731) : add i18n support for name and description const char *atspi_translation_domain; /// - //TIZEN_ONLY(20160725): Add attributes set function and store the list - Eina_List *attr_list; - // /* this is a hook to be set on-the-fly on widgets. this is code * handling the request of showing a specific region from an inner @@ -687,9 +684,6 @@ struct _Elm_Widget_Item_Data Elm_Atspi_Relation_Set atspi_custom_relations; /**< Developer-defined accessiblity relations */ /////////////////////////////////// const char *name; - //TIZEN_ONLY(20160725): Add attributes set function and store the list - Eina_List *attr_list; - // //TIZEN_ONLY(20150731) : add i18n support for name and description const char *atspi_translation_domain; /// diff --git a/src/lib/elm_widget_item.eo b/src/lib/elm_widget_item.eo index c95bf7d..7f37512 100644 --- a/src/lib/elm_widget_item.eo +++ b/src/lib/elm_widget_item.eo @@ -683,6 +683,7 @@ class Elm.Widget_Item (Eo.Base, Elm_Interface_Atspi_Accessible, // Elm_Interface_Atspi_Accessible.state_set.get; Elm_Interface_Atspi_Accessible.parent.get; + Elm_Interface_Atspi_Accessible.attributes.get; //TIZEN_ONLY(20150709) : atspi relations api Elm_Interface_Atspi_Accessible.relationship_append; Elm_Interface_Atspi_Accessible.relationship_remove;