containing ui setup steps in the profiling again.
[platform/upstream/expedite.git] / src / bin / image_crossfade.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_crossfade_start
7 #define NAME "Image Crossfade"
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
17 /* private data */
18 static Evas_Object *o_images[2];
19
20 /* setup */
21 static void _setup(void)
22 {
23    Evas_Object *o;
24
25    o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
26    o_images[0] = o;
27    efl_file_simple_load(o, build_path("im1.png"), NULL);
28    efl_gfx_fill_set(o, EINA_RECT(0, 0, 720, 420));
29    efl_gfx_entity_size_set(o, EINA_SIZE2D(720, 420));
30    efl_gfx_entity_visible_set(o, EINA_TRUE);
31
32    o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
33    o_images[1] = o;
34    efl_file_simple_load(o, build_path("im2.png"), NULL);
35    efl_gfx_fill_set(o, EINA_RECT(0, 0, 720, 420));
36    efl_gfx_entity_size_set(o, EINA_SIZE2D(720, 420));
37    efl_gfx_entity_visible_set(o, EINA_TRUE);
38
39    done = 0;
40 }
41
42 /* cleanup */
43 static void _cleanup(void)
44 {
45    int i;
46    for (i = 0; i < 2; i++) efl_del(o_images[i]);
47 }
48
49 /* loop - do things */
50 static void _loop(double t, int f)
51 {
52    int a;
53
54    a = f & 0x1f;
55    a = ((a << 3) | (a >> 2)) & 0xff;
56    efl_gfx_color_set(o_images[1], a, a, a, a);
57    FPS_STD(NAME);
58 }
59
60 /* prepend special key handlers if interactive (before STD) */
61 static void _key(const char *key)
62 {
63    KEY_STD;
64 }
65
66
67
68
69
70
71
72
73
74
75
76
77 /* template stuff - ignore */
78 # endif
79 #endif
80
81 #ifdef UI
82 _ui_menu_item_add(ICON, NAME, FNAME);
83 #endif
84
85 #ifdef PROTO
86 void FNAME(void);
87 #endif
88
89 #ifndef PROTO
90 # ifndef UI
91 void FNAME(void)
92 {
93    ui_func_set(_key, _loop, _setup);
94 }
95 # endif
96 #endif
97 #undef FNAME
98 #undef NAME
99 #undef ICON