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