1 #include <Elementary.h>
4 typedef struct _Widget_Data Widget_Data;
5 typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
6 typedef struct _Elm_Naviframe_Content_Item_Pair Elm_Naviframe_Content_Item_Pair;
7 typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair;
13 Eina_Bool preserve: 1;
14 Eina_Bool auto_pushed: 1;
15 Eina_Bool freeze_events: 1;
18 struct _Elm_Naviframe_Content_Item_Pair
25 >>>>>>> remotes/origin/upstream
26 Elm_Naviframe_Item *it;
29 struct _Elm_Naviframe_Text_Item_Pair
36 >>>>>>> remotes/origin/upstream
39 struct _Elm_Naviframe_Item
43 Eina_Inlist *content_list;
44 Eina_Inlist *text_list;
46 Evas_Object *title_prev_btn;
47 Evas_Object *title_next_btn;
48 Evas_Object *title_icon;
52 Eina_Bool back_btn: 1;
53 Eina_Bool title_visible: 1;
56 static const char *widtype = NULL;
59 static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
60 static const char SIG_PUSH_FINISHED[] = "push,finished";
61 static const char SIG_POP_FINISHED[] = "pop,finished";
62 static const char SIG_TITLE_CLICKED[] = "title,clicked";
64 static const Evas_Smart_Cb_Description _signals[] = {
65 {SIG_TRANSITION_FINISHED, ""},
66 {SIG_TITLE_CLICKED, ""},
72 static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
73 static const char SIG_TITLE_CLICKED[] = "title,clicked";
76 static const char SIG_ITEM_SHOW_BEGIN[] = "show,begin";
77 static const char SIG_ITEM_HIDE_FINISHED[] = "hide,finished";
79 static const Evas_Smart_Cb_Description _signals[] = {
80 {SIG_TRANSITION_FINISHED, ""},
81 {SIG_TITLE_CLICKED, ""},
82 {SIG_ITEM_SHOW_BEGIN, ""},
83 {SIG_ITEM_HIDE_FINISHED, ""},
87 static void _text_set_hook(Evas_Object *obj,
90 static const char *_text_get_hook(const Evas_Object *obj, const char *part);
91 static void _content_set_hook(Evas_Object *obj,
93 Evas_Object *content);
94 static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part);
95 static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *part);
96 >>>>>>> remotes/origin/upstream
97 static void _del_hook(Evas_Object *obj);
98 static void _theme_hook(Evas_Object *obj);
99 static void _emit_hook(Evas_Object *obj,
100 const char *emission,
102 static void _disable_hook(Evas_Object *obj);
104 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
106 >>>>>>> remotes/origin/upstream
107 static void _item_text_set_hook(Elm_Object_Item *it,
110 static const char *_item_text_get_hook(const Elm_Object_Item *it,
112 static void _item_content_set_hook(Elm_Object_Item *it,
114 Evas_Object *content);
115 static Evas_Object *_item_content_get_hook(const Elm_Object_Item *it,
117 static Evas_Object *_item_content_unset_hook(Elm_Object_Item *it,
119 static void _item_signal_emit_hook(Elm_Object_Item *it,
120 const char *emission,
122 static void _item_title_visible_update(Elm_Naviframe_Item *navi_it);
123 static void _sizing_eval(Evas_Object *obj);
124 static void _move(void *data, Evas *e, Evas_Object *obj, void *event_info);
125 static void _resize(void *data,
129 static void _title_clicked(void *data, Evas_Object *obj,
130 const char *emission,
132 static void _back_btn_clicked(void *data,
135 static Evas_Object *_back_btn_new(Evas_Object *obj);
136 static void _item_content_del(void *data,
140 static void _title_content_del(void *data,
144 static void _title_prev_btn_del(void *data,
148 static void _title_next_btn_del(void *data,
152 static void _title_icon_del(void *data,
156 static void _title_content_set(Elm_Naviframe_Item *it,
158 Evas_Object *content);
159 static void _title_prev_btn_set(Elm_Naviframe_Item *it,
162 static void _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn);
163 static void _title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon);
164 static Evas_Object * _item_content_unset(Elm_Naviframe_Item *it);
165 static Evas_Object * _title_prev_btn_unset(Elm_Naviframe_Item *it);
166 static Evas_Object * _title_next_btn_unset(Elm_Naviframe_Item *it);
167 static Evas_Object * _title_icon_unset(Elm_Naviframe_Item *it);
168 static Evas_Object * _title_content_unset(Elm_Naviframe_Item *it,
170 static void _item_del(Elm_Naviframe_Item *it);
171 static Eina_Bool _item_del_pre_hook(Elm_Object_Item *it);
172 static void _pushed_finished(void *data,
174 const char *emission,
176 static void _popped_finished(void *data,
178 const char *emission,
180 static void _show_finished(void *data,
182 const char *emission,
184 static void _changed_size_hints(void *data,
188 static void _item_content_set(Elm_Naviframe_Item *navi_it,
189 Evas_Object *content);
190 static void _item_style_set(Elm_Naviframe_Item *navi_it,
191 const char *item_style);
192 static Elm_Naviframe_Item * _item_new(Evas_Object *obj,
193 const char *title_label,
194 Evas_Object *prev_btn,
195 Evas_Object *next_btn,
196 Evas_Object *content,
197 const char *item_style);
200 static Eina_Bool _focus_next_hook(const Evas_Object *obj,
201 Elm_Focus_Direction dir,
203 >>>>>>> remotes/origin/upstream
206 _del_hook(Evas_Object *obj)
209 Elm_Naviframe_Item *it;
211 wd = elm_widget_data_get(obj);
216 while (wd->stack->last)
218 it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
220 wd->stack = eina_inlist_remove(wd->stack, wd->stack->last);
224 elm_widget_item_free(it);
225 >>>>>>> remotes/origin/upstream
226 if (!wd->stack) break;
233 _theme_hook(Evas_Object *obj)
236 Elm_Naviframe_Item *it;
238 wd = elm_widget_data_get(obj);
241 _elm_theme_object_set(obj,
245 elm_widget_style_get(obj));
247 EINA_INLIST_FOREACH(wd->stack, it)
249 _item_style_set(it, it->style);
250 _item_title_visible_update(it);
254 _elm_widget_mirrored_reload(obj);
255 _mirrored_set(obj, elm_widget_mirrored_get(obj));
257 >>>>>>> remotes/origin/upstream
260 static void _emit_hook(Evas_Object *obj,
261 const char *emission,
265 ELM_CHECK_WIDTYPE(obj, widtype);
267 Widget_Data *wd = elm_widget_data_get(obj);
270 edje_object_signal_emit(wd->base, emission, source);
272 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
274 return elm_object_item_signal_emit(it, emission, source);
275 >>>>>>> remotes/origin/upstream
279 _disable_hook(Evas_Object *obj __UNUSED__)
286 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
289 Elm_Naviframe_Item *it;
291 wd = elm_widget_data_get(obj);
294 EINA_INLIST_FOREACH(wd->stack, it)
295 edje_object_mirrored_set(VIEW(it), rtl);
296 edje_object_mirrored_set(wd->base, rtl);
301 >>>>>>> remotes/origin/upstream
302 _item_text_set_hook(Elm_Object_Item *it,
307 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
309 Elm_Naviframe_Text_Item_Pair *pair = NULL;
310 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
312 Elm_Naviframe_Text_Item_Pair *pair = NULL;
313 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
314 >>>>>>> remotes/origin/upstream
317 if (!part || !strcmp(part, "default"))
318 snprintf(buf, sizeof(buf), "elm.text.title");
319 else if(!strcmp("subtitle", part))
320 snprintf(buf, sizeof(buf), "elm.text.subtitle");
322 snprintf(buf, sizeof(buf), "%s", part);
324 EINA_INLIST_FOREACH(navi_it->text_list, pair)
325 if (!strcmp(buf, pair->part)) break;
329 pair = ELM_NEW(Elm_Naviframe_Text_Item_Pair);
332 ERR("Failed to allocate new text part of the item! : naviframe=%p",
336 eina_stringshare_replace(&pair->part, buf);
337 navi_it->text_list = eina_inlist_append(navi_it->text_list,
338 EINA_INLIST_GET(pair));
342 eina_stringshare_replace(&pair->text, label);
343 edje_object_part_text_set(VIEW(navi_it), buf, label);
345 elm_object_part_text_set(VIEW(navi_it), buf, label);
346 >>>>>>> remotes/origin/upstream
350 snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
352 edje_object_signal_emit(VIEW(navi_it), buf, "elm");
354 elm_object_signal_emit(VIEW(navi_it), buf, "elm");
355 >>>>>>> remotes/origin/upstream
359 snprintf(buf, sizeof(buf), "elm,state,%s,hide", buf);
361 edje_object_signal_emit(VIEW(navi_it), buf, "elm");
363 elm_object_signal_emit(VIEW(navi_it), buf, "elm");
364 >>>>>>> remotes/origin/upstream
367 _sizing_eval(WIDGET(navi_it));
371 _item_text_get_hook(const Elm_Object_Item *it, const char *part)
374 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
375 Elm_Naviframe_Text_Item_Pair *pair = NULL;
376 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
378 >>>>>>> remotes/origin/upstream
381 if (!part || !strcmp(part, "default"))
382 snprintf(buf, sizeof(buf), "elm.text.title");
383 else if(!strcmp("subtitle", part))
384 snprintf(buf, sizeof(buf), "elm.text.subtitle");
386 snprintf(buf, sizeof(buf), "%s", part);
389 EINA_INLIST_FOREACH(navi_it->text_list, pair)
391 if (!strcmp(buf, pair->part))
396 return elm_object_part_text_get(VIEW(it), buf);
397 >>>>>>> remotes/origin/upstream
401 _item_content_set_hook(Elm_Object_Item *it,
403 Evas_Object *content)
406 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
408 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
411 if ((!part) || (!strcmp(part, "elm.swallow.content")))
413 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
416 if (!part || !strcmp("default", part))
417 >>>>>>> remotes/origin/upstream
419 _item_content_set(navi_it, content);
423 else if (!strcmp(part, "elm.swallow.prev_btn"))
425 else if (!strcmp(part, "prev_btn"))
426 >>>>>>> remotes/origin/upstream
428 _title_prev_btn_set(navi_it, content, EINA_FALSE);
432 else if (!strcmp(part, "elm.swallow.next_btn"))
434 else if (!strcmp(part, "next_btn"))
435 >>>>>>> remotes/origin/upstream
437 _title_next_btn_set(navi_it, content);
440 else if (!strcmp(part, "icon"))
442 _title_icon_set(navi_it, content);
447 _title_content_set(navi_it, part, content);
451 _item_content_get_hook(const Elm_Object_Item *it, const char *part)
454 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
455 Elm_Naviframe_Content_Item_Pair *pair = NULL;
456 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
459 if ((!part) || (!strcmp(part, "elm.swallow.content")))
460 return navi_it->content;
461 else if (!strcmp(part, "elm.swallow.prev_btn"))
462 return navi_it->title_prev_btn;
463 else if (!strcmp(part, "elm.swallow.next_btn"))
465 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
468 if (!part || !strcmp("default", part))
469 return navi_it->content;
470 else if (!strcmp(part, "prev_btn"))
471 return navi_it->title_prev_btn;
472 else if (!strcmp(part, "next_btn"))
473 >>>>>>> remotes/origin/upstream
474 return navi_it->title_next_btn;
475 else if (!strcmp(part, "icon"))
476 return navi_it->title_icon;
480 EINA_INLIST_FOREACH(navi_it->content_list, pair)
482 if (!strcmp(part, pair->part))
483 return pair->content;
487 return elm_object_part_content_get(VIEW(navi_it), part);
488 >>>>>>> remotes/origin/upstream
492 _item_content_unset_hook(Elm_Object_Item *it, const char *part)
495 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
496 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
499 if (!part || !strcmp("elm.swallow.content", part))
500 return _item_content_unset(navi_it);
501 else if (!strcmp(part, "elm.swallow.prev_btn"))
502 return _title_prev_btn_unset(navi_it);
503 else if (!strcmp(part, "elm.swallow.next_btn"))
505 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
508 if (!part || !strcmp("default", part))
509 return _item_content_unset(navi_it);
510 else if (!strcmp(part, "prev_btn"))
511 return _title_prev_btn_unset(navi_it);
512 else if (!strcmp(part, "next_btn"))
513 >>>>>>> remotes/origin/upstream
514 return _title_next_btn_unset(navi_it);
515 else if (!strcmp(part, "icon"))
516 return _title_icon_unset(navi_it);
518 return _title_content_unset(navi_it, part);
522 _item_signal_emit_hook(Elm_Object_Item *it,
523 const char *emission,
527 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
528 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
529 edje_object_signal_emit(VIEW(navi_it), emission, source);
531 elm_object_signal_emit(VIEW(it), emission, source);
532 >>>>>>> remotes/origin/upstream
536 _item_title_visible_update(Elm_Naviframe_Item *navi_it)
538 if (navi_it->title_visible)
540 edje_object_signal_emit(VIEW(navi_it), "elm,state,title,show", "elm");
542 edje_object_signal_emit(VIEW(navi_it), "elm,state,title,hide", "elm");
544 elm_object_signal_emit(VIEW(navi_it), "elm,state,title,show", "elm");
546 elm_object_signal_emit(VIEW(navi_it), "elm,state,title,hide", "elm");
547 >>>>>>> remotes/origin/upstream
551 _sizing_eval(Evas_Object *obj)
554 Elm_Naviframe_Item *it;
555 Evas_Coord x, y, w, h;
556 Evas_Coord minw = -1, minh = -1;
558 wd = elm_widget_data_get(obj);
561 evas_object_geometry_get(obj, &x, &y, &w, &h);
563 EINA_INLIST_FOREACH(wd->stack, it)
565 evas_object_move(VIEW(it), x, y);
566 evas_object_resize(VIEW(it), w, h);
568 edje_object_size_min_calc(VIEW(it), &it->minw, &it->minh);
570 edje_object_size_min_calc(elm_layout_edje_get(VIEW(it)),
573 >>>>>>> remotes/origin/upstream
574 if (it->minw > minw) minw = it->minw;
575 if (it->minh > minh) minh = it->minh;
577 evas_object_size_hint_min_set(obj, minw, minh);
578 evas_object_size_hint_max_set(obj, -1, -1);
582 _move(void *data __UNUSED__,
585 void *event_info __UNUSED__)
591 _resize(void *data __UNUSED__,
594 void *event_info __UNUSED__)
600 _title_clicked(void *data,
601 Evas_Object *obj __UNUSED__,
602 const char *emission __UNUSED__,
603 const char *source __UNUSED__)
605 Elm_Naviframe_Item *it = data;
606 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, it);
610 _back_btn_clicked(void *data,
612 void *event_info __UNUSED__)
614 /* Since edje has the event queue, clicked event could be happend multiple times
615 on some heavy environment. This callback del will prevent those scenario and
616 guarantee only one clicked for it's own page. */
617 evas_object_smart_callback_del(obj, "clicked", _back_btn_clicked);
618 elm_naviframe_item_pop(data);
622 _back_btn_new(Evas_Object *obj)
626 btn = elm_button_add(obj);
627 if (!btn) return NULL;
628 evas_object_smart_callback_add(btn, "clicked", _back_btn_clicked, obj);
630 snprintf(buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
632 snprintf(buf, sizeof(buf), "naviframe/back_btn/%s",
633 elm_widget_style_get(obj));
634 >>>>>>> remotes/origin/upstream
635 elm_object_style_set(btn, buf);
641 static void _text_set_hook(Evas_Object *obj,
645 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
647 elm_object_item_part_text_set(it, part, label);
650 static const char *_text_get_hook(const Evas_Object *obj, const char *part)
652 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
653 if (!it) return NULL;
654 return elm_object_item_part_text_get(it, part);
658 _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
660 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
662 elm_object_item_part_content_set(it, part, content);
666 _content_unset_hook(Evas_Object *obj, const char *part)
668 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
669 if (!it) return NULL;
670 return elm_object_item_part_content_unset(it, part);
674 _content_get_hook(const Evas_Object *obj, const char *part)
676 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
677 if (!it) return NULL;
678 return elm_object_item_part_content_get(it, part);
681 >>>>>>> remotes/origin/upstream
683 _title_content_del(void *data,
685 Evas_Object *obj __UNUSED__,
686 void *event_info __UNUSED__)
689 Elm_Naviframe_Content_Item_Pair *pair = data;
690 Elm_Naviframe_Item *it = pair->it;
691 snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
693 edje_object_signal_emit(VIEW(it), buf, "elm");
695 elm_object_signal_emit(VIEW(it), buf, "elm");
696 >>>>>>> remotes/origin/upstream
697 it->content_list = eina_inlist_remove(it->content_list,
698 EINA_INLIST_GET(pair));
699 eina_stringshare_del(pair->part);
704 _title_prev_btn_del(void *data,
706 Evas_Object *obj __UNUSED__,
707 void *event_info __UNUSED__)
709 Elm_Naviframe_Item *it = data;
710 it->back_btn = EINA_FALSE;
711 it->title_prev_btn = NULL;
713 edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
715 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
716 >>>>>>> remotes/origin/upstream
720 _title_next_btn_del(void *data,
722 Evas_Object *obj __UNUSED__,
723 void *event_info __UNUSED__)
725 Elm_Naviframe_Item *it = data;
726 it->title_next_btn = NULL;
728 edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
730 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
731 >>>>>>> remotes/origin/upstream
735 _title_icon_del(void *data,
737 Evas_Object *obj __UNUSED__,
738 void *event_info __UNUSED__)
740 Elm_Naviframe_Item *it = data;
741 it->title_icon = NULL;
743 edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
745 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
746 >>>>>>> remotes/origin/upstream
750 _item_content_del(void *data,
752 Evas_Object *obj __UNUSED__,
753 void *event_info __UNUSED__)
755 Elm_Naviframe_Item *it = data;
758 edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
760 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
761 >>>>>>> remotes/origin/upstream
765 _title_content_set(Elm_Naviframe_Item *it,
767 Evas_Object *content)
770 Elm_Naviframe_Content_Item_Pair *pair = NULL;
773 Evas_Object *prev_content = NULL;
774 >>>>>>> remotes/origin/upstream
776 EINA_INLIST_FOREACH(it->content_list, pair)
777 if (!strcmp(part, pair->part)) break;
782 if (pair->content != content)
786 evas_object_event_callback_del(pair->content,
789 evas_object_event_callback_del(pair->content,
790 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
791 _changed_size_hints);
792 snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
793 edje_object_signal_emit(VIEW(it), buf, "elm");
795 evas_object_del(pair->content);
797 prev_content = elm_object_part_content_get(VIEW(it), part);
798 if (prev_content != content)
802 evas_object_event_callback_del(prev_content,
805 snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
806 elm_object_signal_emit(VIEW(it), buf, "elm");
808 evas_object_del(prev_content);
809 >>>>>>> remotes/origin/upstream
810 if (!content) return;
815 if (!content) return;
816 pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
819 ERR("Failed to allocate new content part of the item! : naviframe=%p", WIDGET(it));
823 eina_stringshare_replace(&pair->part, part);
824 it->content_list = eina_inlist_append(it->content_list,
825 EINA_INLIST_GET(pair));
828 if (pair->content != content)
830 elm_widget_sub_object_add(WIDGET(it), content);
832 if (prev_content != content)
834 >>>>>>> remotes/origin/upstream
835 evas_object_event_callback_add(content,
840 evas_object_event_callback_add(content,
841 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
845 edje_object_part_swallow(VIEW(it), part, content);
846 snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
847 edje_object_signal_emit(VIEW(it), buf, "elm");
848 pair->content = content;
851 elm_object_part_content_set(VIEW(it), part, content);
852 snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
853 elm_object_signal_emit(VIEW(it), buf, "elm");
854 >>>>>>> remotes/origin/upstream
856 _sizing_eval(WIDGET(it));
860 _title_prev_btn_set(Elm_Naviframe_Item *it,
864 if (it->title_prev_btn == btn) return;
867 if (it->title_prev_btn)
868 evas_object_del(it->title_prev_btn);
870 it->title_prev_btn = btn;
873 elm_widget_sub_object_add(WIDGET(it), btn);
875 if (it->title_prev_btn) evas_object_del(it->title_prev_btn);
876 it->title_prev_btn = btn;
879 >>>>>>> remotes/origin/upstream
880 evas_object_event_callback_add(btn,
885 evas_object_event_callback_add(btn,
886 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
889 edje_object_part_swallow(VIEW(it), "elm.swallow.prev_btn", btn);
890 edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
892 elm_object_part_content_set(VIEW(it), "elm.swallow.prev_btn", btn);
893 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
894 >>>>>>> remotes/origin/upstream
895 it->back_btn = back_btn;
897 _sizing_eval(WIDGET(it));
901 _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
903 if (it->title_next_btn == btn) return;
906 if (it->title_next_btn)
907 evas_object_del(it->title_next_btn);
909 it->title_next_btn = btn;
912 elm_widget_sub_object_add(WIDGET(it), btn);
914 if (it->title_next_btn) evas_object_del(it->title_next_btn);
915 it->title_next_btn = btn;
918 >>>>>>> remotes/origin/upstream
919 evas_object_event_callback_add(btn,
924 evas_object_event_callback_add(btn,
925 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
928 edje_object_part_swallow(VIEW(it), "elm.swallow.next_btn", btn);
929 edje_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
931 elm_object_part_content_set(VIEW(it), "elm.swallow.next_btn", btn);
932 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
933 >>>>>>> remotes/origin/upstream
935 _sizing_eval(WIDGET(it));
939 _title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon)
941 if (it->title_icon == icon) return;
945 evas_object_del(it->title_icon);
947 it->title_icon = icon;
950 elm_widget_sub_object_add(WIDGET(it), icon);
952 if (it->title_icon) evas_object_del(it->title_icon);
953 it->title_icon = icon;
956 >>>>>>> remotes/origin/upstream
957 evas_object_event_callback_add(icon,
962 evas_object_event_callback_add(icon,
963 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
966 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", icon);
967 edje_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
969 elm_object_part_content_set(VIEW(it), "elm.swallow.icon", icon);
970 elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
971 >>>>>>> remotes/origin/upstream
973 _sizing_eval(WIDGET(it));
977 _item_content_unset(Elm_Naviframe_Item *it)
979 Evas_Object *content = it->content;
980 if (!content) return NULL;
983 elm_widget_sub_object_del(WIDGET(it), content);
984 edje_object_part_unswallow(VIEW(it), content);
985 edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
986 evas_object_event_callback_del(content,
989 evas_object_event_callback_del(content,
990 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
991 _changed_size_hints);
993 elm_object_part_content_unset(VIEW(it), "elm.swallow.content");
994 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
995 evas_object_event_callback_del(content,
998 >>>>>>> remotes/origin/upstream
999 _sizing_eval(WIDGET(it));
1005 static Evas_Object *
1006 _title_prev_btn_unset(Elm_Naviframe_Item *it)
1008 Evas_Object *content = it->title_prev_btn;
1009 if (!content) return NULL;
1012 elm_widget_sub_object_del(WIDGET(it), content);
1013 edje_object_part_unswallow(VIEW(it), content);
1014 edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
1015 evas_object_event_callback_del(content,
1017 _title_prev_btn_del);
1018 evas_object_event_callback_del(content,
1019 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1020 _changed_size_hints);
1022 elm_object_part_content_unset(VIEW(it), "elm.swallow.prev_btn");
1023 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
1024 evas_object_event_callback_del(content,
1026 _title_prev_btn_del);
1027 >>>>>>> remotes/origin/upstream
1028 _sizing_eval(WIDGET(it));
1030 it->title_prev_btn = NULL;
1034 static Evas_Object *
1035 _title_next_btn_unset(Elm_Naviframe_Item *it)
1037 Evas_Object *content = it->title_next_btn;
1038 if (!content) return NULL;
1041 elm_widget_sub_object_del(WIDGET(it), content);
1042 edje_object_part_unswallow(VIEW(it), content);
1043 edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
1044 evas_object_event_callback_del(content,
1046 _title_next_btn_del);
1047 evas_object_event_callback_del(content,
1048 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1049 _changed_size_hints);
1051 elm_object_part_content_unset(VIEW(it), "elm.swallow.next_btn");
1052 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
1053 evas_object_event_callback_del(content,
1055 _title_next_btn_del);
1056 >>>>>>> remotes/origin/upstream
1057 _sizing_eval(WIDGET(it));
1059 it->title_next_btn = NULL;
1063 static Evas_Object *
1064 _title_icon_unset(Elm_Naviframe_Item *it)
1066 Evas_Object *content = it->title_icon;
1067 if (!content) return NULL;
1070 elm_widget_sub_object_del(WIDGET(it), content);
1071 edje_object_part_unswallow(VIEW(it), content);
1072 edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
1073 evas_object_event_callback_del(content,
1076 evas_object_event_callback_del(content,
1077 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1078 _changed_size_hints);
1080 elm_object_part_content_unset(VIEW(it), "elm.swallow.icon");
1081 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
1082 evas_object_event_callback_del(content,
1085 >>>>>>> remotes/origin/upstream
1086 _sizing_eval(WIDGET(it));
1087 it->title_icon = NULL;
1092 static Evas_Object *
1093 _title_content_unset(Elm_Naviframe_Item *it, const char *part)
1095 Elm_Naviframe_Content_Item_Pair *pair = NULL;
1097 Evas_Object *content = NULL;
1099 EINA_INLIST_FOREACH(it->content_list, pair)
1101 if (!strcmp(part, pair->part))
1104 content = pair->content;
1106 content = elm_object_part_content_get(VIEW(it), part);
1107 >>>>>>> remotes/origin/upstream
1108 eina_stringshare_del(pair->part);
1109 it->content_list = eina_inlist_remove(it->content_list,
1110 EINA_INLIST_GET(pair));
1116 if (!content) return NULL;
1119 elm_widget_sub_object_del(WIDGET(it), content);
1120 edje_object_part_unswallow(VIEW(it), content);
1121 snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
1122 edje_object_signal_emit(VIEW(it), buf, "elm");
1123 evas_object_event_callback_del(content,
1125 _title_content_del);
1126 evas_object_event_callback_del(content,
1127 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1128 _changed_size_hints);
1130 elm_object_part_content_unset(VIEW(it), part);
1131 snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
1132 elm_object_signal_emit(VIEW(it), buf, "elm");
1133 evas_object_event_callback_del(content,
1135 _title_content_del);
1136 >>>>>>> remotes/origin/upstream
1137 _sizing_eval(WIDGET(it));
1143 _item_del(Elm_Naviframe_Item *it)
1146 Elm_Naviframe_Content_Item_Pair *content_pair;
1147 Elm_Naviframe_Text_Item_Pair *text_pair;
1150 Evas_Object *content;
1151 >>>>>>> remotes/origin/upstream
1155 wd = elm_widget_data_get(WIDGET(it));
1159 if (it->title_prev_btn)
1160 evas_object_del(it->title_prev_btn);
1161 if (it->title_next_btn)
1162 evas_object_del(it->title_next_btn);
1164 evas_object_del(it->title_icon);
1165 if ((it->content) && (!wd->preserve))
1166 evas_object_del(it->content);
1168 while (it->content_list)
1170 content_pair = EINA_INLIST_CONTAINER_GET(it->content_list,
1171 Elm_Naviframe_Content_Item_Pair);
1172 evas_object_event_callback_del(content_pair->content,
1174 _title_content_del);
1175 evas_object_event_callback_del(content_pair->content,
1176 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1177 _changed_size_hints);
1178 evas_object_del(content_pair->content);
1180 while (it->content_list)
1183 EINA_INLIST_CONTAINER_GET(it->content_list,
1184 Elm_Naviframe_Content_Item_Pair);
1185 content = elm_object_part_content_get(VIEW(it), content_pair->part);
1186 evas_object_event_callback_del(content,
1188 _title_content_del);
1189 >>>>>>> remotes/origin/upstream
1190 eina_stringshare_del(content_pair->part);
1191 it->content_list = eina_inlist_remove(it->content_list,
1196 while (it->text_list)
1198 text_pair = EINA_INLIST_CONTAINER_GET(it->text_list,
1199 Elm_Naviframe_Text_Item_Pair);
1200 eina_stringshare_del(text_pair->part);
1202 eina_stringshare_del(text_pair->text);
1204 >>>>>>> remotes/origin/upstream
1205 it->text_list = eina_inlist_remove(it->text_list,
1210 eina_stringshare_del(it->style);
1214 _item_del_pre_hook(Elm_Object_Item *it)
1217 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1218 Elm_Naviframe_Item *navi_it;
1221 navi_it =(Elm_Naviframe_Item *) it;
1223 Elm_Naviframe_Item *navi_it;
1226 navi_it =(Elm_Naviframe_Item *)it;
1227 >>>>>>> remotes/origin/upstream
1228 wd = elm_widget_data_get(WIDGET(navi_it));
1229 if (!wd) return EINA_FALSE;
1231 if (it == elm_naviframe_top_item_get(WIDGET(navi_it)))
1233 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
1235 //If the item is only one, the stack will be empty
1236 if (!wd->stack) return EINA_TRUE;
1237 navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
1238 Elm_Naviframe_Item);
1239 evas_object_show(VIEW(navi_it));
1240 evas_object_raise(VIEW(navi_it));
1241 elm_object_signal_emit(VIEW(navi_it), "elm,state,visible", "elm");
1245 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
1253 _pushed_finished(void *data,
1254 Evas_Object *obj __UNUSED__,
1255 const char *emission __UNUSED__,
1256 const char *source __UNUSED__)
1259 Elm_Naviframe_Item *it = data;
1262 wd = elm_widget_data_get(WIDGET(it));
1265 evas_object_hide(VIEW(it));
1267 evas_object_smart_callback_call(WIDGET(it),
1270 if (wd->freeze_events)
1271 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1273 if (wd->freeze_events)
1274 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1276 elm_widget_item_smart_callback_call(it,
1277 SIG_ITEM_HIDE_FINISHED,
1279 >>>>>>> remotes/origin/upstream
1283 _popped_finished(void *data,
1284 Evas_Object *obj __UNUSED__,
1285 const char *emission __UNUSED__,
1286 const char *source __UNUSED__)
1288 Elm_Naviframe_Item *it = data;
1291 evas_object_smart_callback_call(WIDGET(it),
1295 >>>>>>> remotes/origin/upstream
1297 elm_widget_item_free(data);
1301 _show_finished(void *data,
1302 Evas_Object *obj __UNUSED__,
1303 const char *emission __UNUSED__,
1304 const char *source __UNUSED__)
1306 Elm_Naviframe_Item *it;
1311 wd = elm_widget_data_get(WIDGET(it));
1314 evas_object_smart_callback_call(WIDGET(it),
1315 SIG_TRANSITION_FINISHED,
1317 if (wd->freeze_events)
1318 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1322 _changed_size_hints(void *data,
1324 Evas_Object *obj __UNUSED__,
1325 void *event_info __UNUSED__)
1331 _item_content_set(Elm_Naviframe_Item *navi_it, Evas_Object *content)
1333 if (navi_it->content == content) return;
1334 if (navi_it->content) evas_object_del(navi_it->content);
1336 elm_widget_sub_object_add(WIDGET(navi_it), content);
1337 edje_object_part_swallow(VIEW(navi_it),
1338 "elm.swallow.content",
1341 edje_object_signal_emit(VIEW(navi_it),
1342 "elm,state,content,show",
1345 edje_object_signal_emit(VIEW(navi_it),
1346 "elm,state,content,hide",
1349 elm_object_part_content_set(VIEW(navi_it), "elm.swallow.content", content);
1352 elm_object_signal_emit(VIEW(navi_it), "elm,state,content,show", "elm");
1354 elm_object_signal_emit(VIEW(navi_it), "elm,state,content,hide", "elm");
1356 >>>>>>> remotes/origin/upstream
1357 evas_object_event_callback_add(content,
1362 evas_object_event_callback_add(content,
1363 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1364 _changed_size_hints,
1367 >>>>>>> remotes/origin/upstream
1368 navi_it->content = content;
1369 _sizing_eval(WIDGET(navi_it));
1372 //FIXME: need to handle if this function is called while transition
1374 _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
1376 Elm_Naviframe_Content_Item_Pair *content_pair;
1377 Elm_Naviframe_Text_Item_Pair *text_pair;
1384 strcpy(buf, "item/basic");
1385 eina_stringshare_replace(&navi_it->style, "basic");
1389 snprintf(buf, sizeof(buf), "item/%s", item_style);
1390 eina_stringshare_replace(&navi_it->style, item_style);
1393 _elm_theme_object_set(WIDGET(navi_it),
1397 elm_widget_style_get(WIDGET(navi_it)));
1399 EINA_INLIST_FOREACH(navi_it->text_list, text_pair)
1400 _item_text_set_hook((Elm_Object_Item *) navi_it,
1404 EINA_INLIST_FOREACH(navi_it->content_list, content_pair)
1405 _item_content_set_hook((Elm_Object_Item *) navi_it,
1407 content_pair->content);
1409 if (navi_it->content)
1411 edje_object_part_swallow(VIEW(navi_it),
1412 "elm.swallow.content",
1414 edje_object_signal_emit(VIEW(navi_it),
1415 "elm,state,content,show",
1420 if (navi_it->title_prev_btn)
1422 edje_object_part_swallow(VIEW(navi_it),
1423 "elm.swallow.prev_btn",
1424 navi_it->title_prev_btn);
1425 edje_object_signal_emit(VIEW(navi_it),
1426 "elm,state,prev_btn,show",
1431 if (navi_it->title_next_btn)
1433 edje_object_part_swallow(VIEW(navi_it),
1434 "elm.swallow.next_btn",
1435 navi_it->title_next_btn);
1436 edje_object_signal_emit(VIEW(navi_it),
1437 "elm,state,next_btn,show",
1441 navi_it->title_visible = EINA_TRUE;
1443 elm_layout_theme_set(VIEW(navi_it),
1446 elm_widget_style_get(WIDGET(navi_it)));
1448 EINA_INLIST_FOREACH(navi_it->text_list, text_pair)
1449 _item_text_set_hook((Elm_Object_Item *) navi_it,
1451 elm_object_part_text_get(VIEW(navi_it),
1454 EINA_INLIST_FOREACH(navi_it->content_list, content_pair)
1455 _item_content_set_hook((Elm_Object_Item *) navi_it,
1457 elm_object_part_content_get(VIEW(navi_it),
1458 content_pair->part));
1460 if (navi_it->content)
1461 elm_object_signal_emit(VIEW(navi_it), "elm,state,content,show", "elm");
1464 if (navi_it->title_prev_btn)
1465 elm_object_signal_emit(VIEW(navi_it), "elm,state,prev_btn,show", "elm");
1468 if (navi_it->title_next_btn)
1469 elm_object_signal_emit(VIEW(navi_it), "elm,state,next_btn,show", "elm");
1471 // why does this forcibly enable title? isnt that separate to style?
1472 // navi_it->title_visible = EINA_TRUE;
1473 >>>>>>> remotes/origin/upstream
1474 _sizing_eval(WIDGET(navi_it));
1476 wd = elm_widget_data_get(WIDGET(navi_it));
1479 if (wd->freeze_events)
1480 evas_object_freeze_events_set(VIEW(navi_it), EINA_FALSE);
1483 static Elm_Naviframe_Item *
1484 _item_new(Evas_Object *obj,
1485 const char *title_label,
1486 Evas_Object *prev_btn,
1487 Evas_Object *next_btn,
1488 Evas_Object *content,
1489 const char *item_style)
1491 Widget_Data *wd = elm_widget_data_get(obj);
1494 Elm_Naviframe_Item *it = elm_widget_item_new(obj, Elm_Naviframe_Item);
1497 ERR("Failed to allocate new item! : naviframe=%p", obj);
1501 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
1502 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
1503 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
1504 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
1505 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
1506 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
1507 elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
1511 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
1512 edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(obj));
1513 evas_object_smart_member_add(VIEW(it), wd->base);
1514 elm_widget_sub_object_add(obj, VIEW(it));
1515 edje_object_signal_callback_add(VIEW(it),
1516 "elm,action,show,finished",
1518 _show_finished, it);
1519 edje_object_signal_callback_add(VIEW(it),
1520 "elm,action,pushed,finished",
1522 _pushed_finished, it);
1523 edje_object_signal_callback_add(VIEW(it),
1524 "elm,action,popped,finished",
1526 _popped_finished, it);
1527 edje_object_signal_callback_add(VIEW(it),
1529 VIEW(it) = elm_layout_add(obj);
1530 evas_object_smart_member_add(VIEW(it), wd->base);
1532 evas_object_event_callback_add(VIEW(it),
1533 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1534 _changed_size_hints,
1536 elm_object_signal_callback_add(VIEW(it),
1537 "elm,action,show,finished",
1539 _show_finished, it);
1540 elm_object_signal_callback_add(VIEW(it),
1541 "elm,action,pushed,finished",
1543 _pushed_finished, it);
1544 elm_object_signal_callback_add(VIEW(it),
1545 "elm,action,popped,finished",
1547 _popped_finished, it);
1548 elm_object_signal_callback_add(VIEW(it),
1549 >>>>>>> remotes/origin/upstream
1550 "elm,action,title,clicked",
1552 _title_clicked, it);
1554 _item_style_set(it, item_style);
1556 _item_text_set_hook((Elm_Object_Item *) it, "elm.text.title", title_label);
1558 _item_text_set_hook((Elm_Object_Item *)it, "elm.text.title", title_label);
1559 >>>>>>> remotes/origin/upstream
1562 if ((!prev_btn) && wd->auto_pushed && eina_inlist_count(wd->stack))
1564 prev_btn = _back_btn_new(obj);
1565 _title_prev_btn_set(it, prev_btn, EINA_TRUE);
1568 _title_prev_btn_set(it, prev_btn, EINA_FALSE);
1570 _title_next_btn_set(it, next_btn);
1571 _item_content_set(it, content);
1572 it->title_visible = EINA_TRUE;
1579 _focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
1581 Widget_Data *wd = elm_widget_data_get(obj);
1582 if (!wd || !wd->stack) return EINA_FALSE;
1583 return elm_widget_focus_next_get(VIEW(elm_naviframe_top_item_get(obj)),
1588 >>>>>>> remotes/origin/upstream
1590 elm_naviframe_add(Evas_Object *parent)
1596 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
1597 ELM_SET_WIDTYPE(widtype, "naviframe");
1598 elm_widget_type_set(obj, "naviframe");
1599 elm_widget_sub_object_add(parent, obj);
1600 elm_widget_data_set(obj, wd);
1601 elm_widget_del_hook_set(obj, _del_hook);
1602 elm_widget_disable_hook_set(obj, _disable_hook);
1603 elm_widget_theme_hook_set(obj, _theme_hook);
1605 elm_widget_signal_emit_hook_set(obj, _emit_hook);
1608 wd->base = edje_object_add(e);
1609 edje_object_mirrored_set(wd->base, elm_widget_mirrored_get(obj));
1610 elm_widget_resize_object_set(obj, wd->base);
1611 _elm_theme_object_set(obj, wd->base, "naviframe", "base", "default");
1613 elm_widget_text_set_hook_set(obj, _text_set_hook);
1614 elm_widget_text_get_hook_set(obj, _text_get_hook);
1615 elm_widget_content_set_hook_set(obj, _content_set_hook);
1616 elm_widget_content_get_hook_set(obj, _content_get_hook);
1617 elm_widget_content_unset_hook_set(obj, _content_unset_hook);
1618 elm_widget_signal_emit_hook_set(obj, _emit_hook);
1619 elm_widget_can_focus_set(obj, EINA_FALSE);
1620 elm_widget_focus_next_hook_set(obj, _focus_next_hook);
1623 //FIXME: Is this base layout really needed?
1624 wd->base = elm_layout_add(parent);
1625 evas_object_event_callback_add(wd->base,
1626 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1627 _changed_size_hints,
1629 elm_widget_resize_object_set(obj, wd->base);
1630 elm_layout_theme_set(wd->base, "naviframe", "base", "default");
1631 >>>>>>> remotes/origin/upstream
1633 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj);
1634 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
1635 evas_object_smart_callbacks_descriptions_set(obj, _signals);
1637 wd->auto_pushed = EINA_TRUE;
1638 wd->freeze_events = EINA_TRUE;
1643 EAPI Elm_Object_Item *
1644 elm_naviframe_item_push(Evas_Object *obj,
1645 const char *title_label,
1646 Evas_Object *prev_btn,
1647 Evas_Object *next_btn,
1648 Evas_Object *content,
1649 const char *item_style)
1651 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1653 Elm_Naviframe_Item *prev_it, *it;
1655 wd = elm_widget_data_get(obj);
1656 if (!wd) return NULL;
1658 it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
1659 if (!it) return NULL;
1661 evas_object_show(VIEW(it));
1663 prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
1666 if (wd->freeze_events)
1668 evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
1669 evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
1672 edje_object_signal_emit(VIEW(prev_it),
1673 "elm,state,cur,pushed",
1675 edje_object_signal_emit(VIEW(it),
1676 "elm,state,new,pushed",
1678 edje_object_message_signal_process(VIEW(prev_it));
1679 edje_object_message_signal_process(VIEW(it));
1681 wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it));
1683 return (Elm_Object_Item *) it;
1686 EAPI Elm_Object_Item *
1687 elm_naviframe_item_insert_before(Elm_Object_Item *before,
1689 elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
1690 elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
1691 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
1692 elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
1693 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
1695 wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it));
1697 return (Elm_Object_Item *)it;
1700 EAPI Elm_Object_Item *
1701 elm_naviframe_item_insert_before(Evas_Object *obj,
1702 Elm_Object_Item *before,
1703 >>>>>>> remotes/origin/upstream
1704 const char *title_label,
1705 Evas_Object *prev_btn,
1706 Evas_Object *next_btn,
1707 Evas_Object *content,
1708 const char *item_style)
1712 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1713 >>>>>>> remotes/origin/upstream
1714 ELM_OBJ_ITEM_CHECK_OR_RETURN(before, NULL);
1715 Elm_Naviframe_Item *it;
1719 wd = elm_widget_data_get(WIDGET(before));
1721 wd = elm_widget_data_get(obj);
1722 >>>>>>> remotes/origin/upstream
1723 if (!wd) return NULL;
1725 it = _item_new(WIDGET(before), title_label, prev_btn, next_btn, content,
1727 if (!it) return NULL;
1731 eina_inlist_prepend_relative(wd->stack, EINA_INLIST_GET(it),
1732 EINA_INLIST_GET(((Elm_Naviframe_Item *) before)));
1733 _sizing_eval(WIDGET(before));
1734 return (Elm_Object_Item *) it;
1737 EAPI Elm_Object_Item *
1738 elm_naviframe_item_insert_after(Elm_Object_Item *after,
1740 eina_inlist_prepend_relative(wd->stack,
1741 EINA_INLIST_GET(it),
1742 EINA_INLIST_GET(((Elm_Naviframe_Item *) before)));
1743 _sizing_eval(WIDGET(before));
1744 return (Elm_Object_Item *)it;
1747 EAPI Elm_Object_Item *
1748 elm_naviframe_item_insert_after(Evas_Object *obj,
1749 Elm_Object_Item *after,
1750 >>>>>>> remotes/origin/upstream
1751 const char *title_label,
1752 Evas_Object *prev_btn,
1753 Evas_Object *next_btn,
1754 Evas_Object *content,
1755 const char *item_style)
1759 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1760 >>>>>>> remotes/origin/upstream
1761 ELM_OBJ_ITEM_CHECK_OR_RETURN(after, NULL);
1762 Elm_Naviframe_Item *it;
1766 wd = elm_widget_data_get(WIDGET(after));
1768 wd = elm_widget_data_get(obj);
1769 >>>>>>> remotes/origin/upstream
1770 if (!wd) return NULL;
1772 it = _item_new(WIDGET(after), title_label, prev_btn, next_btn, content,
1774 if (!it) return NULL;
1776 if (elm_naviframe_top_item_get(WIDGET(after)) == after)
1778 evas_object_hide(VIEW(after));
1779 evas_object_show(VIEW(it));
1783 eina_inlist_append_relative(wd->stack, EINA_INLIST_GET(it),
1784 EINA_INLIST_GET(((Elm_Naviframe_Item *) after)));
1785 _sizing_eval(WIDGET(after));
1786 return (Elm_Object_Item *) it;
1788 eina_inlist_append_relative(wd->stack,
1789 EINA_INLIST_GET(it),
1790 EINA_INLIST_GET(((Elm_Naviframe_Item *) after)));
1791 _sizing_eval(WIDGET(after));
1792 return (Elm_Object_Item *)it;
1793 >>>>>>> remotes/origin/upstream
1797 elm_naviframe_item_pop(Evas_Object *obj)
1799 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1800 Elm_Naviframe_Item *it, *prev_it = NULL;
1802 Evas_Object *content = NULL;
1804 wd = elm_widget_data_get(obj);
1805 if (!wd) return NULL;
1807 it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
1808 if (!it) return NULL;
1810 elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
1812 >>>>>>> remotes/origin/upstream
1814 content = it->content;
1816 if (wd->stack->last->prev)
1817 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1818 Elm_Naviframe_Item);
1819 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(it));
1822 if (wd->freeze_events)
1824 evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
1825 evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
1828 edje_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
1829 evas_object_show(VIEW(prev_it));
1830 evas_object_raise(VIEW(prev_it));
1831 edje_object_signal_emit(VIEW(prev_it),
1832 "elm,state,prev,popped",
1834 edje_object_message_signal_process(VIEW(it));
1835 edje_object_message_signal_process(VIEW(prev_it));
1837 elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
1838 evas_object_show(VIEW(prev_it));
1839 evas_object_raise(VIEW(prev_it));
1840 elm_object_signal_emit(VIEW(prev_it),
1841 "elm,state,prev,popped",
1843 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
1844 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
1845 elm_widget_item_smart_callback_call(prev_it,
1846 SIG_ITEM_SHOW_BEGIN,
1848 >>>>>>> remotes/origin/upstream
1853 elm_widget_item_free(it);
1860 elm_naviframe_item_pop_to(Elm_Object_Item *it)
1862 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1863 Elm_Naviframe_Item *navi_it;
1865 Eina_Inlist *l, *prev_l;
1868 navi_it = (Elm_Naviframe_Item *) it;
1870 navi_it = (Elm_Naviframe_Item *)it;
1871 >>>>>>> remotes/origin/upstream
1872 wd = elm_widget_data_get(WIDGET(navi_it));
1875 if (it == elm_naviframe_top_item_get(WIDGET(navi_it))) return;
1877 l = wd->stack->last->prev;
1881 if (EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item) ==
1883 ((Elm_Naviframe_Item *) it)) break;
1885 ((Elm_Naviframe_Item *)it)) break;
1886 >>>>>>> remotes/origin/upstream
1888 wd->stack = eina_inlist_remove(wd->stack, l);
1889 _item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item));
1890 elm_widget_item_free(EINA_INLIST_CONTAINER_GET(l,
1891 Elm_Naviframe_Item));
1894 elm_naviframe_item_pop(WIDGET(navi_it));
1898 elm_naviframe_item_promote(Elm_Object_Item *it)
1900 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1901 Elm_Naviframe_Item *navi_it;
1902 Elm_Naviframe_Item *prev_it;
1906 navi_it = (Elm_Naviframe_Item *) it;
1908 navi_it = (Elm_Naviframe_Item *)it;
1909 >>>>>>> remotes/origin/upstream
1910 wd = elm_widget_data_get(navi_it->base.widget);
1913 if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
1915 wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
1916 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1917 Elm_Naviframe_Item);
1919 elm_widget_tree_unfocusable_set(navi_it->content, EINA_FALSE);
1920 wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
1921 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1922 Elm_Naviframe_Item);
1923 elm_widget_tree_unfocusable_set(prev_it->content, EINA_FALSE);
1924 >>>>>>> remotes/origin/upstream
1925 if (wd->freeze_events)
1927 evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
1928 evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
1931 edje_object_signal_emit(VIEW(prev_it),
1932 "elm,state,cur,pushed",
1934 evas_object_show(VIEW(navi_it));
1935 evas_object_raise(VIEW(navi_it));
1936 edje_object_signal_emit(VIEW(navi_it),
1937 "elm,state,new,pushed",
1939 edje_object_message_signal_process(VIEW(prev_it));
1940 edje_object_message_signal_process(VIEW(navi_it));
1944 elm_object_signal_emit(VIEW(prev_it),
1945 "elm,state,cur,pushed",
1947 evas_object_show(VIEW(navi_it));
1948 evas_object_raise(VIEW(navi_it));
1949 elm_object_signal_emit(VIEW(navi_it),
1950 "elm,state,new,pushed",
1952 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
1953 edje_object_message_signal_process(elm_layout_edje_get(VIEW(navi_it)));
1957 elm_naviframe_item_simple_promote(Evas_Object *obj, Evas_Object *content)
1959 ELM_CHECK_WIDTYPE(obj, widtype);
1960 Widget_Data *wd = elm_widget_data_get(obj);
1962 Elm_Naviframe_Item *itr;
1963 EINA_INLIST_FOREACH(wd->stack, itr)
1965 if (elm_object_item_content_get((Elm_Object_Item *)itr) == content)
1967 elm_naviframe_item_promote((Elm_Object_Item *)itr);
1974 >>>>>>> remotes/origin/upstream
1976 elm_naviframe_item_del(Elm_Object_Item *it)
1978 elm_object_item_del(it);
1982 elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve)
1984 ELM_CHECK_WIDTYPE(obj, widtype);
1985 Widget_Data *wd = elm_widget_data_get(obj);
1987 wd->preserve = !!preserve;
1991 elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj)
1993 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1994 Widget_Data *wd = elm_widget_data_get(obj);
1995 if (!wd) return EINA_FALSE;
1996 return wd->preserve;
1999 EAPI Elm_Object_Item*
2000 elm_naviframe_top_item_get(const Evas_Object *obj)
2002 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2003 Widget_Data *wd = elm_widget_data_get(obj);
2004 if ((!wd) || (!wd->stack)) return NULL;
2005 return (Elm_Object_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack->last,
2006 Elm_Naviframe_Item));
2009 EAPI Elm_Object_Item*
2010 elm_naviframe_bottom_item_get(const Evas_Object *obj)
2012 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2013 Widget_Data *wd = elm_widget_data_get(obj);
2014 if ((!wd) || (!wd->stack)) return NULL;
2015 return (Elm_Object_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack,
2016 Elm_Naviframe_Item));
2020 elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style)
2022 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
2024 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
2026 //Return if new style is exsiting one.
2028 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
2030 >>>>>>> remotes/origin/upstream
2032 if (!strcmp(item_style, navi_it->style)) return;
2035 if (!strcmp("basic", navi_it->style)) return;
2037 _item_style_set(navi_it, item_style);
2041 elm_naviframe_item_style_get(const Elm_Object_Item *it)
2043 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
2045 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
2047 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
2048 >>>>>>> remotes/origin/upstream
2049 return navi_it->style;
2053 elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible)
2055 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
2057 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
2059 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
2060 >>>>>>> remotes/origin/upstream
2062 visible = !!visible;
2063 if (navi_it->title_visible == visible) return;
2065 navi_it->title_visible = visible;
2066 _item_title_visible_update(navi_it);
2070 elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
2072 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
2074 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
2076 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *)it;
2077 >>>>>>> remotes/origin/upstream
2078 return navi_it->title_visible;
2082 elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed)
2084 ELM_CHECK_WIDTYPE(obj, widtype);
2085 Widget_Data *wd = elm_widget_data_get(obj);
2087 wd->auto_pushed = !!auto_pushed;
2091 elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj)
2093 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2094 Widget_Data *wd = elm_widget_data_get(obj);
2095 if (!wd) return EINA_FALSE;
2096 return wd->auto_pushed;
2103 >>>>>>> remotes/origin/upstream
2104 elm_naviframe_items_get(const Evas_Object *obj)
2106 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2107 Widget_Data *wd = elm_widget_data_get(obj);
2108 if (!wd) return NULL;
2112 Eina_List *ret = NULL;
2113 Elm_Naviframe_Item *itr;
2114 EINA_INLIST_FOREACH(wd->stack, itr)
2115 ret = eina_list_append(ret, itr);
2117 >>>>>>> remotes/origin/upstream
2121 elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled)
2123 ELM_CHECK_WIDTYPE(obj, widtype);
2124 Widget_Data *wd = elm_widget_data_get(obj);
2126 enabled = !!enabled;
2127 if (wd->freeze_events == !enabled) return;
2128 wd->freeze_events = !enabled;
2132 elm_naviframe_event_enabled_get(const Evas_Object *obj)
2134 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2135 Widget_Data *wd = elm_widget_data_get(obj);
2136 if (!wd) return EINA_FALSE;
2137 return !wd->freeze_events;