From 739f5631b457c9548d00b4707e693afc43ea530f Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Tue, 12 Dec 2017 20:25:40 +0530 Subject: [PATCH] atspi: handle atspi proxy connection at runtime The following cases make atspi proxy work incorrectly. [case 1] 1. screen reader on, then a11y order would be A1(embedding, deputy) - B1(embedded) - B2(embedded) - A2(embedding) 2. make A2 grab highlight 3. go previous, then A1 grabs highlight. but expected result is that the B2 grabs highlight [case 2] 1. screen reader on, then a11y order would be A1(embedding, deputy) - B1(embedded) - B2(embedded) - A2(embedding) 2. make A1 grab highlight 3. go next, then B1 grabs highlight. This means that the proxy connection is made properly. 4. screen reader off 5. screen reader on, then a11y order is A1(embedding, deputy) - A2(embedding) but the following is expected result as step 1 A1(embedding, deputy) - B1(embedded) - B2(embedded) - A2(embedding) So far the pory connects if elm_interface_atspi_children_get is called. So there is no chance to make connection for the [case 1]. When atspi is disabled, then all atspi related interface is closed. But the proxy related resources are not removed. If atspi is enabled again, then newly created interface is used on new BUS. And the proxy related resources are reused. So the [case 2] happens. This patch set depends on screen-connector to use "widget,create" signal to connect proxy on elementary side. This should be removed, and we have to provide proper API to be used on screen-connector side to connect proxy. orig: 4b26fedd8b3366ac3e5bc89e8e09a5e668616dfd Change-Id: I4f3a68c9eca271c9ba3b38bff9be3df1794f27e5 Signed-off-by: Shilpa Singh --- src/lib/elementary/efl_ui_layout.c | 14 ++++++++++++++ src/lib/elementary/efl_ui_win.c | 24 ++++++++++++++++++++++++ src/lib/elementary/efl_ui_win_socket.c | 20 +++++--------------- src/lib/elementary/elm_atspi_proxy.eo | 1 + src/lib/elementary/elm_widget.c | 26 ++++++++++++++++++++++++++ src/lib/elementary/elm_widget.eo | 11 ++++++++++- 6 files changed, 80 insertions(+), 16 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 0390a89..014fd8d 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2093,6 +2093,14 @@ elm_layout_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +//TIZEN_ONLY(20170621) handle atspi proxy connection at runtime +static void +_widget_created_cb(void *data EINA_UNUSED, Evas_Object *obj, void *ev EINA_UNUSED) +{ + elm_widget_atspi_plug_type_proxy_get(obj); +} +// + EOLIAN static Eo * _efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) { @@ -2102,6 +2110,12 @@ _efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER); + //TIZEN_ONLY(20170621) handle atspi proxy connection at runtime + /* FIXME: This makes dependency on screen-connector. The screen-connector + should use new API to handle atspi proxy connection at runtime. */ + evas_object_smart_callback_add(obj, "widget,created", _widget_created_cb, NULL); + // + return obj; } diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 0d860f4..b72ea47 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -4180,6 +4180,30 @@ _elm_win_atspi(Eina_Bool is_atspi) { const Eina_List *l; Evas_Object *obj; + + EINA_LIST_FOREACH(_elm_win_list, l, obj) + { + elm_widget_atspi(obj, is_atspi); + + if (!is_atspi) + { + _access_socket_proxy_unref(obj); + } + else + { + _access_socket_proxy_listen(obj); + } + } +} +// +// +// + +void +_elm_win_atspi(Eina_Bool is_atspi) +{ + const Eina_List *l; + Evas_Object *obj; Efl_Access_State_Set ss; EINA_LIST_FOREACH(_elm_win_list, l, obj) diff --git a/src/lib/elementary/efl_ui_win_socket.c b/src/lib/elementary/efl_ui_win_socket.c index 46fd047..54f647a 100644 --- a/src/lib/elementary/efl_ui_win_socket.c +++ b/src/lib/elementary/efl_ui_win_socket.c @@ -101,23 +101,13 @@ _efl_ui_win_socket_efl_gfx_visible_set(Eo *obj, Efl_Ui_Win_Socket_Data *sd EINA_ efl_gfx_visible_set(efl_super(obj, EFL_UI_WIN_SOCKET_CLASS), vis); // TIZEN_ONLY(20160705) - enable atspi_proxy to work - /* _elm_atspi_enabled() is not necessary, because it could be disconnected at this point */ - if (_elm_config->atspi_mode) + if (vis) { - const char *plug_id_2; - if (vis) + if (_elm_atspi_enabled()) { - if ((plug_id_2 = evas_object_data_get(obj, "___PLUGID")) != NULL) - { - char *svcname, *svcnum; - if (!sd->socket_proxy && _elm_atspi_bridge_plug_id_split(plug_id_2, &svcname, &svcnum)) - { - sd->socket_proxy = _elm_atspi_bridge_utils_proxy_create(obj, svcname, atoi(svcnum), ELM_ATSPI_PROXY_TYPE_SOCKET); - elm_atspi_bridge_utils_proxy_listen(sd->socket_proxy); - free(svcname); - free(svcnum); - } - } + //TIZEN_ONLY(20170613) -listen if atspi is enabled + _access_socket_proxy_listen(obj); + // } } // diff --git a/src/lib/elementary/elm_atspi_proxy.eo b/src/lib/elementary/elm_atspi_proxy.eo index 7bdc5ed..855da92 100644 --- a/src/lib/elementary/elm_atspi_proxy.eo +++ b/src/lib/elementary/elm_atspi_proxy.eo @@ -43,6 +43,7 @@ class Elm.Atspi.Proxy (Elm.Widget) Efl.Object.destructor; Efl.Access.children { get; } Efl.Access.parent { get; } + Elm.Widget.atspi; } events { connected; diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index de48a56..9cd24b8 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -2950,6 +2950,32 @@ elm_widget_atspi(Evas_Object *obj, Eina_Bool is_atspi) { ret &= elm_widget_atspi(child, is_atspi); } + elm_obj_widget_atspi(obj, is_atspi); + + return ret; +} + +EOLIAN static void +_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool is_atspi EINA_UNUSED) +{ +} +// +// +// + +EOLIAN static Elm_Theme* +_elm_widget_theme_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) +{ + Eina_List *l, *children; + Evas_Object *child; + Eina_Bool ret = EINA_TRUE; + + API_ENTRY return EINA_FALSE; + children = efl_access_children_get(obj); + EINA_LIST_FOREACH(children, l, child) + { + ret &= elm_widget_atspi(child, is_atspi); + } efl_ui_widget_atspi(obj, is_atspi); return ret; diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index 6bab414..eb4b6cd 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -238,13 +238,22 @@ abstract Elm.Widget (Efl.Canvas.Group, Efl.Access, //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, //register/unregister access objects accordingly. + // TIZEN_ONLY(20170516): connect to at-spi dbus based on org.a11y.Status.IsEnabled property screen_reader { - [['Virtual' function on the widget being set access.]] + [['Virtual' function on the widget being set screen reader.]] params { @in is_screen_reader: bool; } legacy: null; } + //TIZEN_ONLY(20170621) handle atspi proxy connection at runtime + atspi { + [['Virtual' function on the widget being set atspi.]] + params { + @in is_atspi: bool; + } + legacy: null; + } // //TIZEN_ONLY(20170621) handle atspi proxy connection at runtime atspi { -- 2.7.4