From f5d90a81c42378cc7a640d929ff8a97d8dc68e9e Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Wed, 14 Jun 2017 11:30:58 +0900 Subject: [PATCH] atspi: "GetNavigableAtPoint" sends deputy object The deputy means embedding side object works for embedded object. If there is no object at point on embedded side, then the deputy object should have highlight. So far the deputy object is elm_access, and the elm_access takes highlight. So there is no chance to have highlight on embedded side. Change-Id: Id3fd144f74784f2630215c401b93c56a87f388e3 --- src/lib/elm_atspi_bridge.c | 52 ++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c index 554926bbe..18ec64c09 100644 --- a/src/lib/elm_atspi_bridge.c +++ b/src/lib/elm_atspi_bridge.c @@ -946,9 +946,12 @@ _accessible_get_neighbor(const Eldbus_Service_Interface *iface EINA_UNUSED, cons Eo *root = _bridge_object_from_path(bridge, root_path); // TIZEN_ONLY(20161213) - do not response if ecore evas is obscured - const Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(root)); - if (ecore_evas_obscured_get(ee)) - return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "ecore evas is obscured."); + if (root) + { + const Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(root)); + if (ecore_evas_obscured_get(ee)) + return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "ecore evas is obscured."); + } // ret = eldbus_message_method_return_new(msg); @@ -1010,15 +1013,54 @@ _accessible_get_navigable_at_point(const Eldbus_Service_Interface *iface EINA_UN Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE; Eo *accessible = _calculate_navigable_accessible_at_point(bridge, obj, type, x, y); + + /* Check deputy */ + Eo *deputy = NULL; + if (accessible && eo_isa(accessible, ELM_ACCESS_CLASS)) + { + Evas_Object *parent = elm_widget_parent_get(accessible); + + Elm_Widget_Smart_Data *wd; + wd = eo_data_scope_get(parent, ELM_WIDGET_CLASS); + if (wd) + { + Eina_List *l; + Evas_Object *widget; + + EINA_LIST_FOREACH(wd->subobjs, l, widget) + { + Eo *proxy; + + proxy = evas_object_data_get(widget, "__widget_proxy"); + if (proxy) + { + int px, py, pw, ph; + evas_object_geometry_get(widget, &px, &py, &pw, &ph); + if (x >= px && x <= px + pw && y >= py && y <= py +ph) + { + /* proxy is also selectable */ + deputy = accessible; + accessible = proxy; + break; + } + } + } + } + } + _bridge_iter_object_reference_append(bridge, iter, accessible); _bridge_object_register(bridge, accessible); const char *obj_bus_name = NULL, *ret_bus_name = NULL; _object_get_bus_name_and_path(bridge, obj, &obj_bus_name, NULL); if (accessible) _object_get_bus_name_and_path(bridge, accessible, &ret_bus_name, NULL); - unsigned char recurse = obj_bus_name && ret_bus_name && strcmp(obj_bus_name, ret_bus_name) != 0; eldbus_message_iter_basic_append(iter, 'y', recurse); + + /* Send deputy */ + _bridge_iter_object_reference_append(bridge, iter, deputy); + _bridge_object_register(bridge, deputy); + return ret; } // @@ -1330,7 +1372,7 @@ fail: static const Eldbus_Method accessible_methods[] = { // TIZEN_ONLY(20170310) - implementation of get object under coordinates for accessibility - { "GetNavigableAtPoint", ELDBUS_ARGS({"i", "x"}, {"i", "y"}, {"u", "coord_type"}), ELDBUS_ARGS({"(so)y", "accessible"}), _accessible_get_navigable_at_point, 0 }, + { "GetNavigableAtPoint", ELDBUS_ARGS({"i", "x"}, {"i", "y"}, {"u", "coord_type"}), ELDBUS_ARGS({"(so)y", "accessible"}, {"(so)", "deputy"}), _accessible_get_navigable_at_point, 0 }, { "GetNeighbor", ELDBUS_ARGS({"s", "current"}, {"i", "direction"}, {"i", "force_next"}), ELDBUS_ARGS({"(so)y", "accessible"}), _accessible_get_neighbor, 0 }, // { "GetChildAtIndex", ELDBUS_ARGS({"i", "index"}), ELDBUS_ARGS({"(so)", "Accessible"}), _accessible_child_at_index, 0 }, -- 2.34.1