6 #define FNAME widgets_list_4_start
7 #define NAME "Widgets List 4"
8 #define ICON "widgets.png"
19 static Evas_Object *o_images[NUM];
20 static Evas_Object *o_icons[NUM];
21 static Evas_Object *o_texts[NUM];
23 static const char *icons[] =
43 static const char *labels[] =
80 static void _setup(void)
84 for (i = 0; i < NUM; i++)
86 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
88 efl_gfx_image_border_insets_set(o, 2, 2, 2, 2);
89 efl_file_simple_load(o, build_path("pan.png"), NULL);
90 efl_gfx_entity_size_set(o, EINA_SIZE2D(win_w, ICON_SIZE));
91 efl_gfx_entity_visible_set(o, EINA_TRUE);
93 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
95 efl_gfx_image_border_insets_set(o, 2, 2, 2, 2);
96 efl_file_simple_load(o, build_path(icons[i % 13]), NULL);
97 efl_gfx_entity_size_set(o, EINA_SIZE2D(ICON_SIZE - 8, ICON_SIZE - 8));
98 efl_gfx_entity_visible_set(o, EINA_TRUE);
100 o = evas_object_text_add(evas);
103 efl_text_font_family_set(o, "Vera-Bold");
104 efl_text_font_size_set(o, 10);
105 efl_text_set(o, labels[i % 26]);
107 evas_object_text_font_set(o, "Vera-Bold", 20);
108 evas_object_text_text_set(o, "This is a test string");
110 efl_gfx_color_set(o, 0, 0, 0, 255);
111 efl_gfx_entity_visible_set(o, EINA_TRUE);
117 static void _cleanup(void)
120 for (i = 0; i < NUM; i++) efl_del(o_images[i]);
121 for (i = 0; i < NUM; i++) efl_del(o_icons[i]);
122 for (i = 0; i < NUM; i++) efl_del(o_texts[i]);
125 /* loop - do things */
126 static void _loop(double t, int f)
129 Evas_Coord x, y, tw, th, cent;
132 for (i = 0; i < NUM; i++)
134 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
135 efl_gfx_entity_position_set(o_icons[i], EINA_POSITION2D(x + 4, y + 4));
136 exp_size_get(o_texts[i], &tw, &th);
137 cent = (ICON_SIZE - th) / 2;
138 efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + 8 + ICON_SIZE + 8, y + cent));
144 /* prepend special key handlers if interactive (before STD) */
145 static void _key(const char *key)
161 /* template stuff - ignore */
166 _ui_menu_item_add(ICON, NAME, FNAME);
177 ui_func_set(_key, _loop, _setup);