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