atspi: support "default_label" attribute of window 68/151568/6
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 21 Sep 2017 07:40:49 +0000 (16:40 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Sat, 30 Sep 2017 08:25:13 +0000 (17:25 +0900)
Wearable profile application does not want to use default label functionality
because it is hard to meet application UI definition.
So if the window has attribute "default_label" key, and its "disabled" value,
then screen-reader does not read out default label, and does not clear
currently highlight object.

Application should append attribute as below.

elm_atspi_accessible_attribute_append(window, "default_label", "disabled");

This patch set works with following patch set.

https://review.tizen.org/gerrit/151570 (screen-reader)

Change-Id: I354c6ecf30db3a0011658d69577ad384fcb900db

src/lib/elm_atspi_bridge.c

index 2d51da2..9205c6d 100644 (file)
@@ -218,6 +218,12 @@ static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = {
    //
 };
 
+enum
+{
+  ELM_ACCESSIBLE_DEFAULT_LABEL_ENABLED = 0,
+  ELM_ACCESSIBLE_DEFAULT_LABEL_DISABLED = 1 << 0,
+};
+
 enum _Atspi_Object_Child_Event_Type
 {
    ATSPI_OBJECT_CHILD_ADDED = 0,
@@ -5659,6 +5665,28 @@ _move_outed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descript
 }
 //
 
+static unsigned int
+_window_activated_detail_value_add(Eo *obj)
+{
+   unsigned int ret = ELM_ACCESSIBLE_DEFAULT_LABEL_ENABLED;
+   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, "default_label") && !strcmp(attr->value, "disabled"))
+          {
+             ret |= ELM_ACCESSIBLE_DEFAULT_LABEL_DISABLED;
+             break;
+          }
+     }
+   if (attr_list)
+     elm_atspi_attributes_list_free(attr_list);
+
+   return ret;
+}
+
 static Eina_Bool
 _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
 {
@@ -5692,8 +5720,12 @@ _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void
         return EINA_FALSE;
      }
 
+   unsigned int det1 = 0;
+   if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED)
+     det1 = _window_activated_detail_value_add(obj);
+
    _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_WINDOW,
-                       &_window_obj_signals[type], "", 0, 0, "i", 0);
+                       &_window_obj_signals[type], "", det1, 0, "i", 0);
    return EINA_TRUE;
 }