elm: access: handle "gesture_required" attribute
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 8 Dec 2017 13:40:05 +0000 (19:10 +0530)
committerJiyoun Park <jy0703.park@samsung.com>
Thu, 21 Dec 2017 12:22:58 +0000 (21:22 +0900)
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: Ibdc8d4d93d5d9946c566812b6cd77e48cbbab4c2
Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>
src/lib/elementary/elm_atspi_bridge.c

index 3089a5e..bfef49b 100644 (file)
@@ -4530,6 +4530,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;
+   Efl_Access_Attribute *attr = NULL;
+
+   attr_list = efl_access_attributes_get(obj);
+   EINA_LIST_FOREACH(attr_list, l, attr)
+     {
+        if (!strcmp(attr->key, "gesture_required") && !strcmp(attr->value, "scroll"))
+          {
+             ret = EINA_TRUE;
+             break;
+          }
+     }
+   if (attr_list)
+     efl_access_attributes_list_free(attr_list);
+
+   return ret;
+}
+//
+
 static void
 _state_changed_signal_send(void *data, const Efl_Event *event)
 {
@@ -4590,9 +4614,15 @@ _state_changed_signal_send(void *data, const Efl_Event *event)
      }
 
    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 == EFL_ACCESS_STATE_HIGHLIGHTED) &&
+       (_scroll_gesture_required_is(event->object)))
+     det2++;
 
    _bridge_signal_send(data, event->object, 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);
+   //
 }
 
 static void