Get us some nice auto translation scheme
[framework/uifw/elementary.git] / src / lib / elm_genlist.c
index e06f046..2c8ae39 100644 (file)
@@ -3,6 +3,7 @@
 #include <Elementary.h>
 #include <Elementary_Cursor.h>
 #include "elm_priv.h"
+#include "els_scroller.h"
 
 #define SWIPE_MOVES         12
 #define MAX_ITEMS_PER_BLOCK 32
@@ -15,18 +16,25 @@ typedef struct _Item_Cache  Item_Cache;
 
 struct _Widget_Data
 {
-   Evas_Object      *obj, *scr, *pan_smart;
-   Eina_Inlist      *items, *blocks;
-   Eina_List        *group_items;
-   Pan              *pan;
-   Evas_Coord        pan_x, pan_y, old_pan_y, w, h, minw, minh, realminw, prev_viewport_w;
+   Eina_Inlist_Sorted_State *state;
+   Evas_Object      *obj; /* the genlist object */
+   Evas_Object      *scr; /* a smart scroller object which is used internally in genlist */
+   Evas_Object      *pan_smart; /* "elm_genlist_pan" evas smart object. this is an extern pan of smart scroller(scr). */
+   Eina_Inlist      *items; /* inlist of all items */
+   Eina_Inlist      *blocks; /* inlist of all blocks. a block consists of a certain number of items. maximum number of items in a block is 'max_items_per_block'. */
+   Eina_List        *group_items; /* list of groups index items */
+   Pan              *pan; /* pan_smart object's smart data */
+   Evas_Coord        pan_x, pan_y, reorder_old_pan_y, w, h, minw, minh, realminw, prev_viewport_w;
    Ecore_Job        *calc_job, *update_job;
    Ecore_Idle_Enterer *queue_idle_enterer;
    Ecore_Idler        *must_recalc_idler;
    Eina_List        *queue, *selected;
-   Elm_Genlist_Item *show_item, *last_selected_item, *anchor_item, *mode_item, *reorder_it, *reorder_rel, *expanded_item;
-   Eina_Inlist      *item_cache;
-   Evas_Coord        anchor_y, reorder_start_y;
+   Elm_Genlist_Item *show_item, *anchor_item, *mode_item, *reorder_rel, *expanded_item;
+   Elm_Genlist_Item *last_selected_item; /* the last selected item. */
+   Elm_Genlist_Item *reorder_it; /* an item which is longpressed and in the moving state. */
+   Eina_Inlist      *item_cache; /* an inlist of edje object item cache. */
+   Evas_Coord        anchor_y;
+   Evas_Coord        reorder_start_y; /* reorder item's initial y coordinate in the pan. */
    Elm_List_Mode     mode;
    Ecore_Timer      *multi_timer, *scr_hold_timer;
    Ecore_Animator   *reorder_move_animator;
@@ -53,21 +61,22 @@ struct _Widget_Data
    Eina_Bool         reorder_mode : 1;
    Eina_Bool         reorder_pan_move : 1;
    Eina_Bool         auto_scroll_enabled : 1;
+   Eina_Bool         pan_resized : 1;
    struct
    {
       Evas_Coord x, y;
    } history[SWIPE_MOVES];
    int               multi_device;
    int               item_cache_count;
-   int               item_cache_max;
+   int               item_cache_max; /* maximum number of cached items */
    int               movements;
    int               walking;
    int               item_width;
    int               item_height;
    int               group_item_width;
    int               group_item_height;
-   int               max_items_per_block;
-   double            longpress_timeout;
+   int               max_items_per_block; /* maximum number of items per block */
+   double            longpress_timeout; /* longpress timeout. this value comes from _elm_config by default. this can be changed by elm_genlist_longpress_timeout_set() */
 };
 
 struct _Item_Block
@@ -122,6 +131,7 @@ struct _Elm_Genlist_Item
       Elm_Tooltip_Item_Content_Cb content_cb;
       Evas_Smart_Cb               del_cb;
       const char                 *style;
+      Eina_Bool                   free_size : 1;
    } tooltip;
 
    const char                   *mouse_cursor;
@@ -210,6 +220,9 @@ static void      _signal_emit_hook(Evas_Object *obj,
                                    const char *source);
 static Eina_Bool _deselect_all_items(Widget_Data *wd);
 static void      _pan_calculate(Evas_Object *obj);
+static void      _pan_max_get(Evas_Object *obj,
+                              Evas_Coord  *x,
+                              Evas_Coord  *y);
 static void      _item_position(Elm_Genlist_Item *it,
                                 Evas_Object      *obj,
                                 Evas_Coord        it_x,
@@ -244,6 +257,10 @@ static const char SIG_DRAG_START_RIGHT[] = "drag,start,right";
 static const char SIG_DRAG_STOP[] = "drag,stop";
 static const char SIG_DRAG[] = "drag";
 static const char SIG_LONGPRESSED[] = "longpressed";
+static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
+static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
+static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
+static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
 static const char SIG_SCROLL_EDGE_TOP[] = "scroll,edge,top";
 static const char SIG_SCROLL_EDGE_BOTTOM[] = "scroll,edge,bottom";
 static const char SIG_SCROLL_EDGE_LEFT[] = "scroll,edge,left";
@@ -274,6 +291,10 @@ static const Evas_Smart_Cb_Description _signals[] = {
    {SIG_DRAG_STOP, ""},
    {SIG_DRAG, ""},
    {SIG_LONGPRESSED, ""},
+   {SIG_SCROLL_ANIM_START, ""},
+   {SIG_SCROLL_ANIM_STOP, ""},
+   {SIG_SCROLL_DRAG_START, ""},
+   {SIG_SCROLL_DRAG_STOP, ""},
    {SIG_SCROLL_EDGE_TOP, ""},
    {SIG_SCROLL_EDGE_BOTTOM, ""},
    {SIG_SCROLL_EDGE_LEFT, ""},
@@ -300,6 +321,7 @@ _event_hook(Evas_Object       *obj,
    if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
    Evas_Event_Key_Down *ev = event_info;
    Widget_Data *wd = elm_widget_data_get(obj);
+   Evas_Coord pan_max_x = 0, pan_max_y = 0;
    if (!wd) return EINA_FALSE;
    if (!wd->items) return EINA_FALSE;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
@@ -404,6 +426,11 @@ _event_hook(Evas_Object       *obj,
    else return EINA_FALSE;
 
    ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+   _pan_max_get(wd->pan_smart, &pan_max_x, &pan_max_y);
+   if (x < 0) x = 0;
+   if (x > pan_max_x) x = pan_max_x;
+   if (y < 0) y = 0;
+   if (y > pan_max_y) y = pan_max_y;
    elm_smart_scroller_child_pos_set(wd->scr, x, y);
    return EINA_TRUE;
 }
@@ -547,9 +574,9 @@ _del_pre_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   elm_genlist_clear(obj);
    evas_object_del(wd->pan_smart);
    wd->pan_smart = NULL;
-   elm_genlist_clear(obj);
 }
 
 static void
@@ -611,6 +638,12 @@ _show_region_hook(void        *data,
 }
 
 static void
+_translate_hook(Evas_Object *obj)
+{
+   evas_object_smart_callback_call(obj, "language,changed", NULL);
+}
+
+static void
 _sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -817,6 +850,8 @@ _item_del(Elm_Genlist_Item *it)
 static void
 _item_select(Elm_Genlist_Item *it)
 {
+   Evas_Object *parent = it->base.widget;
+
    if ((it->wd->no_select) || (it->delete_me) || (it->mode_view)) return;
    if (it->selected)
      {
@@ -826,23 +861,31 @@ _item_select(Elm_Genlist_Item *it)
    it->selected = EINA_TRUE;
    it->wd->selected = eina_list_append(it->wd->selected, it);
 call:
+   evas_object_ref(parent);
    it->walking++;
    it->wd->walking++;
-   if (it->func.func) it->func.func((void *)it->func.data, it->base.widget, it);
+   if (it->func.func) it->func.func((void *)it->func.data, parent, it);
    if (!it->delete_me)
-     evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
+     evas_object_smart_callback_call(parent, SIG_SELECTED, it);
    it->walking--;
    it->wd->walking--;
    if ((it->wd->clear_me) && (!it->wd->walking))
-     elm_genlist_clear(it->base.widget);
+     {
+        elm_genlist_clear(parent);
+        goto end;
+     }
    else
      {
         if ((!it->walking) && (it->delete_me))
           {
              if (!it->relcount) _item_del(it);
+             goto end;
           }
      }
    it->wd->last_selected_item = it;
+
+end:
+   evas_object_unref(parent);
 }
 
 static void
@@ -919,10 +962,12 @@ _mouse_move(void        *data,
              if (!it->wd->reorder_start_y)
                it->wd->reorder_start_y = it->block->y + it->y;
 
-             if (it_scrl_y < oy) y_pos = oy;
-             else if (it_scrl_y + it->wd->reorder_it->h > oy+oh)
-                y_pos = oy + oh - it->wd->reorder_it->h;
-             else y_pos = it_scrl_y;
+             if (it_scrl_y < oy)
+               y_pos = oy;
+             else if (it_scrl_y + it->wd->reorder_it->h > oy + oh)
+               y_pos = oy + oh - it->wd->reorder_it->h;
+             else
+               y_pos = it_scrl_y;
 
              _item_position(it, it->base.view, it->scrl_x, y_pos);
 
@@ -1008,6 +1053,7 @@ _long_press(void *data)
 
         evas_object_raise(it->base.view);
         elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
+        elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
 
         list = elm_genlist_realized_items_get(it->wd->obj);
         EINA_LIST_FOREACH(list, l, it_tmp)
@@ -1310,24 +1356,22 @@ _mouse_up(void        *data,
      {
         Evas_Coord it_scrl_y = ev->canvas.y - it->wd->reorder_it->dy;
 
-        if (it->wd->reorder_rel)
+        if (it->wd->reorder_rel && (it->wd->reorder_it->parent == it->wd->reorder_rel->parent))
           {
-             if (it->wd->reorder_it->parent == it->wd->reorder_rel->parent)
-               {
-                  if (it_scrl_y <= it->wd->reorder_rel->scrl_y)
-                     _item_move_before(it->wd->reorder_it, it->wd->reorder_rel);
-                  else
-                     _item_move_after(it->wd->reorder_it, it->wd->reorder_rel);
-               }
+             if (it_scrl_y <= it->wd->reorder_rel->scrl_y)
+               _item_move_before(it->wd->reorder_it, it->wd->reorder_rel);
              else
-               {
-                  if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
-                  it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
-               }
+               _item_move_after(it->wd->reorder_it, it->wd->reorder_rel);
+          }
+        else
+          {
+             if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
+             it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
           }
         edje_object_signal_emit(it->base.view, "elm,state,reorder,disabled", "elm");
         it->wd->reorder_it = it->wd->reorder_rel = NULL;
         elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
+        elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_TRUE);
      }
    if (it->wd->longpressed)
      {
@@ -1461,6 +1505,8 @@ _mode_finished_signal_cb(void        *data,
    evas_event_freeze(te);
    it->nocache = EINA_FALSE;
    _mode_item_unrealize(it);
+   if (it->group_item)
+     evas_object_raise(it->group_item->base.view);
    snprintf(buf, sizeof(buf), "elm,state,%s,passive,finished", it->wd->mode_type);
    edje_object_signal_callback_del_full(obj, buf, "elm", _mode_finished_signal_cb, it);
    evas_event_thaw(te);
@@ -1654,6 +1700,22 @@ _item_cache_free(Item_Cache *itc)
    free(itc);
 }
 
+static const char *
+_item_label_hook(Elm_Genlist_Item *it, const char *part)
+{
+   if (!it->itc->func.label_get) return NULL;
+   return edje_object_part_text_get(it->base.view, part);
+}
+
+static void
+_item_del_hook(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+   Elm_Genlist_Item *it = event_info;
+   if (!it) return;
+   if (it->wd->last_selected_item == it)
+     it->wd->last_selected_item = NULL;
+}
+
 static void
 _item_label_realize(Elm_Genlist_Item *it,
                     Evas_Object *target,
@@ -1927,6 +1989,7 @@ _item_realize(Elm_Genlist_Item *it,
                                                it->tooltip.content_cb,
                                                it->tooltip.data, NULL);
         elm_widget_item_tooltip_style_set(it, it->tooltip.style);
+        elm_widget_item_tooltip_size_restrict_disable(it, it->tooltip.free_size);
      }
 
    if (it->mouse_cursor)
@@ -2100,7 +2163,7 @@ _get_space_for_reorder_item(Elm_Genlist_Item *it)
      {
         it->block->reorder_offset = it->wd->reorder_it->h * -1;
         if (it->block->count == 1)
-           it->wd->reorder_rel = it;
+          it->wd->reorder_rel = it;
      }
    else if ((it->wd->reorder_start_y >= it->block->y) &&
             (roy - oy + (roh / 2) <= it->block->y - it->wd->pan_y))
@@ -2219,7 +2282,7 @@ _item_block_position(Item_Block *itb,
                   if (vis)
                     {
                        if (it->wd->reorder_mode)
-                          y += _get_space_for_reorder_item(it);
+                         y += _get_space_for_reorder_item(it);
                        git = it->group_item;
                        if (git)
                          {
@@ -2241,14 +2304,12 @@ _item_block_position(Item_Block *itb,
                          }
                        if (!it->move_effect_enabled)
                          {
-                              {
-                                 if (it->mode_view)
-                                   _item_position(it, it->mode_view, it->scrl_x,
-                                                  it->scrl_y);
-                                 else
-                                   _item_position(it, it->base.view, it->scrl_x,
-                                                  it->scrl_y);
-                              }
+                            if (it->mode_view)
+                               _item_position(it, it->mode_view, it->scrl_x,
+                                              it->scrl_y);
+                            else
+                               _item_position(it, it->base.view, it->scrl_x,
+                                              it->scrl_y);
                             it->old_scrl_y = it->scrl_y;
                          }
                     }
@@ -2316,7 +2377,7 @@ _calc_job(void *data)
    Evas_Coord minw = -1, minh = 0, y = 0, ow;
    int in = 0;
    double t0, t;
-   Eina_Bool minw_change = EINA_FALSE, changed = EINA_FALSE;
+   Eina_Bool minw_change = EINA_FALSE;
    Eina_Bool did_must_recalc = EINA_FALSE;
    if (!wd) return;
 
@@ -2337,10 +2398,9 @@ _calc_job(void *data)
           {
              if (itb->realized) _item_block_unrealize(itb);
           }
-        if ((itb->changed) || (changed) ||
-            ((itb->must_recalc) && (!did_must_recalc)))
+        if ((itb->changed) || ((itb->must_recalc) && (!did_must_recalc)))
           {
-             if ((changed) || (itb->must_recalc))
+             if (itb->must_recalc)
                {
                   Eina_List *l;
                   Elm_Genlist_Item *it;
@@ -2514,6 +2574,7 @@ _pan_set(Evas_Object *obj,
    Pan *sd = evas_object_smart_data_get(obj);
    Item_Block *itb;
 
+   if (!sd) return;
    //   Evas_Coord ow, oh;
    //   evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    //   ow = sd->wd->minw - ow;
@@ -2557,6 +2618,7 @@ _pan_get(Evas_Object *obj,
 {
    Pan *sd = evas_object_smart_data_get(obj);
 
+   if (!sd) return;
    if (x) *x = sd->wd->pan_x;
    if (y) *y = sd->wd->pan_y;
 }
@@ -2569,6 +2631,7 @@ _pan_max_get(Evas_Object *obj,
    Pan *sd = evas_object_smart_data_get(obj);
    Evas_Coord ow, oh;
 
+   if (!sd) return;
    evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    ow = sd->wd->minw - ow;
    if (ow < 0) ow = 0;
@@ -2594,6 +2657,7 @@ _pan_child_size_get(Evas_Object *obj,
 {
    Pan *sd = evas_object_smart_data_get(obj);
 
+   if (!sd) return;
    if (w) *w = sd->wd->minw;
    if (h) *h = sd->wd->minh;
 }
@@ -2631,6 +2695,7 @@ static void
 _pan_resize_job(void *data)
 {
    Pan *sd = data;
+   if (!sd) return;
    _sizing_eval(sd->wd->obj);
    sd->resize_job = NULL;
 }
@@ -2643,15 +2708,23 @@ _pan_resize(Evas_Object *obj,
    Pan *sd = evas_object_smart_data_get(obj);
    Evas_Coord ow, oh;
 
+   if (!sd) return;
    evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    if ((ow == w) && (oh == h)) return;
    if ((sd->wd->height_for_width) && (ow != w))
      {
+        /* fix me later */
         if (sd->resize_job) ecore_job_del(sd->resize_job);
         sd->resize_job = ecore_job_add(_pan_resize_job, sd);
      }
+   sd->wd->pan_resized = EINA_TRUE;
+   evas_object_smart_changed(obj);
+   if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
+   sd->wd->calc_job = NULL;
+/* OLD
    if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
    sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
+ */
 }
 
 static void
@@ -2664,7 +2737,15 @@ _pan_calculate(Evas_Object *obj)
    Elm_Genlist_Item *git;
    Eina_List *l;
 
+   if (!sd) return;
    evas_event_freeze(evas_object_evas_get(obj));
+   
+   if (sd->wd->pan_resized)
+     {
+        _calc_job(sd->wd);
+        sd->wd->pan_resized = EINA_FALSE;
+     }
+   
    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
    evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
    EINA_LIST_FOREACH(sd->wd->group_items, l, git)
@@ -2693,11 +2774,11 @@ _pan_calculate(Evas_Object *obj)
       _group_items_recalc(sd->wd);
    if ((sd->wd->reorder_mode) && (sd->wd->reorder_it))
      {
-        if (sd->wd->pan_y != sd->wd->old_pan_y)
+        if (sd->wd->pan_y != sd->wd->reorder_old_pan_y)
            sd->wd->reorder_pan_move = EINA_TRUE;
         else sd->wd->reorder_pan_move = EINA_FALSE;
         evas_object_raise(sd->wd->reorder_it->base.view);
-        sd->wd->old_pan_y = sd->wd->pan_y;
+        sd->wd->reorder_old_pan_y = sd->wd->pan_y;
         sd->wd->start_time = ecore_loop_time_get();
      }
    _item_auto_scroll(sd->wd);
@@ -2712,6 +2793,7 @@ _pan_move(Evas_Object *obj,
 {
    Pan *sd = evas_object_smart_data_get(obj);
 
+   if (!sd) return;
    if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
    sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
 }
@@ -2757,6 +2839,38 @@ _freeze_off(void        *data __UNUSED__,
 }
 
 static void
+_scr_anim_start(void        *data,
+                Evas_Object *obj __UNUSED__,
+                void        *event_info __UNUSED__)
+{
+   evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
+}
+
+static void
+_scr_anim_stop(void        *data,
+               Evas_Object *obj __UNUSED__,
+               void        *event_info __UNUSED__)
+{
+   evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
+}
+
+static void
+_scr_drag_start(void            *data,
+                Evas_Object     *obj __UNUSED__,
+                void            *event_info __UNUSED__)
+{
+   evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
+}
+
+static void
+_scr_drag_stop(void            *data,
+               Evas_Object     *obj __UNUSED__,
+               void            *event_info __UNUSED__)
+{
+   evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
+}
+
+static void
 _scroll_edge_left(void        *data,
                   Evas_Object *scr __UNUSED__,
                   void        *event_info __UNUSED__)
@@ -2897,6 +3011,8 @@ _item_mode_set(Elm_Genlist_Item *it)
 
    evas_event_freeze(evas_object_evas_get(it->wd->obj));
    _mode_item_realize(it);
+   if (it->group_item)
+     evas_object_raise(it->group_item->base.view);
    _item_position(it, it->mode_view, it->scrl_x, it->scrl_y);
    evas_event_thaw(evas_object_evas_get(it->wd->obj));
    evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
@@ -2984,6 +3100,7 @@ elm_genlist_add(Evas_Object *parent)
    elm_widget_can_focus_set(obj, EINA_TRUE);
    elm_widget_event_hook_set(obj, _event_hook);
    elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
+   elm_widget_translate_hook_set(obj, _translate_hook);
 
    wd->scr = elm_smart_scroller_add(e);
    elm_smart_scroller_widget_set(wd->scr, obj);
@@ -2993,6 +3110,10 @@ elm_genlist_add(Evas_Object *parent)
                                        _elm_config->thumbscroll_bounce_enable);
    elm_widget_resize_object_set(obj, wd->scr);
 
+   evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
+   evas_object_smart_callback_add(wd->scr, "animate,stop", _scr_anim_stop, obj);
+   evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj);
+   evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj);
    evas_object_smart_callback_add(wd->scr, "edge,left", _scroll_edge_left, obj);
    evas_object_smart_callback_add(wd->scr, "edge,right", _scroll_edge_right,
                                   obj);
@@ -3052,6 +3173,16 @@ _item_new(Widget_Data                  *wd,
    it->func.data = func_data;
    it->mouse_cursor = NULL;
    it->expanded_depth = 0;
+   elm_widget_item_text_get_hook_set(it, _item_label_hook);
+   elm_widget_item_del_cb_set(it, _item_del_hook);
+
+   if (it->parent)
+     {
+        if (it->parent->flags & ELM_GENLIST_ITEM_GROUP)
+          it->group_item = parent;
+        else if (it->parent->group_item)
+          it->group_item = it->parent->group_item;
+     }
    return it;
 }
 
@@ -3308,12 +3439,20 @@ _elm_genlist_item_compare_data(const void *data, const void *data1)
 static int
 _elm_genlist_item_compare(const void *data, const void *data1)
 {
-   Elm_Genlist_Item *item, *item1;
+   const Elm_Genlist_Item *item, *item1;
    item = ELM_GENLIST_ITEM_FROM_INLIST(data);
    item1 = ELM_GENLIST_ITEM_FROM_INLIST(data1);
    return _elm_genlist_item_compare_cb(item, item1);
 }
 
+static int
+_elm_genlist_item_list_compare(const void *data, const void *data1)
+{
+   const Elm_Genlist_Item *item = data;
+   const Elm_Genlist_Item *item1 = data1;
+   return _elm_genlist_item_compare_cb(item, item1);
+}
+
 static void
 _item_move_after(Elm_Genlist_Item *it, Elm_Genlist_Item *after)
 {
@@ -3355,23 +3494,6 @@ _item_move_before(Elm_Genlist_Item *it, Elm_Genlist_Item *before)
      it->itc->func.moved(it->base.widget, it, before, EINA_FALSE);
 }
 
-/**
- * Add item to the end of the genlist
- *
- * This adds the given item to the end of the list or the end of
- * the children if the parent is given.
- *
- * @param obj The genlist object
- * @param itc The item class for the item
- * @param data The item data
- * @param parent The parent item, or NULL if none
- * @param flags Item flags
- * @param func Convenience function called when item selected
- * @param func_data Data passed to @p func above.
- * @return A handle to the item added or NULL if not possible
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_append(Evas_Object                  *obj,
                         const Elm_Genlist_Item_Class *itc,
@@ -3406,34 +3528,12 @@ elm_genlist_item_append(Evas_Object                  *obj,
                                       EINA_INLIST_GET(it2));
         it->rel = it2;
         it->rel->relcount++;
-
-        if (it->parent->flags & ELM_GENLIST_ITEM_GROUP)
-          it->group_item = parent;
-        else if (it->parent->group_item)
-          it->group_item = it->parent->group_item;
      }
    it->before = EINA_FALSE;
    _item_queue(wd, it);
    return it;
 }
 
-/**
- * Add item at start of the genlist
- *
- * This adds an item to the beginning of the list or beginning of the
- * children of the parent if given.
- *
- * @param obj The genlist object
- * @param itc The item class for the item
- * @param data The item data
- * @param parent The parent item, or NULL if none
- * @param flags Item flags
- * @param func Convenience function called when item selected
- * @param func_data Data passed to @p func above.
- * @return A handle to the item added or NULL if not possible
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_prepend(Evas_Object                  *obj,
                          const Elm_Genlist_Item_Class *itc,
@@ -3474,23 +3574,47 @@ elm_genlist_item_prepend(Evas_Object                  *obj,
    return it;
 }
 
-/**
- * Insert item before another in the genlist
- *
- * This inserts an item before another in the list. It will be in the
- * same tree level or group as the item it is inseted before.
- *
- * @param obj The genlist object
- * @param itc The item class for the item
- * @param data The item data
- * @param before The item to insert before
- * @param flags Item flags
- * @param func Convenience function called when item selected
- * @param func_data Data passed to @p func above.
- * @return A handle to the item added or NULL if not possible
- *
- * @ingroup Genlist
- */
+EAPI Elm_Genlist_Item *
+elm_genlist_item_insert_after(Evas_Object                  *obj,
+                              const Elm_Genlist_Item_Class *itc,
+                              const void                   *data,
+                              Elm_Genlist_Item             *parent,
+                              Elm_Genlist_Item             *after,
+                              Elm_Genlist_Item_Flags        flags,
+                              Evas_Smart_Cb                 func,
+                              const void                   *func_data)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+   Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
+                                    func_data);
+   if (!it) return NULL;
+   /* 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);
+
+   if (!it->parent)
+     {
+        if ((flags & ELM_GENLIST_ITEM_GROUP) &&
+            (after->flags & ELM_GENLIST_ITEM_GROUP))
+          wd->group_items = eina_list_append_relative(wd->group_items, it,
+                                                      after);
+     }
+   else
+     {
+        it->parent->items = eina_list_append_relative(it->parent->items, it,
+                                                      after);
+     }
+   wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
+                                           EINA_INLIST_GET(after));
+   it->rel = after;
+   it->rel->relcount++;
+   it->before = EINA_FALSE;
+   _item_queue(wd, it);
+   return it;
+}
+
 EAPI Elm_Genlist_Item *
 elm_genlist_item_insert_before(Evas_Object                  *obj,
                                const Elm_Genlist_Item_Class *itc,
@@ -3508,7 +3632,17 @@ elm_genlist_item_insert_before(Evas_Object                  *obj,
    Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
                                     func_data);
    if (!it) return NULL;
-   if (it->parent)
+   /* 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);
+
+   if (!it->parent)
+     {
+        if ((flags & ELM_GENLIST_ITEM_GROUP) &&
+            (before->flags & ELM_GENLIST_ITEM_GROUP))
+          wd->group_items = eina_list_prepend_relative(wd->group_items, it,
+                                                       before);
+     }
+   else
      {
         it->parent->items = eina_list_prepend_relative(it->parent->items, it,
                                                        before);
@@ -3535,6 +3669,7 @@ elm_genlist_item_direct_sorted_insert(Evas_Object                  *obj,
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
+   Elm_Genlist_Item *rel = NULL;
    Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
                                     func_data);
    if (!it) return NULL;
@@ -3543,43 +3678,66 @@ elm_genlist_item_direct_sorted_insert(Evas_Object                  *obj,
 
    if (it->parent)
      {
-        it->parent->items =
-          eina_list_sorted_insert(it->parent->items, _elm_genlist_item_compare, it);
+        Eina_List *l;
+        int cmp_result;
+
+        l = eina_list_search_sorted_near_list(it->parent->items,
+                                              _elm_genlist_item_list_compare, it,
+                                              &cmp_result);
+        if (l)
+          rel = eina_list_data_get(l);
+        else
+          rel = it->parent;
+
+        if (cmp_result >= 0)
+          {
+             it->parent->items = eina_list_prepend_relative_list(it->parent->items, it, l);
+             wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel));
+             it->before = EINA_FALSE;
+          }
+        else if (cmp_result < 0)
+          {
+             it->parent->items = eina_list_append_relative_list(it->parent->items, it, l);
+             wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel));
+             it->before = EINA_TRUE;
+          }
      }
-   wd->items = eina_inlist_sorted_insert(wd->items, EINA_INLIST_GET(it),
-                                         _elm_genlist_item_compare);
-   if (EINA_INLIST_GET(it)->next)
+   else
      {
-        it->rel = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
-        it->rel->relcount++;
-        it->before = EINA_TRUE;
+        if (!wd->state)
+          {
+             wd->state = eina_inlist_sorted_state_new();
+          }
+
+        if (flags & ELM_GENLIST_ITEM_GROUP)
+          wd->group_items = eina_list_append(wd->group_items, it);
+
+        wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(it),
+                                                    _elm_genlist_item_compare, wd->state);
+
+        if (EINA_INLIST_GET(it)->next)
+          {
+             rel = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
+             it->before = EINA_TRUE;
+          }
+        else if (EINA_INLIST_GET(it)->prev)
+          {
+             rel = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
+             it->before = EINA_FALSE;
+          }
      }
-   else if (EINA_INLIST_GET(it)->prev)
+
+   if (rel)
      {
-        it->rel = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
+        it->rel = rel;
         it->rel->relcount++;
-        it->before = EINA_FALSE;
      }
+
    _item_queue(wd, it);
 
    return it;
 }
 
-/**
- * Insert a new item into the sorted genlist object
- *
- * @param obj The genlist object
- * @param itc The item class for the item
- * @param data The item data
- * @param parent The parent item, or NULL if none
- * @param flags Item flags
- * @param comp The function called for the sort
- * @param func Convenience function called when item selected
- * @param func_data Data passed to @p func above.
- * @return A handle to the item added or NULL if not possible
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_sorted_insert(Evas_Object                  *obj,
                                const Elm_Genlist_Item_Class *itc,
@@ -3596,63 +3754,17 @@ elm_genlist_item_sorted_insert(Evas_Object                  *obj,
                                                 _elm_genlist_item_compare_data, func, func_data);
 }
 
-/**
- * Insert an item after another in the genlst
- *
- * This inserts an item after another in the list. It will be in the
- * same tree level or group as the item it is inseted after.
- *
- * @param obj The genlist object
- * @param itc The item class for the item
- * @param data The item data
- * @param after The item to insert after
- * @param flags Item flags
- * @param func Convenience function called when item selected
- * @param func_data Data passed to @p func above.
- * @return A handle to the item added or NULL if not possible
- *
- * @ingroup Genlist
- */
-EAPI Elm_Genlist_Item *
-elm_genlist_item_insert_after(Evas_Object                  *obj,
-                              const Elm_Genlist_Item_Class *itc,
-                              const void                   *data,
-                              Elm_Genlist_Item             *parent,
-                              Elm_Genlist_Item             *after,
-                              Elm_Genlist_Item_Flags        flags,
-                              Evas_Smart_Cb                 func,
-                              const void                   *func_data)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return NULL;
-   Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
-                                    func_data);
-   if (!it) return NULL;
-   /* It make 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);
-
-   wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
-                                           EINA_INLIST_GET(after));
-   if (it->parent)
-     {
-        it->parent->items = eina_list_append_relative(it->parent->items, it,
-                                                      after);
-     }
-   it->rel = after;
-   it->rel->relcount++;
-   it->before = EINA_FALSE;
-   _item_queue(wd, it);
-   return it;
-}
-
 EAPI void
 elm_genlist_clear(Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   if (wd->state)
+     {
+        eina_inlist_sorted_state_free(wd->state);
+        wd->state = NULL;
+     }
    if (wd->walking > 0)
      {
         Elm_Genlist_Item *it;
@@ -3730,7 +3842,7 @@ elm_genlist_clear(Evas_Object *obj)
    wd->show_item = NULL;
    wd->pan_x = 0;
    wd->pan_y = 0;
-   wd->old_pan_y = 0;
+   wd->reorder_old_pan_y = 0;
    wd->minw = 0;
    wd->minh = 0;
    if (wd->pan_smart)
@@ -3739,6 +3851,7 @@ elm_genlist_clear(Evas_Object *obj)
         evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
      }
    _sizing_eval(obj);
+   elm_smart_scroller_child_region_show(wd->scr, 0, 0, 0, 0);
    evas_event_thaw(evas_object_evas_get(wd->obj));
    evas_event_thaw_eval(evas_object_evas_get(wd->obj));
 }
@@ -3862,16 +3975,6 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj,
    return NULL;
 }
 
-/**
- * Get the first item in the genlist
- *
- * This returns the first item in the list.
- *
- * @param obj The genlist object
- * @return The first item, or NULL if none
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_first_item_get(const Evas_Object *obj)
 {
@@ -3885,15 +3988,6 @@ elm_genlist_first_item_get(const Evas_Object *obj)
    return it;
 }
 
-/**
- * Get the last item in the genlist
- *
- * This returns the last item in the list.
- *
- * @return The last item, or NULL if none
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_last_item_get(const Evas_Object *obj)
 {
@@ -3907,16 +4001,6 @@ elm_genlist_last_item_get(const Evas_Object *obj)
    return it;
 }
 
-/**
- * Get the next item in the genlist
- *
- * This returns the item after the item @p it.
- *
- * @param it The item
- * @return The item after @p it, or NULL if none
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_next_get(const Elm_Genlist_Item *it)
 {
@@ -3929,16 +4013,6 @@ elm_genlist_item_next_get(const Elm_Genlist_Item *it)
    return (Elm_Genlist_Item *)it;
 }
 
-/**
- * Get the previous item in the genlist
- *
- * This returns the item before the item @p it.
- *
- * @param it The item
- * @return The item before @p it, or NULL if none
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_prev_get(const Elm_Genlist_Item *it)
 {
@@ -3951,16 +4025,6 @@ elm_genlist_item_prev_get(const Elm_Genlist_Item *it)
    return (Elm_Genlist_Item *)it;
 }
 
-/**
- * Get the genlist object from an item
- *
- * This returns the genlist object itself that an item belongs to.
- *
- * @param it The item
- * @return The genlist object
- *
- * @ingroup Genlist
- */
 EAPI Evas_Object *
 elm_genlist_item_genlist_get(const Elm_Genlist_Item *it)
 {
@@ -3968,16 +4032,6 @@ elm_genlist_item_genlist_get(const Elm_Genlist_Item *it)
    return it->base.widget;
 }
 
-/**
- * Get the parent item of the given item
- *
- * This returns the parent item of the item @p it given.
- *
- * @param it The item
- * @return The parent of the item or NULL if none
- *
- * @ingroup Genlist
- */
 EAPI Elm_Genlist_Item *
 elm_genlist_item_parent_get(const Elm_Genlist_Item *it)
 {
@@ -3985,16 +4039,6 @@ elm_genlist_item_parent_get(const Elm_Genlist_Item *it)
    return it->parent;
 }
 
-/**
- * Clear all sub-items (children) of the given item
- *
- * This clears all items that are children (or their descendants) of the
- * given item @p it.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_subitems_clear(Elm_Genlist_Item *it)
 {
@@ -4008,17 +4052,6 @@ elm_genlist_item_subitems_clear(Elm_Genlist_Item *it)
      elm_genlist_item_del(it2);
 }
 
-/**
- * Set the selected state of an item
- *
- * This sets the selected state (1 selected, 0 not selected) of the given
- * item @p it.
- *
- * @param it The item
- * @param selected The selected state
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_selected_set(Elm_Genlist_Item *it,
                               Eina_Bool         selected)
@@ -4050,16 +4083,6 @@ elm_genlist_item_selected_set(Elm_Genlist_Item *it,
      }
 }
 
-/**
- * Get the selected state of an item
- *
- * This gets the selected state of an item (1 selected, 0 not selected).
- *
- * @param it The item
- * @return The selected state
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_item_selected_get(const Elm_Genlist_Item *it)
 {
@@ -4067,17 +4090,6 @@ elm_genlist_item_selected_get(const Elm_Genlist_Item *it)
    return it->selected;
 }
 
-/**
- * Sets the expanded state of an item (if it's a parent)
- *
- * This expands or contracts a parent item (thus showing or hiding the
- * children).
- *
- * @param it The item
- * @param expanded The expanded state (1 expanded, 0 not expanded).
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_expanded_set(Elm_Genlist_Item *it,
                               Eina_Bool         expanded)
@@ -4102,16 +4114,6 @@ elm_genlist_item_expanded_set(Elm_Genlist_Item *it,
      }
 }
 
-/**
- * Get the expanded state of an item
- *
- * This gets the expanded state of an item
- *
- * @param it The item
- * @return Thre expanded state
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_item_expanded_get(const Elm_Genlist_Item *it)
 {
@@ -4119,14 +4121,6 @@ elm_genlist_item_expanded_get(const Elm_Genlist_Item *it)
    return it->expanded;
 }
 
-/**
- * Get the depth of expanded item
- *
- * @param it The genlist item object
- * @return The depth of expanded item
- *
- * @ingroup Genlist
- */
 EAPI int
 elm_genlist_item_expanded_depth_get(const Elm_Genlist_Item *it)
 {
@@ -4134,18 +4128,6 @@ elm_genlist_item_expanded_depth_get(const Elm_Genlist_Item *it)
    return it->expanded_depth;
 }
 
-/**
- * Sets the disabled state of an item.
- *
- * A disabled item cannot be selected or unselected. It will also
- * change appearance to appear disabled. This sets the disabled state
- * (1 disabled, 0 not disabled).
- *
- * @param it The item
- * @param disabled The disabled state
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_disabled_set(Elm_Genlist_Item *it,
                               Eina_Bool         disabled)
@@ -4169,16 +4151,6 @@ elm_genlist_item_disabled_set(Elm_Genlist_Item *it,
      }
 }
 
-/**
- * Get the disabled state of an item
- *
- * This gets the disabled state of the given item.
- *
- * @param it The item
- * @return The disabled state
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_item_disabled_get(const Elm_Genlist_Item *it)
 {
@@ -4187,19 +4159,6 @@ elm_genlist_item_disabled_get(const Elm_Genlist_Item *it)
    return it->disabled;
 }
 
-/**
- * Sets the display only state of an item.
- *
- * A display only item cannot be selected or unselected. It is for
- * display only and not selecting or otherwise clicking, dragging
- * etc. by the user, thus finger size rules will not be applied to
- * this item.
- *
- * @param it The item
- * @param display_only The display only state
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_display_only_set(Elm_Genlist_Item *it,
                                   Eina_Bool         display_only)
@@ -4215,16 +4174,6 @@ elm_genlist_item_display_only_set(Elm_Genlist_Item *it,
    it->wd->update_job = ecore_job_add(_update_job, it->wd);
 }
 
-/**
- * Get the display only state of an item
- *
- * This gets the display only state of the given item.
- *
- * @param it The item
- * @return The display only state
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_item_display_only_get(const Elm_Genlist_Item *it)
 {
@@ -4233,16 +4182,6 @@ elm_genlist_item_display_only_get(const Elm_Genlist_Item *it)
    return it->display_only;
 }
 
-/**
- * Show the given item
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_show(Elm_Genlist_Item *it)
 {
@@ -4269,17 +4208,6 @@ elm_genlist_item_show(Elm_Genlist_Item *it)
                                         it->block->w, it->h);
 }
 
-/**
- * Bring in the given item
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible. This may use animation to
- * do so and take a period of time
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_bring_in(Elm_Genlist_Item *it)
 {
@@ -4306,16 +4234,6 @@ elm_genlist_item_bring_in(Elm_Genlist_Item *it)
                                       it->block->w, it->h);
 }
 
-/**
- * Show the given item at the top
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_top_show(Elm_Genlist_Item *it)
 {
@@ -4344,17 +4262,6 @@ elm_genlist_item_top_show(Elm_Genlist_Item *it)
                                         it->block->w, oh);
 }
 
-/**
- * Bring in the given item at the top
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible. This may use animation to
- * do so and take a period of time
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_top_bring_in(Elm_Genlist_Item *it)
 {
@@ -4383,16 +4290,6 @@ elm_genlist_item_top_bring_in(Elm_Genlist_Item *it)
                                       it->block->w, oh);
 }
 
-/**
- * Show the given item at the middle
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_middle_show(Elm_Genlist_Item *it)
 {
@@ -4419,17 +4316,6 @@ elm_genlist_item_middle_show(Elm_Genlist_Item *it)
                                         it->h / 2, it->block->w, oh);
 }
 
-/**
- * Bring in the given item at the middle
- *
- * This causes genlist to jump to the given item @p it and show it (by
- * scrolling), if it is not fully visible. This may use animation to
- * do so and take a period of time
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_middle_bring_in(Elm_Genlist_Item *it)
 {
@@ -4456,17 +4342,6 @@ elm_genlist_item_middle_bring_in(Elm_Genlist_Item *it)
                                       it->block->w, oh);
 }
 
-/**
- * Delete a given item
- *
- * This deletes the item from genlist and calls the genlist item del
- * class callback defined in the item class, if it is set. This clears all
- * subitems if it is a tree.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_del(Elm_Genlist_Item *it)
 {
@@ -4494,19 +4369,6 @@ elm_genlist_item_del(Elm_Genlist_Item *it)
    _item_del(it);
 }
 
-/**
- * Set the data item from the genlist item
- *
- * This sets the data value passed on the elm_genlist_item_append() and
- * related item addition calls. This function will not call
- * elm_genlist_item_update() anymore. So call elm_genlist_item_update()
- * manually only when it's needed.
- *
- * @param it The item
- * @param data The new data pointer to set
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_data_set(Elm_Genlist_Item *it,
                           const void       *data)
@@ -4515,17 +4377,6 @@ elm_genlist_item_data_set(Elm_Genlist_Item *it,
    elm_widget_item_data_set(it, data);
 }
 
-/**
- * Get the data item from the genlist item
- *
- * This returns the data value passed on the elm_genlist_item_append()
- * and related item addition calls and elm_genlist_item_data_set().
- *
- * @param it The item
- * @return The data pointer provided when created
- *
- * @ingroup Genlist
- */
 EAPI void *
 elm_genlist_item_data_get(const Elm_Genlist_Item *it)
 {
@@ -4533,18 +4384,6 @@ elm_genlist_item_data_get(const Elm_Genlist_Item *it)
    return elm_widget_item_data_get(it);
 }
 
-/**
- * Tells genlist to "orphan" icons fetchs by the item class
- *
- * This instructs genlist to release references to icons in the item,
- * meaning that they will no longer be managed by genlist and are
- * floating "orphans" that can be re-used elsewhere if the user wants
- * to.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_icons_orphan(Elm_Genlist_Item *it)
 {
@@ -4558,21 +4397,6 @@ elm_genlist_item_icons_orphan(Elm_Genlist_Item *it)
      }
 }
 
-/**
- * Get the real evas object of the genlist item
- *
- * This returns the actual evas object used for the specified genlist
- * item. This may be NULL as it may not be created, and may be deleted
- * at any time by genlist. Do not modify this object (move, resize,
- * show, hide etc.) as genlist is controlling it. This function is for
- * querying, emitting custom signals or hooking lower level callbacks
- * for events. Do not delete this object under any circumstances.
- *
- * @param it The item
- * @return The object pointer
- *
- * @ingroup Genlist
- */
 EAPI const Evas_Object *
 elm_genlist_item_object_get(const Elm_Genlist_Item *it)
 {
@@ -4580,17 +4404,6 @@ elm_genlist_item_object_get(const Elm_Genlist_Item *it)
    return it->base.view;
 }
 
-/**
- * Update the contents of an item
- *
- * This updates an item by calling all the item class functions again
- * to get the icons, labels and states. Use this when the original
- * item data has changed and the changes are desired to be reflected.
- *
- * @param it The item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_update(Elm_Genlist_Item *it)
 {
@@ -4604,14 +4417,6 @@ elm_genlist_item_update(Elm_Genlist_Item *it)
    it->wd->update_job = ecore_job_add(_update_job, it->wd);
 }
 
-/**
- * Update the item class of an item
- *
- * @param it The item
- * @parem itc The item class for the item
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_item_class_update(Elm_Genlist_Item             *it,
                                    const Elm_Genlist_Item_Class *itc)
@@ -4655,17 +4460,6 @@ _elm_genlist_item_label_del_cb(void        *data,
    eina_stringshare_del(data);
 }
 
-/**
- * Set the text to be shown in the genlist item.
- *
- * @param item Target item
- * @param text The text to set in the content
- *
- * Setup the text as tooltip to object. The item can have only one
- * tooltip, so any previous tooltip data is removed.
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_tooltip_text_set(Elm_Genlist_Item *item,
                                   const char       *text)
@@ -4677,26 +4471,6 @@ elm_genlist_item_tooltip_text_set(Elm_Genlist_Item *item,
                                            _elm_genlist_item_label_del_cb);
 }
 
-/**
- * Set the content to be shown in the tooltip item
- *
- * Setup the tooltip to item. The item can have only one tooltip, so
- * any previous tooltip data is removed. @p func(with @p data) will be
- * called every time that need to show the tooltip and it should return a
- * valid Evas_Object. This object is then managed fully by tooltip
- * system and is deleted when the tooltip is gone.
- *
- * @param item the genlist item being attached by a tooltip.
- * @param func the function used to create the tooltip contents.
- * @param data what to provide to @a func as callback data/context.
- * @param del_cb called when data is not needed anymore, either when
- *        another callback replaces @func, the tooltip is unset with
- *        elm_genlist_item_tooltip_unset() or the owner @a item
- *        dies. This callback receives as the first parameter the
- *        given @a data, and @c event_info is the item.
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_tooltip_content_cb_set(Elm_Genlist_Item           *item,
                                         Elm_Tooltip_Item_Content_Cb func,
@@ -4722,6 +4496,7 @@ elm_genlist_item_tooltip_content_cb_set(Elm_Genlist_Item           *item,
                                                item->tooltip.content_cb,
                                                item->tooltip.data, NULL);
         elm_widget_item_tooltip_style_set(item, item->tooltip.style);
+        elm_widget_item_tooltip_size_restrict_disable(item, item->tooltip.free_size);
      }
 
    return;
@@ -4730,19 +4505,6 @@ error:
    if (del_cb) del_cb((void *)data, NULL, NULL);
 }
 
-/**
- * Unset tooltip from item
- *
- * @param item genlist item to remove previously set tooltip.
- *
- * Remove tooltip from item. The callback provided as del_cb to
- * elm_genlist_item_tooltip_content_cb_set() will be called to notify
- * it is not used anymore.
- *
- * @see elm_genlist_item_tooltip_content_cb_set()
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_tooltip_unset(Elm_Genlist_Item *item)
 {
@@ -4755,22 +4517,11 @@ elm_genlist_item_tooltip_unset(Elm_Genlist_Item *item)
    item->tooltip.del_cb = NULL;
    item->tooltip.content_cb = NULL;
    item->tooltip.data = NULL;
+   item->tooltip.free_size = EINA_FALSE;
    if (item->tooltip.style)
      elm_genlist_item_tooltip_style_set(item, NULL);
 }
 
-/**
- * Sets a different style for this item tooltip.
- *
- * @note before you set a style you should define a tooltip with
- *       elm_genlist_item_tooltip_content_cb_set() or
- *       elm_genlist_item_tooltip_text_set()
- *
- * @param item genlist item with tooltip already set.
- * @param style the theme style to use (default, transparent, ...)
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_tooltip_style_set(Elm_Genlist_Item *item,
                                    const char       *style)
@@ -4780,15 +4531,6 @@ elm_genlist_item_tooltip_style_set(Elm_Genlist_Item *item,
    if (item->base.view) elm_widget_item_tooltip_style_set(item, style);
 }
 
-/**
- * Get the style for this item tooltip.
- *
- * @param item genlist item with tooltip already set.
- * @return style the theme style in use, defaults to "default". If the
- *         object does not have a tooltip set, then NULL is returned.
- *
- * @ingroup Genlist
- */
 EAPI const char *
 elm_genlist_item_tooltip_style_get(const Elm_Genlist_Item *item)
 {
@@ -4800,25 +4542,18 @@ EAPI Eina_Bool
 elm_genlist_item_tooltip_size_restrict_disable(Elm_Genlist_Item *item, Eina_Bool disable)
 {
    ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
-   return elm_widget_item_tooltip_size_restrict_disable(item, disable);
+   item->tooltip.free_size = disable;
+   if (item->base.view) return elm_widget_item_tooltip_size_restrict_disable(item, disable);
+   return EINA_TRUE;
 }
 
 EAPI Eina_Bool
 elm_genlist_item_tooltip_size_restrict_disabled_get(const Elm_Genlist_Item *item)
 {
    ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
-   return elm_widget_item_tooltip_size_restrict_disabled_get(item);
+   return item->tooltip.free_size;
 }
 
-/**
- * Set the cursor to be shown when mouse is over the genlist item
- *
- * @param item Target item
- * @param cursor the cursor name to be used.
- *
- * @see elm_object_cursor_set()
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_cursor_set(Elm_Genlist_Item *item,
                             const char       *cursor)
@@ -4828,14 +4563,6 @@ elm_genlist_item_cursor_set(Elm_Genlist_Item *item,
    if (item->base.view) elm_widget_item_cursor_set(item, cursor);
 }
 
-/**
- * Get the cursor to be shown when mouse is over the genlist item
- *
- * @param item genlist item with cursor already set.
- * @return the cursor name.
- *
- * @ingroup Genlist
- */
 EAPI const char *
 elm_genlist_item_cursor_get(const Elm_Genlist_Item *item)
 {
@@ -4843,14 +4570,6 @@ elm_genlist_item_cursor_get(const Elm_Genlist_Item *item)
    return elm_widget_item_cursor_get(item);
 }
 
-/**
- * Unset the cursor to be shown when mouse is over the genlist item
- *
- * @param item Target item
- *
- * @see elm_object_cursor_unset()
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_cursor_unset(Elm_Genlist_Item *item)
 {
@@ -4865,17 +4584,6 @@ elm_genlist_item_cursor_unset(Elm_Genlist_Item *item)
    item->mouse_cursor = NULL;
 }
 
-/**
- * Sets a different style for this item cursor.
- *
- * @note before you set a style you should define a cursor with
- *       elm_genlist_item_cursor_set()
- *
- * @param item genlist item with cursor already set.
- * @param style the theme style to use (default, transparent, ...)
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_cursor_style_set(Elm_Genlist_Item *item,
                                   const char       *style)
@@ -4884,15 +4592,6 @@ elm_genlist_item_cursor_style_set(Elm_Genlist_Item *item,
    elm_widget_item_cursor_style_set(item, style);
 }
 
-/**
- * Get the style for this item cursor.
- *
- * @param item genlist item with cursor already set.
- * @return style the theme style in use, defaults to "default". If the
- *         object does not have a cursor set, then NULL is returned.
- *
- * @ingroup Genlist
- */
 EAPI const char *
 elm_genlist_item_cursor_style_get(const Elm_Genlist_Item *item)
 {
@@ -4900,21 +4599,6 @@ elm_genlist_item_cursor_style_get(const Elm_Genlist_Item *item)
    return elm_widget_item_cursor_style_get(item);
 }
 
-/**
- * Set if the cursor set should be searched on the theme or should use
- * the provided by the engine, only.
- *
- * @note before you set if should look on theme you should define a
- * cursor with elm_object_cursor_set(). By default it will only look
- * for cursors provided by the engine.
- *
- * @param item widget item with cursor already set.
- * @param engine_only boolean to define it cursors should be looked
- * only between the provided by the engine or searched on widget's
- * theme as well.
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_cursor_engine_only_set(Elm_Genlist_Item *item,
                                         Eina_Bool         engine_only)
@@ -4923,17 +4607,6 @@ elm_genlist_item_cursor_engine_only_set(Elm_Genlist_Item *item,
    elm_widget_item_cursor_engine_only_set(item, engine_only);
 }
 
-/**
- * Get the cursor engine only usage for this item cursor.
- *
- * @param item widget item with cursor already set.
- * @return engine_only boolean to define it cursors should be looked
- * only between the provided by the engine or searched on widget's
- * theme as well. If the object does not have a cursor set, then
- * EINA_FALSE is returned.
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_item_cursor_engine_only_get(const Elm_Genlist_Item *item)
 {
@@ -4942,7 +4615,7 @@ elm_genlist_item_cursor_engine_only_get(const Elm_Genlist_Item *item)
 }
 
 EAPI void
-elm_genlist_horizontal_mode_set(Evas_Object  *obj,
+elm_genlist_horizontal_set(Evas_Object  *obj,
                                 Elm_List_Mode mode)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
@@ -4953,8 +4626,15 @@ elm_genlist_horizontal_mode_set(Evas_Object  *obj,
    _sizing_eval(obj);
 }
 
+EAPI void
+elm_genlist_horizontal_mode_set(Evas_Object  *obj,
+                                Elm_List_Mode mode)
+{
+   elm_genlist_horizontal_set(obj, mode);
+}
+
 EAPI Elm_List_Mode
-elm_genlist_horizontal_mode_get(const Evas_Object *obj)
+elm_genlist_horizontal_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_LAST;
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -4962,6 +4642,12 @@ elm_genlist_horizontal_mode_get(const Evas_Object *obj)
    return wd->mode;
 }
 
+EAPI Elm_List_Mode
+elm_genlist_horizontal_mode_get(const Evas_Object *obj)
+{
+   return elm_genlist_horizontal_get(obj);
+}
+
 EAPI void
 elm_genlist_always_select_mode_set(Evas_Object *obj,
                                    Eina_Bool    always_select)
@@ -5133,12 +4819,11 @@ elm_genlist_scroller_policy_set(Evas_Object        *obj,
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return;
+   if ((!wd) || (!wd->scr)) return;
    if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
        (policy_v >= ELM_SCROLLER_POLICY_LAST))
      return;
-   if (wd->scr)
-     elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
+   elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
 }
 
 EAPI void
@@ -5168,15 +4853,6 @@ elm_genlist_realized_items_update(Evas_Object *obj)
      elm_genlist_item_update(it);
 }
 
-/**
- * Set genlist item mode
- *
- * @param item The genlist item
- * @param mode Mode name
- * @param mode_set Boolean to define set or unset mode.
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_item_mode_set(Elm_Genlist_Item *it,
                           const char       *mode_type,
@@ -5219,13 +4895,6 @@ elm_genlist_item_mode_set(Elm_Genlist_Item *it,
    if (mode_set) _item_mode_set(it);
 }
 
-/**
- * Get active genlist mode type
- *
- * @param obj The genlist object
- *
- * @ingroup Genlist
- */
 EAPI const char *
 elm_genlist_mode_get(const Evas_Object *obj)
 {
@@ -5235,13 +4904,6 @@ elm_genlist_mode_get(const Evas_Object *obj)
    return wd->mode_type;
 }
 
-/**
- * Get active genlist mode item
- *
- * @param obj The genlist object
- *
- * @ingroup Genlist
- */
 EAPI const Elm_Genlist_Item *
 elm_genlist_mode_item_get(const Evas_Object *obj)
 {
@@ -5251,15 +4913,6 @@ elm_genlist_mode_item_get(const Evas_Object *obj)
    return wd->mode_item;
 }
 
-/**
- * Set reorder mode
- *
- * @param obj The genlist object
- * @param reorder_mode The reorder mode
- * (EINA_TRUE = on, EINA_FALSE = off)
- *
- * @ingroup Genlist
- */
 EAPI void
 elm_genlist_reorder_mode_set(Evas_Object *obj,
                              Eina_Bool    reorder_mode)
@@ -5270,15 +4923,6 @@ elm_genlist_reorder_mode_set(Evas_Object *obj,
    wd->reorder_mode = reorder_mode;
 }
 
-/**
- * Get the reorder mode
- *
- * @param obj The genlist object
- * @return The reorder mode
- * (EINA_TRUE = on, EINA_FALSE = off)
- *
- * @ingroup Genlist
- */
 EAPI Eina_Bool
 elm_genlist_reorder_mode_get(const Evas_Object *obj)
 {