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