expedite/src/bin/cxx/textblock_auto_align.cc

68 lines
1.7 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME textblock_auto_align_start
#define NAME "Textblock auto align"
#define ICON "text.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_text;
/* setup */
static void _setup(void)
{
Evas_Object *o;
Evas_Textblock_Style *st;
o = eo_add(EVAS_TEXTBLOCK_CLASS, G_evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
(st,
"DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'"
);
eo_do(o,
evas_obj_textblock_style_set(st),
evas_obj_textblock_clear(),
evas_obj_textblock_text_markup_set(
"This is a test of auto alignment in Evas<ps/>"
"<br/>"
"This text should be left aligned<ps/>"
"\xE2\x80\x8FThis text should be right aligned<ps/>"
"\xE2\x80\x8FThis text should be right aligned<br/>"
"Same as this text.<ps/>"
"This text should be left aligned<br/>"
"\xE2\x80\x8FSame as this text."
"<br/><br/><ps/>"
"The word 'זה' should be the rightmost, 'טקסט' after, and 'בעברית' last<br/>"
"in the following text:<ps/>"
"זה טקסט בעברית<ps/>"
"<br/>"
"In the next text, the paragraph should be right aligned and the<br/>"
"words should appear in the following order: 'דוגמה' first, 'of' second,<br/>"
"'טקסט' third, 'english' fourth and 'in' fifth, counting from right to left<ps/>"
"דוגמה of טקסט in english."
),
evas_obj_visibility_set(EINA_TRUE));
evas_textblock_style_free(st);
done = 0;
}
/* cleanup */
extern "C" static void _key(char *key)
{
KEY_STD;
}