summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-07-26 19:05:02 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-07-26 19:05:02 +0200
commit117824338ded2e5554be11623ef06fcc2b3320e1 (patch)
tree16ebe04a747c28f45f5cae6051f501909c42acfe
parente878f22e28f572b7335819bae3baf0961ba38bd9 (diff)
elm_items_list: remove tree tracking in the list
this is done in elm.items.display now
-rw-r--r--src/lib/items/elm_items_list.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/lib/items/elm_items_list.c b/src/lib/items/elm_items_list.c
index 2a24c77..36c42cc 100644
--- a/src/lib/items/elm_items_list.c
+++ b/src/lib/items/elm_items_list.c
@@ -15,7 +15,6 @@ typedef struct {
15 Evas_Box *box; 15 Evas_Box *box;
16 unsigned int old_first, old_last; 16 unsigned int old_first, old_last;
17 Eina_List *realitems; 17 Eina_List *realitems;
18 Eina_List *realized;
19} Elm_Items_List_Pan_Data; 18} Elm_Items_List_Pan_Data;
20 19
21#if 0 20#if 0
@@ -185,32 +184,11 @@ _unselected(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EI
185} 184}
186 185
187static Eina_Bool 186static Eina_Bool
188_idle_tree_flush(void *data)
189{
190 Elm_Items_List_Data *pd;
191
192 pd = eo_data_scope_get(data, ELM_ITEMS_LIST_CLASS);
193 eo_do(pd->pan, elm_items_pan_realitems(pd->realitems));
194
195 pd->flush_idle = NULL;
196
197 return EINA_FALSE;
198}
199
200static Eina_Bool
201_add(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event) 187_add(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event)
202{ 188{
203 Eo *good; 189 Eo *good;
204 Eo *prev;
205 Eo *next;
206 Elm_Items_List_Data *pd;
207 190
208 pd = eo_data_scope_get(data, ELM_ITEMS_LIST_CLASS); 191 eo_do(event, good = efl_tree_base_carry_get());
209
210 eo_do(event, good = efl_tree_base_carry_get();
211 prev = efl_tree_base_prev_get();
212 next = efl_tree_base_next_get();
213 );
214 //subscribe to item events 192 //subscribe to item events
215 eo_do(good, eo_event_callback_add(ELM_ITEMS_ITEM_EVENT_SELECTED, _selected, data); 193 eo_do(good, eo_event_callback_add(ELM_ITEMS_ITEM_EVENT_SELECTED, _selected, data);
216 eo_event_callback_add(ELM_ITEMS_ITEM_EVENT_UNSELECTED, _unselected, data); 194 eo_event_callback_add(ELM_ITEMS_ITEM_EVENT_UNSELECTED, _unselected, data);
@@ -224,11 +202,6 @@ _add(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUS
224 //show the item 202 //show the item
225 evas_object_show(good); 203 evas_object_show(good);
226 204
227 pd->realitems = eina_list_append(pd->realitems, good);
228
229 if (!pd->flush_idle)
230 pd->flush_idle = ecore_idler_add(_idle_tree_flush, data);
231
232 return EO_CALLBACK_CONTINUE; 205 return EO_CALLBACK_CONTINUE;
233} 206}
234 207
@@ -236,16 +209,12 @@ static Eina_Bool
236_del(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event) 209_del(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event)
237{ 210{
238 Eo *good; 211 Eo *good;
239 Elm_Items_List_Data *pd;
240
241 pd = eo_data_scope_get(data, ELM_ITEMS_LIST_CLASS);
242 212
243 eo_do(event, good = efl_tree_base_carry_get()); 213 eo_do(event, good = efl_tree_base_carry_get());
244 214
245 pd->realitems = eina_list_remove(pd->realitems, good); 215 eo_do(good, eo_event_callback_del(ELM_ITEMS_ITEM_EVENT_SELECTED, _selected, data);
246 216 eo_event_callback_del(ELM_ITEMS_ITEM_EVENT_UNSELECTED, _unselected, data);
247 if (!pd->flush_idle) 217 );
248 pd->flush_idle = ecore_idler_add(_idle_tree_flush, data);
249 218
250 return EO_CALLBACK_CONTINUE; 219 return EO_CALLBACK_CONTINUE;
251} 220}