Accessibility : synchronized highlight of atspi and item align feature for wearable... 85/95685/3
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 4 Nov 2016 08:07:07 +0000 (17:07 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 9 Nov 2016 12:00:30 +0000 (04:00 -0800)
   In the genlist, it corrected so that highlight could move according to item align feature.
   This feature operates when screen-reader of wearable was enable.

   @TIZEN_ONLY

Change-Id: I0f838264266ff84be8909f35c00c99c7ca6f17fe

src/mobile_lib/elm_genlist.c
src/mobile_lib/elm_widget_genlist.h

index c1525c1..fe90e8b 100644 (file)
@@ -1351,8 +1351,18 @@ _elm_genlist_scroll_item_align_highlight_cb(Evas_Object *obj)
    sd->aligned_item = _elm_genlist_pos_adjust_xy_item_get(obj, vw, vh);
 
    if (sd->aligned_item && sd->aligned_item->realized)
-      edje_object_signal_emit(VIEW(sd->aligned_item),
-                              SIGNAL_ITEM_HIGHLIGHTED, "elm");
+     {
+        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+        if (_elm_atspi_enabled())
+          {
+             if(sd->aligned_item != sd->currently_highlighted_item)
+               {
+                  eo_do(EO_OBJ(sd->aligned_item), elm_interface_atspi_component_highlight_grab());
+               }
+          }
+        //
+        edje_object_signal_emit(VIEW(sd->aligned_item), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+     }
 }
 
 static void
@@ -1633,17 +1643,21 @@ _item_realize(Elm_Gen_Item *it,
      }
    if (!sd->aligned_item)
      {
-        eo_do(sd->obj, elm_interface_scrollable_content_viewport_geometry_get
-              (NULL, NULL, &vw, &vh));
-        vw = (vw / 2);
-        vh = (vh / 2);
-
-        if (ELM_RECTS_INTERSECT(it->x - sd->pan_x, it->y - sd->pan_y, GL_IT(it)->w,
-                                GL_IT(it)->minh, vw, vh, 1, 1))
+       //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+        if (!_elm_atspi_enabled())
+        //
           {
-             sd->aligned_item = it;
-             edje_object_signal_emit(VIEW(sd->aligned_item),
-                                     SIGNAL_ITEM_HIGHLIGHTED, "elm");
+             eo_do(sd->obj, elm_interface_scrollable_content_viewport_geometry_get
+                   (NULL, NULL, &vw, &vh));
+             vw = (vw / 2);
+             vh = (vh / 2);
+
+             if (ELM_RECTS_INTERSECT(it->x - sd->pan_x, it->y - sd->pan_y, GL_IT(it)->w,
+                                     GL_IT(it)->minh, vw, vh, 1, 1))
+               {
+                  sd->aligned_item = it;
+                  edje_object_signal_emit(VIEW(sd->aligned_item), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+               }
           }
      }
    else if (sd->aligned_item == it)
@@ -3550,8 +3564,14 @@ _elm_genlist_elm_widget_on_focus(Eo *obj, Elm_Genlist_Data *sd, Elm_Object_Item
              if (sd->aligned_item)
                {
                   if (sd->aligned_item->realized)
-                    edje_object_signal_emit(VIEW(sd->aligned_item),
-                           SIGNAL_ITEM_HIGHLIGHTED, "elm");
+                    {
+                        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+                        if (!_elm_atspi_enabled())
+                        //
+                          {
+                             edje_object_signal_emit(VIEW(sd->aligned_item), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+                          }
+                     }
                }
           }
      }
@@ -8194,6 +8214,8 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
         evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
         evas_object_geometry_get(VIEW(it), NULL, &y, NULL, &h);
         int res = _is_item_in_viewport(wy, wh, y, h);
+        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+#ifndef TIZEN_PROFILE_WEARABLE
         if (res > 0)
           {
              // new item is above current
@@ -8206,6 +8228,10 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
           }
         else
           elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+#else
+        elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+#endif
+        //
       }
    else // if item is not realized we should search if we are over or below viewport
      {
@@ -8220,17 +8246,28 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
              eo_do(eina_list_last_data_get(realized), bottom = elm_obj_genlist_item_index_get());
              eo_do(eo_it, idx = elm_obj_genlist_item_index_get());
              eina_list_free(realized);
+             //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+#ifndef TIZEN_PROFILE_WEARABLE
              if (idx < top)
                elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
              else if (idx > bottom)
                elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
-            else
-              elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+             else
+               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+#else
+             elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+#endif
+             //
           }
      }
 
    if (VIEW(it))
+     {
         elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_TRUE);
+        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+        sd->currently_highlighted_item = it;
+        //
+     }
    else
        sd->atspi_item_to_highlight = it;//it will be highlighted when realized
 
@@ -8238,6 +8275,9 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
    elm_interface_atspi_accessible_active_descendant_changed_signal_emit(WIDGET(it), eo_it);
 ///
 
+   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+   edje_object_signal_emit(VIEW(it), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+   //
    return EINA_TRUE;
 }
 
@@ -8245,6 +8285,10 @@ EOLIAN static Eina_Bool
 _elm_genlist_item_elm_interface_atspi_component_highlight_clear(Eo *eo_it, Elm_Gen_Item *it)
 {
    ELM_GENLIST_DATA_GET(WIDGET(it), sd);
+   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+   if(sd->currently_highlighted_item == it)
+     sd->currently_highlighted_item = NULL;
+   //
    if (sd->atspi_item_to_highlight == it)
        sd->atspi_item_to_highlight = NULL;
    elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_FALSE);
@@ -8252,6 +8296,10 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_clear(Eo *eo_it, Elm_G
    elm_interface_atspi_accessible_active_descendant_changed_signal_emit(WIDGET(it), eo_it);
 ///
 
+   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+   edje_object_signal_emit(VIEW(it), SIGNAL_ITEM_UNHIGHLIGHTED, "elm");
+   //
+
    return EINA_TRUE;
 }
 ///////////////////////////////////////////////////////////////////////////////
index 43ab80a..c238db8 100644 (file)
@@ -209,6 +209,9 @@ struct _Elm_Genlist_Data
    Evas_Coord                            viewport_w, viewport_h;
    Elm_Gen_Item                         *atspi_item_to_highlight;
    Elm_Gen_Item                         *aligned_item;
+   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+   Elm_Gen_Item                         *currently_highlighted_item;
+   //
 
    Eina_List                            *filter_queue;
    Eina_List                            *filtered_list;