Revert "Revert "Setup before starting fps measurement""
[platform/upstream/expedite.git] / src / bin / image_blend_solid_middle_unscaled.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_blend_solid_middle_unscaled_start
7 #define NAME "Image Blend Solid Middle 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         o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
27         o_images[i] = o;
28         efl_file_simple_load(o, build_path("logo.png"), NULL);
29         efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
30         efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
31         efl_gfx_image_border_insets_set(o, 43, 48, 48, 83);
32         efl_gfx_image_center_fill_mode_set(o, EFL_GFX_CENTER_FILL_MODE_SOLID);
33         efl_gfx_entity_visible_set(o, EINA_TRUE);
34      }
35    done = 0;
36 }
37
38 /* cleanup */
39 static void _cleanup(void)
40 {
41    int i;
42    for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
43 }
44
45 /* loop - do things */
46 static void _loop(double t, int f)
47 {
48    int i;
49    Evas_Coord x, y, w, h;
50    for (i = 0; i < OBNUM; i++)
51      {
52         w = 120;
53         h = 160;
54         x = (win_w / 2) - (w / 2);
55         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
56         y = (win_h / 2) - (h / 2);
57         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
58         efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
59      }
60    FPS_STD(NAME);
61 }
62
63 /* prepend special key handlers if interactive (before STD) */
64 static void _key(const char *key)
65 {
66    KEY_STD;
67 }
68
69
70
71
72
73
74
75
76
77
78
79
80 /* template stuff - ignore */
81 # endif
82 #endif
83
84 #ifdef UI
85 _ui_menu_item_add(ICON, NAME, FNAME);
86 #endif
87
88 #ifdef PROTO
89 void FNAME(void);
90 #endif
91
92 #ifndef PROTO
93 # ifndef UI
94 void FNAME(void)
95 {
96    _setup();
97    ui_func_set(_key, _loop);
98 }
99 # endif
100 #endif
101 #undef FNAME
102 #undef NAME
103 #undef ICON