upldate 1.7.10
[platform/upstream/expedite.git] / src / bin / image_blend_solid_fade_unscaled.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_blend_solid_fade_unscaled_start
7 #define NAME "Image Blend Solid Fade Unscaled"
8 #define ICON "blend.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 /* standard var */
15 static int done = 0;
16 /* private data */
17 static Evas_Object *o_images[OBNUM];
18
19 /* setup */
20 static void _setup(void)
21 {
22    int i;
23    Evas_Object *o;
24    for (i = 0; i < OBNUM; i++)
25      {
26         int a;
27
28         o = eo_add(EVAS_IMAGE_CLASS, evas);
29         o_images[i] = o;
30         eo_do(o,
31               efl_file_set(build_path("image.png"), NULL),
32               efl_gfx_fill_set(0, 0, 120, 160),
33               efl_gfx_size_set(120, 160));
34         a = rnd()&0xff;
35         eo_do(o,
36               efl_gfx_color_set(a, a, a, a),
37               efl_gfx_visible_set(EINA_TRUE));
38      }
39    done = 0;
40 }
41
42 /* cleanup */
43 static void _cleanup(void)
44 {
45    int i;
46    for (i = 0; i < OBNUM; i++) eo_del(o_images[i]);
47 }
48
49 /* loop - do things */
50 static void _loop(double t, int f)
51 {
52    int i;
53    Evas_Coord x, y, w, h;
54    for (i = 0; i < OBNUM; i++)
55      {
56         w = 120;
57         h = 160;
58         x = (win_w / 2) - (w / 2);
59         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
60         y = (win_h / 2) - (h / 2);
61         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
62         eo_do(o_images[i], efl_gfx_position_set(x, y));
63      }
64    FPS_STD(NAME);
65 }
66
67 /* prepend special key handlers if interactive (before STD) */
68 static void _key(char *key)
69 {
70    KEY_STD;
71 }
72
73
74
75
76
77
78
79
80
81
82
83
84 /* template stuff - ignore */
85 # endif
86 #endif
87
88 #ifdef UI
89 _ui_menu_item_add(ICON, NAME, FNAME);
90 #endif
91
92 #ifdef PROTO
93 void FNAME(void);
94 #endif
95
96 #ifndef PROTO
97 # ifndef UI
98 void FNAME(void)
99 {
100    ui_func_set(_key, _loop);
101    _setup();
102 }
103 # endif
104 #endif
105 #undef FNAME
106 #undef NAME
107 #undef ICON