1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 static const char *names[] =
15 _del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
17 Evas_Object *win = data;
18 Ecore_Animator *ani = evas_object_data_get(win, "animator");
20 ecore_animator_del(ani);
26 Evas_Object *win = data;
27 Evas_Object *bub, *sh;
28 Evas_Coord x, y, w, h, vw, vh;
29 double t, xx, yy, zz, r, fac;
33 evas_output_viewport_get(evas_object_evas_get(win), 0, 0, &vw, &vh);
35 t = ecore_loop_time_get();
36 fac = 2.0 / (double)((sizeof(names) / sizeof(char *) / 2));
37 evas_pointer_canvas_xy_get(evas_object_evas_get(win), &x, &y);
41 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
43 bub = evas_object_data_get(win, names[i * 2]);
44 sh = evas_object_data_get(win, names[(i * 2) + 1]);
45 zz = (((2 + sin(t * 6 + (M_PI * (i * fac)))) / 3) * 64) * 2;
46 xx = (cos(t * 4 + (M_PI * (i * fac))) * r) * 2;
47 yy = (sin(t * 6 + (M_PI * (i * fac))) * r) * 2;
51 x = (vw / 2) + xx - (w / 2);
52 y = (vh / 2) + yy - (h / 2);
54 evas_object_move(bub, x, y);
55 evas_object_resize(bub, w, h);
57 x = x - ((lx - (x + (w / 2))) / 4);
58 y = y - ((ly - (y + (h / 2))) / 4);
60 evas_object_move(sh, x, y);
61 evas_object_resize(sh, w, h);
63 return ECORE_CALLBACK_RENEW;
67 test_anim(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
69 Evas_Object *win, *bg, *bub, *sh;
74 win = elm_win_add(NULL, "animation", ELM_WIN_BASIC);
75 elm_win_title_set(win, "Animation");
76 elm_win_autodel_set(win, EINA_TRUE);
79 snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", elm_app_data_dir_get());
80 elm_bg_file_set(bg, buf, NULL);
81 elm_win_resize_object_add(win, bg);
82 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
85 snprintf(buf, sizeof(buf), "%s/images/bubble_sh.png", elm_app_data_dir_get());
86 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
88 sh = evas_object_image_filled_add(evas_object_evas_get(win));
89 evas_object_image_file_set(sh, buf, NULL);
90 evas_object_resize(sh, 64, 64);
92 evas_object_data_set(win, names[(i * 2) + 1], sh);
95 snprintf(buf, sizeof(buf), "%s/images/bubble.png", elm_app_data_dir_get());
96 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
98 bub = evas_object_image_filled_add(evas_object_evas_get(win));
99 evas_object_image_file_set(bub, buf, NULL);
100 evas_object_resize(bub, 64, 64);
101 evas_object_show(bub);
102 evas_object_data_set(win, names[(i * 2)], bub);
105 evas_object_resize(win, 480, 800);
106 evas_object_show(win);
108 ani = ecore_animator_add(anim, win);
109 evas_object_data_set(win, "animator", ani);
111 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _del, win);