kimcinoo pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a2c342270c656acebbc7004f43fae13fa0a8e8aa
commit a2c342270c656acebbc7004f43fae13fa0a8e8aa Author: Shilpa Singh <[email protected]> Date: Thu Nov 23 12:07:52 2017 +0900 efl_access: Add reading_info_type set/get APIs Summary: Information obtained by atspi client is name, role, description, state of an object. reading_info_type_set/get APIs give control to application to decide on the information that can be exposed. Test Plan: The reading info is added as an attribute of an accessible object, on query of attribute, reading_info_type and corresponding character buffer should be given to ATSPI clients. Reviewers: kimcinoo Subscribers: cedric, govi, rajeshps, jpeg Differential Revision: https://phab.enlightenment.org/D5524 --- src/lib/elementary/efl_access.c | 37 +++++++++++++++++++++++++++++++++++++ src/lib/elementary/efl_access.eo | 20 ++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/src/lib/elementary/efl_access.c b/src/lib/elementary/efl_access.c index dc02dbb703..2ed5dde41c 100644 --- a/src/lib/elementary/efl_access.c +++ b/src/lib/elementary/efl_access.c @@ -129,6 +129,7 @@ struct _Efl_Access_Data const char *description; const char *translation_domain; Efl_Access_Role role; + Efl_Access_Reading_Info_Type reading_info; Efl_Access_Type type: 2; }; @@ -253,6 +254,42 @@ EOLIAN static void _efl_access_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_ pd->attr_list = NULL; } +EOLIAN static void +_efl_access_reading_info_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Reading_Info_Type reading_info) +{ + Eina_Strbuf *buf = NULL; + pd->reading_info = reading_info; + buf = eina_strbuf_new(); + eina_strbuf_reset(buf); + if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME)) + { + eina_strbuf_append(buf, "name"); + eina_strbuf_append_char(buf, '|'); + } + if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE)) + { + eina_strbuf_append(buf, "role"); + eina_strbuf_append_char(buf, '|'); + } + if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION)) + { + eina_strbuf_append(buf, "description"); + eina_strbuf_append_char(buf, '|'); + } + if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE)) + { + eina_strbuf_append(buf, "state"); + } + efl_access_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf)); + eina_strbuf_free(buf); +} + +EOLIAN Efl_Access_Reading_Info_Type +_efl_access_reading_info_type_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd) +{ + return pd->reading_info; +} + EOLIAN static Efl_Access_Role _efl_access_role_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED) { diff --git a/src/lib/elementary/efl_access.eo b/src/lib/elementary/efl_access.eo index 360832b28f..d32be85faa 100644 --- a/src/lib/elementary/efl_access.eo +++ b/src/lib/elementary/efl_access.eo @@ -192,6 +192,15 @@ enum Efl.Access.Relation_Type last_defined, [[Last enum entry sentinel]] } +enum Efl.Access.Reading.Info.Type +{ + [[The accessible Reading information type that can be read.]] + name = 1 << 0, [[Name should be read]] + role = 1 << 1, [[Role should be read]] + description = 1 << 2, [[description should be read.]] + state = 1 << 3, [[State should be read.]] +} + type Efl.Access.State_Set: uint64; [[Accessibility object state set.]] struct Efl.Access.Event.Handler; [[Accessibility event listener]] @@ -315,6 +324,17 @@ mixin Efl.Access (Efl.Interface, Efl.Object) \@internal ]] } + @property reading_info_type @protected { + get { + [[Gets reading information types of an accessible object.]] + } + set { + [[Sets reading information of an accessible object.]] + } + values { + reading_info: Efl.Access.Reading.Info.Type; [[Reading information types]] + } + } @property index_in_parent @protected @beta { [[Gets index of the child in parent's children list.]] get { --
