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