From 5d6437d1d794808792ce92ae422ccf9032975071 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Wed, 2 Aug 2017 21:15:56 +0900 Subject: [PATCH] atspi: handle "gesture_required" attribute The elementary sends the "detail2" information highlight based on the attribute "gesture_required" when an object grabs. If an object has attribute key "gesture_required", and "scroll" for its value, then the "detail2" is 1. Otherwise, the "detail2" is 0. The screen-reader AT client calls "ObjectNeedsScrollGesture" method of e-mod-tizen-screen-reader window manager module with object geometry value, if the "detail2" is 1. Otherwise, the object geometry value is not used. The e-mod-tizen-screen-reader window manager module will send mouse event based on the object geometry. Application side could use this feature setting attribute as below: - elm_atspi_accessible_attribute_append(btn, "gesture_required", "scroll"); This patch set depends on: https://review.tizen.org/gerrit/#/c/142108/ (screen-reader) https://review.tizen.org/gerrit/#/c/142107/ (e-mod-tizen-screen-reader) Change-Id: I0b731ce947be569b2d782fdc21f18c79ffebf70e --- src/lib/elm_atspi_bridge.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c index 9eb6192..6a81045 100644 --- a/src/lib/elm_atspi_bridge.c +++ b/src/lib/elm_atspi_bridge.c @@ -5407,6 +5407,30 @@ _handle_listener_change(void *data, const Eldbus_Message *msg EINA_UNUSED) _registered_events_list_update(data); } +//TIZEN_ONLY(20170802): handle "gesture_required" attribute +static Eina_Bool +_scroll_gesture_required_is(Eo *obj) +{ + Eina_Bool ret = EINA_FALSE; + Eina_List *l, *attr_list = NULL; + Elm_Atspi_Attribute *attr = NULL; + + eo_do(obj, attr_list = elm_interface_atspi_accessible_attributes_get()); + EINA_LIST_FOREACH(attr_list, l, attr) + { + if (!strcmp(attr->key, "gesture_required") && !strcmp(attr->value, "scroll")) + { + ret = EINA_TRUE; + break; + } + } + if (attr_list) + elm_atspi_attributes_list_free(attr_list); + + return ret; +} +// + static Eina_Bool _state_changed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) { @@ -5455,8 +5479,15 @@ _state_changed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descr type_desc = elm_states_to_atspi_state[state_data->type].name; + //TIZEN_ONLY(20170802): handle "gesture_required" attribute + unsigned int det2 = 0; + if ((state_data->type == ELM_ATSPI_STATE_HIGHLIGHTED) && + (_scroll_gesture_required_is(obj))) + det2++; + _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT, - &_event_obj_signals[ATSPI_OBJECT_EVENT_STATE_CHANGED], type_desc, state_data->new_value, 0, NULL); + &_event_obj_signals[ATSPI_OBJECT_EVENT_STATE_CHANGED], type_desc, state_data->new_value, det2, NULL); + // return EINA_TRUE; } -- 2.7.4