support runtime tizen profile configurability 86/166486/3
authorJongmin Lee <jm105.lee@samsung.com>
Wed, 10 Jan 2018 10:13:49 +0000 (19:13 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Sat, 13 Jan 2018 01:10:24 +0000 (01:10 +0000)
Change-Id: I6118a2d7075700012f08562327142a851f1202eb

src/lib/elementary/efl_ui_widget.c
src/lib/elementary/elm_genlist.c
src/lib/elementary/elm_list.c
src/lib/elementary/elm_priv.h

index a9f24a5..570282b 100644 (file)
@@ -6875,15 +6875,16 @@ _accessible_at_point_top_down_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSE
                {
                   Elm_Widget_Item_Data *id = efl_data_scope_get(child, ELM_WIDGET_ITEM_CLASS);
                   compare_obj = id->view;
-#ifdef TIZEN_PROFILE_WEARABLE
-                  Eo* it_view = evas_object_image_source_get(stack_item);
-                  if (it_view && it_view == compare_obj)
+                  if (TIZEN_PROFILE_WEARABLE)
                     {
-                       eina_list_free(children);
-                       eina_list_free(stack);
-                       return child;
+                       Eo* it_view = evas_object_image_source_get(stack_item);
+                       if (it_view && it_view == compare_obj)
+                         {
+                            eina_list_free(children);
+                            eina_list_free(stack);
+                            return child;
+                         }
                     }
-#endif
                }
              /* In case of access object compare should be 'wrapped' evas_object */
              if (efl_isa(child, ELM_ACCESS_CLASS))
@@ -7031,12 +7032,11 @@ _efl_ui_widget_efl_access_component_accessible_at_point_get(Eo *obj, Elm_Widget_
                          break;
                        case EFL_ACCESS_ROLE_LIST:
                            item_child = _item_at_point_get(smart_parent, x, y);
-    #ifdef TIZEN_PROFILE_WEARABLE
+                           if (TIZEN_PROFILE_WEARABLE)
                              {
                                 item_child = _child_object_at_point_get(item_child, x, y);
                                 return item_child;
                              }
-    #endif
                            return item_child;
                          break;
                        default:
index 21d4c31..c86b90e 100644 (file)
@@ -9192,40 +9192,43 @@ _elm_genlist_item_efl_access_component_highlight_grab(Eo *eo_it, Elm_Gen_Item *i
 {
    ELM_GENLIST_DATA_GET(WIDGET(it), sd);
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
-   efl_access_component_highlight_grab(efl_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS));
-   //
-#else
-   // TIZEN_ONLY(20171011) : atspi : Do not center align when genlist item is highlighted in wearable profile
-   //FIXME : First, last item is called centered because it may not have a proxy image.
-   //        This part will be revised in the next version.
-   Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
-   if (VIEW(it) || realized)
-     {
-        Elm_Object_Item *first_it = elm_genlist_first_item_get(WIDGET(it));
-        Elm_Object_Item *last_it = elm_genlist_last_item_get(WIDGET(it));
-        if (first_it == eo_it || last_it == eo_it)
-          elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
-        else
-          elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-      }
-   if (realized)
-     eina_list_free(realized);
-   //
+   if (!TIZEN_PROFILE_WEARABLE)
+     {
+        //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
+        efl_access_component_highlight_grab(efl_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS));
+        //
+     }
+   else
+     {
+        // TIZEN_ONLY(20171011) : atspi : Do not center align when genlist item is highlighted in wearable profile
+        //FIXME : First, last item is called centered because it may not have a proxy image.
+        //        This part will be revised in the next version.
+        Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
+        if (VIEW(it) || realized)
+         {
+            Elm_Object_Item *first_it = elm_genlist_first_item_get(WIDGET(it));
+            Elm_Object_Item *last_it = elm_genlist_last_item_get(WIDGET(it));
+            if (first_it == eo_it || last_it == eo_it)
+              elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+            else
+              elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+          }
+        if (realized)
+         eina_list_free(realized);
+        //
 
-   if (VIEW(it))
-     elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_TRUE);
+        if (VIEW(it))
+         elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_TRUE);
 
-   ///TIZEN_ONLY(20170717) : expose highlight information on atspi
-   efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_HIGHLIGHTED, EINA_TRUE);
-   ///
+        ///TIZEN_ONLY(20170717) : expose highlight information on atspi
+        efl_access_state_changed_signal_emit(EO_OBJ(it), EFL_ACCESS_STATE_HIGHLIGHTED, EINA_TRUE);
+        ///
 
-   //TIZEN_ONLY(20170412) Make atspi,(un)highlighted work on widget item
-   // If you call eo_do_super, then you do NOT have to call smart callback.
-   evas_object_smart_callback_call(WIDGET(it), "atspi,highlighted", EO_OBJ(it));
-   //
-#endif
+        //TIZEN_ONLY(20170412) Make atspi,(un)highlighted work on widget item
+        // If you call eo_do_super, then you do NOT have to call smart callback.
+        evas_object_smart_callback_call(WIDGET(it), "atspi,highlighted", EO_OBJ(it));
+        //
+     }
 
    if (VIEW(it))
      {
@@ -9235,11 +9238,13 @@ _elm_genlist_item_efl_access_component_highlight_grab(Eo *eo_it, Elm_Gen_Item *i
      }
    else
      {
-#ifndef TIZEN_PROFILE_WEARABLE
-        //TIZEN_ONLY(20170724): grab highlight using unrealized item
-        elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-        //
-#endif
+        
+        if (!TIZEN_PROFILE_WEARABLE)
+          {
+            //TIZEN_ONLY(20170724): grab highlight using unrealized item
+            elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+            //
+          }
         sd->atspi_item_to_highlight = it;//it will be highlighted when realized
      }
 
index a2a8320..8ca4326 100644 (file)
@@ -3435,41 +3435,44 @@ _elm_list_item_efl_access_component_highlight_grab(Eo *eo_it, Elm_List_Item_Data
 {
    ELM_LIST_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, EINA_FALSE);
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
-   efl_access_component_highlight_grab(efl_super(EO_OBJ(it), ELM_LIST_ITEM_CLASS));
-   //
-#else
-   Evas_Coord wy, wh, x, y, w, h, bx, by, bw, bh;
-   evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
-   evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
-   int res = _is_item_in_viewport(wy, wh, y, h);
-
-   if (res != 0)
+   if (!TIZEN_PROFILE_WEARABLE)
      {
-         evas_object_geometry_get(sd->box, &bx, &by, &bw, &bh);
-         evas_smart_objects_calculate(evas_object_evas_get(sd->box));
-         x -= bx;
-         y -= by;
-         if (res > 0)
-           {
-             y -= wh - h;
-             elm_interface_scrollable_content_region_show(WIDGET(it), x, y, w, h);
-           }
-         else if (res < 0)
-           {
-             y += wh - h;
-             elm_interface_scrollable_content_region_show(WIDGET(it), x, y, w, h);
-           }
+        //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
+        efl_access_component_highlight_grab(efl_super(EO_OBJ(it), ELM_LIST_ITEM_CLASS));
+        //
      }
    else
-     elm_list_item_show(eo_it);
+     {
+        Evas_Coord wy, wh, x, y, w, h, bx, by, bw, bh;
+        evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
+        evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
+        int res = _is_item_in_viewport(wy, wh, y, h);
+
+        if (res != 0)
+         {
+             evas_object_geometry_get(sd->box, &bx, &by, &bw, &bh);
+             evas_smart_objects_calculate(evas_object_evas_get(sd->box));
+             x -= bx;
+             y -= by;
+             if (res > 0)
+               {
+                 y -= wh - h;
+                 elm_interface_scrollable_content_region_show(WIDGET(it), x, y, w, h);
+               }
+             else if (res < 0)
+               {
+                 y += wh - h;
+                 elm_interface_scrollable_content_region_show(WIDGET(it), x, y, w, h);
+               }
+         }
+        else
+         elm_list_item_show(eo_it);
 
-   // TIZEN_ONLY(20171114): atspi: expose highlight information on atspi
-   elm_object_accessibility_highlight_set(eo_it, EINA_TRUE);
-   efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_HIGHLIGHTED, EINA_TRUE);
-   //
-#endif
+        // TIZEN_ONLY(20171114): atspi: expose highlight information on atspi
+        elm_object_accessibility_highlight_set(eo_it, EINA_TRUE);
+        efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_HIGHLIGHTED, EINA_TRUE);
+        //
+     }
 
    return EINA_TRUE;
 }
index 0000063..6e10e41 100644 (file)
@@ -911,8 +911,9 @@ efl_ui_dir_is_horizontal(Efl_Ui_Dir dir, Eina_Bool def_val)
 #define EAPI
 
 //TIZEN_ONLY(20170411): Tizen Profile Runtime Configurability
+extern char _tizen_profile_wearable;
 char tizen_util_probe_profile_wearable();
-#define TIZEN_PROFILE_WEARABLE tizen_util_probe_profile_wearable()
+#define TIZEN_PROFILE_WEARABLE (__builtin_expect(_tizen_profile_wearable != -1, 1)?_tizen_profile_wearable:tizen_util_probe_profile_wearable())
 //
 
 /***********************************************************************************