2011-07-12 21:21:50 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
|
|
|
typedef struct _Widget_Data Widget_Data;
|
2011-08-04 01:17:30 -07:00
|
|
|
typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
|
2011-09-13 23:23:08 -07:00
|
|
|
typedef struct _Elm_Naviframe_Content_Item_Pair Elm_Naviframe_Content_Item_Pair;
|
|
|
|
typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
struct _Widget_Data
|
|
|
|
{
|
2011-10-12 23:30:05 -07:00
|
|
|
Eina_Inlist *stack;
|
2011-07-12 21:21:50 -07:00
|
|
|
Evas_Object *base;
|
|
|
|
Eina_Bool preserve: 1;
|
2011-10-12 03:31:13 -07:00
|
|
|
Eina_Bool auto_pushed: 1;
|
2011-10-12 05:19:31 -07:00
|
|
|
Eina_Bool freeze_events: 1;
|
2012-02-15 08:27:34 -08:00
|
|
|
Eina_Stringshare *item_style;
|
2011-07-12 21:21:50 -07:00
|
|
|
};
|
|
|
|
|
2011-09-13 23:23:08 -07:00
|
|
|
struct _Elm_Naviframe_Content_Item_Pair
|
|
|
|
{
|
2011-10-14 03:20:07 -07:00
|
|
|
EINA_INLIST;
|
2011-09-13 23:23:08 -07:00
|
|
|
const char *part;
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Elm_Naviframe_Text_Item_Pair
|
|
|
|
{
|
2011-10-14 03:20:07 -07:00
|
|
|
EINA_INLIST;
|
2011-09-13 23:23:08 -07:00
|
|
|
const char *part;
|
|
|
|
};
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
struct _Elm_Naviframe_Item
|
|
|
|
{
|
2011-10-20 17:45:19 -07:00
|
|
|
ELM_WIDGET_ITEM;
|
2011-10-12 23:30:05 -07:00
|
|
|
EINA_INLIST;
|
2011-10-14 03:20:07 -07:00
|
|
|
Eina_Inlist *content_list;
|
|
|
|
Eina_Inlist *text_list;
|
2011-07-12 21:21:50 -07:00
|
|
|
Evas_Object *content;
|
|
|
|
Evas_Object *title_prev_btn;
|
|
|
|
Evas_Object *title_next_btn;
|
2011-11-28 00:28:34 -08:00
|
|
|
Evas_Object *title_icon;
|
2011-07-12 21:21:50 -07:00
|
|
|
const char *style;
|
2011-11-19 22:31:54 -08:00
|
|
|
Evas_Coord minw;
|
|
|
|
Evas_Coord minh;
|
2011-07-12 21:21:50 -07:00
|
|
|
Eina_Bool back_btn: 1;
|
|
|
|
Eina_Bool title_visible: 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *widtype = NULL;
|
|
|
|
|
|
|
|
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
|
2011-10-18 09:12:14 -07:00
|
|
|
static const char SIG_PUSH_FINISHED[] = "push,finished";
|
|
|
|
static const char SIG_POP_FINISHED[] = "pop,finished";
|
2011-07-12 21:21:50 -07:00
|
|
|
static const char SIG_TITLE_CLICKED[] = "title,clicked";
|
|
|
|
|
|
|
|
static const Evas_Smart_Cb_Description _signals[] = {
|
|
|
|
{SIG_TRANSITION_FINISHED, ""},
|
|
|
|
{SIG_TITLE_CLICKED, ""},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static void _del_hook(Evas_Object *obj);
|
|
|
|
static void _theme_hook(Evas_Object *obj);
|
2011-09-15 18:05:15 -07:00
|
|
|
static void _emit_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _disable_hook(Evas_Object *obj);
|
2011-09-15 18:09:48 -07:00
|
|
|
static void _item_text_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
const char *label);
|
|
|
|
static const char *_item_text_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part);
|
|
|
|
static void _item_content_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content);
|
|
|
|
static Evas_Object *_item_content_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part);
|
|
|
|
static Evas_Object *_item_content_unset_hook(Elm_Object_Item *it,
|
|
|
|
const char *part);
|
2011-09-15 19:20:02 -07:00
|
|
|
static void _item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2011-10-14 22:16:53 -07:00
|
|
|
static void _item_title_visible_update(Elm_Naviframe_Item *navi_it);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _sizing_eval(Evas_Object *obj);
|
|
|
|
static void _move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _resize(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _title_clicked(void *data, Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
|
|
|
static void _back_btn_clicked(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static Evas_Object *_back_btn_new(Evas_Object *obj);
|
2011-09-13 23:23:08 -07:00
|
|
|
static void _item_content_del(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _title_content_del(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _title_prev_btn_del(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _title_next_btn_del(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2011-11-16 04:51:53 -08:00
|
|
|
static void _title_icon_del(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2011-09-13 23:23:08 -07:00
|
|
|
static void _title_content_set(Elm_Naviframe_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _title_prev_btn_set(Elm_Naviframe_Item *it,
|
|
|
|
Evas_Object *btn,
|
|
|
|
Eina_Bool back_btn);
|
|
|
|
static void _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn);
|
2011-11-16 04:51:53 -08:00
|
|
|
static void _title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon);
|
2011-11-28 00:28:34 -08:00
|
|
|
static Evas_Object * _item_content_unset(Elm_Naviframe_Item *it);
|
|
|
|
static Evas_Object * _title_prev_btn_unset(Elm_Naviframe_Item *it);
|
|
|
|
static Evas_Object * _title_next_btn_unset(Elm_Naviframe_Item *it);
|
|
|
|
static Evas_Object * _title_icon_unset(Elm_Naviframe_Item *it);
|
|
|
|
static Evas_Object * _title_content_unset(Elm_Naviframe_Item *it,
|
|
|
|
const char *part);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _item_del(Elm_Naviframe_Item *it);
|
2012-01-27 03:56:14 -08:00
|
|
|
static Eina_Bool _item_del_pre_hook(Elm_Object_Item *it);
|
2011-07-12 21:21:50 -07:00
|
|
|
static void _pushed_finished(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
|
|
|
static void _popped_finished(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
|
|
|
static void _show_finished(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2011-11-21 08:14:52 -08:00
|
|
|
static void _changed_size_hints(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2011-08-04 09:37:36 -07:00
|
|
|
static void _item_content_set(Elm_Naviframe_Item *navi_it,
|
|
|
|
Evas_Object *content);
|
2011-10-19 01:49:24 -07:00
|
|
|
static void _item_style_set(Elm_Naviframe_Item *navi_it,
|
|
|
|
const char *item_style);
|
2011-11-03 00:15:18 -07:00
|
|
|
static Elm_Naviframe_Item * _item_new(Evas_Object *obj,
|
|
|
|
const char *title_label,
|
|
|
|
Evas_Object *prev_btn,
|
|
|
|
Evas_Object *next_btn,
|
|
|
|
Evas_Object *content,
|
|
|
|
const char *item_style);
|
2012-01-11 03:52:54 -08:00
|
|
|
static Eina_Bool _focus_next_hook(const Evas_Object *obj,
|
|
|
|
Elm_Focus_Direction dir,
|
2012-01-11 03:53:20 -08:00
|
|
|
Evas_Object **next);
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_del_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd;
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
|
|
|
|
wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-24 22:05:56 -07:00
|
|
|
if (wd->stack)
|
2011-10-23 23:35:48 -07:00
|
|
|
{
|
2011-10-24 22:05:56 -07:00
|
|
|
while (wd->stack->last)
|
|
|
|
{
|
|
|
|
it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
|
|
|
|
Elm_Naviframe_Item);
|
|
|
|
wd->stack = eina_inlist_remove(wd->stack, wd->stack->last);
|
|
|
|
_item_del(it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_free(it);
|
2011-10-24 22:05:56 -07:00
|
|
|
if (!wd->stack) break;
|
|
|
|
}
|
2011-10-23 23:35:48 -07:00
|
|
|
}
|
2012-02-15 08:27:34 -08:00
|
|
|
eina_stringshare_del(wd->item_style);
|
2011-07-12 21:21:50 -07:00
|
|
|
free(wd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-07 21:23:37 -07:00
|
|
|
_theme_hook(Evas_Object *obj)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-10-14 22:16:53 -07:00
|
|
|
Widget_Data *wd;
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
|
|
|
|
wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
|
|
|
_elm_theme_object_set(obj,
|
|
|
|
wd->base,
|
|
|
|
"naviframe",
|
|
|
|
"base",
|
|
|
|
elm_widget_style_get(obj));
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(wd->stack, it)
|
|
|
|
{
|
2011-10-19 01:49:24 -07:00
|
|
|
_item_style_set(it, it->style);
|
2011-10-14 22:16:53 -07:00
|
|
|
_item_title_visible_update(it);
|
|
|
|
}
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-09-15 18:05:15 -07:00
|
|
|
static void _emit_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(wd->base, emission, source);
|
2011-09-15 18:05:15 -07:00
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
static void
|
|
|
|
_disable_hook(Evas_Object *obj __UNUSED__)
|
|
|
|
{
|
2011-07-25 01:48:47 -07:00
|
|
|
//FIXME:
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-08-04 09:37:36 -07:00
|
|
|
static void
|
2011-09-15 18:09:48 -07:00
|
|
|
_item_text_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
const char *label)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-09-13 23:23:08 -07:00
|
|
|
|
|
|
|
Elm_Naviframe_Text_Item_Pair *pair = NULL;
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-09-13 23:23:08 -07:00
|
|
|
char buf[1024];
|
2011-08-04 09:37:36 -07:00
|
|
|
|
2011-11-16 04:51:53 -08:00
|
|
|
if (!part || !strcmp(part, "default"))
|
2011-09-14 05:37:17 -07:00
|
|
|
snprintf(buf, sizeof(buf), "elm.text.title");
|
2011-11-16 04:51:53 -08:00
|
|
|
else if(!strcmp("subtitle", part))
|
|
|
|
snprintf(buf, sizeof(buf), "elm.text.subtitle");
|
2011-09-14 05:37:17 -07:00
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "%s", part);
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-10-14 03:20:07 -07:00
|
|
|
EINA_INLIST_FOREACH(navi_it->text_list, pair)
|
2011-10-03 23:49:16 -07:00
|
|
|
if (!strcmp(buf, pair->part)) break;
|
2011-09-13 23:23:08 -07:00
|
|
|
|
|
|
|
if (!pair)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
2011-09-13 23:23:08 -07:00
|
|
|
pair = ELM_NEW(Elm_Naviframe_Text_Item_Pair);
|
|
|
|
if (!pair)
|
|
|
|
{
|
2011-10-03 23:47:32 -07:00
|
|
|
ERR("Failed to allocate new text part of the item! : naviframe=%p",
|
2011-10-20 18:08:01 -07:00
|
|
|
WIDGET(navi_it));
|
2011-09-13 23:23:08 -07:00
|
|
|
return;
|
|
|
|
}
|
2011-09-14 05:37:17 -07:00
|
|
|
eina_stringshare_replace(&pair->part, buf);
|
2011-10-14 03:20:07 -07:00
|
|
|
navi_it->text_list = eina_inlist_append(navi_it->text_list,
|
|
|
|
EINA_INLIST_GET(pair));
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_text_set(VIEW(navi_it), buf, label);
|
2011-09-13 23:23:08 -07:00
|
|
|
|
|
|
|
if (label)
|
2011-10-03 23:43:37 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), buf, "elm");
|
2011-10-03 23:43:37 -07:00
|
|
|
}
|
2011-09-13 23:23:08 -07:00
|
|
|
else
|
2011-10-03 23:43:37 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", buf);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), buf, "elm");
|
2011-10-03 23:43:37 -07:00
|
|
|
}
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(navi_it));
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2011-09-15 18:09:48 -07:00
|
|
|
_item_text_get_hook(const Elm_Object_Item *it, const char *part)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
2011-09-14 05:37:17 -07:00
|
|
|
char buf[1024];
|
2011-08-04 09:37:36 -07:00
|
|
|
|
2011-11-16 04:51:53 -08:00
|
|
|
if (!part || !strcmp(part, "default"))
|
2011-09-14 05:37:17 -07:00
|
|
|
snprintf(buf, sizeof(buf), "elm.text.title");
|
2011-11-16 04:51:53 -08:00
|
|
|
else if(!strcmp("subtitle", part))
|
|
|
|
snprintf(buf, sizeof(buf), "elm.text.subtitle");
|
2011-09-14 05:37:17 -07:00
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "%s", part);
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
return elm_object_part_text_get(VIEW(it), buf);
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-09-15 18:09:48 -07:00
|
|
|
_item_content_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-08-04 09:37:36 -07:00
|
|
|
|
2011-09-13 23:49:23 -07:00
|
|
|
//specified parts
|
2011-11-16 04:51:53 -08:00
|
|
|
if (!part || !strcmp("default", part))
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
2011-09-19 17:31:44 -07:00
|
|
|
_item_content_set(navi_it, content);
|
|
|
|
return;
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "prev_btn"))
|
2011-08-04 09:52:39 -07:00
|
|
|
{
|
2011-09-19 17:31:44 -07:00
|
|
|
_title_prev_btn_set(navi_it, content, EINA_FALSE);
|
|
|
|
return;
|
2011-08-04 09:52:39 -07:00
|
|
|
}
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "next_btn"))
|
2011-08-04 09:52:39 -07:00
|
|
|
{
|
2011-09-19 17:31:44 -07:00
|
|
|
_title_next_btn_set(navi_it, content);
|
|
|
|
return;
|
2011-08-04 09:52:39 -07:00
|
|
|
}
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "icon"))
|
|
|
|
{
|
|
|
|
_title_icon_set(navi_it, content);
|
|
|
|
return;
|
|
|
|
}
|
2011-08-04 09:52:39 -07:00
|
|
|
|
2011-09-13 23:49:23 -07:00
|
|
|
//common part
|
2011-12-01 03:41:47 -08:00
|
|
|
_title_content_set(navi_it, part, content);
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2011-09-15 18:09:48 -07:00
|
|
|
_item_content_get_hook(const Elm_Object_Item *it, const char *part)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-08-04 09:37:36 -07:00
|
|
|
|
2011-09-14 04:21:01 -07:00
|
|
|
//specified parts
|
2011-11-16 04:51:53 -08:00
|
|
|
if (!part || !strcmp("default", part))
|
2011-09-13 23:49:23 -07:00
|
|
|
return navi_it->content;
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "prev_btn"))
|
2011-09-13 23:49:23 -07:00
|
|
|
return navi_it->title_prev_btn;
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "next_btn"))
|
2011-09-13 23:49:23 -07:00
|
|
|
return navi_it->title_next_btn;
|
2011-11-16 04:51:53 -08:00
|
|
|
else if (!strcmp(part, "icon"))
|
2011-11-28 00:28:34 -08:00
|
|
|
return navi_it->title_icon;
|
2011-09-13 23:49:23 -07:00
|
|
|
|
|
|
|
//common parts
|
2012-01-11 03:25:04 -08:00
|
|
|
return elm_object_part_content_get(VIEW(navi_it), part);
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2011-09-15 18:09:48 -07:00
|
|
|
_item_content_unset_hook(Elm_Object_Item *it, const char *part)
|
2011-08-04 09:37:36 -07:00
|
|
|
{
|
2011-09-13 23:49:23 -07:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-09-13 23:49:23 -07:00
|
|
|
|
2011-09-15 18:09:48 -07:00
|
|
|
//specified parts
|
2011-11-28 00:28:34 -08:00
|
|
|
if (!part || !strcmp("default", part))
|
|
|
|
return _item_content_unset(navi_it);
|
|
|
|
else if (!strcmp(part, "prev_btn"))
|
|
|
|
return _title_prev_btn_unset(navi_it);
|
|
|
|
else if (!strcmp(part, "next_btn"))
|
|
|
|
return _title_next_btn_unset(navi_it);
|
|
|
|
else if (!strcmp(part, "icon"))
|
|
|
|
return _title_icon_unset(navi_it);
|
2011-09-13 23:49:23 -07:00
|
|
|
|
2011-11-28 00:28:34 -08:00
|
|
|
return _title_content_unset(navi_it, part);
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
2011-09-15 19:20:02 -07:00
|
|
|
static void
|
|
|
|
_item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), emission, source);
|
2011-09-15 19:20:02 -07:00
|
|
|
}
|
|
|
|
|
2011-10-14 22:16:53 -07:00
|
|
|
static void
|
|
|
|
_item_title_visible_update(Elm_Naviframe_Item *navi_it)
|
|
|
|
{
|
|
|
|
if (navi_it->title_visible)
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,title,show", "elm");
|
2011-10-14 22:16:53 -07:00
|
|
|
else
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,title,hide", "elm");
|
2011-10-14 22:16:53 -07:00
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
static void
|
|
|
|
_sizing_eval(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd;
|
2011-07-12 21:42:45 -07:00
|
|
|
Elm_Naviframe_Item *it;
|
2011-11-21 08:14:52 -08:00
|
|
|
Evas_Coord x, y, w, h;
|
2011-11-19 22:31:54 -08:00
|
|
|
Evas_Coord minw = -1, minh = -1;
|
2011-11-21 08:14:52 -08:00
|
|
|
|
|
|
|
wd = elm_widget_data_get(obj);
|
2011-07-12 21:21:50 -07:00
|
|
|
if (!wd) return;
|
|
|
|
|
2012-01-10 22:42:15 -08:00
|
|
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
|
|
|
|
2011-10-12 23:30:05 -07:00
|
|
|
EINA_INLIST_FOREACH(wd->stack, it)
|
2011-11-19 22:31:54 -08:00
|
|
|
{
|
2011-11-21 08:14:52 -08:00
|
|
|
evas_object_move(VIEW(it), x, y);
|
|
|
|
evas_object_resize(VIEW(it), w, h);
|
2012-01-11 03:25:04 -08:00
|
|
|
edje_object_size_min_calc(elm_layout_edje_get(VIEW(it)),
|
|
|
|
&it->minw,
|
|
|
|
&it->minh);
|
2011-11-19 22:31:54 -08:00
|
|
|
if (it->minw > minw) minw = it->minw;
|
|
|
|
if (it->minh > minh) minh = it->minh;
|
|
|
|
}
|
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
|
|
|
evas_object_size_hint_max_set(obj, -1, -1);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_move(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_resize(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_title_clicked(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it = data;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, it);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_back_btn_clicked(void *data,
|
2011-10-26 23:01:50 -07:00
|
|
|
Evas_Object *obj,
|
2011-07-12 21:21:50 -07:00
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
2011-10-26 23:01:50 -07:00
|
|
|
/* Since edje has the event queue, clicked event could be happend multiple times
|
|
|
|
on some heavy environment. This callback del will prevent those scenario and
|
|
|
|
guarantee only one clicked for it's own page. */
|
|
|
|
evas_object_smart_callback_del(obj, "clicked", _back_btn_clicked);
|
2011-07-12 21:21:50 -07:00
|
|
|
elm_naviframe_item_pop(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_back_btn_new(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *btn;
|
2011-09-13 23:50:10 -07:00
|
|
|
char buf[1024];
|
2011-07-12 21:21:50 -07:00
|
|
|
btn = elm_button_add(obj);
|
|
|
|
if (!btn) return NULL;
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _back_btn_clicked, obj);
|
|
|
|
snprintf(buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
|
|
|
|
elm_object_style_set(btn, buf);
|
|
|
|
return btn;
|
|
|
|
}
|
|
|
|
|
2011-09-13 23:23:08 -07:00
|
|
|
static void
|
|
|
|
_title_content_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
char buf[1024];
|
|
|
|
Elm_Naviframe_Content_Item_Pair *pair = data;
|
|
|
|
Elm_Naviframe_Item *it = pair->it;
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), buf, "elm");
|
2011-10-14 03:20:07 -07:00
|
|
|
it->content_list = eina_inlist_remove(it->content_list,
|
|
|
|
EINA_INLIST_GET(pair));
|
2011-09-13 23:23:08 -07:00
|
|
|
eina_stringshare_del(pair->part);
|
|
|
|
free(pair);
|
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
static void
|
|
|
|
_title_prev_btn_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it = data;
|
|
|
|
it->back_btn = EINA_FALSE;
|
|
|
|
it->title_prev_btn = NULL;
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_title_next_btn_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it = data;
|
|
|
|
it->title_next_btn = NULL;
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-11-16 04:51:53 -08:00
|
|
|
static void
|
|
|
|
_title_icon_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it = data;
|
2011-11-28 00:28:34 -08:00
|
|
|
it->title_icon = NULL;
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
|
2011-11-16 04:51:53 -08:00
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
static void
|
2011-09-13 23:23:08 -07:00
|
|
|
_item_content_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it = data;
|
2011-09-13 23:23:08 -07:00
|
|
|
it->content = NULL;
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-09-13 23:23:08 -07:00
|
|
|
_title_content_set(Elm_Naviframe_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-09-13 23:23:08 -07:00
|
|
|
char buf[1024];
|
2011-12-01 03:41:47 -08:00
|
|
|
Elm_Naviframe_Content_Item_Pair *pair = NULL;
|
2012-01-11 03:25:04 -08:00
|
|
|
Evas_Object *prev_content = NULL;
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-10-14 03:20:07 -07:00
|
|
|
EINA_INLIST_FOREACH(it->content_list, pair)
|
2011-10-03 23:49:16 -07:00
|
|
|
if (!strcmp(part, pair->part)) break;
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-12-16 03:01:20 -08:00
|
|
|
if (pair)
|
2011-12-16 01:07:41 -08:00
|
|
|
{
|
2012-01-11 03:25:04 -08:00
|
|
|
prev_content = elm_object_part_content_get(VIEW(it), part);
|
|
|
|
if (prev_content != content)
|
2011-12-16 01:07:41 -08:00
|
|
|
{
|
|
|
|
if (content)
|
|
|
|
{
|
2012-01-11 03:25:04 -08:00
|
|
|
evas_object_event_callback_del(prev_content,
|
2011-12-16 01:07:41 -08:00
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_content_del);
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), buf, "elm");
|
2011-12-16 01:07:41 -08:00
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
evas_object_del(prev_content);
|
2011-12-16 01:07:41 -08:00
|
|
|
if (!content) return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2011-09-13 23:23:08 -07:00
|
|
|
{
|
2011-12-06 02:53:20 -08:00
|
|
|
if (!content) return;
|
|
|
|
pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
|
|
|
|
if (!pair)
|
2011-09-13 23:23:08 -07:00
|
|
|
{
|
2011-12-06 02:53:20 -08:00
|
|
|
ERR("Failed to allocate new content part of the item! : naviframe=%p", WIDGET(it));
|
2011-09-13 23:23:08 -07:00
|
|
|
return;
|
|
|
|
}
|
2011-12-06 02:53:20 -08:00
|
|
|
pair->it = it;
|
|
|
|
eina_stringshare_replace(&pair->part, part);
|
|
|
|
it->content_list = eina_inlist_append(it->content_list,
|
|
|
|
EINA_INLIST_GET(pair));
|
2011-12-19 03:13:06 -08:00
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
if (prev_content != content)
|
2011-12-19 03:13:06 -08:00
|
|
|
{
|
2011-12-16 01:07:41 -08:00
|
|
|
evas_object_event_callback_add(content,
|
2011-11-07 02:18:26 -08:00
|
|
|
EVAS_CALLBACK_DEL,
|
2011-12-16 01:07:41 -08:00
|
|
|
_title_content_del,
|
|
|
|
pair);
|
2011-10-03 23:49:16 -07:00
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_set(VIEW(it), part, content);
|
2011-12-19 03:13:06 -08:00
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), buf, "elm");
|
2011-12-01 03:41:47 -08:00
|
|
|
|
|
|
|
_sizing_eval(WIDGET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-09-19 17:31:44 -07:00
|
|
|
_title_prev_btn_set(Elm_Naviframe_Item *it,
|
|
|
|
Evas_Object *btn,
|
|
|
|
Eina_Bool back_btn)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
|
|
|
if (it->title_prev_btn == btn) return;
|
2012-01-11 03:25:04 -08:00
|
|
|
if (it->title_prev_btn) evas_object_del(it->title_prev_btn);
|
2011-07-12 21:21:50 -07:00
|
|
|
it->title_prev_btn = btn;
|
2011-11-24 03:26:41 -08:00
|
|
|
if (!btn) return;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(btn,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_prev_btn_del,
|
|
|
|
it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_set(VIEW(it), "elm.swallow.prev_btn", btn);
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
|
2011-07-12 21:21:50 -07:00
|
|
|
it->back_btn = back_btn;
|
2011-08-04 09:52:39 -07:00
|
|
|
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
|
|
|
|
{
|
|
|
|
if (it->title_next_btn == btn) return;
|
2012-01-11 03:25:04 -08:00
|
|
|
if (it->title_next_btn) evas_object_del(it->title_next_btn);
|
2011-07-12 21:21:50 -07:00
|
|
|
it->title_next_btn = btn;
|
2011-11-24 03:26:41 -08:00
|
|
|
if (!btn) return;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(btn,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_next_btn_del,
|
|
|
|
it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_set(VIEW(it), "elm.swallow.next_btn", btn);
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
|
2011-08-04 09:52:39 -07:00
|
|
|
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-11-16 04:51:53 -08:00
|
|
|
static void
|
|
|
|
_title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon)
|
|
|
|
{
|
2011-11-28 00:28:34 -08:00
|
|
|
if (it->title_icon == icon) return;
|
2012-01-11 03:25:04 -08:00
|
|
|
if (it->title_icon) evas_object_del(it->title_icon);
|
2011-11-28 00:28:34 -08:00
|
|
|
it->title_icon = icon;
|
2011-11-24 03:26:41 -08:00
|
|
|
if (!icon) return;
|
2011-11-16 04:51:53 -08:00
|
|
|
|
|
|
|
evas_object_event_callback_add(icon,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_icon_del,
|
|
|
|
it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_set(VIEW(it), "elm.swallow.icon", icon);
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
|
2011-11-16 04:51:53 -08:00
|
|
|
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(it));
|
2011-11-16 04:51:53 -08:00
|
|
|
}
|
|
|
|
|
2011-11-28 00:28:34 -08:00
|
|
|
static Evas_Object *
|
|
|
|
_item_content_unset(Elm_Naviframe_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *content = it->content;
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_unset(VIEW(it), "elm.swallow.content");
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
|
2011-11-28 00:28:34 -08:00
|
|
|
evas_object_event_callback_del(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_item_content_del);
|
|
|
|
_sizing_eval(WIDGET(it));
|
|
|
|
|
|
|
|
it->content = NULL;
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_title_prev_btn_unset(Elm_Naviframe_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *content = it->title_prev_btn;
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_unset(VIEW(it), "elm.swallow.prev_btn");
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
|
2011-11-28 00:28:34 -08:00
|
|
|
evas_object_event_callback_del(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_prev_btn_del);
|
|
|
|
_sizing_eval(WIDGET(it));
|
|
|
|
|
|
|
|
it->title_prev_btn = NULL;
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_title_next_btn_unset(Elm_Naviframe_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *content = it->title_next_btn;
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_unset(VIEW(it), "elm.swallow.next_btn");
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
|
2011-11-28 00:28:34 -08:00
|
|
|
evas_object_event_callback_del(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_next_btn_del);
|
|
|
|
_sizing_eval(WIDGET(it));
|
|
|
|
|
|
|
|
it->title_next_btn = NULL;
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_title_icon_unset(Elm_Naviframe_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *content = it->title_icon;
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_unset(VIEW(it), "elm.swallow.icon");
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
|
2011-11-28 00:28:34 -08:00
|
|
|
evas_object_event_callback_del(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_icon_del);
|
|
|
|
_sizing_eval(WIDGET(it));
|
|
|
|
it->title_icon = NULL;
|
2011-12-11 20:54:15 -08:00
|
|
|
|
2011-11-28 00:28:34 -08:00
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_title_content_unset(Elm_Naviframe_Item *it, const char *part)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Content_Item_Pair *pair = NULL;
|
|
|
|
char buf[1028];
|
2011-11-29 01:24:41 -08:00
|
|
|
Evas_Object *content = NULL;
|
2011-11-28 00:28:34 -08:00
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(it->content_list, pair)
|
|
|
|
{
|
|
|
|
if (!strcmp(part, pair->part))
|
|
|
|
{
|
2012-01-11 03:25:04 -08:00
|
|
|
content = elm_object_part_content_get(VIEW(it), part);
|
2011-11-28 00:28:34 -08:00
|
|
|
eina_stringshare_del(pair->part);
|
|
|
|
it->content_list = eina_inlist_remove(it->content_list,
|
|
|
|
EINA_INLIST_GET(pair));
|
|
|
|
free(pair);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_unset(VIEW(it), part);
|
2011-11-28 00:28:34 -08:00
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), buf, "elm");
|
2011-11-28 00:28:34 -08:00
|
|
|
evas_object_event_callback_del(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_content_del);
|
|
|
|
_sizing_eval(WIDGET(it));
|
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
static void
|
|
|
|
_item_del(Elm_Naviframe_Item *it)
|
|
|
|
{
|
|
|
|
Widget_Data *wd;
|
2011-09-13 23:23:08 -07:00
|
|
|
Elm_Naviframe_Content_Item_Pair *content_pair;
|
|
|
|
Elm_Naviframe_Text_Item_Pair *text_pair;
|
2012-01-11 03:25:04 -08:00
|
|
|
Evas_Object *content;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
if (!it) return;
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
wd = elm_widget_data_get(WIDGET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-24 17:50:54 -07:00
|
|
|
while (it->content_list)
|
2011-10-04 06:15:42 -07:00
|
|
|
{
|
2012-01-11 03:25:04 -08:00
|
|
|
content_pair =
|
|
|
|
EINA_INLIST_CONTAINER_GET(it->content_list,
|
|
|
|
Elm_Naviframe_Content_Item_Pair);
|
|
|
|
content = elm_object_part_content_get(VIEW(it), content_pair->part);
|
|
|
|
evas_object_event_callback_del(content,
|
2011-10-14 03:20:07 -07:00
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_title_content_del);
|
2011-10-04 06:15:42 -07:00
|
|
|
eina_stringshare_del(content_pair->part);
|
2011-10-24 17:50:54 -07:00
|
|
|
it->content_list = eina_inlist_remove(it->content_list,
|
|
|
|
it->content_list);
|
2011-10-04 06:15:42 -07:00
|
|
|
free(content_pair);
|
|
|
|
}
|
2011-09-13 23:23:08 -07:00
|
|
|
|
2011-10-24 17:50:54 -07:00
|
|
|
while (it->text_list)
|
2011-09-13 23:23:08 -07:00
|
|
|
{
|
2011-10-24 17:50:54 -07:00
|
|
|
text_pair = EINA_INLIST_CONTAINER_GET(it->text_list,
|
|
|
|
Elm_Naviframe_Text_Item_Pair);
|
2011-09-13 23:23:08 -07:00
|
|
|
eina_stringshare_del(text_pair->part);
|
2011-10-14 03:20:07 -07:00
|
|
|
it->text_list = eina_inlist_remove(it->text_list,
|
2011-10-24 17:50:54 -07:00
|
|
|
it->text_list);
|
2011-10-04 06:15:42 -07:00
|
|
|
free(text_pair);
|
2011-09-13 23:23:08 -07:00
|
|
|
}
|
|
|
|
|
2011-10-19 01:49:24 -07:00
|
|
|
eina_stringshare_del(it->style);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2012-01-27 03:56:14 -08:00
|
|
|
static Eina_Bool
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
_item_del_pre_hook(Elm_Object_Item *it)
|
|
|
|
{
|
2012-01-27 03:56:14 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
Elm_Naviframe_Item *navi_it;
|
|
|
|
Widget_Data *wd;
|
2011-10-19 01:49:24 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
navi_it =(Elm_Naviframe_Item *) it;
|
|
|
|
wd = elm_widget_data_get(WIDGET(navi_it));
|
2012-01-27 03:56:14 -08:00
|
|
|
if (!wd) return EINA_FALSE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
|
|
|
if (it == elm_naviframe_top_item_get(WIDGET(navi_it)))
|
|
|
|
{
|
|
|
|
wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
|
|
|
|
_item_del(navi_it);
|
|
|
|
elm_widget_item_free(navi_it);
|
|
|
|
//If the item is only one, the stack will be empty
|
2012-01-27 03:56:14 -08:00
|
|
|
if (!wd->stack) return EINA_TRUE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
|
|
|
|
Elm_Naviframe_Item);
|
|
|
|
evas_object_show(VIEW(navi_it));
|
|
|
|
evas_object_raise(VIEW(navi_it));
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,visible", "elm");
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it));
|
|
|
|
_item_del(navi_it);
|
|
|
|
elm_widget_item_free(navi_it);
|
|
|
|
}
|
2012-01-27 03:56:14 -08:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pushed_finished(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
2011-10-28 01:31:42 -07:00
|
|
|
Widget_Data *wd;
|
2011-07-12 21:21:50 -07:00
|
|
|
Elm_Naviframe_Item *it = data;
|
|
|
|
if (!it) return;
|
2011-10-28 01:31:42 -07:00
|
|
|
|
|
|
|
wd = elm_widget_data_get(WIDGET(it));
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_hide(VIEW(it));
|
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-10-18 09:12:14 -07:00
|
|
|
SIG_PUSH_FINISHED,
|
|
|
|
data);
|
2011-10-28 01:31:42 -07:00
|
|
|
if (wd->freeze_events)
|
|
|
|
evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_popped_finished(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
2011-10-18 09:12:14 -07:00
|
|
|
Elm_Naviframe_Item *it = data;
|
|
|
|
if (!it) return;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-10-18 09:12:14 -07:00
|
|
|
SIG_POP_FINISHED,
|
|
|
|
data);
|
2011-07-12 21:21:50 -07:00
|
|
|
_item_del(data);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_free(data);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_show_finished(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
Widget_Data *wd;
|
|
|
|
|
|
|
|
it = data;
|
|
|
|
if (!it) return;
|
2011-10-20 18:08:01 -07:00
|
|
|
wd = elm_widget_data_get(WIDGET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-07-12 21:21:50 -07:00
|
|
|
SIG_TRANSITION_FINISHED,
|
2011-10-18 09:12:14 -07:00
|
|
|
data);
|
2011-10-12 05:19:31 -07:00
|
|
|
if (wd->freeze_events)
|
2011-10-28 01:31:42 -07:00
|
|
|
evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-11-21 08:14:52 -08:00
|
|
|
static void
|
|
|
|
_changed_size_hints(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
_sizing_eval(data);
|
|
|
|
}
|
|
|
|
|
2011-08-04 09:37:36 -07:00
|
|
|
static void
|
|
|
|
_item_content_set(Elm_Naviframe_Item *navi_it, Evas_Object *content)
|
|
|
|
{
|
|
|
|
if (navi_it->content == content) return;
|
|
|
|
if (navi_it->content) evas_object_del(navi_it->content);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_part_content_set(VIEW(navi_it), "elm.swallow.content", content);
|
|
|
|
|
2011-08-04 09:37:36 -07:00
|
|
|
if (content)
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,content,show", "elm");
|
2011-08-04 09:37:36 -07:00
|
|
|
else
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,content,hide", "elm");
|
|
|
|
|
2011-08-04 09:37:36 -07:00
|
|
|
evas_object_event_callback_add(content,
|
|
|
|
EVAS_CALLBACK_DEL,
|
2011-09-13 23:23:08 -07:00
|
|
|
_item_content_del,
|
2011-08-04 09:37:36 -07:00
|
|
|
navi_it);
|
|
|
|
navi_it->content = content;
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(navi_it));
|
2011-08-04 09:37:36 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 17:24:15 -07:00
|
|
|
//FIXME: need to handle if this function is called while transition
|
2011-10-19 01:49:24 -07:00
|
|
|
static void
|
|
|
|
_item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
|
|
|
{
|
|
|
|
Elm_Naviframe_Content_Item_Pair *content_pair;
|
|
|
|
Elm_Naviframe_Text_Item_Pair *text_pair;
|
|
|
|
Widget_Data *wd;
|
2012-02-15 08:27:34 -08:00
|
|
|
wd = elm_widget_data_get(WIDGET(navi_it));
|
|
|
|
if (!wd) return;
|
2011-10-19 01:49:24 -07:00
|
|
|
|
|
|
|
char buf[256];
|
|
|
|
|
|
|
|
if (!item_style)
|
|
|
|
{
|
2012-02-15 08:27:34 -08:00
|
|
|
snprintf(buf, sizeof(buf), "item/%s", wd->item_style);
|
2011-10-19 01:49:24 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-01-02 21:24:35 -08:00
|
|
|
snprintf(buf, sizeof(buf), "item/%s", item_style);
|
2011-10-19 01:49:24 -07:00
|
|
|
eina_stringshare_replace(&navi_it->style, item_style);
|
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_layout_theme_set(VIEW(navi_it),
|
|
|
|
"naviframe",
|
|
|
|
buf,
|
|
|
|
elm_widget_style_get(WIDGET(navi_it)));
|
2011-10-19 01:49:24 -07:00
|
|
|
//recover item
|
|
|
|
EINA_INLIST_FOREACH(navi_it->text_list, text_pair)
|
2012-01-11 03:25:04 -08:00
|
|
|
_item_text_set_hook((Elm_Object_Item *) navi_it,
|
|
|
|
text_pair->part,
|
|
|
|
elm_object_part_text_get(VIEW(navi_it),
|
|
|
|
text_pair->part));
|
2011-10-19 01:49:24 -07:00
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(navi_it->content_list, content_pair)
|
2012-01-11 03:25:04 -08:00
|
|
|
_item_content_set_hook((Elm_Object_Item *) navi_it,
|
|
|
|
content_pair->part,
|
|
|
|
elm_object_part_content_get(VIEW(navi_it),
|
|
|
|
content_pair->part));
|
2011-10-19 01:49:24 -07:00
|
|
|
//content
|
|
|
|
if (navi_it->content)
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,content,show", "elm");
|
2011-10-19 01:49:24 -07:00
|
|
|
|
|
|
|
//prev button
|
|
|
|
if (navi_it->title_prev_btn)
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,prev_btn,show", "elm");
|
2011-10-19 01:49:24 -07:00
|
|
|
|
|
|
|
//next button
|
|
|
|
if (navi_it->title_next_btn)
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it), "elm,state,next_btn,show", "elm");
|
2011-10-19 01:49:24 -07:00
|
|
|
|
|
|
|
navi_it->title_visible = EINA_TRUE;
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(navi_it));
|
2011-10-19 01:49:24 -07:00
|
|
|
|
2011-10-28 01:31:42 -07:00
|
|
|
if (wd->freeze_events)
|
|
|
|
evas_object_freeze_events_set(VIEW(navi_it), EINA_FALSE);
|
2011-10-19 01:49:24 -07:00
|
|
|
}
|
|
|
|
|
2011-11-03 00:15:18 -07:00
|
|
|
static Elm_Naviframe_Item *
|
|
|
|
_item_new(Evas_Object *obj,
|
|
|
|
const char *title_label,
|
|
|
|
Evas_Object *prev_btn,
|
|
|
|
Evas_Object *next_btn,
|
|
|
|
Evas_Object *content,
|
|
|
|
const char *item_style)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-11-03 00:15:18 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
//create item
|
2011-11-03 00:15:18 -07:00
|
|
|
Elm_Naviframe_Item *it = elm_widget_item_new(obj, Elm_Naviframe_Item);
|
2011-07-12 21:21:50 -07:00
|
|
|
if (!it)
|
|
|
|
{
|
|
|
|
ERR("Failed to allocate new item! : naviframe=%p", obj);
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-08-04 09:37:36 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
|
2011-09-15 18:09:48 -07:00
|
|
|
elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
|
|
|
|
elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
|
|
|
|
elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
|
|
|
|
elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
|
|
|
|
elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
|
2011-09-15 19:20:02 -07:00
|
|
|
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
|
2011-08-04 09:37:36 -07:00
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
//item base layout
|
2012-01-11 03:25:04 -08:00
|
|
|
VIEW(it) = elm_layout_add(obj);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_member_add(VIEW(it), wd->base);
|
2012-01-11 03:25:04 -08:00
|
|
|
|
|
|
|
evas_object_event_callback_add(VIEW(it),
|
|
|
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
|
|
|
_changed_size_hints,
|
|
|
|
obj);
|
|
|
|
elm_object_signal_callback_add(VIEW(it),
|
2011-07-12 21:21:50 -07:00
|
|
|
"elm,action,show,finished",
|
|
|
|
"",
|
|
|
|
_show_finished, it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_callback_add(VIEW(it),
|
2011-07-12 21:21:50 -07:00
|
|
|
"elm,action,pushed,finished",
|
|
|
|
"",
|
|
|
|
_pushed_finished, it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_callback_add(VIEW(it),
|
2011-07-12 21:21:50 -07:00
|
|
|
"elm,action,popped,finished",
|
|
|
|
"",
|
|
|
|
_popped_finished, it);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_callback_add(VIEW(it),
|
2011-09-15 23:11:36 -07:00
|
|
|
"elm,action,title,clicked",
|
|
|
|
"",
|
2011-07-12 21:21:50 -07:00
|
|
|
_title_clicked, it);
|
|
|
|
|
2011-10-19 01:49:24 -07:00
|
|
|
_item_style_set(it, item_style);
|
2011-10-17 17:25:52 -07:00
|
|
|
_item_text_set_hook((Elm_Object_Item *) it, "elm.text.title", title_label);
|
2011-07-12 21:21:50 -07:00
|
|
|
|
2011-07-25 01:48:47 -07:00
|
|
|
//title buttons
|
2011-10-12 23:30:05 -07:00
|
|
|
if ((!prev_btn) && wd->auto_pushed && eina_inlist_count(wd->stack))
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
|
|
|
prev_btn = _back_btn_new(obj);
|
|
|
|
_title_prev_btn_set(it, prev_btn, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_title_prev_btn_set(it, prev_btn, EINA_FALSE);
|
|
|
|
|
|
|
|
_title_next_btn_set(it, next_btn);
|
2011-08-04 09:37:36 -07:00
|
|
|
_item_content_set(it, content);
|
2011-11-03 00:15:18 -07:00
|
|
|
it->title_visible = EINA_TRUE;
|
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
2012-01-11 03:48:45 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd || !wd->stack) return EINA_FALSE;
|
|
|
|
return elm_widget_focus_next_get(VIEW(elm_naviframe_top_item_get(obj)),
|
|
|
|
dir,
|
|
|
|
next);
|
|
|
|
}
|
|
|
|
|
2011-11-03 00:15:18 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_naviframe_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
Evas *e;
|
|
|
|
Widget_Data *wd;
|
|
|
|
|
|
|
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
|
|
|
ELM_SET_WIDTYPE(widtype, "naviframe");
|
|
|
|
elm_widget_type_set(obj, "naviframe");
|
|
|
|
elm_widget_sub_object_add(parent, obj);
|
|
|
|
elm_widget_data_set(obj, wd);
|
|
|
|
elm_widget_del_hook_set(obj, _del_hook);
|
|
|
|
elm_widget_disable_hook_set(obj, _disable_hook);
|
|
|
|
elm_widget_theme_hook_set(obj, _theme_hook);
|
|
|
|
elm_widget_signal_emit_hook_set(obj, _emit_hook);
|
2012-01-11 03:48:45 -08:00
|
|
|
elm_widget_can_focus_set(obj, EINA_FALSE);
|
|
|
|
elm_widget_focus_next_hook_set(obj, _focus_next_hook);
|
2011-11-03 00:15:18 -07:00
|
|
|
|
|
|
|
//base
|
2012-01-11 03:25:04 -08:00
|
|
|
wd->base = elm_layout_add(parent);
|
|
|
|
evas_object_event_callback_add(wd->base,
|
|
|
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
|
|
|
_changed_size_hints,
|
|
|
|
obj);
|
2011-11-03 00:15:18 -07:00
|
|
|
elm_widget_resize_object_set(obj, wd->base);
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_layout_theme_set(wd->base, "naviframe", "base", "default");
|
2011-11-03 00:15:18 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
|
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _signals);
|
|
|
|
|
|
|
|
wd->auto_pushed = EINA_TRUE;
|
|
|
|
wd->freeze_events = EINA_TRUE;
|
2012-02-15 08:27:34 -08:00
|
|
|
wd->item_style = eina_stringshare_add("basic");
|
2011-11-03 00:15:18 -07:00
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd;
|
|
|
|
Elm_Naviframe_Item *prev_it, *it;
|
|
|
|
|
|
|
|
wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
|
|
|
|
it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_show(VIEW(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
|
2011-10-17 17:25:52 -07:00
|
|
|
prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
|
2011-07-12 21:21:50 -07:00
|
|
|
if (prev_it)
|
|
|
|
{
|
2011-10-12 05:19:31 -07:00
|
|
|
if (wd->freeze_events)
|
2011-10-28 01:31:42 -07:00
|
|
|
{
|
|
|
|
evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
|
|
|
|
evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
|
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
|
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
2011-10-12 23:30:05 -07:00
|
|
|
wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it));
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(obj);
|
2011-10-17 17:25:52 -07:00
|
|
|
return (Elm_Object_Item *) it;
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-11-03 00:15:18 -07:00
|
|
|
EAPI Elm_Object_Item *
|
|
|
|
elm_naviframe_item_insert_before(Elm_Object_Item *before,
|
|
|
|
const char *title_label,
|
|
|
|
Evas_Object *prev_btn,
|
|
|
|
Evas_Object *next_btn,
|
|
|
|
Evas_Object *content,
|
|
|
|
const char *item_style)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(before, NULL);
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
Widget_Data *wd;
|
|
|
|
|
2011-11-07 18:49:05 -08:00
|
|
|
wd = elm_widget_data_get(WIDGET(before));
|
2011-11-03 00:15:18 -07:00
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-11-07 18:49:05 -08:00
|
|
|
it = _item_new(WIDGET(before), title_label, prev_btn, next_btn, content,
|
2011-11-03 00:15:18 -07:00
|
|
|
item_style);
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
wd->stack =
|
|
|
|
eina_inlist_prepend_relative(wd->stack, EINA_INLIST_GET(it),
|
2011-11-07 18:49:05 -08:00
|
|
|
EINA_INLIST_GET(((Elm_Naviframe_Item *) before)));
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(before));
|
2011-11-03 00:15:18 -07:00
|
|
|
return (Elm_Object_Item *) it;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Object_Item *
|
|
|
|
elm_naviframe_item_insert_after(Elm_Object_Item *after,
|
|
|
|
const char *title_label,
|
|
|
|
Evas_Object *prev_btn,
|
|
|
|
Evas_Object *next_btn,
|
|
|
|
Evas_Object *content,
|
|
|
|
const char *item_style)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(after, NULL);
|
|
|
|
Elm_Naviframe_Item *it;
|
|
|
|
Widget_Data *wd;
|
|
|
|
|
2011-11-07 18:49:05 -08:00
|
|
|
wd = elm_widget_data_get(WIDGET(after));
|
2011-11-03 00:15:18 -07:00
|
|
|
if (!wd) return NULL;
|
|
|
|
|
2011-11-07 18:49:05 -08:00
|
|
|
it = _item_new(WIDGET(after), title_label, prev_btn, next_btn, content,
|
2011-11-03 00:15:18 -07:00
|
|
|
item_style);
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
2011-11-07 18:49:05 -08:00
|
|
|
if (elm_naviframe_top_item_get(WIDGET(after)) == after)
|
2011-11-03 00:15:18 -07:00
|
|
|
{
|
2011-11-07 18:49:05 -08:00
|
|
|
evas_object_hide(VIEW(after));
|
2011-11-03 00:15:18 -07:00
|
|
|
evas_object_show(VIEW(it));
|
|
|
|
}
|
|
|
|
wd->stack =
|
|
|
|
eina_inlist_append_relative(wd->stack, EINA_INLIST_GET(it),
|
2011-11-07 18:49:05 -08:00
|
|
|
EINA_INLIST_GET(((Elm_Naviframe_Item *) after)));
|
2011-11-21 08:14:52 -08:00
|
|
|
_sizing_eval(WIDGET(after));
|
2011-11-03 00:15:18 -07:00
|
|
|
return (Elm_Object_Item *) it;
|
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_naviframe_item_pop(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2011-10-13 00:52:01 -07:00
|
|
|
Elm_Naviframe_Item *it, *prev_it = NULL;
|
2011-07-12 21:21:50 -07:00
|
|
|
Widget_Data *wd;
|
|
|
|
Evas_Object *content = NULL;
|
|
|
|
|
|
|
|
wd = elm_widget_data_get(obj);
|
2012-01-11 03:50:49 -08:00
|
|
|
if (!wd) return NULL;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
2011-10-17 17:25:52 -07:00
|
|
|
it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
|
2011-07-12 21:21:50 -07:00
|
|
|
if (!it) return NULL;
|
2011-10-18 22:34:41 -07:00
|
|
|
elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
|
2011-07-12 21:21:50 -07:00
|
|
|
if (wd->preserve)
|
|
|
|
content = it->content;
|
|
|
|
|
2011-10-13 00:52:01 -07:00
|
|
|
if (wd->stack->last->prev)
|
|
|
|
prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
|
|
|
|
Elm_Naviframe_Item);
|
2011-10-23 23:35:48 -07:00
|
|
|
wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(it));
|
2011-07-12 21:21:50 -07:00
|
|
|
if (prev_it)
|
|
|
|
{
|
2011-10-12 05:19:31 -07:00
|
|
|
if (wd->freeze_events)
|
2011-10-28 01:31:42 -07:00
|
|
|
{
|
|
|
|
evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
|
|
|
|
evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
|
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_show(VIEW(prev_it));
|
|
|
|
evas_object_raise(VIEW(prev_it));
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(prev_it),
|
|
|
|
"elm,state,prev,popped",
|
|
|
|
"elm");
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
else
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
_item_del(it);
|
|
|
|
elm_widget_item_free(it);
|
|
|
|
}
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
2011-09-18 22:23:35 -07:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_item_pop_to(Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-10-28 01:31:42 -07:00
|
|
|
Elm_Naviframe_Item *navi_it;
|
|
|
|
Widget_Data *wd;
|
2011-10-12 23:30:05 -07:00
|
|
|
Eina_Inlist *l, *prev_l;
|
2011-09-18 22:23:35 -07:00
|
|
|
|
2011-10-28 01:31:42 -07:00
|
|
|
navi_it = (Elm_Naviframe_Item *) it;
|
|
|
|
wd = elm_widget_data_get(WIDGET(navi_it));
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
if (it == elm_naviframe_top_item_get(WIDGET(navi_it))) return;
|
2011-09-18 22:23:35 -07:00
|
|
|
|
2011-10-12 23:30:05 -07:00
|
|
|
l = wd->stack->last->prev;
|
2011-09-18 22:23:35 -07:00
|
|
|
|
|
|
|
while(l)
|
|
|
|
{
|
2011-10-17 17:25:52 -07:00
|
|
|
if (EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item) ==
|
|
|
|
((Elm_Naviframe_Item *) it)) break;
|
2011-09-18 22:23:35 -07:00
|
|
|
prev_l = l->prev;
|
2011-10-23 23:35:48 -07:00
|
|
|
wd->stack = eina_inlist_remove(wd->stack, l);
|
2011-10-12 23:30:05 -07:00
|
|
|
_item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item));
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_free(EINA_INLIST_CONTAINER_GET(l,
|
|
|
|
Elm_Naviframe_Item));
|
2011-09-18 22:23:35 -07:00
|
|
|
l = prev_l;
|
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
elm_naviframe_item_pop(WIDGET(navi_it));
|
2011-09-18 22:23:35 -07:00
|
|
|
}
|
|
|
|
|
2011-10-23 23:35:48 -07:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_item_promote(Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-10-28 01:31:42 -07:00
|
|
|
Elm_Naviframe_Item *navi_it;
|
|
|
|
Elm_Naviframe_Item *prev_it;
|
|
|
|
Widget_Data *wd;
|
|
|
|
|
|
|
|
navi_it = (Elm_Naviframe_Item *) it;
|
|
|
|
wd = elm_widget_data_get(navi_it->base.widget);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-10-23 23:35:48 -07:00
|
|
|
if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
|
|
|
|
wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
|
|
|
|
prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
|
|
|
|
Elm_Naviframe_Item);
|
|
|
|
if (wd->freeze_events)
|
2011-10-28 01:31:42 -07:00
|
|
|
{
|
|
|
|
evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
|
|
|
|
evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
|
|
|
|
}
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(prev_it),
|
|
|
|
"elm,state,cur,pushed",
|
|
|
|
"elm");
|
2011-11-14 00:23:25 -08:00
|
|
|
evas_object_show(VIEW(navi_it));
|
|
|
|
evas_object_raise(VIEW(navi_it));
|
2012-01-11 03:25:04 -08:00
|
|
|
elm_object_signal_emit(VIEW(navi_it),
|
|
|
|
"elm,state,new,pushed",
|
|
|
|
"elm");
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
|
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(navi_it)));
|
2011-10-23 23:35:48 -07:00
|
|
|
}
|
|
|
|
|
2011-10-06 05:46:59 -07:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_item_del(Elm_Object_Item *it)
|
|
|
|
{
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_object_item_del(it);
|
2011-10-06 05:46:59 -07:00
|
|
|
}
|
|
|
|
|
2011-07-12 21:21:50 -07:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->preserve = !!preserve;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->preserve;
|
|
|
|
}
|
|
|
|
|
2011-08-04 01:17:30 -07:00
|
|
|
EAPI Elm_Object_Item*
|
2011-07-12 21:21:50 -07:00
|
|
|
elm_naviframe_top_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if ((!wd) || (!wd->stack)) return NULL;
|
2011-10-17 17:25:52 -07:00
|
|
|
return (Elm_Object_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack->last,
|
|
|
|
Elm_Naviframe_Item));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-08-04 01:17:30 -07:00
|
|
|
EAPI Elm_Object_Item*
|
2011-07-12 21:21:50 -07:00
|
|
|
elm_naviframe_bottom_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-10-07 03:33:14 -07:00
|
|
|
if ((!wd) || (!wd->stack)) return NULL;
|
2011-10-17 17:25:52 -07:00
|
|
|
return (Elm_Object_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack,
|
|
|
|
Elm_Naviframe_Item));
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-08-04 01:17:30 -07:00
|
|
|
elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-08-04 01:58:35 -07:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
2011-10-20 17:24:15 -07:00
|
|
|
//Return if new style is exsiting one.
|
2012-02-15 08:27:34 -08:00
|
|
|
if ((item_style && navi_it->style) && (!strcmp(item_style, navi_it->style)))
|
|
|
|
return;
|
2011-10-03 23:50:18 -07:00
|
|
|
|
2012-02-15 08:27:34 -08:00
|
|
|
if ((!item_style) && (!navi_it->style))
|
|
|
|
return;
|
2011-10-03 23:50:18 -07:00
|
|
|
|
2011-10-19 01:49:24 -07:00
|
|
|
_item_style_set(navi_it, item_style);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2011-08-04 01:17:30 -07:00
|
|
|
elm_naviframe_item_style_get(const Elm_Object_Item *it)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-08-04 01:58:35 -07:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-08-04 01:17:30 -07:00
|
|
|
return navi_it->style;
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2011-08-04 01:17:30 -07:00
|
|
|
elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-08-04 01:58:35 -07:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
|
|
|
visible = !!visible;
|
2011-08-04 01:17:30 -07:00
|
|
|
if (navi_it->title_visible == visible) return;
|
2011-07-12 21:21:50 -07:00
|
|
|
|
2011-08-04 01:17:30 -07:00
|
|
|
navi_it->title_visible = visible;
|
2011-10-14 22:16:53 -07:00
|
|
|
_item_title_visible_update(navi_it);
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2011-08-04 01:17:30 -07:00
|
|
|
elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
|
2011-07-12 21:21:50 -07:00
|
|
|
{
|
2011-08-04 01:58:35 -07:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
2011-10-17 17:25:52 -07:00
|
|
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
2011-08-04 01:17:30 -07:00
|
|
|
return navi_it->title_visible;
|
2011-07-12 21:21:50 -07:00
|
|
|
}
|
|
|
|
|
2011-10-12 03:31:13 -07:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed)
|
|
|
|
{
|
2011-10-12 04:13:18 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2011-10-12 03:31:13 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-10-12 04:13:18 -07:00
|
|
|
if (!wd) return;
|
2011-10-12 03:31:13 -07:00
|
|
|
wd->auto_pushed = !!auto_pushed;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj)
|
|
|
|
{
|
2011-10-12 04:13:18 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
2011-10-12 03:31:13 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-10-12 04:13:18 -07:00
|
|
|
if (!wd) return EINA_FALSE;
|
2011-10-12 03:31:13 -07:00
|
|
|
return wd->auto_pushed;
|
|
|
|
}
|
|
|
|
|
2012-02-15 08:27:34 -08:00
|
|
|
EAPI Eina_List *
|
2011-11-03 00:15:18 -07:00
|
|
|
elm_naviframe_items_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
2012-02-15 08:27:34 -08:00
|
|
|
Eina_List *ret = NULL;
|
|
|
|
Elm_Naviframe_Item *itr;
|
|
|
|
EINA_INLIST_FOREACH(wd->stack, itr)
|
|
|
|
{
|
|
|
|
ret = eina_list_append(ret, itr);
|
|
|
|
}
|
|
|
|
return ret;
|
2011-11-03 00:15:18 -07:00
|
|
|
}
|
|
|
|
|
2011-12-11 20:54:15 -08:00
|
|
|
EAPI void
|
|
|
|
elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
enabled = !!enabled;
|
2011-12-11 20:57:33 -08:00
|
|
|
if (wd->freeze_events == !enabled) return;
|
|
|
|
wd->freeze_events = !enabled;
|
2011-12-11 20:54:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_naviframe_event_enabled_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
2011-12-11 20:57:33 -08:00
|
|
|
return !wd->freeze_events;
|
2011-12-11 20:54:15 -08:00
|
|
|
}
|
2012-02-15 08:27:34 -08:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
eina_stringshare_replace(&wd->item_style, style);
|
|
|
|
_theme_hook(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
|
|
|
elm_naviframe_item_style_default_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
return wd->item_style;
|
|
|
|
}
|