1 #include <Elementary.h>
2 #ifndef ELM_LIB_QUICKLAUNCH
4 static const char *names[] =
12 _del(void *data, Evas *evas, Evas_Object *obj, void *event_info)
14 Evas_Object *win = data;
15 Ecore_Animator *ani = evas_object_data_get(win, "animator");
17 ecore_animator_del(ani);
23 Evas_Object *win = data;
24 Evas_Object *bub, *sh;
25 Evas_Coord x, y, w, h, vw, vh;
26 double t, xx, yy, zz, r, fac;
30 evas_output_viewport_get(evas_object_evas_get(win), 0, 0, &vw, &vh);
32 t = ecore_loop_time_get();
33 fac = 2.0 / (double)((sizeof(names) / sizeof(char *) / 2));
34 evas_pointer_canvas_xy_get(evas_object_evas_get(win), &x, &y);
38 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
40 bub = evas_object_data_get(win, names[i * 2]);
41 sh = evas_object_data_get(win, names[(i * 2) + 1]);
42 zz = (((2 + sin(t * 6 + (M_PI * (i * fac)))) / 3) * 64) * 2;
43 xx = (cos(t * 4 + (M_PI * (i * fac))) * r) * 2;
44 yy = (sin(t * 6 + (M_PI * (i * fac))) * r) * 2;
48 x = (vw / 2) + xx - (w / 2);
49 y = (vh / 2) + yy - (h / 2);
51 evas_object_move(bub, x, y);
52 evas_object_resize(bub, w, h);
54 x = x - ((lx - (x + (w / 2))) / 4);
55 y = y - ((ly - (y + (h / 2))) / 4);
57 evas_object_move(sh, x, y);
58 evas_object_resize(sh, w, h);
60 return ECORE_CALLBACK_RENEW;
64 test_anim(void *data, Evas_Object *obj, void *event_info)
66 Evas_Object *win, *bg, *bub, *sh;
71 win = elm_win_add(NULL, "animation", ELM_WIN_BASIC);
72 elm_win_title_set(win, "Animation");
73 elm_win_autodel_set(win, 1);
76 snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR);
77 elm_bg_file_set(bg, buf, NULL);
78 elm_win_resize_object_add(win, bg);
79 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
82 snprintf(buf, sizeof(buf), "%s/images/bubble_sh.png", PACKAGE_DATA_DIR);
83 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
85 sh = evas_object_image_filled_add(evas_object_evas_get(win));
86 evas_object_image_file_set(sh, buf, NULL);
87 evas_object_resize(sh, 64, 64);
89 evas_object_data_set(win, names[(i * 2) + 1], sh);
92 snprintf(buf, sizeof(buf), "%s/images/bubble.png", PACKAGE_DATA_DIR);
93 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
95 bub = evas_object_image_filled_add(evas_object_evas_get(win));
96 evas_object_image_file_set(bub, buf, NULL);
97 evas_object_resize(bub, 64, 64);
98 evas_object_show(bub);
99 evas_object_data_set(win, names[(i * 2)], bub);
102 evas_object_resize(win, 480, 800);
103 evas_object_show(win);
105 ani = ecore_animator_add(anim, win);
106 evas_object_data_set(win, "animator", ani);
108 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _del, win);