implement style_set API for index item 35/206335/2
authorSungtaek Hong <sth253.hong@samsung.com>
Thu, 30 Jun 2016 11:52:26 +0000 (20:52 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 17 May 2019 02:19:07 +0000 (02:19 +0000)
Change-Id: Idbdfecdcbf866b56366cb47308246dc02d6905a0
Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>
src/lib/elementary/elm_index.c
src/lib/elementary/elm_index_item_eo.c
src/lib/elementary/elm_widget_index.h

index 095a3d9..6e0d252 100644 (file)
@@ -61,6 +61,9 @@ _item_free(Elm_Index_Item_Data *it)
      it->omitted = eina_list_free(it->omitted);
 
    ELM_SAFE_FREE(it->letter, eina_stringshare_del);
+   // TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+   ELM_SAFE_FREE(it->style, eina_stringshare_del);
+   /* END */
 }
 
 static void
@@ -136,6 +139,24 @@ _elm_index_item_elm_widget_item_access_register(Eo *eo_item, Elm_Index_Item_Data
    return ret;
 }
 
+// TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+EOLIAN static void
+_elm_index_item_elm_widget_item_style_set(Eo *eo_it EINA_UNUSED,
+                                          Elm_Index_Item_Data *it,
+                                          const char *style)
+{
+   if (eina_stringshare_replace(&it->style, style))
+     elm_widget_theme_object_set(WIDGET(it), VIEW(it), "index", style, elm_widget_style_get(WIDGET(it)));
+}
+
+EOLIAN static const char *
+_elm_index_item_elm_widget_item_style_get(const Eo *eo_it EINA_UNUSED,
+                                          Elm_Index_Item_Data *it)
+{
+   return it->style;
+}
+/* END */
+
 static void
 _omit_calc(void *data, int num_of_items, int max_num_of_items)
 {
@@ -342,8 +363,13 @@ _index_box_auto_fill(Evas_Object *obj,
 
         edje_object_mirrored_set(VIEW(it), rtl);
         o = VIEW(it);
-
+        /* TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
         if (efl_ui_dir_is_horizontal(sd->dir, EINA_FALSE))
+        */
+        if (it->style)
+          elm_widget_theme_object_set(obj, o, "index", it->style, elm_widget_style_get(obj));
+        else if (efl_ui_dir_is_horizontal(sd->dir, EINA_FALSE))
+        /* END */
           {
              if (i & 0x1)
                elm_widget_theme_object_set
index c3d1867..c2964ea 100644 (file)
@@ -52,6 +52,12 @@ void _elm_index_item_efl_object_destructor(Eo *obj, Elm_Index_Item_Data *pd);
 Efl_Canvas_Object *_elm_index_item_elm_widget_item_access_register(Eo *obj, Elm_Index_Item_Data *pd);
 
 
+// TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+void _elm_index_item_elm_widget_item_style_set(Eo *obj, Elm_Index_Item_Data *pd, const char *style);
+const char *_elm_index_item_elm_widget_item_style_get(const Eo *obj, Elm_Index_Item_Data *pd);
+/* END */
+
+
 const char *_elm_index_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Index_Item_Data *pd);
 
 
@@ -85,6 +91,10 @@ _elm_index_item_class_initializer(Efl_Class *klass)
       EFL_OBJECT_OP_FUNC(efl_constructor, _elm_index_item_efl_object_constructor),
       EFL_OBJECT_OP_FUNC(efl_destructor, _elm_index_item_efl_object_destructor),
       EFL_OBJECT_OP_FUNC(elm_wdg_item_access_register, _elm_index_item_elm_widget_item_access_register),
+      // TIZEN_ONLY(20160630) : implement elm_index_item_elm_widget_item_style_set
+      EFL_OBJECT_OP_FUNC(elm_wdg_item_style_set, _elm_index_item_elm_widget_item_style_set),
+      EFL_OBJECT_OP_FUNC(elm_wdg_item_style_get, _elm_index_item_elm_widget_item_style_get),
+      /* END */
       EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_index_item_efl_access_object_i18n_name_get),
       EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_index_item_efl_access_widget_action_elm_actions_get),
       EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_index_item_efl_access_object_state_set_get),
index 845a354..ba1871a 100644 (file)
@@ -67,6 +67,9 @@ struct _Elm_Index_Item_Data
    Elm_Index_Item_Data  *head;
 
    int              priority;
+   // TIZEN_ONLY(20160630): implement elm_index_item_elm_widget_item_style_set
+   Eina_Stringshare *style;
+   /* END */
    Eina_Bool        selected : 1; /**< a flag that remembers an item is selected. this is set true when mouse down/move occur above an item and when elm_index_item_selected_set() API is called. */
 };