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