summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-07-23 13:39:25 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commit9cdb6987e3b260ed254e4056eec457271dc16c56 (patch)
tree3106ea791aa614a0346dbe6583cd41777dd80cec
parent5c9f23b5c440d4893e6a2bf0afbcd9929ddd35cd (diff)
Porting to Eo: Elm Naviframe Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elc_naviframe.c437
-rw-r--r--src/lib/elc_naviframe_common.h84
-rw-r--r--src/lib/elm_naviframe_item.eo111
-rw-r--r--src/lib/elm_widget_naviframe.h23
5 files changed, 378 insertions, 288 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 179e20d07..ce875ae60 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -865,7 +865,9 @@ BUILT_SOURCES = \
865 elm_index_item.eo.c \ 865 elm_index_item.eo.c \
866 elm_index_item.eo.h \ 866 elm_index_item.eo.h \
867 elm_multibuttonentry_item.eo.c \ 867 elm_multibuttonentry_item.eo.c \
868 elm_multibuttonentry_item.eo.h 868 elm_multibuttonentry_item.eo.h \
869 elm_naviframe_item.eo.c \
870 elm_naviframe_item.eo.h
869 871
870elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 872elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
871elementaryeolianfiles_DATA = \ 873elementaryeolianfiles_DATA = \
@@ -970,7 +972,8 @@ elementaryeolianfiles_DATA = \
970 elm_menu_item.eo \ 972 elm_menu_item.eo \
971 elm_ctxpopup_item.eo \ 973 elm_ctxpopup_item.eo \
972 elm_index_item.eo \ 974 elm_index_item.eo \
973 elm_multibuttonentry_item.eo 975 elm_multibuttonentry_item.eo \
976 elm_naviframe_item.eo
974 977
975EXTRA_DIST += ${elementaryeolianfiles_DATA} 978EXTRA_DIST += ${elementaryeolianfiles_DATA}
976 979
@@ -1075,6 +1078,7 @@ nodist_includesunstable_HEADERS = \
1075 elm_menu_item.eo.h \ 1078 elm_menu_item.eo.h \
1076 elm_index_item.eo.h \ 1079 elm_index_item.eo.h \
1077 elm_multibuttonentry_item.eo.h \ 1080 elm_multibuttonentry_item.eo.h \
1081 elm_naviframe_item.eo.h \
1078 elm_ctxpopup_item.eo.h \ 1082 elm_ctxpopup_item.eo.h \
1079 elm_slideshow_item.eo.h \ 1083 elm_slideshow_item.eo.h \
1080 elm_layout.eo.legacy.h \ 1084 elm_layout.eo.legacy.h \
@@ -1150,7 +1154,8 @@ nodist_includesunstable_HEADERS = \
1150 elm_menu_item.eo.legacy.h \ 1154 elm_menu_item.eo.legacy.h \
1151 elm_ctxpopup_item.eo.legacy.h \ 1155 elm_ctxpopup_item.eo.legacy.h \
1152 elm_index_item.eo.legacy.h \ 1156 elm_index_item.eo.legacy.h \
1153 elm_multibuttonentry_item.eo.legacy.h 1157 elm_multibuttonentry_item.eo.legacy.h \
1158 elm_naviframe_item.eo.legacy.h
1154 1159
1155if HAVE_CXX11 1160if HAVE_CXX11
1156 1161
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index ae00e6577..3b04573b6 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#define ELM_WIDGET_ITEM_PROTECTED
5#include <Elementary.h> 6#include <Elementary.h>
6#include "elm_priv.h" 7#include "elm_priv.h"
7#include "elm_widget_naviframe.h" 8#include "elm_widget_naviframe.h"
@@ -55,7 +56,7 @@ static const Elm_Action key_actions[] = {
55}; 56};
56 57
57static void 58static void
58_resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item *it) 59_resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item_Data *it)
59{ 60{
60 if (it) 61 if (it)
61 { 62 {
@@ -65,7 +66,7 @@ _resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item *it)
65} 66}
66 67
67static void 68static void
68_prev_page_focus_recover(Elm_Naviframe_Item *it) 69_prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
69{ 70{
70 Evas_Object *newest; 71 Evas_Object *newest;
71 unsigned int order = 0; 72 unsigned int order = 0;
@@ -85,10 +86,10 @@ _prev_page_focus_recover(Elm_Naviframe_Item *it)
85EOLIAN static Eina_Bool 86EOLIAN static Eina_Bool
86_elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) 87_elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
87{ 88{
88 Elm_Naviframe_Item *it; 89 Elm_Naviframe_Item_Data *it;
89 90
90 EINA_INLIST_FOREACH(sd->stack, it) 91 EINA_INLIST_FOREACH(sd->stack, it)
91 elm_widget_item_translate(it); 92 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_translate());
92 93
93 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 94 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
94 95
@@ -101,7 +102,7 @@ _item_content_del_cb(void *data,
101 Evas_Object *obj EINA_UNUSED, 102 Evas_Object *obj EINA_UNUSED,
102 void *event_info EINA_UNUSED) 103 void *event_info EINA_UNUSED)
103{ 104{
104 Elm_Naviframe_Item *it = data; 105 Elm_Naviframe_Item_Data *it = data;
105 106
106 it->content = NULL; 107 it->content = NULL;
107 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm"); 108 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
@@ -113,7 +114,7 @@ _item_title_prev_btn_del_cb(void *data,
113 Evas_Object *obj EINA_UNUSED, 114 Evas_Object *obj EINA_UNUSED,
114 void *event_info EINA_UNUSED) 115 void *event_info EINA_UNUSED)
115{ 116{
116 Elm_Naviframe_Item *it = data; 117 Elm_Naviframe_Item_Data *it = data;
117 118
118 it->title_prev_btn = NULL; 119 it->title_prev_btn = NULL;
119 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm"); 120 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
@@ -125,7 +126,7 @@ _item_title_next_btn_del_cb(void *data,
125 Evas_Object *obj EINA_UNUSED, 126 Evas_Object *obj EINA_UNUSED,
126 void *event_info EINA_UNUSED) 127 void *event_info EINA_UNUSED)
127{ 128{
128 Elm_Naviframe_Item *it = data; 129 Elm_Naviframe_Item_Data *it = data;
129 130
130 it->title_next_btn = NULL; 131 it->title_next_btn = NULL;
131 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm"); 132 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
@@ -137,7 +138,7 @@ _item_title_icon_del_cb(void *data,
137 Evas_Object *obj EINA_UNUSED, 138 Evas_Object *obj EINA_UNUSED,
138 void *event_info EINA_UNUSED) 139 void *event_info EINA_UNUSED)
139{ 140{
140 Elm_Naviframe_Item *it = data; 141 Elm_Naviframe_Item_Data *it = data;
141 142
142 it->title_icon = NULL; 143 it->title_icon = NULL;
143 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm"); 144 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
@@ -151,7 +152,7 @@ _title_content_del(void *data,
151{ 152{
152 char buf[1024]; 153 char buf[1024];
153 Elm_Naviframe_Content_Item_Pair *pair = data; 154 Elm_Naviframe_Content_Item_Pair *pair = data;
154 Elm_Naviframe_Item *it = pair->it; 155 Elm_Naviframe_Item_Data *it = pair->it;
155 snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part); 156 snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
156 elm_object_signal_emit(VIEW(it), buf, "elm"); 157 elm_object_signal_emit(VIEW(it), buf, "elm");
157 it->content_list = eina_inlist_remove(it->content_list, 158 it->content_list = eina_inlist_remove(it->content_list,
@@ -161,7 +162,7 @@ _title_content_del(void *data,
161} 162}
162 163
163static void 164static void
164_item_free(Elm_Naviframe_Item *it) 165_item_free(Elm_Naviframe_Item_Data *it)
165{ 166{
166 Eina_Inlist *l; 167 Eina_Inlist *l;
167 Elm_Naviframe_Content_Item_Pair *content_pair; 168 Elm_Naviframe_Content_Item_Pair *content_pair;
@@ -205,7 +206,7 @@ _item_free(Elm_Naviframe_Item *it)
205} 206}
206 207
207static void 208static void
208_item_content_signals_emit(Elm_Naviframe_Item *it) 209_item_content_signals_emit(Elm_Naviframe_Item_Data *it)
209{ 210{
210 Elm_Naviframe_Content_Item_Pair *content_pair; 211 Elm_Naviframe_Content_Item_Pair *content_pair;
211 char buf[1024]; 212 char buf[1024];
@@ -243,7 +244,7 @@ _item_content_signals_emit(Elm_Naviframe_Item *it)
243} 244}
244 245
245static void 246static void
246_item_text_signals_emit(Elm_Naviframe_Item *it) 247_item_text_signals_emit(Elm_Naviframe_Item_Data *it)
247{ 248{
248 Elm_Naviframe_Text_Item_Pair *text_pair; 249 Elm_Naviframe_Text_Item_Pair *text_pair;
249 char buf[1024]; 250 char buf[1024];
@@ -269,7 +270,7 @@ _item_text_signals_emit(Elm_Naviframe_Item *it)
269} 270}
270 271
271static Evas_Object * 272static Evas_Object *
272_access_object_get(Elm_Naviframe_Item *it, const char* part) 273_access_object_get(Elm_Naviframe_Item_Data *it, const char* part)
273{ 274{
274 Evas_Object *po, *ao; 275 Evas_Object *po, *ao;
275 276
@@ -302,7 +303,7 @@ _access_info_has(Evas_Object *obj, int type)
302} 303}
303 304
304static void 305static void
305_item_signals_emit(Elm_Naviframe_Item *it) 306_item_signals_emit(Elm_Naviframe_Item_Data *it)
306{ 307{
307 _item_text_signals_emit(it); 308 _item_text_signals_emit(it);
308 _item_content_signals_emit(it); 309 _item_content_signals_emit(it);
@@ -311,7 +312,7 @@ _item_signals_emit(Elm_Naviframe_Item *it)
311/* FIXME: we need to handle the case when this function is called 312/* FIXME: we need to handle the case when this function is called
312 * during a transition */ 313 * during a transition */
313static void 314static void
314_item_style_set(Elm_Naviframe_Item *it, 315_item_style_set(Elm_Naviframe_Item_Data *it,
315 const char *item_style) 316 const char *item_style)
316{ 317{
317 char buf[256]; 318 char buf[256];
@@ -343,13 +344,13 @@ _on_item_title_transition_finished(void *data,
343 const char *emission EINA_UNUSED, 344 const char *emission EINA_UNUSED,
344 const char *source EINA_UNUSED) 345 const char *source EINA_UNUSED)
345{ 346{
346 Elm_Naviframe_Item *it = data; 347 Elm_Naviframe_Item_Data *it = data;
347 348
348 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_TRANSITION_FINISHED, data); 349 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_TRANSITION_FINISHED, EO_OBJ(it));
349} 350}
350 351
351static void 352static void
352_item_title_enabled_update(Elm_Naviframe_Item *nit, Eina_Bool transition) 353_item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition)
353{ 354{
354 transition = !!transition; 355 transition = !!transition;
355 if (transition) 356 if (transition)
@@ -371,7 +372,7 @@ _item_title_enabled_update(Elm_Naviframe_Item *nit, Eina_Bool transition)
371EOLIAN static Eina_Bool 372EOLIAN static Eina_Bool
372_elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd) 373_elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
373{ 374{
374 Elm_Naviframe_Item *it; 375 Elm_Naviframe_Item_Data *it;
375 const char *style = NULL, *sstyle = NULL; 376 const char *style = NULL, *sstyle = NULL;
376 377
377 eo_do(obj, style = elm_obj_widget_style_get()); 378 eo_do(obj, style = elm_obj_widget_style_get());
@@ -392,7 +393,7 @@ _elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
392static char * 393static char *
393_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) 394_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
394{ 395{
395 Elm_Naviframe_Item *nit; 396 Elm_Naviframe_Item_Data *nit;
396 Evas_Object *layout; 397 Evas_Object *layout;
397 Eina_Strbuf *buf; 398 Eina_Strbuf *buf;
398 const char *info; 399 const char *info;
@@ -420,7 +421,7 @@ end:
420} 421}
421 422
422static void 423static void
423_access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access) 424_access_obj_process(Elm_Naviframe_Item_Data *it, Eina_Bool is_access)
424{ 425{
425 Evas_Object *ao, *eo; 426 Evas_Object *ao, *eo;
426 427
@@ -436,13 +437,13 @@ _access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
436 _elm_access_callback_set(_elm_access_info_get(ao), 437 _elm_access_callback_set(_elm_access_info_get(ao),
437 ELM_ACCESS_INFO, _access_info_cb, it); 438 ELM_ACCESS_INFO, _access_info_cb, it);
438 /* to access title access object, any idea? */ 439 /* to access title access object, any idea? */
439 ((Elm_Widget_Item_Data *)it)->access_obj = ao; 440 it->base->access_obj = ao;
440 } 441 }
441 } 442 }
442 else 443 else
443 { 444 {
444 /* to access title access object, any idea? */ 445 /* to access title access object, any idea? */
445 ao = ((Elm_Widget_Item_Data *)it)->access_obj; 446 ao = it->base->access_obj;
446 if (!ao) return; 447 if (!ao) return;
447 448
448 if (it->title_label || it->subtitle_label) 449 if (it->title_label || it->subtitle_label)
@@ -452,12 +453,13 @@ _access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
452 } 453 }
453} 454}
454 455
455static void 456EOLIAN static void
456_item_text_set_hook(Elm_Object_Item *it, 457_elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED,
457 const char *part, 458 Elm_Naviframe_Item_Data *it,
458 const char *label) 459 const char *part,
460 const char *label)
459{ 461{
460 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 462 Elm_Naviframe_Item_Data *nit = it;
461 Elm_Naviframe_Text_Item_Pair *pair = NULL; 463 Elm_Naviframe_Text_Item_Pair *pair = NULL;
462 char buf[1024]; 464 char buf[1024];
463 465
@@ -513,9 +515,10 @@ _item_text_set_hook(Elm_Object_Item *it,
513 elm_layout_sizing_eval(WIDGET(nit)); 515 elm_layout_sizing_eval(WIDGET(nit));
514} 516}
515 517
516static const char * 518EOLIAN static const char *
517_item_text_get_hook(const Elm_Object_Item *it, 519_elm_naviframe_item_elm_widget_item_part_text_get(Eo *nit EINA_UNUSED,
518 const char *part) 520 Elm_Naviframe_Item_Data *it,
521 const char *part)
519{ 522{
520 char buf[1024]; 523 char buf[1024];
521 524
@@ -529,13 +532,12 @@ _item_text_get_hook(const Elm_Object_Item *it,
529 return elm_object_part_text_get(VIEW(it), buf); 532 return elm_object_part_text_get(VIEW(it), buf);
530} 533}
531 534
532static Eina_Bool 535EOLIAN static Eina_Bool
533_item_del_pre_hook(Elm_Object_Item *it) 536_elm_naviframe_item_elm_widget_item_del_pre(Eo *eo_item, Elm_Naviframe_Item_Data *it)
534{ 537{
535 Elm_Naviframe_Item *nit, *prev_it = NULL; 538 Elm_Naviframe_Item_Data *nit = it, *prev_it = NULL;
536 Eina_Bool top; 539 Eina_Bool top;
537 540
538 nit = (Elm_Naviframe_Item *)it;
539 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd); 541 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
540 542
541 nit->delete_me = EINA_TRUE; 543 nit->delete_me = EINA_TRUE;
@@ -543,7 +545,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
543 545
544 ecore_animator_del(nit->animator); 546 ecore_animator_del(nit->animator);
545 547
546 top = (it == elm_naviframe_top_item_get(WIDGET(nit))); 548 top = (eo_item == (Eo *)elm_naviframe_top_item_get(WIDGET(nit)));
547 if (evas_object_data_get(VIEW(nit), "out_of_list")) 549 if (evas_object_data_get(VIEW(nit), "out_of_list"))
548 goto end; 550 goto end;
549 551
@@ -553,7 +555,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
553 { 555 {
554 if (sd->stack && sd->stack->last) 556 if (sd->stack && sd->stack->last)
555 prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last, 557 prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last,
556 Elm_Naviframe_Item); 558 Elm_Naviframe_Item_Data);
557 if (!prev_it) goto end; 559 if (!prev_it) goto end;
558 560
559 elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE); 561 elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE);
@@ -576,7 +578,7 @@ end:
576} 578}
577 579
578static void 580static void
579_item_content_set(Elm_Naviframe_Item *it, 581_item_content_set(Elm_Naviframe_Item_Data *it,
580 Evas_Object *content) 582 Evas_Object *content)
581{ 583{
582 if (it->content == content) return; 584 if (it->content == content) return;
@@ -594,7 +596,7 @@ _item_content_set(Elm_Naviframe_Item *it,
594} 596}
595 597
596static void 598static void
597_item_title_prev_btn_set(Elm_Naviframe_Item *it, 599_item_title_prev_btn_set(Elm_Naviframe_Item_Data *it,
598 Evas_Object *btn) 600 Evas_Object *btn)
599{ 601{
600 if (it->title_prev_btn == btn) return; 602 if (it->title_prev_btn == btn) return;
@@ -611,7 +613,7 @@ _item_title_prev_btn_set(Elm_Naviframe_Item *it,
611} 613}
612 614
613static void 615static void
614_item_title_next_btn_set(Elm_Naviframe_Item *it, 616_item_title_next_btn_set(Elm_Naviframe_Item_Data *it,
615 Evas_Object *btn) 617 Evas_Object *btn)
616{ 618{
617 if (it->title_next_btn == btn) return; 619 if (it->title_next_btn == btn) return;
@@ -627,7 +629,7 @@ _item_title_next_btn_set(Elm_Naviframe_Item *it,
627} 629}
628 630
629static void 631static void
630_item_title_icon_set(Elm_Naviframe_Item *it, 632_item_title_icon_set(Elm_Naviframe_Item_Data *it,
631 Evas_Object *icon) 633 Evas_Object *icon)
632{ 634{
633 if (it->title_icon == icon) return; 635 if (it->title_icon == icon) return;
@@ -643,7 +645,7 @@ _item_title_icon_set(Elm_Naviframe_Item *it,
643} 645}
644 646
645static Evas_Object * 647static Evas_Object *
646_item_content_unset(Elm_Naviframe_Item *it) 648_item_content_unset(Elm_Naviframe_Item_Data *it)
647{ 649{
648 Evas_Object *content = it->content; 650 Evas_Object *content = it->content;
649 651
@@ -660,7 +662,7 @@ _item_content_unset(Elm_Naviframe_Item *it)
660} 662}
661 663
662static Evas_Object * 664static Evas_Object *
663_item_title_prev_btn_unset(Elm_Naviframe_Item *it) 665_item_title_prev_btn_unset(Elm_Naviframe_Item_Data *it)
664{ 666{
665 Evas_Object *content = it->title_prev_btn; 667 Evas_Object *content = it->title_prev_btn;
666 668
@@ -678,7 +680,7 @@ _item_title_prev_btn_unset(Elm_Naviframe_Item *it)
678} 680}
679 681
680static Evas_Object * 682static Evas_Object *
681_item_title_next_btn_unset(Elm_Naviframe_Item *it) 683_item_title_next_btn_unset(Elm_Naviframe_Item_Data *it)
682{ 684{
683 Evas_Object *content = it->title_next_btn; 685 Evas_Object *content = it->title_next_btn;
684 686
@@ -695,7 +697,7 @@ _item_title_next_btn_unset(Elm_Naviframe_Item *it)
695} 697}
696 698
697static Evas_Object * 699static Evas_Object *
698_item_title_icon_unset(Elm_Naviframe_Item *it) 700_item_title_icon_unset(Elm_Naviframe_Item_Data *it)
699{ 701{
700 Evas_Object *content = it->title_icon; 702 Evas_Object *content = it->title_icon;
701 703
@@ -727,7 +729,7 @@ _part_aliasing_eval(const char **part)
727} 729}
728 730
729static void 731static void
730_title_content_set(Elm_Naviframe_Item *it, 732_title_content_set(Elm_Naviframe_Item_Data *it,
731 const char *part, 733 const char *part,
732 Evas_Object *content) 734 Evas_Object *content)
733{ 735{
@@ -788,13 +790,12 @@ _title_content_set(Elm_Naviframe_Item *it,
788 pair); 790 pair);
789} 791}
790 792
791static void 793EOLIAN static void
792_item_content_set_hook(Elm_Object_Item *it, 794_elm_naviframe_item_elm_widget_item_part_content_set(Eo *eo_nit EINA_UNUSED,
793 const char *part, 795 Elm_Naviframe_Item_Data *nit,
794 Evas_Object *content) 796 const char *part,
797 Evas_Object *content)
795{ 798{
796 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
797
798 _part_aliasing_eval(&part); 799 _part_aliasing_eval(&part);
799 800
800 //specified parts 801 //specified parts
@@ -809,15 +810,14 @@ _item_content_set_hook(Elm_Object_Item *it,
809 else 810 else
810 _title_content_set(nit, part, content); 811 _title_content_set(nit, part, content);
811 812
812 elm_layout_sizing_eval(WIDGET(it)); 813 elm_layout_sizing_eval(WIDGET(nit));
813} 814}
814 815
815static Evas_Object * 816EOLIAN static Evas_Object *
816_item_content_get_hook(const Elm_Object_Item *it, 817_elm_naviframe_item_elm_widget_item_part_content_get(Eo *eo_nit EINA_UNUSED,
817 const char *part) 818 Elm_Naviframe_Item_Data *nit,
819 const char *part)
818{ 820{
819 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
820
821 _part_aliasing_eval(&part); 821 _part_aliasing_eval(&part);
822 822
823 //specified parts 823 //specified parts
@@ -835,7 +835,7 @@ _item_content_get_hook(const Elm_Object_Item *it,
835} 835}
836 836
837static Evas_Object * 837static Evas_Object *
838_title_content_unset(Elm_Naviframe_Item *it, const char *part) 838_title_content_unset(Elm_Naviframe_Item_Data *it, const char *part)
839{ 839{
840 Elm_Naviframe_Content_Item_Pair *pair = NULL; 840 Elm_Naviframe_Content_Item_Pair *pair = NULL;
841 char buf[1028]; 841 char buf[1028];
@@ -865,11 +865,11 @@ _title_content_unset(Elm_Naviframe_Item *it, const char *part)
865 return content; 865 return content;
866} 866}
867 867
868static Evas_Object * 868EOLIAN static Evas_Object *
869_item_content_unset_hook(Elm_Object_Item *it, 869_elm_naviframe_item_elm_widget_item_part_content_unset(Eo *eo_nit EINA_UNUSED,
870 const char *part) 870 Elm_Naviframe_Item_Data *nit,
871 const char *part)
871{ 872{
872 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
873 Evas_Object *o = NULL; 873 Evas_Object *o = NULL;
874 874
875 _part_aliasing_eval(&part); 875 _part_aliasing_eval(&part);
@@ -886,15 +886,16 @@ _item_content_unset_hook(Elm_Object_Item *it,
886 else 886 else
887 o = _title_content_unset(nit, part); 887 o = _title_content_unset(nit, part);
888 888
889 elm_layout_sizing_eval(WIDGET(it)); 889 elm_layout_sizing_eval(WIDGET(nit));
890 890
891 return o; 891 return o;
892} 892}
893 893
894static void 894EOLIAN static void
895_item_signal_emit_hook(Elm_Object_Item *it, 895_elm_naviframe_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED,
896 const char *emission, 896 Elm_Naviframe_Item_Data *it,
897 const char *source) 897 const char *emission,
898 const char *source)
898{ 899{
899 elm_object_signal_emit(VIEW(it), emission, source); 900 elm_object_signal_emit(VIEW(it), emission, source);
900} 901}
@@ -903,13 +904,13 @@ EOLIAN static void
903_elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd) 904_elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd)
904{ 905{
905 Evas_Coord minw = -1, minh = -1; 906 Evas_Coord minw = -1, minh = -1;
906 Elm_Naviframe_Item *it, *top; 907 Elm_Naviframe_Item_Data *it, *top;
907 Evas_Coord x, y, w, h; 908 Evas_Coord x, y, w, h;
908 909
909 if (sd->on_deletion) return; 910 if (sd->on_deletion) return;
910 if (!sd->stack) return; 911 if (!sd->stack) return;
911 912
912 top = (EINA_INLIST_CONTAINER_GET(sd->stack->last, Elm_Naviframe_Item)); 913 top = (EINA_INLIST_CONTAINER_GET(sd->stack->last, Elm_Naviframe_Item_Data));
913 evas_object_geometry_get(obj, &x, &y, &w, &h); 914 evas_object_geometry_get(obj, &x, &y, &w, &h);
914 EINA_INLIST_FOREACH(sd->stack, it) 915 EINA_INLIST_FOREACH(sd->stack, it)
915 { 916 {
@@ -985,10 +986,11 @@ _back_btn_new(Evas_Object *obj, const char *title_label)
985EOLIAN static void 986EOLIAN static void
986_elm_naviframe_elm_layout_signal_emit(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *emission, const char *source) 987_elm_naviframe_elm_layout_signal_emit(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *emission, const char *source)
987{ 988{
988 Elm_Naviframe_Item *top_it; 989 Elm_Object_Item *eo_top_it;
989 990
990 top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 991 eo_top_it = elm_naviframe_top_item_get(obj);
991 if (!top_it) return; 992 if (!eo_top_it) return;
993 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
992 994
993 eo_do(VIEW(top_it), elm_obj_layout_signal_emit(emission, source)); 995 eo_do(VIEW(top_it), elm_obj_layout_signal_emit(emission, source));
994} 996}
@@ -1060,9 +1062,9 @@ _on_item_title_clicked(void *data,
1060 const char *emission EINA_UNUSED, 1062 const char *emission EINA_UNUSED,
1061 const char *source EINA_UNUSED) 1063 const char *source EINA_UNUSED)
1062{ 1064{
1063 Elm_Naviframe_Item *it = data; 1065 Elm_Naviframe_Item_Data *it = data;
1064 1066
1065 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, it); 1067 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, EO_OBJ(it));
1066} 1068}
1067 1069
1068/* "elm,state,cur,pushed" 1070/* "elm,state,cur,pushed"
@@ -1073,7 +1075,7 @@ _on_item_push_finished(void *data,
1073 const char *emission EINA_UNUSED, 1075 const char *emission EINA_UNUSED,
1074 const char *source EINA_UNUSED) 1076 const char *source EINA_UNUSED)
1075{ 1077{
1076 Elm_Naviframe_Item *it = data; 1078 Elm_Naviframe_Item_Data *it = data;
1077 1079
1078 if (!it) return; 1080 if (!it) return;
1079 1081
@@ -1095,7 +1097,7 @@ _on_item_pop_finished(void *data,
1095 const char *emission EINA_UNUSED, 1097 const char *emission EINA_UNUSED,
1096 const char *source EINA_UNUSED) 1098 const char *source EINA_UNUSED)
1097{ 1099{
1098 Elm_Naviframe_Item *it = data; 1100 Elm_Naviframe_Item_Data *it = data;
1099 1101
1100 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd); 1102 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
1101 1103
@@ -1103,7 +1105,7 @@ _on_item_pop_finished(void *data,
1103 elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE); 1105 elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1104 sd->popping = eina_list_remove(sd->popping, it); 1106 sd->popping = eina_list_remove(sd->popping, it);
1105 1107
1106 elm_widget_item_del(data); 1108 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_del());
1107} 1109}
1108 1110
1109/* "elm,state,new,pushed", 1111/* "elm,state,new,pushed",
@@ -1115,7 +1117,7 @@ _on_item_show_finished(void *data,
1115 const char *emission EINA_UNUSED, 1117 const char *emission EINA_UNUSED,
1116 const char *source EINA_UNUSED) 1118 const char *source EINA_UNUSED)
1117{ 1119{
1118 Elm_Naviframe_Item *it = data; 1120 Elm_Naviframe_Item_Data *it = data;
1119 1121
1120 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd); 1122 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
1121 1123
@@ -1139,7 +1141,7 @@ _on_item_size_hints_changed(void *data,
1139} 1141}
1140 1142
1141static void 1143static void
1142_item_dispmode_set(Elm_Naviframe_Item *it, Evas_Display_Mode dispmode) 1144_item_dispmode_set(Elm_Naviframe_Item_Data *it, Evas_Display_Mode dispmode)
1143{ 1145{
1144 if (it->dispmode == dispmode) return; 1146 if (it->dispmode == dispmode) return;
1145 switch (dispmode) 1147 switch (dispmode)
@@ -1160,33 +1162,35 @@ _access_prev_btn_info_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
1160 return strdup(E_("Back")); 1162 return strdup(E_("Back"));
1161} 1163}
1162 1164
1163static Elm_Naviframe_Item * 1165EOLIAN static void
1166_elm_naviframe_item_eo_base_constructor(Eo *eo_item, Elm_Naviframe_Item_Data *it)
1167{
1168 eo_do_super(eo_item, ELM_NAVIFRAME_ITEM_CLASS, eo_constructor());
1169 it->base = eo_data_scope_get(eo_item, ELM_WIDGET_ITEM_CLASS);
1170}
1171
1172static Elm_Object_Item *
1164_item_new(Evas_Object *obj, 1173_item_new(Evas_Object *obj,
1165 const Elm_Naviframe_Item *prev_it, 1174 const Elm_Object_Item *eo_prev_it,
1166 const char *title_label, 1175 const char *title_label,
1167 Evas_Object *prev_btn, 1176 Evas_Object *prev_btn,
1168 Evas_Object *next_btn, 1177 Evas_Object *next_btn,
1169 Evas_Object *content, 1178 Evas_Object *content,
1170 const char *item_style) 1179 const char *item_style)
1171{ 1180{
1172 Elm_Naviframe_Item *it; 1181 Eo *eo_item;
1173 1182
1174 ELM_NAVIFRAME_DATA_GET(obj, sd); 1183 ELM_NAVIFRAME_DATA_GET(obj, sd);
1175 1184
1176 it = elm_widget_item_new(obj, Elm_Naviframe_Item); 1185 eo_item = eo_add(ELM_NAVIFRAME_ITEM_CLASS, obj);
1177 if (!it) 1186
1187 if (!eo_item)
1178 { 1188 {
1179 ERR("Failed to allocate new item! : naviframe=%p", obj); 1189 ERR("Failed to allocate new item! : naviframe=%p", obj);
1180 return NULL; 1190 return NULL;
1181 } 1191 }
1182 1192
1183 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook); 1193 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1184 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
1185 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
1186 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
1187 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
1188 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
1189 elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
1190 1194
1191 //item base layout 1195 //item base layout
1192 VIEW(it) = elm_layout_add(obj); 1196 VIEW(it) = elm_layout_add(obj);
@@ -1213,19 +1217,19 @@ _item_new(Evas_Object *obj,
1213 _item_style_set(it, item_style); 1217 _item_style_set(it, item_style);
1214 1218
1215 if (title_label) 1219 if (title_label)
1216 _item_text_set_hook((Elm_Object_Item *)it, TITLE_PART, title_label); 1220 eo_do(eo_item, elm_wdg_item_part_text_set(TITLE_PART, title_label));
1217 1221
1218 //title buttons 1222 //title buttons
1219 if ((!prev_btn) && sd->auto_pushed && prev_it) 1223 if ((!prev_btn) && sd->auto_pushed && eo_prev_it)
1220 { 1224 {
1225 ELM_NAVIFRAME_ITEM_DATA_GET(eo_prev_it, prev_it);
1221 const char *prev_title = prev_it->title_label; 1226 const char *prev_title = prev_it->title_label;
1222 prev_btn = _back_btn_new(obj, prev_title); 1227 prev_btn = _back_btn_new(obj, prev_title);
1223 } 1228 }
1224 1229
1225 if (prev_btn) 1230 if (prev_btn)
1226 { 1231 {
1227 _item_content_set_hook((Elm_Object_Item *)it, PREV_BTN_PART, prev_btn); 1232 eo_do(eo_item, elm_wdg_item_part_content_set(PREV_BTN_PART, prev_btn));
1228
1229 if (!elm_layout_text_get(prev_btn, NULL)) 1233 if (!elm_layout_text_get(prev_btn, NULL))
1230 { 1234 {
1231 if (!_access_info_has(prev_btn, ELM_ACCESS_INFO)) 1235 if (!_access_info_has(prev_btn, ELM_ACCESS_INFO))
@@ -1240,7 +1244,7 @@ _item_new(Evas_Object *obj,
1240 1244
1241 if (next_btn) 1245 if (next_btn)
1242 { 1246 {
1243 _item_content_set_hook((Elm_Object_Item *)it, NEXT_BTN_PART, next_btn); 1247 eo_do(eo_item, elm_wdg_item_part_content_set(NEXT_BTN_PART, next_btn));
1244 1248
1245 if (!elm_layout_text_get(next_btn, NULL)) 1249 if (!elm_layout_text_get(next_btn, NULL))
1246 { 1250 {
@@ -1258,14 +1262,14 @@ _item_new(Evas_Object *obj,
1258 1262
1259 it->title_enabled = EINA_TRUE; 1263 it->title_enabled = EINA_TRUE;
1260 1264
1261 return it; 1265 return EO_OBJ(it);
1262} 1266}
1263 1267
1264static void 1268static void
1265_on_obj_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 1269_on_obj_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
1266 Evas_Object *obj, void *event_info EINA_UNUSED) 1270 Evas_Object *obj, void *event_info EINA_UNUSED)
1267{ 1271{
1268 Elm_Naviframe_Item *it; 1272 Elm_Naviframe_Item_Data *it;
1269 Evas_Display_Mode dispmode; 1273 Evas_Display_Mode dispmode;
1270 1274
1271 ELM_NAVIFRAME_DATA_GET(obj, sd); 1275 ELM_NAVIFRAME_DATA_GET(obj, sd);
@@ -1285,16 +1289,17 @@ _elm_naviframe_elm_widget_focus_next(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED
1285 Evas_Object *ao; 1289 Evas_Object *ao;
1286 1290
1287 Eina_List *l = NULL; 1291 Eina_List *l = NULL;
1288 Elm_Naviframe_Item *top_it; 1292 Elm_Object_Item *eo_top_it;
1289 void *(*list_data_get)(const Eina_List *list); 1293 void *(*list_data_get)(const Eina_List *list);
1290 1294
1291 Eina_Bool int_ret = EINA_FALSE; 1295 Eina_Bool int_ret = EINA_FALSE;
1292 1296
1293 top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 1297 eo_top_it = elm_naviframe_top_item_get(obj);
1294 if (!top_it) goto end; 1298 if (!eo_top_it) goto end;
1295 1299
1296 list_data_get = eina_list_data_get; 1300 list_data_get = eina_list_data_get;
1297 1301
1302 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1298 l = eina_list_append(l, VIEW(top_it)); 1303 l = eina_list_append(l, VIEW(top_it));
1299 1304
1300 /* access */ 1305 /* access */
@@ -1329,14 +1334,15 @@ _elm_naviframe_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Naviframe_Dat
1329 Eina_Bool int_ret; 1334 Eina_Bool int_ret;
1330 1335
1331 Eina_List *l = NULL; 1336 Eina_List *l = NULL;
1332 Elm_Naviframe_Item *top_it; 1337 Elm_Object_Item *eo_top_it;
1333 void *(*list_data_get)(const Eina_List *list); 1338 void *(*list_data_get)(const Eina_List *list);
1334 1339
1335 top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 1340 eo_top_it = elm_naviframe_top_item_get(obj);
1336 if (!top_it) return EINA_FALSE; 1341 if (!eo_top_it) return EINA_FALSE;
1337 1342
1338 list_data_get = eina_list_data_get; 1343 list_data_get = eina_list_data_get;
1339 1344
1345 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1340 l = eina_list_append(l, VIEW(top_it)); 1346 l = eina_list_append(l, VIEW(top_it));
1341 1347
1342 int_ret = elm_widget_focus_list_direction_get 1348 int_ret = elm_widget_focus_list_direction_get
@@ -1369,14 +1375,16 @@ _elm_naviframe_evas_object_smart_add(Eo *obj, Elm_Naviframe_Data *priv)
1369static Eina_Bool 1375static Eina_Bool
1370_pop_transition_cb(void *data) 1376_pop_transition_cb(void *data)
1371{ 1377{
1372 Elm_Naviframe_Item *prev_it, *it; 1378 Elm_Object_Item *eo_prev_it;
1373 it = (Elm_Naviframe_Item *)data; 1379 Elm_Naviframe_Item_Data *it;
1380 it = (Elm_Naviframe_Item_Data *)data;
1374 1381
1375 it->animator = NULL; 1382 it->animator = NULL;
1376 1383
1377 prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(WIDGET(it)); 1384 eo_prev_it = elm_naviframe_top_item_get(WIDGET(it));
1378 if (prev_it) 1385 if (eo_prev_it)
1379 { 1386 {
1387 ELM_NAVIFRAME_ITEM_DATA_GET(eo_prev_it, prev_it);
1380 elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped,deferred", 1388 elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped,deferred",
1381 "elm"); 1389 "elm");
1382 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it))); 1390 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
@@ -1390,21 +1398,21 @@ _pop_transition_cb(void *data)
1390EOLIAN static void 1398EOLIAN static void
1391_elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd) 1399_elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd)
1392{ 1400{
1393 Elm_Naviframe_Item *it; 1401 Elm_Naviframe_Item_Data *it;
1394 1402
1395 sd->on_deletion = EINA_TRUE; 1403 sd->on_deletion = EINA_TRUE;
1396 1404
1397 while (sd->stack) 1405 while (sd->stack)
1398 { 1406 {
1399 it = EINA_INLIST_CONTAINER_GET(sd->stack, Elm_Naviframe_Item); 1407 it = EINA_INLIST_CONTAINER_GET(sd->stack, Elm_Naviframe_Item_Data);
1400 elm_widget_item_del(it); 1408 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_del());
1401 } 1409 }
1402 1410
1403 //All popping items which are not called yet by animator. 1411 //All popping items which are not called yet by animator.
1404 EINA_LIST_FREE(sd->popping, it) 1412 EINA_LIST_FREE(sd->popping, it)
1405 { 1413 {
1406 ecore_animator_del(it->animator); 1414 ecore_animator_del(it->animator);
1407 elm_widget_item_del(it); 1415 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_del());
1408 } 1416 }
1409 1417
1410 evas_object_del(sd->dummy_edje); 1418 evas_object_del(sd->dummy_edje);
@@ -1416,9 +1424,11 @@ _elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd)
1416EOLIAN static void 1424EOLIAN static void
1417_elm_naviframe_evas_object_smart_show(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED) 1425_elm_naviframe_evas_object_smart_show(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1418{ 1426{
1419 Elm_Naviframe_Item *top; 1427 Elm_Object_Item *eo_top;
1428
1429 eo_top = (Elm_Object_Item *)elm_naviframe_top_item_get(obj);
1430 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top, top);
1420 1431
1421 top = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
1422 if (top && !top->delete_me) 1432 if (top && !top->delete_me)
1423 evas_object_show(VIEW(top)); 1433 evas_object_show(VIEW(top));
1424} 1434}
@@ -1426,12 +1436,13 @@ _elm_naviframe_evas_object_smart_show(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSE
1426static Eina_Bool 1436static Eina_Bool
1427_key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED) 1437_key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED)
1428{ 1438{
1429 Elm_Naviframe_Item *it = NULL; 1439 Elm_Object_Item *eo_item = NULL;
1430 eo_do(obj, it = (Elm_Naviframe_Item *) elm_obj_naviframe_top_item_get()); 1440 eo_item = eo_do(obj, elm_obj_naviframe_top_item_get());
1431 if (!it) return EINA_FALSE; 1441 if (!eo_item) return EINA_FALSE;
1432 1442
1433 //FIXME: Replace this below code to elm_naviframe_item_pop() at elm 2.0. 1443 //FIXME: Replace this below code to elm_naviframe_item_pop() at elm 2.0.
1434 ///Leave for compatibility. 1444 ///Leave for compatibility.
1445 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1435 if (it->title_prev_btn) 1446 if (it->title_prev_btn)
1436 evas_object_smart_callback_call(it->title_prev_btn, SIG_CLICKED, NULL); 1447 evas_object_smart_callback_call(it->title_prev_btn, SIG_CLICKED, NULL);
1437 1448
@@ -1455,7 +1466,7 @@ _elm_naviframe_elm_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Eva
1455EOLIAN static void 1466EOLIAN static void
1456_elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access) 1467_elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
1457{ 1468{
1458 Elm_Naviframe_Item *it; 1469 Elm_Naviframe_Item_Data *it;
1459 1470
1460 EINA_INLIST_FOREACH(sd->stack, it) 1471 EINA_INLIST_FOREACH(sd->stack, it)
1461 _access_obj_process(it, is_access); 1472 _access_obj_process(it, is_access);
@@ -1464,14 +1475,14 @@ _elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Ei
1464static Eina_Bool 1475static Eina_Bool
1465_push_transition_cb(void *data) 1476_push_transition_cb(void *data)
1466{ 1477{
1467 Elm_Naviframe_Item *prev_it, *it = data; 1478 Elm_Naviframe_Item_Data *prev_it, *it = data;
1468 1479
1469 it->animator = NULL; 1480 it->animator = NULL;
1470 1481
1471 if (EINA_INLIST_GET(it)->prev) 1482 if (EINA_INLIST_GET(it)->prev)
1472 { 1483 {
1473 prev_it = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(it)->prev, 1484 prev_it = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(it)->prev,
1474 Elm_Naviframe_Item); 1485 Elm_Naviframe_Item_Data);
1475 elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed,deferred", 1486 elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed,deferred",
1476 "elm"); 1487 "elm");
1477 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it))); 1488 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
@@ -1483,17 +1494,18 @@ _push_transition_cb(void *data)
1483} 1494}
1484 1495
1485static void 1496static void
1486_item_push_helper(Elm_Naviframe_Item *item) 1497_item_push_helper(Elm_Naviframe_Item_Data *item)
1487{ 1498{
1488 Elm_Naviframe_Item *top_item; 1499 Elm_Object_Item *eo_top_item;
1489 Evas_Object *obj = WIDGET(item); 1500 Evas_Object *obj = WIDGET(item);
1490 ELM_NAVIFRAME_DATA_GET(obj, sd); 1501 ELM_NAVIFRAME_DATA_GET(obj, sd);
1491 top_item = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 1502 eo_top_item = elm_naviframe_top_item_get(obj);
1492 evas_object_show(VIEW(item)); 1503 evas_object_show(VIEW(item));
1493 1504
1505 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_item, top_item);
1494 if (top_item) elm_widget_focused_object_clear(VIEW(top_item)); 1506 if (top_item) elm_widget_focused_object_clear(VIEW(top_item));
1495 _resize_object_reset(obj, item); 1507 _resize_object_reset(obj, item);
1496 if (top_item) 1508 if (eo_top_item)
1497 { 1509 {
1498 elm_widget_tree_unfocusable_set(VIEW(item), EINA_FALSE); 1510 elm_widget_tree_unfocusable_set(VIEW(item), EINA_FALSE);
1499 elm_widget_tree_unfocusable_set(VIEW(top_item), EINA_TRUE); 1511 elm_widget_tree_unfocusable_set(VIEW(top_item), EINA_TRUE);
@@ -1549,60 +1561,71 @@ _elm_naviframe_eo_base_constructor(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1549EOLIAN static Elm_Object_Item* 1561EOLIAN static Elm_Object_Item*
1550_elm_naviframe_item_push(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) 1562_elm_naviframe_item_push(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1551{ 1563{
1552 Elm_Naviframe_Item *top_item, *item; 1564 Elm_Object_Item *top_item, *eo_item;
1553 1565
1554 top_item = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 1566 top_item = elm_naviframe_top_item_get(obj);
1555 item = _item_new(obj, top_item, 1567 eo_item = _item_new(obj, top_item,
1556 title_label, prev_btn, next_btn, content, item_style); 1568 title_label, prev_btn, next_btn, content, item_style);
1569 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, item);
1557 if (!item) return NULL; 1570 if (!item) return NULL;
1558 _item_push_helper(item); 1571 _item_push_helper(item);
1559 return (Elm_Object_Item *)item; 1572 return eo_item;
1560} 1573}
1561 1574
1562EOLIAN static Elm_Object_Item* 1575EOLIAN static Elm_Object_Item*
1563_elm_naviframe_item_insert_before(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) 1576_elm_naviframe_item_insert_before(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *eo_before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1564{ 1577{
1565 Elm_Naviframe_Item *it, *prev_it = NULL; 1578 Elm_Object_Item *eo_it;
1579 Elm_Naviframe_Item_Data *prev_it;
1580 ELM_NAVIFRAME_ITEM_DATA_GET(eo_before, before);
1566 1581
1567 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(before, NULL); 1582 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(before, NULL);
1568 1583
1569 it = (Elm_Naviframe_Item *)before; 1584 eo_it = eo_before;
1585 ELM_NAVIFRAME_ITEM_DATA_GET(eo_it, it);
1570 if (EINA_INLIST_GET(it)->prev) 1586 if (EINA_INLIST_GET(it)->prev)
1571 prev_it = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(it)->prev, 1587 prev_it = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(it)->prev,
1572 Elm_Naviframe_Item); 1588 Elm_Naviframe_Item_Data);
1573 it = _item_new(obj, prev_it, 1589 eo_it = _item_new(obj, EO_OBJ(prev_it),
1574 title_label, prev_btn, next_btn, content, item_style); 1590 title_label, prev_btn, next_btn, content, item_style);
1575 if (!it) return NULL; 1591 if (!eo_it) return NULL;
1592
1593 it = eo_data_scope_get((Eo *)eo_it, ELM_NAVIFRAME_ITEM_CLASS);
1576 1594
1577 sd->stack = eina_inlist_prepend_relative 1595 sd->stack = eina_inlist_prepend_relative
1578 (sd->stack, EINA_INLIST_GET(it), 1596 (sd->stack, EINA_INLIST_GET(it),
1579 EINA_INLIST_GET(((Elm_Naviframe_Item *)before))); 1597 EINA_INLIST_GET(before));
1580 1598
1581 elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE); 1599 elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
1582 elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm"); 1600 elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
1583 1601
1584 elm_layout_sizing_eval(obj); 1602 elm_layout_sizing_eval(obj);
1585 1603
1586 return (Elm_Object_Item *)it; 1604 return eo_it;
1587} 1605}
1588 1606
1589EOLIAN static Elm_Object_Item* 1607EOLIAN static Elm_Object_Item*
1590_elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) 1608_elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *eo_after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1591{ 1609{
1592 Elm_Naviframe_Item *it; 1610 Elm_Object_Item *eo_item;
1593 Eina_Bool top_inserted = EINA_FALSE; 1611 Eina_Bool top_inserted = EINA_FALSE;
1594 1612
1613 ELM_NAVIFRAME_ITEM_DATA_GET(eo_after, after);
1614
1595 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(after, NULL); 1615 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(after, NULL);
1596 1616
1597 it = _item_new(obj, (Elm_Naviframe_Item *)after, 1617 eo_item = _item_new(obj, eo_after,
1598 title_label, prev_btn, next_btn, content, item_style); 1618 title_label, prev_btn, next_btn, content, item_style);
1599 if (!it) return NULL; 1619 if (!eo_item) return NULL;
1600 1620
1601 if (elm_naviframe_top_item_get(obj) == after) top_inserted = EINA_TRUE; 1621 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1622
1623 if (elm_naviframe_top_item_get(obj) == eo_after) top_inserted = EINA_TRUE;
1602 1624
1603 sd->stack = eina_inlist_append_relative 1625 sd->stack = eina_inlist_append_relative
1604 (sd->stack, EINA_INLIST_GET(it), 1626 (sd->stack, EINA_INLIST_GET(it),
1605 EINA_INLIST_GET(((Elm_Naviframe_Item *)after))); 1627 EINA_INLIST_GET(((Elm_Naviframe_Item_Data *)after)));
1628
1606 1629
1607 if (top_inserted) 1630 if (top_inserted)
1608 { 1631 {
@@ -1623,19 +1646,22 @@ _elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Ite
1623 1646
1624 elm_layout_sizing_eval(obj); 1647 elm_layout_sizing_eval(obj);
1625 1648
1626 return (Elm_Object_Item *)it; 1649 return eo_item;
1627} 1650}
1628 1651
1629EOLIAN static Evas_Object* 1652EOLIAN static Evas_Object*
1630_elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd) 1653_elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1631{ 1654{
1632 Elm_Naviframe_Item *it, *prev_it = NULL; 1655 Elm_Object_Item *eo_item;
1656 Elm_Naviframe_Item_Data *prev_it = NULL;
1633 Evas_Object *content = NULL; 1657 Evas_Object *content = NULL;
1634 1658
1635 if (sd->freeze_events && sd->popping) return NULL; 1659 if (sd->freeze_events && sd->popping) return NULL;
1636 1660
1637 it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj); 1661 eo_item = elm_naviframe_top_item_get(obj);
1638 if (!it) return NULL; 1662 if (!eo_item) return NULL;
1663
1664 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1639 1665
1640 if (it->popping) return NULL; 1666 if (it->popping) return NULL;
1641 it->popping = EINA_TRUE; 1667 it->popping = EINA_TRUE;
@@ -1644,11 +1670,11 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1644 if (it->pop_cb) 1670 if (it->pop_cb)
1645 { 1671 {
1646 it->ref++; 1672 it->ref++;
1647 if (!it->pop_cb(it->pop_data, (Elm_Object_Item *)it)) 1673 if (!it->pop_cb(it->pop_data, eo_item))
1648 { 1674 {
1649 it->ref--; 1675 it->ref--;
1650 if (it->delete_me) 1676 if (it->delete_me)
1651 elm_widget_item_del(it); 1677 eo_do((Eo *)eo_item, elm_wdg_item_del());
1652 else 1678 else
1653 it->popping = EINA_FALSE; 1679 it->popping = EINA_FALSE;
1654 evas_object_unref(obj); 1680 evas_object_unref(obj);
@@ -1665,7 +1691,7 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1665 1691
1666 if (sd->stack->last->prev) 1692 if (sd->stack->last->prev)
1667 prev_it = EINA_INLIST_CONTAINER_GET 1693 prev_it = EINA_INLIST_CONTAINER_GET
1668 (sd->stack->last->prev, Elm_Naviframe_Item); 1694 (sd->stack->last->prev, Elm_Naviframe_Item_Data);
1669 1695
1670 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(it)); 1696 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(it));
1671 1697
@@ -1695,7 +1721,7 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1695 sd->popping = eina_list_append(sd->popping, it); 1721 sd->popping = eina_list_append(sd->popping, it);
1696 } 1722 }
1697 else 1723 else
1698 elm_widget_item_del(it); 1724 eo_do((Eo *)eo_item, elm_wdg_item_del());
1699 1725
1700 return content; 1726 return content;
1701} 1727}
@@ -1703,15 +1729,17 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1703EAPI void 1729EAPI void
1704elm_naviframe_item_pop_to(Elm_Object_Item *it) 1730elm_naviframe_item_pop_to(Elm_Object_Item *it)
1705{ 1731{
1706 Elm_Naviframe_Item *nit; 1732 eo_do((Eo *)it, elm_obj_naviframe_item_pop_to());
1707 Eina_Inlist *l; 1733}
1708 1734
1709 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it); 1735EOLIAN static void
1736_elm_naviframe_item_pop_to(Eo *eo_it, Elm_Naviframe_Item_Data *it)
1737{
1738 Eina_Inlist *l;
1710 1739
1711 nit = (Elm_Naviframe_Item *)it; 1740 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
1712 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
1713 1741
1714 if (it == elm_naviframe_top_item_get(WIDGET(nit))) return; 1742 if (eo_it == (Eo *)elm_naviframe_top_item_get(WIDGET(it))) return;
1715 1743
1716 l = sd->stack->last->prev; 1744 l = sd->stack->last->prev;
1717 1745
@@ -1719,34 +1747,37 @@ elm_naviframe_item_pop_to(Elm_Object_Item *it)
1719 1747
1720 while (l) 1748 while (l)
1721 { 1749 {
1722 Elm_Naviframe_Item *iit = EINA_INLIST_CONTAINER_GET 1750 Elm_Naviframe_Item_Data *iit = EINA_INLIST_CONTAINER_GET
1723 (l, Elm_Naviframe_Item); 1751 (l, Elm_Naviframe_Item_Data);
1724 1752
1725 if (iit == nit) break; 1753 if (iit == it) break;
1726 1754
1727 l = l->prev; 1755 l = l->prev;
1728 1756
1729 elm_widget_item_del(iit); 1757 eo_do((Eo *)EO_OBJ(iit), elm_wdg_item_del());
1730 } 1758 }
1731 1759
1732 sd->on_deletion = EINA_FALSE; 1760 sd->on_deletion = EINA_FALSE;
1733 1761
1734 elm_naviframe_item_pop(WIDGET(nit)); 1762 elm_naviframe_item_pop(WIDGET(it));
1735} 1763}
1736 1764
1737EAPI void 1765EAPI void
1738elm_naviframe_item_promote(Elm_Object_Item *it) 1766elm_naviframe_item_promote(Elm_Object_Item *it)
1739{ 1767{
1740 Elm_Object_Item *prev_top; 1768 eo_do((Eo *)it, elm_obj_naviframe_item_promote());
1741 Elm_Naviframe_Item *nit; 1769}
1742 1770
1743 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it); 1771EOLIAN static void
1772_elm_naviframe_item_promote(Eo *eo_it, Elm_Naviframe_Item_Data *it)
1773{
1774 Elm_Object_Item *eo_prev_top;
1775 Elm_Naviframe_Item_Data *nit = it;
1744 1776
1745 nit = (Elm_Naviframe_Item *)it;
1746 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd); 1777 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
1747 1778
1748 prev_top = elm_naviframe_top_item_get(WIDGET(nit)); 1779 eo_prev_top = elm_naviframe_top_item_get(WIDGET(nit));
1749 if (it == prev_top) return; 1780 if (eo_it == (Eo *)eo_prev_top) return;
1750 1781
1751 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit)); 1782 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit));
1752 _item_push_helper(nit); 1783 _item_push_helper(nit);
@@ -1755,13 +1786,13 @@ elm_naviframe_item_promote(Elm_Object_Item *it)
1755EOLIAN static void 1786EOLIAN static void
1756_elm_naviframe_item_simple_promote(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Evas_Object *content) 1787_elm_naviframe_item_simple_promote(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Evas_Object *content)
1757{ 1788{
1758 Elm_Naviframe_Item *itr; 1789 Elm_Naviframe_Item_Data *itr;
1759 1790
1760 EINA_INLIST_FOREACH(sd->stack, itr) 1791 EINA_INLIST_FOREACH(sd->stack, itr)
1761 { 1792 {
1762 if (elm_object_item_content_get((Elm_Object_Item *)itr) == content) 1793 if (elm_object_item_content_get((Elm_Object_Item *)EO_OBJ(itr)) == content)
1763 { 1794 {
1764 elm_naviframe_item_promote((Elm_Object_Item *)itr); 1795 elm_naviframe_item_promote((Elm_Object_Item *)EO_OBJ(itr));
1765 break; 1796 break;
1766 } 1797 }
1767 } 1798 }
@@ -1783,26 +1814,32 @@ EOLIAN static Elm_Object_Item*
1783_elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) 1814_elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
1784{ 1815{
1785 if (!sd->stack) return NULL; 1816 if (!sd->stack) return NULL;
1786 return (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET 1817 Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
1787 (sd->stack->last, Elm_Naviframe_Item)); 1818 (sd->stack->last, Elm_Naviframe_Item_Data);
1819 return ret_it?EO_OBJ(ret_it):NULL;
1788} 1820}
1789 1821
1790EOLIAN static Elm_Object_Item* 1822EOLIAN static Elm_Object_Item*
1791_elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) 1823_elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
1792{ 1824{
1793 if (!sd->stack) return NULL; 1825 if (!sd->stack) return NULL;
1794 return (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET 1826 Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
1795 (sd->stack, Elm_Naviframe_Item)); 1827 (sd->stack, Elm_Naviframe_Item_Data);
1828 return ret_it?EO_OBJ(ret_it):NULL;
1796} 1829}
1797 1830
1798EAPI void 1831EAPI void
1799elm_naviframe_item_style_set(Elm_Object_Item *it, 1832elm_naviframe_item_style_set(Elm_Object_Item *it,
1800 const char *item_style) 1833 const char *item_style)
1801{ 1834{
1802 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 1835 eo_do((Eo *)it, elm_obj_naviframe_item_style_set(item_style));
1803 1836}
1804 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it);
1805 1837
1838EOLIAN static void
1839_elm_naviframe_item_style_set(Eo *eo_item EINA_UNUSED,
1840 Elm_Naviframe_Item_Data *nit,
1841 const char *item_style)
1842{
1806 if (item_style && !strcmp(item_style, nit->style)) return; 1843 if (item_style && !strcmp(item_style, nit->style)) return;
1807 1844
1808 if (!item_style) 1845 if (!item_style)
@@ -1816,10 +1853,13 @@ elm_naviframe_item_style_set(Elm_Object_Item *it,
1816EAPI const char * 1853EAPI const char *
1817elm_naviframe_item_style_get(const Elm_Object_Item *it) 1854elm_naviframe_item_style_get(const Elm_Object_Item *it)
1818{ 1855{
1819 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 1856 return eo_do((Eo *)it, elm_obj_naviframe_item_style_get());
1820 1857}
1821 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, NULL);
1822 1858
1859EOLIAN static const char *
1860_elm_naviframe_item_style_get(Eo *eo_item EINA_UNUSED,
1861 Elm_Naviframe_Item_Data *nit)
1862{
1823 return nit->style; 1863 return nit->style;
1824} 1864}
1825 1865
@@ -1841,10 +1881,15 @@ elm_naviframe_item_title_enabled_set(Elm_Object_Item *it,
1841 Eina_Bool enabled, 1881 Eina_Bool enabled,
1842 Eina_Bool transition) 1882 Eina_Bool transition)
1843{ 1883{
1844 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 1884 eo_do((Eo *)it, elm_obj_naviframe_item_title_enabled_set(enabled, transition));
1845 1885}
1846 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it);
1847 1886
1887EOLIAN static void
1888_elm_naviframe_item_title_enabled_set(Eo *eo_item EINA_UNUSED,
1889 Elm_Naviframe_Item_Data *nit,
1890 Eina_Bool enabled,
1891 Eina_Bool transition)
1892{
1848 enabled = !!enabled; 1893 enabled = !!enabled;
1849 if (nit->title_enabled == enabled) return; 1894 if (nit->title_enabled == enabled) return;
1850 1895
@@ -1857,20 +1902,27 @@ elm_naviframe_item_title_enabled_set(Elm_Object_Item *it,
1857EAPI Eina_Bool 1902EAPI Eina_Bool
1858elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it) 1903elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it)
1859{ 1904{
1860 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 1905 return eo_do((Eo *)it, elm_obj_naviframe_item_title_enabled_get());
1861 1906}
1862 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1863 1907
1908EOLIAN static Eina_Bool
1909_elm_naviframe_item_title_enabled_get(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data *nit)
1910{
1864 return nit->title_enabled; 1911 return nit->title_enabled;
1865} 1912}
1866 1913
1867EAPI void 1914EAPI void
1868elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data) 1915elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data)
1869{ 1916{
1870 Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it; 1917 eo_do((Eo *)it, elm_obj_naviframe_item_pop_cb_set(func, data));
1871 1918}
1872 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it);
1873 1919
1920EOLIAN static void
1921_elm_naviframe_item_pop_cb_set(Eo *eo_item EINA_UNUSED,
1922 Elm_Naviframe_Item_Data *nit,
1923 Elm_Naviframe_Item_Pop_Cb func,
1924 void *data)
1925{
1874 nit->pop_cb = func; 1926 nit->pop_cb = func;
1875 nit->pop_data = data; 1927 nit->pop_data = data;
1876} 1928}
@@ -1891,10 +1943,10 @@ EOLIAN static Eina_List*
1891_elm_naviframe_items_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) 1943_elm_naviframe_items_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
1892{ 1944{
1893 Eina_List *ret = NULL; 1945 Eina_List *ret = NULL;
1894 Elm_Naviframe_Item *itr; 1946 Elm_Naviframe_Item_Data *itr;
1895 1947
1896 EINA_INLIST_FOREACH(sd->stack, itr) 1948 EINA_INLIST_FOREACH(sd->stack, itr)
1897 ret = eina_list_append(ret, itr); 1949 ret = eina_list_append(ret, EO_OBJ(itr));
1898 1950
1899 return ret; 1951 return ret;
1900} 1952}
@@ -1935,4 +1987,5 @@ _elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
1935 return &atspi_actions[0]; 1987 return &atspi_actions[0];
1936} 1988}
1937 1989
1990#include "elm_naviframe_item.eo.c"
1938#include "elm_naviframe.eo.c" 1991#include "elm_naviframe.eo.c"
diff --git a/src/lib/elc_naviframe_common.h b/src/lib/elc_naviframe_common.h
index 757bdb551..b14eae0b0 100644
--- a/src/lib/elc_naviframe_common.h
+++ b/src/lib/elc_naviframe_common.h
@@ -21,102 +21,18 @@ typedef Eina_Bool (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it);
21 */ 21 */
22EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent); 22EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent);
23 23
24/**
25 * @brief Pop the items between the top and the above one on the given item.
26 *
27 * The items between the top and the given item will be deleted first,
28 * and then the top item will be popped at last.
29 *
30 * @param it The naviframe item
31 *
32 * @ingroup Naviframe
33 */
34EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it); 24EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it);
35 25
36/**
37 * Promote an item already in the naviframe stack to the top of the stack
38 *
39 * @param it The naviframe item
40 *
41 * This will take the indicated item and promote it to the top of the stack
42 * as if it had been pushed there. The item must already be inside the
43 * naviframe stack to work.
44 *
45 */
46EAPI void elm_naviframe_item_promote(Elm_Object_Item *it); 26EAPI void elm_naviframe_item_promote(Elm_Object_Item *it);
47 27
48/**
49 * @brief Set an item style
50 *
51 * @param it The naviframe item
52 * @param item_style The current item style name. @c NULL would be default
53 *
54 * The following styles are available for this item:
55 * @li @c "default"
56 *
57 * @see also elm_naviframe_item_style_get()
58 *
59 * @ingroup Naviframe
60 */
61EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style); 28EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style);
62 29
63/**
64 * @brief Get an item style
65 *
66 * @param it The naviframe item
67 * @return The current item style name
68 *
69 * @see also elm_naviframe_item_style_set()
70 *
71 * @ingroup Naviframe
72 */
73EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it); 30EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
74 31
75/**
76 * @brief Enable/Disable the title area with transition effect
77 *
78 * @param it The naviframe item
79 * @param enabled If @c EINA_TRUE, title area will be enabled, disabled
80 * otherwise
81 * @param transition If @c EINA_TRUE, transition effect of the title will be
82 * visible, invisible otherwise
83 *
84 * When the title area is disabled, then the controls would be hidden so as
85 * to expand the content area to full-size.
86 *
87 * @see also elm_naviframe_item_title_enabled_get()
88 * @see also elm_naviframe_item_title_visible_set()
89 *
90 * @ingroup Naviframe
91 */
92EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition); 32EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition);
93 33
94/**
95 * @brief Get a value whether title area is enabled or not.
96 *
97 * @param it The naviframe item
98 * @return If @c EINA_TRUE, title area is enabled
99 *
100 * @see also elm_naviframe_item_title_enabled_set()
101 *
102 * @ingroup Naviframe
103 */
104EAPI Eina_Bool elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it); 34EAPI Eina_Bool elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it);
105 35
106/**
107 * @brief Set a function to be called when @c it of the naviframe is going to be
108 * popped.
109 *
110 * @param it The item to set the callback on
111 * @param func the callback function.
112 *
113 * @warning Don't set "clicked" callback to the prev button additionally if the
114 * function does an exact same logic with this @c func. When hardware back key
115 * is pressed then both callbacks will be called.
116 *
117 * @since 1.8
118 * @ingroup Naviframe
119 */
120EAPI void elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data); 36EAPI void elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data);
121 37
122Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); 38Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
diff --git a/src/lib/elm_naviframe_item.eo b/src/lib/elm_naviframe_item.eo
new file mode 100644
index 000000000..937d4f127
--- /dev/null
+++ b/src/lib/elm_naviframe_item.eo
@@ -0,0 +1,111 @@
1class Elm_Naviframe_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_naviframe_item;
5 properties {
6 style {
7 get {
8 /*@
9 Get an item style
10
11 @see also elm_naviframe_item_style_set()
12
13 @ingroup Naviframe
14 */
15 }
16 set {
17 /*@
18 Set an item style
19
20 The following styles are available for this item:
21 @li @c "default"
22
23 @see also elm_naviframe_item_style_get()
24
25 @ingroup Naviframe
26 */
27 }
28 values {
29 const (char) *style; /*@ The current item style name. @c NULL would be default */
30 }
31 }
32 }
33 methods {
34 pop_to {
35 /*@
36 Pop the items between the top and the above one on the given item.
37
38 The items between the top and the given item will be deleted first,
39 and then the top item will be popped at last.
40
41 @ingroup Naviframe
42 */
43 }
44 title_enabled_get @const {
45 /*@
46 Get a value whether title area is enabled or not.
47
48 @see also elm_naviframe_item_title_enabled_set()
49
50 @ingroup Naviframe
51 */
52 return: bool; /*@ If @c EINA_TRUE, title area will be enabled, disabled otherwise */
53 }
54 title_enabled_set {
55 /*@
56 Enable/Disable the title area with transition effect
57
58 When the title area is disabled, then the controls would be hidden so as
59 to expand the content area to full-size.
60
61 @see also elm_naviframe_item_title_enabled_get()
62 @see also elm_naviframe_item_title_visible_set()
63
64 @ingroup Naviframe
65 */
66 params {
67 @in Eina_Bool enable; /*@ If @c EINA_TRUE, title area will be enabled, disabled otherwise */
68 @in Eina_Bool transition; /*@ If @c EINA_TRUE, transition effect of the title will be visible, invisible otherwise */
69 }
70 }
71 promote {
72 /*@
73 Promote an item already in the naviframe stack to the top of the stack
74
75 This will take the indicated item and promote it to the top of the stack
76 as if it had been pushed there. The item must already be inside the
77 naviframe stack to work.
78 */
79 }
80
81 pop_cb_set {
82 /*@
83 Set a function to be called when @c it of the naviframe is going to be
84 popped.
85
86 @param func the callback function.
87
88 @warning Don't set "clicked" callback to the prev button additionally if the
89 function does an exact same logic with this @c func. When hardware back key
90 is pressed then both callbacks will be called.
91
92 @since 1.8
93 @ingroup Naviframe
94 */
95 params {
96 @in Elm_Naviframe_Item_Pop_Cb func; /*@ The callback function */
97 @in void *data; /*@ Data to be passed to func */
98 }
99 }
100 }
101 implements {
102 Eo.Base.constructor;
103 Elm_Widget_Item.del_pre;
104 Elm_Widget_Item.signal_emit;
105 Elm_Widget_Item.part_text.set;
106 Elm_Widget_Item.part_text.get;
107 Elm_Widget_Item.part_content.get;
108 Elm_Widget_Item.part_content.set;
109 Elm_Widget_Item.part_content_unset;
110 }
111}
diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h
index 8abf384ea..f74200c04 100644
--- a/src/lib/elm_widget_naviframe.h
+++ b/src/lib/elm_widget_naviframe.h
@@ -2,6 +2,7 @@
2#define ELM_WIDGET_NAVIFRAME_H 2#define ELM_WIDGET_NAVIFRAME_H
3 3
4#include "Elementary.h" 4#include "Elementary.h"
5#include "elm_naviframe_item.eo.h"
5 6
6/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 7/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
7 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 8 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
@@ -9,6 +10,7 @@
9 * IT AT RUNTIME. 10 * IT AT RUNTIME.
10 */ 11 */
11 12
13#include "elm_object_item_migration_temp.h"
12/** 14/**
13 * @addtogroup Widget 15 * @addtogroup Widget
14 * @{ 16 * @{
@@ -37,10 +39,10 @@ struct _Elm_Naviframe_Data
37 Eina_Bool freeze_events : 1; 39 Eina_Bool freeze_events : 1;
38}; 40};
39 41
40typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item; 42typedef struct _Elm_Naviframe_Item_Data Elm_Naviframe_Item_Data;
41struct _Elm_Naviframe_Item 43struct _Elm_Naviframe_Item_Data
42{ 44{
43 ELM_WIDGET_ITEM; 45 Elm_Widget_Item_Data *base;
44 EINA_INLIST; 46 EINA_INLIST;
45 47
46 Eina_Inlist *content_list; 48 Eina_Inlist *content_list;
@@ -73,7 +75,7 @@ struct _Elm_Naviframe_Content_Item_Pair
73 EINA_INLIST; 75 EINA_INLIST;
74 const char *part; 76 const char *part;
75 Evas_Object *content; 77 Evas_Object *content;
76 Elm_Naviframe_Item *it; 78 Elm_Naviframe_Item_Data *it;
77}; 79};
78 80
79typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair; 81typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair;
@@ -113,11 +115,14 @@ struct _Elm_Naviframe_Text_Item_Pair
113 return 115 return
114 116
115#define ELM_NAVIFRAME_ITEM_CHECK(it) \ 117#define ELM_NAVIFRAME_ITEM_CHECK(it) \
116 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 118 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_NAVIFRAME_ITEM_CLASS))) \
117 ELM_NAVIFRAME_CHECK(it->base.widget); 119 return
120
121#define ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, ...) \
122 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_NAVIFRAME_ITEM_CLASS))) \
123 return __VA_ARGS__;
118 124
119#define ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, ...) \ 125#define ELM_NAVIFRAME_ITEM_DATA_GET(o, sd) \
120 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 126 Elm_Naviframe_Item_Data *sd = eo_data_scope_get((Eo *)o, ELM_NAVIFRAME_ITEM_CLASS)
121 ELM_NAVIFRAME_CHECK(it->base.widget) __VA_ARGS__;
122 127
123#endif 128#endif