6 #define FNAME widgets_file_icons_2_same_grouped_start
7 #define NAME "Widgets File Icons 2 Same Grouped"
8 #define ICON "widgets.png"
19 static Evas_Object *o_images[NUM];
20 static Evas_Object *o_texts[NUM];
22 static const char *icons[] =
28 static void _setup(void)
32 for (i = 0; i < NUM; i++)
34 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
36 efl_file_simple_load(o, build_path(icons[i % 1]), NULL);
37 efl_gfx_fill_set(o, EINA_RECT(0, 0, ICON_SIZE, ICON_SIZE));
38 efl_gfx_entity_size_set(o, EINA_SIZE2D(ICON_SIZE, ICON_SIZE));
39 efl_gfx_entity_visible_set(o, EINA_TRUE);
41 o = evas_object_text_add(evas);
44 efl_text_font_family_set(o, "Vera-Bold");
45 efl_text_font_size_set(o, 10);
46 efl_text_set(o, icons[i % 1]);
48 evas_object_text_font_set(o, "Vera-Bold", 10);
49 evas_object_text_text_set(o, icons[i % 1]);
51 efl_gfx_color_set(o, 0, 0, 0, 255);
52 efl_gfx_entity_visible_set(o, EINA_TRUE);
54 for (i = 0; i < NUM; i++)
56 efl_gfx_stack_raise_to_top(o_images[i]);
62 static void _cleanup(void)
65 for (i = 0; i < NUM; i++)
72 /* loop - do things */
73 static void _loop(double t, int f)
76 Evas_Coord x, y, tw, th, cent;
79 for (i = 0; i < NUM; i++)
81 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x + 8, y));
82 exp_size_get(o_texts[i], &tw, &th);
83 cent = (ICON_SIZE + 16 - tw) / 2;
84 efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
95 /* prepend special key handlers if interactive (before STD) */
96 static void _key(const char *key)
112 /* template stuff - ignore */
117 _ui_menu_item_add(ICON, NAME, FNAME);
128 ui_func_set(_key, _loop, _setup);