diff options
Diffstat (limited to 'src/lib/elementary/elm_genlist.c')
-rw-r--r-- | src/lib/elementary/elm_genlist.c | 175 |
1 files changed, 97 insertions, 78 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 182de48..b84e830 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c | |||
@@ -101,7 +101,6 @@ | |||
101 | cmd(SIG_ITEM_UNFOCUSED, "item,unfocused", "") \ | 101 | cmd(SIG_ITEM_UNFOCUSED, "item,unfocused", "") \ |
102 | cmd(SIG_PRESSED, "pressed", "") \ | 102 | cmd(SIG_PRESSED, "pressed", "") \ |
103 | cmd(SIG_RELEASED, "released", "") \ | 103 | cmd(SIG_RELEASED, "released", "") \ |
104 | cmd(SIG_CHANGED, "changed", "") \ | ||
105 | cmd(SIG_FILTER_DONE, "filter,done", "") | 104 | cmd(SIG_FILTER_DONE, "filter,done", "") |
106 | 105 | ||
107 | ELM_PRIV_GENLIST_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); | 106 | ELM_PRIV_GENLIST_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); |
@@ -167,7 +166,7 @@ static void _access_activate_cb(void *data EINA_UNUSED, | |||
167 | Elm_Object_Item *item); | 166 | Elm_Object_Item *item); |
168 | static void _decorate_item_set(Elm_Gen_Item *); | 167 | static void _decorate_item_set(Elm_Gen_Item *); |
169 | static void _internal_elm_genlist_clear(Evas_Object *obj); | 168 | static void _internal_elm_genlist_clear(Evas_Object *obj); |
170 | static Eina_Bool _item_filtered_get(Elm_Gen_Item *it); | 169 | static Eina_Bool _item_filtered_get(Elm_Gen_Item *it, Elm_Genlist_Data *sd); |
171 | 170 | ||
172 | static void _elm_genlist_tree_effect_stop(Elm_Genlist_Data *sd); | 171 | static void _elm_genlist_tree_effect_stop(Elm_Genlist_Data *sd); |
173 | static Eina_Bool _elm_genlist_tree_effect_setup(Elm_Genlist_Data *sd); | 172 | static Eina_Bool _elm_genlist_tree_effect_setup(Elm_Genlist_Data *sd); |
@@ -184,14 +183,6 @@ static const Elm_Action key_actions[] = { | |||
184 | {NULL, NULL} | 183 | {NULL, NULL} |
185 | }; | 184 | }; |
186 | 185 | ||
187 | static inline void | ||
188 | _add_calc_job(Elm_Genlist_Data *sd) | ||
189 | { | ||
190 | ELM_SAFE_FREE(sd->calc_job, ecore_job_del); | ||
191 | if (!efl_alive_get(sd->obj)) return; | ||
192 | sd->calc_job = ecore_job_add(_calc_job, sd->obj); | ||
193 | } | ||
194 | |||
195 | static void | 186 | static void |
196 | _size_cache_free(void *data) | 187 | _size_cache_free(void *data) |
197 | { | 188 | { |
@@ -297,7 +288,6 @@ _elm_genlist_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Pan_Data *psd, | |||
297 | 288 | ||
298 | psd->wsd->pan_changed = EINA_TRUE; | 289 | psd->wsd->pan_changed = EINA_TRUE; |
299 | evas_object_smart_changed(obj); | 290 | evas_object_smart_changed(obj); |
300 | ELM_SAFE_FREE(psd->wsd->calc_job, ecore_job_del); | ||
301 | } | 291 | } |
302 | 292 | ||
303 | static void | 293 | static void |
@@ -333,9 +323,7 @@ _elm_genlist_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Ein | |||
333 | // away or appeared to queue a job to deal with it. it should settle in | 323 | // away or appeared to queue a job to deal with it. it should settle in |
334 | // the end to a steady-state | 324 | // the end to a steady-state |
335 | if (old.w != size.w) | 325 | if (old.w != size.w) |
336 | _add_calc_job(sd); | 326 | efl_canvas_group_change(sd->obj); |
337 | else | ||
338 | ELM_SAFE_FREE(sd->calc_job, ecore_job_del); | ||
339 | 327 | ||
340 | super: | 328 | super: |
341 | efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), size); | 329 | efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), size); |
@@ -481,7 +469,8 @@ _item_content_realize(Elm_Gen_Item *it, | |||
481 | 469 | ||
482 | if (elm_widget_is(content)) | 470 | if (elm_widget_is(content)) |
483 | { | 471 | { |
484 | if (!calc) | 472 | elm_widget_tree_unfocusable_set(content, it->item->unfocusable); |
473 | if (!calc && (!it->item->unfocusable)) | ||
485 | _elm_widget_full_eval(content); | 474 | _elm_widget_full_eval(content); |
486 | } | 475 | } |
487 | } | 476 | } |
@@ -784,7 +773,7 @@ _must_recalc_idler(void *data) | |||
784 | { | 773 | { |
785 | ELM_GENLIST_DATA_GET(data, sd); | 774 | ELM_GENLIST_DATA_GET(data, sd); |
786 | 775 | ||
787 | _add_calc_job(sd); | 776 | efl_canvas_group_change(sd->obj); |
788 | sd->must_recalc_idler = NULL; | 777 | sd->must_recalc_idler = NULL; |
789 | return ECORE_CALLBACK_CANCEL; | 778 | return ECORE_CALLBACK_CANCEL; |
790 | } | 779 | } |
@@ -794,12 +783,13 @@ _calc_job(void *data) | |||
794 | { | 783 | { |
795 | int in = 0; | 784 | int in = 0; |
796 | Item_Block *itb, *chb = NULL; | 785 | Item_Block *itb, *chb = NULL; |
797 | ELM_GENLIST_DATA_GET(data, sd); | 786 | Elm_Genlist_Data *sd = data; |
798 | Eina_Bool minw_change = EINA_FALSE; | 787 | Eina_Bool minw_change = EINA_FALSE; |
799 | Eina_Bool did_must_recalc = EINA_FALSE; | 788 | Eina_Bool did_must_recalc = EINA_FALSE; |
800 | Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0; | 789 | Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0; |
801 | Evas *e; | 790 | Evas *e; |
802 | 791 | ||
792 | sd->need_calc = EINA_FALSE; | ||
803 | evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h); | 793 | evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h); |
804 | if (sd->mode == ELM_LIST_COMPRESS) | 794 | if (sd->mode == ELM_LIST_COMPRESS) |
805 | elm_interface_scrollable_content_viewport_geometry_get | 795 | elm_interface_scrollable_content_viewport_geometry_get |
@@ -906,7 +896,7 @@ _calc_job(void *data) | |||
906 | if (did_must_recalc) | 896 | if (did_must_recalc) |
907 | { | 897 | { |
908 | if (!sd->must_recalc_idler) | 898 | if (!sd->must_recalc_idler) |
909 | sd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, data); | 899 | sd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, sd->obj); |
910 | } | 900 | } |
911 | if (!sd->show_item) sd->check_scroll = EINA_FALSE; | 901 | if (!sd->show_item) sd->check_scroll = EINA_FALSE; |
912 | if (sd->check_scroll) | 902 | if (sd->check_scroll) |
@@ -918,7 +908,6 @@ _calc_job(void *data) | |||
918 | _item_scroll(sd); | 908 | _item_scroll(sd); |
919 | } | 909 | } |
920 | 910 | ||
921 | sd->calc_job = NULL; | ||
922 | evas_object_smart_changed(sd->pan_obj); | 911 | evas_object_smart_changed(sd->pan_obj); |
923 | evas_event_thaw(e); | 912 | evas_event_thaw(e); |
924 | evas_event_thaw_eval(e); | 913 | evas_event_thaw_eval(e); |
@@ -957,11 +946,15 @@ _elm_genlist_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Data *sd) | |||
957 | { | 946 | { |
958 | itb->must_recalc = EINA_TRUE; | 947 | itb->must_recalc = EINA_TRUE; |
959 | } | 948 | } |
960 | _add_calc_job(sd); | 949 | sd->need_calc = EINA_TRUE; |
961 | } | 950 | } |
962 | minw = vmw; | 951 | minw = vmw; |
963 | minh = vmh; | 952 | minh = vmh; |
964 | } | 953 | } |
954 | else | ||
955 | sd->need_calc = EINA_TRUE; | ||
956 | if (sd->need_calc) | ||
957 | _calc_job(sd); | ||
965 | 958 | ||
966 | if (sd->scr_minw) | 959 | if (sd->scr_minw) |
967 | { | 960 | { |
@@ -1052,22 +1045,26 @@ _item_tree_effect_before(Elm_Gen_Item *it) | |||
1052 | return ECORE_CALLBACK_CANCEL; | 1045 | return ECORE_CALLBACK_CANCEL; |
1053 | } | 1046 | } |
1054 | 1047 | ||
1055 | static void | 1048 | /* returns true if change occurred */ |
1049 | static Eina_Bool | ||
1056 | _item_position(Elm_Gen_Item *it, | 1050 | _item_position(Elm_Gen_Item *it, |
1057 | Evas_Object *view, | 1051 | Evas_Object *view, |
1058 | Evas_Coord it_x, | 1052 | Evas_Coord it_x, |
1059 | Evas_Coord it_y) | 1053 | Evas_Coord it_y) |
1060 | { | 1054 | { |
1061 | if (!it) return; | 1055 | Eina_Position2D pos; |
1062 | if (!view) return; | 1056 | if (!it) return EINA_FALSE; |
1057 | if (!view) return EINA_FALSE; | ||
1063 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); | 1058 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); |
1064 | Evas *e = evas_object_evas_get(sd->obj); | 1059 | Evas *e = evas_object_evas_get(sd->obj); |
1065 | 1060 | ||
1066 | evas_event_freeze(e); | 1061 | evas_event_freeze(e); |
1062 | pos = efl_gfx_entity_position_get(view); | ||
1067 | efl_gfx_entity_geometry_set(view, EINA_RECT(it_x, it_y, it->item->w, it->item->h)); | 1063 | efl_gfx_entity_geometry_set(view, EINA_RECT(it_x, it_y, it->item->w, it->item->h)); |
1068 | evas_object_show(view); | 1064 | evas_object_show(view); |
1069 | evas_event_thaw(e); | 1065 | evas_event_thaw(e); |
1070 | evas_event_thaw_eval(e); | 1066 | evas_event_thaw_eval(e); |
1067 | return (pos.x != it_x) || (pos.y != it_y); | ||
1071 | } | 1068 | } |
1072 | 1069 | ||
1073 | static void | 1070 | static void |
@@ -1704,7 +1701,11 @@ _item_cache_find(Elm_Gen_Item *it) | |||
1704 | efl_wref_del(itc->base_view, &itc->base_view); | 1701 | efl_wref_del(itc->base_view, &itc->base_view); |
1705 | itc->base_view = NULL; | 1702 | itc->base_view = NULL; |
1706 | EINA_LIST_FREE(itc->contents, obj) | 1703 | EINA_LIST_FREE(itc->contents, obj) |
1707 | elm_widget_tree_unfocusable_set(obj, EINA_FALSE); | 1704 | { |
1705 | if (elm_widget_is(obj)) | ||
1706 | elm_widget_tree_unfocusable_set(obj, it->item->unfocusable); | ||
1707 | evas_object_show(obj); | ||
1708 | } | ||
1708 | itc->contents = NULL; | 1709 | itc->contents = NULL; |
1709 | _item_cache_free(itc); | 1710 | _item_cache_free(itc); |
1710 | return EINA_TRUE; | 1711 | return EINA_TRUE; |
@@ -1722,7 +1723,8 @@ _content_cache_add(Elm_Gen_Item *it, Eina_List **cache) | |||
1722 | { | 1723 | { |
1723 | *cache = eina_list_append(*cache, content); | 1724 | *cache = eina_list_append(*cache, content); |
1724 | eina_hash_del_by_key(pd->content_item_map, &content); | 1725 | eina_hash_del_by_key(pd->content_item_map, &content); |
1725 | elm_widget_tree_unfocusable_set(content, EINA_TRUE); | 1726 | if (elm_widget_is(content)) elm_widget_tree_unfocusable_set(content, EINA_TRUE); |
1727 | evas_object_hide(content); | ||
1726 | } | 1728 | } |
1727 | 1729 | ||
1728 | return *cache; | 1730 | return *cache; |
@@ -2429,8 +2431,8 @@ _item_block_position(Item_Block *itb, const int blk_idx) | |||
2429 | sd = it->item->wsd; | 2431 | sd = it->item->wsd; |
2430 | if (sd->reorder_it == it) continue; | 2432 | if (sd->reorder_it == it) continue; |
2431 | 2433 | ||
2432 | if (!it->filtered && sd->filter_data && it->itc->func.filter_get) | 2434 | if (it->itc->func.filter_get) |
2433 | _item_filtered_get(it); | 2435 | _item_filtered_get(it, sd); |
2434 | if (it->hide) | 2436 | if (it->hide) |
2435 | { | 2437 | { |
2436 | if (it->realized) evas_object_hide(VIEW(it)); | 2438 | if (it->realized) evas_object_hide(VIEW(it)); |
@@ -2622,9 +2624,7 @@ _elm_genlist_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Pan_Data | |||
2622 | 2624 | ||
2623 | if (sd->pan_changed) | 2625 | if (sd->pan_changed) |
2624 | { | 2626 | { |
2625 | ecore_job_del(sd->calc_job); | 2627 | _calc_job(sd); |
2626 | sd->calc_job = NULL; | ||
2627 | _calc_job(sd->obj); | ||
2628 | sd->pan_changed = EINA_FALSE; | 2628 | sd->pan_changed = EINA_FALSE; |
2629 | } | 2629 | } |
2630 | 2630 | ||
@@ -3562,6 +3562,7 @@ _elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd) | |||
3562 | int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); | 3562 | int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); |
3563 | if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; | 3563 | if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; |
3564 | 3564 | ||
3565 | elm_interface_scrollable_reset_signals(obj); | ||
3565 | e = evas_object_evas_get(obj); | 3566 | e = evas_object_evas_get(obj); |
3566 | evas_event_freeze(e); | 3567 | evas_event_freeze(e); |
3567 | _mirrored_set(obj, efl_ui_mirrored_get(obj)); | 3568 | _mirrored_set(obj, efl_ui_mirrored_get(obj)); |
@@ -3577,8 +3578,8 @@ _elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd) | |||
3577 | 3578 | ||
3578 | itb->changed = EINA_TRUE; | 3579 | itb->changed = EINA_TRUE; |
3579 | } | 3580 | } |
3580 | if (sd->obj) | 3581 | if (sd->obj && efl_finalized_get(obj)) |
3581 | _add_calc_job(sd); | 3582 | efl_canvas_group_change(sd->obj); |
3582 | elm_layout_sizing_eval(obj); | 3583 | elm_layout_sizing_eval(obj); |
3583 | evas_event_thaw(e); | 3584 | evas_event_thaw(e); |
3584 | evas_event_thaw_eval(e); | 3585 | evas_event_thaw_eval(e); |
@@ -3700,7 +3701,9 @@ _item_block_del(Elm_Gen_Item *it) | |||
3700 | itb->items = eina_list_remove(itb->items, it); | 3701 | itb->items = eina_list_remove(itb->items, it); |
3701 | itb->count--; | 3702 | itb->count--; |
3702 | itb->changed = EINA_TRUE; | 3703 | itb->changed = EINA_TRUE; |
3703 | _add_calc_job(sd); | 3704 | efl_canvas_group_change(sd->pan_obj); |
3705 | efl_canvas_group_change(sd->obj); | ||
3706 | if (itb->realized) efl_ui_focus_manager_calc_unregister(itb->sd->obj, EO_OBJ(it)); | ||
3704 | if (itb->count < 1) | 3707 | if (itb->count < 1) |
3705 | { | 3708 | { |
3706 | Item_Block *itbn; | 3709 | Item_Block *itbn; |
@@ -3768,8 +3771,6 @@ _item_block_del(Elm_Gen_Item *it) | |||
3768 | { | 3771 | { |
3769 | sd->pan_changed = EINA_TRUE; | 3772 | sd->pan_changed = EINA_TRUE; |
3770 | evas_object_smart_changed(sd->pan_obj); | 3773 | evas_object_smart_changed(sd->pan_obj); |
3771 | ecore_job_del(sd->calc_job); | ||
3772 | sd->calc_job = NULL; | ||
3773 | } | 3774 | } |
3774 | } | 3775 | } |
3775 | 3776 | ||
@@ -3848,7 +3849,8 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it) | |||
3848 | sd->group_items = eina_list_remove(sd->group_items, it); | 3849 | sd->group_items = eina_list_remove(sd->group_items, it); |
3849 | 3850 | ||
3850 | ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free); | 3851 | ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free); |
3851 | _add_calc_job(sd); | 3852 | efl_canvas_group_change(sd->pan_obj); |
3853 | efl_canvas_group_change(sd->obj); | ||
3852 | 3854 | ||
3853 | ELM_SAFE_FREE(it->item, free); | 3855 | ELM_SAFE_FREE(it->item, free); |
3854 | } | 3856 | } |
@@ -4016,8 +4018,7 @@ _item_mouse_move_cb(void *data, | |||
4016 | sd->movements++; | 4018 | sd->movements++; |
4017 | } | 4019 | } |
4018 | ELM_SAFE_FREE(it->long_timer, ecore_timer_del); | 4020 | ELM_SAFE_FREE(it->long_timer, ecore_timer_del); |
4019 | efl_event_callback_legacy_call | 4021 | evas_object_smart_callback_call(WIDGET(it), "drag", eo_it); |
4020 | (WIDGET(it), EFL_UI_EVENT_DRAG, eo_it); | ||
4021 | return; | 4022 | return; |
4022 | } | 4023 | } |
4023 | if ((!it->down) || (sd->longpressed)) | 4024 | if ((!it->down) || (sd->longpressed)) |
@@ -4025,6 +4026,7 @@ _item_mouse_move_cb(void *data, | |||
4025 | ELM_SAFE_FREE(it->long_timer, ecore_timer_del); | 4026 | ELM_SAFE_FREE(it->long_timer, ecore_timer_del); |
4026 | if ((sd->reorder_mode) && (sd->reorder_it)) | 4027 | if ((sd->reorder_mode) && (sd->reorder_it)) |
4027 | { | 4028 | { |
4029 | Eina_Bool changed; | ||
4028 | evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh); | 4030 | evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh); |
4029 | 4031 | ||
4030 | if (ev->cur.canvas.y < (oy + (sd->reorder_it->item->h / 2))) | 4032 | if (ev->cur.canvas.y < (oy + (sd->reorder_it->item->h / 2))) |
@@ -4046,11 +4048,13 @@ _item_mouse_move_cb(void *data, | |||
4046 | y_pos = it_scrl_y; | 4048 | y_pos = it_scrl_y; |
4047 | 4049 | ||
4048 | if (it->deco_all_view) | 4050 | if (it->deco_all_view) |
4049 | _item_position(it, it->deco_all_view, it->item->scrl_x, y_pos); | 4051 | changed = _item_position(it, it->deco_all_view, it->item->scrl_x, y_pos); |
4050 | else | 4052 | else |
4051 | _item_position(it, VIEW(it), it->item->scrl_x, y_pos); | 4053 | changed = _item_position(it, VIEW(it), it->item->scrl_x, y_pos); |
4052 | 4054 | ||
4053 | _add_calc_job(sd); | 4055 | efl_canvas_group_change(sd->obj); |
4056 | if (changed) | ||
4057 | efl_canvas_group_change(sd->pan_obj); | ||
4054 | } | 4058 | } |
4055 | return; | 4059 | return; |
4056 | } | 4060 | } |
@@ -4654,7 +4658,7 @@ newblock: | |||
4654 | itb->count++; | 4658 | itb->count++; |
4655 | itb->changed = EINA_TRUE; | 4659 | itb->changed = EINA_TRUE; |
4656 | it->item->block = itb; | 4660 | it->item->block = itb; |
4657 | _add_calc_job(itb->sd); | 4661 | efl_canvas_group_change(itb->sd->obj); |
4658 | 4662 | ||
4659 | if (itb->count > itb->sd->max_items_per_block) | 4663 | if (itb->count > itb->sd->max_items_per_block) |
4660 | { | 4664 | { |
@@ -4813,7 +4817,6 @@ _item_process_post(Elm_Genlist_Data *sd, Elm_Gen_Item *it) | |||
4813 | if (sd->pan_changed) | 4817 | if (sd->pan_changed) |
4814 | { | 4818 | { |
4815 | evas_object_smart_changed(sd->pan_obj); | 4819 | evas_object_smart_changed(sd->pan_obj); |
4816 | ELM_SAFE_FREE(sd->calc_job, ecore_job_del); | ||
4817 | } | 4820 | } |
4818 | } | 4821 | } |
4819 | if (show_me) it->item->block->show_me = EINA_TRUE; | 4822 | if (show_me) it->item->block->show_me = EINA_TRUE; |
@@ -4850,9 +4853,10 @@ _queue_process(Elm_Genlist_Data *sd) | |||
4850 | { | 4853 | { |
4851 | int n; | 4854 | int n; |
4852 | double t0, t; | 4855 | double t0, t; |
4856 | Evas *e = evas_object_evas_get(sd->obj); | ||
4853 | 4857 | ||
4854 | t0 = ecore_time_get(); | 4858 | t0 = ecore_time_get(); |
4855 | 4859 | evas_event_freeze(e); | |
4856 | for (n = 0; (sd->queue) && (n < ITEM_QUEUE_MAX); n++) | 4860 | for (n = 0; (sd->queue) && (n < ITEM_QUEUE_MAX); n++) |
4857 | { | 4861 | { |
4858 | Elm_Gen_Item *it; | 4862 | Elm_Gen_Item *it; |
@@ -4869,6 +4873,8 @@ _queue_process(Elm_Genlist_Data *sd) | |||
4869 | if ((t - t0) > (ecore_animator_frametime_get())) break; | 4873 | if ((t - t0) > (ecore_animator_frametime_get())) break; |
4870 | } | 4874 | } |
4871 | } | 4875 | } |
4876 | evas_event_thaw(e); | ||
4877 | evas_event_thaw_eval(e); | ||
4872 | return n; | 4878 | return n; |
4873 | } | 4879 | } |
4874 | 4880 | ||
@@ -4896,7 +4902,7 @@ _item_idle_enterer(void *data) | |||
4896 | if (wakeup) | 4902 | if (wakeup) |
4897 | { | 4903 | { |
4898 | // wake up mainloop | 4904 | // wake up mainloop |
4899 | _add_calc_job(sd); | 4905 | efl_canvas_group_change(sd->obj); |
4900 | } | 4906 | } |
4901 | if (ok == ECORE_CALLBACK_CANCEL) sd->queue_idle_enterer = NULL; | 4907 | if (ok == ECORE_CALLBACK_CANCEL) sd->queue_idle_enterer = NULL; |
4902 | 4908 | ||
@@ -5141,7 +5147,7 @@ _item_mouse_up_cb(void *data, | |||
5141 | } | 5147 | } |
5142 | else | 5148 | else |
5143 | { | 5149 | { |
5144 | _add_calc_job(sd); | 5150 | efl_canvas_group_change(sd->obj); |
5145 | } | 5151 | } |
5146 | edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_DISABLED, "elm"); | 5152 | edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_DISABLED, "elm"); |
5147 | if (_elm_config->atspi_mode) | 5153 | if (_elm_config->atspi_mode) |
@@ -5168,7 +5174,10 @@ _item_mouse_up_cb(void *data, | |||
5168 | } | 5174 | } |
5169 | } | 5175 | } |
5170 | 5176 | ||
5171 | if (!it->selected && it->highlighted) | 5177 | /* this is handled implicitly in _item_unselect() below unless there |
5178 | * will be no select | ||
5179 | */ | ||
5180 | if (!it->selected && it->highlighted && _is_no_select(it)) | ||
5172 | _item_unhighlight(it); | 5181 | _item_unhighlight(it); |
5173 | 5182 | ||
5174 | if ((ev->flags != EVAS_BUTTON_NONE) || | 5183 | if ((ev->flags != EVAS_BUTTON_NONE) || |
@@ -5191,7 +5200,9 @@ _item_mouse_up_cb(void *data, | |||
5191 | { | 5200 | { |
5192 | if (!it->selected) | 5201 | if (!it->selected) |
5193 | { | 5202 | { |
5203 | /* this should only be handled on mouse down | ||
5194 | _item_highlight(it); | 5204 | _item_highlight(it); |
5205 | */ | ||
5195 | if (_item_select(it)) goto deleted; | 5206 | if (_item_select(it)) goto deleted; |
5196 | } | 5207 | } |
5197 | else | 5208 | else |
@@ -5220,7 +5231,9 @@ _item_mouse_up_cb(void *data, | |||
5220 | _item_unselect(it2); | 5231 | _item_unselect(it2); |
5221 | } | 5232 | } |
5222 | } | 5233 | } |
5234 | /* this should only be handled on mouse down | ||
5223 | _item_highlight(it); | 5235 | _item_highlight(it); |
5236 | */ | ||
5224 | if (_item_select(it)) goto deleted; | 5237 | if (_item_select(it)) goto deleted; |
5225 | } | 5238 | } |
5226 | 5239 | ||
@@ -5384,6 +5397,15 @@ _item_unrealize(Elm_Gen_Item *it) | |||
5384 | it->want_unrealize = EINA_FALSE; | 5397 | it->want_unrealize = EINA_FALSE; |
5385 | } | 5398 | } |
5386 | 5399 | ||
5400 | static void | ||
5401 | _item_temp_realize(Elm_Gen_Item *it, const int index) | ||
5402 | { | ||
5403 | it->item->unfocusable = EINA_TRUE; | ||
5404 | _item_realize(it, index, EINA_TRUE); | ||
5405 | _elm_genlist_item_unrealize(it, EINA_TRUE); | ||
5406 | it->item->unfocusable = EINA_FALSE; | ||
5407 | } | ||
5408 | |||
5387 | static Eina_Bool | 5409 | static Eina_Bool |
5388 | _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) | 5410 | _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) |
5389 | { | 5411 | { |
@@ -5400,8 +5422,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) | |||
5400 | { | 5422 | { |
5401 | show_me |= it->item->show_me; | 5423 | show_me |= it->item->show_me; |
5402 | 5424 | ||
5403 | if (!it->filtered) _item_filtered_get(it); | 5425 | if (!_item_filtered_get(it, itb->sd)) |
5404 | if (it->hide) | ||
5405 | { | 5426 | { |
5406 | if (it->realized) evas_object_hide(VIEW(it)); | 5427 | if (it->realized) evas_object_hide(VIEW(it)); |
5407 | continue; | 5428 | continue; |
@@ -5418,8 +5439,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) | |||
5418 | { | 5439 | { |
5419 | if (!size || (it->item->expanded_depth != size->expanded_depth)) | 5440 | if (!size || (it->item->expanded_depth != size->expanded_depth)) |
5420 | { | 5441 | { |
5421 | _item_realize(it, blk_idx + vis_count, EINA_TRUE); | 5442 | _item_temp_realize(it, blk_idx + vis_count); |
5422 | _elm_genlist_item_unrealize(it, EINA_TRUE); | ||
5423 | } | 5443 | } |
5424 | else | 5444 | else |
5425 | { | 5445 | { |
@@ -5440,10 +5460,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) | |||
5440 | it->item->mincalcd = EINA_TRUE; | 5460 | it->item->mincalcd = EINA_TRUE; |
5441 | } | 5461 | } |
5442 | else | 5462 | else |
5443 | { | 5463 | _item_temp_realize(it, blk_idx + vis_count); |
5444 | _item_realize(it, blk_idx + vis_count, EINA_TRUE); | ||
5445 | _elm_genlist_item_unrealize(it, EINA_TRUE); | ||
5446 | } | ||
5447 | } | 5464 | } |
5448 | } | 5465 | } |
5449 | else | 5466 | else |
@@ -5531,7 +5548,8 @@ _update_job(void *data) | |||
5531 | } | 5548 | } |
5532 | if (position) | 5549 | if (position) |
5533 | { | 5550 | { |
5534 | _add_calc_job(sd); | 5551 | efl_canvas_group_change(sd->pan_obj); |
5552 | efl_canvas_group_change(sd->obj); | ||
5535 | } | 5553 | } |
5536 | evas_event_thaw(e); | 5554 | evas_event_thaw(e); |
5537 | evas_event_thaw_eval(e); | 5555 | evas_event_thaw_eval(e); |
@@ -5885,7 +5903,6 @@ _elm_genlist_efl_canvas_group_group_del(Eo *obj, Elm_Genlist_Data *sd) | |||
5885 | EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, | 5903 | EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, |
5886 | _evas_viewport_resize_cb, sd); | 5904 | _evas_viewport_resize_cb, sd); |
5887 | 5905 | ||
5888 | ELM_SAFE_FREE(sd->calc_job, ecore_job_del); | ||
5889 | ELM_SAFE_FREE(sd->update_job, ecore_job_del); | 5906 | ELM_SAFE_FREE(sd->update_job, ecore_job_del); |
5890 | ELM_SAFE_FREE(sd->pan_obj, evas_object_del); | 5907 | ELM_SAFE_FREE(sd->pan_obj, evas_object_del); |
5891 | ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); | 5908 | ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); |
@@ -6038,7 +6055,6 @@ _internal_elm_genlist_clear(Evas_Object *obj) | |||
6038 | sd->pan_changed = EINA_TRUE; | 6055 | sd->pan_changed = EINA_TRUE; |
6039 | if (!sd->queue) | 6056 | if (!sd->queue) |
6040 | { | 6057 | { |
6041 | ELM_SAFE_FREE(sd->calc_job, ecore_job_del); | ||
6042 | sd->anchor_item = NULL; | 6058 | sd->anchor_item = NULL; |
6043 | ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); | 6059 | ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); |
6044 | ELM_SAFE_FREE(sd->must_recalc_idler, ecore_idler_del); | 6060 | ELM_SAFE_FREE(sd->must_recalc_idler, ecore_idler_del); |
@@ -6978,7 +6994,7 @@ _elm_genlist_first_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) | |||
6978 | { | 6994 | { |
6979 | Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(sd->items); | 6995 | Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(sd->items); |
6980 | 6996 | ||
6981 | while (it && sd->filter && !_item_filtered_get(it)) | 6997 | while (it && sd->filter && !_item_filtered_get(it, sd)) |
6982 | it = ELM_GEN_ITEM_NEXT(it); | 6998 | it = ELM_GEN_ITEM_NEXT(it); |
6983 | 6999 | ||
6984 | return EO_OBJ(it); | 7000 | return EO_OBJ(it); |
@@ -6992,7 +7008,7 @@ _elm_genlist_last_item_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) | |||
6992 | if (!sd->items) return NULL; | 7008 | if (!sd->items) return NULL; |
6993 | it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); | 7009 | it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); |
6994 | 7010 | ||
6995 | while (it && sd->filter && !_item_filtered_get(it)) | 7011 | while (it && sd->filter && !_item_filtered_get(it, sd)) |
6996 | it = ELM_GEN_ITEM_PREV(it); | 7012 | it = ELM_GEN_ITEM_PREV(it); |
6997 | 7013 | ||
6998 | return EO_OBJ(it); | 7014 | return EO_OBJ(it); |
@@ -7004,7 +7020,7 @@ _elm_genlist_item_next_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it) | |||
7004 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); | 7020 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); |
7005 | 7021 | ||
7006 | do it = ELM_GEN_ITEM_NEXT(it); | 7022 | do it = ELM_GEN_ITEM_NEXT(it); |
7007 | while (it && sd->filter && !_item_filtered_get(it)); | 7023 | while (it && sd->filter && !_item_filtered_get(it, sd)); |
7008 | 7024 | ||
7009 | return EO_OBJ(it); | 7025 | return EO_OBJ(it); |
7010 | } | 7026 | } |
@@ -7015,7 +7031,7 @@ _elm_genlist_item_prev_get(const Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it) | |||
7015 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); | 7031 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); |
7016 | 7032 | ||
7017 | do it = ELM_GEN_ITEM_PREV(it); | 7033 | do it = ELM_GEN_ITEM_PREV(it); |
7018 | while (it && sd->filter && !_item_filtered_get(it)); | 7034 | while (it && sd->filter && !_item_filtered_get(it, sd)); |
7019 | 7035 | ||
7020 | return EO_OBJ(it); | 7036 | return EO_OBJ(it); |
7021 | } | 7037 | } |
@@ -7286,7 +7302,7 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it, | |||
7286 | sd->scroll_to_type = type; | 7302 | sd->scroll_to_type = type; |
7287 | it->item->show_me = EINA_TRUE; | 7303 | it->item->show_me = EINA_TRUE; |
7288 | 7304 | ||
7289 | _add_calc_job(sd); | 7305 | efl_canvas_group_change(sd->obj); |
7290 | 7306 | ||
7291 | return EINA_FALSE; | 7307 | return EINA_FALSE; |
7292 | } | 7308 | } |
@@ -7858,7 +7874,7 @@ _filter_item_internal(Elm_Gen_Item *it) | |||
7858 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); | 7874 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); |
7859 | if (sd->filter_data) | 7875 | if (sd->filter_data) |
7860 | { | 7876 | { |
7861 | if ((it->parent && !_item_filtered_get(it->parent)) || | 7877 | if ((it->parent && !_item_filtered_get(it->parent, sd)) || |
7862 | (it->itc->func.filter_get && | 7878 | (it->itc->func.filter_get && |
7863 | !it->itc->func.filter_get( | 7879 | !it->itc->func.filter_get( |
7864 | (void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), | 7880 | (void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), |
@@ -7877,11 +7893,11 @@ _filter_item_internal(Elm_Gen_Item *it) | |||
7877 | 7893 | ||
7878 | // Returns true if the item is not filtered out, but remains visible. | 7894 | // Returns true if the item is not filtered out, but remains visible. |
7879 | static Eina_Bool | 7895 | static Eina_Bool |
7880 | _item_filtered_get(Elm_Gen_Item *it) | 7896 | _item_filtered_get(Elm_Gen_Item *it, Elm_Genlist_Data *sd) |
7881 | { | 7897 | { |
7882 | Eina_List *l; | 7898 | Eina_List *l; |
7883 | if (!it) return EINA_FALSE; | 7899 | /* no filter exists: item will always be visible */ |
7884 | ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); | 7900 | if (!sd->filter_data) return EINA_TRUE; |
7885 | if (!it->filtered) | 7901 | if (!it->filtered) |
7886 | { | 7902 | { |
7887 | l = eina_list_data_find_list(sd->filter_queue, it); | 7903 | l = eina_list_data_find_list(sd->filter_queue, it); |
@@ -7902,10 +7918,10 @@ _item_filtered_get(Elm_Gen_Item *it) | |||
7902 | _filter_item_internal(it); | 7918 | _filter_item_internal(it); |
7903 | if (it->item->block) | 7919 | if (it->item->block) |
7904 | it->item->block->changed = EINA_TRUE; | 7920 | it->item->block->changed = EINA_TRUE; |
7905 | _add_calc_job(sd); | 7921 | efl_canvas_group_change(sd->obj); |
7922 | sd->need_calc = EINA_TRUE; | ||
7906 | } | 7923 | } |
7907 | if (!it->hide) return EINA_TRUE; | 7924 | return !it->hide; |
7908 | return EINA_FALSE; | ||
7909 | } | 7925 | } |
7910 | 7926 | ||
7911 | static int | 7927 | static int |
@@ -7961,7 +7977,7 @@ _item_filter_enterer(void *data) | |||
7961 | if (wakeup) | 7977 | if (wakeup) |
7962 | { | 7978 | { |
7963 | // wake up mainloop | 7979 | // wake up mainloop |
7964 | _add_calc_job(sd); | 7980 | efl_canvas_group_change(sd->obj); |
7965 | } | 7981 | } |
7966 | if (ok == ECORE_CALLBACK_CANCEL) | 7982 | if (ok == ECORE_CALLBACK_CANCEL) |
7967 | { | 7983 | { |
@@ -8002,6 +8018,8 @@ _elm_genlist_filter_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, void *filter_ | |||
8002 | sd->filter_queue = eina_list_append(sd->filter_queue, it); | 8018 | sd->filter_queue = eina_list_append(sd->filter_queue, it); |
8003 | } | 8019 | } |
8004 | itb->changed = EINA_TRUE; | 8020 | itb->changed = EINA_TRUE; |
8021 | evas_object_smart_changed(obj); | ||
8022 | sd->need_calc = EINA_TRUE; | ||
8005 | } | 8023 | } |
8006 | else | 8024 | else |
8007 | { | 8025 | { |
@@ -8013,10 +8031,11 @@ _elm_genlist_filter_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, void *filter_ | |||
8013 | } | 8031 | } |
8014 | } | 8032 | } |
8015 | } | 8033 | } |
8016 | _calc_job(sd->obj); | 8034 | if (!sd->filter_queue) |
8017 | 8035 | efl_event_callback_legacy_call(sd->obj, ELM_GENLIST_EVENT_FILTER_DONE, NULL); | |
8018 | sd->queue_filter_enterer = ecore_idle_enterer_add(_item_filter_enterer, | 8036 | else |
8019 | sd->obj); | 8037 | sd->queue_filter_enterer = ecore_idle_enterer_add(_item_filter_enterer, |
8038 | sd->obj); | ||
8020 | } | 8039 | } |
8021 | 8040 | ||
8022 | static Eina_Bool | 8041 | static Eina_Bool |
@@ -8028,7 +8047,7 @@ _filter_iterator_next(Elm_Genlist_Filter *iter, void **data) | |||
8028 | { | 8047 | { |
8029 | item = ELM_GENLIST_FILTER_ITERATOR_ITEM_GET(iter->current, Elm_Gen_Item); | 8048 | item = ELM_GENLIST_FILTER_ITERATOR_ITEM_GET(iter->current, Elm_Gen_Item); |
8030 | iter->current = iter->current->next; | 8049 | iter->current = iter->current->next; |
8031 | if (_item_filtered_get(item)) | 8050 | if (_item_filtered_get(item, item->item->block->sd)) |
8032 | { | 8051 | { |
8033 | if (data) | 8052 | if (data) |
8034 | *data = EO_OBJ(item); | 8053 | *data = EO_OBJ(item); |
@@ -8267,7 +8286,7 @@ _elm_genlist_decorate_mode_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Bool decorate | |||
8267 | } | 8286 | } |
8268 | } | 8287 | } |
8269 | 8288 | ||
8270 | _add_calc_job(sd); | 8289 | efl_canvas_group_change(sd->obj); |
8271 | } | 8290 | } |
8272 | 8291 | ||
8273 | EOLIAN static void | 8292 | EOLIAN static void |
@@ -8413,7 +8432,7 @@ _flip_job(void *data) | |||
8413 | 8432 | ||
8414 | it->flipped = EINA_TRUE; | 8433 | it->flipped = EINA_TRUE; |
8415 | it->item->nocache = EINA_TRUE; | 8434 | it->item->nocache = EINA_TRUE; |
8416 | _add_calc_job(sd); | 8435 | efl_canvas_group_change(sd->obj); |
8417 | } | 8436 | } |
8418 | 8437 | ||
8419 | EOLIAN static void | 8438 | EOLIAN static void |