6 #define FNAME image_map_color_nearest_solid_rotate_start
7 #define NAME "Image Map Color Nearest Solid Rotate"
18 static Evas_Object *o_images[OBNUM];
21 static void _setup(void)
25 for (i = 0; i < (OBNUM / 2); i++)
27 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
29 efl_file_simple_load(o, build_path("image.png"), NULL);
30 efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
31 efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
32 efl_gfx_image_smooth_scale_set(o, 0);
33 efl_gfx_entity_visible_set(o, EINA_TRUE);
39 static void _cleanup(void)
42 for (i = 0; i < (OBNUM / 2); i++) efl_del(o_images[i]);
45 /* loop - do things */
46 static void _loop(double t, int f)
49 static Evas_Map *m = NULL;
50 Evas_Coord x, y, w, h;
51 if (!m) m = evas_map_new(4);
52 evas_map_smooth_set(m, 0);
53 for (i = 0; i < (OBNUM / 2); i++)
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
62 evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
64 evas_map_point_color_set(m, 0, 255, 255, 255, 255);
65 evas_map_point_color_set(m, 1, 255, 0, 0, 255);
66 evas_map_point_color_set(m, 2, 0, 0, 255, 255);
67 evas_map_point_color_set(m, 3, 0, 255, 0, 255);
69 evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2));
71 evas_object_map_enable_set(o_images[i], 1);
72 evas_object_map_set(o_images[i], m);
77 /* prepend special key handlers if interactive (before STD) */
78 static void _key(const char *key)
94 /* template stuff - ignore */
99 _ui_menu_item_add(ICON, NAME, FNAME);
110 ui_func_set(_key, _loop, _setup);