more_option/rotary_selector 73/231973/1 accepted/tizen/unified/20200428.214656 submit/tizen/20200427.214018
authorHyukSoon Choi <hs619.choi@samsung.com>
Thu, 9 Apr 2020 02:13:23 +0000 (11:13 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Mon, 27 Apr 2020 05:34:28 +0000 (14:34 +0900)
- use proper callback name
- change name from product to extension
- remove unused member variable
- accessibility code.

Change-Id: Ie5befcaea247b5d69db2b9e0aa72182aa441a873
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
data/wearable/images/more_option_masking_image.png [new file with mode: 0644]
inc/wearable/efl_extension_common_private.h
src/wearable/efl_extension_more_option.c
src/wearable/efl_extension_rotary_selector.c

diff --git a/data/wearable/images/more_option_masking_image.png b/data/wearable/images/more_option_masking_image.png
new file mode 100644 (file)
index 0000000..ad07079
Binary files /dev/null and b/data/wearable/images/more_option_masking_image.png differ
index 038fb29d073d3a88c36ff481f367b469f263ecc1..b3914bc72dbb33b54a388de112dfb31363c1d5bb 100644 (file)
@@ -188,9 +188,9 @@ struct _Eext_Rotary_Selector_Data {
    Evas_Object *accessible_need_highlight_obj;
    //
 
-   //ONEUI1.5(20Jun2017): Add next/prev icons for product style.
-   Eina_Bool is_product_style;
-   Eina_Bool checked_product_style;
+   //ONEUI1.5(20Jun2017): Add next/prev icons for extension style.
+   Eina_Bool is_extension_style;
+   Eina_Bool checked_extension_style;
    Evas_Object* next_icon;
    Evas_Object* prev_icon;
    //
@@ -277,7 +277,6 @@ struct _Eext_More_Option_Data {
    Evas_Object* more_option;
    Eina_List *item_list;
    Evas_Object* panel;
-   Evas_Object* rotary_selector;
    Eext_More_Option_Direction direction;
    //for accessibility
    Evas_Object* cue_access_object;
index 9686c41c3511411a591cd64546660e9538310a3f..54e337809913a42301c9e383a9ef4c3a576b46e0 100644 (file)
@@ -62,6 +62,9 @@ static void _set_item_access_info(Eext_Rotary_Selector_Item* item);
 static char *_accessibility_item_name_cb(void *data, Evas_Object *obj);
 static char *_accessibility_item_description_cb(void *data, Evas_Object *obj);
 //
+//ONEUI1.5(20200408): create access object for cue image
+static void _create_cue_access_object(Eext_More_Option_Data *mold);
+//
 /* === color class === */
 void _eext_more_option_color_class_parent_set(Evas_Object *obj, Evas_Object *parent);
 
@@ -418,7 +421,7 @@ _eext_more_option_genlist_add(Evas_Object *parent)
    Evas_Object *genlist = elm_genlist_add(mold->panel);
    elm_object_style_set(genlist, "prod/more_option");
    evas_object_smart_callback_add(genlist, "selected", _genlist_selected_cb, NULL);
-   evas_object_smart_callback_call(genlist, "bottom,margin,enable", NULL);
+   evas_object_smart_callback_call(genlist, "bottom,margin,enabled", NULL);
    /* Dont remove sizing code, it wont trigger item realization on first launch */
    evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -1556,7 +1559,6 @@ _more_option_data_init(Evas_Object *obj, Evas_Object *parent)
    mold->more_option = obj;
    mold->item_list = NULL;
    mold->panel = NULL;
-   mold->rotary_selector = NULL;
    mold->genlist = NULL;
    mold->effect_timer = NULL;
    mold->effect_count = 0;
@@ -1862,17 +1864,9 @@ eext_more_option_add(Evas_Object *parent)
         elm_atspi_accessible_name_cb_set(mold->panel, _accessibility_panel_name_set_cb, NULL);
         elm_atspi_accessible_description_cb_set(mold->panel, _accessibility_panel_description_set_cb, mold);
         elm_atspi_accessible_reading_info_type_set(mold->panel, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION));
-
-        mold->cue_target_object = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(mold->panel), "access");
-        mold->cue_access_object = elm_access_object_register(mold->cue_target_object, mold->more_option);
-
-        elm_atspi_accessible_name_cb_set(mold->cue_access_object, _accessibility_name_set_cb, (Eext_More_Option_Data*)mold);
-        elm_atspi_accessible_role_set(mold->cue_access_object, ELM_ATSPI_ROLE_PUSH_BUTTON);
-        elm_atspi_accessible_reading_info_type_set(mold->cue_access_object, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME|
-                                                                                         ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE|
-                                                                                         ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION);
-        elm_access_action_cb_set(mold->cue_access_object, ELM_ACCESS_ACTION_ACTIVATE, _access_action_cb, mold);
-        evas_object_data_set(mold->more_option, "_cue_access_object", mold->cue_access_object);
+        //OneUI1.5(20200408): create access object for cue image
+        _create_cue_access_object(mold);
+        //
      }
    //
 
@@ -1897,10 +1891,14 @@ eext_more_option_direction_set(Evas_Object *obj, Eext_More_Option_Direction dire
    if (mold)
      {
         elm_panel_orient_set(mold->panel, direction);
-        //ONEUI1.5(11July2019): Enable product theme when style changes
+        //ONEUI1.5(11July2019): Enable extension theme when style changes
         elm_object_signal_emit(mold->panel, "eext,more,option,enable", "elm");
         //
         mold->direction = direction;
+        //OneUI1.5(20200408): create access object for cue image
+        if (elm_atspi_bridge_utils_is_screen_reader_enabled())
+          _create_cue_access_object(mold);
+        //
      }
 }
 
@@ -2342,7 +2340,7 @@ _accessibility_item_name_cb(void *data, Evas_Object *obj)
 
    ret = eina_strbuf_string_steal(buf);
    eina_strbuf_free(buf);
-   return ret;
+   return strdup(ret);
 }
 
 static char *
@@ -2361,7 +2359,7 @@ _accessibility_item_description_cb(void *data, Evas_Object *obj)
 
    ret = eina_strbuf_string_steal(buf);
    eina_strbuf_free(buf);
-   return ret;
+   return strdup(ret);
 }
 
 static void
@@ -2371,6 +2369,23 @@ _set_item_access_info(Eext_Rotary_Selector_Item* item)
    elm_atspi_accessible_description_cb_set(item->item, _accessibility_item_description_cb, item);
 }
 //
+
+//OneUI1.5(20200408): create access object for cue image
+static void
+_create_cue_access_object(Eext_More_Option_Data *mold)
+{
+   mold->cue_target_object = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(mold->panel), "access");
+   mold->cue_access_object = elm_access_object_register(mold->cue_target_object, mold->more_option);
+
+   elm_atspi_accessible_name_cb_set(mold->cue_access_object, _accessibility_name_set_cb, (Eext_More_Option_Data*)mold);
+   elm_atspi_accessible_role_set(mold->cue_access_object, ELM_ATSPI_ROLE_PUSH_BUTTON);
+   elm_atspi_accessible_reading_info_type_set(mold->cue_access_object, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME|
+                                                                                    ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE|
+                                                                                    ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION);
+   elm_access_action_cb_set(mold->cue_access_object, ELM_ACCESS_ACTION_ACTIVATE, _access_action_cb, mold);
+   evas_object_data_set(mold->more_option, "_cue_access_object", mold->cue_access_object);
+}
+//
 //
 
 void
index f8cce25c35517da89c0af677c4367b54460e4e54..159697adbf9e826e96aef88df991e9c693cec576 100644 (file)
@@ -222,9 +222,9 @@ static void _item_rearrange(Eext_Rotary_Selector_Data *rsd, int selected_index);
 static void _item_select(Eext_Rotary_Selector_Data *rsd, int index);
 static void _item_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
-//ONEUI1.5(20Jun2017): Add next/prev icons for product style.
-static void _product_style_check(Eext_Rotary_Selector_Data *rsd);
-static Evas_Object *_product_layer_icon_create(Eext_Rotary_Selector_Data *rsd, const char* style);
+//ONEUI1.5(20Jun2017): Add next/prev icons for extension style.
+static void _extension_style_check(Eext_Rotary_Selector_Data *rsd);
+static Evas_Object *_extension_layer_icon_create(Eext_Rotary_Selector_Data *rsd, const char* style);
 
 static Eext_Rotary_Selector_Item *_item_create(Eext_Rotary_Selector_Data *rsd, Eext_Rotary_Selector_Item_Type item_type);
 static void _item_selected_signal_send(Eext_Rotary_Selector_Data *rsd, int previous_item_index, int current_item_index);
@@ -964,9 +964,9 @@ _dnd_pos(Eext_Rotary_Selector_Data *data, Evas_Coord x, Evas_Coord y)
                   ecore_timer_del(rsd->stand_timer);
                   rsd->stand_timer = NULL;
                }
-             for(i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX; i++)
+             for (i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX; i++)
                {
-                  if(angle < touchAreaAngle[i]) break;
+                  if (angle < touchAreaAngle[i]) break;
                }
              new_index = first_index + i;
 
@@ -1180,9 +1180,9 @@ _event_area_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_inf
           {
              const float touchAreaAngle[] = { 45.f, 75.f, 105.f, 135.f, 165.f, 195.f,
                                                    225.f, 255.f, 285.f, 315.f, 340.f};
-             for(i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX;i++)
+             for (i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX;i++)
                {
-                  if(angle < touchAreaAngle[i]) break;
+                  if (angle < touchAreaAngle[i]) break;
                }
 
              new_index = first_index + i;
@@ -1369,9 +1369,9 @@ _event_area_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
           {
              const float touchAreaAngle[] = { 45.f, 75.f, 105.f, 135.f, 165.f, 195.f,
                                                    225.f, 255.f, 285.f, 315.f, 340.f};
-             for(i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX; i++)
+             for (i = 0; i < _ROTARY_SELECTOR_PAGE_ITEM_MAX; i++)
                {
-                  if(angle < touchAreaAngle[i]) break;
+                  if (angle < touchAreaAngle[i]) break;
                }
              new_index = first_index + i;
 
@@ -1879,7 +1879,7 @@ _rotary_selector_rotary_cb(void *data, Evas_Object *obj, Eext_Rotary_Event_Info
                          {
                             rsd->selected_index = first_index;
                          }
-                       else if(rsd->selected_index % (_ROTARY_SELECTOR_PAGE_ITEM_MAX - 1) == 0 )
+                       else if (rsd->selected_index % (_ROTARY_SELECTOR_PAGE_ITEM_MAX - 1) == 0 )
                          {
                             rsd->selected_index = last_index;
                          }
@@ -2120,7 +2120,7 @@ _rotary_selector_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
         ecore_timer_del(rsd->content_update_timer);
         rsd->content_update_timer = NULL;
      }
-   if(rsd->content_animator)
+   if (rsd->content_animator)
      {
         ecore_animator_del(rsd->content_animator);
         rsd->content_animator = NULL;
@@ -2645,8 +2645,9 @@ _item_select(Eext_Rotary_Selector_Data *rsd, int index)
 #if _ROTARY_SELECTOR_DEBUG_ENABLED
    LOGI("item is selected!! : index(%d)", index);
 #endif
-//ONEUI1.5(20170620): Add next/prev icons for product style.
-   _product_style_check(rsd);
+   //ONEUI1.5(20170620): Add next/prev icons for extension style.
+   _extension_style_check(rsd);
+   //
    if (!rsd->editing)
      _item_selected_signal_send(rsd, rsd->selected_index, index);
    rsd->selected_index = index;
@@ -2781,11 +2782,11 @@ _item_create(Eext_Rotary_Selector_Data *rsd, Eext_Rotary_Selector_Item_Type item
    return item;
 }
 
-//ONEUI1.5(20170620): Add next/prev icons for product style.
+//ONEUI1.5(20170620): Add next/prev icons for extension style.
 static void
-_product_style_check(Eext_Rotary_Selector_Data *rsd)
+_extension_style_check(Eext_Rotary_Selector_Data *rsd)
 {
-   if (!rsd->checked_product_style)
+   if (!rsd->checked_extension_style)
      {
         Eext_Rotary_Selector_Item *item = eina_list_nth(rsd->item_list, 0);
         if (!item) return;
@@ -2794,26 +2795,26 @@ _product_style_check(Eext_Rotary_Selector_Data *rsd)
           {
              if (!strcmp(elm_object_style_get(item->base.obj), "prod/more_option_item"))
                {
-                  rsd->is_product_style = EINA_TRUE;
+                  rsd->is_extension_style = EINA_TRUE;
                }
           }
          else
           {
              if (!strcmp(elm_object_style_get(item->base.obj), "prod/rotary_selector_item"))
                {
-                  rsd->is_product_style = EINA_TRUE;
+                  rsd->is_extension_style = EINA_TRUE;
                }
           }
 
-        rsd->checked_product_style = EINA_TRUE;
-        if(rsd->is_product_style)
+        rsd->checked_extension_style = EINA_TRUE;
+        if (rsd->is_extension_style)
           {
              if (rsd->item_count > _ROTARY_SELECTOR_PAGE_ITEM_MAX)
                {
                   if (!rsd->next_icon && !rsd->prev_icon)
                     {
-                       rsd->next_icon = _product_layer_icon_create(rsd, "next_icon");
-                       rsd->prev_icon = _product_layer_icon_create(rsd, "prev_icon");
+                       rsd->next_icon = _extension_layer_icon_create(rsd, "next_icon");
+                       rsd->prev_icon = _extension_layer_icon_create(rsd, "prev_icon");
                     }
                }
           }
@@ -2821,7 +2822,7 @@ _product_style_check(Eext_Rotary_Selector_Data *rsd)
 }
 
 static Evas_Object*
-_product_layer_icon_create(Eext_Rotary_Selector_Data *rsd, const char* style)
+_extension_layer_icon_create(Eext_Rotary_Selector_Data *rsd, const char* style)
 {
    Evas_Object *layout = elm_layout_add(rsd->rotary_selector);
    if (!layout)
@@ -3088,8 +3089,8 @@ _item_update_animator_cb(void *data)
 
    rsd->item_update_animator = NULL;
 
-//ONEUI1.5(20170620): Add next/prev icons for product style.
-   if(rsd->is_product_style)
+   //ONEUI1.5(20170620): Add next/prev icons for extension style.
+   if (rsd->is_extension_style)
      {
         if (rsd->item_count <= _ROTARY_SELECTOR_PAGE_ITEM_MAX)
           {
@@ -3100,7 +3101,7 @@ _item_update_animator_cb(void *data)
                }
           }
      }
-
+   //
 #if _ROTARY_SELECTOR_DEBUG_ENABLED
    LOGI("item_list(0x%d), count(%d)", rsd->item_list, rsd->item_count);
 #endif