6 #define FNAME widgets_file_icons_start
7 #define NAME "Widgets File Icons"
8 #define ICON "widgets.png"
19 static Evas_Object *o_images[NUM];
20 static Evas_Object *o_texts[NUM];
22 static const char *icons[] =
43 static void _setup(void)
47 for (i = 0; i < NUM; i++)
49 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
51 efl_file_simple_load(o, build_path(icons[i % 13]), NULL);
52 efl_gfx_fill_set(o, EINA_RECT(0, 0, ICON_SIZE, ICON_SIZE));
53 efl_gfx_entity_size_set(o, EINA_SIZE2D(ICON_SIZE, ICON_SIZE));
54 efl_gfx_entity_visible_set(o, EINA_TRUE);
56 o = evas_object_text_add(evas);
59 efl_text_font_family_set(o, "Vera-Bold");
60 efl_text_font_size_set(o, 10);
61 efl_text_set(o, icons[i % 13]);
63 evas_object_text_font_set(o, "Vera-Bold", 10);
64 evas_object_text_text_set(o, icons[i % 13]);
66 evas_object_text_style_set(o, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW);
67 efl_gfx_color_set(o, 255, 255, 255, 255);
68 evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
69 efl_gfx_entity_visible_set(o, EINA_TRUE);
75 static void _cleanup(void)
78 for (i = 0; i < NUM; i++)
85 /* loop - do things */
86 static void _loop(double t, int f)
89 Evas_Coord x, y, tw, th, cent;
92 for (i = 0; i < NUM; i++)
94 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x + 8, y));
95 exp_size_get(o_texts[i], &tw, &th);
96 cent = (ICON_SIZE + 16 - tw) / 2;
97 efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
108 /* prepend special key handlers if interactive (before STD) */
109 static void _key(const char *key)
125 /* template stuff - ignore */
130 _ui_menu_item_add(ICON, NAME, FNAME);
142 ui_func_set(_key, _loop);