summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-02 10:26:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-06 16:10:40 +0200
commit588745e9956ba622aadc9fe6f11988a372687d39 (patch)
treea9fd09013d9ae94db44582ddb8cc3f674d94eea4
parentb36e159d313bae4a6dd4e0c60deae0aef2309b50 (diff)
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite weird to have a index, where most of the time you work with widgets. We might want to add syntax suger in the future to make it easier to just jump to the next element, or to the previous, but that still is to be decided. The event and the communication to the spotlight manager are still left to be used with the index, reason for this is, that we might need to fill there an invalid pointer, if a deletion is triggering an animation, which seems quite weird. That needs further discussing. Docx have been updated, the sitemarks about the shifting of the active_index can be removed, as the element is not subject of change during content adds/deletes. ref T7991 Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com> Differential Revision: https://phab.enlightenment.org/D9813
-rw-r--r--src/bin/elementary/test_ui_spotlight.c29
-rw-r--r--src/bin/elementary/test_ui_tab_pager.c30
-rw-r--r--src/examples/elementary/efl_ui_slideshow_example.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c126
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.eo12
-rw-r--r--src/lib/elementary/efl_ui_spotlight_indicator.eo17
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager.eo16
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_plain.c36
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_scroll.c7
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_stack.c4
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.c19
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.eo2
-rw-r--r--src/tests/elementary/efl_ui_test_spotlight.c77
13 files changed, 189 insertions, 190 deletions
diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c
index cdcaf65b1e..c2bc6b436c 100644
--- a/src/bin/elementary/test_ui_spotlight.c
+++ b/src/bin/elementary/test_ui_spotlight.c
@@ -124,20 +124,20 @@ static void
124prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 124prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
125{ 125{
126 Eo *spotlight = data; 126 Eo *spotlight = data;
127 int active_index = efl_ui_spotlight_active_index_get(spotlight); 127 int active_index = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight));
128 128
129 if (active_index - 1 > -1) 129 if (active_index - 1 > -1)
130 efl_ui_spotlight_active_index_set(spotlight, active_index - 1); 130 efl_ui_spotlight_active_element_set(spotlight, efl_pack_content_get(spotlight, active_index - 1));
131} 131}
132 132
133static void 133static void
134next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 134next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
135{ 135{
136 Eo *spotlight = data; 136 Eo *spotlight = data;
137 int active_index = efl_ui_spotlight_active_index_get(spotlight); 137 int active_index = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight));
138 138
139 if (active_index + 1 < efl_content_count(spotlight)) 139 if (active_index + 1 < efl_content_count(spotlight))
140 efl_ui_spotlight_active_index_set(spotlight, active_index + 1); 140 efl_ui_spotlight_active_element_set(spotlight, efl_pack_content_get(spotlight, active_index + 1));
141} 141}
142 142
143static Eina_Value 143static Eina_Value
@@ -280,7 +280,7 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
280{ 280{
281 Pack_Params *param = data; 281 Pack_Params *param = data;
282 Eo *spotlight = param->spotlight; 282 Eo *spotlight = param->spotlight;
283 Eo *page = NULL, *curr_page; 283 Eo *page = NULL;
284 int index, cnt; 284 int index, cnt;
285 285
286 if ((param->type != UNPACK_AT) && (param->type != CLEAR)) 286 if ((param->type != UNPACK_AT) && (param->type != CLEAR))
@@ -318,15 +318,11 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
318 break; 318 break;
319 319
320 case PACK_BEFORE: 320 case PACK_BEFORE:
321 index = efl_ui_spotlight_active_index_get(spotlight); 321 efl_pack_before(spotlight, page, efl_ui_spotlight_active_element_get(spotlight));
322 curr_page = efl_pack_content_get(spotlight, index);
323 efl_pack_before(spotlight, page, curr_page);
324 break; 322 break;
325 323
326 case PACK_AFTER: 324 case PACK_AFTER:
327 index = efl_ui_spotlight_active_index_get(spotlight); 325 efl_pack_after(spotlight, page, efl_ui_spotlight_active_element_get(spotlight));
328 curr_page = efl_pack_content_get(spotlight, index);
329 efl_pack_after(spotlight, page, curr_page);
330 break; 326 break;
331 327
332 case PACK_AT: 328 case PACK_AT:
@@ -383,8 +379,9 @@ page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
383{ 379{
384 Page_Set_Params *psp = data; 380 Page_Set_Params *psp = data;
385 381
386 efl_ui_spotlight_active_index_set(psp->spotlight, 382 efl_ui_spotlight_active_element_set(psp->spotlight,
387 efl_ui_range_value_get(psp->spinner)); 383 efl_pack_content_get(psp->spotlight,
384 efl_ui_range_value_get(psp->spinner)));
388} 385}
389 386
390static void 387static void
@@ -609,7 +606,7 @@ pack_cb(void *data,
609 num = efl_content_count(spotlight); 606 num = efl_content_count(spotlight);
610 if (num) 607 if (num)
611 efl_ui_range_limits_set(sp1, 0, num); 608 efl_ui_range_limits_set(sp1, 0, num);
612 num = efl_ui_spotlight_active_index_get(spotlight); 609 num = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight));
613 if (num >= 0) 610 if (num >= 0)
614 efl_ui_range_value_set(sp1, num); 611 efl_ui_range_value_set(sp1, num);
615 612
@@ -735,7 +732,7 @@ pack_cb(void *data,
735 efl_ui_range_limits_set(sp2, 0, 732 efl_ui_range_limits_set(sp2, 0,
736 (efl_content_count(spotlight) - 1)); 733 (efl_content_count(spotlight) - 1));
737 efl_ui_range_value_set(sp2, 734 efl_ui_range_value_set(sp2,
738 efl_ui_spotlight_active_index_get(spotlight)); 735 efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight)));
739 } 736 }
740 else 737 else
741 { 738 {
@@ -801,7 +798,7 @@ active_index_cb(void *data,
801 efl_ui_range_limits_set(sp, 0, 798 efl_ui_range_limits_set(sp, 0,
802 (efl_content_count(spotlight) - 1)); 799 (efl_content_count(spotlight) - 1));
803 efl_ui_range_value_set(sp, 800 efl_ui_range_value_set(sp,
804 efl_ui_spotlight_active_index_get(spotlight)); 801 efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight)));
805 } 802 }
806 else 803 else
807 { 804 {
diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c
index 93aaa12948..01ca807a2e 100644
--- a/src/bin/elementary/test_ui_tab_pager.c
+++ b/src/bin/elementary/test_ui_tab_pager.c
@@ -139,10 +139,10 @@ test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
139 { 139 {
140 page = tab_page_add(tp); 140 page = tab_page_add(tp);
141 efl_pack_end(tp, page); 141 efl_pack_end(tp, page);
142 if (i == 0)
143 efl_ui_spotlight_active_element_set(tp, page);
142 } 144 }
143 145
144 efl_ui_spotlight_active_index_set(tp, 0);
145
146 ad = (App_Data*)calloc(1, sizeof(App_Data)); 146 ad = (App_Data*)calloc(1, sizeof(App_Data));
147 ad->navi = navi; 147 ad->navi = navi;
148 ad->tab_pager = tp; 148 ad->tab_pager = tp;
@@ -175,7 +175,7 @@ static void
175_tab_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 175_tab_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
176{ 176{
177 Tab_Set_Data *tsd = data; 177 Tab_Set_Data *tsd = data;
178 efl_ui_spotlight_active_index_set(tsd->tab_pager, elm_spinner_value_get(tsd->spinner)); 178 efl_ui_spotlight_active_element_set(tsd->tab_pager, efl_pack_content_get(tsd->tab_pager, elm_spinner_value_get(tsd->spinner)));
179} 179}
180 180
181static void 181static void
@@ -206,7 +206,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
206 206
207 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box, 207 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
208 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), 208 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
209 efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), 209 efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
210 efl_pack_end(box, efl_added)); 210 efl_pack_end(box, efl_added));
211 211
212 tsd->tab_pager = tab_pager; 212 tsd->tab_pager = tab_pager;
@@ -246,10 +246,8 @@ _pack_before_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
246{ 246{
247 Eo *tab_pager = data; 247 Eo *tab_pager = data;
248 Eo *tab_page, *cur_tab_page; 248 Eo *tab_page, *cur_tab_page;
249 int index;
250 249
251 index = efl_ui_spotlight_active_index_get(tab_pager); 250 cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager);
252 cur_tab_page = efl_pack_content_get(tab_pager, index);
253 251
254 tab_page = tab_page_add(tab_pager); 252 tab_page = tab_page_add(tab_pager);
255 253
@@ -261,10 +259,8 @@ _pack_after_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
261{ 259{
262 Eo *tab_pager = data; 260 Eo *tab_pager = data;
263 Eo *tab_page, *cur_tab_page; 261 Eo *tab_page, *cur_tab_page;
264 int index;
265 262
266 index = efl_ui_spotlight_active_index_get(tab_pager); 263 cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager);
267 cur_tab_page = efl_pack_content_get(tab_pager, index);
268 264
269 tab_page = tab_page_add(tab_pager); 265 tab_page = tab_page_add(tab_pager);
270 266
@@ -340,7 +336,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
340 336
341 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box, 337 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
342 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), 338 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
343 efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), 339 efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
344 efl_pack_end(in_box, efl_added)); 340 efl_pack_end(in_box, efl_added));
345 341
346 tsd->tab_pager = tab_pager; 342 tsd->tab_pager = tab_pager;
@@ -365,8 +361,9 @@ static void
365_unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 361_unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
366{ 362{
367 Eo *tab_pager = data; 363 Eo *tab_pager = data;
368 int index = efl_ui_spotlight_active_index_get(tab_pager); 364
369 Eo *tab_page = efl_pack_content_get(tab_pager, index); 365 Eo *tab_page = efl_ui_spotlight_active_element_get(tab_pager);
366
370 efl_pack_unpack(tab_pager, tab_page); 367 efl_pack_unpack(tab_pager, tab_page);
371 efl_del(tab_page); 368 efl_del(tab_page);
372} 369}
@@ -440,7 +437,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
440 437
441 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box, 438 sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
442 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), 439 efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
443 efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), 440 efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
444 efl_pack_end(in_box, efl_added)); 441 efl_pack_end(in_box, efl_added));
445 442
446 tsd->tab_pager = tab_pager; 443 tsd->tab_pager = tab_pager;
@@ -463,9 +460,8 @@ _change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
463 Eo *tab_page, *content; 460 Eo *tab_page, *content;
464 char *label = NULL; 461 char *label = NULL;
465 char *icon = NULL; 462 char *icon = NULL;
466 int cur; 463
467 cur = efl_ui_spotlight_active_index_get(tcd->tab_pager); 464 tab_page = efl_ui_spotlight_active_element_get(tcd->tab_pager);
468 tab_page = efl_pack_content_get(tcd->tab_pager, cur);
469 465
470 if (efl_ui_selectable_selected_get(tcd->label_check)) 466 if (efl_ui_selectable_selected_get(tcd->label_check))
471 { 467 {
diff --git a/src/examples/elementary/efl_ui_slideshow_example.c b/src/examples/elementary/efl_ui_slideshow_example.c
index 55c1b66fab..6292f4390f 100644
--- a/src/examples/elementary/efl_ui_slideshow_example.c
+++ b/src/examples/elementary/efl_ui_slideshow_example.c
@@ -25,9 +25,9 @@ _show_next(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
25 efl_del(show_timer); 25 efl_del(show_timer);
26 show_timer = NULL; 26 show_timer = NULL;
27 27
28 int current_index = efl_ui_spotlight_active_index_get(container); 28 int current_index = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container));
29 int new_index = (current_index + 1) % efl_content_count(container); 29 int new_index = (current_index + 1) % efl_content_count(container);
30 efl_ui_spotlight_active_index_set(container, new_index); 30 efl_ui_spotlight_active_element_set(container, efl_pack_content_get(container, new_index));
31} 31}
32 32
33static void 33static void
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 10c8125709..9b7737415f 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -14,7 +14,7 @@ typedef struct _Efl_Ui_Spotlight_Container_Data
14 Eina_Size2D sz; 14 Eina_Size2D sz;
15 } page_spec; 15 } page_spec;
16 struct { 16 struct {
17 int page; 17 Efl_Ui_Widget *page;
18 double pos; 18 double pos;
19 } curr; 19 } curr;
20 struct { 20 struct {
@@ -37,6 +37,14 @@ typedef struct _Efl_Ui_Spotlight_Container_Data
37 37
38#define MY_CLASS EFL_UI_SPOTLIGHT_CONTAINER_CLASS 38#define MY_CLASS EFL_UI_SPOTLIGHT_CONTAINER_CLASS
39 39
40static void
41_fetch_partners(Eina_List *list, Eo *subobj, Eo **next, Eo **prev)
42{
43 Eina_List *node = eina_list_data_find_list(list, subobj);
44 *next = eina_list_data_get(eina_list_next(node));
45 *prev = eina_list_data_get(eina_list_prev(node));
46}
47
40static void _unpack(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj, int index); 48static void _unpack(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj, int index);
41static void _unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Eina_Bool clear); 49static void _unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Eina_Bool clear);
42 50
@@ -73,10 +81,13 @@ _transition_end(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd)
73 if (pd->transition_done.content) 81 if (pd->transition_done.content)
74 { 82 {
75 Eina_Value v = eina_value_object_init(pd->transition_done.content); 83 Eina_Value v = eina_value_object_init(pd->transition_done.content);
76 efl_pack_unpack(obj, pd->transition_done.content); 84 //first store the fields, then NULL them, then resolve the situation, otherwise we might get trapped in a endless recursion
77 eina_promise_resolve(pd->transition_done.transition_done, v); 85 Eina_Promise *p = pd->transition_done.transition_done;
86 Eo *content = pd->transition_done.content;
78 pd->transition_done.transition_done = NULL; 87 pd->transition_done.transition_done = NULL;
79 pd->transition_done.content = NULL; 88 pd->transition_done.content = NULL;
89 efl_pack_unpack(obj, content);
90 eina_promise_resolve(p , v);
80 } 91 }
81 92
82 ev.from = pd->show_request.from; 93 ev.from = pd->show_request.from;
@@ -176,7 +187,7 @@ _efl_ui_spotlight_container_efl_object_constructor(Eo *obj,
176 CRI("Failed to set layout!"); 187 CRI("Failed to set layout!");
177 188
178 pd->position = -1; 189 pd->position = -1;
179 pd->curr.page = -1; 190 pd->curr.page = NULL;
180 pd->curr.pos = 0.0; 191 pd->curr.pos = 0.0;
181 192
182 pd->transition = NULL; 193 pd->transition = NULL;
@@ -267,24 +278,14 @@ _register_child(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gf
267static void 278static void
268_update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index) 279_update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index)
269{ 280{
270 Eina_Bool curr_page_update = EINA_FALSE;
271
272 if (pd->curr.page >= index)
273 {
274 pd->curr.page++;
275 curr_page_update = EINA_TRUE;
276 }
277
278 pd->prevent_transition_interaction = EINA_TRUE; 281 pd->prevent_transition_interaction = EINA_TRUE;
279 if (pd->transition) 282 if (pd->transition)
280 efl_ui_spotlight_manager_content_add(pd->transition, subobj, index); 283 efl_ui_spotlight_manager_content_add(pd->transition, subobj, index);
281 if (pd->indicator) 284 if (pd->indicator)
282 efl_ui_spotlight_indicator_content_add(pd->indicator, subobj, index); 285 efl_ui_spotlight_indicator_content_add(pd->indicator, subobj, index);
283 if (curr_page_update && !pd->transition && eina_list_count(pd->content_list) != 1)
284 _position_set(obj, pd, pd->curr.page);
285 pd->prevent_transition_interaction = EINA_FALSE; 286 pd->prevent_transition_interaction = EINA_FALSE;
286 if (eina_list_count(pd->content_list) == 1) 287 if (eina_list_count(pd->content_list) == 1)
287 efl_ui_spotlight_active_index_set(obj, 0); 288 efl_ui_spotlight_active_element_set(obj, subobj);
288} 289}
289 290
290EOLIAN static Eina_Bool 291EOLIAN static Eina_Bool
@@ -386,21 +387,21 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
386} 387}
387 388
388EOLIAN static void 389EOLIAN static void
389_efl_ui_spotlight_container_active_index_set(Eo *obj EINA_UNUSED, 390_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
390 Efl_Ui_Spotlight_Container_Data *pd, 391 Efl_Ui_Spotlight_Container_Data *pd,
391 int index) 392 Efl_Ui_Widget *new_page)
392{ 393{
393 int before; 394 int before = -1;
395 int index;
394 396
395 if ((index < 0) || (index > ((int)eina_list_count(pd->content_list) - 1))) 397 if (pd->curr.page)
396 { 398 before = efl_pack_index_get(obj, pd->curr.page);
397 ERR("index %d out of range", index); 399 index = efl_pack_index_get(obj, new_page);
398 return; 400
399 } 401 EINA_SAFETY_ON_FALSE_RETURN(index != -1);
400 402
401 before = pd->curr.page; 403 pd->show_request.last_pos = efl_pack_index_get(obj, pd->curr.page);
402 pd->show_request.last_pos = pd->curr.page; 404 pd->show_request.from = efl_pack_index_get(obj, pd->curr.page);
403 pd->show_request.from = pd->curr.page;
404 pd->show_request.to = index; 405 pd->show_request.to = index;
405 406
406 if (pd->show_request.active && pd->show_request.from == -1 && pd->show_request.to) 407 if (pd->show_request.active && pd->show_request.from == -1 && pd->show_request.to)
@@ -410,13 +411,12 @@ _efl_ui_spotlight_container_active_index_set(Eo *obj EINA_UNUSED,
410 _transition_start(obj, pd, before, index, before); 411 _transition_start(obj, pd, before, index, before);
411 } 412 }
412 413
413 int old_curr_page = pd->curr.page; 414 pd->curr.page = new_page;
414 pd->curr.page = index; 415 efl_ui_spotlight_manager_switch_to(pd->transition, before, index);
415 efl_ui_spotlight_manager_switch_to(pd->transition, old_curr_page, pd->curr.page);
416} 416}
417 417
418EOLIAN static int 418EOLIAN static Efl_Ui_Widget*
419_efl_ui_spotlight_container_active_index_get(const Eo *obj EINA_UNUSED, 419_efl_ui_spotlight_container_active_element_get(const Eo *obj EINA_UNUSED,
420 Efl_Ui_Spotlight_Container_Data *pd) 420 Efl_Ui_Spotlight_Container_Data *pd)
421{ 421{
422 return pd->curr.page; 422 return pd->curr.page;
@@ -456,7 +456,7 @@ _unpack_all(Eo *obj EINA_UNUSED,
456 Efl_Ui_Spotlight_Container_Data *pd, 456 Efl_Ui_Spotlight_Container_Data *pd,
457 Eina_Bool clear) 457 Eina_Bool clear)
458{ 458{
459 pd->curr.page = -1; 459 pd->curr.page = NULL;
460 460
461 while(pd->content_list) 461 while(pd->content_list)
462 { 462 {
@@ -493,15 +493,15 @@ _unpack(Eo *obj,
493 Efl_Gfx_Entity *subobj, 493 Efl_Gfx_Entity *subobj,
494 int index) 494 int index)
495{ 495{
496 int early_curr_page = pd->curr.page; 496 int early_curr_page = efl_pack_index_get(obj, pd->curr.page);
497 Eina_Bool deletion_of_active = (index == pd->curr.page); 497 Eina_Bool deletion_of_active = (subobj == pd->curr.page);
498 Efl_Ui_Widget *next, *prev;
498 499
500 _fetch_partners(pd->content_list, subobj, &next, &prev);
499 pd->content_list = eina_list_remove(pd->content_list, subobj); 501 pd->content_list = eina_list_remove(pd->content_list, subobj);
500 _elm_widget_sub_object_redirect_to_top(obj, subobj); 502 _elm_widget_sub_object_redirect_to_top(obj, subobj);
501 503
502 if (!efl_alive_get(obj)) return; 504 if (!efl_alive_get(obj)) return;
503 if (index < pd->curr.page)
504 pd->curr.page--;
505 505
506 if (pd->transition) 506 if (pd->transition)
507 efl_ui_spotlight_manager_content_del(pd->transition, subobj, index); 507 efl_ui_spotlight_manager_content_del(pd->transition, subobj, index);
@@ -509,23 +509,30 @@ _unpack(Eo *obj,
509 efl_ui_spotlight_indicator_content_del(pd->indicator, subobj, index); 509 efl_ui_spotlight_indicator_content_del(pd->indicator, subobj, index);
510 510
511 //we deleted the current index 511 //we deleted the current index
512 if (early_curr_page == index) 512 if (deletion_of_active)
513 { 513 {
514 int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1); 514 if (eina_list_count(pd->content_list) == 0)
515 //when we delete the active index and we are not updating the index, 515 {
516 // then force a update, so the same sort of animation is triggered from the right direction 516 pd->curr.page = NULL;
517 if (deletion_of_active && new_curr_page == pd->curr.page) 517 }
518 pd->curr.page = index -1;
519 if (eina_list_count(pd->content_list) > 0 && efl_alive_get(obj))
520 efl_ui_spotlight_active_index_set(obj, new_curr_page);
521 else 518 else
522 pd->curr.page = -1; 519 {
520 //when we delete the active index and we are not updating the index,
521 // then force a update, so the same sort of animation is triggered from the right direction
522 if (early_curr_page == efl_pack_index_get(obj, prev))
523 pd->curr.page = eina_list_nth(pd->content_list, early_curr_page - 1);
524
525 if (prev)
526 efl_ui_spotlight_active_element_set(obj, prev);
527 else
528 efl_ui_spotlight_active_element_set(obj, next);
529 }
523 } 530 }
524 531
525 //position has updated 532 //position has updated
526 if (early_curr_page != pd->curr.page && early_curr_page != index && 533 if (deletion_of_active &&
527 pd->indicator && !pd->transition) 534 pd->indicator && !pd->transition)
528 efl_ui_spotlight_indicator_position_update(pd->indicator, pd->curr.page); 535 efl_ui_spotlight_indicator_position_update(pd->indicator, efl_pack_index_get(obj, pd->curr.page));
529 536
530 efl_event_callback_del(subobj, EFL_EVENT_INVALIDATE, _child_inv, obj); 537 efl_event_callback_del(subobj, EFL_EVENT_INVALIDATE, _child_inv, obj);
531} 538}
@@ -656,13 +663,18 @@ _efl_ui_spotlight_container_indicator_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spot
656EOLIAN static void 663EOLIAN static void
657_efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *view) 664_efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *view)
658{ 665{
659 int old_active_index = efl_ui_spotlight_active_index_get(obj); 666 if (efl_ui_spotlight_active_element_get(obj))
660 667 {
661 if (old_active_index == -1) 668 if (!efl_pack_before(obj, view, efl_ui_spotlight_active_element_get(obj)))
662 old_active_index = 0; 669 return;
670 }
671 else
672 {
673 if (!efl_pack_begin(obj, view))
674 return;
675 }
663 676
664 efl_pack_at(obj, view, old_active_index); 677 efl_ui_spotlight_active_element_set(obj, view);
665 efl_ui_spotlight_active_index_set(obj, old_active_index);
666} 678}
667 679
668static Eina_Value 680static Eina_Value
@@ -686,13 +698,13 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
686 698
687 if (count == 0) return NULL; 699 if (count == 0) return NULL;
688 700
689 content = efl_pack_content_get(obj, efl_ui_spotlight_active_index_get(obj)); 701 content = efl_ui_spotlight_active_element_get(obj);
690 702
691 //pop() unpacks content without transition if there is one content. 703 //pop() unpacks content without transition if there is one content.
692 if (count == 1) 704 if (count == 1)
693 { 705 {
694 efl_pack_unpack(obj, content); 706 efl_pack_unpack(obj, content);
695 pd->curr.page = -1; 707 pd->curr.page = NULL;
696 708
697 if (del) 709 if (del)
698 { 710 {
@@ -706,7 +718,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
706 return efl_loop_future_resolved(obj, v); 718 return efl_loop_future_resolved(obj, v);
707 } 719 }
708 720
709 new_index = efl_ui_spotlight_active_index_get(obj) + 1; 721 new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) + 1;
710 if (new_index >= count) 722 if (new_index >= count)
711 new_index -= 2; 723 new_index -= 2;
712 724
@@ -717,7 +729,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
717 if (del) 729 if (del)
718 transition_done = eina_future_then(transition_done, _delete_obj, NULL); 730 transition_done = eina_future_then(transition_done, _delete_obj, NULL);
719 731
720 efl_ui_spotlight_active_index_set(obj, new_index); 732 efl_ui_spotlight_active_element_set(obj, efl_pack_content_get(obj, new_index));
721 733
722 return transition_done; 734 return transition_done;
723} 735}
diff --git a/src/lib/elementary/efl_ui_spotlight_container.eo b/src/lib/elementary/efl_ui_spotlight_container.eo
index 31d39ef373..dc08b624ee 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.eo
+++ b/src/lib/elementary/efl_ui_spotlight_container.eo
@@ -9,7 +9,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl
9 [[The Spotlight widget is a container for other sub-widgets, where only one sub-widget is active at any given time. 9 [[The Spotlight widget is a container for other sub-widgets, where only one sub-widget is active at any given time.
10 10
11 Sub-widgets are added using the @Efl.Pack_Linear interface and the active one (the one in the "spotlight") is 11 Sub-widgets are added using the @Efl.Pack_Linear interface and the active one (the one in the "spotlight") is
12 selected using @.active_index. 12 selected using @.active_element.
13 13
14 The way the different sub-widgets are rendered can be customized through the @.spotlight_manager object. 14 The way the different sub-widgets are rendered can be customized through the @.spotlight_manager object.
15 For example, only the active sub-widget might be shown, or it might be shown in a central position whereas the 15 For example, only the active sub-widget might be shown, or it might be shown in a central position whereas the
@@ -46,14 +46,14 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl
46 indicator : Efl.Ui.Spotlight.Indicator @owned; [[The Indicator object or $NULL.]] 46 indicator : Efl.Ui.Spotlight.Indicator @owned; [[The Indicator object or $NULL.]]
47 } 47 }
48 } 48 }
49 @property active_index { 49 @property active_element {
50 [[Currently active sub-widget (the one with the spotlight) among all the sub-widgets added to this widget 50 [[Currently active sub-widget (the one with the spotlight) among all the sub-widgets added to this widget
51 51
52 Changing this value might trigger an animation. 52 Changing this value might trigger an animation.
53 ]] 53 ]]
54 values { 54 values {
55 index: int; [[Index of the sub-widget that has the spotlight, from 0 to the number of sub-widgets - 1 55 element : Efl.Ui.Widget; [[Sub-widget that has the spotlight.
56 (@Efl.Container.content_count - 1).]] 56 The element has to be added prior to this call via the @Efl.Pack_Linear interface.]]
57 } 57 }
58 } 58 }
59 @property spotlight_size { 59 @property spotlight_size {
@@ -66,7 +66,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl
66 } 66 }
67 } 67 }
68 push @beta { 68 push @beta {
69 [[Packs a new sub-widget at the position indicated by @.active_index (0 by default). 69 [[Packs a new sub-widget before @.active_element, and move the spotlight there.
70 70
71 This is the same behavior as a push operation on a stack. 71 This is the same behavior as a push operation on a stack.
72 72
@@ -81,7 +81,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl
81 81
82 The sub-widgets behind it naturally flow down so the next one gets the spotlight. 82 The sub-widgets behind it naturally flow down so the next one gets the spotlight.
83 This is the same behavior as a pop operation on a stack. 83 This is the same behavior as a pop operation on a stack.
84 When combined with @.push you don't have to worry about @.active_index since only the first sub-widget is 84 When combined with @.push you don't have to worry about @.active_element since only the first sub-widget is
85 manipulated. 85 manipulated.
86 86
87 An animation might be triggered to give the new sub-widget the spotlight, come into position and the old 87 An animation might be triggered to give the new sub-widget the spotlight, come into position and the old
diff --git a/src/lib/elementary/efl_ui_spotlight_indicator.eo b/src/lib/elementary/efl_ui_spotlight_indicator.eo
index c846048203..a680a0e726 100644
--- a/src/lib/elementary/efl_ui_spotlight_indicator.eo
+++ b/src/lib/elementary/efl_ui_spotlight_indicator.eo
@@ -1,7 +1,7 @@
1abstract @beta Efl.Ui.Spotlight.Indicator extends Efl.Object { 1abstract @beta Efl.Ui.Spotlight.Indicator extends Efl.Object {
2 [[Object used by @Efl.Ui.Spotlight.Container to render an indication of the active widgets' position among 2 [[Object used by @Efl.Ui.Spotlight.Container to render an indication of the active widgets' position among
3 the rest of the container's widgets. 3 the rest of the container's widgets.
4 4
5 An example would be Android's little dots in the home screen. 5 An example would be Android's little dots in the home screen.
6 ]] 6 ]]
7 methods { 7 methods {
@@ -19,31 +19,22 @@ abstract @beta Efl.Ui.Spotlight.Indicator extends Efl.Object {
19 } 19 }
20 } 20 }
21 content_add @pure_virtual { 21 content_add @pure_virtual {
22 [[A $subobj has been added at position $index in the bound container. 22 [[A $subobj has been added at position $index in the bound container.]]
23
24 The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have
25 shifted due to the insertion of the new object.
26 ]]
27 params { 23 params {
28 subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]] 24 subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]]
29 index : int; [[The index of the new object in the container's list.]] 25 index : int; [[The index of the new object in the container's list.]]
30 } 26 }
31 } 27 }
32 content_del @pure_virtual { 28 content_del @pure_virtual {
33 [[The $subobj at position $index in the bound container has been removed. 29 [[The $subobj at position $index in the bound container has been removed.]]
34
35 The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have
36 shifted due to the removal of the object.
37 ]]
38 params { 30 params {
39 subobj : Efl.Gfx.Entity; [[The object being removed from the container.]] 31 subobj : Efl.Gfx.Entity; [[The object being removed from the container.]]
40 index : int; [[The index this object had in the container's list.]] 32 index : int; [[The index this object had in the container's list.]]
41 } 33 }
42 } 34 }
43 position_update @pure_virtual { 35 position_update @pure_virtual {
44 [[This method tells the indicator that @Efl.Ui.Spotlight.Container.active_index has changed in the bound 36 [[This method tells the indicator that @Efl.Ui.Spotlight.Container.active_element has changed in the bound
45 container. 37 container.
46
47 $position ranges from -1 to the number of views in the bound container (@Efl.Container.content_count). 38 $position ranges from -1 to the number of views in the bound container (@Efl.Container.content_count).
48 Notice this allows moving to a position before the first view or past the last view, which might happen if the 39 Notice this allows moving to a position before the first view or past the last view, which might happen if the
49 view is thumb-scrolled out-of-bounds. Indicators can choose to render these out-of-bounds positions or not. 40 view is thumb-scrolled out-of-bounds. Indicators can choose to render these out-of-bounds positions or not.
diff --git a/src/lib/elementary/efl_ui_spotlight_manager.eo b/src/lib/elementary/efl_ui_spotlight_manager.eo
index 2257dfeefd..03f0e4fc35 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager.eo
@@ -2,11 +2,11 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
2 [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets, 2 [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets,
3 and user interaction. 3 and user interaction.
4 4
5 For instance, changes to the current sub-widget in the spotlight (@Efl.Ui.Spotlight.Container.active_index) can be 5 For instance, changes to the current sub-widget in the spotlight (@Efl.Ui.Spotlight.Container.active_element) can be
6 animated with a transition. 6 animated with a transition.
7 This object can also handle user interaction. For example, dragging the sub-widget to one side to get to a 7 This object can also handle user interaction. For example, dragging the sub-widget to one side to get to a
8 different sub-widget (like an smartphone home screen). 8 different sub-widget (like an smartphone home screen).
9 Such user interactions should end up setting a new @Efl.Ui.Spotlight.Container.active_index. 9 Such user interactions should end up setting a new @Efl.Ui.Spotlight.Container.active_element.
10 During a transition, the evolution of the current position should be exposed by emitting $pos_update events. 10 During a transition, the evolution of the current position should be exposed by emitting $pos_update events.
11 ]] 11 ]]
12 methods { 12 methods {
@@ -24,22 +24,14 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
24 } 24 }
25 } 25 }
26 content_add @pure_virtual { 26 content_add @pure_virtual {
27 [[A $subobj has been added at position $index in the bound container. 27 [[A $subobj has been added at position $index in the bound container.]]
28
29 The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have
30 shifted due to the insertion of the new object.
31 ]]
32 params { 28 params {
33 subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]] 29 subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]]
34 index : int; [[The index of the new object in the container's list.]] 30 index : int; [[The index of the new object in the container's list.]]
35 } 31 }
36 } 32 }
37 content_del @pure_virtual { 33 content_del @pure_virtual {
38 [[The $subobj at position $index in the bound container has been removed. 34 [[The $subobj at position $index in the bound container has been removed.]]
39
40 The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have
41 shifted due to the removal of the object.
42 ]]
43 params { 35 params {
44 subobj : Efl.Gfx.Entity; [[The object being removed from the container.]] 36 subobj : Efl.Gfx.Entity; [[The object being removed from the container.]]
45 index : int; [[The index this object had in the container's list.]] 37 index : int; [[The index this object had in the container's list.]]
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
index 5bbb5238f4..ec7c3a2782 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
@@ -10,8 +10,9 @@ typedef struct {
10 Efl_Ui_Spotlight_Container * container; 10 Efl_Ui_Spotlight_Container * container;
11 Efl_Gfx_Entity *group; 11 Efl_Gfx_Entity *group;
12 Eina_Size2D page_size; 12 Eina_Size2D page_size;
13 int current_content; 13 Efl_Ui_Widget *current_content;
14 Eina_Bool animation; 14 Eina_Bool animation;
15 double last_pos;
15} Efl_Ui_Spotlight_Manager_Plain_Data; 16} Efl_Ui_Spotlight_Manager_Plain_Data;
16 17
17#define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS 18#define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS
@@ -19,14 +20,17 @@ typedef struct {
19static void 20static void
20_emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) 21_emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
21{ 22{
22 double absolut_position = pd->current_content; 23 double absolut_position = efl_pack_index_get(pd->container, pd->current_content);
23 efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &absolut_position); 24 if (pd->last_pos != absolut_position)
25 efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &absolut_position);
26
27 pd->last_pos = absolut_position;
24} 28}
25 29
26static void 30static void
27_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) 31_geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
28{ 32{
29 Efl_Gfx_Entity *entity = efl_pack_content_get(pd->container, pd->current_content); 33 Efl_Gfx_Entity *entity = pd->current_content;
30 Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->group); 34 Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->group);
31 Eina_Rect goal = EINA_RECT_EMPTY(); 35 Eina_Rect goal = EINA_RECT_EMPTY();
32 36
@@ -58,7 +62,7 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
58{ 62{
59 if (spotlight && group) 63 if (spotlight && group)
60 { 64 {
61 int index; 65 Efl_Ui_Widget *index;
62 66
63 pd->container = spotlight; 67 pd->container = spotlight;
64 pd->group = group; 68 pd->group = group;
@@ -70,11 +74,11 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
70 efl_canvas_group_member_add(pd->group, elem); 74 efl_canvas_group_member_add(pd->group, elem);
71 efl_gfx_entity_visible_set(elem, EINA_FALSE); 75 efl_gfx_entity_visible_set(elem, EINA_FALSE);
72 } 76 }
73 index = efl_ui_spotlight_active_index_get(spotlight); 77 index = efl_ui_spotlight_active_element_get(spotlight);
74 if (index != -1) 78 if (index)
75 { 79 {
76 pd->current_content = index; 80 pd->current_content = index;
77 efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, pd->current_content), EINA_TRUE); 81 efl_gfx_entity_visible_set(pd->current_content, EINA_TRUE);
78 _geom_sync(obj, pd); 82 _geom_sync(obj, pd);
79 _emit_position(obj, pd); 83 _emit_position(obj, pd);
80 } 84 }
@@ -84,15 +88,15 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
84static void 88static void
85_content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) 89_content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
86{ 90{
87 if (efl_ui_spotlight_active_index_get(pd->container) != pd->current_content) 91 if (efl_ui_spotlight_active_element_get(pd->container) != pd->current_content)
88 { 92 {
89 int old_current_content = pd->current_content; 93 Efl_Ui_Widget *old_current_content = pd->current_content;
90 pd->current_content = efl_ui_spotlight_active_index_get(pd->container); 94 pd->current_content = efl_ui_spotlight_active_element_get(pd->container);
91 efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, old_current_content), EINA_FALSE); 95 efl_gfx_entity_visible_set(old_current_content, EINA_FALSE);
92 efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, pd->current_content), EINA_TRUE); 96 efl_gfx_entity_visible_set(pd->current_content, EINA_TRUE);
93 _geom_sync(obj, pd); 97 _geom_sync(obj, pd);
94 _emit_position(obj, pd);
95 } 98 }
99 _emit_position(obj, pd);
96} 100}
97 101
98EOLIAN static void 102EOLIAN static void
@@ -118,13 +122,13 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_
118 if (from_obj) 122 if (from_obj)
119 { 123 {
120 efl_gfx_entity_visible_set(from_obj, EINA_FALSE); 124 efl_gfx_entity_visible_set(from_obj, EINA_FALSE);
121 pd->current_content = -1; 125 pd->current_content = NULL;
122 } 126 }
123 127
124 if (to_obj) 128 if (to_obj)
125 { 129 {
126 efl_gfx_entity_visible_set(to_obj, EINA_TRUE); 130 efl_gfx_entity_visible_set(to_obj, EINA_TRUE);
127 pd->current_content = to; 131 pd->current_content = efl_pack_content_get(pd->container, to);
128 } 132 }
129 133
130 _emit_position(obj, pd); 134 _emit_position(obj, pd);
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
index bd0000faa8..e75c3f955f 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
@@ -45,7 +45,7 @@ _apply_box_properties(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd)
45 if (pd->transition.active) 45 if (pd->transition.active)
46 current_pos = pd->transition.from + ((double)pd->transition.to - pd->transition.from)*pd->transition.progress; 46 current_pos = pd->transition.from + ((double)pd->transition.to - pd->transition.from)*pd->transition.progress;
47 else 47 else
48 current_pos = efl_ui_spotlight_active_index_get(pd->container); 48 current_pos = efl_pack_index_get(pd->container, efl_ui_spotlight_active_element_get(pd->container));
49 49
50 efl_gfx_entity_geometry_set(pd->foreclip, group_pos); 50 efl_gfx_entity_geometry_set(pd->foreclip, group_pos);
51 //first calculate the size 51 //first calculate the size
@@ -106,7 +106,7 @@ _mouse_down_cb(void *data,
106 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj); 106 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj);
107 107
108 pd->mouse_move.active = EINA_TRUE; 108 pd->mouse_move.active = EINA_TRUE;
109 pd->mouse_move.from = efl_ui_spotlight_active_index_get(pd->container); 109 pd->mouse_move.from = efl_pack_index_get(pd->container, efl_ui_spotlight_active_element_get(pd->container));
110 pd->mouse_move.mouse_start = efl_input_pointer_position_get(ev); 110 pd->mouse_move.mouse_start = efl_input_pointer_position_get(ev);
111 111
112 pd->transition.from = pd->mouse_move.from; 112 pd->transition.from = pd->mouse_move.from;
@@ -158,7 +158,8 @@ _mouse_up_cb(void *data,
158 double absolut_current_position = (double)pd->transition.from + pd->transition.progress; 158 double absolut_current_position = (double)pd->transition.from + pd->transition.progress;
159 int result = round(absolut_current_position); 159 int result = round(absolut_current_position);
160 160
161 efl_ui_spotlight_active_index_set(pd->container, MIN(MAX(result, 0), efl_content_count(pd->container) - 1)); 161 Efl_Ui_Widget *new_content = efl_pack_content_get(pd->container, MIN(MAX(result, 0), efl_content_count(pd->container) - 1));
162 efl_ui_spotlight_active_element_set(pd->container, new_content);
162} 163}
163 164
164EFL_CALLBACKS_ARRAY_DEFINE(mouse_listeners, 165EFL_CALLBACKS_ARRAY_DEFINE(mouse_listeners,
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
index dbef2c200d..18756c0d5f 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
@@ -151,9 +151,9 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
151 efl_canvas_group_member_add(pd->group, elem); 151 efl_canvas_group_member_add(pd->group, elem);
152 efl_gfx_entity_visible_set(elem, EINA_FALSE); 152 efl_gfx_entity_visible_set(elem, EINA_FALSE);
153 } 153 }
154 if (efl_ui_spotlight_active_index_get(spotlight) != -1) 154 if (efl_ui_spotlight_active_element_get(spotlight))
155 { 155 {
156 pd->content = efl_pack_content_get(pd->container, efl_ui_spotlight_active_index_get(spotlight)); 156 pd->content = efl_ui_spotlight_active_element_get(spotlight);
157 efl_gfx_entity_visible_set(pd->content, EINA_TRUE); 157 efl_gfx_entity_visible_set(pd->content, EINA_TRUE);
158 _geom_sync(obj, pd); 158 _geom_sync(obj, pd);
159 } 159 }
diff --git a/src/lib/elementary/efl_ui_tab_pager.c b/src/lib/elementary/efl_ui_tab_pager.c
index f1a3dc4059..745a1dcb72 100644
--- a/src/lib/elementary/efl_ui_tab_pager.c
+++ b/src/lib/elementary/efl_ui_tab_pager.c
@@ -12,24 +12,21 @@
12#define MY_CLASS EFL_UI_TAB_PAGER_CLASS 12#define MY_CLASS EFL_UI_TAB_PAGER_CLASS
13 13
14static void 14static void
15_select(Eo *obj, int index) 15_select(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Page *page)
16{ 16{
17 Efl_Ui_Tab_Page *page = efl_pack_content_get(obj, index);
18
19 efl_ui_selectable_selected_set(efl_ui_tab_page_tab_bar_item_get(page), EINA_TRUE); 17 efl_ui_selectable_selected_set(efl_ui_tab_page_tab_bar_item_get(page), EINA_TRUE);
20} 18}
21 19
22static void 20static void
23_tab_select_cb(void *data, const Efl_Event *event) 21_tab_select_cb(void *data, const Efl_Event *event)
24{ 22{
25 EFL_UI_TAB_PAGER_DATA_GET(data, sd);
26 Efl_Ui_Tab_Bar_Default_Item *selected; 23 Efl_Ui_Tab_Bar_Default_Item *selected;
27 int i = 0; 24 Efl_Ui_Tab_Page *page;
28 25
29 selected = efl_ui_single_selectable_last_selected_get(event->object); 26 selected = efl_ui_single_selectable_last_selected_get(event->object);
30 i = efl_pack_index_get(sd->tab_bar, selected); 27 page = efl_parent_get(selected);
31 if (efl_ui_spotlight_active_index_get(data) != i) 28 if (efl_ui_spotlight_active_element_get(data))
32 efl_ui_spotlight_active_index_set(data, i); 29 efl_ui_spotlight_active_element_set(data, page);
33} 30}
34 31
35EOLIAN static Efl_Canvas_Object * 32EOLIAN static Efl_Canvas_Object *
@@ -39,10 +36,10 @@ _efl_ui_tab_pager_tab_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Pager_Data *
39} 36}
40 37
41EOLIAN static void 38EOLIAN static void
42_efl_ui_tab_pager_efl_ui_spotlight_container_active_index_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, int index) 39_efl_ui_tab_pager_efl_ui_spotlight_container_active_element_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, Efl_Ui_Widget *element)
43{ 40{
44 efl_ui_spotlight_active_index_set(efl_super(obj, MY_CLASS), index); 41 efl_ui_spotlight_active_element_set(efl_super(obj, MY_CLASS), element);
45 _select(obj, index); 42 _select(obj, element);
46} 43}
47 44
48EOLIAN static void 45EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_tab_pager.eo b/src/lib/elementary/efl_ui_tab_pager.eo
index e6b10757e6..9efb40c753 100644
--- a/src/lib/elementary/efl_ui_tab_pager.eo
+++ b/src/lib/elementary/efl_ui_tab_pager.eo
@@ -24,6 +24,6 @@ class @beta Efl.Ui.Tab_Pager extends Efl.Ui.Spotlight.Container
24 Efl.Pack_Linear.pack_after; 24 Efl.Pack_Linear.pack_after;
25 Efl.Pack_Linear.pack_at; 25 Efl.Pack_Linear.pack_at;
26 Efl.Pack_Linear.pack_unpack_at; 26 Efl.Pack_Linear.pack_unpack_at;
27 Efl.Ui.Spotlight.Container.active_index { set; } 27 Efl.Ui.Spotlight.Container.active_element { set; }
28 } 28 }
29} 29}
diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c
index 0bad5c362f..9749258273 100644
--- a/src/tests/elementary/efl_ui_test_spotlight.c
+++ b/src/tests/elementary/efl_ui_test_spotlight.c
@@ -21,13 +21,13 @@ typedef struct {
21 int called; 21 int called;
22 Efl_Gfx_Entity *subobj; 22 Efl_Gfx_Entity *subobj;
23 int index; 23 int index;
24 int current_page_at_call; 24 Efl_Ui_Widget *current_page_at_call;
25 } content_del; 25 } content_del;
26 struct { 26 struct {
27 int called; 27 int called;
28 Efl_Gfx_Entity *subobj; 28 Efl_Gfx_Entity *subobj;
29 int index; 29 int index;
30 int current_page_at_call; 30 Efl_Ui_Widget *current_page_at_call;
31 } content_add; 31 } content_add;
32 struct { 32 struct {
33 int called; 33 int called;
@@ -43,7 +43,7 @@ _indicator_content_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entity
43 indicator_calls.content_del.called ++; 43 indicator_calls.content_del.called ++;
44 indicator_calls.content_del.subobj = subobj; 44 indicator_calls.content_del.subobj = subobj;
45 indicator_calls.content_del.index = index; 45 indicator_calls.content_del.index = index;
46 indicator_calls.content_del.current_page_at_call = efl_ui_spotlight_active_index_get(container); 46 indicator_calls.content_del.current_page_at_call = efl_ui_spotlight_active_element_get(container);
47} 47}
48 48
49static void 49static void
@@ -52,7 +52,7 @@ _indicator_content_add(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entity
52 indicator_calls.content_add.called ++; 52 indicator_calls.content_add.called ++;
53 indicator_calls.content_add.subobj = subobj; 53 indicator_calls.content_add.subobj = subobj;
54 indicator_calls.content_add.index = index; 54 indicator_calls.content_add.index = index;
55 indicator_calls.content_add.current_page_at_call = efl_ui_spotlight_active_index_get(container); 55 indicator_calls.content_add.current_page_at_call = efl_ui_spotlight_active_element_get(container);
56} 56}
57 57
58static void 58static void
@@ -92,13 +92,13 @@ typedef struct {
92 int called; 92 int called;
93 Efl_Gfx_Entity *subobj; 93 Efl_Gfx_Entity *subobj;
94 int index; 94 int index;
95 int current_page_at_call; 95 Efl_Ui_Widget *current_page_at_call;
96 } content_del; 96 } content_del;
97 struct { 97 struct {
98 int called; 98 int called;
99 Efl_Gfx_Entity *subobj; 99 Efl_Gfx_Entity *subobj;
100 int index; 100 int index;
101 int current_page_at_call; 101 Efl_Ui_Widget *current_page_at_call;
102 } content_add; 102 } content_add;
103 struct { 103 struct {
104 int called; 104 int called;
@@ -125,7 +125,9 @@ Transition_Calls transition_calls = { 0 };
125static void 125static void
126_emit_pos(Eo *obj, double d) 126_emit_pos(Eo *obj, double d)
127{ 127{
128 printf("EMITTING %f %f\n", d, transition_calls.last_position);
128 if (d == transition_calls.last_position) return; 129 if (d == transition_calls.last_position) return;
130
129 efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &d); 131 efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &d);
130 transition_calls.last_position = d; 132 transition_calls.last_position = d;
131} 133}
@@ -136,9 +138,9 @@ _transition_content_add(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entit
136 transition_calls.content_add.called ++; 138 transition_calls.content_add.called ++;
137 transition_calls.content_add.subobj = subobj; 139 transition_calls.content_add.subobj = subobj;
138 transition_calls.content_add.index = index; 140 transition_calls.content_add.index = index;
139 transition_calls.content_add.current_page_at_call = efl_ui_spotlight_active_index_get(container); 141 transition_calls.content_add.current_page_at_call = efl_ui_spotlight_active_element_get(container);
140 142
141 int i = efl_ui_spotlight_active_index_get(container); 143 int i = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container));
142 if (i != -1) 144 if (i != -1)
143 _emit_pos(obj, i); 145 _emit_pos(obj, i);
144} 146}
@@ -149,9 +151,9 @@ _transition_content_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entit
149 transition_calls.content_del.called ++; 151 transition_calls.content_del.called ++;
150 transition_calls.content_del.subobj = subobj; 152 transition_calls.content_del.subobj = subobj;
151 transition_calls.content_del.index = index; 153 transition_calls.content_del.index = index;
152 transition_calls.content_del.current_page_at_call = efl_ui_spotlight_active_index_get(container); 154 transition_calls.content_del.current_page_at_call = efl_ui_spotlight_active_element_get(container);
153 155
154 int i = efl_ui_spotlight_active_index_get(container); 156 int i = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container));
155 if (i != -1) 157 if (i != -1)
156 _emit_pos(obj, i); 158 _emit_pos(obj, i);
157} 159}
@@ -224,7 +226,7 @@ EFL_START_TEST (efl_ui_spotlight_init)
224 Eina_Size2D s = efl_ui_spotlight_size_get(container); 226 Eina_Size2D s = efl_ui_spotlight_size_get(container);
225 ck_assert_int_eq(s.w, 0); //FIXME 227 ck_assert_int_eq(s.w, 0); //FIXME
226 ck_assert_int_eq(s.h, 0); //FIXME 228 ck_assert_int_eq(s.h, 0); //FIXME
227 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), -1); 229 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), NULL);
228} 230}
229EFL_END_TEST 231EFL_END_TEST
230 232
@@ -232,17 +234,23 @@ EFL_START_TEST (efl_ui_spotlight_active_index)
232{ 234{
233 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 235 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
234 efl_pack(container, w); 236 efl_pack(container, w);
235 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 0);
236 237
237 for (int i = -20; i < 20; ++i) 238 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
238 { 239 EXPECT_ERROR_START;
239 if (i == 0) continue; 240 efl_ui_spotlight_active_element_set(container, 0x0);
240 EXPECT_ERROR_START; 241 EXPECT_ERROR_END;
241 efl_ui_spotlight_active_index_set(container, i); 242 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
242 EXPECT_ERROR_END; 243 EXPECT_ERROR_START;
243 } 244 efl_ui_spotlight_active_element_set(container, (void*)0xAFFE);
245 EXPECT_ERROR_END;
246 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
247 EXPECT_ERROR_START;
248 efl_ui_spotlight_active_element_set(container, efl_main_loop_get());
249 EXPECT_ERROR_END;
250 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
251
244 efl_del(w); 252 efl_del(w);
245 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), -1); 253 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), NULL);
246} 254}
247EFL_END_TEST 255EFL_END_TEST
248 256
@@ -280,7 +288,7 @@ EFL_START_TEST (efl_ui_smart_transition_calls)
280 ck_assert_int_eq(transition_calls.content_add.called, 1); 288 ck_assert_int_eq(transition_calls.content_add.called, 1);
281 ck_assert_int_eq(transition_calls.content_add.index, 0); 289 ck_assert_int_eq(transition_calls.content_add.index, 0);
282 ck_assert_ptr_eq(transition_calls.content_add.subobj, w); 290 ck_assert_ptr_eq(transition_calls.content_add.subobj, w);
283 ck_assert_int_eq(transition_calls.content_add.current_page_at_call, -1); 291 ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, NULL);
284 ck_assert_int_eq(transition_calls.content_del.called, 0); 292 ck_assert_int_eq(transition_calls.content_del.called, 0);
285 transition_calls.content_add.called = 0; 293 transition_calls.content_add.called = 0;
286 transition_calls.request_switch.called = 0; 294 transition_calls.request_switch.called = 0;
@@ -293,11 +301,11 @@ EFL_START_TEST (efl_ui_smart_transition_calls)
293 ck_assert_int_eq(transition_calls.content_add.called, 1); 301 ck_assert_int_eq(transition_calls.content_add.called, 1);
294 ck_assert_int_eq(transition_calls.content_add.index, 0); 302 ck_assert_int_eq(transition_calls.content_add.index, 0);
295 ck_assert_ptr_eq(transition_calls.content_add.subobj, w1); 303 ck_assert_ptr_eq(transition_calls.content_add.subobj, w1);
296 ck_assert_int_eq(transition_calls.content_add.current_page_at_call, 1); 304 ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, w);
297 ck_assert_int_eq(transition_calls.content_del.called, 0); 305 ck_assert_int_eq(transition_calls.content_del.called, 0);
298 transition_calls.content_add.called = 0; 306 transition_calls.content_add.called = 0;
299 transition_calls.request_switch.called = 0; 307 transition_calls.request_switch.called = 0;
300 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 1); 308 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
301 309
302 //new object, must update the content and a not update current page 310 //new object, must update the content and a not update current page
303 efl_pack_end(container, w2); 311 efl_pack_end(container, w2);
@@ -307,13 +315,13 @@ EFL_START_TEST (efl_ui_smart_transition_calls)
307 ck_assert_int_eq(transition_calls.content_add.called, 1); 315 ck_assert_int_eq(transition_calls.content_add.called, 1);
308 ck_assert_int_eq(transition_calls.content_add.index, 2); 316 ck_assert_int_eq(transition_calls.content_add.index, 2);
309 ck_assert_ptr_eq(transition_calls.content_add.subobj, w2); 317 ck_assert_ptr_eq(transition_calls.content_add.subobj, w2);
310 ck_assert_int_eq(transition_calls.content_add.current_page_at_call, 1); 318 ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, w);
311 ck_assert_int_eq(transition_calls.content_del.called, 0); 319 ck_assert_int_eq(transition_calls.content_del.called, 0);
312 transition_calls.content_add.called = 0; 320 transition_calls.content_add.called = 0;
313 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 1); 321 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
314 322
315 //page change must result in a call to request a switch 323 //page change must result in a call to request a switch
316 efl_ui_spotlight_active_index_set(container, 2); 324 efl_ui_spotlight_active_element_set(container, w2);
317 ck_assert_int_eq(transition_calls.spotlight.called, 0); 325 ck_assert_int_eq(transition_calls.spotlight.called, 0);
318 ck_assert_int_eq(transition_calls.page_size.called, 0); 326 ck_assert_int_eq(transition_calls.page_size.called, 0);
319 ck_assert_int_eq(transition_calls.request_switch.called, 1); 327 ck_assert_int_eq(transition_calls.request_switch.called, 1);
@@ -332,7 +340,7 @@ EFL_START_TEST (efl_ui_smart_transition_calls)
332 ck_assert_int_eq(transition_calls.content_del.called, 1); 340 ck_assert_int_eq(transition_calls.content_del.called, 1);
333 ck_assert_int_eq(transition_calls.content_del.index, 1); 341 ck_assert_int_eq(transition_calls.content_del.index, 1);
334 ck_assert_ptr_eq(transition_calls.content_del.subobj, w); 342 ck_assert_ptr_eq(transition_calls.content_del.subobj, w);
335 ck_assert_int_eq(transition_calls.content_del.current_page_at_call, 1); 343 ck_assert_ptr_eq(transition_calls.content_del.current_page_at_call, w2);
336 transition_calls.content_del.called = 0; 344 transition_calls.content_del.called = 0;
337} 345}
338EFL_END_TEST 346EFL_END_TEST
@@ -486,7 +494,7 @@ _verify_transition_start_end_events(void)
486 ck_assert_int_eq(end.from, -8); 494 ck_assert_int_eq(end.from, -8);
487 495
488 EV_RESET 496 EV_RESET
489 efl_ui_spotlight_active_index_set(container, 2); 497 efl_ui_spotlight_active_element_set(container, w2);
490 ck_assert_int_eq(start.to, 2); 498 ck_assert_int_eq(start.to, 2);
491 ck_assert_int_eq(end.to, 2); 499 ck_assert_int_eq(end.to, 2);
492 ck_assert_int_eq(start.from, 1); 500 ck_assert_int_eq(start.from, 1);
@@ -511,7 +519,7 @@ EFL_START_TEST (efl_ui_spotlight_test_push1)
511 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 519 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
512 efl_ui_spotlight_push(container, w); 520 efl_ui_spotlight_push(container, w);
513 ck_assert_int_eq(efl_pack_index_get(container, w), 0); 521 ck_assert_int_eq(efl_pack_index_get(container, w), 0);
514 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 0); 522 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 0));
515} 523}
516EFL_END_TEST 524EFL_END_TEST
517 525
@@ -521,13 +529,13 @@ EFL_START_TEST (efl_ui_spotlight_test_push2)
521 { 529 {
522 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 530 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
523 efl_pack_end(container, w); 531 efl_pack_end(container, w);
532 if (i == 3)
533 efl_ui_spotlight_active_element_set(container, w);
524 } 534 }
525 efl_ui_spotlight_active_index_set(container, 3);
526
527 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 535 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
528 efl_ui_spotlight_push(container, w); 536 efl_ui_spotlight_push(container, w);
529 ck_assert_int_eq(efl_pack_index_get(container, w), 3); 537 ck_assert_int_eq(efl_pack_index_get(container, w), 3);
530 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 3); 538 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
531} 539}
532EFL_END_TEST 540EFL_END_TEST
533 541
@@ -590,16 +598,17 @@ EFL_START_TEST (efl_ui_spotlight_test_pop3)
590 { 598 {
591 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 599 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
592 efl_pack_end(container, w); 600 efl_pack_end(container, w);
601 if (i == 3)
602 efl_ui_spotlight_active_element_set(container, w);
593 } 603 }
594 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 604 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
595 efl_ui_spotlight_active_index_set(container, 3);
596 efl_ui_spotlight_push(container, w); 605 efl_ui_spotlight_push(container, w);
597 Eina_Future *f = efl_ui_spotlight_pop(container, EINA_TRUE); 606 Eina_Future *f = efl_ui_spotlight_pop(container, EINA_TRUE);
598 for (int i = 0; i < 10; ++i) 607 for (int i = 0; i < 10; ++i)
599 { 608 {
600 efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS)); 609 efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS));
601 } 610 }
602 ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 3); 611 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 3));
603 ck_assert_int_eq(efl_ref_count(w), 0); 612 ck_assert_int_eq(efl_ref_count(w), 0);
604 ck_assert_int_eq(efl_content_count(container), 5); 613 ck_assert_int_eq(efl_content_count(container), 5);
605 ck_assert_ptr_ne(f, NULL); 614 ck_assert_ptr_ne(f, NULL);