elm: [popup][ctxpopup] popup and ctxpopup accessibility highlight impementation
authorPatryk Kaczmarek <patryk.k@samsung.com>
Thu, 23 Nov 2017 07:54:02 +0000 (13:24 +0530)
committerJiyoun Park <jy0703.park@samsung.com>
Thu, 21 Dec 2017 09:03:09 +0000 (18:03 +0900)
@tizen_feature

orignal patch: 0a67da373248031c81ef7986b117546f21510f00

Change-Id: I9d4f49e10f6fa5cfe16795abf7076ed109cbfa27

src/lib/elementary/elc_ctxpopup.c
src/lib/elementary/elc_popup.c
src/lib/elementary/elm_ctxpopup.eo
src/lib/elementary/elm_popup.eo

index 8454381..90a63a9 100644 (file)
@@ -1601,6 +1601,30 @@ _elm_ctxpopup_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED,
    return &atspi_actions[0];
 }
 
+//TIZEN ONLY(20150708): popup and ctxpopup accessibility highlight impementation
+EOLIAN static Eina_Bool
+_elm_ctxpopup_efl_access_component_highlight_grab(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+{
+   if (sd->box)
+     {
+        elm_object_accessibility_highlight_set(sd->box, EINA_TRUE);
+        return EINA_TRUE;
+     }
+   return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_ctxpopup_efl_access_component_highlight_clear(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd)
+{
+   if (sd->box)
+     {
+        elm_object_accessibility_highlight_set(sd->box, EINA_FALSE);
+        return EINA_TRUE;
+     }
+   return EINA_FALSE;
+}
+//
+
 /* Internal EO APIs and hidden overrides */
 
 ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_ctxpopup, Elm_Ctxpopup_Data)
index 5b050f4..7af0455 100644 (file)
@@ -941,6 +941,15 @@ _item_new(Elm_Popup_Item_Data *it)
      }
 }
 
+//TIZEN ONLY(20150717): expose title as at-spi object
+static char *
+_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
+{
+   Elm_Popup_Data *priv = data;
+   return priv->title_text ? strdup(priv->title_text) : NULL;
+}
+//
+
 static Eina_Bool
 _title_text_set(Evas_Object *obj,
                 const char *text)
@@ -971,6 +980,29 @@ _title_text_set(Evas_Object *obj,
         _elm_access_text_set(_elm_access_info_get(ao), ELM_ACCESS_INFO, text);
      }
 
+   //TIZEN ONLY(20150717): expose title as at-spi object
+   if (_elm_config->atspi_mode)
+     {
+        if (sd->title_text)
+          {
+             ao = _access_object_get(obj, ACCESS_TITLE_PART);
+             if (!ao)
+               {
+                  ao = _elm_access_edje_object_part_object_register
+                        (obj, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
+                  efl_access_role_set(ao, EFL_ACCESS_ROLE_HEADING);
+                  _elm_access_callback_set(_elm_access_info_get(ao),
+                                            ELM_ACCESS_INFO, _access_info_cb, sd);
+               }
+          }
+        else
+          {
+                ao = _access_object_get(obj, ACCESS_TITLE_PART);
+                if (ao)
+                    _elm_access_object_unregister(ao, NULL);
+          }
+     }
+   //
    if (sd->title_text)
      elm_layout_signal_emit(sd->main_layout, "elm,state,title,text,visible", "elm");
    else
@@ -1837,6 +1869,30 @@ _elm_popup_efl_access_name_get(Eo *obj, Elm_Popup_Data *sd)
    return name;
 }
 
+//TIZEN ONLY(20150708): popup and ctxpopup accessibility highlight impementation
+EOLIAN static Eina_Bool
+_elm_popup_efl_access_component_highlight_grab(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+{
+   if (sd->scr)
+     {
+        elm_object_accessibility_highlight_set(sd->main_layout, EINA_TRUE);
+        return EINA_TRUE;
+     }
+   return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_popup_efl_access_component_highlight_clear(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+{
+   if (sd->scr)
+     {
+        elm_object_accessibility_highlight_set(sd->main_layout, EINA_FALSE);
+        return EINA_TRUE;
+     }
+   return EINA_FALSE;
+}
+//
+
 /* Standard widget overrides */
 
 ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_popup, Elm_Popup_Data)
index 4166ace..cdcb6a4 100644 (file)
@@ -215,6 +215,10 @@ class Elm.Ctxpopup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action,
       Efl.Access.Widget.Action.elm_actions { get; }
       Efl.Access.state_set { get; }
       Efl.Part.part;
+      //TIZEN ONLY(20150708): popup and ctxpopup accessibility highlight impementation
+      Efl.Access.Component.highlight_grab;
+      Efl.Access.Component.highlight_clear;
+      //
    }
    events {
       dismissed; [[Called when context popup was dismissed]]
index 1532328..8a37ef9 100644 (file)
@@ -179,6 +179,10 @@ class Elm.Popup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action)
       Efl.Access.state_set { get; }
       Efl.Access.name { get; }
       Efl.Part.part;
+      //TIZEN ONLY(20150708): popup and ctxpopup accessibility highlight impementation
+      Efl.Access.Component.highlight_grab;
+      Efl.Access.Component.highlight_clear;
+      //
    }
    events {
       block,clicked; [[Called when popup was clicked]]