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, EINA_TRUE);
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, EINA_TRUE);
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_homogeneous_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_entry_add(win);
274 elm_entry_scrollable_set(en, EINA_TRUE);
275 elm_entry_line_wrap_set(en, EINA_FALSE);
276 snprintf(buf, sizeof(buf),
277 "This is an entry widget in this window that<br>"
278 "uses markup <b>like this</> for styling and<br>"
279 "formatting <em>like this</>, as well as<br>"
280 "<a href=X><link>links in the text</></a>, so enter text<br>"
281 "in here to edit it. By the way, links are<br>"
282 "called <a href=anc-02>Anchors</a> so you will need<br>"
283 "to refer to them this way.<br>"
286 "Also you can stick in items with (relsize + ascent): "
287 "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
289 "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
292 "Also (size + ascent): "
293 "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
295 "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
298 "And as well (absize + ascent): "
299 "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
301 "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
302 " or even paths to image files on disk too like: "
303 "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
307 elm_entry_entry_set(en, buf);
308 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
309 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
311 elm_flip_content_back_set(fl, en);
312 evas_object_show(en);
314 evas_object_show(fl);
316 bx2 = elm_box_add(win);
317 elm_box_horizontal_set(bx2, EINA_TRUE);
318 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
319 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
321 bt = elm_button_add(win);
322 elm_button_label_set(bt, "1");
323 evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
324 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
325 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
326 elm_box_pack_end(bx2, bt);
327 evas_object_show(bt);
329 bt = elm_button_add(win);
330 elm_button_label_set(bt, "2");
331 evas_object_smart_callback_add(bt, "clicked", my_fl_2, fl);
332 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
333 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
334 elm_box_pack_end(bx2, bt);
335 evas_object_show(bt);
337 bt = elm_button_add(win);
338 elm_button_label_set(bt, "3");
339 evas_object_smart_callback_add(bt, "clicked", my_fl_3, fl);
340 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
341 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
342 elm_box_pack_end(bx2, bt);
343 evas_object_show(bt);
345 bt = elm_button_add(win);
346 elm_button_label_set(bt, "4");
347 evas_object_smart_callback_add(bt, "clicked", my_fl_4, fl);
348 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
349 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
350 elm_box_pack_end(bx2, bt);
351 evas_object_show(bt);
353 bt = elm_button_add(win);
354 elm_button_label_set(bt, "5");
355 evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
356 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
357 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
358 elm_box_pack_end(bx2, bt);
359 evas_object_show(bt);
361 bt = elm_button_add(win);
362 elm_button_label_set(bt, "6");
363 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
364 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
365 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
366 elm_box_pack_end(bx2, bt);
367 evas_object_show(bt);
369 elm_box_pack_end(bx, bx2);
370 evas_object_show(bx2);
372 evas_object_resize(win, 320, 480);
373 evas_object_show(win);
377 test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
379 Evas_Object *win, *bg, *bx, *bx2, *fl, *fl_f, *fl_b, *o, *bt, *fr;
382 win = elm_win_add(NULL, "flip3", ELM_WIN_BASIC);
383 elm_win_title_set(win, "Flip Flip");
384 elm_win_autodel_set(win, 1);
386 bg = elm_bg_add(win);
387 elm_win_resize_object_add(win, bg);
388 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
389 evas_object_show(bg);
391 bx = elm_box_add(win);
392 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
393 elm_win_resize_object_add(win, bx);
394 evas_object_show(bx);
396 fl = elm_flip_add(win);
397 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
398 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
399 elm_box_pack_end(bx, fl);
400 evas_object_show(fl);
402 fr = elm_frame_add(win);
403 elm_frame_label_set(fr, "Front");
404 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
405 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
406 elm_flip_content_front_set(fl, fr);
407 evas_object_show(fr);
409 fl_f = elm_flip_add(win);
410 evas_object_size_hint_align_set(fl_f, EVAS_HINT_FILL, EVAS_HINT_FILL);
411 evas_object_size_hint_weight_set(fl_f, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
412 elm_frame_content_set(fr, fl_f);
413 evas_object_show(fl_f);
416 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
417 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
418 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_01.jpg");
419 elm_bg_file_set(o, buf, NULL);
420 elm_flip_content_front_set(fl_f, o);
424 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
425 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
426 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_02.jpg");
427 elm_bg_file_set(o, buf, NULL);
428 elm_flip_content_back_set(fl_f, o);
431 fr = elm_frame_add(win);
432 elm_frame_label_set(fr, "Back");
433 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
434 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
435 elm_flip_content_back_set(fl, fr);
436 evas_object_show(fr);
438 fl_b = elm_flip_add(win);
439 evas_object_size_hint_align_set(fl_b, EVAS_HINT_FILL, EVAS_HINT_FILL);
440 evas_object_size_hint_weight_set(fl_b, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
441 elm_frame_content_set(fr, fl_b);
442 evas_object_show(fl_b);
445 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
446 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
447 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_03.jpg");
448 elm_bg_file_set(o, buf, NULL);
449 elm_flip_content_front_set(fl_b, o);
453 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
454 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
455 snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, "sky_04.jpg");
456 elm_bg_file_set(o, buf, NULL);
457 elm_flip_content_back_set(fl_b, o);
460 bx2 = elm_box_add(win);
461 elm_box_horizontal_set(bx2, EINA_TRUE);
462 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
463 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
465 bt = elm_button_add(win);
466 elm_button_label_set(bt, "Main Flip");
467 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl);
468 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
469 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
470 elm_box_pack_end(bx2, bt);
471 evas_object_show(bt);
473 bt = elm_button_add(win);
474 elm_button_label_set(bt, "Front Flip");
475 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl_f);
476 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
477 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
478 elm_box_pack_end(bx2, bt);
479 evas_object_show(bt);
481 bt = elm_button_add(win);
482 elm_button_label_set(bt, "Back Flip");
483 evas_object_smart_callback_add(bt, "clicked", my_fl_6, fl_b);
484 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
485 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
486 elm_box_pack_end(bx2, bt);
487 evas_object_show(bt);
489 elm_box_pack_end(bx, bx2);
490 evas_object_show(bx2);
492 evas_object_resize(win, 320, 480);
493 evas_object_show(win);
498 my_fl_go(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
500 Evas_Object *win = data;
501 Evas_Object *fl = evas_object_data_get(win, "fl");
502 elm_flip_go(fl, ELM_FLIP_PAGE_LEFT);
506 my_fl_ch(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
508 Evas_Object *win = data;
509 Evas_Object *fl = evas_object_data_get(win, "fl");
510 Evas_Object *rdg = evas_object_data_get(win, "rdg");
511 elm_flip_interaction_set(fl, elm_radio_value_get(rdg));
515 test_flip4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
517 Evas_Object *win, *bg, *bx, *fl, *im, *li, *bt, *rd, *rdg;
520 win = elm_win_add(NULL, "flip4", ELM_WIN_BASIC);
521 elm_win_title_set(win, "Flip Interactive");
522 elm_win_autodel_set(win, 1);
524 bg = elm_bg_add(win);
525 elm_win_resize_object_add(win, bg);
526 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
527 evas_object_show(bg);
529 bx = elm_box_add(win);
530 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
531 elm_win_resize_object_add(win, bx);
532 evas_object_show(bx);
534 fl = elm_flip_add(win);
535 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
536 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
537 elm_box_pack_end(bx, fl);
538 evas_object_data_set(win, "fl", fl);
540 elm_flip_interaction_set(fl, ELM_FLIP_INTERACTION_NONE);
541 elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_UP, EINA_TRUE);
542 elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_DOWN, EINA_TRUE);
543 elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_LEFT, EINA_TRUE);
544 elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_RIGHT, EINA_TRUE);
545 elm_flip_interacton_direction_hitsize_set(fl, ELM_FLIP_DIRECTION_UP, 0.25);
546 elm_flip_interacton_direction_hitsize_set(fl, ELM_FLIP_DIRECTION_DOWN, 0.25);
547 elm_flip_interacton_direction_hitsize_set(fl, ELM_FLIP_DIRECTION_LEFT, 0.25);
548 elm_flip_interacton_direction_hitsize_set(fl, ELM_FLIP_DIRECTION_RIGHT, 0.25);
549 evas_object_show(fl);
551 im = evas_object_image_filled_add(evas_object_evas_get(win));
552 evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
553 snprintf(buf, sizeof(buf), "%s/images/%s",
554 PACKAGE_DATA_DIR, "twofish.jpg");
555 evas_object_image_file_set(im, buf, NULL);
556 elm_flip_content_front_set(fl, im);
557 evas_object_show(im);
560 im = evas_object_image_filled_add(evas_object_evas_get(win));
561 evas_object_size_hint_weight_set(im, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
562 snprintf(buf, sizeof(buf), "%s/images/%s",
563 PACKAGE_DATA_DIR, "sky_04.jpg");
564 evas_object_image_file_set(im, buf, NULL);
565 elm_flip_content_back_set(fl, im);
566 evas_object_show(im);
568 li = elm_list_add(win);
569 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
570 elm_list_item_append(li, "Item 0", NULL, NULL, NULL, NULL);
571 elm_list_item_append(li, "Item 1", NULL, NULL, NULL, NULL);
572 elm_list_item_append(li, "Item 2", NULL, NULL, NULL, NULL);
573 elm_list_item_append(li, "Item 3 (Which is very long just for testing purposes)", NULL, NULL, NULL, NULL);
575 elm_flip_content_back_set(fl, li);
576 evas_object_show(li);
579 rd = elm_radio_add(win);
580 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
581 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
582 elm_radio_state_value_set(rd, ELM_FLIP_INTERACTION_NONE);
583 elm_radio_label_set(rd, "None");
584 elm_box_pack_end(bx, rd);
585 evas_object_show(rd);
586 evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
588 evas_object_data_set(win, "rdg", rdg);
590 rd = elm_radio_add(win);
591 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
592 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
593 elm_radio_state_value_set(rd, ELM_FLIP_INTERACTION_ROTATE);
594 elm_radio_label_set(rd, "Rotate");
595 elm_radio_group_add(rd, rdg);
596 elm_box_pack_end(bx, rd);
597 evas_object_show(rd);
598 evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
600 rd = elm_radio_add(win);
601 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
602 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
603 elm_radio_state_value_set(rd, ELM_FLIP_INTERACTION_CUBE);
604 elm_radio_label_set(rd, "Cube");
605 elm_radio_group_add(rd, rdg);
606 elm_box_pack_end(bx, rd);
607 evas_object_show(rd);
608 evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
610 rd = elm_radio_add(win);
611 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
612 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
613 elm_radio_state_value_set(rd, ELM_FLIP_INTERACTION_PAGE);
614 elm_radio_label_set(rd, "Page");
615 elm_radio_group_add(rd, rdg);
616 elm_box_pack_end(bx, rd);
617 evas_object_show(rd);
618 evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
620 bt = elm_button_add(win);
621 elm_button_label_set(bt, "Go");
622 evas_object_smart_callback_add(bt, "clicked", my_fl_go, win);
623 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
624 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
625 elm_box_pack_end(bx, bt);
626 evas_object_show(bt);
628 evas_object_resize(win, 320, 480);
629 evas_object_show(win);