6 #define FNAME textblock_auto_align_start
7 #define NAME "Textblock auto align"
8 #define ICON "text.png"
18 static Evas_Object *o_text;
21 static void _setup(void)
24 Evas_Textblock_Style *st;
26 o = evas_object_textblock_add(evas);
28 st = evas_textblock_style_new();
29 evas_textblock_style_set
31 "DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'"
33 evas_object_textblock_style_set(o, st); \
34 evas_object_textblock_clear(o); \
35 evas_object_textblock_text_markup_set(o, "This is a test of auto alignment in Evas<ps/>"
37 "This text should be left aligned<ps/>"
38 "\xE2\x80\x8FThis text should be right aligned<ps/>"
39 "\xE2\x80\x8FThis text should be right aligned<br/>"
40 "Same as this text.<ps/>"
41 "This text should be left aligned<br/>"
42 "\xE2\x80\x8FSame as this text."
44 "The word 'זה' should be the rightmost, 'טקסט' after, and 'בעברית' last<br/>"
45 "in the following text:<ps/>"
48 "In the next text, the paragraph should be right aligned and the<br/>"
49 "words should appear in the following order: 'דוגמה' first, 'of' second, <br/>"
50 "'טקסט' third, 'english' fourth and 'in' fifth, counting from right to left<ps/>"
51 "דוגמה of טקסט in english."); \
52 efl_gfx_entity_visible_set(o, EINA_TRUE);
53 evas_textblock_style_free(st);
59 static void _cleanup(void)
64 /* loop - do things */
65 static void _loop(double t, int f)
67 Evas_Coord x, y, w, h, w0, h0;
70 evas_object_textblock_size_native_get(o_text, &w0, &h0);
73 w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0);
74 x = (win_w / 2) - (w / 2);
75 y = (win_h / 2) - (h0 / 2);
76 efl_gfx_entity_position_set(o_text, EINA_POSITION2D(x, y));
77 efl_gfx_entity_size_set(o_text, EINA_SIZE2D(w, h));
82 /* prepend special key handlers if interactive (before STD) */
83 static void _key(const char *key)
99 /* template stuff - ignore */
104 _ui_menu_item_add(ICON, NAME, FNAME);
115 ui_func_set(_key, _loop, _setup);