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);
37 _title_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
39 printf("Title Clicked!\n");
43 _title_visible(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
45 elm_naviframe_item_title_visible_set(data,
46 !elm_naviframe_item_title_visible_get(data));
50 _page5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
52 Evas_Object *bt, *content, *nf = data;
55 bt = elm_button_add(nf);
56 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
57 elm_object_text_set(bt, "Prev");
59 content = _content_new(nf, img5);
60 it = elm_naviframe_item_insert_after(elm_naviframe_top_item_get(nf),
67 evas_object_smart_callback_add(bt, "clicked", _navi_it_del, it);
71 _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
73 Evas_Object *bt, *ic, *content, *nf = data;
77 ic = elm_icon_add(nf);
78 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png",
79 elm_app_data_dir_get());
80 elm_icon_file_set(ic, buf, NULL);
81 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
83 bt = elm_button_add(nf);
84 evas_object_smart_callback_add(bt, "clicked", _page5, nf);
85 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
86 elm_object_part_content_set(bt, "icon", ic);
88 content = _content_new(nf, img4);
90 it = elm_naviframe_item_push(nf,
96 ic = elm_icon_add(nf);
97 snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
98 elm_app_data_dir_get());
99 elm_icon_file_set(ic, buf, NULL);
100 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
101 elm_object_item_content_part_set(it, "icon", ic);
102 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
103 evas_object_smart_callback_add(content, "clicked", _title_visible, it);
107 _page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
109 Evas_Object *bt, *bt2, *ic, *content, *nf = data;
113 bt = elm_button_add(nf);
114 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
115 elm_object_text_set(bt, "Prev");
116 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
118 bt2 = elm_button_add(nf);
119 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
120 elm_object_text_set(bt2, "Next");
121 evas_object_smart_callback_add(bt2, "clicked", _page4, nf);
123 content = _content_new(nf, img3);
125 it = elm_naviframe_item_push(nf,
131 ic = elm_icon_add(nf);
132 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
133 elm_icon_file_set(ic, buf, NULL);
134 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
136 elm_object_item_content_part_set(it, "icon", ic);
140 _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
142 Evas_Object *bt, *content, *ic, *nf = data;
146 bt = elm_button_add(nf);
147 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
148 evas_object_smart_callback_add(bt, "clicked", _page3, nf);
150 ic = elm_icon_add(nf);
151 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png",
152 elm_app_data_dir_get());
153 elm_icon_file_set(ic, buf, NULL);
154 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
155 elm_object_part_content_set(bt, "icon", ic);
157 content = _content_new(nf, img2);
159 it = elm_naviframe_item_push(nf, "Page 2", NULL, bt, content, NULL);
160 elm_object_item_text_part_set(it, "subtitle", "Here is sub-title part!");
164 test_naviframe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
166 Evas_Object *win, *bg, *nf, *btn, *content;
168 win = elm_win_add(NULL, "naviframe", ELM_WIN_BASIC);
169 elm_win_title_set(win, "Naviframe");
170 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
171 elm_win_autodel_set(win, EINA_TRUE);
173 bg = elm_bg_add(win);
174 elm_win_resize_object_add(win, bg);
175 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
176 evas_object_show(bg);
178 nf = elm_naviframe_add(win);
179 elm_win_resize_object_add(win, nf);
180 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
181 evas_object_show(nf);
182 evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
184 btn = elm_button_add(nf);
185 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
186 evas_object_smart_callback_add(btn, "clicked", _page2, nf);
187 elm_object_text_set(btn, "Next");
188 evas_object_show(btn);
190 content = _content_new(nf, img1);
191 elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
193 evas_object_resize(win, 400, 600);
194 evas_object_show(win);