summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-18 18:45:50 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-19 07:38:08 +0200
commit0a4beb291d83c392a4b8e0928ae901a5d7826a31 (patch)
treea56eaf92d8d67ce984668f8b213a17c5bf9962f6
parente71c9ad00b9038e09fd1e40584c24c32c73d41cf (diff)
efl_ui_stack: remove!
this can now be done with active_view. This is done in order to reduce the LOC in elementary that basically do the same. Differential Revision: https://phab.enlightenment.org/D8920
-rw-r--r--src/bin/elementary/test.c3
-rw-r--r--src/bin/elementary/test_ui_active_view.c479
-rw-r--r--src/bin/elementary/test_ui_stack.c85
-rw-r--r--src/lib/elementary/Efl_Ui.h2
-rw-r--r--src/lib/elementary/efl_ui_active_view_container.c80
-rw-r--r--src/lib/elementary/efl_ui_active_view_container.eo53
-rw-r--r--src/lib/elementary/efl_ui_active_view_util.c21
-rw-r--r--src/lib/elementary/efl_ui_active_view_util.eo11
-rw-r--r--src/lib/elementary/efl_ui_navigation_bar.c8
-rw-r--r--src/lib/elementary/efl_ui_stack.c697
-rw-r--r--src/lib/elementary/efl_ui_stack.eo131
-rw-r--r--src/lib/elementary/efl_ui_stack_private.h31
-rw-r--r--src/lib/elementary/meson.build5
-rw-r--r--src/tests/elementary/efl_ui_test_active_view.c107
14 files changed, 474 insertions, 1239 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 31a0fa0db6..c797426c2c 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -1119,7 +1119,7 @@ add_tests:
1119 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Plain", test_ui_active_view_plain); 1119 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Plain", test_ui_active_view_plain);
1120 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Scroll", test_ui_active_view_scroll); 1120 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Scroll", test_ui_active_view_scroll);
1121 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Stack", test_ui_active_view_stack); 1121 ADD_TEST_EO(NULL, "Active View", "Efl.Ui.Active_View Stack", test_ui_active_view_stack);
1122 1122 ADD_TEST_EO(NULL, "Active View", "Navigation stack", test_ui_stack);
1123 //------------------------------// 1123 //------------------------------//
1124 ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup); 1124 ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup);
1125 ADD_TEST(NULL, "Popups", "Hover", test_hover); 1125 ADD_TEST(NULL, "Popups", "Hover", test_hover);
@@ -1184,7 +1184,6 @@ add_tests:
1184 ADD_TEST(NULL, "Naviframe", "Naviframe 2", test_naviframe2); 1184 ADD_TEST(NULL, "Naviframe", "Naviframe 2", test_naviframe2);
1185 ADD_TEST(NULL, "Naviframe", "Naviframe 3", test_naviframe3); 1185 ADD_TEST(NULL, "Naviframe", "Naviframe 3", test_naviframe3);
1186 ADD_TEST(NULL, "Naviframe", "Naviframe: Complex", test_naviframe_complex); 1186 ADD_TEST(NULL, "Naviframe", "Naviframe: Complex", test_naviframe_complex);
1187 ADD_TEST_EO(NULL, "Naviframe", "Efl.Ui.Stack", test_ui_stack);
1188 1187
1189 //------------------------------// 1188 //------------------------------//
1190 ADD_TEST(NULL, "Geographic", "Map", test_map); 1189 ADD_TEST(NULL, "Geographic", "Map", test_map);
diff --git a/src/bin/elementary/test_ui_active_view.c b/src/bin/elementary/test_ui_active_view.c
index 71fc9ba0b0..8f0d21febb 100644
--- a/src/bin/elementary/test_ui_active_view.c
+++ b/src/bin/elementary/test_ui_active_view.c
@@ -7,13 +7,15 @@
7#include <Efl_Ui.h> 7#include <Efl_Ui.h>
8#include <Elementary.h> 8#include <Elementary.h>
9 9
10typedef enum _Page_Type { 10typedef enum _View_Type
11{
11 LAYOUT, 12 LAYOUT,
12 LIST, 13 LIST,
13 BUTTON 14 BUTTON
14} Page_Type; 15} View_Type;
15 16
16typedef enum _Pack_Type { 17typedef enum _Pack_Type
18{
17 PACK_BEGIN, 19 PACK_BEGIN,
18 PACK_END, 20 PACK_END,
19 PACK_BEFORE, 21 PACK_BEFORE,
@@ -23,82 +25,90 @@ typedef enum _Pack_Type {
23 CLEAR 25 CLEAR
24} Pack_Type; 26} Pack_Type;
25 27
26typedef struct _Params { 28typedef struct _Params
29{
27 Evas_Object *navi; 30 Evas_Object *navi;
28 Eo *active_view; 31 Eo *active_view;
29 Eo *indicator; 32 Eo *indicator;
30 int w, h; 33 int w, h;
31 Eina_Bool wfill, hfill; 34 Eina_Bool wfill, hfill;
32} Params; 35} Params;
33 36
34typedef struct _Page_Set_Params { 37typedef struct _Page_Set_Params
38{
35 Eo *active_view; 39 Eo *active_view;
36 Eo *spinner; 40 Eo *spinner;
37} Page_Set_Params; 41} Page_Set_Params;
38 42
39typedef struct _Pack_Params { 43typedef struct _Pack_Params
44{
40 Pack_Type type; 45 Pack_Type type;
41 Eo *active_view; 46 Eo *active_view;
42 Eo *pack_sp; 47 Eo *pack_sp;
43 Eo *unpack_sp; 48 Eo *unpack_sp;
44 Eo *unpack_btn; 49 Eo *unpack_btn;
45} Pack_Params; 50} Pack_Params;
46 51
47typedef struct _Size_Params { 52typedef struct _Size_Params
48 Eo *active_view; 53{
49 Eo *slider; 54 Eo *active_view;
55 Eo *slider;
50 Params *params; 56 Params *params;
51} Size_Params; 57} Size_Params;
52 58
53#define PAGE_NUM 3 59#define PAGE_NUM 3
54 60
55static Eo* 61static Eo *
56page_add(Page_Type p, Eo *parent) 62view_add(View_Type p, Eo *parent)
57{ 63{
58 Eo *page; 64 Eo *page;
59 char buf[PATH_MAX]; 65 char buf[PATH_MAX];
60 int i; 66 int i;
61 67
62 switch (p) { 68 switch (p)
63 case LAYOUT: 69 {
64 snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", 70 case LAYOUT:
65 elm_app_data_dir_get()); 71 snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
66 page = efl_add(EFL_UI_LAYOUT_CLASS, parent, 72 elm_app_data_dir_get());
67 efl_file_set(efl_added, buf), 73 page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
68 efl_file_key_set(efl_added, "page"), 74 efl_file_set(efl_added, buf),
69 efl_file_load(efl_added), 75 efl_file_key_set(efl_added, "page"),
70 efl_text_set(efl_part(efl_added, "text"), "Layout Page")); 76 efl_file_load(efl_added),
71 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); 77 efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
72 break; 78 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
73 case LIST: 79 break;
74 page = elm_list_add(parent); 80
75 elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS); 81 case LIST:
76 evas_object_show(page); 82 page = elm_list_add(parent);
77 for (i = 0; i < 20; i++) { 83 elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS);
78 snprintf(buf, sizeof(buf), "List Page - Item #%d", i); 84 evas_object_show(page);
79 elm_list_item_append(page, buf, NULL, NULL, NULL, NULL); 85 for (i = 0; i < 20; i++) {
80 } 86 snprintf(buf, sizeof(buf), "List Page - Item #%d", i);
81 evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND, 87 elm_list_item_append(page, buf, NULL, NULL, NULL, NULL);
82 EVAS_HINT_EXPAND); 88 }
83 evas_object_size_hint_align_set(page, EVAS_HINT_FILL, 89 evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND,
84 EVAS_HINT_FILL); 90 EVAS_HINT_EXPAND);
85 break; 91 evas_object_size_hint_align_set(page, EVAS_HINT_FILL,
86 case BUTTON: 92 EVAS_HINT_FILL);
87 page = efl_add(EFL_UI_BUTTON_CLASS, parent, 93 break;
88 efl_text_set(efl_added, "Button Page")); 94
89 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); 95 case BUTTON:
90 break; 96 page = efl_add(EFL_UI_BUTTON_CLASS, parent,
91 default: 97 efl_text_set(efl_added, "Button Page"));
92 snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj", 98 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
93 elm_app_data_dir_get()); 99 break;
94 page = efl_add(EFL_UI_LAYOUT_CLASS, parent, 100
95 efl_file_set(efl_added, buf), 101 default:
96 efl_file_key_set(efl_added, "page"), 102 snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
97 efl_file_load(efl_added), 103 elm_app_data_dir_get());
98 efl_text_set(efl_part(efl_added, "text"), "Layout Page")); 104 page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
99 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); 105 efl_file_set(efl_added, buf),
100 break; 106 efl_file_key_set(efl_added, "page"),
101 } 107 efl_file_load(efl_added),
108 efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
109 efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
110 break;
111 }
102 112
103 return page; 113 return page;
104} 114}
@@ -110,7 +120,7 @@ prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
110 int active_index = efl_ui_active_view_active_index_get(active_view); 120 int active_index = efl_ui_active_view_active_index_get(active_view);
111 121
112 if (active_index - 1 > -1) 122 if (active_index - 1 > -1)
113 efl_ui_active_view_active_index_set(active_view, active_index -1); 123 efl_ui_active_view_active_index_set(active_view, active_index - 1);
114} 124}
115 125
116static void 126static void
@@ -120,7 +130,7 @@ next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
120 int active_index = efl_ui_active_view_active_index_get(active_view); 130 int active_index = efl_ui_active_view_active_index_get(active_view);
121 131
122 if (active_index + 1 < efl_content_count(active_view)) 132 if (active_index + 1 < efl_content_count(active_view))
123 efl_ui_active_view_active_index_set(active_view, active_index +1); 133 efl_ui_active_view_active_index_set(active_view, active_index + 1);
124} 134}
125 135
126static void 136static void
@@ -215,55 +225,67 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
215 Eo *page = NULL, *curr_page; 225 Eo *page = NULL, *curr_page;
216 int index, cnt; 226 int index, cnt;
217 227
218 if ((param->type != UNPACK_AT) && (param->type != CLEAR)) { 228 if ((param->type != UNPACK_AT) && (param->type != CLEAR))
219 index = efl_content_count(active_view); 229 {
220 230 index = efl_content_count(active_view);
221 switch (index % 3) { 231
222 case 0: 232 switch (index % 3)
223 page = page_add(LAYOUT, active_view); 233 {
224 break; 234 case 0:
225 case 1: 235 page = view_add(LAYOUT, active_view);
226 page = page_add(LIST, active_view); 236 break;
227 break; 237
228 case 2: 238 case 1:
229 page = page_add(BUTTON, active_view); 239 page = view_add(LIST, active_view);
230 break; 240 break;
231 default: 241
232 page = page_add(LAYOUT, active_view); 242 case 2:
233 break; 243 page = view_add(BUTTON, active_view);
234 } 244 break;
235 } 245
236 246 default:
237 switch (param->type) { 247 page = view_add(LAYOUT, active_view);
238 case PACK_BEGIN: 248 break;
239 efl_pack_begin(active_view, page); 249 }
240 break; 250 }
241 case PACK_END: 251
242 efl_pack_end(active_view, page); 252 switch (param->type)
243 break; 253 {
244 case PACK_BEFORE: 254 case PACK_BEGIN:
245 index = efl_ui_active_view_active_index_get(active_view); 255 efl_pack_begin(active_view, page);
246 curr_page = efl_pack_content_get(active_view, index); 256 break;
247 efl_pack_before(active_view, page, curr_page); 257
248 break; 258 case PACK_END:
249 case PACK_AFTER: 259 efl_pack_end(active_view, page);
250 index = efl_ui_active_view_active_index_get(active_view); 260 break;
251 curr_page = efl_pack_content_get(active_view, index); 261
252 efl_pack_after(active_view, page, curr_page); 262 case PACK_BEFORE:
253 break; 263 index = efl_ui_active_view_active_index_get(active_view);
254 case PACK_AT: 264 curr_page = efl_pack_content_get(active_view, index);
255 index = efl_ui_range_value_get(param->pack_sp); 265 efl_pack_before(active_view, page, curr_page);
256 efl_pack_at(active_view, page, index); 266 break;
257 break; 267
258 case UNPACK_AT: 268 case PACK_AFTER:
259 index = efl_ui_range_value_get(param->unpack_sp); 269 index = efl_ui_active_view_active_index_get(active_view);
260 page = efl_pack_unpack_at(active_view, index); 270 curr_page = efl_pack_content_get(active_view, index);
261 efl_del(page); 271 efl_pack_after(active_view, page, curr_page);
262 break; 272 break;
263 case CLEAR: 273
264 efl_pack_clear(active_view); 274 case PACK_AT:
265 break; 275 index = efl_ui_range_value_get(param->pack_sp);
266 } 276 efl_pack_at(active_view, page, index);
277 break;
278
279 case UNPACK_AT:
280 index = efl_ui_range_value_get(param->unpack_sp);
281 page = efl_pack_unpack_at(active_view, index);
282 efl_del(page);
283 break;
284
285 case CLEAR:
286 efl_pack_clear(active_view);
287 break;
288 }
267 289
268 cnt = efl_content_count(active_view); 290 cnt = efl_content_count(active_view);
269 291
@@ -302,7 +324,7 @@ page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
302 Page_Set_Params *psp = data; 324 Page_Set_Params *psp = data;
303 325
304 efl_ui_active_view_active_index_set(psp->active_view, 326 efl_ui_active_view_active_index_set(psp->active_view,
305 efl_ui_range_value_get(psp->spinner)); 327 efl_ui_range_value_get(psp->spinner));
306} 328}
307 329
308static void 330static void
@@ -329,8 +351,8 @@ indicator_none_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
329 351
330static void 352static void
331active_view_size(void *data, 353active_view_size(void *data,
332 Evas_Object *obj EINA_UNUSED, 354 Evas_Object *obj EINA_UNUSED,
333 void *event_info EINA_UNUSED) 355 void *event_info EINA_UNUSED)
334{ 356{
335 Params *params = data; 357 Params *params = data;
336 Size_Params *size_params; 358 Size_Params *size_params;
@@ -355,7 +377,7 @@ active_view_size(void *data,
355 efl_gfx_entity_visible_set(fr, 1); 377 efl_gfx_entity_visible_set(fr, 1);
356 378
357 inbox = efl_add(EFL_UI_BOX_CLASS, fr, 379 inbox = efl_add(EFL_UI_BOX_CLASS, fr,
358 efl_content_set(fr, efl_added)); 380 efl_content_set(fr, efl_added));
359 381
360 ck = elm_check_add(inbox); 382 ck = elm_check_add(inbox);
361 elm_object_text_set(ck, "Fill"); 383 elm_object_text_set(ck, "Fill");
@@ -396,7 +418,7 @@ active_view_size(void *data,
396 efl_gfx_entity_visible_set(fr, 1); 418 efl_gfx_entity_visible_set(fr, 1);
397 419
398 inbox = efl_add(EFL_UI_BOX_CLASS, fr, 420 inbox = efl_add(EFL_UI_BOX_CLASS, fr,
399 efl_content_set(fr, efl_added)); 421 efl_content_set(fr, efl_added));
400 422
401 ck = elm_check_add(inbox); 423 ck = elm_check_add(inbox);
402 elm_object_text_set(ck, "Fill"); 424 elm_object_text_set(ck, "Fill");
@@ -430,56 +452,6 @@ active_view_size(void *data,
430} 452}
431 453
432static void 454static void
433_gravity_changed_cb(void *data, const Efl_Event *ev)
434{
435 Params *params = data;
436
437 if (efl_ui_nstate_value_get(ev->object) == 0)
438 {
439 efl_ui_active_view_gravity_set(params->active_view, EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_INDEX);
440 }
441 else
442 {
443 efl_ui_active_view_gravity_set(params->active_view, EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT);
444 }
445}
446
447static void
448view_index_gravity_cb(void *data,
449 Evas_Object *obj EINA_UNUSED,
450 void *event_info EINA_UNUSED)
451{
452 Params *params = data;
453 Evas_Object *navi = params->navi;
454 Eo *btn, *box, *ck;
455
456 btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
457 efl_text_set(efl_added, "Back"),
458 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
459 back_btn_cb, navi));
460
461 box = efl_add(EFL_UI_BOX_CLASS, navi,
462 elm_naviframe_item_push(navi, "View Index Gravity", btn, NULL,
463 efl_added, NULL));
464
465 // Width
466
467 ck = efl_add(EFL_UI_CHECK_CLASS, box);
468 efl_event_callback_add(ck, EFL_UI_NSTATE_EVENT_CHANGED, _gravity_changed_cb, params);
469 efl_text_set(ck, "Content Index Gravity");
470 efl_pack_end(box, ck);
471 efl_gfx_entity_visible_set(ck, 1);
472 if (efl_ui_active_view_gravity_get(params->active_view) == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT)
473 {
474 efl_ui_nstate_value_set(ck, 1);
475 }
476 else
477 {
478 efl_ui_nstate_value_set(ck, 0);
479 }
480}
481
482static void
483_animation_cb(void *data, const Efl_Event *ev) 455_animation_cb(void *data, const Efl_Event *ev)
484{ 456{
485 Params *params = data; 457 Params *params = data;
@@ -489,8 +461,8 @@ _animation_cb(void *data, const Efl_Event *ev)
489 461
490static void 462static void
491view_animation_cb(void *data, 463view_animation_cb(void *data,
492 Evas_Object *obj EINA_UNUSED, 464 Evas_Object *obj EINA_UNUSED,
493 void *event_info EINA_UNUSED) 465 void *event_info EINA_UNUSED)
494{ 466{
495 Params *params = data; 467 Params *params = data;
496 Evas_Object *navi = params->navi; 468 Evas_Object *navi = params->navi;
@@ -515,8 +487,8 @@ view_animation_cb(void *data,
515 487
516static void 488static void
517pack_cb(void *data, 489pack_cb(void *data,
518 Evas_Object *obj EINA_UNUSED, 490 Evas_Object *obj EINA_UNUSED,
519 void *event_info EINA_UNUSED) 491 void *event_info EINA_UNUSED)
520{ 492{
521 Params *params = (Params *)data; 493 Params *params = (Params *)data;
522 Evas_Object *navi = params->navi; 494 Evas_Object *navi = params->navi;
@@ -695,13 +667,12 @@ pack_cb(void *data,
695 efl_event_callback_add(efl_added, EFL_EVENT_DEL, 667 efl_event_callback_add(efl_added, EFL_EVENT_DEL,
696 pack_btn_del_cb, pack_param), 668 pack_btn_del_cb, pack_param),
697 efl_pack_end(box, efl_added)); 669 efl_pack_end(box, efl_added));
698
699} 670}
700 671
701static void 672static void
702active_index_cb(void *data, 673active_index_cb(void *data,
703 Evas_Object *obj EINA_UNUSED, 674 Evas_Object *obj EINA_UNUSED,
704 void *event_info EINA_UNUSED) 675 void *event_info EINA_UNUSED)
705{ 676{
706 Params *params = (Params *)data; 677 Params *params = (Params *)data;
707 Evas_Object *navi = params->navi; 678 Evas_Object *navi = params->navi;
@@ -717,7 +688,7 @@ active_index_cb(void *data,
717 688
718 box = efl_add(EFL_UI_BOX_CLASS, navi, 689 box = efl_add(EFL_UI_BOX_CLASS, navi,
719 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), 690 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
720 elm_naviframe_item_push(navi, "Active Index", btn, NULL, 691 elm_naviframe_item_push(navi, "Active Index", btn, NULL,
721 efl_added, NULL)); 692 efl_added, NULL));
722 693
723 btn = efl_add(EFL_UI_BUTTON_CLASS, box, 694 btn = efl_add(EFL_UI_BUTTON_CLASS, box,
@@ -750,8 +721,8 @@ active_index_cb(void *data,
750 721
751static void 722static void
752indicator_cb(void *data, 723indicator_cb(void *data,
753 Evas_Object *obj EINA_UNUSED, 724 Evas_Object *obj EINA_UNUSED,
754 void *event_info EINA_UNUSED) 725 void *event_info EINA_UNUSED)
755{ 726{
756 Params *params = (Params *)data; 727 Params *params = (Params *)data;
757 Evas_Object *navi = params->navi; 728 Evas_Object *navi = params->navi;
@@ -780,11 +751,12 @@ indicator_cb(void *data,
780 efl_pack_end(box, efl_added)); 751 efl_pack_end(box, efl_added));
781} 752}
782 753
783void test_ui_active_view_stack(void *data EINA_UNUSED, 754void
784 Evas_Object *obj EINA_UNUSED, 755test_ui_active_view_stack(void *data EINA_UNUSED,
785 void *event_info EINA_UNUSED) 756 Evas_Object *obj EINA_UNUSED,
757 void *event_info EINA_UNUSED)
786{ 758{
787 Eo *win, *panes, *navi, *list, *layout, *active_view, *page; 759 Eo *win, *panes, *navi, *list, *layout, *active_view, *view;
788 Params *params = NULL; 760 Params *params = NULL;
789 char buf[PATH_MAX]; 761 char buf[PATH_MAX];
790 int i; 762 int i;
@@ -818,8 +790,8 @@ void test_ui_active_view_stack(void *data EINA_UNUSED,
818 efl_content_set(efl_part(panes, "second"), efl_added)); 790 efl_content_set(efl_part(panes, "second"), efl_added));
819 791
820 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout, 792 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout,
821 efl_content_set(efl_part(layout, "pager"), efl_added), 793 efl_content_set(efl_part(layout, "pager"), efl_added),
822 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300))); 794 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300)));
823 795
824 efl_ui_active_view_manager_set(active_view, efl_new(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_STACK_CLASS)); 796 efl_ui_active_view_manager_set(active_view, efl_new(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_STACK_CLASS));
825 797
@@ -850,38 +822,43 @@ void test_ui_active_view_stack(void *data EINA_UNUSED,
850 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params); 822 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params);
851 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params); 823 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params);
852 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params); 824 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params);
853 elm_list_item_append(list, "View Index Gravity", NULL, NULL, view_index_gravity_cb, params);
854 elm_list_item_append(list, "Animation", NULL, NULL, view_animation_cb, params); 825 elm_list_item_append(list, "Animation", NULL, NULL, view_animation_cb, params);
855 elm_list_go(list); 826 elm_list_go(list);
856 827
857 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params); 828 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params);
858 829
859 for (i = 0; i < PAGE_NUM; i++) { 830 for (i = 0; i < PAGE_NUM; i++)
860 switch (i % 3) { 831 {
861 case 0: 832 switch (i % 3)
862 page = page_add(LAYOUT, active_view); 833 {
863 break; 834 case 0:
864 case 1: 835 view = view_add(LAYOUT, active_view);
865 page = page_add(LIST, active_view); 836 break;
866 break; 837
867 case 2: 838 case 1:
868 page = page_add(BUTTON, active_view); 839 view = view_add(LIST, active_view);
869 break; 840 break;
870 default: 841
871 page = page_add(LAYOUT, active_view); 842 case 2:
872 break; 843 view = view_add(BUTTON, active_view);
873 } 844 break;
874 efl_pack_end(active_view, page); 845
875 } 846 default:
847 view = view_add(LAYOUT, active_view);
848 break;
849 }
850 efl_pack_end(active_view, view);
851 }
876 852
877 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320)); 853 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320));
878} 854}
879 855
880void test_ui_active_view_plain(void *data EINA_UNUSED, 856void
881 Evas_Object *obj EINA_UNUSED, 857test_ui_active_view_plain(void *data EINA_UNUSED,
882 void *event_info EINA_UNUSED) 858 Evas_Object *obj EINA_UNUSED,
859 void *event_info EINA_UNUSED)
883{ 860{
884 Eo *win, *panes, *navi, *list, *layout, *active_view, *page; 861 Eo *win, *panes, *navi, *list, *layout, *active_view, *view;
885 Params *params = NULL; 862 Params *params = NULL;
886 char buf[PATH_MAX]; 863 char buf[PATH_MAX];
887 int i; 864 int i;
@@ -915,8 +892,8 @@ void test_ui_active_view_plain(void *data EINA_UNUSED,
915 efl_content_set(efl_part(panes, "second"), efl_added)); 892 efl_content_set(efl_part(panes, "second"), efl_added));
916 893
917 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout, 894 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout,
918 efl_content_set(efl_part(layout, "pager"), efl_added), 895 efl_content_set(efl_part(layout, "pager"), efl_added),
919 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300))); 896 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300)));
920 897
921 efl_add(EFL_UI_BUTTON_CLASS, layout, 898 efl_add(EFL_UI_BUTTON_CLASS, layout,
922 efl_text_set(efl_added, "Prev"), 899 efl_text_set(efl_added, "Prev"),
@@ -945,38 +922,42 @@ void test_ui_active_view_plain(void *data EINA_UNUSED,
945 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params); 922 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params);
946 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params); 923 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params);
947 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params); 924 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params);
948 elm_list_item_append(list, "View Index Gravity", NULL, NULL, view_index_gravity_cb, params);
949 elm_list_go(list); 925 elm_list_go(list);
950 926
951 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params); 927 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params);
952 928
953 for (i = 0; i < PAGE_NUM; i++) { 929 for (i = 0; i < PAGE_NUM; i++)
954 switch (i % 3) { 930 {
955 case 0: 931 switch (i % 3)
956 page = page_add(LAYOUT, active_view); 932 {
957 break; 933 case 0:
958 case 1: 934 view = view_add(LAYOUT, active_view);
959 page = page_add(LIST, active_view); 935 break;
960 break; 936
961 case 2: 937 case 1:
962 page = page_add(BUTTON, active_view); 938 view = view_add(LIST, active_view);
963 break; 939 break;
964 default: 940
965 page = page_add(LAYOUT, active_view); 941 case 2:
966 break; 942 view = view_add(BUTTON, active_view);
967 } 943 break;
968 efl_pack_end(active_view, page); 944
969 } 945 default:
946 view = view_add(LAYOUT, active_view);
947 break;
948 }
949 efl_pack_end(active_view, view);
950 }
970 951
971 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320)); 952 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320));
972} 953}
973 954
974 955void
975void test_ui_active_view_scroll(void *data EINA_UNUSED, 956test_ui_active_view_scroll(void *data EINA_UNUSED,
976 Evas_Object *obj EINA_UNUSED, 957 Evas_Object *obj EINA_UNUSED,
977 void *event_info EINA_UNUSED) 958 void *event_info EINA_UNUSED)
978{ 959{
979 Eo *win, *panes, *navi, *list, *layout, *active_view, *page; 960 Eo *win, *panes, *navi, *list, *layout, *active_view, *view;
980 Params *params = NULL; 961 Params *params = NULL;
981 char buf[PATH_MAX]; 962 char buf[PATH_MAX];
982 int i; 963 int i;
@@ -1010,8 +991,8 @@ void test_ui_active_view_scroll(void *data EINA_UNUSED,
1010 efl_content_set(efl_part(panes, "second"), efl_added)); 991 efl_content_set(efl_part(panes, "second"), efl_added));
1011 992
1012 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout, 993 active_view = efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, layout,
1013 efl_content_set(efl_part(layout, "pager"), efl_added), 994 efl_content_set(efl_part(layout, "pager"), efl_added),
1014 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300))); 995 efl_ui_active_view_size_set(efl_added, EINA_SIZE2D(200, 300)));
1015 996
1016 efl_ui_active_view_manager_set(active_view, efl_new(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_SCROLL_CLASS)); 997 efl_ui_active_view_manager_set(active_view, efl_new(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_SCROLL_CLASS));
1017 998
@@ -1042,29 +1023,33 @@ void test_ui_active_view_scroll(void *data EINA_UNUSED,
1042 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params); 1023 elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params);
1043 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params); 1024 elm_list_item_append(list, "Active Index", NULL, NULL, active_index_cb, params);
1044 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params); 1025 elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params);
1045 elm_list_item_append(list, "View Index Gravity", NULL, NULL, view_index_gravity_cb, params);
1046 elm_list_item_append(list, "Animation", NULL, NULL, view_animation_cb, params); 1026 elm_list_item_append(list, "Animation", NULL, NULL, view_animation_cb, params);
1047 elm_list_go(list); 1027 elm_list_go(list);
1048 1028
1049 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params); 1029 efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params);
1050 1030
1051 for (i = 0; i < PAGE_NUM; i++) { 1031 for (i = 0; i < PAGE_NUM; i++) {
1052 switch (i % 3) { 1032 switch (i % 3)
1053 case 0: 1033 {
1054 page = page_add(LAYOUT, active_view); 1034 case 0:
1055 break; 1035 view = view_add(LAYOUT, active_view);
1056 case 1: 1036 break;
1057 page = page_add(LIST, active_view); 1037
1058 break; 1038 case 1:
1059 case 2: 1039 view = view_add(LIST, active_view);
1060 page = page_add(BUTTON, active_view); 1040 break;
1061 break; 1041
1062 default: 1042 case 2:
1063 page = page_add(LAYOUT, active_view); 1043 view = view_add(BUTTON, active_view);
1064 break; 1044 break;
1065 } 1045
1066 efl_pack_end(active_view, page); 1046 default:
1067 } 1047 view = view_add(LAYOUT, active_view);
1048 break;
1049 }
1050 efl_pack_end(active_view, view);
1051 }
1068 1052
1069 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320)); 1053 efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320));
1070} 1054}
1055
diff --git a/src/bin/elementary/test_ui_stack.c b/src/bin/elementary/test_ui_stack.c
index 087e51f6ab..f5ef762d8e 100644
--- a/src/bin/elementary/test_ui_stack.c
+++ b/src/bin/elementary/test_ui_stack.c
@@ -6,29 +6,20 @@
6#include <Elementary.h> 6#include <Elementary.h>
7 7
8static void _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED); 8static void _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED);
9static void _fourth_layout_push(void *data, const Efl_Event *ev EINA_UNUSED);
10 9
11static void 10static void
12_stack_remove(void *data, const Efl_Event *ev EINA_UNUSED) 11_stack_remove(void *data, const Efl_Event *ev EINA_UNUSED)
13{ 12{
14 Eo *stack = data; 13 Eo *stack = data;
15 Eo *top_layout = efl_ui_stack_top(stack); 14 Eo *top_layout = efl_pack_content_get(stack, 0);
16 efl_ui_stack_remove(stack, top_layout); 15 efl_del(top_layout);
17}
18
19static void
20_stack_double_pop(void *data, const Efl_Event *ev EINA_UNUSED)
21{
22 Eo *stack = data;
23 efl_ui_stack_pop(stack);
24 efl_ui_stack_pop(stack);
25} 16}
26 17
27static void 18static void
28_stack_pop(void *data, const Efl_Event *ev EINA_UNUSED) 19_stack_pop(void *data, const Efl_Event *ev EINA_UNUSED)
29{ 20{
30 Eo *stack = data; 21 Eo *stack = data;
31 efl_ui_stack_pop(stack); 22 efl_ui_active_view_pop(stack, EINA_TRUE);
32} 23}
33 24
34static void 25static void
@@ -36,14 +27,13 @@ _stack_double_push(void *data, const Efl_Event *ev EINA_UNUSED)
36{ 27{
37 Eo *stack = data; 28 Eo *stack = data;
38 _third_layout_push(stack, NULL); 29 _third_layout_push(stack, NULL);
39 _fourth_layout_push(stack, NULL);
40} 30}
41 31
42static void 32static void
43_stack_del(void *data, const Efl_Event *ev EINA_UNUSED) 33_stack_del(void *data, const Efl_Event *ev EINA_UNUSED)
44{ 34{
45 Eo *stack = data; 35 Eo *stack = data;
46 Eo *top_layout = efl_ui_stack_top(stack); 36 Eo *top_layout = efl_pack_content_get(stack, 0);
47 efl_del(top_layout); 37 efl_del(top_layout);
48} 38}
49 39
@@ -103,31 +93,13 @@ _fifth_layout_insert(void *data, const Efl_Event *ev EINA_UNUSED)
103{ 93{
104 Eo *stack = data; 94 Eo *stack = data;
105 95
106 Eo *top_layout = efl_ui_stack_top(stack);
107
108 Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack); 96 Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
109 efl_text_set(btn, "Press to remove top layout"); 97 efl_text_set(btn, "Press to remove top layout");
110 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_remove, stack); 98 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_remove, stack);
111 99
112 Eo *nl = _navigation_layout_create(stack, "5th layout", btn); 100 Eo *nl = _navigation_layout_create(stack, "5th layout", btn);
113 101
114 efl_ui_stack_insert_after(stack, top_layout, nl); 102 efl_ui_active_view_push(stack, nl);
115}
116
117static void
118_fourth_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
119{
120 Eo *stack = data;
121
122 Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack);
123 efl_text_set(btn, "Press to double pop");
124 efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_double_pop, stack);
125
126 Eo *nl = _navigation_layout_create(stack, "4th layout", btn);
127
128 _bar_right_btn_set(nl, _fifth_layout_insert, stack);
129
130 efl_ui_stack_push(stack, nl);
131} 103}
132 104
133static void 105static void
@@ -141,9 +113,9 @@ _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
141 113
142 Eo *nl = _navigation_layout_create(stack, "3rd layout", btn); 114 Eo *nl = _navigation_layout_create(stack, "3rd layout", btn);
143 115
144 _bar_right_btn_set(nl, _fourth_layout_push, stack); 116 _bar_right_btn_set(nl, _fifth_layout_insert, stack);
145 117
146 efl_ui_stack_push(stack, nl); 118 efl_ui_active_view_push(stack, nl);
147} 119}
148 120
149static void 121static void
@@ -159,7 +131,7 @@ _second_layout_push(void *data, const Efl_Event *ev EINA_UNUSED)
159 131
160 _bar_right_btn_set(nl, _third_layout_push, stack); 132 _bar_right_btn_set(nl, _third_layout_push, stack);
161 133
162 efl_ui_stack_push(stack, nl); 134 efl_ui_active_view_push(stack, nl);
163} 135}
164 136
165static void 137static void
@@ -174,35 +146,7 @@ _first_layout_push(Eo *win, Eo *stack)
174 _bar_left_btn_set(nl, _win_del, win); 146 _bar_left_btn_set(nl, _win_del, win);
175 _bar_right_btn_set(nl, _second_layout_push, stack); 147 _bar_right_btn_set(nl, _second_layout_push, stack);
176 148
177 efl_ui_stack_push(stack, nl); 149 efl_ui_active_view_push(stack, nl);
178}
179
180static void
181_stack_loaded_cb(void *data EINA_UNUSED, const Efl_Event *event)
182{
183 Efl_Ui_Stack_Event_Loaded *loaded_info = event->info;
184 printf("Content(%p) is loaded to the stack.\n\n", loaded_info->content);
185}
186
187static void
188_stack_unloaded_cb(void *data EINA_UNUSED, const Efl_Event *event)
189{
190 Efl_Ui_Stack_Event_Unloaded *unloaded_info = event->info;
191 printf("Content(%p) is unloaded from the stack.\n\n", unloaded_info->content);
192}
193
194static void
195_stack_activated_cb(void *data EINA_UNUSED, const Efl_Event *event)
196{
197 Efl_Ui_Stack_Event_Activated *activated_info = event->info;
198 printf("Content(%p) is activated in the stack.\n\n", activated_info->content);
199}
200
201static void
202_stack_deactivated_cb(void *data EINA_UNUSED, const Efl_Event *event)
203{
204 Efl_Ui_Stack_Event_Deactivated *deactivated_info = event->info;
205 printf("Content(%p) is deactivated in the stack.\n\n", deactivated_info->content);
206} 150}
207 151
208void 152void
@@ -214,15 +158,8 @@ test_ui_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
214 158
215 efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500)); 159 efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
216 160
217 Eo *stack = efl_add(EFL_UI_STACK_CLASS, win); 161 Eo *stack = efl_ui_active_view_util_stack_gen(win);
218 efl_event_callback_add(stack, EFL_UI_STACK_EVENT_LOADED, 162
219 _stack_loaded_cb, NULL);
220 efl_event_callback_add(stack, EFL_UI_STACK_EVENT_UNLOADED,
221 _stack_unloaded_cb, NULL);
222 efl_event_callback_add(stack, EFL_UI_STACK_EVENT_ACTIVATED,
223 _stack_activated_cb, NULL);
224 efl_event_callback_add(stack, EFL_UI_STACK_EVENT_DEACTIVATED,
225 _stack_deactivated_cb, NULL);
226 efl_content_set(win, stack); 163 efl_content_set(win, stack);
227 164
228 _first_layout_push(win, stack); 165 _first_layout_push(win, stack);
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index bf11cb215d..c364595260 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -242,12 +242,12 @@ typedef Eo Efl_Ui_Active_View_Indicator;
242# include <efl_ui_active_view_indicator_icon.eo.h> 242# include <efl_ui_active_view_indicator_icon.eo.h>
243# include <efl_ui_active_view_view_manager_scroll.eo.h> 243# include <efl_ui_active_view_view_manager_scroll.eo.h>
244# include <efl_ui_active_view_view_manager_stack.eo.h> 244# include <efl_ui_active_view_view_manager_stack.eo.h>
245# include <efl_ui_active_view_util.eo.h>
245 246
246# include <efl_ui_navigation_bar.eo.h> 247# include <efl_ui_navigation_bar.eo.h>
247# include <efl_ui_navigation_bar_part.eo.h> 248# include <efl_ui_navigation_bar_part.eo.h>
248# include <efl_ui_navigation_bar_part_back_button.eo.h> 249# include <efl_ui_navigation_bar_part_back_button.eo.h>
249# include <efl_ui_navigation_layout.eo.h> 250# include <efl_ui_navigation_layout.eo.h>
250# include <efl_ui_stack.eo.h>
251# include <efl_ui_clickable.eo.h> 251# include <efl_ui_clickable.eo.h>
252# include <efl_ui_clickable_util.eo.h> 252# include <efl_ui_clickable_util.eo.h>
253 253
diff --git a/src/lib/elementary/efl_ui_active_view_container.c b/src/lib/elementary/efl_ui_active_view_container.c
index 30dadd698b..9d19b07cf0 100644
--- a/src/lib/elementary/efl_ui_active_view_container.c
+++ b/src/lib/elementary/efl_ui_active_view_container.c
@@ -23,13 +23,16 @@ typedef struct _Efl_Ui_Active_View_Container_Data
23 double last_pos; 23 double last_pos;
24 Eina_Bool active; 24 Eina_Bool active;
25 } show_request; 25 } show_request;
26 struct {
27 Eina_Promise *transition_done;
28 Efl_Gfx_Entity *content;
29 } transition_done;
26 Efl_Ui_Active_View_View_Manager *transition; 30 Efl_Ui_Active_View_View_Manager *transition;
27 Efl_Ui_Active_View_Indicator *indicator; 31 Efl_Ui_Active_View_Indicator *indicator;
28 double position; 32 double position;
29 Eina_Bool fill_width: 1; 33 Eina_Bool fill_width: 1;
30 Eina_Bool fill_height: 1; 34 Eina_Bool fill_height: 1;
31 Eina_Bool prevent_transition_interaction : 1; 35 Eina_Bool prevent_transition_interaction : 1;
32 Efl_Ui_Active_View_Container_Gravity gravity;
33} Efl_Ui_Active_View_Container_Data; 36} Efl_Ui_Active_View_Container_Data;
34 37
35#define MY_CLASS EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS 38#define MY_CLASS EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS
@@ -67,6 +70,15 @@ _transition_end(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd)
67 70
68 if (pd->prevent_transition_interaction) return; 71 if (pd->prevent_transition_interaction) return;
69 72
73 if (pd->transition_done.content)
74 {
75 Eina_Value v = eina_value_object_init(pd->transition_done.content);
76 efl_pack_unpack(obj, pd->transition_done.content);
77 eina_promise_resolve(pd->transition_done.transition_done, v);
78 pd->transition_done.transition_done = NULL;
79 pd->transition_done.content = NULL;
80 }
81
70 ev.from = pd->show_request.from; 82 ev.from = pd->show_request.from;
71 ev.to = pd->show_request.to; 83 ev.to = pd->show_request.to;
72 efl_event_callback_call(obj, EFL_UI_ACTIVE_VIEW_EVENT_TRANSITION_END, &ev); 84 efl_event_callback_call(obj, EFL_UI_ACTIVE_VIEW_EVENT_TRANSITION_END, &ev);
@@ -174,7 +186,6 @@ _efl_ui_active_view_container_efl_object_constructor(Eo *obj,
174 pd->fill_height = EINA_TRUE; 186 pd->fill_height = EINA_TRUE;
175 187
176 efl_ui_active_view_size_set(obj, EINA_SIZE2D(-1, -1)); 188 efl_ui_active_view_size_set(obj, EINA_SIZE2D(-1, -1));
177 efl_ui_active_view_gravity_set(obj, EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT);
178 189
179 elm_widget_can_focus_set(obj, EINA_FALSE); 190 elm_widget_can_focus_set(obj, EINA_FALSE);
180 191
@@ -255,25 +266,12 @@ _register_child(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_
255 return EINA_TRUE; 266 return EINA_TRUE;
256} 267}
257 268
258
259EOLIAN static void
260_efl_ui_active_view_container_active_view_gravity_set(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_Ui_Active_View_Container_Gravity gravity)
261{
262 pd->gravity = gravity;
263}
264
265EOLIAN static Efl_Ui_Active_View_Container_Gravity
266_efl_ui_active_view_container_active_view_gravity_get(const Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd)
267{
268 return pd->gravity;
269}
270
271static void 269static void
272_update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index) 270_update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Active_View_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index)
273{ 271{
274 Eina_Bool curr_page_update = EINA_FALSE; 272 Eina_Bool curr_page_update = EINA_FALSE;
275 273
276 if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && pd->curr.page >= index) 274 if (pd->curr.page >= index)
277 { 275 {
278 pd->curr.page++; 276 pd->curr.page++;
279 curr_page_update = EINA_TRUE; 277 curr_page_update = EINA_TRUE;
@@ -505,7 +503,7 @@ _unpack(Eo *obj,
505 pd->content_list = eina_list_remove(pd->content_list, subobj); 503 pd->content_list = eina_list_remove(pd->content_list, subobj);
506 _elm_widget_sub_object_redirect_to_top(obj, subobj); 504 _elm_widget_sub_object_redirect_to_top(obj, subobj);
507 505
508 if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && index < pd->curr.page) 506 if (index < pd->curr.page)
509 pd->curr.page--; 507 pd->curr.page--;
510 508
511 if (pd->transition) 509 if (pd->transition)
@@ -514,7 +512,7 @@ _unpack(Eo *obj,
514 efl_ui_active_view_indicator_content_del(pd->indicator, subobj, index); 512 efl_ui_active_view_indicator_content_del(pd->indicator, subobj, index);
515 513
516 //we deleted the current index 514 //we deleted the current index
517 if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && early_curr_page == index) 515 if (early_curr_page == index)
518 { 516 {
519 int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1); 517 int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1);
520 //when we delete the active index and we are not updating the index, 518 //when we delete the active index and we are not updating the index,
@@ -651,4 +649,50 @@ _efl_ui_active_view_container_indicator_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ac
651 return pd->indicator; 649 return pd->indicator;
652} 650}
653 651
652EOLIAN static void
653_efl_ui_active_view_container_push(Eo *obj, Efl_Ui_Active_View_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *view)
654{
655 int old_active_index = efl_ui_active_view_active_index_get(obj);
656
657 if (old_active_index == -1)
658 old_active_index = 0;
659
660 efl_pack_at(obj, view, old_active_index);
661 efl_ui_active_view_active_index_set(obj, old_active_index);
662}
663
664static Eina_Value
665_delete_obj(void *data EINA_UNUSED, const Eina_Value value, const Eina_Future *dead_future EINA_UNUSED)
666{
667 efl_del(eina_value_object_get(&value));
668
669 return EINA_VALUE_EMPTY;
670}
671
672EOLIAN static Eina_Future*
673_efl_ui_active_view_container_pop(Eo *obj, Efl_Ui_Active_View_Container_Data *pd, Eina_Bool del)
674{
675 Eina_Future *transition_done;
676 int new_index;
677
678 if (eina_list_count(pd->content_list) < 2)
679 new_index = -1;
680
681 new_index = efl_ui_active_view_active_index_get(obj) + 1;
682 if (new_index >= (int)eina_list_count(pd->content_list))
683 new_index -= 2;
684
685 pd->transition_done.content = efl_pack_content_get(obj, efl_ui_active_view_active_index_get(obj));
686 pd->transition_done.transition_done = efl_loop_promise_new(obj);
687
688 transition_done = eina_future_new(pd->transition_done.transition_done);
689 if (del)
690 transition_done = eina_future_then(transition_done, _delete_obj, NULL);
691
692 efl_ui_active_view_active_index_set(obj, new_index);
693
694 return transition_done;
695}
696
697
654#include "efl_ui_active_view_container.eo.c" 698#include "efl_ui_active_view_container.eo.c"
diff --git a/src/lib/elementary/efl_ui_active_view_container.eo b/src/lib/elementary/efl_ui_active_view_container.eo
index 052e35808c..b4c46fee0d 100644
--- a/src/lib/elementary/efl_ui_active_view_container.eo
+++ b/src/lib/elementary/efl_ui_active_view_container.eo
@@ -4,15 +4,6 @@ struct @beta Efl.Ui.Active_View.Transition_Event {
4 to : int; [[The view index to where the transition is headed, -1 if not known.]] 4 to : int; [[The view index to where the transition is headed, -1 if not known.]]
5} 5}
6 6
7enum Efl.Ui.Active_View.Container_Gravity {
8 [[This enum controls the behavior of @Efl.Ui.Active_View.Container.active_index when indices are
9 shifted due to object addition or removal.]]
10 content = 0, [[When a view is added or removed from the container, the @Efl.Ui.Active_View.Container.active_index will
11 be adjusted as necessary so it points to the same view as before.]]
12 index = 1, [[When a view is added or removed from the container, the @Efl.Ui.Active_View.Container.active_index will
13 remain the same, possibly pointing to a different view.]]
14}
15
16class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements Efl.Pack_Linear 7class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements Efl.Pack_Linear
17{ 8{
18 [[The Active View widget is a container for other sub-widgets (views), where only one sub-widget is active at any given time. 9 [[The Active View widget is a container for other sub-widgets (views), where only one sub-widget is active at any given time.
@@ -51,27 +42,13 @@ class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements E
51 } 42 }
52 @property active_index { 43 @property active_index {
53 [[Currently active view among all the views added to this widget. 44 [[Currently active view among all the views added to this widget.
54 45
55 Changing this value might trigger an animation. 46 Changing this value might trigger an animation.
56 ]] 47 ]]
57 values { 48 values {
58 index: int; [[Index of the active view, from 0 to the number of views - 1 (@Efl.Container.content_count - 1).]] 49 index: int; [[Index of the active view, from 0 to the number of views - 1 (@Efl.Container.content_count - 1).]]
59 } 50 }
60 } 51 }
61 @property active_view_gravity {
62 [[When a new view is added to this widget, the indices for the previous views might change (for example,
63 when adding a view at the beginning of the list with @Efl.Pack_Linear.pack_begin all previous view's indices are increased by one).
64
65 This property controls whether the Active View should remain the same view as before (@Efl.Ui.Active_View.Container_Gravity.content)
66 or if the Active View should be moved to the one with the same index as before (@Efl.Ui.Active_View.Container_Gravity.index).
67
68 For example, @Efl.Ui.Active_View.Container_Gravity.index can be used to build a Stack, where @.active_index is always 0 and new
69 views are pushed onto the stack with @Efl.Pack_Linear.pack_begin and popped from the stack with @Efl.Pack_Linear.pack_unpack_at 0.
70 ]]
71 values {
72 gravity : Efl.Ui.Active_View.Container_Gravity; [[Active View behavior when adding new views. Default is @Efl.Ui.Active_View.Container_Gravity.content.]]
73 }
74 }
75 @property active_view_size { 52 @property active_view_size {
76 [[The size to use when displaying the Active View. This is used by the @.view_manager to perform the rendering. 53 [[The size to use when displaying the Active View. This is used by the @.view_manager to perform the rendering.
77 Views other than the Active one may or may not use this size.]] 54 Views other than the Active one may or may not use this size.]]
@@ -79,6 +56,34 @@ class @beta Efl.Ui.Active_View.Container extends Efl.Ui.Layout_Base implements E
79 size: Eina.Size2D; [[Render size for the Active View. (-1, -1) means that all available space inside the container is used.]] 56 size: Eina.Size2D; [[Render size for the Active View. (-1, -1) means that all available space inside the container is used.]]
80 } 57 }
81 } 58 }
59 push @beta {
60 [[Packs a new view at the position indicated by @.active_index (0 by default).
61
62 This is the same behavior as a push operation on a stack.
63
64 An animation might be triggered to make the new active view come into position.
65 ]]
66 params {
67 view : Efl.Gfx.Entity; [[View to add and set to be the active view.]]
68 }
69 }
70 pop @beta {
71 [[Removes the active view from the widget.
72
73 The views behind it naturally flow down so the next one becomes the active view. This is the same behavior as a pop operation on a stack.
74 When combined with @.push you don't have to worry about @.active_index since only the first view is manipulated.
75
76 An animation might be triggered to make the new active view come into position and the old one disappear.
77
78 The removed view can be returned to the caller or deleted (depending on $delete_on_transition_end).
79 ]]
80 params {
81 deletion_on_transition_end : bool; [[ if $true, then the object will be deleted before resolving the future, and a NULL pointer is the value of the future. $false if no operation should be applied to it]]
82 }
83 return : future<Efl.Gfx.Entity>; [[ This Future gets resolved when any transition animation finishes and the popped view is ready for collection.
84 If there is no animation, the Future resolves immediately.
85 If $deletion_on_transition_end is $true then this widget will destroy the popped view and the Future will contain no Value. Otherwise, the caller becomes the owner of the view contained in the Future and must dispose of it appropriately. ]]
86 }
82 } 87 }
83 events { 88 events {
84 transition,start : Efl.Ui.Active_View.Transition_Event; [[A transition animation has started.]] 89 transition,start : Efl.Ui.Active_View.Transition_Event; [[A transition animation has started.]]
diff --git a/src/lib/elementary/efl_ui_active_view_util.c b/src/lib/elementary/efl_ui_active_view_util.c
new file mode 100644
index 0000000000..eaf8b48cec
--- /dev/null
+++ b/src/lib/elementary/efl_ui_active_view_util.c
@@ -0,0 +1,21 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Efl_Ui.h>
6#include "elm_priv.h"
7
8typedef struct {
9
10} Efl_Ui_Active_View_Util_Data;
11
12EOLIAN static Efl_Ui_Active_View_Container*
13_efl_ui_active_view_util_stack_gen(Efl_Ui_Widget *parent)
14{
15 Efl_Ui_Active_View_View_Manager *manager = efl_add(EFL_UI_ACTIVE_VIEW_VIEW_MANAGER_STACK_CLASS, parent);
16 return efl_add(EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS, parent,
17 efl_ui_active_view_manager_set(efl_added, manager));
18}
19
20
21#include "efl_ui_active_view_util.eo.c"
diff --git a/src/lib/elementary/efl_ui_active_view_util.eo b/src/lib/elementary/efl_ui_active_view_util.eo
new file mode 100644
index 0000000000..1d7d57b58f
--- /dev/null
+++ b/src/lib/elementary/efl_ui_active_view_util.eo
@@ -0,0 +1,11 @@
1class @beta Efl.Ui.Active_View.Util {
2 methods {
3 stack_gen @class {
4 [[Get a preconfigured stack obejct]]
5 params {
6 parent : Efl.Ui.Widget;
7 }
8 return : Efl.Ui.Active_View.Container;
9 }
10 }
11}
diff --git a/src/lib/elementary/efl_ui_navigation_bar.c b/src/lib/elementary/efl_ui_navigation_bar.c
index 6df57fd461..8f893eb304 100644
--- a/src/lib/elementary/efl_ui_navigation_bar.c
+++ b/src/lib/elementary/efl_ui_navigation_bar.c
@@ -19,14 +19,14 @@ _back_button_clicked_cb(void *data, const Efl_Event *ev EINA_UNUSED)
19{ 19{
20 Eo *navigation_bar = data; 20 Eo *navigation_bar = data;
21 21
22 Eo *stack = efl_provider_find(navigation_bar, EFL_UI_STACK_CLASS); 22 Eo *active_view = efl_provider_find(navigation_bar, EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS);
23 if (!stack) 23 if (!active_view)
24 { 24 {
25 ERR("Cannot find EFL_UI_STACK_CLASS instance!"); 25 ERR("Cannot find EFL_UI_ACTIVE_VIEW_CONTAINER_CLASS instance!");
26 return; 26 return;
27 } 27 }
28 28
29 efl_ui_stack_pop(stack); 29 efl_ui_active_view_pop(active_view, EINA_TRUE);
30} 30}
31 31
32EOLIAN static Eo * 32EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c
deleted file mode 100644
index 92241acf87..0000000000
--- a/src/lib/elementary/efl_ui_stack.c
+++ /dev/null
@@ -1,697 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6
7#include "elm_priv.h"
8#include "efl_ui_stack_private.h"
9
10#define MY_CLASS EFL_UI_STACK_CLASS
11#define MY_CLASS_NAME "Efl.Ui.Stack"
12
13static Efl_Canvas_Animation *show_anim = NULL;
14static Efl_Canvas_Animation *hide_anim = NULL;
15
16static void
17_announce_hiding(Efl_Ui_Stack *obj, Evas_Object *content)
18{
19 //Deactivated Event
20 Efl_Ui_Stack_Event_Deactivated deactivated_info;
21 deactivated_info.content = content;
22 efl_event_callback_call(obj,
23 EFL_UI_STACK_EVENT_DEACTIVATED,
24 &deactivated_info);
25
26 //Unloaded Event
27 Efl_Ui_Stack_Event_Unloaded unloaded_info;
28 unloaded_info.content = content;
29 efl_event_callback_call(obj,
30 EFL_UI_STACK_EVENT_UNLOADED,
31 &unloaded_info);
32}
33
34static void
35_show_content_without_anim(Efl_Ui_Stack *obj, Evas_Object *content)
36{
37 //Loaded Event
38 Efl_Ui_Stack_Event_Loaded loaded_info;
39 loaded_info.content = content;
40 efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
41 &loaded_info);
42
43 evas_object_raise(content);
44 /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
45 * internally.
46 * Therefore, efl_ui_widget_resize_object_set() is called after
47 * setting animation and efl_gfx_entity_visible_set() is not called. */
48 efl_ui_widget_resize_object_set(obj, content);
49
50 //Activated Event
51 Efl_Ui_Stack_Event_Activated activated_info;
52 activated_info.content = content;
53 efl_event_callback_call(obj, EFL_UI_STACK_EVENT_ACTIVATED,
54 &activated_info);
55}
56
57static void
58_hide_content_without_anim(Efl_Ui_Stack *obj EINA_UNUSED, Evas_Object *content)
59{
60 efl_gfx_entity_visible_set(content, EINA_FALSE);
61}
62
63static void
64_content_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
65{
66 Content_Data *cd = data;
67
68 //Popped content has already called deactivated event and unloaded event.
69 if (cd->popped_hidden) return;
70
71 _announce_hiding(NULL, cd->content);
72}
73
74static Content_Data *
75_content_data_new(Eo *obj EINA_UNUSED, Eo *content)
76{
77 Content_Data *cd = calloc(1, sizeof(Content_Data));
78 if (!cd)
79 {
80 ERR("Memory allocation error!");
81 return NULL;
82 }
83
84 cd->content = content;
85
86 efl_event_callback_add(cd->content, EFL_EVENT_DEL, _content_del_cb, cd);
87
88 return cd;
89}
90
91static void
92_content_data_del(Content_Data *cd)
93{
94 if (!cd) return;
95
96 if (cd->content)
97 efl_del(cd->content);
98
99 free(cd);
100}
101
102static void
103_anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event)
104{
105 efl_event_freeze(efl_animation_player_target_get(event->object));
106}
107
108static Evas_Object*
109_end_anim(Transit_Data *td)
110{
111 Efl_Canvas_Object *content = td->cd->content;
112
113 efl_event_thaw(content);
114 td->cd->on_pushing = EINA_FALSE;
115 td->cd->on_popping = EINA_FALSE;
116 free(td);
117
118 return content;
119}
120
121static void
122_hide_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
123{
124 Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
125 Efl_Canvas_Object *content;
126
127 EINA_SAFETY_ON_NULL_RETURN(pd);
128
129 content = _end_anim(pd->hide_td);
130 pd->hide_td = NULL;
131 efl_gfx_entity_visible_set(content, EINA_FALSE);
132 _announce_hiding(data, content);
133}
134
135static void
136_show_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
137{
138 Efl_Ui_Stack_Data *pd = efl_data_scope_safe_get(data, EFL_UI_STACK_CLASS);
139 Efl_Canvas_Object *content;
140
141 EINA_SAFETY_ON_NULL_RETURN(pd);
142
143 content = _end_anim(pd->show_td);
144 pd->show_td = NULL;
145 //Activated Event
146 Efl_Ui_Stack_Event_Activated activated_info;
147 activated_info.content = content;
148 efl_event_callback_call(data,
149 EFL_UI_STACK_EVENT_ACTIVATED,
150 &activated_info);
151}
152
153static void
154_show_content_with_anim(Efl_Ui_Stack *obj, Efl_Ui_Stack_Data *pd, Content_Data *cd)
155{
156 //immidiatly stop hiding animation
157 efl_player_stop(pd->show);
158 if (pd->show_td)
159 EINA_SAFETY_ERROR("td is set but it should not");
160
161 //attach new content target
162 efl_animation_player_target_set(pd->show, cd->content);
163
164 Transit_Data *td = calloc(1, sizeof(Transit_Data));
165 if (!td)
166 {
167 ERR("Memory allocation error!");
168
169 //show content without animation
170 _show_content_without_anim(obj, cd->content);
171 return;
172 }
173
174 td->cd = cd;
175 pd->show_td = td;
176
177 /* efl_ui_widget_resize_object_set() calls efl_gfx_entity_visible_set()
178 * internally.
179 * Therefore, efl_ui_widget_resize_object_set() is called after
180 * setting animation and efl_gfx_entity_visible_set() is not called. */
181 efl_ui_widget_resize_object_set(obj, cd->content);
182 efl_player_start(pd->show);
183}
184
185static void
186_hide_content_with_anim(Efl_Ui_Stack *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Content_Data *cd)
187{
188 //immidiatly stop hiding animation
189 efl_player_stop(pd->hide);
190 if (pd->hide_td)
191 EINA_SAFETY_ERROR("td is set but it should not");
192
193 //attach new content target
194 efl_animation_player_target_set(pd->hide, cd->content);
195
196 Transit_Data *td = calloc(1, sizeof(Transit_Data));
197 if (!td)
198 {
199 ERR("Memory allocation error!");
200
201 //hide content without animation
202 _hide_content_without_anim(obj, cd->content);
203 return;
204 }
205
206 td->cd = cd;
207 pd->hide_td = td;
208
209 efl_player_start(pd->hide);
210}
211
212EOLIAN static void
213_efl_ui_stack_push(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
214{
215 if (!content) return;
216
217 //If the given content exists in the stack, promote the given content to the top.
218 Content_Data *cd = NULL;
219 EINA_INLIST_FOREACH(pd->stack, cd)
220 if (cd->content == content)
221 break;
222
223 Content_Data *top_cd = NULL;
224 if (pd->stack)
225 top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
226
227 if (cd)
228 {
229 //If given content is already the top content, then do nothing.
230 if (cd == top_cd)
231 return;
232
233 //Remove the given content(existing content) to promote it to the top.
234 pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
235 }
236 else
237 {
238 cd = _content_data_new(obj, content);
239 if (!cd) return;
240
241 evas_object_smart_member_add(content, obj);
242 }
243
244 pd->stack = eina_inlist_append(pd->stack, EINA_INLIST_GET(cd));
245
246 //Loaded Event
247 Efl_Ui_Stack_Event_Loaded loaded_info;
248 loaded_info.content = content;
249 efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED, &loaded_info);
250
251 /* Apply transition to top content.
252 * Hide top content with animation. */
253 if (top_cd)
254 {
255 Eo *top_content = top_cd->content;
256
257 /* If content is being pushed now, then finish current animation and hide
258 * the content without animation. */
259 if (top_cd->on_pushing)
260 {
261 _hide_content_without_anim(obj, top_content);
262 _announce_hiding(obj, top_content);
263 }
264 else
265 {
266 top_cd->on_pushing = EINA_TRUE;
267
268 _hide_content_with_anim(obj, pd, top_cd);
269 }
270 }
271
272 /* Prepare transition for new content.
273 * Hide new content without animation. */
274 cd->on_pushing = EINA_TRUE;
275 _hide_content_without_anim(obj, content);
276
277 /* Apply transition to new content.
278 * Show new content with animation. */
279 _show_content_with_anim(obj, pd, cd);
280}
281
282static void
283_pop_content_hide_cb(void *data, const Efl_Event *event)
284{
285 Content_Data *cd = data;
286 Eina_Bool *visible = event->info;
287 /* object is being shown */
288 if (*visible) return;
289
290 cd->popped_hidden = EINA_TRUE;
291
292 _content_data_del(cd);
293}
294
295EOLIAN static Eo *
296_efl_ui_stack_pop(Eo *obj, Efl_Ui_Stack_Data *pd)
297{
298 if (!pd->stack)
299 {
300 ERR("There is no content in the stack!");
301 return NULL;
302 }
303
304 Content_Data *top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
305
306 pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(top_cd));
307
308 /* Apply transition to top content.
309 * Hide top content with animation. */
310 {
311 Eo *top_content = top_cd->content;
312
313 /* If content is being popped now, then finish current animation and show
314 * the content without animation. */
315 if (top_cd->on_popping)
316 {
317 _hide_content_without_anim(obj, top_content);
318 _announce_hiding(obj, top_content);
319 }
320 else
321 {
322 top_cd->on_popping = EINA_TRUE;
323
324 //Deallocate content data when hide animation is finished.
325 efl_event_callback_add(top_content, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED,
326 _pop_content_hide_cb, top_cd);
327
328 _hide_content_with_anim(obj, pd, top_cd);
329 }
330 }
331
332 if (pd->stack)
333 {
334 Content_Data *prev_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
335 Content_Data);
336 Eo *prev_content = prev_cd->content;
337
338 prev_cd->on_popping = EINA_TRUE;
339
340 //Loaded Event
341 Efl_Ui_Stack_Event_Loaded loaded_info;
342 loaded_info.content = prev_content;
343 efl_event_callback_call(obj, EFL_UI_STACK_EVENT_LOADED,
344 &loaded_info);
345
346 /* Apply transition to previous content.
347 * Show previous content with animation. */
348 _show_content_with_anim(obj, pd, prev_cd);
349 }
350
351 return NULL;
352}
353
354EOLIAN static void
355_efl_ui_stack_insert_before(Eo *obj, Efl_Ui_Stack_Data *pd,
356 Eo *base_content, Eo *content)
357{
358 if (!content) return;
359
360 Content_Data *base_cd = NULL;
361 EINA_INLIST_FOREACH(pd->stack, base_cd)
362 if (base_cd->content == base_content)
363 break;
364
365 if (!base_cd)
366 {
367 ERR("The given base content is not found in the stack!");
368 return;
369 }
370
371 Content_Data *cd = _content_data_new(obj, content);
372 if (!cd) return;
373
374 pd->stack = eina_inlist_prepend_relative(pd->stack,
375 EINA_INLIST_GET(cd),
376 EINA_INLIST_GET(base_cd));
377 evas_object_smart_member_add(content, obj);
378}
379
380EOLIAN static void
381_efl_ui_stack_insert_after(Eo *obj, Efl_Ui_Stack_Data *pd,
382 Eo *base_content, Eo *content)
383{
384 if (!content) return;
385
386 Content_Data *base_cd = NULL;
387 EINA_INLIST_FOREACH(pd->stack, base_cd)
388 if (base_cd->content == base_content)
389 break;
390
391 if (!base_cd)
392 {
393 ERR("The given base content is not found in the stack!");
394 return;
395 }
396
397 Content_Data *cd = _content_data_new(obj, content);
398 if (!cd) return;
399
400 pd->stack = eina_inlist_append_relative(pd->stack,
401 EINA_INLIST_GET(cd),
402 EINA_INLIST_GET(base_cd));
403 evas_object_smart_member_add(content, obj);
404
405 if (pd->stack->last == EINA_INLIST_GET(cd))
406 {
407 /* Do not apply transition for insert.
408 * Hide top content without animation. */
409 _hide_content_without_anim(obj, base_cd->content);
410 _announce_hiding(obj, base_cd->content);
411
412 /* Do not apply transition for insert.
413 * Show new content without animation. */
414 _show_content_without_anim(obj, content);
415 }
416}
417
418EOLIAN static void
419_efl_ui_stack_insert_at(Eo *obj, Efl_Ui_Stack_Data *pd,
420 int index, Eo *content)
421{
422 if (!content)
423 {
424 ERR("The given content is NULL!");
425 return;
426 }
427
428 int count = eina_inlist_count(pd->stack);
429 if ((index < 0) || (index > count))
430 {
431 ERR("The index(%d) should be from 0 to #contents in the stack(%d)!",
432 index, count);
433 return;
434 }
435
436 Content_Data *base_cd = NULL;
437
438 if (index == count)
439 {
440 base_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
441 }
442 else
443 {
444 int i = 0;
445 EINA_INLIST_FOREACH(pd->stack, base_cd)
446 {
447 if (i == index)
448 break;
449
450 i++;
451 }
452 }
453
454 Content_Data *cd = _content_data_new(obj, content);
455 if (!cd) return;
456
457 if (index == count)
458 pd->stack = eina_inlist_append_relative(pd->stack,
459 EINA_INLIST_GET(cd),
460 EINA_INLIST_GET(base_cd));
461 else
462 pd->stack = eina_inlist_prepend_relative(pd->stack,
463 EINA_INLIST_GET(cd),
464 EINA_INLIST_GET(base_cd));
465
466 evas_object_smart_member_add(content, obj);
467
468 if (pd->stack->last == EINA_INLIST_GET(cd))
469 {
470
471 /* Do not apply transition for insert.
472 * Hide top content without animation. */
473 _hide_content_without_anim(obj, base_cd->content);
474 _announce_hiding(obj, base_cd->content);
475
476 /* Do not apply transition for insert.
477 * Show new content without animation. */
478 _show_content_without_anim(obj, content);
479 }
480}
481
482EOLIAN static void
483_efl_ui_stack_remove(Eo *obj, Efl_Ui_Stack_Data *pd, Eo *content)
484{
485 if (!pd->stack)
486 {
487 ERR("There is no content in the stack!");
488 return;
489 }
490
491 if (!content)
492 {
493 ERR("The given content is NULL!");
494 return;
495 }
496
497 Content_Data *cd = NULL;
498
499 EINA_INLIST_FOREACH(pd->stack, cd)
500 {
501 if (cd->content == content)
502 break;
503 }
504 if (!cd)
505 {
506 ERR("The given content does not exist in the stack!");
507 return;
508 }
509
510 Eina_Bool remove_top = EINA_FALSE;
511 if (pd->stack->last == EINA_INLIST_GET(cd))
512 remove_top = EINA_TRUE;
513
514 pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
515
516 _announce_hiding(obj, cd->content);
517 _content_data_del(cd);
518
519 if (remove_top)
520 {
521 if (pd->stack)
522 {
523 Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
524 Content_Data);
525
526 /* Do not apply transition for insert.
527 * Show new content without animation. */
528 _show_content_without_anim(obj, new_top_cd->content);
529 }
530 }
531}
532
533EOLIAN static void
534_efl_ui_stack_remove_at(Eo *obj, Efl_Ui_Stack_Data *pd,
535 int index)
536{
537 if (!pd->stack)
538 {
539 ERR("There is no content in the stack!");
540 return;
541 }
542
543 int count = eina_inlist_count(pd->stack);
544 if ((index < 0) || (index >= count))
545 {
546 ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
547 index, count);
548 return;
549 }
550
551 Content_Data *cd = NULL;
552 int i = 0;
553 EINA_INLIST_FOREACH(pd->stack, cd)
554 {
555 if (i == index)
556 break;
557 i++;
558 }
559
560 Eina_Bool remove_top = EINA_FALSE;
561 if (pd->stack->last == EINA_INLIST_GET(cd))
562 remove_top = EINA_TRUE;
563
564 pd->stack = eina_inlist_remove(pd->stack, EINA_INLIST_GET(cd));
565
566 _announce_hiding(NULL, cd->content);
567 _content_data_del(cd);
568
569 //FIXME: Apply transition here.
570 if (remove_top)
571 {
572 if (pd->stack)
573 {
574 Content_Data *new_top_cd = EINA_INLIST_CONTAINER_GET(pd->stack->last,
575 Content_Data);
576 /* Do not apply transition for insert.
577 * Show new content without animation. */
578 _show_content_without_anim(obj, new_top_cd->content);
579 }
580 }
581}
582
583EOLIAN static int
584_efl_ui_stack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Efl_Canvas_Object *content)
585{
586 if (!pd->stack)
587 {
588 ERR("There is no content in the stack!");
589 return -1;
590 }
591
592 if (!content)
593 {
594 ERR("The given content is NULL!");
595 return -1;
596 }
597
598 Content_Data *cd = NULL;
599 int index = 0;
600 int count = eina_inlist_count(pd->stack);
601
602 EINA_INLIST_FOREACH(pd->stack, cd)
603 {
604 if (cd->content == content)
605 break;
606 index++;
607 }
608
609 //The given content is not found.
610 if (index == count) return -1;
611
612 return index;
613}
614
615EOLIAN static Eo *
616_efl_ui_stack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, int index)
617{
618 if (!pd->stack)
619 {
620 ERR("There is no content in the stack!");
621 return NULL;
622 }
623
624 int count = eina_inlist_count(pd->stack);
625 if ((index < 0) || (index >= count))
626 {
627 ERR("The index(%d) should be from 0 to (#contents - 1) in the stack(%d)!",
628 index, count);
629 return NULL;
630 }
631
632 Content_Data *cd = NULL;
633 int i = 0;
634 EINA_INLIST_FOREACH(pd->stack, cd)
635 {
636 if (i == index)
637 break;
638 i++;
639 }
640
641 if (cd)
642 return cd->content;
643
644 return NULL;
645}
646
647EOLIAN static Eo *
648_efl_ui_stack_top(Eo *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd)
649{
650 if (!pd->stack) return NULL;
651
652 Content_Data *cd = EINA_INLIST_CONTAINER_GET(pd->stack->last, Content_Data);
653
654 return cd->content;
655}
656
657EFL_CALLBACKS_ARRAY_DEFINE(_anim_show_event_cb,
658 {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb},
659 {EFL_ANIMATION_PLAYER_EVENT_ENDED, _show_anim_ended_cb},
660)
661
662EFL_CALLBACKS_ARRAY_DEFINE(_anim_hide_event_cb,
663 {EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb},
664 {EFL_ANIMATION_PLAYER_EVENT_ENDED, _hide_anim_ended_cb},
665)
666
667EOLIAN static Eo *
668_efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *pd EINA_UNUSED)
669{
670 Efl_Canvas_Animation *sh, *hi;
671 obj = efl_constructor(efl_super(obj, MY_CLASS));
672 efl_canvas_object_type_set(obj, MY_CLASS_NAME);
673
674 //Default Show Animation
675 sh = show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
676 efl_animation_alpha_set(show_anim, 0.0, 1.0);
677 efl_animation_duration_set(show_anim, 0.5);
678
679 pd->show = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
680 efl_animation_player_animation_set(pd->show, sh);
681 efl_player_play_set(pd->show, EINA_FALSE);
682 efl_event_callback_array_add(pd->show, _anim_show_event_cb(), obj);
683
684 //Default Hide Animation
685 hi = hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, obj);
686 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
687 efl_animation_duration_set(hide_anim, 0.5);
688
689 pd->hide = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
690 efl_animation_player_animation_set(pd->hide, hi);
691 efl_player_play_set(pd->hide, EINA_FALSE);
692 efl_event_callback_array_add(pd->hide, _anim_hide_event_cb(), obj);
693
694 return obj;
695}
696
697#include "efl_ui_stack.eo.c"
diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo
deleted file mode 100644
index 8fbc2cf2ed..0000000000
--- a/src/lib/elementary/efl_ui_stack.eo
+++ /dev/null
@@ -1,131 +0,0 @@
1struct @beta Efl.Ui.Stack_Event_Loaded {
2 [[Information of loaded event.]]
3 content: Efl.Canvas.Object; [[Loaded content.]]
4}
5
6struct @beta Efl.Ui.Stack_Event_Unloaded {
7 [[Information of unloaded event.]]
8 content: Efl.Canvas.Object; [[Unloaded content.]]
9}
10
11struct @beta Efl.Ui.Stack_Event_Activated {
12 [[Information of activated event.]]
13 content: Efl.Canvas.Object; [[Activated content.]]
14}
15
16struct @beta Efl.Ui.Stack_Event_Deactivated {
17 [[Information of deactivated event.]]
18 content: Efl.Canvas.Object; [[Deactivated content.]]
19}
20
21class @beta Efl.Ui.Stack extends Efl.Ui.Layout_Base
22{
23 [[Stack widget.
24
25 Stack widget arranges objects in stack structure by pushing and poping them.
26 ]]
27 methods {
28 push {
29 [[Pushes a new object to the top of the stack and shows it.
30 ]]
31 params {
32 @in content: Efl.Canvas.Object;
33 [[The pushed object which becomes the top content of the stack.]]
34 }
35 }
36 pop {
37 [[Pops the top content from the stack and deletes it.
38 ]]
39 return: Efl.Canvas.Object;
40 [[The top content which is removed from the stack.]]
41 }
42 insert_before {
43 [[Inserts an object before the given base content in the stack.
44 ]]
45 params {
46 @in base_content: Efl.Canvas.Object;
47 [[$content is inserted before this $base_content.]]
48 @in content: Efl.Canvas.Object;
49 [[The inserted object in the stack.]]
50 }
51 }
52 insert_after {
53 [[Inserts an object after the given base content in the stack.
54 ]]
55 params {
56 @in base_content: Efl.Canvas.Object;
57 [[$content is inserted after this $base_content.]]
58 @in content: Efl.Canvas.Object;
59 [[The inserted object in the stack.]]
60 }
61 }
62 insert_at {
63 [[Inserts an object at the given place in the stack.
64 ]]
65 params {
66 @in index: int;
67 [[The index of the inserted object in the stack.
68 $index begins from bottom to top of the stack.
69 $index of the bottom content is 0.
70 ]]
71 @in content: Efl.Canvas.Object;
72 [[The inserted object in the stack.]]
73 }
74 }
75 remove {
76 [[Removes the given content in the stack.
77 ]]
78 params {
79 @in content: Efl.Canvas.Object;
80 [[The removed content from the stack.]]
81 }
82 }
83 remove_at {
84 [[Removes a content matched to the given index in the stack.
85 ]]
86 params {
87 @in index: int;
88 [[The index of the removed object in the stack.
89 $index begins from bottom to top of the stack.
90 $index of the bottom content is 0.
91 ]]
92 }
93 }
94 index_get {
95 [[Gets the index of the given content in the stack.
96 The index begins from bottom to top of the stack.
97 The index of the bottom content is 0.
98 ]]
99 return: int;
100 [[The index of $content in the stack.]]
101 params {
102 @in content: Efl.Canvas.Object;
103 [[The content matched to the index to be returned in the stack.]]
104 }
105 }
106 content_get {
107 [[Gets the content matched to the given index in the stack.
108 ]]
109 return: Efl.Canvas.Object;
110 [[The content matched to $index in the stack.]]
111 params {
112 @in index: int;
113 [[The index of the content to be returned in the stack.]]
114 }
115 }
116 top {
117 [[Gets the top content in the stack.
118 ]]
119 return: Efl.Canvas.Object; [[The top content in the stack.]]
120 }
121 }
122 implements {
123 Efl.Object.constructor;
124 }
125 events {
126 loaded: Efl.Ui.Stack_Event_Loaded; [[Called when content is loaded right before transition.]]
127 unloaded: Efl.Ui.Stack_Event_Unloaded; [[Called when content is unloaded right after being deactivated.]]
128 activated: Efl.Ui.Stack_Event_Activated; [[Called when content is activated right after transition.]]
129 deactivated: Efl.Ui.Stack_Event_Deactivated; [[Called when content is deactivated right after transition.]]
130 }
131}
diff --git a/src/lib/elementary/efl_ui_stack_private.h b/src/lib/elementary/efl_ui_stack_private.h
deleted file mode 100644
index f3d3b7a7c4..0000000000
--- a/src/lib/elementary/efl_ui_stack_private.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef EFL_UI_WIDGET_STACK_H
2#define EFL_UI_WIDGET_STACK_H
3
4
5typedef struct _Content_Data Content_Data;
6struct _Content_Data
7{
8 EINA_INLIST;
9
10 Eo *content;
11 Eina_Bool on_pushing : 1;
12 Eina_Bool on_popping : 1;
13 Eina_Bool popped_hidden : 1;
14};
15
16typedef struct _Transit_Data Transit_Data;
17struct _Transit_Data
18{
19 Content_Data *cd;
20};
21
22typedef struct _Efl_Ui_Stack_Data Efl_Ui_Stack_Data;
23struct _Efl_Ui_Stack_Data
24{
25 Eina_Inlist *stack; /* the last item is the top item */
26 Efl_Canvas_Animation_Player *hide, *show;
27 Transit_Data *show_td, *hide_td;
28
29};
30
31#endif
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index b028831b66..d3c418144d 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -45,7 +45,6 @@ pub_eo_files = [
45 'efl_ui_check.eo', 45 'efl_ui_check.eo',
46 'efl_ui_flip.eo', 46 'efl_ui_flip.eo',
47 'efl_ui_frame.eo', 47 'efl_ui_frame.eo',
48 'efl_ui_stack.eo',
49 'efl_ui_image.eo', 48 'efl_ui_image.eo',
50 'efl_ui_image_zoomable.eo', 49 'efl_ui_image_zoomable.eo',
51 'efl_ui_layout.eo', 50 'efl_ui_layout.eo',
@@ -159,6 +158,7 @@ pub_eo_files = [
159 'efl_ui_active_view_view_manager_stack.eo', 158 'efl_ui_active_view_view_manager_stack.eo',
160 'efl_ui_active_view_indicator.eo', 159 'efl_ui_active_view_indicator.eo',
161 'efl_ui_active_view_indicator_icon.eo', 160 'efl_ui_active_view_indicator_icon.eo',
161 'efl_ui_active_view_util.eo',
162 'efl_ui_tab_pager.eo', 162 'efl_ui_tab_pager.eo',
163 'efl_ui_tab_bar.eo', 163 'efl_ui_tab_bar.eo',
164 'efl_ui_tab_page.eo', 164 'efl_ui_tab_page.eo',
@@ -291,7 +291,6 @@ elementary_headers_unstable = [
291 'efl_ui_widget_flip.h', 291 'efl_ui_widget_flip.h',
292 'elm_widget_flipselector.h', 292 'elm_widget_flipselector.h',
293 'efl_ui_widget_frame.h', 293 'efl_ui_widget_frame.h',
294 'efl_ui_stack_private.h',
295 'elm_widget_gengrid.h', 294 'elm_widget_gengrid.h',
296 'elm_widget_genlist.h', 295 'elm_widget_genlist.h',
297 'elm_widget_glview.h', 296 'elm_widget_glview.h',
@@ -772,7 +771,6 @@ elementary_src = [
772 'elm_flipselector.c', 771 'elm_flipselector.c',
773 'elm_font.c', 772 'elm_font.c',
774 'efl_ui_frame.c', 773 'efl_ui_frame.c',
775 'efl_ui_stack.c',
776 'elm_gengrid.c', 774 'elm_gengrid.c',
777 'elm_genlist.c', 775 'elm_genlist.c',
778 'elm_gesture_layer.c', 776 'elm_gesture_layer.c',
@@ -920,6 +918,7 @@ elementary_src = [
920 'efl_ui_active_view_view_manager_stack.c', 918 'efl_ui_active_view_view_manager_stack.c',
921 'efl_ui_active_view_indicator.c', 919 'efl_ui_active_view_indicator.c',
922 'efl_ui_active_view_indicator_icon.c', 920 'efl_ui_active_view_indicator_icon.c',
921 'efl_ui_active_view_util.c',
923 'efl_ui_focus_graph.h', 922 'efl_ui_focus_graph.h',
924 'efl_ui_focus_graph.c', 923 'efl_ui_focus_graph.c',
925 'efl_ui_tab_pager.c', 924 'efl_ui_tab_pager.c',
diff --git a/src/tests/elementary/efl_ui_test_active_view.c b/src/tests/elementary/efl_ui_test_active_view.c
index f1b4c32ebb..c471b4b7c6 100644
--- a/src/tests/elementary/efl_ui_test_active_view.c
+++ b/src/tests/elementary/efl_ui_test_active_view.c
@@ -503,19 +503,108 @@ EFL_START_TEST (efl_ui_active_view_view_manager_start_end)
503} 503}
504EFL_END_TEST 504EFL_END_TEST
505 505
506EFL_START_TEST (efl_ui_active_view_active_index_not_update) 506EFL_START_TEST (efl_ui_active_view_test_push1)
507{ 507{
508 efl_ui_active_view_gravity_set(container, EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_INDEX); 508 for (int i = 0; i < 5; ++i)
509 {
510 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
511 efl_pack_end(container, w);
512 }
513 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
514 efl_ui_active_view_push(container, w);
515 ck_assert_int_eq(efl_pack_index_get(container, w), 0);
516 ck_assert_int_eq(efl_ui_active_view_active_index_get(container), 0);
517}
518EFL_END_TEST
509 519
520EFL_START_TEST (efl_ui_active_view_test_push2)
521{
510 for (int i = 0; i < 5; ++i) 522 for (int i = 0; i < 5; ++i)
511 { 523 {
512 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 524 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
513 efl_pack(container, w); 525 efl_pack_end(container, w);
514 ck_assert_int_eq(efl_ui_active_view_active_index_get(container), 0);
515 } 526 }
527 efl_ui_active_view_active_index_set(container, 3);
516 528
517 efl_del(efl_pack_content_get(container, 0)); 529 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
518 ck_assert_int_eq(efl_ui_active_view_active_index_get(container), 0); 530 efl_ui_active_view_push(container, w);
531 ck_assert_int_eq(efl_pack_index_get(container, w), 3);
532 ck_assert_int_eq(efl_ui_active_view_active_index_get(container), 3);
533}
534EFL_END_TEST
535
536static Eina_Value
537_then_cb(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
538{
539 Eo **value = data;
540
541 *value = eina_value_object_get(&v);
542
543 return EINA_VALUE_EMPTY;
544}
545
546EFL_START_TEST (efl_ui_active_view_test_pop1)
547{
548 Eo *called;
549 for (int i = 0; i < 5; ++i)
550 {
551 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
552 efl_pack_end(container, w);
553 }
554 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
555 efl_ui_active_view_push(container, w);
556 Eina_Future *f = efl_ui_active_view_pop(container, EINA_FALSE);
557 eina_future_then(f, _then_cb, &called);
558 for (int i = 0; i < 10; ++i)
559 {
560 efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS));
561 }
562 ck_assert_ptr_eq(efl_ui_widget_parent_get(w), win);
563 ck_assert_int_eq(efl_content_count(container), 5);
564 ck_assert_ptr_eq(called, w);
565 ck_assert_ptr_ne(f, NULL);
566}
567EFL_END_TEST
568
569EFL_START_TEST (efl_ui_active_view_test_pop2)
570{
571 for (int i = 0; i < 5; ++i)
572 {
573 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
574 efl_pack_end(container, w);
575 }
576 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
577 efl_ui_active_view_push(container, w);
578 Eina_Future *f = efl_ui_active_view_pop(container, EINA_TRUE);
579 for (int i = 0; i < 10; ++i)
580 {
581 efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS));
582 }
583 ck_assert_int_eq(efl_ref_count(w), 0);
584 ck_assert_int_eq(efl_content_count(container), 5);
585 ck_assert_ptr_ne(f, NULL);
586}
587EFL_END_TEST
588
589EFL_START_TEST (efl_ui_active_view_test_pop3)
590{
591 for (int i = 0; i < 5; ++i)
592 {
593 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
594 efl_pack_end(container, w);
595 }
596 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
597 efl_ui_active_view_active_index_set(container, 3);
598 efl_ui_active_view_push(container, w);
599 Eina_Future *f = efl_ui_active_view_pop(container, EINA_TRUE);
600 for (int i = 0; i < 10; ++i)
601 {
602 efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS));
603 }
604 ck_assert_int_eq(efl_ui_active_view_active_index_get(container), 3);
605 ck_assert_int_eq(efl_ref_count(w), 0);
606 ck_assert_int_eq(efl_content_count(container), 5);
607 ck_assert_ptr_ne(f, NULL);
519} 608}
520EFL_END_TEST 609EFL_END_TEST
521 610
@@ -565,5 +654,9 @@ void efl_ui_test_active_view(TCase *tc)
565 tcase_add_test(tc, efl_ui_smart_indicator_calls); 654 tcase_add_test(tc, efl_ui_smart_indicator_calls);
566 tcase_add_test(tc, efl_ui_smart_indicator_transition_calls); 655 tcase_add_test(tc, efl_ui_smart_indicator_transition_calls);
567 tcase_add_test(tc, efl_ui_active_view_view_manager_start_end); 656 tcase_add_test(tc, efl_ui_active_view_view_manager_start_end);
568 tcase_add_test(tc, efl_ui_active_view_active_index_not_update); 657 tcase_add_test(tc, efl_ui_active_view_test_push1);
658 tcase_add_test(tc, efl_ui_active_view_test_push2);
659 tcase_add_test(tc, efl_ui_active_view_test_pop1);
660 tcase_add_test(tc, efl_ui_active_view_test_pop2);
661 tcase_add_test(tc, efl_ui_active_view_test_pop3);
569} 662}