summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2011-10-24 06:35:48 +0000
committerChunEon Park <hermet@hermet.pe.kr>2011-10-24 06:35:48 +0000
commit4cad4f12a866137abc6460637c102a93b2c63a61 (patch)
treec1463393094844a1491e3e20790825205cec9a32 /legacy
parentf7aaa3aeff4749c1919d7a7e474f605a25f5477e (diff)
elementary/naviframe - new API elm_naviframe_item_promote
SVN revision: 64353
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in11
-rw-r--r--legacy/elementary/src/lib/elc_naviframe.c43
2 files changed, 50 insertions, 4 deletions
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 845508042a..9a3ee7c64e 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -28149,6 +28149,17 @@ extern "C" {
28149 */ 28149 */
28150 EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it) EINA_ARG_NONNULL(1); 28150 EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
28151 /** 28151 /**
28152 * Promote an item already in the naviframe stack to the top of the stack
28153 *
28154 * @param it The naviframe item
28155 *
28156 * This will take the indicated item and promote it to the top of the stack
28157 * as if it had been pushed there. The item must already be inside the
28158 * naviframe stack to work.
28159 *
28160 */
28161 EAPI void elm_naviframe_item_promote(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
28162 /**
28152 * @brief Delete the given item instantly. 28163 * @brief Delete the given item instantly.
28153 * 28164 *
28154 * @param it The naviframe item 28165 * @param it The naviframe item
diff --git a/legacy/elementary/src/lib/elc_naviframe.c b/legacy/elementary/src/lib/elc_naviframe.c
index 11814b82eb..8c2bfa5b8e 100644
--- a/legacy/elementary/src/lib/elc_naviframe.c
+++ b/legacy/elementary/src/lib/elc_naviframe.c
@@ -148,7 +148,10 @@ _del_hook(Evas_Object *obj)
148 if (!wd) return; 148 if (!wd) return;
149 149
150 EINA_INLIST_REVERSE_FOREACH(wd->stack, it) 150 EINA_INLIST_REVERSE_FOREACH(wd->stack, it)
151 _item_del(it); 151 {
152 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(it));
153 _item_del(it);
154 }
152 free(wd); 155 free(wd);
153} 156}
154 157
@@ -716,8 +719,6 @@ _item_del(Elm_Naviframe_Item *it)
716 719
717 eina_stringshare_del(it->style); 720 eina_stringshare_del(it->style);
718 721
719 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(it));
720
721 elm_widget_item_del(it); 722 elm_widget_item_del(it);
722} 723}
723 724
@@ -1026,6 +1027,7 @@ elm_naviframe_item_pop(Evas_Object *obj)
1026 if (wd->stack->last->prev) 1027 if (wd->stack->last->prev)
1027 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev, 1028 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1028 Elm_Naviframe_Item); 1029 Elm_Naviframe_Item);
1030 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(it));
1029 if (prev_it) 1031 if (prev_it)
1030 { 1032 {
1031 if (wd->freeze_events) 1033 if (wd->freeze_events)
@@ -1060,6 +1062,7 @@ elm_naviframe_item_pop_to(Elm_Object_Item *it)
1060 if (EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item) == 1062 if (EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item) ==
1061 ((Elm_Naviframe_Item *) it)) break; 1063 ((Elm_Naviframe_Item *) it)) break;
1062 prev_l = l->prev; 1064 prev_l = l->prev;
1065 wd->stack = eina_inlist_remove(wd->stack, l);
1063 _item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item)); 1066 _item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item));
1064 l = prev_l; 1067 l = prev_l;
1065 } 1068 }
@@ -1067,6 +1070,34 @@ elm_naviframe_item_pop_to(Elm_Object_Item *it)
1067} 1070}
1068 1071
1069EAPI void 1072EAPI void
1073elm_naviframe_item_promote(Elm_Object_Item *it)
1074{
1075 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1076 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
1077 Elm_Naviframe_Item *prev_it = NULL;
1078 Widget_Data *wd = elm_widget_data_get(navi_it->base.widget);
1079 if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
1080 wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
1081 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1082 Elm_Naviframe_Item);
1083 if (wd->freeze_events)
1084 {
1085 evas_object_show(wd->rect);
1086 //FIXME:
1087 evas_object_pass_events_set(wd->base, EINA_TRUE);
1088 }
1089 edje_object_signal_emit(prev_it->base.view,
1090 "elm,state,cur,pushed",
1091 "elm");
1092 evas_object_show(navi_it->base.view);
1093 evas_object_raise(navi_it->base.view);
1094 edje_object_signal_emit(navi_it->base.view,
1095 "elm,state,new,pushed",
1096 "elm");
1097
1098}
1099
1100EAPI void
1070elm_naviframe_item_del(Elm_Object_Item *it) 1101elm_naviframe_item_del(Elm_Object_Item *it)
1071{ 1102{
1072 ELM_OBJ_ITEM_CHECK_OR_RETURN(it); 1103 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
@@ -1074,6 +1105,7 @@ elm_naviframe_item_del(Elm_Object_Item *it)
1074 Widget_Data *wd = elm_widget_data_get(WIDGET(navi_it)); 1105 Widget_Data *wd = elm_widget_data_get(WIDGET(navi_it));
1075 if (it == elm_naviframe_top_item_get(WIDGET(navi_it))) 1106 if (it == elm_naviframe_top_item_get(WIDGET(navi_it)))
1076 { 1107 {
1108 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
1077 _item_del(navi_it); 1109 _item_del(navi_it);
1078 navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last, 1110 navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
1079 Elm_Naviframe_Item); 1111 Elm_Naviframe_Item);
@@ -1082,7 +1114,10 @@ elm_naviframe_item_del(Elm_Object_Item *it)
1082 edje_object_signal_emit(VIEW(navi_it), "elm,state,visible", "elm"); 1114 edje_object_signal_emit(VIEW(navi_it), "elm,state,visible", "elm");
1083 } 1115 }
1084 else 1116 else
1085 _item_del(navi_it); 1117 {
1118 wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
1119 _item_del(navi_it);
1120 }
1086} 1121}
1087 1122
1088EAPI void 1123EAPI void