diff options
author | Carsten Haitzler <raster@rasterman.com> | 2011-04-28 10:46:41 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2011-04-28 10:46:41 +0000 |
commit | 6ddaefaaf6b4d1658d9b945389439dd5e3063ae3 (patch) | |
tree | 26ccce080e5ca38773f7934e9e8247b3d71c2f08 /src/bin/image_mask_14.c | |
parent | 2f2dd23ee46ec3e25b2340828469d608f0d85735 (diff) |
more tests that fail. woot.
SVN revision: 58999
Diffstat (limited to 'src/bin/image_mask_14.c')
-rw-r--r-- | src/bin/image_mask_14.c | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/src/bin/image_mask_14.c b/src/bin/image_mask_14.c new file mode 100644 index 0000000..a2a5d83 --- /dev/null +++ b/src/bin/image_mask_14.c | |||
@@ -0,0 +1,118 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME image_mask_14 | ||
7 | #define NAME "Image Mask 14" | ||
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 | static Evas_Object *o_mask; | ||
19 | |||
20 | /* setup */ | ||
21 | static void _setup(void) | ||
22 | { | ||
23 | int i; | ||
24 | Evas_Object *o; | ||
25 | |||
26 | o = evas_object_image_add(evas); | ||
27 | o_mask = o; | ||
28 | evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); | ||
29 | evas_object_image_fill_set(o, 0, 0, 720, 420); | ||
30 | evas_object_resize(o, 720, 420); | ||
31 | evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); | ||
32 | evas_object_show(o); | ||
33 | |||
34 | for (i = 0; i < OBNUM; i++) | ||
35 | { | ||
36 | o = evas_object_image_add(evas); | ||
37 | o_images[i] = o; | ||
38 | evas_object_image_file_set(o, build_path("logo.png"), NULL); | ||
39 | evas_object_image_fill_set(o, 0, 0, 120, 160); | ||
40 | evas_object_resize(o, 120, 160); | ||
41 | evas_object_image_smooth_scale_set(o, 1); | ||
42 | evas_object_clip_set(o, o_mask); | ||
43 | evas_object_show(o); | ||
44 | } | ||
45 | done = 0; | ||
46 | } | ||
47 | |||
48 | /* cleanup */ | ||
49 | static void _cleanup(void) | ||
50 | { | ||
51 | int i; | ||
52 | for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); | ||
53 | evas_object_del(o_mask); | ||
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, w0, h0; | ||
61 | for (i = 0; i < OBNUM; i++) | ||
62 | { | ||
63 | w0 = 80; | ||
64 | h0 = 80; | ||
65 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
66 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
67 | x = (win_w / 2) - (w / 2); | ||
68 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
69 | y = (win_h / 2) - (h / 2); | ||
70 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
71 | evas_object_move(o_images[i], x, y); | ||
72 | evas_object_resize(o_images[i], w, h); | ||
73 | evas_object_image_fill_set(o_images[i], 0, 0, w, h); | ||
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 | ||