[access] highlight recovery enhancement
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 13 Jun 2013 12:35:09 +0000 (21:35 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Thu, 20 Jun 2013 12:32:19 +0000 (21:32 +0900)
Change-Id: I1e07cd0a9b482a5d607fc5df539c3621bd4d2332

src/lib/elc_ctxpopup.c
src/lib/elc_naviframe.c
src/lib/elc_popup.c
src/lib/elm_access.c
src/lib/elm_widget.c
src/lib/elm_widget.h
src/lib/elm_win.c

index b6f49fd..d05ad3b 100644 (file)
@@ -1370,6 +1370,7 @@ _on_show(void *data __UNUSED__,
    Eina_List *elist;
    Elm_Ctxpopup_Item *item;
    int idx = 0;
+   Evas_Object *ao;
 
    ELM_CTXPOPUP_DATA_GET(obj, sd);
    ELM_WIDGET_DATA_GET(obj, wsd);
@@ -1416,6 +1417,12 @@ _on_show(void *data __UNUSED__,
    elm_layout_sizing_eval(obj);
 
    elm_object_focus_set(obj, EINA_TRUE);
+
+   if (_elm_config->access_mode)
+     {
+        ao = _access_object_get(obj, ACCESS_OUTLINE_PART);
+        _elm_access_highlight_set(ao);
+     }
 }
 
 static void
index 9f3f1c2..618b01f 100644 (file)
@@ -60,11 +60,17 @@ static void
 _prev_page_focus_recover(Elm_Naviframe_Item *it)
 {
    Evas_Object *newest;
-   unsigned int order;
+   unsigned int order = 0;
+
+   ELM_WIDGET_DATA_GET(VIEW(it), sd);
+   order = sd->focus_order;
 
    newest = elm_widget_newest_focus_order_get(VIEW(it), &order, EINA_TRUE);
    if (newest)
+   {
      elm_object_focus_set(newest, EINA_TRUE);
+     _elm_access_highlight_set(newest);
+   }
    else
      {
         if (_elm_config->access_mode)
@@ -1316,8 +1322,12 @@ _elm_naviframe_smart_focus_next(const Evas_Object *obj,
    l = eina_list_append(l, VIEW(top_it));
 
    /* access */
-   if (_elm_config->access_mode && _elm_access_auto_highlight_get())
+   if (top_it->title_visible &&
+       _elm_config->access_mode &&
+       _elm_access_auto_highlight_get())
      {
+        if (elm_widget_tree_unfocusable_get(VIEW(top_it))) return EINA_FALSE;
+
         ao = ((Elm_Widget_Item *)top_it)->access_obj;
         if (ao &&
             !elm_widget_highlight_get(ao) &&
@@ -1333,8 +1343,13 @@ _elm_naviframe_smart_focus_next(const Evas_Object *obj,
    ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next);
    eina_list_free(l);
 
-   if (!ret && _elm_config->access_mode && _elm_access_auto_highlight_get())
+   if (!ret &&
+       top_it->title_visible &&
+       _elm_config->access_mode &&
+       _elm_access_auto_highlight_get())
      {
+        if (elm_widget_tree_unfocusable_get(VIEW(top_it))) return EINA_FALSE;
+
         ao = ((Elm_Widget_Item *)top_it)->access_obj;
         if (ao && !elm_widget_highlight_get(ao))
           {
index f866c87..6e0682c 100644 (file)
@@ -107,6 +107,17 @@ _access_object_get(const Evas_Object *obj, const char* part)
 
    return ao;
 }
+static void
+_access_highlight_set(const Evas_Object *obj)
+{
+   Evas_Object *ao;
+
+   ao = _access_object_get(obj, ACCESS_BASE_PART);
+   if (!ao) ao = _access_object_get(obj, ACCESS_TITLE_PART);
+   if (!ao) ao = _access_object_get(obj, ACCESS_BODY_PART);
+   if (!ao) ao = elm_widget_focused_object_get(obj);
+   if (ao) _elm_access_highlight_set(ao);
+}
 
 static void
 _on_show(void *data __UNUSED__,
@@ -125,6 +136,7 @@ _on_show(void *data __UNUSED__,
    elm_object_content_set(sd->notify, obj);
 
    elm_object_focus_set(obj, EINA_TRUE);
+   if (_elm_config->access_mode) _access_highlight_set(obj);
 }
 
 static void
@@ -1220,8 +1232,13 @@ _action_button_set(Evas_Object *obj,
         ao = _access_object_get(obj, ACCESS_BASE_PART);
 
         if (ao && sd->button_count)
-          _elm_access_edje_object_part_object_unregister
+          {
+             _elm_access_edje_object_part_object_unregister
                (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BASE_PART);
+
+             /* there is a case to set button, after evas_object_show(popup); */
+             if (evas_object_visible_get(obj)) _access_highlight_set(obj);
+          }
      }
 
    snprintf(buf, sizeof(buf), "buttons%u", sd->button_count);
index d18e2c5..b2fc3d9 100644 (file)
@@ -1048,6 +1048,31 @@ _elm_access_say(const char *txt)
      }
 }
 
+EAPI void
+_elm_access_highlight_object_read(const Evas_Object *obj)
+{
+   Elm_Access_Info *ac;
+   Evas_Object *ho;
+
+   if (!obj) return;
+
+   ho = _access_highlight_object_get(obj);
+   if (!ho) return;
+
+   ac = evas_object_data_get(ho, "_elm_access");
+   if (!ac) return;
+
+   if (ac->highlight_read_job)
+     {
+        ecore_job_del(ac->highlight_read_job);
+        ac->highlight_read_job = NULL;
+     }
+
+   /* use ecore_job_add(); here, an object could have a highlight even though
+      its text is not yet translated in case of the naviframe title */
+   ac->highlight_read_job = ecore_job_add(_access_highlight_read_job, ho);
+}
+
 EAPI Elm_Access_Info *
 _elm_access_object_get(const Evas_Object *obj)
 {
index 19f5eaa..e52174f 100644 (file)
@@ -450,6 +450,7 @@ _if_focused_revert(Evas_Object *obj,
           {
              elm_object_focus_set(newest, EINA_FALSE);
              elm_object_focus_set(newest, EINA_TRUE);
+             _elm_access_highlight_set(newest);
           }
      }
 }
@@ -1821,9 +1822,11 @@ elm_widget_focus_cycle(Evas_Object *obj,
                 target will steal focus, or focus its own job. */
              if (!_elm_access_auto_highlight_get())
                elm_widget_focus_steal(target);
-
-             _elm_access_highlight_set(target);
-             _elm_widget_focus_region_show(target);
+             else
+               {
+                  _elm_access_highlight_set(target);
+                  _elm_widget_focus_region_show(target);
+               }
           }
         else elm_widget_focus_steal(target);
      }
index 734c435..5fc512e 100644 (file)
@@ -606,6 +606,7 @@ EAPI void             _elm_access_text_set(Elm_Access_Info *ac, int type, const
 EAPI void             _elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Info_Cb func, const void *data);
 EAPI char            *_elm_access_text_get(const Elm_Access_Info *ac, int type, const Evas_Object *obj); /* this is ok it actually returns a strduped string - it's meant to! */
 EAPI void             _elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj);
+EAPI void             _elm_access_highlight_object_read(const Evas_Object *obj);
 EAPI void             _elm_access_say(const char *txt);
 EAPI Elm_Access_Info *_elm_access_object_get(const Evas_Object *obj);
 EAPI void             _elm_access_object_hilight(Evas_Object *obj);
index 730b97f..fd41a07 100644 (file)
@@ -862,6 +862,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
    Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
    Evas_Object *obj;
    unsigned int order = 0;
+   Evas_Object *access_highlight, *highlight_target;
 
    EINA_SAFETY_ON_NULL_RETURN(sd);
 
@@ -883,6 +884,16 @@ _elm_win_focus_in(Ecore_Evas *ee)
         edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
      }
 
+   /* access */
+   if (_elm_config->access_mode)
+     {
+        access_highlight = evas_object_name_find(evas_object_evas_get(obj),
+                                                 "_elm_access_disp");
+        if (!access_highlight) return;
+
+        evas_object_show(access_highlight);
+        _elm_access_highlight_object_read(obj);
+     }
    /* do nothing */
    /* else if (sd->img_obj) */
    /*   { */
@@ -894,6 +905,7 @@ _elm_win_focus_out(Ecore_Evas *ee)
 {
    Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
    Evas_Object *obj;
+   Evas_Object *access_highlight;
 
    EINA_SAFETY_ON_NULL_RETURN(sd);
 
@@ -910,7 +922,12 @@ _elm_win_focus_out(Ecore_Evas *ee)
      }
 
    /* access */
-   _elm_access_object_hilight_disable(evas_object_evas_get(obj));
+   if (_elm_config->access_mode)
+     {
+        access_highlight = evas_object_name_find(evas_object_evas_get(obj),
+                                                 "_elm_access_disp");
+        if (access_highlight) evas_object_hide(access_highlight);
+     }
 
    /* do nothing */
    /* if (sd->img_obj) */