elm genlist: Fixed flipmode cache issue. Renamed nocache to nocache_once and adopted...
[framework/uifw/elementary.git] / src / lib / elm_genlist.c
index 792a7e9..5006cd7 100644 (file)
    (it)->unhighlight_cb = (Ecore_Cb)_item_unhighlight; \
    (it)->unrealize_cb = (Ecore_Cb)_item_unrealize_cb
 
+#define ELM_GENLIST_CHECK_ITC_VER(itc) \
+   do \
+     { \
+        if (!itc) \
+          { \
+             ERR("Genlist_Item_Class(itc) is NULL"); \
+             return; \
+          } \
+        if (itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) \
+          { \
+             ERR("Genlist_Item_Class version mismatched! required = (%d), current  = (%d)", itc->version, ELM_GENLIST_ITEM_CLASS_VERSION); \
+             return; \
+          } \
+     } \
+   while(0)
+
 typedef struct _Item_Block  Item_Block;
 typedef struct _Item_Cache  Item_Cache;
 
@@ -31,7 +47,7 @@ struct Elm_Gen_Item_Type
    Eina_List                    *items;
    Evas_Coord                    w, h, minw, minh;
    Elm_Gen_Item                 *group_item;
-   Elm_Genlist_Item_Flags        flags;
+   Elm_Genlist_Item_Type        type;
    Eina_List                    *mode_texts, *mode_contents, *mode_states, *mode_content_objs;
    Eina_List                    *edit_texts, *edit_contents, *edit_states, *edit_content_objs;
    Ecore_Timer                  *swipe_timer;
@@ -50,7 +66,8 @@ struct Elm_Gen_Item_Type
    Eina_Bool                     queued : 1;
    Eina_Bool                     showme : 1;
    Eina_Bool                     updateme : 1;
-   Eina_Bool                     nocache : 1;
+   Eina_Bool                     nocache : 1; /* do not use cache for this item */
+   Eina_Bool                     nocache_once : 1; /* do not use cache for this item only once */
    Eina_Bool                     stacking_even : 1;
    Eina_Bool                     nostacking : 1;
    Eina_Bool                     move_effect_enabled : 1;
@@ -329,6 +346,7 @@ _event_hook(Evas_Object       *obj,
      {
         it = elm_genlist_first_item_get(obj);
         elm_genlist_item_bring_in(it);
+        elm_genlist_item_selected_set(it, EINA_TRUE);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
      }
@@ -336,6 +354,7 @@ _event_hook(Evas_Object       *obj,
      {
         it = elm_genlist_last_item_get(obj);
         elm_genlist_item_bring_in(it);
+        elm_genlist_item_selected_set(it, EINA_TRUE);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
      }
@@ -798,7 +817,7 @@ _item_del(Elm_Gen_Item *it)
    Evas_Object *obj = WIDGET(it);
 
    evas_event_freeze(evas_object_evas_get(obj));
-   elm_genlist_item_subitems_clear((Elm_Object_Item *) it);
+   elm_genlist_item_subitems_clear((Elm_Object_Item *)it);
    if (it->wd->show_item == it) it->wd->show_item = NULL;
    if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
    if (it->item->edit_mode_item_realized) _edit_mode_item_unrealize(it);
@@ -811,6 +830,7 @@ _item_del(Elm_Gen_Item *it)
         if (!it->wd->anchor_item)
           it->wd->anchor_item = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
      }
+   if (it->wd->expanded_item == it) it->wd->expanded_item = NULL;
    if (it->parent)
      it->parent->item->items = eina_list_remove(it->parent->item->items, it);
    if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
@@ -877,7 +897,7 @@ _mouse_move(void        *data,
         if (!it->wd->on_hold)
           {
              it->wd->on_hold = EINA_TRUE;
-             if (!it->wd->wasselected)
+             if ((!it->wd->wasselected) && (!it->flipped))
                {
                   _item_unhighlight(it);
                   _item_unselect(it);
@@ -1030,9 +1050,9 @@ _long_press(void *data)
           {
              if (it != it_tmp) _item_unselect(it_tmp);
           }
-        if (elm_genlist_item_expanded_get((Elm_Object_Item *) it))
+        if (elm_genlist_item_expanded_get((Elm_Object_Item *)it))
           {
-             elm_genlist_item_expanded_set((Elm_Object_Item *) it, EINA_FALSE);
+             elm_genlist_item_expanded_set((Elm_Object_Item *)it, EINA_FALSE);
              return ECORE_CALLBACK_RENEW;
           }
 
@@ -1348,7 +1368,7 @@ _mouse_up(void        *data,
    if (it->wd->longpressed)
      {
         it->wd->longpressed = EINA_FALSE;
-        if (!it->wd->wasselected)
+        if ((!it->wd->wasselected) && (!it->flipped))
           {
              _item_unhighlight(it);
              _item_unselect(it);
@@ -1476,7 +1496,7 @@ _mode_finished_signal_cb(void        *data,
    Evas *te = evas_object_evas_get(obj);
 
    evas_event_freeze(te);
-   it->item->nocache = EINA_FALSE;
+   it->item->nocache_once = EINA_FALSE;
    _mode_item_unrealize(it);
    if (it->item->group_item)
      evas_object_raise(it->item->VIEW(group_item));
@@ -1500,7 +1520,7 @@ _item_cache_clean(Widget_Data *wd)
         wd->item_cache_count--;
         if (itc->spacer) evas_object_del(itc->spacer);
         if (itc->base_view) evas_object_del(itc->base_view);
-        if (itc->item_style) eina_stringshare_del(itc->item_style);
+        eina_stringshare_del(itc->item_style);
         free(itc);
      }
    evas_event_thaw(evas_object_evas_get(wd->obj));
@@ -1551,7 +1571,7 @@ _item_cache_add(Elm_Gen_Item *it)
    evas_object_hide(itc->base_view);
    evas_object_move(itc->base_view, -9999, -9999);
    itc->item_style = eina_stringshare_add(it->itc->item_style);
-   if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
+   if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
    itc->compress = (it->wd->compress);
    itc->selected = it->selected;
    itc->disabled = elm_widget_item_disabled_get(it);
@@ -1598,14 +1618,16 @@ _item_cache_find(Elm_Gen_Item *it)
    Item_Cache *itc;
    Eina_Bool tree = 0;
 
-   if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
+   if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
    EINA_INLIST_FOREACH(it->wd->item_cache, itc)
      {
         if ((itc->selected) || (itc->disabled) || (itc->expanded))
           continue;
         if ((itc->tree == tree) &&
             (itc->compress == it->wd->compress) &&
-            (!strcmp(it->itc->item_style, itc->item_style)))
+            (((!it->itc->item_style) && (!itc->item_style)) ||
+             (it->itc->item_style && itc->item_style &&
+            (!strcmp(it->itc->item_style, itc->item_style)))))
           {
              it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
                                                      EINA_INLIST_GET(itc));
@@ -1724,7 +1746,7 @@ _item_cache_free(Item_Cache *itc)
 {
    if (itc->spacer) evas_object_del(itc->spacer);
    if (itc->base_view) evas_object_del(itc->base_view);
-   if (itc->item_style) eina_stringshare_del(itc->item_style);
+   eina_stringshare_del(itc->item_style);
    free(itc);
 }
 
@@ -1870,6 +1892,41 @@ _item_state_realize(Elm_Gen_Item *it,
      }
 }
 
+static Eina_List *
+_item_flips_realize(Elm_Gen_Item *it,
+                    Evas_Object *target,
+                    Eina_List **source)
+{
+   Eina_List *res = NULL;
+
+   if (it->itc->func.content_get)
+     {
+        const Eina_List *l;
+        const char *key;
+        Evas_Object *ic = NULL;
+
+        *source = elm_widget_stringlist_get(edje_object_data_get(target, "flips"));
+
+        EINA_LIST_FOREACH(*source, l, key)
+          {
+             if (it->itc->func.content_get)
+               ic = it->itc->func.content_get
+                  ((void *)it->base.data, WIDGET(it), key);
+             if (ic)
+               {
+                  res = eina_list_append(res, ic);
+                  edje_object_part_swallow(target, key, ic);
+                  evas_object_show(ic);
+                  elm_widget_sub_object_add(WIDGET(it), ic);
+                  if (elm_widget_item_disabled_get(it))
+                    elm_widget_disabled_set(ic, EINA_TRUE);
+               }
+          }
+     }
+
+   return res;
+}
+
 static void
 _item_realize(Elm_Gen_Item *it,
               int               in,
@@ -1897,9 +1954,9 @@ _item_realize(Elm_Gen_Item *it,
      }
    it->item->order_num_in = in;
 
-   if (it->item->nocache)
-     it->item->nocache = EINA_FALSE;
-   else
+   if (it->item->nocache_once)
+     it->item->nocache_once = EINA_FALSE;
+   else if (!it->item->nocache)
      itc = _item_cache_find(it);
    if (itc)
      {
@@ -1920,14 +1977,10 @@ _item_realize(Elm_Gen_Item *it,
         evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
         elm_widget_sub_object_add(WIDGET(it), VIEW(it));
 
-        if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
-          strncpy(buf, "tree", sizeof(buf));
-        else strncpy(buf, "item", sizeof(buf));
-        if (it->wd->compress)
-          strncat(buf, "_compress", sizeof(buf) - strlen(buf));
-
-        strncat(buf, "/", sizeof(buf) - strlen(buf));
-        strncat(buf, it->itc->item_style, sizeof(buf) - strlen(buf));
+        if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS)
+          snprintf(buf, sizeof(buf), "tree%s/%s", it->wd->compress ? "_compress" : "", it->itc->item_style ?: "default");
+        else
+          snprintf(buf, sizeof(buf), "item%s/%s", it->wd->compress ? "_compress" : "", it->itc->item_style ?: "default");
 
         _elm_theme_object_set(WIDGET(it), VIEW(it), "genlist", buf,
                               elm_widget_style_get(WIDGET(it)));
@@ -1978,7 +2031,7 @@ _item_realize(Elm_Gen_Item *it,
                                        _multi_move, it);
 
         if ((it->wd->edit_mode) && (!it->edit_obj) &&
-            (it->item->flags != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
+            (it->item->type != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
           _edit_mode_item_realize(it, EINA_FALSE);
 
         _elm_genlist_item_state_update(it, itc);
@@ -2014,6 +2067,11 @@ _item_realize(Elm_Gen_Item *it,
         _item_text_realize(it, VIEW(it), &it->texts, NULL);
         it->content_objs = _item_content_realize(it, VIEW(it), &it->contents, NULL);
         _item_state_realize(it, VIEW(it), &it->states, NULL);
+        if (it->flipped)
+          {
+             edje_object_signal_emit(VIEW(it), "elm,state,flip,enabled", "elm");
+             it->content_objs = _item_flips_realize(it, VIEW(it), &it->contents);
+          }
 
         if (!it->item->mincalcd)
           {
@@ -2035,7 +2093,7 @@ _item_realize(Elm_Gen_Item *it,
                   it->wd->group_item_width = mw;
                   it->wd->group_item_height = mh;
                }
-             else if ((!it->wd->item_width) && (it->item->flags == ELM_GENLIST_ITEM_NONE))
+             else if ((!it->wd->item_width) && (it->item->type == ELM_GENLIST_ITEM_NONE))
                {
                   it->wd->item_width = mw;
                   it->wd->item_height = mh;
@@ -2065,7 +2123,7 @@ _item_realize(Elm_Gen_Item *it,
    if (!calc)
      evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
 
-   if ((!calc) && (it->wd->edit_mode) && (it->item->flags != ELM_GENLIST_ITEM_GROUP))
+   if ((!calc) && (it->wd->edit_mode) && (it->item->type != ELM_GENLIST_ITEM_GROUP))
      {
         if (it->itc->edit_item_style)
           {
@@ -2079,7 +2137,7 @@ _item_realize(Elm_Gen_Item *it,
 static void
 _item_unrealize_cb(Elm_Gen_Item *it)
 {
-   if (it->item->nocache)
+   if (it->item->nocache_once || it->item->nocache)
      {
         evas_object_del(VIEW(it));
         VIEW(it) = NULL;
@@ -2332,7 +2390,7 @@ _item_block_position(Item_Block *itb,
                }
              if (it->realized)
                {
-                  if (vis)
+                  if (vis || it->dragging)
                     {
                        if (it->wd->reorder_mode)
                          y += _get_space_for_reorder_item(it);
@@ -2375,7 +2433,7 @@ _item_block_position(Item_Block *itb,
                     }
                   else
                     {
-                       if (!it->dragging) _elm_genlist_item_unrealize(it, EINA_FALSE);
+                       _elm_genlist_item_unrealize(it, EINA_FALSE);
                     }
                }
              in++;
@@ -3126,7 +3184,7 @@ _item_mode_set(Elm_Gen_Item *it)
    char buf[1024];
 
    wd->mode_item = it;
-   it->item->nocache = EINA_TRUE;
+   it->item->nocache_once = EINA_TRUE;
 
    if (wd->scr_hold_timer)
      {
@@ -3157,7 +3215,7 @@ _item_mode_unset(Widget_Data *wd)
    Elm_Gen_Item *it;
 
    it = wd->mode_item;
-   it->item->nocache = EINA_TRUE;
+   it->item->nocache_once = EINA_TRUE;
 
    snprintf(buf, sizeof(buf), "elm,state,%s,passive", wd->mode_type);
    snprintf(buf2, sizeof(buf2), "elm,state,%s,passive,finished", wd->mode_type);
@@ -3193,7 +3251,7 @@ _edit_mode_item_realize(Elm_Gen_Item *it, Eina_Bool effect_on)
    evas_object_smart_member_add(it->edit_obj, it->wd->pan_smart);
    elm_widget_sub_object_add(WIDGET(it), it->edit_obj);
 
-   if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
+   if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS)
       strncpy(buf, "tree", sizeof(buf));
    else strncpy(buf, "item", sizeof(buf));
    if (it->wd->compress)
@@ -3236,6 +3294,7 @@ _edit_mode_item_realize(Elm_Gen_Item *it, Eina_Bool effect_on)
                                   _multi_move, it);
 
    _item_text_realize(it, it->edit_obj, &it->item->edit_texts, NULL);
+   if (it->flipped)  edje_object_signal_emit(it->edit_obj, "elm,state,flip,enabled", "elm");
    it->item->edit_content_objs =
      _item_content_realize(it, it->edit_obj, &it->item->edit_contents, NULL);
    _item_state_realize(it, it->edit_obj, &it->item->edit_states, NULL);
@@ -3269,7 +3328,7 @@ _edit_mode_item_unrealize(Elm_Gen_Item *it)
    elm_widget_stringlist_free(it->item->edit_states);
    it->item->edit_states = NULL;
    EINA_LIST_FREE(it->item->edit_content_objs, icon)
-      evas_object_del(icon);
+     evas_object_del(icon);
    edje_object_message_signal_process(it->edit_obj);
 
    evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_DOWN,
@@ -3433,7 +3492,7 @@ _item_select(Elm_Gen_Item *it)
                }
           }
         else
-          it->wd->last_selected_item = (Elm_Object_Item *) it;
+          it->wd->last_selected_item = (Elm_Object_Item *)it;
      }
 }
 
@@ -3476,7 +3535,7 @@ _item_disable_hook(Elm_Object_Item *it)
 {
    Eina_List *l;
    Evas_Object *obj;
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (_it->generation < _it->wd->generation) return;
 
@@ -3505,7 +3564,7 @@ _item_disable_hook(Elm_Object_Item *it)
 static Eina_Bool
 _item_del_pre_hook(Elm_Object_Item *it)
 {
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if ((_it->relcount > 0) || (_it->walking > 0))
      {
@@ -3554,12 +3613,12 @@ _elm_genlist_item_new(Widget_Data              *wd,
    elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
    elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
    elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
+   elm_widget_item_text_get_hook_set(it, _item_text_hook);
    elm_widget_item_disable_hook_set(it, _item_disable_hook);
    elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
    /* TEMPORARY */
    it->sel_cb = (Ecore_Cb)_item_select;
 
-   elm_widget_item_text_get_hook_set(it, _item_text_hook);
    return it;
 }
 
@@ -3568,7 +3627,7 @@ _item_new(Widget_Data                  *wd,
           const Elm_Genlist_Item_Class *itc,
           const void                   *data,
           Elm_Gen_Item                 *parent,
-          Elm_Genlist_Item_Flags        flags,
+          Elm_Genlist_Item_Type         type,
           Evas_Smart_Cb                 func,
           const void                   *func_data)
 {
@@ -3578,8 +3637,8 @@ _item_new(Widget_Data                  *wd,
    it = _elm_genlist_item_new(wd, itc, data, parent, func, func_data);
    if (!it) return NULL;
    it->item = ELM_NEW(Elm_Gen_Item_Type);
-   it->item->flags = flags;
-   if (flags & ELM_GENLIST_ITEM_GROUP) it->group++;
+   it->item->type = type;
+   if (type & ELM_GENLIST_ITEM_GROUP) it->group++;
    it->item->expanded_depth = 0;
    ELM_GEN_ITEM_SETUP(it);
    if (it->parent)
@@ -3977,15 +4036,6 @@ _item_queue(Widget_Data *wd,
 }
 
 static int
-_elm_genlist_item_compare_data(const void *data, const void *data1)
-{
-   const Elm_Gen_Item *it = data;
-   const Elm_Gen_Item *item1 = data1;
-
-   return it->wd->item_compare_data_cb(it->base.data, item1->base.data);
-}
-
-static int
 _elm_genlist_item_compare(const void *data, const void *data1)
 {
    const Elm_Gen_Item *it, *item1;
@@ -4053,14 +4103,14 @@ elm_genlist_item_append(Evas_Object                  *obj,
                         const Elm_Genlist_Item_Class *itc,
                         const void                   *data,
                         Elm_Object_Item              *parent,
-                        Elm_Genlist_Item_Flags        flags,
+                        Elm_Genlist_Item_Type         type,
                         Evas_Smart_Cb                 func,
                         const void                   *func_data)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
-   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
                                 func, func_data);
    if (!it) return NULL;
    if (!it->parent)
@@ -4085,7 +4135,7 @@ elm_genlist_item_append(Evas_Object                  *obj,
      }
    it->item->before = EINA_FALSE;
    _item_queue(wd, it, NULL);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
@@ -4093,14 +4143,14 @@ elm_genlist_item_prepend(Evas_Object                  *obj,
                          const Elm_Genlist_Item_Class *itc,
                          const void                   *data,
                          Elm_Object_Item              *parent,
-                         Elm_Genlist_Item_Flags        flags,
+                         Elm_Genlist_Item_Type         type,
                          Evas_Smart_Cb                 func,
                          const void                   *func_data)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
-   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
                                 func, func_data);
    if (!it) return NULL;
    if (!it->parent)
@@ -4125,7 +4175,7 @@ elm_genlist_item_prepend(Evas_Object                  *obj,
      }
    it->item->before = EINA_TRUE;
    _item_queue(wd, it, NULL);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
@@ -4134,7 +4184,7 @@ elm_genlist_item_insert_after(Evas_Object                  *obj,
                               const void                   *data,
                               Elm_Object_Item              *parent,
                               Elm_Object_Item              *after,
-                              Elm_Genlist_Item_Flags        flags,
+                              Elm_Genlist_Item_Type         type,
                               Evas_Smart_Cb                 func,
                               const void                   *func_data)
 {
@@ -4146,7 +4196,7 @@ elm_genlist_item_insert_after(Evas_Object                  *obj,
    /* It makes no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
    EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
 
-   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
                                 func, func_data);
    if (!it) return NULL;
    if (!it->parent)
@@ -4166,7 +4216,7 @@ elm_genlist_item_insert_after(Evas_Object                  *obj,
    it->item->rel->relcount++;
    it->item->before = EINA_FALSE;
    _item_queue(wd, it, NULL);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
@@ -4175,7 +4225,7 @@ elm_genlist_item_insert_before(Evas_Object                  *obj,
                                const void                   *data,
                                Elm_Object_Item              *parent,
                                Elm_Object_Item              *before,
-                               Elm_Genlist_Item_Flags        flags,
+                               Elm_Genlist_Item_Type         type,
                                Evas_Smart_Cb                 func,
                                const void                   *func_data)
 {
@@ -4187,7 +4237,7 @@ elm_genlist_item_insert_before(Evas_Object                  *obj,
    /* It makes no sense to insert before in an empty list with before != NULL, something really bad is happening in your app. */
    EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
 
-   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
                                 func, func_data);
    if (!it) return NULL;
    if (!it->parent)
@@ -4207,24 +4257,24 @@ elm_genlist_item_insert_before(Evas_Object                  *obj,
    it->item->rel->relcount++;
    it->item->before = EINA_TRUE;
    _item_queue(wd, it, NULL);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
-elm_genlist_item_direct_sorted_insert(Evas_Object                  *obj,
-                                      const Elm_Genlist_Item_Class *itc,
-                                      const void                   *data,
-                                      Elm_Object_Item              *parent,
-                                      Elm_Genlist_Item_Flags        flags,
-                                      Eina_Compare_Cb               comp,
-                                      Evas_Smart_Cb                 func,
-                                      const void                   *func_data)
+elm_genlist_item_sorted_insert(Evas_Object                  *obj,
+                               const Elm_Genlist_Item_Class *itc,
+                               const void                   *data,
+                               Elm_Object_Item              *parent,
+                               Elm_Genlist_Item_Type         type,
+                               Eina_Compare_Cb               comp,
+                               Evas_Smart_Cb                 func,
+                               const void                   *func_data)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
    Elm_Gen_Item *rel = NULL;
-   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+   Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
                                 func, func_data);
    if (!it) return NULL;
 
@@ -4236,7 +4286,8 @@ elm_genlist_item_direct_sorted_insert(Evas_Object                  *obj,
         int cmp_result;
 
         l = eina_list_search_sorted_near_list(it->parent->item->items,
-                                              _elm_genlist_item_list_compare, it,
+                                              _elm_genlist_item_list_compare,
+                                              it,
                                               &cmp_result);
         if (l)
           rel = eina_list_data_get(l);
@@ -4291,25 +4342,7 @@ elm_genlist_item_direct_sorted_insert(Evas_Object                  *obj,
 
    _item_queue(wd, it, _elm_genlist_item_list_compare);
 
-   return (Elm_Object_Item *) it;
-}
-
-EAPI Elm_Object_Item *
-elm_genlist_item_sorted_insert(Evas_Object                  *obj,
-                               const Elm_Genlist_Item_Class *itc,
-                               const void                   *data,
-                               Elm_Object_Item              *parent,
-                               Elm_Genlist_Item_Flags        flags,
-                               Eina_Compare_Cb               comp,
-                               Evas_Smart_Cb                 func,
-                               const void                   *func_data)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   Widget_Data *wd = elm_widget_data_get(obj);
-   wd->item_compare_data_cb = comp;
-   return elm_genlist_item_direct_sorted_insert(obj, itc, data, parent, flags,
-                                                _elm_genlist_item_compare_data,
-                                                func, func_data);
+   return (Elm_Object_Item *)it;
 }
 
 static void
@@ -4331,7 +4364,7 @@ _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
 
    if (wd->walking > 0)
      {
-        wd->clear_me = 1;
+        wd->clear_me = EINA_TRUE;
         return;
      }
    evas_event_freeze(evas_object_evas_get(wd->obj));
@@ -4352,7 +4385,7 @@ _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
              if (itn) itn->walking--;
           }
      }
-   wd->clear_me = 0;
+   wd->clear_me = EINA_FALSE;
    wd->pan_changed = EINA_TRUE;
    if (wd->calc_job)
      {
@@ -4389,7 +4422,7 @@ elm_genlist_multi_select_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->multi = multi;
+   wd->multi = !!multi;
 }
 
 EAPI Eina_Bool
@@ -4436,7 +4469,7 @@ elm_genlist_realized_items_get(const Evas_Object *obj)
              Eina_List *l;
              Elm_Gen_Item *it;
 
-             done = 1;
+             done = EINA_TRUE;
              EINA_LIST_FOREACH(itb->items, l, it)
                {
                   if (it->realized) list = eina_list_append(list, it);
@@ -4488,7 +4521,7 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj,
                          *posret = 1;
                        else *posret = 0;
                     }
-                  return (Elm_Object_Item *) it;
+                  return (Elm_Object_Item *)it;
                }
              lasty = ity + it->item->h;
           }
@@ -4511,7 +4544,7 @@ elm_genlist_first_item_get(const Evas_Object *obj)
    Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items);
    while ((it) && (it->generation < wd->generation))
      it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
@@ -4524,14 +4557,14 @@ elm_genlist_last_item_get(const Evas_Object *obj)
    Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
    while ((it) && (it->generation < wd->generation))
      it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
-   return (Elm_Object_Item *) it;
+   return (Elm_Object_Item *)it;
 }
 
 EAPI Elm_Object_Item *
 elm_genlist_item_next_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    while (_it)
      {
         _it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(_it)->next);
@@ -4544,7 +4577,7 @@ EAPI Elm_Object_Item *
 elm_genlist_item_prev_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    while (_it)
      {
         _it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(_it)->prev);
@@ -4553,7 +4586,7 @@ elm_genlist_item_prev_get(const Elm_Object_Item *it)
    return (Elm_Object_Item *) _it;
 }
 
-EAPI Evas_Object *
+EINA_DEPRECATED EAPI Evas_Object *
 elm_genlist_item_genlist_get(const Elm_Object_Item *it)
 {
    return elm_object_item_widget_get(it);
@@ -4563,7 +4596,7 @@ EAPI Elm_Object_Item *
 elm_genlist_item_parent_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
-   return (Elm_Object_Item *) ((Elm_Gen_Item *) it)->parent;
+   return (Elm_Object_Item *) ((Elm_Gen_Item *)it)->parent;
 }
 
 EAPI void
@@ -4573,7 +4606,7 @@ elm_genlist_item_subitems_clear(Elm_Object_Item *it)
    Eina_List *tl = NULL, *l;
    Elm_Gen_Item *_it;
    Elm_Object_Item *it2;
-   _it = (Elm_Gen_Item *) it;
+   _it = (Elm_Gen_Item *)it;
 
    EINA_LIST_FOREACH(_it->item->items, l, it2)
      tl = eina_list_append(tl, it2);
@@ -4586,7 +4619,7 @@ elm_genlist_item_selected_set(Elm_Object_Item *it,
                               Eina_Bool selected)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Widget_Data *wd = _it->wd;
    if (!wd) return;
    if ((_it->generation < wd->generation) || elm_widget_item_disabled_get(_it))
@@ -4616,7 +4649,7 @@ EAPI Eina_Bool
 elm_genlist_item_selected_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
-   return ((Elm_Gen_Item *) it)->selected;
+   return ((Elm_Gen_Item *)it)->selected;
 }
 
 EAPI void
@@ -4624,16 +4657,17 @@ elm_genlist_item_expanded_set(Elm_Object_Item  *it,
                               Eina_Bool         expanded)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+   expanded = !!expanded;
    if (_it->item->expanded == expanded) return;
    _it->item->expanded = expanded;
-   _it->wd->expanded_item = _it;
    if (_it->item->expanded)
      {
         if (_it->realized)
           edje_object_signal_emit(VIEW(_it), "elm,state,expanded", "elm");
         evas_object_smart_callback_call(WIDGET(_it), SIG_EXPANDED, _it);
         _it->wd->auto_scroll_enabled = EINA_TRUE;
+        _it->wd->expanded_item = _it;
      }
    else
      {
@@ -4641,6 +4675,7 @@ elm_genlist_item_expanded_set(Elm_Object_Item  *it,
           edje_object_signal_emit(VIEW(_it), "elm,state,contracted", "elm");
         evas_object_smart_callback_call(WIDGET(_it), SIG_CONTRACTED, _it);
         _it->wd->auto_scroll_enabled = EINA_FALSE;
+        _it->wd->expanded_item = NULL;
      }
 }
 
@@ -4648,24 +4683,24 @@ EAPI Eina_Bool
 elm_genlist_item_expanded_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
-   return ((Elm_Gen_Item *) it)->item->expanded;
+   return ((Elm_Gen_Item *)it)->item->expanded;
 }
 
 EAPI int
 elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, 0);
-   return ((Elm_Gen_Item *) it)->item->expanded_depth;
+   return ((Elm_Gen_Item *)it)->item->expanded_depth;
 }
 
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_genlist_item_disabled_set(Elm_Object_Item  *it,
                               Eina_Bool         disabled)
 {
    elm_object_item_disabled_set(it, disabled);
 }
 
-EAPI Eina_Bool
+EINA_DEPRECATED EAPI Eina_Bool
 elm_genlist_item_disabled_get(const Elm_Object_Item *it)
 {
    return elm_object_item_disabled_get(it);
@@ -4676,7 +4711,7 @@ elm_genlist_item_display_only_set(Elm_Object_Item  *it,
                                   Eina_Bool         display_only)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    display_only = !!display_only;
    if (_it->display_only == display_only) return;
    if (_it->generation < _it->wd->generation) return;
@@ -4692,7 +4727,7 @@ EAPI Eina_Bool
 elm_genlist_item_display_only_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    if (_it->generation < _it->wd->generation) return EINA_FALSE;
    return _it->display_only;
 }
@@ -4701,7 +4736,7 @@ EAPI void
 elm_genlist_item_show(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord gith = 0;
    if (_it->generation < _it->wd->generation) return;
    if ((_it->item->queued) || (!_it->item->mincalcd))
@@ -4730,7 +4765,7 @@ EAPI void
 elm_genlist_item_promote(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    if (_it->generation < _it->wd->generation) return;
    _item_move_before(_it,
                      (Elm_Gen_Item *) elm_genlist_first_item_get(WIDGET(_it)));
@@ -4740,7 +4775,7 @@ EAPI void
 elm_genlist_item_demote(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    if (_it->generation < _it->wd->generation) return;
    _item_move_after(_it,
                     (Elm_Gen_Item *) elm_genlist_last_item_get(WIDGET(_it)));
@@ -4750,7 +4785,7 @@ EAPI void
 elm_genlist_item_bring_in(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord gith = 0;
    if (_it->generation < _it->wd->generation) return;
    if ((_it->item->queued) || (!_it->item->mincalcd))
@@ -4779,7 +4814,7 @@ EAPI void
 elm_genlist_item_top_show(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord ow, oh;
    Evas_Coord gith = 0;
 
@@ -4809,7 +4844,7 @@ EAPI void
 elm_genlist_item_top_bring_in(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord ow, oh;
    Evas_Coord gith = 0;
 
@@ -4839,7 +4874,7 @@ EAPI void
 elm_genlist_item_middle_show(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord ow, oh;
 
    if (_it->generation < _it->wd->generation) return;
@@ -4868,7 +4903,7 @@ EAPI void
 elm_genlist_item_middle_bring_in(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord ow, oh;
 
    if (_it->generation < _it->wd->generation) return;
@@ -4924,7 +4959,7 @@ elm_genlist_item_contents_orphan(Elm_Object_Item *it)
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Evas_Object *content;
-   EINA_LIST_FREE(((Elm_Gen_Item *) it)->content_objs, content)
+   EINA_LIST_FREE(((Elm_Gen_Item *)it)->content_objs, content)
      {
         elm_widget_sub_object_del(WIDGET(it), content);
         evas_object_smart_member_del(content);
@@ -4932,7 +4967,7 @@ elm_genlist_item_contents_orphan(Elm_Object_Item *it)
      }
 }
 
-EAPI const Evas_Object *
+EINA_DEPRECATED EAPI const Evas_Object *
 elm_genlist_item_object_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
@@ -4943,7 +4978,7 @@ EAPI void
 elm_genlist_item_update(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (!_it->item->block) return;
    if (_it->generation < _it->wd->generation) return;
@@ -4957,15 +4992,15 @@ elm_genlist_item_update(Elm_Object_Item *it)
 EAPI void
 elm_genlist_item_fields_update(Elm_Object_Item *it,
                                const char *parts,
-                               Elm_Genlist_Item_Field_Flags itf)
+                               Elm_Genlist_Item_Field_Type itf)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (!_it->item->block) return;
    if (_it->generation < _it->wd->generation) return;
 
-   if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_LABEL))
+   if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT))
      _item_text_realize(_it, VIEW(_it), &_it->texts, parts);
    if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_CONTENT))
      {
@@ -4983,13 +5018,13 @@ elm_genlist_item_item_class_update(Elm_Object_Item *it,
                                    const Elm_Genlist_Item_Class *itc)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (!_it->item->block) return;
    EINA_SAFETY_ON_NULL_RETURN(itc);
    if (_it->generation < _it->wd->generation) return;
    _it->itc = itc;
-   _it->item->nocache = EINA_TRUE;
+   _it->item->nocache_once = EINA_TRUE;
    elm_genlist_item_update(it);
 }
 
@@ -4997,7 +5032,7 @@ EAPI const Elm_Genlist_Item_Class *
 elm_genlist_item_item_class_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    if (_it->generation < _it->wd->generation) return NULL;
    return _it->itc;
 }
@@ -5042,7 +5077,7 @@ elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item           *it,
                                         Evas_Smart_Cb               del_cb)
 {
    ELM_OBJ_ITEM_CHECK_OR_GOTO(it, error);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if ((_it->tooltip.content_cb == func) && (_it->tooltip.data == data))
      return;
@@ -5073,7 +5108,7 @@ EAPI void
 elm_genlist_item_tooltip_unset(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if ((VIEW(_it)) && (_it->tooltip.content_cb))
      elm_widget_item_tooltip_unset(_it);
@@ -5093,7 +5128,7 @@ elm_genlist_item_tooltip_style_set(Elm_Object_Item  *it,
                                    const char       *style)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    eina_stringshare_replace(&_it->tooltip.style, style);
    if (VIEW(_it)) elm_widget_item_tooltip_style_set(_it, style);
@@ -5110,7 +5145,7 @@ elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it,
                                          Eina_Bool disable)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    _it->tooltip.free_size = disable;
    if (VIEW(_it)) return elm_widget_item_tooltip_window_mode_set(_it, disable);
@@ -5128,7 +5163,7 @@ elm_genlist_item_cursor_set(Elm_Object_Item  *it,
                             const char       *cursor)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    eina_stringshare_replace(&_it->mouse_cursor, cursor);
    if (VIEW(_it)) elm_widget_item_cursor_set(_it, cursor);
 }
@@ -5143,7 +5178,7 @@ EAPI void
 elm_genlist_item_cursor_unset(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (!_it->mouse_cursor) return;
 
@@ -5180,10 +5215,10 @@ elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it)
 }
 
 EAPI int
-elm_genlist_item_index_get(Elm_Object_Item *it)
+elm_genlist_item_index_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, -1);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    if (_it->item->block)
      return _it->position + _it->item->block->position;
@@ -5225,13 +5260,13 @@ elm_genlist_mode_get(const Evas_Object *obj)
    return wd->mode;
 }
 
-EAPI Elm_List_Mode
+EINA_DEPRECATED EAPI Elm_List_Mode
 elm_genlist_horizontal_get(const Evas_Object *obj)
 {
    return elm_genlist_mode_get(obj);
 }
 
-EAPI Elm_List_Mode
+EINA_DEPRECATED EAPI Elm_List_Mode
 elm_genlist_horizontal_mode_get(const Evas_Object *obj)
 {
    return elm_genlist_mode_get(obj);
@@ -5244,7 +5279,7 @@ elm_genlist_always_select_mode_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->always_select = always_select;
+   wd->always_select = !!always_select;
 }
 
 EAPI Eina_Bool
@@ -5263,7 +5298,7 @@ elm_genlist_no_select_mode_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->no_select = no_select;
+   wd->no_select = !!no_select;
 }
 
 EAPI Eina_Bool
@@ -5282,7 +5317,7 @@ elm_genlist_compress_mode_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->compress = compress;
+   wd->compress = !!compress;
    if (!compress) elm_genlist_homogeneous_set(obj, EINA_FALSE);
 }
 
@@ -5327,9 +5362,9 @@ elm_genlist_bounce_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
-   wd->h_bounce = h_bounce;
-   wd->v_bounce = v_bounce;
+   wd->h_bounce = !!h_bounce;
+   wd->v_bounce = !!v_bounce;
+   elm_smart_scroller_bounce_allow_set(wd->scr, wd->h_bounce, wd->v_bounce);
 }
 
 EAPI void
@@ -5352,7 +5387,7 @@ elm_genlist_homogeneous_set(Evas_Object *obj,
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
    if (homogeneous) elm_genlist_compress_mode_set(obj, EINA_TRUE);
-   wd->homogeneous = homogeneous;
+   wd->homogeneous = !!homogeneous;
 }
 
 EAPI Eina_Bool
@@ -5366,12 +5401,12 @@ elm_genlist_homogeneous_get(const Evas_Object *obj)
 
 EAPI void
 elm_genlist_block_count_set(Evas_Object *obj,
-                            int          n)
+                            int          count)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->max_items_per_block = n;
+   wd->max_items_per_block = count;
    wd->item_cache_max = wd->max_items_per_block * 2;
    _item_cache_clean(wd);
 }
@@ -5451,7 +5486,7 @@ elm_genlist_item_mode_set(Elm_Object_Item  *it,
                           Eina_Bool         mode_set)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
 
    Widget_Data *wd = _it->wd;
    Eina_List *l;
@@ -5473,13 +5508,13 @@ elm_genlist_item_mode_set(Elm_Object_Item  *it,
    if (wd->multi)
      {
         EINA_LIST_FOREACH(wd->selected, l, it2)
-          if (((Elm_Gen_Item *) it2)->realized)
+          if (((Elm_Gen_Item *)it2)->realized)
             elm_genlist_item_selected_set(it2, EINA_FALSE);
      }
    else
      {
         it2 = elm_genlist_selected_item_get(wd->obj);
-        if ((it2) && (((Elm_Gen_Item *) it2)->realized))
+        if ((it2) && (((Elm_Gen_Item *)it2)->realized))
           elm_genlist_item_selected_set(it2, EINA_FALSE);
      }
 
@@ -5552,15 +5587,16 @@ elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode)
 
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   edit_mode = !!edit_mode;
    if (wd->edit_mode == edit_mode) return;
+   wd->edit_mode = edit_mode;
 
-   wd->edit_mode = !!edit_mode;
    list = elm_genlist_realized_items_get(obj);
    if (!wd->edit_mode)
      {
         EINA_LIST_FOREACH(list, l, it)
           {
-             if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
+             if (it->item->type != ELM_GENLIST_ITEM_GROUP)
                _edit_mode_item_unrealize(it);
           }
         _item_cache_zero(wd);
@@ -5569,7 +5605,7 @@ elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode)
      {
         EINA_LIST_FOREACH(list, l, it)
           {
-             if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
+             if (it->item->type != ELM_GENLIST_ITEM_GROUP)
                {
                   if (it->selected) _item_unselect(it);
                   if (it->itc->edit_item_style)
@@ -5588,7 +5624,7 @@ elm_genlist_reorder_mode_set(Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->reorder_mode = reorder_mode;
+   wd->reorder_mode = !!reorder_mode;
 }
 
 EAPI Eina_Bool
@@ -5600,12 +5636,18 @@ elm_genlist_reorder_mode_get(const Evas_Object *obj)
    return wd->reorder_mode;
 }
 
-EAPI Elm_Genlist_Item_Flags
-elm_genlist_item_flags_get(const Elm_Object_Item *it)
+EAPI Elm_Genlist_Item_Type
+elm_genlist_item_type_get(const Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
-   return _it->item->flags;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+   return _it->item->type;
+}
+
+EINA_DEPRECATED EAPI Elm_Genlist_Item_Type
+elm_genlist_item_flags_get(const Elm_Object_Item *it)
+{
+   return elm_genlist_item_type_get(it);
 }
 
 EAPI Elm_Genlist_Item_Class *
@@ -5659,6 +5701,48 @@ elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
      }
 }
 
+void _flip_job(void *data)
+{
+   Elm_Gen_Item *it = (Elm_Gen_Item *) data;
+   _elm_genlist_item_unrealize(it, EINA_FALSE);
+   if (it->selected) _item_unselect(it);
+   it->flipped = EINA_TRUE;
+   it->item->nocache = EINA_TRUE;
+}
+
+EAPI void
+elm_genlist_item_flip_set(Elm_Object_Item *it,
+                          Eina_Bool flip)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+
+   flip = !!flip;
+   if (_it->flipped == flip) return;
+
+   if (flip)
+     {
+        ecore_job_add(_flip_job, _it);
+        if (_it->wd->calc_job) ecore_job_del(_it->wd->calc_job);
+        _it->wd->calc_job = ecore_job_add(_calc_job, _it->wd);
+     }
+   else
+     {
+        _it->flipped = flip;
+        _item_cache_zero(_it->wd);
+        elm_genlist_item_update(it);
+        _it->item->nocache = EINA_FALSE;
+     }
+}
+
+EAPI Eina_Bool
+elm_genlist_item_flip_get(const Elm_Object_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+   return _it->flipped;
+}
+
 /* for gengrid as of now */
 void
 _elm_genlist_page_relative_set(Evas_Object *obj,
@@ -5716,8 +5800,7 @@ _elm_genlist_current_page_get(const Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (wd->scr)
-     elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
+   elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
 }
 
 /* for gengrid as of now */
@@ -5729,8 +5812,7 @@ _elm_genlist_last_page_get(const Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (wd->scr)
-     elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
+   elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
 }
 
 /* for gengrid as of now */
@@ -5742,8 +5824,7 @@ _elm_genlist_page_show(const Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (wd->scr)
-     elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
+   elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
 }
 
 /* for gengrid as of now */
@@ -5755,8 +5836,7 @@ _elm_genlist_page_bring_in(const Evas_Object *obj,
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (wd->scr)
-     elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
+   elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
 }
 
 void
@@ -5828,7 +5908,7 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
    free(it->item);
 
    it->item = NULL;
-   if (it->wd->last_selected_item == (Elm_Object_Item *) it)
+   if (it->wd->last_selected_item == (Elm_Object_Item *)it)
      it->wd->last_selected_item = NULL;
    it->wd->item_count--;
 }