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