containing ui setup steps in the profiling again.
[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 = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
29         o_images[i] = o;
30         efl_file_simple_load(o, build_path("image.png"), NULL);
31         efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
32         efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
33         a = rnd()&0xff;
34         efl_gfx_color_set(o, a, a, a, a);
35         efl_gfx_entity_visible_set(o, EINA_TRUE);
36      }
37    done = 0;
38 }
39
40 /* cleanup */
41 static void _cleanup(void)
42 {
43    int i;
44    for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
45 }
46
47 /* loop - do things */
48 static void _loop(double t, int f)
49 {
50    int i;
51    Evas_Coord x, y, w, h;
52    for (i = 0; i < OBNUM; i++)
53      {
54         w = 120;
55         h = 160;
56         x = (win_w / 2) - (w / 2);
57         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
58         y = (win_h / 2) - (h / 2);
59         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
60         efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
61      }
62    FPS_STD(NAME);
63 }
64
65 /* prepend special key handlers if interactive (before STD) */
66 static void _key(const char *key)
67 {
68    KEY_STD;
69 }
70
71
72
73
74
75
76
77
78
79
80
81
82 /* template stuff - ignore */
83 # endif
84 #endif
85
86 #ifdef UI
87 _ui_menu_item_add(ICON, NAME, FNAME);
88 #endif
89
90 #ifdef PROTO
91 void FNAME(void);
92 #endif
93
94 #ifndef PROTO
95 # ifndef UI
96 void FNAME(void)
97 {
98    ui_func_set(_key, _loop, _setup);
99 }
100 # endif
101 #endif
102 #undef FNAME
103 #undef NAME
104 #undef ICON