6 #define FNAME image_mask_clipped
7 #define NAME "Image Mask Clipped"
8 #define ICON "blend.png"
17 static Evas_Object *o_images[OBNUM];
18 static Evas_Object *o_mask;
19 static Evas_Object *o_clip;
22 static void _setup(void)
27 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
29 efl_gfx_entity_size_set(o, EINA_SIZE2D(180, 105));
30 efl_gfx_entity_position_set(o, EINA_POSITION2D((win_w - 180) / 2, (win_h - 105) / 2));
31 efl_gfx_entity_visible_set(o, EINA_TRUE);
33 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
35 efl_file_simple_load(o, build_path("e-logo-mask.png"), NULL);
36 efl_gfx_fill_set(o, EINA_RECT(0, 0, 720, 420));
37 efl_gfx_entity_size_set(o, EINA_SIZE2D(720, 420));
38 evas_object_clip_set(o, o_clip);
39 efl_canvas_object_has_fixed_size_set(o, 1);
40 efl_gfx_entity_position_set(o, EINA_POSITION2D((win_w - 720) / 2, (win_h - 420) / 2));
41 efl_gfx_entity_visible_set(o, EINA_TRUE);
43 for (i = 0; i < OBNUM; i++)
45 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
47 efl_file_simple_load(o, build_path("logo.png"), NULL);
48 efl_gfx_fill_set(o, EINA_RECT(0, 0, 360, 480));
49 efl_gfx_entity_size_set(o, EINA_SIZE2D(360, 480));
50 efl_gfx_image_smooth_scale_set(o, 0);
51 evas_object_clip_set(o, o_mask);
52 efl_gfx_entity_visible_set(o, EINA_TRUE);
58 static void _cleanup(void)
61 for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
66 /* loop - do things */
67 static void _loop(double t, int f)
70 Evas_Coord x, y, w, h, w0, h0;
72 for (i = 0; i < OBNUM; i++)
76 w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
77 h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
78 x = (win_w / 2) - (w / 2);
79 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
80 y = (win_h / 2) - (h / 2);
81 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
83 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
84 efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
85 efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
87 w = (sin((double)f) * 720 + 840) / 2.2;
88 h = (sin((double)f) * 720 + 840) / 2.2;
89 efl_gfx_entity_size_set(o_mask, EINA_SIZE2D(w, h));
90 efl_gfx_entity_position_set(o_mask, EINA_POSITION2D((win_w - w) / 2, (win_h - h) / 2));
94 /* prepend special key handlers if interactive (before STD) */
95 static void _key(const char *key)
111 /* template stuff - ignore */
116 _ui_menu_item_add(ICON, NAME, FNAME);
128 ui_func_set(_key, _loop);