summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-08 23:03:52 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-08 23:07:39 +0900
commit0e7d521151ba93f3b5955caaf9b906e160ab6057 (patch)
treee5856a6b2da4a3b0f05f5f196dfa15fa6ef4b899
parentb54811005d6a3c2ce9e95bf9358b43453a0b18f7 (diff)
genilst: get rid of lazy deletion.
delete genlist item directly. instead, remove the bunch of code that was related to lazy deletion. we can success, if we clean up the resources and callback calls properly. here i only found item focus callback that (may) required the lazy deletion.
-rw-r--r--src/lib/elm_genlist.c221
-rw-r--r--src/lib/elm_widget.h2
-rw-r--r--src/lib/elm_widget_genlist.h6
3 files changed, 54 insertions, 175 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index cf75970fc..0deacb15d 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -154,7 +154,7 @@ static void _access_activate_cb(void *data EINA_UNUSED,
154 Evas_Object *part_obj EINA_UNUSED, 154 Evas_Object *part_obj EINA_UNUSED,
155 Elm_Object_Item *item); 155 Elm_Object_Item *item);
156static void _decorate_item_set(Elm_Gen_Item *); 156static void _decorate_item_set(Elm_Gen_Item *);
157static void _internal_elm_genlist_clear(Evas_Object *obj, Eina_Bool standby); 157static void _internal_elm_genlist_clear(Evas_Object *obj);
158 158
159static const Elm_Action key_actions[] = { 159static const Elm_Action key_actions[] = {
160 {"move", _key_action_move}, 160 {"move", _key_action_move},
@@ -1286,9 +1286,7 @@ _decorate_all_item_realize(Elm_Gen_Item *it,
1286 if (!it) return; 1286 if (!it) return;
1287 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 1287 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1288 1288
1289 if ((it->item->decorate_all_item_realized) || 1289 if (it->item->decorate_all_item_realized) return;
1290 (it->generation < sd->generation))
1291 return;
1292 1290
1293 it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it))); 1291 it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
1294 edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) * 1292 edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) *
@@ -1623,7 +1621,6 @@ _item_realize(Elm_Gen_Item *it,
1623 int tsize = 20; 1621 int tsize = 20;
1624 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 1622 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1625 1623
1626 if (it->generation < sd->generation) return;
1627 if (it->realized) 1624 if (it->realized)
1628 { 1625 {
1629 if (it->item->order_num_in != in) 1626 if (it->item->order_num_in != in)
@@ -2157,9 +2154,7 @@ _item_block_position(Item_Block *itb,
2157 EINA_LIST_FOREACH(itb->items, l, it) 2154 EINA_LIST_FOREACH(itb->items, l, it)
2158 { 2155 {
2159 sd = GL_IT(it)->wsd; 2156 sd = GL_IT(it)->wsd;
2160 if (it->generation < sd->generation) continue; 2157 if (sd->reorder_it == it) continue;
2161 else if (sd->reorder_it == it)
2162 continue;
2163 2158
2164 it->x = 0; 2159 it->x = 0;
2165 it->y = y; 2160 it->y = y;
@@ -2386,9 +2381,7 @@ _item_multi_select_up(Elm_Genlist_Data *sd)
2386 while (eo_prev) 2381 while (eo_prev)
2387 { 2382 {
2388 ELM_GENLIST_ITEM_DATA_GET(eo_prev, prev); 2383 ELM_GENLIST_ITEM_DATA_GET(eo_prev, prev);
2389 if ((prev->generation == sd->generation) && 2384 if ((!_is_no_select(prev)) && (!elm_object_item_disabled_get(eo_prev)))
2390 (!_is_no_select(prev)) &&
2391 (!elm_object_item_disabled_get(eo_prev)))
2392 break; 2385 break;
2393 eo_prev = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev)); 2386 eo_prev = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev));
2394 } 2387 }
@@ -2418,9 +2411,7 @@ _item_multi_select_down(Elm_Genlist_Data *sd)
2418 while ((eo_next)) 2411 while ((eo_next))
2419 { 2412 {
2420 ELM_GENLIST_ITEM_DATA_GET(eo_next, next); 2413 ELM_GENLIST_ITEM_DATA_GET(eo_next, next);
2421 if ((next->generation == sd->generation) && 2414 if ((_is_no_select(next)) && (!elm_object_item_disabled_get(eo_next)))
2422 (!_is_no_select(next)) &&
2423 (!elm_object_item_disabled_get(eo_next)))
2424 break; 2415 break;
2425 eo_next = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next)); 2416 eo_next = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next));
2426 } 2417 }
@@ -2472,8 +2463,7 @@ _item_single_select_up(Elm_Genlist_Data *sd)
2472 2463
2473 while (prev) 2464 while (prev)
2474 { 2465 {
2475 if ((prev->generation == sd->generation) && 2466 if ((!_is_no_select(prev)) &&
2476 (!_is_no_select(prev)) &&
2477 (!elm_object_item_disabled_get(EO_OBJ(prev)))) 2467 (!elm_object_item_disabled_get(EO_OBJ(prev))))
2478 break; 2468 break;
2479 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); 2469 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
@@ -2503,8 +2493,7 @@ _item_single_select_down(Elm_Genlist_Data *sd)
2503 2493
2504 while ((next)) 2494 while ((next))
2505 { 2495 {
2506 if ((next->generation == sd->generation) && 2496 if ((!_is_no_select(next)) &&
2507 (!_is_no_select(next)) &&
2508 (!elm_object_item_disabled_get(EO_OBJ(next)))) 2497 (!elm_object_item_disabled_get(EO_OBJ(next))))
2509 break; 2498 break;
2510 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 2499 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
@@ -2527,9 +2516,6 @@ _elm_genlist_item_focused(Elm_Object_Item *eo_it)
2527 ELM_GENLIST_DATA_GET(obj, sd); 2516 ELM_GENLIST_DATA_GET(obj, sd);
2528 const char *focus_raise; 2517 const char *focus_raise;
2529 2518
2530 if (it->generation < sd->generation)
2531 return;
2532
2533 if (_is_no_select(it) || 2519 if (_is_no_select(it) ||
2534 (eo_it == sd->focused_item) || 2520 (eo_it == sd->focused_item) ||
2535 (eo_do(eo_it, elm_wdg_item_disabled_get()))) 2521 (eo_do(eo_it, elm_wdg_item_disabled_get())))
@@ -2569,9 +2555,6 @@ _elm_genlist_item_unfocused(Elm_Object_Item *eo_it)
2569 Evas_Object *obj = WIDGET(it); 2555 Evas_Object *obj = WIDGET(it);
2570 ELM_GENLIST_DATA_GET(obj, sd); 2556 ELM_GENLIST_DATA_GET(obj, sd);
2571 2557
2572 if (it->generation < sd->generation)
2573 return;
2574
2575 if (_is_no_select(it)) 2558 if (_is_no_select(it))
2576 return; 2559 return;
2577 2560
@@ -2608,7 +2591,6 @@ _item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir)
2608 return EINA_FALSE; 2591 return EINA_FALSE;
2609 2592
2610 while ((next) && 2593 while ((next) &&
2611 (next->generation < sd->generation) &&
2612 (!eo_do(EO_OBJ(next), elm_wdg_item_disabled_get()))) 2594 (!eo_do(EO_OBJ(next), elm_wdg_item_disabled_get())))
2613 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 2595 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
2614 } 2596 }
@@ -3341,7 +3323,6 @@ _item_highlight(Elm_Gen_Item *it)
3341 3323
3342 if (_is_no_select(it) || 3324 if (_is_no_select(it) ||
3343 (!sd->highlight) || 3325 (!sd->highlight) ||
3344 (it->generation < sd->generation) ||
3345 (it->highlighted) || eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) || 3326 (it->highlighted) || eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) ||
3346 (it->item->deco_it_view)) 3327 (it->item->deco_it_view))
3347 return; 3328 return;
@@ -3367,8 +3348,7 @@ _item_unhighlight(Elm_Gen_Item *it)
3367{ 3348{
3368 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 3349 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3369 3350
3370 if ((it->generation < GL_IT(it)->wsd->generation) || (!it->highlighted)) 3351 if (!it->highlighted) return;
3371 return;
3372 3352
3373 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm"); 3353 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm");
3374 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it)); 3354 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it));
@@ -3554,11 +3534,6 @@ _elm_genlist_item_del_not_serious(Elm_Gen_Item *it)
3554 Elm_Object_Item *eo_it = EO_OBJ(it); 3534 Elm_Object_Item *eo_it = EO_OBJ(it);
3555 3535
3556 eo_do(eo_it, elm_wdg_item_pre_notify_del()); 3536 eo_do(eo_it, elm_wdg_item_pre_notify_del());
3557 it->generation = sd->generation - 1; /* This means that
3558 * the item is
3559 * deleted */
3560
3561 if (it->walking > 0) return;
3562 3537
3563 if (it->selected) 3538 if (it->selected)
3564 { 3539 {
@@ -3587,7 +3562,6 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
3587 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it)); 3562 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
3588 if (it->tooltip.del_cb) 3563 if (it->tooltip.del_cb)
3589 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it); 3564 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
3590 sd->walking -= it->walking;
3591 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 3565 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
3592 if (GL_IT(it)->type == ELM_GENLIST_ITEM_GROUP) 3566 if (GL_IT(it)->type == ELM_GENLIST_ITEM_GROUP)
3593 sd->group_items = eina_list_remove(sd->group_items, it); 3567 sd->group_items = eina_list_remove(sd->group_items, it);
@@ -3659,7 +3633,6 @@ _item_unselect(Elm_Gen_Item *it)
3659{ 3633{
3660 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 3634 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3661 3635
3662 if ((it->generation < sd->generation)) return;
3663 it->unhighlight_cb(it); /* unhighlight the item first */ 3636 it->unhighlight_cb(it); /* unhighlight the item first */
3664 if (!it->selected) return; /* then check whether the item is selected */ 3637 if (!it->selected) return; /* then check whether the item is selected */
3665 3638
@@ -4800,19 +4773,6 @@ _item_mouse_up_cb(void *data,
4800 4773
4801 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 4774 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
4802 4775
4803 it->walking++;
4804 sd->walking++;
4805 if (sd->focused_item != EO_OBJ(it))
4806 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
4807 it->walking--;
4808 sd->walking--;
4809
4810 if ((sd->clear_me) && (!sd->walking))
4811 {
4812 _internal_elm_genlist_clear(WIDGET(it), EINA_TRUE);
4813 return;
4814 }
4815
4816 if (sd->multi && 4776 if (sd->multi &&
4817 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) || 4777 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
4818 (evas_key_modifier_is_set(ev->modifiers, "Control")))) 4778 (evas_key_modifier_is_set(ev->modifiers, "Control"))))
@@ -4851,6 +4811,9 @@ _item_mouse_up_cb(void *data,
4851 it->highlight_cb(it); 4811 it->highlight_cb(it);
4852 it->sel_cb(it); 4812 it->sel_cb(it);
4853 } 4813 }
4814
4815 if (sd->focused_item != EO_OBJ(it))
4816 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
4854} 4817}
4855 4818
4856static void 4819static void
@@ -4943,8 +4906,7 @@ _decorate_item_finished_signal_cb(void *data,
4943 4906
4944 te = evas_object_evas_get(obj); 4907 te = evas_object_evas_get(obj);
4945 4908
4946 if ((it->generation < sd->generation) || (!it->realized) 4909 if ((!it->realized) || (!it->item->deco_it_view)) return;
4947 || (!it->item->deco_it_view)) return;
4948 4910
4949 evas_event_freeze(te); 4911 evas_event_freeze(te);
4950 it->item->nocache_once = EINA_FALSE; 4912 it->item->nocache_once = EINA_FALSE;
@@ -5011,7 +4973,6 @@ _item_block_recalc(Item_Block *itb,
5011 EINA_LIST_FOREACH(itb->items, l, it) 4973 EINA_LIST_FOREACH(itb->items, l, it)
5012 { 4974 {
5013 sd = GL_IT(it)->wsd; 4975 sd = GL_IT(it)->wsd;
5014 if (it->generation < sd->generation) continue;
5015 show_me |= it->item->show_me; 4976 show_me |= it->item->show_me;
5016 if (!itb->realized) 4977 if (!itb->realized)
5017 { 4978 {
@@ -5290,8 +5251,7 @@ _decorate_item_realize(Elm_Gen_Item *it)
5290 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 5251 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
5291 Evas_Object *obj = sd->obj; 5252 Evas_Object *obj = sd->obj;
5292 5253
5293 if ((it->item->deco_it_view) || (it->generation < 5254 if (it->item->deco_it_view) return;
5294 sd->generation)) return;
5295 5255
5296 evas_event_freeze(evas_object_evas_get(obj)); 5256 evas_event_freeze(evas_object_evas_get(obj));
5297 it->item->deco_it_view = _view_create(it, it->itc->decorate_item_style); 5257 it->item->deco_it_view = _view_create(it, it->itc->decorate_item_style);
@@ -5464,8 +5424,6 @@ _elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv)
5464 elm_widget_can_focus_set(obj, EINA_TRUE); 5424 elm_widget_can_focus_set(obj, EINA_TRUE);
5465 elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL); 5425 elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL);
5466 5426
5467 priv->generation = 1;
5468
5469 if (!elm_layout_theme_set 5427 if (!elm_layout_theme_set
5470 (obj, "genlist", "base", elm_widget_style_get(obj))) 5428 (obj, "genlist", "base", elm_widget_style_get(obj)))
5471 CRI("Failed to set layout!"); 5429 CRI("Failed to set layout!");
@@ -5631,45 +5589,25 @@ _elm_genlist_eo_base_constructor(Eo *obj, Elm_Genlist_Data *sd)
5631} 5589}
5632 5590
5633static void 5591static void
5634_internal_elm_genlist_clear(Evas_Object *obj, 5592_internal_elm_genlist_clear(Evas_Object *obj)
5635 Eina_Bool standby)
5636{ 5593{
5637 Eina_Inlist *next, *l; 5594 Eina_Inlist *next, *l;
5638 5595
5639 ELM_GENLIST_DATA_GET(obj, sd); 5596 ELM_GENLIST_DATA_GET(obj, sd);
5640 5597
5641 if (!standby) sd->generation++;
5642
5643 _elm_genlist_item_unfocused(sd->focused_item); 5598 _elm_genlist_item_unfocused(sd->focused_item);
5644 if (sd->mode_item) sd->mode_item = NULL; 5599 if (sd->mode_item) sd->mode_item = NULL;
5645 5600
5646 ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free); 5601 ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free);
5647 5602
5648 if (sd->walking > 0)
5649 {
5650 sd->clear_me = EINA_TRUE;
5651 return;
5652 }
5653
5654 evas_event_freeze(evas_object_evas_get(sd->obj)); 5603 evas_event_freeze(evas_object_evas_get(sd->obj));
5655 for (l = sd->items, next = l ? l->next : NULL; 5604 for (l = sd->items, next = l ? l->next : NULL;
5656 l; 5605 l;
5657 l = next, next = next ? next->next : NULL) 5606 l = next, next = next ? next->next : NULL)
5658 { 5607 {
5659 Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l); 5608 Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
5660 5609 eo_do(EO_OBJ(it), elm_wdg_item_del());
5661 if (it->generation < sd->generation)
5662 {
5663 Elm_Gen_Item *itn = NULL;
5664
5665 if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
5666 if (itn) itn->walking++; /* prevent early death of subitem */
5667 it->del_cb(it);
5668 eo_del(EO_OBJ(it));
5669 if (itn) itn->walking--;
5670 }
5671 } 5610 }
5672 sd->clear_me = EINA_FALSE;
5673 sd->pan_changed = EINA_TRUE; 5611 sd->pan_changed = EINA_TRUE;
5674 if (!sd->queue) 5612 if (!sd->queue)
5675 { 5613 {
@@ -5714,11 +5652,7 @@ _item_select(Elm_Gen_Item *it)
5714 Elm_Object_Item *eo_it = EO_OBJ(it); 5652 Elm_Object_Item *eo_it = EO_OBJ(it);
5715 5653
5716 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return; 5654 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return;
5717 5655 if (_is_no_select(it) || (it->decorate_it_set)) return;
5718 if (_is_no_select(it) ||
5719 (it->generation < sd->generation) ||
5720 (it->decorate_it_set))
5721 return;
5722 5656
5723 if (!sd->multi) 5657 if (!sd->multi)
5724 { 5658 {
@@ -5739,15 +5673,12 @@ _item_select(Elm_Gen_Item *it)
5739 } 5673 }
5740 5674
5741 evas_object_ref(obj); 5675 evas_object_ref(obj);
5742 it->walking++;
5743 sd->walking++;
5744 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); 5676 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it);
5745 if (it->generation == sd->generation) 5677 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it);
5746 { 5678 elm_object_item_focus_set(eo_it, EINA_TRUE);
5747 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it); 5679 _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
5748 elm_object_item_focus_set(eo_it, EINA_TRUE); 5680
5749 _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS); 5681 sd->last_selected_item = eo_it;
5750 }
5751 5682
5752 if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable)) 5683 if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
5753 { 5684 {
@@ -5764,21 +5695,6 @@ _item_select(Elm_Gen_Item *it)
5764 } 5695 }
5765 } 5696 }
5766 5697
5767 it->walking--;
5768 sd->walking--;
5769 if ((sd->clear_me) && (!sd->walking))
5770 _internal_elm_genlist_clear(WIDGET(it), EINA_TRUE);
5771 else
5772 {
5773 if ((!it->walking) && (it->generation < sd->generation))
5774 {
5775 it->del_cb(it);
5776 eo_del(eo_it);
5777 }
5778 else
5779 sd->last_selected_item = eo_it;
5780 }
5781
5782 evas_object_unref(obj); 5698 evas_object_unref(obj);
5783} 5699}
5784 5700
@@ -5825,8 +5741,6 @@ _elm_genlist_item_elm_widget_item_disable(Eo *eo_it, Elm_Gen_Item *it)
5825 Eina_List *l; 5741 Eina_List *l;
5826 Evas_Object *obj; 5742 Evas_Object *obj;
5827 5743
5828 if (it->generation < GL_IT(it)->wsd->generation) return;
5829
5830 _item_unselect(it); 5744 _item_unselect(it);
5831 if (eo_it == GL_IT(it)->wsd->focused_item) 5745 if (eo_it == GL_IT(it)->wsd->focused_item)
5832 _elm_genlist_item_unfocused(eo_it); 5746 _elm_genlist_item_unfocused(eo_it);
@@ -5858,39 +5772,35 @@ _elm_genlist_item_elm_widget_item_del_pre(Eo *eo_it, Elm_Gen_Item *it)
5858{ 5772{
5859 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 5773 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
5860 5774
5861 if (it->walking > 0) 5775 // FIXME: relative will be better to be fixed. it is too harsh.
5776 if (it->item->rel)
5862 { 5777 {
5863 // FIXME: relative will be better to be fixed. it is too harsh. 5778 it->item->rel->item->rel_revs =
5864 if (it->item->rel) 5779 eina_list_remove(it->item->rel->item->rel_revs, it);
5865 { 5780 it->item->rel = NULL;
5866 it->item->rel->item->rel_revs = 5781 }
5867 eina_list_remove(it->item->rel->item->rel_revs, it); 5782 if (it->item->rel_revs)
5868 it->item->rel = NULL; 5783 {
5869 } 5784 Elm_Gen_Item *tmp;
5870 if (it->item->rel_revs) 5785 EINA_LIST_FREE(it->item->rel_revs, tmp) tmp->item->rel = NULL;
5871 { 5786 }
5872 Elm_Gen_Item *tmp; 5787 elm_genlist_item_subitems_clear(eo_it);
5873 EINA_LIST_FREE(it->item->rel_revs, tmp) tmp->item->rel = NULL; 5788 if (sd->show_item == it)
5874 } 5789 sd->show_item = NULL;
5875 elm_genlist_item_subitems_clear(eo_it);
5876 if (sd->show_item == it)
5877 sd->show_item = NULL;
5878 5790
5879 _elm_genlist_item_del_not_serious(it); 5791 _elm_genlist_item_del_not_serious(it);
5880 if (it->item->block) 5792 if (it->item->block)
5881 { 5793 {
5882 if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE); 5794 if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
5883 it->item->block->changed = EINA_TRUE; 5795 it->item->block->changed = EINA_TRUE;
5884 ecore_job_del(sd->calc_job); 5796 ecore_job_del(sd->calc_job);
5885 sd->calc_job = ecore_job_add(_calc_job, sd->obj); 5797 sd->calc_job = ecore_job_add(_calc_job, sd->obj);
5886 } 5798 }
5887 if (it->parent) 5799 if (it->parent)
5888 { 5800 {
5889 it->parent->item->items = 5801 it->parent->item->items =
5890 eina_list_remove(it->parent->item->items, eo_it); 5802 eina_list_remove(it->parent->item->items, eo_it);
5891 it->parent = NULL; 5803 it->parent = NULL;
5892 }
5893 return EINA_FALSE;
5894 } 5804 }
5895 5805
5896 _item_del(it); 5806 _item_del(it);
@@ -5974,7 +5884,6 @@ _elm_genlist_item_new(Elm_Genlist_Data *sd,
5974 if (!eo_it) return NULL; 5884 if (!eo_it) return NULL;
5975 ELM_GENLIST_ITEM_DATA_GET(eo_it, it); 5885 ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
5976 5886
5977 it->generation = sd->generation;
5978 it->itc = itc; 5887 it->itc = itc;
5979 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc); 5888 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
5980 5889
@@ -6359,7 +6268,7 @@ _elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist
6359EOLIAN static void 6268EOLIAN static void
6360_elm_genlist_clear(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED) 6269_elm_genlist_clear(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED)
6361{ 6270{
6362 _internal_elm_genlist_clear(obj, EINA_FALSE); 6271 _internal_elm_genlist_clear(obj);
6363} 6272}
6364 6273
6365EOLIAN static void 6274EOLIAN static void
@@ -6502,15 +6411,7 @@ _elm_genlist_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Evas_Coor
6502EOLIAN static Elm_Object_Item* 6411EOLIAN static Elm_Object_Item*
6503_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) 6412_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
6504{ 6413{
6505 Elm_Gen_Item *it; 6414 return EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(sd->items));
6506
6507 if (!sd->items) return NULL;
6508
6509 it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
6510 while ((it) && (it->generation < sd->generation))
6511 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
6512
6513 return EO_OBJ(it);
6514} 6415}
6515 6416
6516EOLIAN static Elm_Object_Item* 6417EOLIAN static Elm_Object_Item*
@@ -6521,8 +6422,6 @@ _elm_genlist_last_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
6521 if (!sd->items) return NULL; 6422 if (!sd->items) return NULL;
6522 6423
6523 it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); 6424 it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
6524 while ((it) && (it->generation < sd->generation))
6525 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
6526 6425
6527 return EO_OBJ(it); 6426 return EO_OBJ(it);
6528} 6427}
@@ -6533,7 +6432,7 @@ _elm_genlist_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6533 while (it) 6432 while (it)
6534 { 6433 {
6535 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 6434 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
6536 if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break; 6435 if (it) break;
6537 } 6436 }
6538 6437
6539 if (it) return EO_OBJ(it); 6438 if (it) return EO_OBJ(it);
@@ -6546,7 +6445,7 @@ _elm_genlist_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6546 while (it) 6445 while (it)
6547 { 6446 {
6548 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev); 6447 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
6549 if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break; 6448 if (it) break;
6550 } 6449 }
6551 6450
6552 if (it) return EO_OBJ(it); 6451 if (it) return EO_OBJ(it);
@@ -6607,10 +6506,8 @@ _elm_genlist_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
6607 Eina_Bool selected) 6506 Eina_Bool selected)
6608{ 6507{
6609 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6508 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6610 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6611 6509
6612 if ((it->generation < sd->generation) || 6510 if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return;
6613 eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return;
6614 6511
6615 selected = !!selected; 6512 selected = !!selected;
6616 if (it->selected == selected) return; 6513 if (it->selected == selected) return;
@@ -6778,7 +6675,6 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it,
6778 Evas_Coord gith = 0; 6675 Evas_Coord gith = 0;
6779 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 6676 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6780 6677
6781 if (it->generation < sd->generation) return EINA_FALSE;
6782 if ((sd->queue) || 6678 if ((sd->queue) ||
6783 (!((sd->homogeneous) && 6679 (!((sd->homogeneous) &&
6784 (sd->mode == ELM_LIST_COMPRESS)))) 6680 (sd->mode == ELM_LIST_COMPRESS))))
@@ -6833,7 +6729,6 @@ _elm_genlist_item_promote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6833{ 6729{
6834 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6730 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6835 6731
6836 if (it->generation < GL_IT(it)->wsd->generation) return;
6837 Elm_Object_Item *eo_first_item = elm_genlist_first_item_get(WIDGET(it)); 6732 Elm_Object_Item *eo_first_item = elm_genlist_first_item_get(WIDGET(it));
6838 ELM_GENLIST_ITEM_DATA_GET(eo_first_item, first_item); 6733 ELM_GENLIST_ITEM_DATA_GET(eo_first_item, first_item);
6839 _item_move_before(it, first_item); 6734 _item_move_before(it, first_item);
@@ -6843,7 +6738,6 @@ EOLIAN static void
6843_elm_genlist_item_demote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it) 6738_elm_genlist_item_demote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6844{ 6739{
6845 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6740 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6846 if (it->generation < GL_IT(it)->wsd->generation) return;
6847 Elm_Object_Item *eo_last_item = elm_genlist_last_item_get(WIDGET(it)); 6741 Elm_Object_Item *eo_last_item = elm_genlist_last_item_get(WIDGET(it));
6848 ELM_GENLIST_ITEM_DATA_GET(eo_last_item, last_item); 6742 ELM_GENLIST_ITEM_DATA_GET(eo_last_item, last_item);
6849 _item_move_after(it, last_item); 6743 _item_move_after(it, last_item);
@@ -6897,7 +6791,6 @@ _elm_genlist_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
6897 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 6791 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6898 6792
6899 if (!it->item->block) return; 6793 if (!it->item->block) return;
6900 if (it->generation < sd->generation) return;
6901 it->item->mincalcd = EINA_FALSE; 6794 it->item->mincalcd = EINA_FALSE;
6902 it->item->updateme = EINA_TRUE; 6795 it->item->updateme = EINA_TRUE;
6903 it->item->block->updateme = EINA_TRUE; 6796 it->item->block->updateme = EINA_TRUE;
@@ -6913,7 +6806,6 @@ _elm_genlist_item_fields_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
6913 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6806 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6914 6807
6915 if (!it->item->block) return; 6808 if (!it->item->block) return;
6916 if (it->generation < GL_IT(it)->wsd->generation) return;
6917 6809
6918 if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT)) 6810 if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT))
6919 { 6811 {
@@ -6968,7 +6860,6 @@ _elm_genlist_item_item_class_update(Eo *eo_it, Elm_Gen_Item *it,
6968 EINA_SAFETY_ON_NULL_RETURN(itc); 6860 EINA_SAFETY_ON_NULL_RETURN(itc);
6969 it->itc = itc; 6861 it->itc = itc;
6970 if (!it->item->block) return; 6862 if (!it->item->block) return;
6971 if (it->generation < GL_IT(it)->wsd->generation) return;
6972 it->item->nocache_once = EINA_TRUE; 6863 it->item->nocache_once = EINA_TRUE;
6973 6864
6974 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free); 6865 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free);
@@ -6980,7 +6871,6 @@ EOLIAN static const Elm_Genlist_Item_Class *
6980_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it) 6871_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
6981{ 6872{
6982 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL); 6873 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
6983 if (it->generation < GL_IT(it)->wsd->generation) return NULL;
6984 6874
6985 return it->itc; 6875 return it->itc;
6986} 6876}
@@ -7383,8 +7273,7 @@ _elm_genlist_item_decorate_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
7383 sd = GL_IT(it)->wsd; 7273 sd = GL_IT(it)->wsd;
7384 7274
7385 if (!decorate_it_type) return; 7275 if (!decorate_it_type) return;
7386 if ((it->generation < sd->generation) || 7276 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return;
7387 eo_do(eo_it, elm_wdg_item_disabled_get())) return;
7388 if (sd->decorate_all_mode) return; 7277 if (sd->decorate_all_mode) return;
7389 7278
7390 if ((sd->mode_item == it) && 7279 if ((sd->mode_item == it) &&
@@ -7702,8 +7591,6 @@ _elm_genlist_item_select_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
7702 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 7591 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
7703 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 7592 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
7704 7593
7705 if (it->generation < sd->generation) return;
7706
7707 if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (it->select_mode == mode)) 7594 if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (it->select_mode == mode))
7708 return; 7595 return;
7709 7596
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index 520b6429b..dd9601928 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -812,8 +812,6 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
812 * @see elm_widget_item_internal_del() 812 * @see elm_widget_item_internal_del()
813 * @param item a valid item. 813 * @param item a valid item.
814 */ 814 */
815#define elm_widget_item_del(item) \
816 _elm_widget_item_internal_del(item)
817#define elm_widget_item_pre_notify_del(item) \ 815#define elm_widget_item_pre_notify_del(item) \
818 elm_widget_item_internal_pre_notify_del(item) 816 elm_widget_item_internal_pre_notify_del(item)
819#define elm_widget_item_del_cb_set(item, del_cb) \ 817#define elm_widget_item_del_cb_set(item, del_cb) \
diff --git a/src/lib/elm_widget_genlist.h b/src/lib/elm_widget_genlist.h
index 9c44e33b3..477dbde04 100644
--- a/src/lib/elm_widget_genlist.h
+++ b/src/lib/elm_widget_genlist.h
@@ -123,9 +123,6 @@ struct _Elm_Genlist_Data
123 * default. this can be changed by 123 * default. this can be changed by
124 * elm_genlist_longpress_timeout_set() */ 124 * elm_genlist_longpress_timeout_set() */
125 double longpress_timeout; 125 double longpress_timeout;
126 /* a generation of genlist. when genlist is cleared, this value
127 * will be increased and a new generation will start */
128 int generation;
129 Eina_Compare_Cb item_compare_cb; 126 Eina_Compare_Cb item_compare_cb;
130 Eina_Compare_Cb item_compare_data_cb; 127 Eina_Compare_Cb item_compare_data_cb;
131 128
@@ -177,9 +174,6 @@ struct _Elm_Genlist_Data
177 Eina_Bool on_sub_del : 1; 174 Eina_Bool on_sub_del : 1;
178 175
179 Eina_Bool highlight : 1; 176 Eina_Bool highlight : 1;
180 /* a flag whether genlist is marked as to be cleared or not. if
181 * this flag is true, genlist clear was already deferred. */
182 Eina_Bool clear_me : 1;
183 Eina_Bool h_bounce : 1; 177 Eina_Bool h_bounce : 1;
184 Eina_Bool v_bounce : 1; 178 Eina_Bool v_bounce : 1;
185 Eina_Bool bring_in : 1; /* a flag to 179 Eina_Bool bring_in : 1; /* a flag to