elementary/naviframe - added one convenient API for users.

pop the items which are in the stack between the top and the upper one of the given item



SVN revision: 63469
This commit is contained in:
ChunEon Park 2011-09-19 05:23:35 +00:00
parent f077ab0a40
commit 4dd9ffff22
2 changed files with 24 additions and 0 deletions

View File

@ -26662,6 +26662,7 @@ extern "C" {
EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
EAPI Elm_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) EINA_ARG_NONNULL(1, 5);
EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve) EINA_ARG_NONNULL(1);
EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);

View File

@ -841,6 +841,29 @@ elm_naviframe_item_pop(Evas_Object *obj)
return content;
}
EAPI void
elm_naviframe_item_pop_to(Elm_Object_Item *it)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Elm_Naviframe_Item *navi_it = ELM_CAST(it);
Widget_Data *wd = elm_widget_data_get(navi_it->base.widget);
Eina_List *l, *prev_l;
if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
l = eina_list_last(wd->stack)->prev;
while(l)
{
if (l->data == it) break;
prev_l = l->prev;
_item_del(l->data);
wd->stack = eina_list_remove(wd->stack, l);
l = prev_l;
}
elm_naviframe_item_pop(navi_it->base.widget);
}
EAPI void
elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve)
{