aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2011-07-13 04:21:50 +0000
committerChunEon Park <hermet@hermet.pe.kr>2011-07-13 04:21:50 +0000
commit5f9a3fa570e4f921639de63ab6fea745c00f2717 (patch)
tree61cd8c1212ff9c92e9ec8a78c13e934c2ae43a1b
parentelementary/test_gesture_layer - oops. ciritical misktake. :p (diff)
downloadelementary-5f9a3fa570e4f921639de63ab6fea745c00f2717.tar.gz
elementary/naviframe - added new widget.
This widget is for application's view manager such as elm_pager But has optional functions more for users convenience. Not completed yet for decorations. but basic frame is completed. Need to have a review. SVN revision: 61313
-rw-r--r--data/images/icon_right_arrow.pngbin0 -> 1832 bytes
-rw-r--r--data/themes/default.edc561
-rw-r--r--src/bin/Makefile.am1
-rw-r--r--src/bin/test.c2
-rw-r--r--src/bin/test_naviframe.c165
-rw-r--r--src/lib/Elementary.h.in31
-rw-r--r--src/lib/Makefile.am1
-rw-r--r--src/lib/elc_naviframe.c807
8 files changed, 1568 insertions, 0 deletions
diff --git a/data/images/icon_right_arrow.png b/data/images/icon_right_arrow.png
new file mode 100644
index 000000000..6bbb2c6ea
--- /dev/null
+++ b/data/images/icon_right_arrow.png
Binary files differ
diff --git a/data/themes/default.edc b/data/themes/default.edc
index e610415f8..0db4c9576 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -2970,6 +2970,193 @@ collections {
}
}
}
+ group { name: "elm/button/base/naviframe/back_btn/default";
+ images {
+ image: "bt_base1.png" COMP;
+ image: "bt_base2.png" COMP;
+ image: "bt_hilight.png" COMP;
+ image: "bt_shine.png" COMP;
+ image: "bt_glow.png" COMP;
+ image: "bt_dis_base.png" COMP;
+ image: "bt_dis_hilight.png" COMP;
+ image: "icon_left_arrow.png" COMP;
+ }
+ parts {
+ part { name: "button_image";
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ image {
+ normal: "bt_base2.png";
+ border: 7 7 7 7;
+ }
+ image.middle: SOLID;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "bt_base1.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_base.png";
+ border: 4 4 4 4;
+ }
+ }
+ }
+ part { name: "prev_image";
+ type: IMAGE;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 30 30;
+ max: 30 30;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ image.normal: "icon_left_arrow.png";
+ }
+ }
+ part { name: "over1";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel2.relative: 1.0 0.5;
+ image {
+ normal: "bt_hilight.png";
+ border: 7 7 7 0;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_hilight.png";
+ border: 4 4 4 0;
+ }
+ }
+ }
+ part { name: "over2";
+ mouse_events: 1;
+ repeat_events: 1;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ image {
+ normal: "bt_shine.png";
+ border: 7 7 7 7;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "over3";
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 255 255 255 0;
+ image {
+ normal: "bt_glow.png";
+ border: 12 12 12 12;
+ }
+ fill.smooth : 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "button_click";
+ signal: "mouse,down,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ after: "button_click_anim";
+ }
+ program {
+ name: "button_click_anim";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_unclick";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ after: "button_unclick_anim";
+ }
+ program {
+ name: "button_pressed_anim";
+ signal: "elm,anim,activate";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ target: "over3";
+ after: "button_unpressed_anim";
+ }
+ program {
+ name: "button_unpressed_anim";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "button_image";
+ target: "over3";
+ }
+ program {
+ name: "button_unclick_anim";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_click2";
+ signal: "mouse,down,1";
+ source: "over3";
+ action: STATE_SET "clicked" 0.0;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick2";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick3";
+ signal: "mouse,clicked,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program { name: "disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ }
+ }
///////////////////////////////////////////////////////////////////////////////
group { name: "elm/toggle/base/default";
@@ -36691,4 +36878,378 @@ collections {
}
}
}
+/////////////////////////////////////////////////////////////////////////
+ group { name:"elm/naviframe/base/default";
+ images {
+ image: "frame_1.png" COMP;
+ image: "frame_2.png" COMP;
+ image: "dia_grad.png" COMP;
+ }
+ parts {
+ part { name: "base0";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ image.normal: "dia_grad.png";
+ fill {
+ smooth: 0;
+ size {
+ relative: 0.0 1.0;
+ offset: 64 0;
+ }
+ }
+ }
+ }
+ part { name: "base1";
+ type: IMAGE;
+ description { state: "default" 0.0;
+ image {
+ normal: "frame_2.png";
+ border: 5 5 32 26;
+ middle: 0;
+ }
+ fill.smooth : 0;
+ }
+ }
+ part { name: "over";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: 4 4;
+ rel2.offset: 5 5;
+ image {
+ normal: "frame_1.png";
+ border: 2 2 28 22;
+ middle: 0;
+ }
+ fill.smooth : 0;
+ }
+ }
+ }
+ }
+ group { name:"elm/naviframe/item/basic/default";
+ parts {
+ part { name: "title_clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 1 50;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 0.0; }
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ fixed: 1 1;
+ }
+ }
+ part { name: "content_clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to_y: "title_clip";
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "content_clip";
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1.relative: 1.0 1.0;
+ rel1.to_y: "title_clip";
+ rel2.relative: 2.0 1.0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
+ }
+ description { state: "pushed" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: -1.0 1.0;
+ rel2.relative: 0.0 1.0;
+ }
+ description { state: "popped" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ rel2.relative: 2.0 1.0;
+ }
+ }
+ part { name: "elm.swallow.title";
+ type: SWALLOW;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ min: 1 50;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 0.0; }
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ fixed: 1 1;
+ }
+ }
+ }
+ programs {
+ program { name: "show";
+ signal: "elm,state,show";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "show_finished";
+ }
+ program { name: "pushed";
+ signal: "elm,state,pushed";
+ source: "elm";
+ action: STATE_SET "pushed" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "pushed_finished";
+ }
+ program { name: "popped";
+ signal: "elm,state,popped";
+ source: "elm";
+ action: STATE_SET "popped" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "popped_finished";
+ }
+ program { name: "visible";
+ signal: "elm,state,visible";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ }
+ program { name: "title_show";
+ signal: "elm,state,title,show";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "title_clip";
+ }
+ program { name: "title_hide";
+ signal: "elm,state,title,hide";
+ source: "elm";
+ action: STATE_SET "hide" 0.0;
+ target: "title_clip";
+ }
+ program { name: "show_finished";
+ action: SIGNAL_EMIT "elm,action,show,finished" "";
+ }
+ program { name: "pushed_finished";
+ action: SIGNAL_EMIT "elm,action,pushed,finished" "";
+ }
+ program { name: "popped_finished";
+ action: SIGNAL_EMIT "elm,action,popped,finished" "";
+ }
+ }
+ }
+ group { name:"elm/naviframe/item/no_transit/default";
+ parts {
+ part { name: "clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.to_y: "elm.swallow.title";
+ rel2.relative: 1.0 1.0;
+ visible: 0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "elm.swallow.title";
+ type: SWALLOW;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ min: 1 50;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 0.0; offset: 4 4; }
+ rel2 { relative: 1.0 0.0; offset: -5 -5; }
+ visible: 0;
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ fixed: 1 1;
+ }
+ }
+ }
+ programs {
+ program { name: "show";
+ signal: "elm,state,show";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ after: "show_finished";
+ }
+ program { name: "pushed";
+ signal: "elm,state,pushed";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.content";
+ after: "pushed_finished";
+ }
+ program { name: "popped";
+ signal: "elm,state,popped";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.content";
+ after: "popped_finished";
+ }
+ program { name: "visible";
+ signal: "elm,state,visible";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ }
+ program { name: "title_show";
+ signal: "elm,state,title,show";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.title";
+ }
+ program { name: "title_hide";
+ signal: "elm,state,title,hide";
+ source: "elm";
+ action: STATE_SET "hide" 0.0;
+ target: "elm.swallow.title";
+ }
+ program { name: "show_finished";
+ action: SIGNAL_EMIT "elm,action,show,finished" "";
+ }
+ program { name: "pushed_finished";
+ action: SIGNAL_EMIT "elm,action,pushed,finished" "";
+ }
+ program { name: "popped_finished";
+ action: SIGNAL_EMIT "elm,action,popped,finished" "";
+ }
+ }
+ }
+ group { name:"elm/naviframe/title/default";
+ images {
+ image: "flip_base.png" COMP;
+ image: "flip_shad.png" COMP;
+ }
+ parts {
+ part { name: "base";
+ type: IMAGE;
+ description {
+ image.normal: "flip_base.png";
+ }
+ }
+ part { name: "elm.swallow.prev_btn";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 80 40;
+ max: 80 40;
+ align: 0 0;
+ fixed: 1 1;
+ rel1.offset: 5 5;
+ rel2.offset: -1 -6;
+ }
+ }
+ part { name: "elm.swallow.next_btn";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 80 40;
+ max: 80 40;
+ align: 1 0;
+ fixed: 1 1;
+ rel1.offset: 0 5;
+ rel2.offset: -6 -6;
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 40 40;
+ max: 40 40;
+ align: 1 0.5;
+ rel1.to: "elm.text.title";
+ rel1.relative: 0 0;
+ rel2.to: "elm.text.title";
+ rel2.relative: 0 1;
+ }
+ }
+ part { name: "elm.text.title";
+ type: TEXT;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ text { font: "Sans,Edje-Vera";
+ size: 10;
+ min: 0 0;
+ max: 1 0;
+ align: 0.5 0.5;
+ }
+ color: 0 0 0 255;
+ align: 0.5 0.5;
+ }
+ }
+ part { name: "elm.text.subtitle";
+ type: TEXT;
+ scale: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ text { font: "Sans,Edje-Vera";
+ size: 8;
+ min: 0 0;
+ max: 1 0;
+ align: 0.5 1;
+ }
+ rel1.to_y: "elm.text.title";
+ rel1.relative: 0 1;
+ color: 50 50 50 255;
+ align: 0.5 0;
+ }
+ }
+ part { name: "shade";
+ type: IMAGE;
+ mouse_events: 0;
+ description {
+ align: 0.5 1;
+ rel1.to_y: "elm.text.title";
+ rel1.relative: 0 1;
+ rel1.offset: 0 0;
+ rel2.offset: -1 5;
+ image.normal: "flip_shad.png";
+ }
+ }
+ }
+ programs {
+ program {
+ name: "title_clicked";
+ signal: "mouse,clicked,1";
+ source: "base";
+ action: SIGNAL_EMIT "elm,action,clicked" "elm";
+ }
+ }
+ }
}
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index d9a2afa74..64eb99f24 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -81,6 +81,7 @@ test_list.c \
test_map.c \
test_menu.c \
test_multi.c \
+test_naviframe.c \
test_notify.c \
test_pager.c \
test_panel.c \
diff --git a/src/bin/test.c b/src/bin/test.c
index 39b9600c4..dd41f5752 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -139,6 +139,7 @@ void test_grid(void *data, Evas_Object *obj, void *event_info);
void test_glview_simple(void *data, Evas_Object *obj, void *event_info);
void test_glview(void *data, Evas_Object *obj, void *event_info);
void test_3d(void *data, Evas_Object *obj, void *event_info);
+void test_naviframe(void *data, Evas_Object *obj, void *event_info);
#ifdef HAVE_EIO
void test_eio(void *data, Evas_Object *obj, void *event_info);
#endif
@@ -416,6 +417,7 @@ my_win_main(char *autorun, Eina_Bool test_win_only)
ADD_TEST("3D", test_3d);
ADD_TEST("Genscroller", test_genscroller);
ADD_TEST("Gesture Layer", test_gesture_layer);
+ ADD_TEST("Naviframe", test_naviframe);
#undef ADD_TEST
if (autorun)
diff --git a/src/bin/test_naviframe.c b/src/bin/test_naviframe.c
new file mode 100644
index 000000000..038889d2a
--- /dev/null
+++ b/src/bin/test_naviframe.c
@@ -0,0 +1,165 @@
+#include <Elementary.h>
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#ifndef ELM_LIB_QUICKLAUNCH
+
+void
+_navi_pop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ elm_naviframe_item_pop(data);
+}
+
+void
+_title_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ printf("Title Clicked!\n");
+}
+
+void
+_title_visible(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ elm_naviframe_item_title_visible_set(data,
+ !elm_naviframe_item_title_visible_get(data));
+}
+
+void
+_page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *bt, *bt2, *ic, *nf = data;
+ char buf[PATH_MAX];
+ Elm_Naviframe_Item *it;
+
+ bt = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ ic = elm_icon_add(nf);
+ snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+ elm_button_icon_set(bt, ic);
+
+ bt2 = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(bt2, "Naviframe Test");
+
+ ic = elm_icon_add(nf);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+ it = elm_naviframe_item_push(nf,
+ "Page 4",
+ NULL,
+ bt,
+ bt2,
+ NULL);
+ elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
+ elm_naviframe_item_icon_set(it, ic);
+ elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+ evas_object_smart_callback_add(bt2, "clicked", _title_visible, it);
+}
+
+void
+_page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *bt, *bt2, *bt3, *ic, *nf = data;
+ char buf[PATH_MAX];
+ Elm_Naviframe_Item *it;
+
+ bt = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(bt, "Prev");
+ evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
+
+ bt2 = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(bt2, "Next");
+ evas_object_smart_callback_add(bt2, "clicked", _page4, nf);
+
+ bt3 = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt3, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(bt3, "Naviframe Test");
+
+ ic = elm_icon_add(nf);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+ it = elm_naviframe_item_push(nf,
+ "Page 3",
+ bt,
+ bt2,
+ bt3,
+ NULL);
+ elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
+ elm_naviframe_item_icon_set(it, ic);
+}
+
+void
+_page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *bt, *bt2, *ic, *nf = data;
+ char buf[PATH_MAX];
+ Elm_Naviframe_Item *it;
+
+ bt = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(bt, "clicked", _page3, nf);
+
+ bt2 = elm_button_add(nf);
+ evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(bt2, "Naviframe Test");
+
+ ic = elm_icon_add(nf);
+ snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+ elm_button_icon_set(bt, ic);
+
+ it = elm_naviframe_item_push(nf,
+ "Page 2",
+ NULL,
+ bt,
+ bt2,
+ NULL);
+ elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
+}
+
+void
+test_naviframe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *win, *bg, *nf, *btn;
+
+ win = elm_win_add(NULL, "naviframe", ELM_WIN_BASIC);
+ elm_win_title_set(win, "Naviframe");
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+ elm_win_autodel_set(win, 1);
+
+ bg = elm_bg_add(win);
+ elm_win_resize_object_add(win, bg);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(bg);
+
+ nf = elm_naviframe_add(win);
+ elm_win_resize_object_add(win, nf);
+ evas_object_show(nf);
+ evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
+
+ btn = elm_button_add(nf);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(btn, "clicked", _page2, nf);
+ elm_object_text_set(btn, "Naviframe Test");
+ evas_object_show(btn);
+
+ elm_naviframe_item_push(nf,
+ "Page 1",
+ NULL,
+ NULL,
+ btn,
+ NULL);
+
+ evas_object_resize(win, 400, 600);
+ evas_object_show(win);
+}
+#endif
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 9b8902eef..15a7934c5 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -7852,6 +7852,37 @@ extern "C" {
EAPI Evas_Object *elm_player_add(Evas_Object *parent);
EAPI void elm_player_video_set(Evas_Object *player, Evas_Object *video);
+ /* naviframe */
+ typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
+
+ typedef enum
+ {
+ ELM_NAVIFRAME_PREV_BUTTON,
+ ELM_NAVIFRAME_NEXT_BUTTON
+ } Elm_Naviframe_Button_Type;
+
+ EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
+ EAPI Elm_Naviframe_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_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 void elm_naviframe_item_content_set(Elm_Naviframe_Item *item, Evas_Object *content) EINA_ARG_NONNULL(1);
+ EAPI Evas_Object *elm_naviframe_item_content_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_title_label_set(Elm_Naviframe_Item *it, const char *label) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_naviframe_item_title_label_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_subtitle_label_set(Elm_Naviframe_Item *it, const char *label) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_naviframe_item_subtitle_label_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+ EAPI Elm_Naviframe_Item *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI Elm_Naviframe_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_button_set(Elm_Naviframe_Item *it, Evas_Object *btn, Elm_Naviframe_Button_Type btn_type) EINA_ARG_NONNULL(1);
+ EAPI Evas_Object *elm_naviframe_item_button_get(const Elm_Naviframe_Item *it, Elm_Naviframe_Button_Type btn_type) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon) EINA_ARG_NONNULL(1);
+ EAPI Evas_Object *elm_naviframe_item_icon_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_style_set(Elm_Naviframe_Item *it, const char *item_style) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_naviframe_item_style_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_title_visible_set(Elm_Naviframe_Item *it, Eina_Bool visible) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 33fa4f1e5..2eb636f79 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -49,6 +49,7 @@ elc_fileselector_button.c \
elc_fileselector.c \
elc_fileselector_entry.c \
elc_hoversel.c \
+elc_naviframe.c \
elc_player.c \
elc_scrolled_entry.c \
elm_actionslider.c \
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
new file mode 100644
index 000000000..0a14d7047
--- /dev/null
+++ b/src/lib/elc_naviframe.c
@@ -0,0 +1,807 @@
+#include <Elementary.h>
+#include "elm_priv.h"
+
+typedef struct _Widget_Data Widget_Data;
+
+struct _Widget_Data
+{
+ Eina_List *stack;
+ Evas_Object *base;
+ Eina_Bool preserve: 1;
+ Eina_Bool pass_events: 1;
+};
+
+struct _Elm_Naviframe_Item
+{
+ Elm_Widget_Item base;
+ Evas_Object *title;
+ Evas_Object *content;
+ const char *title_label;
+ const char *title_sublabel;
+ Evas_Object *title_prev_btn;
+ Evas_Object *title_next_btn;
+ Evas_Object *title_icon;
+ const char *style;
+ Eina_Bool back_btn: 1;
+ Eina_Bool title_visible: 1;
+};
+
+static const char *widtype = NULL;
+
+static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
+static const char SIG_TITLE_CLICKED[] = "title,clicked";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_TRANSITION_FINISHED, ""},
+ {SIG_TITLE_CLICKED, ""},
+ {NULL, NULL}
+};
+
+#define ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, ...) \
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *) it, __VA_ARGS__); \
+ ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
+
+static void _del_hook(Evas_Object *obj);
+static void _theme_hook(Evas_Object *obj);
+static void _disable_hook(Evas_Object *obj);
+static void _sizing_eval(Evas_Object *obj);
+static void _item_sizing_eval(Elm_Naviframe_Item *it);
+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);
+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);
+static void _title_icon_del(void *data,
+ Evas *e,
+ Evas_Object *obj,
+ void *event_info);
+static void _content_del(void *data,
+ Evas *e,
+ Evas_Object *obj,
+ void *event_info);
+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);
+static void _item_del(Elm_Naviframe_Item *it);
+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);
+
+static void
+_del_hook(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ Eina_List *list;
+ Elm_Naviframe_Item *it;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ EINA_LIST_FOREACH(wd->stack, list, it)
+ _item_del(it);
+ eina_list_free(wd->stack);
+ free(wd);
+}
+
+static void
+_theme_hook(Evas_Object *obj __UNUSED__)
+{
+ //FIXME:
+}
+
+static void
+_disable_hook(Evas_Object *obj __UNUSED__)
+{
+ //FIXME:
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ Eina_List *list;
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ list = eina_list_last(wd->stack);
+ if (!list) return;
+
+ _item_sizing_eval(list->data);
+}
+
+static void
+_item_sizing_eval(Elm_Naviframe_Item *it)
+{
+ Widget_Data *wd;
+ Evas_Coord x, y, w, h;
+ if (!it) return;
+
+ wd = elm_widget_data_get(it->base.widget);
+ if (!wd) return;
+
+ evas_object_geometry_get(it->base.widget, &x, &y, &w, &h);
+ evas_object_move(it->base.view, x, y);
+ evas_object_resize(it->base.view, w, h);
+}
+
+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;
+ evas_object_smart_callback_call(it->base.widget, SIG_TITLE_CLICKED, it);
+}
+
+static void
+_back_btn_clicked(void *data,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ elm_naviframe_item_pop(data);
+}
+
+static Evas_Object *
+_back_btn_new(Evas_Object *obj)
+{
+ Evas_Object *btn;
+ char buf[256]; //FIXME: How to guarantee the size of style name?
+ 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;
+}
+
+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;
+}
+
+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;
+}
+
+static void
+_title_icon_del(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Naviframe_Item *it = data;
+ it->title_icon = NULL;
+ edje_object_signal_emit(it->base.view, "elm,state,icon,hide", "elm");
+}
+
+static void
+_content_del(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Naviframe_Item *it = data;
+ it->content = NULL;
+ edje_object_signal_emit(it->base.view, "elm,state,content,hide", "elm");
+}
+
+static void
+_title_prev_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn, Eina_Bool back_btn)
+{
+ char buf[256]; //FIXME: How to guarantee the size of style name?
+
+ if (it->title_prev_btn == btn) return;
+
+ if (it->title_prev_btn)
+ evas_object_del(it->title_prev_btn);
+
+ it->title_prev_btn = btn;
+
+ if (!btn) return;
+
+ if (!back_btn)
+ {
+ snprintf(buf,
+ sizeof(buf),
+ "naviframe/prev_btn/%s",
+ elm_widget_style_get(it->base.widget));
+ elm_object_style_set(btn, buf);
+ }
+ elm_widget_sub_object_add(it->base.widget, btn);
+ evas_object_event_callback_add(btn,
+ EVAS_CALLBACK_DEL,
+ _title_prev_btn_del,
+ it);
+ edje_object_part_swallow(it->title, "elm.swallow.prev_btn", btn);
+ it->back_btn = back_btn;
+}
+
+static void
+_title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
+{
+ char buf[256]; //FIXME: How to guarantee the size of style name?
+
+ if (it->title_next_btn == btn) return;
+
+ if (it->title_next_btn)
+ evas_object_del(it->title_next_btn);
+
+ it->title_next_btn = btn;
+
+ if (!btn) return;
+
+ snprintf(buf,
+ sizeof(buf),
+ "naviframe/next_btn/%s",
+ elm_widget_style_get(it->base.widget));
+ elm_object_style_set(btn, buf);
+ elm_widget_sub_object_add(it->base.widget, btn);
+ evas_object_event_callback_add(btn,
+ EVAS_CALLBACK_DEL,
+ _title_next_btn_del,
+ it);
+ edje_object_part_swallow(it->title, "elm.swallow.next_btn", btn);
+}
+
+static void
+_item_del(Elm_Naviframe_Item *it)
+{
+ Widget_Data *wd;
+
+ if (!it) return;
+
+ wd = elm_widget_data_get(it->base.widget);
+ if (!wd) return;
+
+ if (it->title_prev_btn)
+ evas_object_del(it->title_prev_btn);
+ if (it->title_next_btn)
+ evas_object_del(it->title_next_btn);
+ if (it->title_icon)
+ evas_object_del(it->title_icon);
+ if ((it->content) && (!wd->preserve))
+ evas_object_del(it->content);
+
+ evas_object_del(it->title);
+ evas_object_del(it->base.view);
+
+ wd->stack = eina_list_remove(wd->stack, it);
+
+ free(it);
+}
+
+static void
+_pushed_finished(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Naviframe_Item *it = data;
+ if (!it) return;
+ evas_object_hide(it->base.view);
+}
+
+static void
+_popped_finished(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ _item_del(data);
+}
+
+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;
+ wd = elm_widget_data_get(it->base.widget);
+ if (!wd) return;
+
+ evas_object_smart_callback_call(it->base.widget,
+ SIG_TRANSITION_FINISHED,
+ (void *) EINA_TRUE);
+ if (wd->pass_events)
+ evas_object_pass_events_set(wd->base, EINA_FALSE);
+}
+
+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);
+
+ //base
+ wd->base = edje_object_add(e);
+ elm_widget_resize_object_set(obj, wd->base);
+ _elm_theme_object_set(obj, wd->base, "naviframe", "base", "default");
+
+ 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->pass_events = EINA_TRUE;
+
+ return obj;
+}
+
+EAPI Elm_Naviframe_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;
+
+ //create item
+ it = elm_widget_item_new(obj, Elm_Naviframe_Item);
+ if (!it)
+ {
+ ERR("Failed to allocate new item! : naviframe=%p", obj);
+ return NULL;
+ }
+ //item base layout
+ it->base.view = edje_object_add(evas_object_evas_get(obj));
+ evas_object_smart_member_add(it->base.view, wd->base);
+ elm_widget_sub_object_add(obj, it->base.view);
+ edje_object_signal_callback_add(it->base.view,
+ "elm,action,show,finished",
+ "",
+ _show_finished, it);
+ edje_object_signal_callback_add(it->base.view,
+ "elm,action,pushed,finished",
+ "",
+ _pushed_finished, it);
+ edje_object_signal_callback_add(it->base.view,
+ "elm,action,popped,finished",
+ "",
+ _popped_finished, it);
+ elm_naviframe_item_style_set(it, item_style);
+
+ //title
+ it->title = edje_object_add(evas_object_evas_get(obj));
+ elm_widget_sub_object_add(obj, it->title);
+ _elm_theme_object_set(obj,
+ it->title, "naviframe",
+ "title",
+ elm_widget_style_get(obj));
+ edje_object_signal_callback_add(it->title,
+ "elm,action,clicked",
+ "elm",
+ _title_clicked, it);
+
+ elm_naviframe_item_title_label_set(it, title_label);
+
+ //title buttons
+ if ((!prev_btn) && (eina_list_count(wd->stack)))
+ {
+ 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);
+ edje_object_part_swallow(it->base.view, "elm.swallow.title", it->title);
+
+ elm_naviframe_item_content_set(it, content);
+
+ _item_sizing_eval(it);
+ evas_object_show(it->base.view);
+
+ prev_it = elm_naviframe_top_item_get(obj);
+ if (prev_it)
+ {
+ if (wd->pass_events)
+ evas_object_pass_events_set(wd->base, EINA_TRUE);
+ edje_object_signal_emit(prev_it->base.view,
+ "elm,state,pushed",
+ "elm");
+ edje_object_signal_emit(it->base.view,
+ "elm,state,show",
+ "elm");
+ }
+ else
+ edje_object_signal_emit(it->base.view, "elm,state,visible", "elm");
+ it->title_visible = EINA_TRUE;
+ wd->stack = eina_list_append(wd->stack, it);
+ return it;
+}
+
+EAPI Evas_Object *
+elm_naviframe_item_pop(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Elm_Naviframe_Item *it, *prev_it;
+ Widget_Data *wd;
+ Evas_Object *content = NULL;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+
+ it = elm_naviframe_top_item_get(obj);
+ if (!it) return NULL;
+ wd->stack = eina_list_remove(wd->stack, it);
+
+ if (wd->preserve)
+ content = it->content;
+
+ prev_it = elm_naviframe_top_item_get(obj);
+ if (prev_it)
+ {
+ if (wd->pass_events)
+ evas_object_pass_events_set(wd->base, EINA_TRUE);
+ evas_object_show(prev_it->base.view);
+ evas_object_raise(prev_it->base.view);
+ edje_object_signal_emit(prev_it->base.view,
+ "elm,state,show",
+ "elm");
+ edje_object_signal_emit(it->base.view, "elm,state,popped", "elm");
+ }
+ else
+ _item_del(it);
+
+ return content;
+}
+
+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;
+}
+
+EAPI void
+elm_naviframe_item_content_set(Elm_Naviframe_Item *it, Evas_Object *content)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ if (it->content == content) return;
+ if (it->content) evas_object_del(it->content);
+ elm_widget_sub_object_add(it->base.widget, content);
+ edje_object_part_swallow(it->base.view, "elm.swallow.content", content);
+ if (content)
+ edje_object_signal_emit(it->base.view,
+ "elm,state,content,show",
+ "elm");
+ else
+ edje_object_signal_emit(it->base.view,
+ "elm,state,content,hide",
+ "elm");
+ evas_object_event_callback_add(content,
+ EVAS_CALLBACK_DEL,
+ _content_del,
+ it);
+ it->content = content;
+ _item_sizing_eval(it);
+}
+
+EAPI Evas_Object *
+elm_naviframe_item_content_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ return it->content;
+}
+
+EAPI void
+elm_naviframe_item_title_label_set(Elm_Naviframe_Item *it, const char *label)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ edje_object_part_text_set(it->title, "elm.text.title", label);
+ if (label)
+ edje_object_signal_emit(it->title, "elm,state,title,show", "elm");
+ else
+ edje_object_signal_emit(it->title, "elm,state,title,hidew", "elm");
+
+ eina_stringshare_replace(&it->title_label, label);
+ _item_sizing_eval(it);
+}
+
+EAPI const char *
+elm_naviframe_item_title_label_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ return it->title_label;
+}
+
+EAPI void
+elm_naviframe_item_subtitle_label_set(Elm_Naviframe_Item *it, const char *label)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ edje_object_part_text_set(it->title, "elm.text.subtitle", label);
+ if (label)
+ edje_object_signal_emit(it->title, "elm,state,subtitle,show", "elm");
+ else
+ edje_object_signal_emit(it->title, "elm,state,subtitle,hide", "elm");
+
+ eina_stringshare_replace(&it->title_sublabel, label);
+ _item_sizing_eval(it);
+}
+
+EAPI const char *
+elm_naviframe_item_subtitle_label_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ return it->title_sublabel;
+}
+
+EAPI Elm_Naviframe_Item*
+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;
+ return eina_list_last(wd->stack)->data;
+}
+
+EAPI Elm_Naviframe_Item*
+elm_naviframe_bottom_item_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ return NULL;
+}
+
+EAPI void
+elm_naviframe_item_button_set(Elm_Naviframe_Item *it, Evas_Object *btn, Elm_Naviframe_Button_Type btn_type)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ switch(btn_type)
+ {
+ case ELM_NAVIFRAME_PREV_BUTTON:
+ _title_prev_btn_set(it, btn, EINA_FALSE);
+ break;
+ case ELM_NAVIFRAME_NEXT_BUTTON:
+ _title_next_btn_set(it, btn);
+ break;
+ default:
+ WRN("Button type is invalid! : naviframe=%p", it->base.widget);
+ break;
+ }
+ _item_sizing_eval(it);
+}
+
+EAPI Evas_Object *
+elm_naviframe_item_button_get(const Elm_Naviframe_Item *it, Elm_Naviframe_Button_Type btn_type)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+
+ switch(btn_type)
+ {
+ case ELM_NAVIFRAME_PREV_BUTTON:
+ return it->title_prev_btn;
+ case ELM_NAVIFRAME_NEXT_BUTTON:
+ return it->title_next_btn;
+ default:
+ WRN("Button type is invalid! : naviframe=%p", it->base.widget);
+ break;
+ }
+ return NULL;
+}
+
+EAPI void
+elm_naviframe_item_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ Widget_Data *wd = elm_widget_data_get(it->base.widget);
+ if (!wd) return;
+
+ if (it->title_icon == icon) return;
+ if (it->title_icon) evas_object_del(it->title_icon);
+ it->title_icon = icon;
+ if (!icon)
+ {
+ edje_object_signal_emit(it->title,
+ "elm,state,icon,hide",
+ "elm");
+ return;
+ }
+ elm_widget_sub_object_add(it->base.widget, icon);
+ edje_object_part_swallow(it->title, "elm.swallow.icon", icon);
+ edje_object_signal_emit(it->title, "elm,state,icon,show", "elm");
+
+ evas_object_event_callback_add(icon, EVAS_CALLBACK_DEL, _title_icon_del, it);
+ _item_sizing_eval(it);
+}
+
+EAPI Evas_Object *
+elm_naviframe_item_icon_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ return it->title_icon;
+}
+
+EAPI void
+elm_naviframe_item_style_set(Elm_Naviframe_Item *it, const char *item_style)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ char buf[256];
+
+ if (!item_style) sprintf(buf, "item/basic");
+ else
+ {
+ if (strlen(item_style) > sizeof(buf))
+ WRN("too much long style name! : naviframe=%p", it->base.widget);
+ else
+ sprintf(buf, "item/%s", item_style);
+ }
+ _elm_theme_object_set(it->base.widget,
+ it->base.view,
+ "naviframe",
+ buf,
+ elm_widget_style_get(it->base.widget));
+}
+
+EAPI const char *
+elm_naviframe_item_style_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ return it->style;
+}
+
+EAPI void
+elm_naviframe_item_title_visible_set(Elm_Naviframe_Item *it, Eina_Bool visible)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+
+ visible = !!visible;
+ if (it->title_visible == visible) return;
+
+ if (visible)
+ edje_object_signal_emit(it->base.view, "elm,state,title,show", "elm");
+ else
+ edje_object_signal_emit(it->base.view, "elm,state,title,hide", "elm");
+
+ it->title_visible = visible;
+}
+
+EAPI Eina_Bool
+elm_naviframe_item_title_visible_get(const Elm_Naviframe_Item *it)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, EINA_FALSE);
+ return it->title_visible;
+}
+/*
+EAPI void
+elm_naviframe_extension_set(Elm_Naviframe_Item *it, const char *swallow, Evas_Object *extension)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+ Evas_Object *prev = elm_naviframe_extension_get(it, swallow);
+ if (prev) evas_object_del(prev);
+ edje_object_part_swallow(it->base.view, swallow, extension);
+ _sizing_eval(it->base.view);
+}
+
+EAPI Evas_Object *
+elm_naviframe_extension_unset(Elm_Naviframe_Item *it, const char *swallow)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ Evas_Object *part_obj;
+ part_obj = edje_object_part_swallow_get(it->base.view, swallow);
+ if (!part_obj) return NULL;
+ edje_object_part_unswallow(it->base.view, part_obj);
+ _sizing_eval(it->base.widget);
+ return part_obj;
+}
+
+EAPI Evas_Object *
+elm_naviframe_extension_get(const Elm_Naviframe_Item *it, const char *swallow)
+{
+ ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
+ Evas_Object *part_obj;
+ part_obj = edje_object_part_swallow_get(it->base.view, swallow);
+ return part_obj;
+}
+
+EAPI void
+elm_naviframe_item_promote(Elm_Naviframe_Item *it)
+{
+}
+
+EAPI void
+elm_naviframe_to_item_pop(Elm_Naviframe_Item *it)
+{
+}
+
+
+EAPI void
+elm_naviframe_extension_visible_set(Elm_Naviframe_Item *it, Eina_Bool visible)
+{
+}
+
+EAPI Eina_Bool
+elm_naviframe_extension_visible_get(const Elm_Naviframe_Item *it)
+{
+}
+*/