From d8dac4f075b9dd3423c7b52ad14680a93d305778 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 8 Dec 2017 19:29:58 +0530 Subject: [PATCH] elm: [atspi][panel] Adds accessibility support for the panel widget. Panel handles similar popups. When open or close it sends signal to screen-reader. orig patch: ebc340ef13fdab63a07f6a58af54f00d84c92eb8 Change-Id: I5124d0398c410d33335705d9bbe4577eb9b3bd9b Signed-off-by: Shilpa Singh --- src/lib/elementary/elm_atspi_bridge.c | 1 - src/lib/elementary/elm_panel.c | 40 +++++++++++++++++++++++++++++++++++ src/lib/elementary/elm_panel.eo | 3 +++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c index 44b770e..7bc9243 100644 --- a/src/lib/elementary/elm_atspi_bridge.c +++ b/src/lib/elementary/elm_atspi_bridge.c @@ -4202,7 +4202,6 @@ static unsigned char _accept_object_check_role(accessibility_navigation_pointer_ case ATSPI_ROLE_TOOL_BAR: case ATSPI_ROLE_REDUNDANT_OBJECT: case ATSPI_ROLE_COLOR_CHOOSER: - case ATSPI_ROLE_PANEL: case ATSPI_ROLE_TREE_TABLE: case ATSPI_ROLE_PAGE_TAB_LIST: case ATSPI_ROLE_PAGE_TAB: diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c index 4b7b1a1..ef57284 100644 --- a/src/lib/elementary/elm_panel.c +++ b/src/lib/elementary/elm_panel.c @@ -135,6 +135,16 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access) } } +// TIZEN_ONLY(20170829): [atspi][panel] Adds accessibility support for the panel widget. +static void +_accessible_panel_hidden_set(Evas_Object* obj, Eina_Bool is_hidden) +{ + is_hidden = !!is_hidden; + efl_access_can_highlight_set(obj, !is_hidden); + efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_SHOWING, !is_hidden); +} +// + static void _orient_set_do(Evas_Object *obj) { @@ -337,6 +347,9 @@ _drawer_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim) else elm_interface_scrollable_content_region_show (obj, x, y, w, h); + // TIZEN_ONLY(20170829): [atspi][panel] Adds accessibility support for the panel widget. + _accessible_panel_hidden_set(obj, EINA_FALSE); + // } static void @@ -395,6 +408,9 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim) elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm"); } } + // TIZEN_ONLY(20170829) : [atspi][panel] Adds accessibility support for the panel widget. + _accessible_panel_hidden_set(obj, EINA_TRUE); + // } static void @@ -430,12 +446,18 @@ _panel_toggle(void *data EINA_UNUSED, elm_layout_signal_emit(obj, "elm,action,show", "elm"); sd->hidden = EINA_FALSE; evas_object_repeat_events_set(obj, EINA_FALSE); + // TIZEN_ONLY(20170829) : [atspi][panel] Adds accessibility support for the panel widget. + _accessible_panel_hidden_set(obj, sd->hidden); + // } else { elm_layout_signal_emit(obj, "elm,action,hide", "elm"); sd->hidden = EINA_TRUE; evas_object_repeat_events_set(obj, EINA_TRUE); + // TIZEN_ONLY(20170829) : [atspi][panel] Adds accessibility support for the panel widget. + _accessible_panel_hidden_set(obj, sd->hidden); + // } //if the panel is hidden, make this thing unfocusable @@ -1420,6 +1442,24 @@ _elm_panel_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Pan return &atspi_actions[0]; } +// TIZEN_ONLY(20170829) : [atspi][panel] Adds accessibility support for the panel widget. +EOLIAN static Elm_Atspi_State_Set +_elm_panel_efl_access_state_set_get(Eo *obj, Elm_Panel_Data *sd EINA_UNUSED) +{ + Elm_Access_State_Set ret; + ret = efl_access_state_set_get(efl_super(obj, MY_CLASS)); + + if (!sd->hidden) + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SHOWING); + else + STATE_TYPE_UNSET(ret, EFL_ACCESS_STATE_SHOWING); + + STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MODAL); + + return ret; +} +// + /* Efl.Part begin */ ELM_PART_OVERRIDE(elm_panel, ELM_PANEL, Elm_Panel_Data) diff --git a/src/lib/elementary/elm_panel.eo b/src/lib/elementary/elm_panel.eo index 107b1ae..eeebe5a 100644 --- a/src/lib/elementary/elm_panel.eo +++ b/src/lib/elementary/elm_panel.eo @@ -85,6 +85,9 @@ class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, Elm.Widget.widget_event; Elm.Widget.interest_region { get; } Efl.Access.Widget.Action.elm_actions { get; } + // TIZEN_ONLY(20170829): [atspi][panel] Adds accessibility support for the panel widget. + Efl.Access.state_set { get; } + // Efl.Part.part; } events { -- 2.7.4