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