6 #define FNAME textblock_text_fill_format
7 #define NAME "Textblock text_fill_format"
8 #define ICON "text.png"
18 static Evas_Object *o_text;
19 static int sizes[] = {500, 600};
20 Evas_Coord ll, rr, tt, bb;
23 static void _setup(void)
26 Evas_Textblock_Style *st;
28 o = evas_object_textblock_add(evas);
30 st = evas_textblock_style_new();
31 evas_textblock_style_set (st, "DEFAULT='font=Sans font_size=10 color=#000000 wrap=word align=left outline_color=#000 shadow_color=#fff8 shadow_color=#0002 glow2_color=#fe87 glow_color=#f214 underline_color=#00f linesize=40'");
32 evas_object_textblock_style_set(o, st);
33 evas_object_textblock_clear(o);
34 evas_object_textblock_text_markup_set(o, "This test resize text block and keep style (style parsed only once)");
36 efl_gfx_entity_position_set(o, EINA_POSITION2D(0, 0)); \
37 efl_gfx_entity_size_set(o, EINA_SIZE2D(win_w, win_h)); \
38 efl_gfx_entity_visible_set(o, EINA_TRUE);
40 evas_textblock_style_free(st);
46 static void _cleanup(void)
52 /* loop - do things */
53 static void _loop(double t, int f)
55 Evas_Coord x, y, w, h, w0, h0;
60 w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2);
61 h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2);
62 x = (win_w / 2) - (w / 2);
63 x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2);
64 y = (win_h / 2) - (h / 2);
65 y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2);
66 efl_gfx_entity_position_set(o_text, EINA_POSITION2D(x, y));
68 for (i = 0; i < 10000; i++)
70 evas_object_resize(o_text, sizes[i%2], sizes[i%2]);
71 evas_object_textblock_style_insets_get((Efl_Canvas_Object*) o_text, &ll, &rr, &tt, &bb);
76 /* prepend special key handlers if interactive (before STD) */
77 static void _key(const char *key)
93 /* template stuff - ignore */
98 _ui_menu_item_add(ICON, NAME, FNAME);
110 ui_func_set(_key, _loop);