From: Hyoyoung Chang <hyoyoung@gmail.com>
[framework/uifw/elementary.git] / src / lib / elm_genlist.c
index 51013a9..93fc577 100644 (file)
@@ -6,6 +6,9 @@
 #include "els_scroller.h"
 #include "elm_gen_common.h"
 
+// internally allocated
+#define CLASS_ALLOCATED 0x3a70f11f
+
 #define MAX_ITEMS_PER_BLOCK 32
 #define REORDER_EFFECT_TIME 0.5
 
              ERR("Genlist_Item_Class(itc) is NULL"); \
              return; \
           } \
-        if (itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) \
+        if ((itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) && \
+            (itc->version != CLASS_ALLOCATED)) \
           { \
-             ERR("Genlist_Item_Class version mismatched! required = (%d), current  = (%d)", itc->version, ELM_GENLIST_ITEM_CLASS_VERSION); \
+             ERR("Genlist_Item_Class version mismatched! current = (%d), required = (%d) or (%d)", itc->version, ELM_GENLIST_ITEM_CLASS_VERSION, CLASS_ALLOCATED); \
              return; \
           } \
      } \
@@ -47,7 +51,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;
@@ -66,11 +70,13 @@ 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;
    Eina_Bool                     edit_mode_item_realized : 1;
+   Eina_Bool                     tree_effect_finished : 1; /* tree effect */
 };
 
 struct _Item_Block
@@ -164,6 +170,12 @@ static void      _elm_genlist_clear(Evas_Object *obj,
 static void      _pan_child_size_get(Evas_Object *obj,
                                      Evas_Coord  *w,
                                      Evas_Coord  *h);
+static Evas_Object* _create_tray_alpha_bg(const Evas_Object *obj);
+static void         _item_contract_emit(Elm_Gen_Item *it);
+static int          _item_tree_effect_before(Elm_Gen_Item *it);
+static void         _item_tree_effect(Widget_Data *wd, int y);
+static void         _item_tree_effect_finish(Widget_Data *wd);
+static Eina_Bool    _item_moving_effect_timer_cb(void *data);
 
 static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
 
@@ -201,6 +213,7 @@ static const char SIG_MULTI_PINCH_IN[] = "multi,pinch,in";
 static const char SIG_SWIPE[] = "swipe";
 static const char SIG_MOVED[] = "moved";
 static const char SIG_INDEX_UPDATE[] = "index,update";
+static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished";
 
 static const Evas_Smart_Cb_Description _signals[] = {
    {SIG_CLICKED_DOUBLE, ""},
@@ -236,6 +249,7 @@ static const Evas_Smart_Cb_Description _signals[] = {
    {SIG_MULTI_PINCH_IN, ""},
    {SIG_SWIPE, ""},
    {SIG_MOVED, ""},
+   {SIG_TREE_EFFECT_FINISHED, ""},
    {NULL, NULL}
 };
 
@@ -344,7 +358,7 @@ _event_hook(Evas_Object       *obj,
    else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home")))
      {
         it = elm_genlist_first_item_get(obj);
-        elm_genlist_item_bring_in(it);
+        elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
         elm_genlist_item_selected_set(it, EINA_TRUE);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
@@ -352,7 +366,7 @@ _event_hook(Evas_Object       *obj,
    else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
      {
         it = elm_genlist_last_item_get(obj);
-        elm_genlist_item_bring_in(it);
+        elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
         elm_genlist_item_selected_set(it, EINA_TRUE);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
@@ -422,12 +436,12 @@ _item_multi_select_up(Widget_Data *wd)
      {
         elm_genlist_item_selected_set(wd->last_selected_item, EINA_FALSE);
         wd->last_selected_item = prev;
-        elm_genlist_item_show(wd->last_selected_item);
+        elm_genlist_item_show(wd->last_selected_item, ELM_GENLIST_ITEM_SCROLLTO_IN);
      }
    else
      {
         elm_genlist_item_selected_set(prev, EINA_TRUE);
-        elm_genlist_item_show(prev);
+        elm_genlist_item_show(prev, ELM_GENLIST_ITEM_SCROLLTO_IN);
      }
    return EINA_TRUE;
 }
@@ -446,12 +460,12 @@ _item_multi_select_down(Widget_Data *wd)
      {
         elm_genlist_item_selected_set(wd->last_selected_item, EINA_FALSE);
         wd->last_selected_item = next;
-        elm_genlist_item_show(wd->last_selected_item);
+        elm_genlist_item_show(wd->last_selected_item, ELM_GENLIST_ITEM_SCROLLTO_IN);
      }
    else
      {
         elm_genlist_item_selected_set(next, EINA_TRUE);
-        elm_genlist_item_show(next);
+        elm_genlist_item_show(next, ELM_GENLIST_ITEM_SCROLLTO_IN);
      }
    return EINA_TRUE;
 }
@@ -473,7 +487,7 @@ _item_single_select_up(Widget_Data *wd)
    _deselect_all_items(wd);
 
    elm_genlist_item_selected_set((Elm_Object_Item *) prev, EINA_TRUE);
-   elm_genlist_item_show((Elm_Object_Item *) prev);
+   elm_genlist_item_show((Elm_Object_Item *) prev, ELM_GENLIST_ITEM_SCROLLTO_IN);
    return EINA_TRUE;
 }
 
@@ -494,7 +508,7 @@ _item_single_select_down(Widget_Data *wd)
    _deselect_all_items(wd);
 
    elm_genlist_item_selected_set((Elm_Object_Item *) next, EINA_TRUE);
-   elm_genlist_item_show((Elm_Object_Item *) next);
+   elm_genlist_item_show((Elm_Object_Item *) next, ELM_GENLIST_ITEM_SCROLLTO_IN);
    return EINA_TRUE;
 }
 
@@ -674,7 +688,9 @@ static void
 _item_highlight(Elm_Gen_Item *it)
 {
    const char *selectraise;
-   if ((it->wd->no_select) || (it->generation < it->wd->generation) ||
+   if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) ||
+       (it->wd->no_highlight) ||
+       (it->generation < it->wd->generation) ||
        (it->highlighted) || elm_widget_item_disabled_get(it) ||
        (it->display_only) || (it->item->mode_view))
      return;
@@ -811,6 +827,19 @@ _item_block_del(Elm_Gen_Item *it)
 }
 
 static void
+_item_subitems_clear(Elm_Gen_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Eina_List *tl = NULL, *l;
+   Elm_Object_Item *it2;
+
+   EINA_LIST_FOREACH(it->item->items, l, it2)
+     tl = eina_list_append(tl, it2);
+   EINA_LIST_FREE(tl, it2)
+     elm_object_item_del(it2);
+}
+
+static void
 _item_del(Elm_Gen_Item *it)
 {
    Evas_Object *obj = WIDGET(it);
@@ -1495,7 +1524,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));
@@ -1570,7 +1599,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_TREE) itc->tree = 1;
    itc->compress = (it->wd->compress);
    itc->selected = it->selected;
    itc->disabled = elm_widget_item_disabled_get(it);
@@ -1617,7 +1646,7 @@ _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_TREE) tree = 1;
    EINA_INLIST_FOREACH(it->wd->item_cache, itc)
      {
         if ((itc->selected) || (itc->disabled) || (itc->expanded))
@@ -1953,11 +1982,11 @@ _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)
+   if (itc && (!it->wd->tree_effect_enabled))
      {
         VIEW(it) = itc->base_view;
         itc->base_view = NULL;
@@ -1976,7 +2005,7 @@ _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)
+        if (it->item->type & ELM_GENLIST_ITEM_TREE)
           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");
@@ -2030,7 +2059,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);
@@ -2092,7 +2121,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;
@@ -2122,7 +2151,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)
           {
@@ -2136,7 +2165,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;
@@ -2389,7 +2418,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);
@@ -2432,7 +2461,8 @@ _item_block_position(Item_Block *itb,
                     }
                   else
                     {
-                       if (!it->dragging) _elm_genlist_item_unrealize(it, EINA_FALSE);
+                       if (!it->wd->item_moving_effect_timer)
+                         _elm_genlist_item_unrealize(it, EINA_FALSE);
                     }
                }
              in++;
@@ -2962,7 +2992,21 @@ _pan_calculate(Evas_Object *obj)
         sd->wd->reorder_old_pan_y = sd->wd->pan_y;
         sd->wd->start_time = ecore_loop_time_get();
      }
-   _item_auto_scroll(sd->wd);
+
+   if (sd->wd->tree_effect_enabled && (sd->wd->move_effect_mode != ELM_GENLIST_ITEM_MOVE_EFFECT_NONE))
+     {
+        if (!sd->wd->item_moving_effect_timer)
+          {
+             _item_tree_effect_before(sd->wd->expanded_item);
+             evas_object_raise(sd->wd->alpha_bg);
+             evas_object_show(sd->wd->alpha_bg);
+             sd->wd->start_time = ecore_time_get();
+             sd->wd->item_moving_effect_timer = ecore_animator_add(_item_moving_effect_timer_cb, sd->wd);
+          }
+     }
+   else
+     _item_auto_scroll(sd->wd);
+
    evas_event_thaw(evas_object_evas_get(obj));
    evas_event_thaw_eval(evas_object_evas_get(obj));
 }
@@ -3183,7 +3227,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)
      {
@@ -3214,7 +3258,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);
@@ -3250,7 +3294,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_TREE)
       strncpy(buf, "tree", sizeof(buf));
    else strncpy(buf, "item", sizeof(buf));
    if (it->wd->compress)
@@ -3461,13 +3505,15 @@ elm_genlist_add(Evas_Object *parent)
 void
 _item_select(Elm_Gen_Item *it)
 {
-   if ((it->wd->no_select) || (it->generation < it->wd->generation) || (it->mode_set)) return;
+   if ((it->generation < it->wd->generation) || (it->mode_set) ||
+       (it->wd->select_mode == ELM_OBJECT_NO_SELECT))
+     return;
    if (!it->selected)
      {
         it->selected = EINA_TRUE;
         it->wd->selected = eina_list_append(it->wd->selected, it);
      }
-   else if (!it->wd->always_select) return;
+   else if (it->wd->select_mode == ELM_OBJECT_ALWAYS_SELECT) return;
 
    evas_object_ref(WIDGET(it));
    it->walking++;
@@ -3626,7 +3672,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)
 {
@@ -3636,8 +3682,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)
@@ -4102,14 +4148,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)
@@ -4142,14 +4188,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)
@@ -4183,7 +4229,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)
 {
@@ -4195,7 +4241,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)
@@ -4224,7 +4270,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)
 {
@@ -4236,7 +4282,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)
@@ -4264,7 +4310,7 @@ 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,
+                               Elm_Genlist_Item_Type         type,
                                Eina_Compare_Cb               comp,
                                Evas_Smart_Cb                 func,
                                const void                   *func_data)
@@ -4273,7 +4319,7 @@ elm_genlist_item_sorted_insert(Evas_Object                  *obj,
    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;
 
@@ -4397,6 +4443,10 @@ _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
    wd->pan_y = 0;
    wd->minw = 0;
    wd->minh = 0;
+
+   if (wd->alpha_bg) evas_object_del(wd->alpha_bg);
+   wd->alpha_bg = NULL;
+
    if (wd->pan_smart)
      {
         evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh);
@@ -4585,12 +4635,6 @@ elm_genlist_item_prev_get(const Elm_Object_Item *it)
    return (Elm_Object_Item *) _it;
 }
 
-EINA_DEPRECATED EAPI Evas_Object *
-elm_genlist_item_genlist_get(const Elm_Object_Item *it)
-{
-   return elm_object_item_widget_get(it);
-}
-
 EAPI Elm_Object_Item *
 elm_genlist_item_parent_get(const Elm_Object_Item *it)
 {
@@ -4602,15 +4646,26 @@ EAPI void
 elm_genlist_item_subitems_clear(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Eina_List *tl = NULL, *l;
-   Elm_Gen_Item *_it;
-   Elm_Object_Item *it2;
-   _it = (Elm_Gen_Item *)it;
+   Widget_Data *wd = elm_widget_data_get(WIDGET(it));
+   if (!wd) return;
+   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
 
-   EINA_LIST_FOREACH(_it->item->items, l, it2)
-     tl = eina_list_append(tl, it2);
-   EINA_LIST_FREE(tl, it2)
-     elm_object_item_del(it2);
+   if (!wd->tree_effect_enabled || !wd->move_effect_mode)
+     _item_subitems_clear(_it);
+   else
+     {
+        if (!wd->item_moving_effect_timer)
+          {
+             wd->expanded_item = _it;
+             _item_tree_effect_before(_it);
+             evas_object_raise(wd->alpha_bg);
+             evas_object_show(wd->alpha_bg);
+             wd->start_time = ecore_time_get();
+             wd->item_moving_effect_timer = ecore_animator_add(_item_moving_effect_timer_cb, wd);
+          }
+        else
+           _item_subitems_clear(_it);
+     }
 }
 
 EAPI void
@@ -4651,6 +4706,57 @@ elm_genlist_item_selected_get(const Elm_Object_Item *it)
    return ((Elm_Gen_Item *)it)->selected;
 }
 
+Elm_Gen_Item *
+_elm_genlist_expanded_next_item_get(Elm_Gen_Item *it)
+{
+   Elm_Gen_Item *it2;
+   if (it->item->expanded)
+     {
+        it2 = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it);
+     }
+   else
+     {
+        it2 = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it);
+        while (it2)
+          {
+             if (it->item->expanded_depth >= it2->item->expanded_depth) break;
+             it2 = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it2);
+          }
+     }
+   return it2;
+}
+
+static void
+_elm_genlist_move_items_set(Elm_Gen_Item *it)
+{
+   Eina_List *l;
+   Elm_Gen_Item *it2 = NULL;
+   Evas_Coord ox, oy, ow, oh, dh = 0;
+
+   it->wd->expanded_next_item = _elm_genlist_expanded_next_item_get(it);
+
+   if (it->item->expanded)
+     {
+        it->wd->move_items = elm_genlist_realized_items_get(it->wd->obj);
+        EINA_LIST_FOREACH(it->wd->move_items, l, it2)
+          {
+             if (it2 == it->wd->expanded_next_item) break;
+             it->wd->move_items = eina_list_remove(it->wd->move_items, it2);
+          }
+     }
+   else
+     {
+        evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &ow, &oh);
+        it2 = it->wd->expanded_next_item;
+        while (it2 && (dh < oy + oh))
+          {
+             dh += it2->item->h;
+             it->wd->move_items = eina_list_append(it->wd->move_items, it2);
+             it2 = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it2);
+          }
+     }
+}
+
 EAPI void
 elm_genlist_item_expanded_set(Elm_Object_Item  *it,
                               Eina_Bool         expanded)
@@ -4660,21 +4766,27 @@ elm_genlist_item_expanded_set(Elm_Object_Item  *it,
    expanded = !!expanded;
    if (_it->item->expanded == expanded) return;
    _it->item->expanded = expanded;
+   _it->wd->expanded_item = _it;
+   _elm_genlist_move_items_set(_it);
+
+   if (_it->wd->tree_effect_enabled && !_it->wd->alpha_bg)
+      _it->wd->alpha_bg = _create_tray_alpha_bg(WIDGET(_it));
+
    if (_it->item->expanded)
      {
+        _it->wd->move_effect_mode = ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND;
         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
      {
+        _it->wd->move_effect_mode = ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT;
         if (_it->realized)
           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;
      }
 }
 
@@ -4692,19 +4804,6 @@ elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it)
    return ((Elm_Gen_Item *)it)->item->expanded_depth;
 }
 
-EINA_DEPRECATED EAPI void
-elm_genlist_item_disabled_set(Elm_Object_Item  *it,
-                              Eina_Bool         disabled)
-{
-   elm_object_item_disabled_set(it, disabled);
-}
-
-EINA_DEPRECATED EAPI Eina_Bool
-elm_genlist_item_disabled_get(const Elm_Object_Item *it)
-{
-   return elm_object_item_disabled_get(it);
-}
-
 EAPI void
 elm_genlist_item_display_only_set(Elm_Object_Item  *it,
                                   Eina_Bool         display_only)
@@ -4731,33 +4830,56 @@ elm_genlist_item_display_only_get(const Elm_Object_Item *it)
    return _it->display_only;
 }
 
-EAPI void
-elm_genlist_item_show(Elm_Object_Item *it)
+static Eina_Bool _elm_genlist_item_compute_coordinates(
+                  Elm_Object_Item *it,
+                  Elm_Genlist_Item_Scrollto_Type type,
+                  Evas_Coord *x,
+                  Evas_Coord *y,
+                  Evas_Coord *w,
+                  Evas_Coord *h)
 {
-   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
    Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
    Evas_Coord gith = 0;
-   if (_it->generation < _it->wd->generation) return;
+   if (_it->generation < _it->wd->generation) return EINA_FALSE;
    if ((_it->item->queued) || (!_it->item->mincalcd))
      {
         _it->wd->show_item = _it;
         _it->wd->bring_in = EINA_FALSE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
+        _it->wd->scrollto_type = type;
         _it->item->showme = EINA_TRUE;
-        return;
+        return EINA_FALSE;
      }
    if (_it->wd->show_item)
      {
         _it->wd->show_item->item->showme = EINA_FALSE;
         _it->wd->show_item = NULL;
      }
-   if ((_it->item->group_item) &&
-       (_it->wd->pan_y > (_it->y + _it->item->block->y)))
-     gith = _it->item->group_item->item->h;
-   elm_smart_scroller_child_region_show(_it->wd->scr,
-                                        _it->x + _it->item->block->x,
-                                        _it->y + _it->item->block->y - gith,
-                                        _it->item->block->w, _it->item->h);
+
+   evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, w, h);
+   if (type==ELM_GENLIST_ITEM_SCROLLTO_IN)
+     {
+        if ((_it->item->group_item) &&
+           (_it->wd->pan_y > (_it->y + _it->item->block->y)))
+            gith = _it->item->group_item->item->h;
+
+        *h = _it->item->h;
+        *y = _it->y + _it->item->block->y - gith;
+     }
+   else if (type==ELM_GENLIST_ITEM_SCROLLTO_TOP)
+     {
+        if (_it->item->group_item) gith = _it->item->group_item->item->h;
+        *y = _it->y + _it->item->block->y - gith;
+     }
+   else if (type==ELM_GENLIST_ITEM_SCROLLTO_MIDDLE)
+     {
+        *y = _it->y + _it->item->block->y - *h / 2 + _it->item->h / 2;
+     }
+   else
+     return EINA_FALSE;
+
+   *x = _it->x + _it->item->block->x;
+   *w = _it->item->block->w;
+   return EINA_TRUE;
 }
 
 EAPI void
@@ -4781,179 +4903,60 @@ elm_genlist_item_demote(Elm_Object_Item *it)
 }
 
 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;
-   Evas_Coord gith = 0;
-   if (_it->generation < _it->wd->generation) return;
-   if ((_it->item->queued) || (!_it->item->mincalcd))
-     {
-        _it->wd->show_item = _it;
-        _it->wd->bring_in = EINA_TRUE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
-        _it->item->showme = EINA_TRUE;
-        return;
-     }
-   if (_it->wd->show_item)
-     {
-        _it->wd->show_item->item->showme = EINA_FALSE;
-        _it->wd->show_item = NULL;
-     }
-   if ((_it->item->group_item) &&
-       (_it->wd->pan_y > (_it->y + _it->item->block->y)))
-     gith = _it->item->group_item->item->h;
-   elm_smart_scroller_region_bring_in(_it->wd->scr,
-                                      _it->x + _it->item->block->x,
-                                      _it->y + _it->item->block->y - gith,
-                                      _it->item->block->w, _it->item->h);
-}
-
-EAPI void
-elm_genlist_item_top_show(Elm_Object_Item *it)
+elm_genlist_item_show(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Evas_Coord x, y, w, h;
    Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
-   Evas_Coord ow, oh;
-   Evas_Coord gith = 0;
 
-   if (_it->generation < _it->wd->generation) return;
-   if ((_it->item->queued) || (!_it->item->mincalcd))
-     {
-        _it->wd->show_item = _it;
-        _it->wd->bring_in = EINA_FALSE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_TOP;
-        _it->item->showme = EINA_TRUE;
-        return;
-     }
-   if (_it->wd->show_item)
-     {
-        _it->wd->show_item->item->showme = EINA_FALSE;
-        _it->wd->show_item = NULL;
-     }
-   evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
-   if (_it->item->group_item) gith = _it->item->group_item->item->h;
-   elm_smart_scroller_child_region_show(_it->wd->scr,
-                                        _it->x + _it->item->block->x,
-                                        _it->y + _it->item->block->y - gith,
-                                        _it->item->block->w, oh);
+   if (_elm_genlist_item_compute_coordinates(it, type, &x, &y, &w, &h))
+     elm_smart_scroller_child_region_show(_it->wd->scr, x, y, w, h);
 }
 
 EAPI void
-elm_genlist_item_top_bring_in(Elm_Object_Item *it)
+elm_genlist_item_bring_in(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type)
 {
-   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
-   Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
-   Evas_Coord ow, oh;
-   Evas_Coord gith = 0;
 
-   if (_it->generation < _it->wd->generation) return;
-   if ((_it->item->queued) || (!_it->item->mincalcd))
-     {
-        _it->wd->show_item = _it;
-        _it->wd->bring_in = EINA_TRUE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_TOP;
-        _it->item->showme = EINA_TRUE;
-        return;
-     }
-   if (_it->wd->show_item)
-     {
-        _it->wd->show_item->item->showme = EINA_FALSE;
-        _it->wd->show_item = NULL;
-     }
-   evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
-   if (_it->item->group_item) gith = _it->item->group_item->item->h;
-   elm_smart_scroller_region_bring_in(_it->wd->scr,
-                                      _it->x + _it->item->block->x,
-                                      _it->y + _it->item->block->y - gith,
-                                      _it->item->block->w, oh);
-}
-
-EAPI void
-elm_genlist_item_middle_show(Elm_Object_Item *it)
-{
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Evas_Coord x, y, w, h;
    Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
-   Evas_Coord ow, oh;
 
-   if (_it->generation < _it->wd->generation) return;
-   if ((_it->item->queued) || (!_it->item->mincalcd))
-     {
-        _it->wd->show_item = _it;
-        _it->wd->bring_in = EINA_FALSE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_MIDDLE;
-        _it->item->showme = EINA_TRUE;
-        return;
-     }
-   if (_it->wd->show_item)
-     {
-        _it->wd->show_item->item->showme = EINA_FALSE;
-        _it->wd->show_item = NULL;
-     }
-   evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
-   elm_smart_scroller_child_region_show(_it->wd->scr,
-                                        _it->x + _it->item->block->x,
-                                        _it->y + _it->item->block->y - oh / 2 +
-                                        _it->item->h / 2, _it->item->block->w,
-                                        oh);
+   if (_elm_genlist_item_compute_coordinates(it, type, &x, &y, &w, &h))
+     elm_smart_scroller_region_bring_in(_it->wd->scr,x, y, w, h);
 }
 
-EAPI void
-elm_genlist_item_middle_bring_in(Elm_Object_Item *it)
+EINA_DEPRECATED 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;
-   Evas_Coord ow, oh;
-
-   if (_it->generation < _it->wd->generation) return;
-   if ((_it->item->queued) || (!_it->item->mincalcd))
-     {
-        _it->wd->show_item = _it;
-        _it->wd->bring_in = EINA_TRUE;
-        _it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_MIDDLE;
-        _it->item->showme = EINA_TRUE;
-        return;
-     }
-   if (_it->wd->show_item)
-     {
-        _it->wd->show_item->item->showme = EINA_FALSE;
-        _it->wd->show_item = NULL;
-     }
-   evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
-   elm_smart_scroller_region_bring_in(_it->wd->scr,
-                                      _it->x + _it->item->block->x,
-                                      _it->y + _it->item->block->y - oh / 2 +
-                                      _it->item->h / 2, _it->item->block->w,
-                                      oh);
+   elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
 }
 
-EAPI void
-elm_genlist_item_del(Elm_Object_Item *it)
+EINA_DEPRECATED EAPI void
+elm_genlist_item_top_bring_in(Elm_Object_Item *it)
 {
-   elm_object_item_del(it);
+   elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
 }
 
-EAPI void
-elm_genlist_item_data_set(Elm_Object_Item  *it,
-                          const void       *data)
+EINA_DEPRECATED EAPI void
+elm_genlist_item_middle_show(Elm_Object_Item *it)
 {
-   elm_object_item_data_set(it, (void *) data);
+   elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
 }
 
-EAPI void *
-elm_genlist_item_data_get(const Elm_Object_Item *it)
+EINA_DEPRECATED EAPI void
+elm_genlist_item_middle_bring_in(Elm_Object_Item *it)
 {
-   return elm_object_item_data_get(it);
+   elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
 }
 
-EAPI void
-elm_genlist_item_icons_orphan(Elm_Object_Item *it)
+EINA_DEPRECATED EAPI void
+elm_genlist_item_contents_orphan(Elm_Object_Item *it)
 {
-   elm_genlist_item_contents_orphan(it);
+   elm_genlist_item_all_contents_unset(it, NULL);
 }
 
 EAPI void
-elm_genlist_item_contents_orphan(Elm_Object_Item *it)
+elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
@@ -4963,6 +4966,8 @@ elm_genlist_item_contents_orphan(Elm_Object_Item *it)
         elm_widget_sub_object_del(WIDGET(it), content);
         evas_object_smart_member_del(content);
         evas_object_hide(content);
+        if (l)
+          *l = eina_list_append(*l, content);
      }
 }
 
@@ -4991,7 +4996,7 @@ 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;
@@ -5023,7 +5028,7 @@ elm_genlist_item_item_class_update(Elm_Object_Item *it,
    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);
 }
 
@@ -5236,19 +5241,6 @@ elm_genlist_mode_set(Evas_Object  *obj,
    _sizing_eval(obj);
 }
 
-EAPI void
-elm_genlist_horizontal_set(Evas_Object  *obj,
-                           Elm_List_Mode mode)
-{
-   elm_genlist_mode_set(obj, mode);
-}
-
-EAPI void
-elm_genlist_horizontal_mode_set(Evas_Object  *obj,
-                                Elm_List_Mode mode)
-{
-   elm_genlist_mode_set(obj, mode);
-}
 
 EAPI Elm_List_Mode
 elm_genlist_mode_get(const Evas_Object *obj)
@@ -5259,54 +5251,62 @@ elm_genlist_mode_get(const Evas_Object *obj)
    return wd->mode;
 }
 
-EINA_DEPRECATED EAPI Elm_List_Mode
-elm_genlist_horizontal_get(const Evas_Object *obj)
-{
-   return elm_genlist_mode_get(obj);
-}
-
-EINA_DEPRECATED EAPI Elm_List_Mode
-elm_genlist_horizontal_mode_get(const Evas_Object *obj)
-{
-   return elm_genlist_mode_get(obj);
-}
-
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_genlist_always_select_mode_set(Evas_Object *obj,
                                    Eina_Bool    always_select)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->always_select = !!always_select;
+   if (always_select)
+     elm_genlist_select_mode_set(obj, ELM_OBJECT_ALWAYS_SELECT);
+   else
+     {
+        Elm_Object_Select_Mode_Type oldmode = elm_genlist_select_mode_get(obj);
+        if (oldmode == ELM_OBJECT_ALWAYS_SELECT)
+          elm_genlist_select_mode_set(obj, ELM_OBJECT_NORMAL_SELECT);
+     }
 }
 
-EAPI Eina_Bool
+EINA_DEPRECATED EAPI Eina_Bool
 elm_genlist_always_select_mode_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return EINA_FALSE;
-   return wd->always_select;
+   Elm_Object_Select_Mode_Type oldmode = elm_genlist_select_mode_get(obj);
+   if (oldmode == ELM_OBJECT_ALWAYS_SELECT)
+     return EINA_TRUE;
+   return EINA_FALSE;
 }
 
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_genlist_no_select_mode_set(Evas_Object *obj,
                                Eina_Bool    no_select)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->no_select = !!no_select;
+   if (no_select)
+     elm_genlist_select_mode_set(obj, ELM_OBJECT_NO_SELECT);
+   else
+     {
+        Elm_Object_Select_Mode_Type oldmode = elm_genlist_select_mode_get(obj);
+        if (oldmode == ELM_OBJECT_NO_SELECT)
+          elm_genlist_select_mode_set(obj, ELM_OBJECT_NORMAL_SELECT);
+     }
 }
 
-EAPI Eina_Bool
+EINA_DEPRECATED EAPI Eina_Bool
 elm_genlist_no_select_mode_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return EINA_FALSE;
-   return wd->no_select;
+   Elm_Object_Select_Mode_Type oldmode = elm_genlist_select_mode_get(obj);
+   if (oldmode == ELM_OBJECT_NO_SELECT)
+     return EINA_TRUE;
+   return EINA_FALSE;
 }
 
 EAPI void
@@ -5527,29 +5527,6 @@ elm_genlist_item_mode_set(Elm_Object_Item  *it,
 }
 
 EAPI const char *
-elm_genlist_mode_item_style_get(const Evas_Object *obj)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return NULL;
-   return wd->mode_item->itc->mode_item_style;
-}
-
-EAPI void
-elm_genlist_mode_item_style_set(Evas_Object *obj, const char *style)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return;
-   if ((style == wd->mode_item->itc->mode_item_style) ||
-       (style && wd->mode_item->itc->mode_item_style &&
-       (!strcmp(style, wd->mode_item->itc->mode_item_style))))
-     return;
-   eina_stringshare_replace((const char**)&wd->mode_item->itc->mode_item_style, style);
-   elm_genlist_realized_items_update(obj);
-}
-
-EAPI const char *
 elm_genlist_mode_type_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
@@ -5595,7 +5572,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)
                _edit_mode_item_unrealize(it);
           }
         _item_cache_zero(wd);
@@ -5604,7 +5581,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)
@@ -5635,12 +5612,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;
+   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 *
@@ -5651,7 +5634,7 @@ elm_genlist_item_class_new(void)
    itc = calloc(1, sizeof(Elm_Genlist_Item_Class));
    if (!itc)
      return NULL;
-   itc->version = ELM_GENLIST_ITEM_CLASS_VERSION;
+   itc->version = CLASS_ALLOCATED;
    itc->refcount = 1;
    itc->delete_me = EINA_FALSE;
 
@@ -5661,7 +5644,7 @@ elm_genlist_item_class_new(void)
 EAPI void
 elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
 {
-   if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+   if (itc && (itc->version == CLASS_ALLOCATED))
      {
         if (!itc->delete_me) itc->delete_me = EINA_TRUE;
         if (itc->refcount > 0) elm_genlist_item_class_unref(itc);
@@ -5676,7 +5659,7 @@ elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
 EAPI void
 elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
 {
-   if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+   if (itc && (itc->version == CLASS_ALLOCATED))
      {
         itc->refcount++;
         if (itc->refcount == 0) itc->refcount--;
@@ -5686,7 +5669,7 @@ elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
 EAPI void
 elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
 {
-   if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+   if (itc && (itc->version == CLASS_ALLOCATED))
      {
         if (itc->refcount > 0) itc->refcount--;
         if (itc->delete_me && (!itc->refcount))
@@ -5722,9 +5705,9 @@ elm_genlist_item_flip_set(Elm_Object_Item *it,
    else
      {
         _it->flipped = flip;
-        _it->item->nocache = EINA_TRUE;
         _item_cache_zero(_it->wd);
         elm_genlist_item_update(it);
+        _it->item->nocache = EINA_FALSE;
      }
 }
 
@@ -5736,6 +5719,47 @@ elm_genlist_item_flip_get(const Elm_Object_Item *it)
    return _it->flipped;
 }
 
+EAPI void
+elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
+     return;
+   if (wd->select_mode != mode)
+     wd->select_mode = mode;
+}
+
+EAPI Elm_Object_Select_Mode_Type
+elm_genlist_select_mode_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) ELM_OBJECT_SELECT_MODE_MAX;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return ELM_OBJECT_SELECT_MODE_MAX;
+   return wd->select_mode;
+}
+
+EAPI void
+elm_genlist_hilight_mode_set(Evas_Object *obj,
+                             Eina_Bool    hilight)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   hilight = !!hilight;
+   wd->no_highlight = !hilight;
+}
+
+EAPI Eina_Bool
+elm_genlist_hilight_mode_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   return !wd->no_highlight;
+}
+
 /* for gengrid as of now */
 void
 _elm_genlist_page_relative_set(Evas_Object *obj,
@@ -5905,3 +5929,285 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
      it->wd->last_selected_item = NULL;
    it->wd->item_count--;
 }
+
+EAPI void
+elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   wd->tree_effect_enabled = !!enabled;
+}
+
+EAPI Eina_Bool
+elm_genlist_tree_effect_enabled_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   return wd->tree_effect_enabled;
+}
+
+static Evas_Object*
+_create_tray_alpha_bg(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+
+   Evas_Object *bg = NULL;
+   Evas_Coord ox, oy, ow, oh;
+
+   evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
+   bg  =  evas_object_rectangle_add(evas_object_evas_get(wd->obj));
+   evas_object_color_set(bg,0,0,0,0);
+   evas_object_resize(bg , ow, oh);
+   evas_object_move(bg , ox, oy);
+   return bg ;
+}
+
+static void
+_item_contract_emit(Elm_Gen_Item *it)
+{
+   Elm_Gen_Item *it2;
+   Eina_List *l;
+
+   edje_object_signal_emit(VIEW(it), "elm,state,contract_flip", "");
+   it->item->tree_effect_finished = EINA_FALSE;
+
+   EINA_LIST_FOREACH(it->item->items, l, it2)
+     if (it2) _item_contract_emit(it2);
+}
+
+static int
+_item_tree_effect_before(Elm_Gen_Item *it)
+{
+   Elm_Gen_Item *it2;
+   Eina_List *l;
+
+   EINA_LIST_FOREACH(it->item->items, l, it2)
+     {
+        if (it2->parent && (it == it2->parent))
+          {
+             if (it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND)
+               edje_object_signal_emit(VIEW(it2), "elm,state,hide", "");
+             else if (it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT)
+               _item_contract_emit(it2);
+          }
+     }
+   return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_item_tree_effect(Widget_Data *wd, int y)
+{
+   Elm_Gen_Item *it = NULL, *expanded_next_it;
+
+   expanded_next_it = wd->expanded_next_item;
+
+   if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND)
+     {
+        it = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) expanded_next_it);
+        while (it)
+          {
+             if (it->item->expanded_depth <= expanded_next_it->item->expanded_depth) break;
+             if (it->item->scrl_y && (it->item->scrl_y < expanded_next_it->item->old_scrl_y + y) &&
+                 (it->item->expanded_depth > expanded_next_it->item->expanded_depth))
+               {
+                  if (!it->item->tree_effect_finished)
+                    {
+                       edje_object_signal_emit(VIEW(it), "flip_item", "");
+                       evas_object_show(VIEW(it));
+                       it->item->tree_effect_finished = EINA_TRUE;
+                    }
+               }
+             it = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) it);
+          }
+     }
+   else if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT)
+     {
+        it = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) expanded_next_it);
+        while (it)
+          {
+             if ((it->item->scrl_y > expanded_next_it->item->old_scrl_y + y) &&
+                 (it->item->expanded_depth > expanded_next_it->item->expanded_depth))
+               {
+                  if (!it->item->tree_effect_finished)
+                    {
+                       edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
+                       it->item->tree_effect_finished = EINA_TRUE;
+                    }
+               }
+             else
+               break;
+             it = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) it);
+          }
+     }
+}
+
+static void
+_item_tree_effect_finish(Widget_Data *wd)
+{
+   Item_Block *itb;
+   Elm_Gen_Item *it = NULL;
+   const Eina_List *l;
+
+   if (wd->item_moving_effect_timer)
+     {
+        if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT)
+           _item_subitems_clear(wd->expanded_item);
+        EINA_INLIST_FOREACH(wd->blocks, itb)
+          {
+             EINA_LIST_FOREACH(itb->items, l, it)
+               {
+                  it->item->tree_effect_finished = EINA_TRUE;
+                  it->item->old_scrl_y = it->item->scrl_y;
+               }
+          }
+     }
+   _item_auto_scroll(wd);
+   evas_object_lower(wd->alpha_bg);
+   evas_object_hide(wd->alpha_bg);
+   wd->move_effect_mode = ELM_GENLIST_ITEM_MOVE_EFFECT_NONE;
+   if (wd->move_items) wd->move_items = eina_list_free(wd->move_items);
+
+   evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
+   evas_object_smart_callback_call(wd->obj, SIG_TREE_EFFECT_FINISHED, NULL);
+   evas_object_smart_changed(wd->pan_smart);
+
+   wd->item_moving_effect_timer = NULL;
+}
+
+static Eina_Bool
+_item_moving_effect_timer_cb(void *data)
+{
+   Widget_Data *wd = data;
+   if (!wd) return EINA_FALSE;
+   Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
+   Elm_Gen_Item *it = NULL, *it2, *expanded_next_it;
+   const Eina_List *l;
+   double effect_duration = 0.5, t;
+   int y = 0, dy = 0, dh = 0;
+   Eina_Bool end = EINA_FALSE, vis = EINA_TRUE;
+   int in = 0;
+
+   t = ((0.0 > (t = ecore_time_get() - wd->start_time)) ? 0.0 : t);
+   evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
+   evas_output_viewport_get(evas_object_evas_get(wd->pan_smart), &cvx, &cvy, &cvw, &cvh);
+   if (t > effect_duration) end = EINA_TRUE;
+
+   // Below while statement is needed, when the genlist is resized.
+   it2 = wd->expanded_item;
+   while (it2 && vis)
+     {
+        evas_object_move(VIEW(it2), it2->item->scrl_x, it2->item->scrl_y);
+        vis = (ELM_RECTS_INTERSECT(it2->item->scrl_x, it2->item->scrl_y, it2->item->w, it2->item->h,
+                                   cvx, cvy, cvw, cvh));
+        it2 = (Elm_Gen_Item *) elm_genlist_item_prev_get((Elm_Object_Item *) it2);
+     }
+
+   if (wd->expanded_next_item)
+     {
+        expanded_next_it = wd->expanded_next_item;
+
+        /* move items */
+        EINA_LIST_FOREACH(wd->move_items, l, it)
+          {
+             if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND)
+               {
+                  expanded_next_it->item->old_scrl_y = wd->expanded_item->item->old_scrl_y + wd->expanded_item->item->h;
+                  if (expanded_next_it->item->scrl_y < expanded_next_it->item->old_scrl_y) //did not calculate next item position
+                    expanded_next_it->item->scrl_y = cvy + cvh;
+
+                  dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ?
+                         cvy + cvh : expanded_next_it->item->scrl_y) -
+                         expanded_next_it->item->old_scrl_y;
+               }
+             else if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT)
+               {
+                  if (expanded_next_it->item->scrl_y > expanded_next_it->item->old_scrl_y) //did not calculate next item position
+                     expanded_next_it->item->old_scrl_y = cvy + cvh;
+
+                  if (expanded_next_it->item->old_scrl_y > (cvy + cvh))
+                    {
+                       dy = (wd->expanded_item->item->scrl_y + wd->expanded_item->item->h) -
+                            cvy + cvh;
+                       expanded_next_it->item->old_scrl_y = cvy + cvh;
+                    }
+                  else
+                    {
+                       dy = (wd->expanded_item->item->scrl_y + wd->expanded_item->item->h) -
+                             expanded_next_it->item->old_scrl_y;
+                    }
+               }
+
+             if (t <= effect_duration)
+               {
+                  y = ((1 - (1 - (t / effect_duration)) * (1 - (t /effect_duration))) * dy);
+               }
+             else
+               {
+                  end = EINA_TRUE;
+                  y = dy;
+               }
+
+             if (!it->realized)
+               {
+                  _item_realize(it, in, 0);
+               }
+             in++;
+
+             if (it != expanded_next_it)
+               {
+                  it->item->old_scrl_y = expanded_next_it->item->old_scrl_y + expanded_next_it->item->h + dh;
+                  dh += it->item->h;
+               }
+
+             if ((it->item->old_scrl_y + y) < (cvy + cvh))
+               _item_position(it, VIEW(it),it->item->scrl_x, it->item->old_scrl_y + y);
+          }
+        /* tree effect */
+        _item_tree_effect(wd, y);
+     }
+   else
+     {
+        int expanded_item_num = 0;
+        int num = 0;
+
+        if (wd->expanded_item)
+          it = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) wd->expanded_item);
+
+        it2 = it;
+        while (it2)
+          {
+             expanded_item_num++;
+             it2 = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it2);
+          }
+
+        while (it)
+          {
+             num++;
+             if (wd->expanded_item->item->expanded_depth >= it->item->expanded_depth) break;
+             if (wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND)
+               {
+                  if (!it->item->tree_effect_finished)
+                    {
+                       if (t >= (((num - 1) * effect_duration) / expanded_item_num))
+                         {
+                            edje_object_signal_emit(VIEW(it), "flip_item", "");
+                            evas_object_show(VIEW(it));
+                            it->item->tree_effect_finished = EINA_TRUE;
+                         }
+                    }
+               }
+             it = (Elm_Gen_Item *) elm_genlist_item_next_get((Elm_Object_Item *) it);
+          }
+     }
+
+   if (end)
+     {
+        _item_tree_effect_finish(wd);
+        return ECORE_CALLBACK_CANCEL;
+     }
+   return ECORE_CALLBACK_RENEW;
+}