upldate 1.7.10
[platform/upstream/expedite.git] / src / bin / image_blend_solid_fade_pow2_unscaled.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_blend_solid_fade_pow2_unscaled_start
7 #define NAME "Image Blend Solid Fade Power 2 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 = 256 - (1 << ((rnd() % 8) + 1));
35         if (a < 128) a = 128;
36         eo_do(o,
37               efl_gfx_color_set(a, a, a, a),
38               efl_gfx_visible_set(EINA_TRUE));
39      }
40    done = 0;
41 }
42
43 /* cleanup */
44 static void _cleanup(void)
45 {
46    int i;
47    for (i = 0; i < OBNUM; i++) eo_del(o_images[i]);
48 }
49
50 /* loop - do things */
51 static void _loop(double t, int f)
52 {
53    int i;
54    Evas_Coord x, y, w, h;
55    for (i = 0; i < OBNUM; i++)
56      {
57         w = 120;
58         h = 160;
59         x = (win_w / 2) - (w / 2);
60         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
61         y = (win_h / 2) - (h / 2);
62         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
63         eo_do(o_images[i], efl_gfx_position_set(x, y));
64      }
65    FPS_STD(NAME);
66 }
67
68 /* prepend special key handlers if interactive (before STD) */
69 static void _key(char *key)
70 {
71    KEY_STD;
72 }
73
74
75
76
77
78
79
80
81
82
83
84
85 /* template stuff - ignore */
86 # endif
87 #endif
88
89 #ifdef UI
90 _ui_menu_item_add(ICON, NAME, FNAME);
91 #endif
92
93 #ifdef PROTO
94 void FNAME(void);
95 #endif
96
97 #ifndef PROTO
98 # ifndef UI
99 void FNAME(void)
100 {
101    ui_func_set(_key, _loop);
102    _setup();
103 }
104 # endif
105 #endif
106 #undef FNAME
107 #undef NAME
108 #undef ICON