1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
8 my_fl_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
10 Evas_Object *fl = data;
11 elm_flip_go(fl, ELM_FLIP_ROTATE_Y_CENTER_AXIS);
15 my_fl_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
17 Evas_Object *fl = data;
18 elm_flip_go(fl, ELM_FLIP_ROTATE_X_CENTER_AXIS);
22 my_fl_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
24 Evas_Object *fl = data;
25 elm_flip_go(fl, ELM_FLIP_ROTATE_XZ_CENTER_AXIS);
29 my_fl_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
31 Evas_Object *fl = data;
32 elm_flip_go(fl, ELM_FLIP_ROTATE_YZ_CENTER_AXIS);
36 my_fl_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
38 Evas_Object *fl = data;
39 elm_flip_go(fl, ELM_FLIP_CUBE_LEFT);
43 my_fl_6(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
45 Evas_Object *fl = data;
46 elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT);
50 my_fl_7(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
52 Evas_Object *fl = data;
53 elm_flip_go(fl, ELM_FLIP_CUBE_UP);
57 my_fl_8(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
59 Evas_Object *fl = data;
60 elm_flip_go(fl, ELM_FLIP_CUBE_DOWN);
64 test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
66 Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *ly;
69 win = elm_win_add(NULL, "flip", ELM_WIN_BASIC);
70 elm_win_title_set(win, "Flip");
71 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
72 elm_win_autodel_set(win, 1);
75 elm_win_resize_object_add(win, bg);
76 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
79 bx = elm_box_add(win);
80 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
81 elm_win_resize_object_add(win, bx);
84 fl = elm_flip_add(win);
85 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
86 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
87 elm_box_pack_end(bx, fl);
90 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
91 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
92 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_01.jpg");
93 elm_bg_file_set(o, buf, NULL);
94 elm_flip_content_front_set(fl, o);
97 ly = elm_layout_add(win);
98 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
99 elm_layout_file_set(ly, buf, "layout");
100 evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
101 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
102 elm_flip_content_back_set(fl, ly);
103 evas_object_show(ly);
105 bt = elm_button_add(win);
106 elm_button_label_set(bt, "Button 1");
107 elm_layout_content_set(ly, "element1", bt);
108 evas_object_show(bt);
110 bt = elm_button_add(win);
111 elm_button_label_set(bt, "Button 2");
112 elm_layout_content_set(ly, "element2", bt);
113 evas_object_show(bt);
115 bt = elm_button_add(win);
116 elm_button_label_set(bt, "Button 3");
117 elm_layout_content_set(ly, "element3", bt);
118 evas_object_show(bt);
120 evas_object_show(fl);
122 bx2 = elm_box_add(win);
123 elm_box_horizontal_set(bx2, 1);
124 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
125 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
127 bt = elm_button_add(win);
128 elm_button_label_set(bt, "1");
129 evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
130 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
131 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
132 elm_box_pack_end(bx2, bt);
133 evas_object_show(bt);
135 bt = elm_button_add(win);
136 elm_button_label_set(bt, "2");
137 evas_object_smart_callback_add(bt, "clicked", my_fl_2, fl);
138 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
139 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
140 elm_box_pack_end(bx2, bt);
141 evas_object_show(bt);
143 bt = elm_button_add(win);
144 elm_button_label_set(bt, "3");
145 evas_object_smart_callback_add(bt, "clicked", my_fl_3, fl);
146 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
147 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
148 elm_box_pack_end(bx2, bt);
149 evas_object_show(bt);
151 bt = elm_button_add(win);
152 elm_button_label_set(bt, "4");
153 evas_object_smart_callback_add(bt, "clicked", my_fl_4, fl);
154 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
155 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
156 elm_box_pack_end(bx2, bt);
157 evas_object_show(bt);
159 elm_box_pack_end(bx, bx2);
160 evas_object_show(bx2);
162 bx2 = elm_box_add(win);
163 elm_box_horizontal_set(bx2, 1);
164 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
165 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
167 bt = elm_button_add(win);
168 elm_button_label_set(bt, "5");
169 evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
170 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
171 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
172 elm_box_pack_end(bx2, bt);
173 evas_object_show(bt);
175 bt = elm_button_add(win);
176 elm_button_label_set(bt, "6");
177 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
178 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
179 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
180 elm_box_pack_end(bx2, bt);
181 evas_object_show(bt);
183 bt = elm_button_add(win);
184 elm_button_label_set(bt, "7");
185 evas_object_smart_callback_add(bt, "clicked", my_fl_7, fl);
186 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
187 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
188 elm_box_pack_end(bx2, bt);
189 evas_object_show(bt);
191 bt = elm_button_add(win);
192 elm_button_label_set(bt, "8");
193 evas_object_smart_callback_add(bt, "clicked", my_fl_8, fl);
194 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
195 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
196 elm_box_pack_end(bx2, bt);
197 evas_object_show(bt);
199 elm_box_pack_end(bx, bx2);
200 evas_object_show(bx2);
202 evas_object_resize(win, 320, 480);
203 evas_object_show(win);
207 test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
209 Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *tb, *li, *en;
212 win = elm_win_add(NULL, "flip2", ELM_WIN_BASIC);
213 elm_win_title_set(win, "Flip 2");
214 elm_win_autodel_set(win, 1);
216 bg = elm_bg_add(win);
217 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_01.jpg");
218 elm_bg_file_set(bg, buf, NULL);
219 elm_win_resize_object_add(win, bg);
220 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
221 evas_object_show(bg);
223 bx = elm_box_add(win);
224 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
225 elm_win_resize_object_add(win, bx);
226 evas_object_show(bx);
228 fl = elm_flip_add(win);
229 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
230 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
231 elm_box_pack_end(bx, fl);
233 o = elm_box_add(win);
234 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
235 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
237 tb = elm_toolbar_add(win);
238 elm_toolbar_homogenous_set(tb, 0);
239 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
240 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
242 elm_toolbar_item_append(tb, "arrow_left", "Hello", NULL, NULL);
243 elm_toolbar_item_append(tb, "arrow_right", "Out", NULL, NULL);
244 elm_toolbar_item_append(tb, "home", "There", NULL, NULL);
245 elm_toolbar_item_append(tb, "refresh", "World", NULL, NULL);
247 elm_box_pack_end(o, tb);
248 evas_object_show(tb);
250 li = elm_list_add(win);
251 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
252 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
254 elm_list_item_append(li, "This is a list", NULL, NULL, NULL, NULL);
255 elm_list_item_append(li, "Second item", NULL, NULL, NULL, NULL);
256 elm_list_item_append(li, "3rd", NULL, NULL, NULL, NULL);
257 elm_list_item_append(li, "Fourth", NULL, NULL, NULL, NULL);
258 elm_list_item_append(li, "Number five is alive!", NULL, NULL, NULL, NULL);
259 elm_list_item_append(li, "The quick brown fox jumps over the lazy dog", NULL, NULL, NULL, NULL);
260 elm_list_item_append(li, "Booyah", NULL, NULL, NULL, NULL);
261 elm_list_item_append(li, "And another item", NULL, NULL, NULL, NULL);
262 elm_list_item_append(li, "More of them", NULL, NULL, NULL, NULL);
263 elm_list_item_append(li, "Get with it", NULL, NULL, NULL, NULL);
267 elm_box_pack_end(o, li);
268 evas_object_show(li);
270 elm_flip_content_front_set(fl, o);
273 en = elm_scrolled_entry_add(win);
274 elm_scrolled_entry_line_wrap_set(en, EINA_FALSE);
275 snprintf(buf, sizeof(buf),
276 "This is an entry widget in this window that<br>"
277 "uses markup <b>like this</> for styling and<br>"
278 "formatting <em>like this</>, as well as<br>"
279 "<a href=X><link>links in the text</></a>, so enter text<br>"
280 "in here to edit it. By the way, links are<br>"
281 "called <a href=anc-02>Anchors</a> so you will need<br>"
282 "to refer to them this way.<br>"
285 "Also you can stick in items with (relsize + ascent): "
286 "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
288 "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
291 "Also (size + ascent): "
292 "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
294 "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
297 "And as well (absize + ascent): "
298 "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
300 "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
301 " or even paths to image files on disk too like: "
302 "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
306 elm_scrolled_entry_entry_set(en, buf);
307 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
308 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
310 elm_flip_content_back_set(fl, en);
311 evas_object_show(en);
313 evas_object_show(fl);
315 bx2 = elm_box_add(win);
316 elm_box_horizontal_set(bx2, 1);
317 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
318 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
320 bt = elm_button_add(win);
321 elm_button_label_set(bt, "1");
322 evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
323 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
324 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
325 elm_box_pack_end(bx2, bt);
326 evas_object_show(bt);
328 bt = elm_button_add(win);
329 elm_button_label_set(bt, "2");
330 evas_object_smart_callback_add(bt, "clicked", my_fl_2, fl);
331 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
332 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
333 elm_box_pack_end(bx2, bt);
334 evas_object_show(bt);
336 bt = elm_button_add(win);
337 elm_button_label_set(bt, "3");
338 evas_object_smart_callback_add(bt, "clicked", my_fl_3, fl);
339 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
340 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
341 elm_box_pack_end(bx2, bt);
342 evas_object_show(bt);
344 bt = elm_button_add(win);
345 elm_button_label_set(bt, "4");
346 evas_object_smart_callback_add(bt, "clicked", my_fl_4, fl);
347 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
348 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
349 elm_box_pack_end(bx2, bt);
350 evas_object_show(bt);
352 bt = elm_button_add(win);
353 elm_button_label_set(bt, "5");
354 evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
355 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
356 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
357 elm_box_pack_end(bx2, bt);
358 evas_object_show(bt);
360 bt = elm_button_add(win);
361 elm_button_label_set(bt, "6");
362 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
363 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
364 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
365 elm_box_pack_end(bx2, bt);
366 evas_object_show(bt);
368 elm_box_pack_end(bx, bx2);
369 evas_object_show(bx2);
371 evas_object_resize(win, 320, 480);
372 evas_object_show(win);
376 test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
378 Evas_Object *win, *bg, *bx, *bx2, *fl, *fl_f, *fl_b, *o, *bt, *fr;
381 win = elm_win_add(NULL, "flip flip", ELM_WIN_BASIC);
382 elm_win_title_set(win, "Flip Flip");
383 elm_win_autodel_set(win, 1);
385 bg = elm_bg_add(win);
386 elm_win_resize_object_add(win, bg);
387 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
388 evas_object_show(bg);
390 bx = elm_box_add(win);
391 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
392 elm_win_resize_object_add(win, bx);
393 evas_object_show(bx);
395 fl = elm_flip_add(win);
396 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
397 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
398 elm_box_pack_end(bx, fl);
399 evas_object_show(fl);
401 fr = elm_frame_add(win);
402 elm_frame_label_set(fr, "Front");
403 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
404 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
405 elm_flip_content_front_set(fl, fr);
406 evas_object_show(fr);
408 fl_f = elm_flip_add(win);
409 evas_object_size_hint_align_set(fl_f, EVAS_HINT_FILL, EVAS_HINT_FILL);
410 evas_object_size_hint_weight_set(fl_f, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
411 elm_frame_content_set(fr, fl_f);
412 evas_object_show(fl_f);
415 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
416 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
417 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_01.jpg");
418 elm_bg_file_set(o, buf, NULL);
419 elm_flip_content_front_set(fl_f, o);
423 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
424 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
425 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_02.jpg");
426 elm_bg_file_set(o, buf, NULL);
427 elm_flip_content_back_set(fl_f, o);
430 fr = elm_frame_add(win);
431 elm_frame_label_set(fr, "Back");
432 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
433 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
434 elm_flip_content_back_set(fl, fr);
435 evas_object_show(fr);
437 fl_b = elm_flip_add(win);
438 evas_object_size_hint_align_set(fl_b, EVAS_HINT_FILL, EVAS_HINT_FILL);
439 evas_object_size_hint_weight_set(fl_b, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
440 elm_frame_content_set(fr, fl_b);
441 evas_object_show(fl_b);
444 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
445 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
446 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_03.jpg");
447 elm_bg_file_set(o, buf, NULL);
448 elm_flip_content_front_set(fl_b, o);
452 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
453 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
454 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_04.jpg");
455 elm_bg_file_set(o, buf, NULL);
456 elm_flip_content_back_set(fl_b, o);
459 bx2 = elm_box_add(win);
460 elm_box_horizontal_set(bx2, 1);
461 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
462 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
464 bt = elm_button_add(win);
465 elm_button_label_set(bt, "Main Flip");
466 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
467 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
468 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
469 elm_box_pack_end(bx2, bt);
470 evas_object_show(bt);
472 bt = elm_button_add(win);
473 elm_button_label_set(bt, "Front Flip");
474 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl_f);
475 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
476 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
477 elm_box_pack_end(bx2, bt);
478 evas_object_show(bt);
480 bt = elm_button_add(win);
481 elm_button_label_set(bt, "Back Flip");
482 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl_b);
483 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
484 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
485 elm_box_pack_end(bx2, bt);
486 evas_object_show(bt);
488 elm_box_pack_end(bx, bx2);
489 evas_object_show(bx2);
491 evas_object_resize(win, 320, 480);
492 evas_object_show(win);