6 #define FNAME image_blend_solid_stretch_start
7 #define NAME "Image Blend Solid Stretch"
8 #define ICON "blend.png"
17 static Evas_Object *o_images[OBNUM];
19 // Each offset is relative to the last block
20 static const Efl_Gfx_Image_Stretch_Region hsz[] = { { 8, 8 }, { 16, 55 } };
21 static const Efl_Gfx_Image_Stretch_Region vsz[] = { { 8, 8 }, { 16, 12 } };
24 static void _setup(void)
28 for (i = 0; i < OBNUM; i++)
30 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
32 efl_file_simple_load(o, build_path("stretch.png"), NULL);
33 efl_gfx_image_stretch_region_set(o, EINA_C_ARRAY_ITERATOR_NEW(hsz),
34 EINA_C_ARRAY_ITERATOR_NEW(vsz));
35 efl_gfx_entity_visible_set(o, EINA_TRUE);
41 static void _cleanup(void)
44 for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
47 /* loop - do things */
48 static void _loop(double t, int f)
51 Evas_Coord x, y, w, h, w0, h0;
53 for (i = 0; i < OBNUM; i++)
57 w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW))) * w0 * 2);
58 h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW))) * w0 * 2);
59 x = (win_w / 2) - (w / 2);
60 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
61 y = (win_h / 2) - (h / 2);
62 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
63 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
64 efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
65 efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
70 /* prepend special key handlers if interactive (before STD) */
71 static void _key(const char *key)
87 /* template stuff - ignore */
92 _ui_menu_item_add(ICON, NAME, FNAME);
103 ui_func_set(_key, _loop, _setup);