1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 static const char *img1 = PACKAGE_DATA_DIR"/images/logo.png";
8 static const char *img2 = PACKAGE_DATA_DIR"/images/plant_01.jpg";
9 static const char *img3 = PACKAGE_DATA_DIR"/images/rock_01.jpg";
10 static const char *img4 = PACKAGE_DATA_DIR"/images/rock_02.jpg";
11 static const char *img5 = PACKAGE_DATA_DIR"/images/sky_01.jpg";
14 _content_new(Evas_Object *parent, const char *img)
16 Evas_Object *photo = elm_photo_add(parent);
17 elm_photo_file_set(photo, img);
18 elm_photo_fill_inside_set(photo, EINA_TRUE);
19 elm_object_style_set(photo, "shadow");
24 _navi_pop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
26 elm_naviframe_item_pop(data);
30 _navi_it_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
32 elm_naviframe_item_del(data);
36 _title_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
38 printf("Title Clicked!\n");
42 _title_visible(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
44 elm_naviframe_item_title_visible_set(data,
45 !elm_naviframe_item_title_visible_get(data));
49 _promote(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
51 elm_naviframe_item_promote(data);
55 _page5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
57 Evas_Object *bt, *bt2, *content, *nf = data;
60 bt = elm_button_add(nf);
61 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
62 elm_object_text_set(bt, "Prev");
64 bt2 = elm_button_add(nf);
65 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
66 elm_object_text_set(bt2, "Page 1");
67 evas_object_smart_callback_add(bt2, "clicked", _promote,
68 evas_object_data_get(nf, "page1"));
70 content = _content_new(nf, img5);
71 it = elm_naviframe_item_insert_after(elm_naviframe_top_item_get(nf),
78 evas_object_smart_callback_add(bt, "clicked", _navi_it_del, it);
82 _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
84 Evas_Object *bt, *ic, *content, *nf = data;
88 ic = elm_icon_add(nf);
89 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png",
90 elm_app_data_dir_get());
91 elm_icon_file_set(ic, buf, NULL);
92 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
94 bt = elm_button_add(nf);
95 evas_object_smart_callback_add(bt, "clicked", _page5, nf);
96 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
97 elm_object_part_content_set(bt, "icon", ic);
99 content = _content_new(nf, img4);
101 it = elm_naviframe_item_push(nf,
108 ic = elm_icon_add(nf);
109 snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
110 elm_app_data_dir_get());
111 elm_icon_file_set(ic, buf, NULL);
112 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
113 elm_object_item_part_content_set(it, "icon", ic);
114 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
115 evas_object_smart_callback_add(content, "clicked", _title_visible, it);
119 _page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
121 Evas_Object *bt, *bt2, *ic, *content, *nf = data;
125 bt = elm_button_add(nf);
126 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
127 elm_object_text_set(bt, "Prev");
128 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
130 bt2 = elm_button_add(nf);
131 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
132 elm_object_text_set(bt2, "Next");
133 evas_object_smart_callback_add(bt2, "clicked", _page4, nf);
135 content = _content_new(nf, img3);
137 it = elm_naviframe_item_push(nf,
143 ic = elm_icon_add(nf);
144 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
145 elm_icon_file_set(ic, buf, NULL);
146 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
148 elm_object_item_part_content_set(it, "icon", ic);
152 _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
154 Evas_Object *bt, *content, *ic, *nf = data;
158 bt = elm_button_add(nf);
159 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
160 evas_object_smart_callback_add(bt, "clicked", _page3, nf);
162 ic = elm_icon_add(nf);
163 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png",
164 elm_app_data_dir_get());
165 elm_icon_file_set(ic, buf, NULL);
166 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
167 elm_object_part_content_set(bt, "icon", ic);
169 content = _content_new(nf, img2);
171 it = elm_naviframe_item_push(nf, "Page 2", NULL, bt, content, NULL);
172 elm_object_item_part_text_set(it, "subtitle", "Here is sub-title part!");
176 test_naviframe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
178 Evas_Object *win, *bg, *nf, *btn, *content;
181 win = elm_win_add(NULL, "naviframe", ELM_WIN_BASIC);
182 elm_win_title_set(win, "Naviframe");
183 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
184 elm_win_autodel_set(win, EINA_TRUE);
186 bg = elm_bg_add(win);
187 elm_win_resize_object_add(win, bg);
188 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
189 evas_object_show(bg);
191 nf = elm_naviframe_add(win);
192 elm_win_resize_object_add(win, nf);
193 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
194 evas_object_show(nf);
195 evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
197 btn = elm_button_add(nf);
198 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
199 evas_object_smart_callback_add(btn, "clicked", _page2, nf);
200 elm_object_text_set(btn, "Next");
201 evas_object_show(btn);
203 content = _content_new(nf, img1);
204 it = elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
205 evas_object_data_set(nf, "page1", it);
207 evas_object_resize(win, 400, 600);
208 evas_object_show(win);