6 #define FNAME line_blend_start
7 #define NAME "Line Blend"
8 #define ICON "rect.png"
17 static Evas_Object *o_images[OBNUM];
20 static void _setup(void)
25 for (i = 0; i < OBNUM; i++)
29 o = evas_object_line_add(evas);
32 r = ((rnd()&0xff) * a) / 255;
33 g = ((rnd()&0xff) * a) / 255;
34 b = ((rnd()&0xff) * a) / 255;
35 efl_gfx_color_set(o, r, g, b, a);
36 evas_object_line_xy_set(o, ((win_w / 2) * (rnd()&0xff)) / 255, ((win_h / 2) * (rnd()&0xff)) / 255, ((win_w / 2) * (rnd()&0xff)) / 255 + (win_w / 2), ((win_h / 2) * (rnd()&0xff)) / 255 + (win_h / 2));
37 efl_gfx_entity_visible_set(o, EINA_TRUE);
45 static void _cleanup(void)
48 for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
51 #define PI (double) 3.141592654
54 _rotate_point(Evas_Coord *ox, Evas_Coord *oy, int r)
60 x = *ox - (win_w / 2);
61 y = *oy - (win_h / 2);
63 d = sqrt(x * x + y * y);
65 angle = atan((double) y / (double) x);
66 if (x < 0) angle -= PI;
70 case 0: angle += 1 * PI / 180; break;
71 case 1: angle += -1 * PI / 180; break;
72 case 2: angle += 7 * PI / 180; break;
73 case 3: angle += -1 * PI / 180; break;
76 *ox = d * cos(angle) + (win_w / 2);
77 *oy = d * sin(angle) + (win_h / 2);
80 /* loop - do things */
81 static void _loop(double t, int f)
84 Evas_Coord ox1, oy1, ox2, oy2;
87 for (i = 0; i < OBNUM; i++)
90 evas_object_line_xy_get(o, &ox1, &oy1, &ox2, &oy2);
92 _rotate_point(&ox1, &oy1, i);
93 _rotate_point(&ox2, &oy2, i);
94 evas_object_line_xy_set(o, ox1, oy1, ox2, oy2);
99 /* prepend special key handlers if interactive (before STD) */
100 static void _key(const char *key)
116 /* template stuff - ignore */
121 _ui_menu_item_add(ICON, NAME, FNAME);
133 ui_func_set(_key, _loop);