summaryrefslogtreecommitdiff
path: root/src/bin/textblock_intl.c
blob: 80b2437d235389a66e66f899aad69cccd14e1922 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#undef FNAME
#undef NAME
#undef ICON

/* metadata */
#define FNAME textblock_intl_start
#define NAME "Textblock Intl"
#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_OBJ_TEXTBLOCK_CLASS, evas);
   o_text = o;
   st = evas_textblock_style_new();
   evas_textblock_style_set
     (st,
      "DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'"
      );
   if (o)
	eo_do(o, evas_obj_textblock_style_set(st));
   evas_textblock_style_free(st);
   if (o)
	eo_do(o, evas_obj_textblock_clear());

   if (o)
	eo_do(o, evas_obj_textblock_text_markup_set(
      "This is a test of International test rendering in Evas<br/>"
      "<br/>"
      "Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'<br/>"
      "German: 'Heizölrückstoßabdämpfung'<br/>"
      "Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'<br/>"
      "French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'<br/>"
      "Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'<br/>"
      "Hungarian: 'Árvíztűrő tükörfúrógép'<br/>"
      "Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'<br/>"
      "Japanese (hiragana): 'いろはにほへとちりぬるを'<br/>"
      "Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'<br/>"
      "Hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה?‏'<br/>"
      "Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'<br/>"
      "Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'<br/>"
      "IPA: 'ˈjunɪˌkoːd'<br/>"
      "American Dictionary: 'Ūnĭcōde̽'<br/>"
      "Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'<br/>"
      "Arabic: 'يونِكود'<br/>"
      "Armenian: 'Յունիկօդ'<br/>"
      "Bengali: 'য়ূনিকোড'<br/>"
      "Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'<br/>"
      "Canadian Syllabics: 'ᔫᗂᑰᑦ'<br/>"
      "Cherokee: 'ᏳᏂᎪᏛ'<br/>"
      "Chinese: '萬國碼'<br/>"
      "Ethiopic: 'ዩኒኮድ'<br/>"
      "Georgian: 'უნიკოდი'<br/>"
      "Greek: 'Γιούνικοντ'<br/>"

      /* also test the html entity stuff a bit */
      "Greek continued: '&tau;&upsilon;&lambda;&theta;'<br/>"

      "Gujarati: 'યૂનિકોડ'<br/>"
      "Gurmukhi: 'ਯੂਨਿਕੋਡ'<br/>"
      "Hindi: 'यूनिकोड'<br/>"
      "Kannada: 'ಯೂನಿಕೋಡ್'<br/>"
      "Khmer: 'យូនីគោដ'<br/>"
      "Korean: '유니코드'<br/>"
      "Malayalam: 'യൂനികോഡ്'<br/>"
      "Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'<br/>"
      "Oriya: 'ୟୂନିକୋଡ'<br/>"
      "Persian: 'یونی‌کُد'<br/>"
      "Sinhala: 'යණනිකෞද්'<br/>"
      "Syriac: 'ܝܘܢܝܩܘܕ'<br/>"
      "Tamil:'யூனிகோட்'<br/>"
      "Telugu: 'యూనికోడ్'<br/>"
      "Thai: 'ยูนืโคด'<br/>"
      "Tibetan: 'ཨུ་ནི་ཀོཌྲ།'<br/>"
      "Yiddish: 'יוניקאָד'<br/>"
      ));

   if (o)
	eo_do(o, evas_obj_visibility_set(EINA_TRUE));

   done = 0;
}

/* cleanup */
static void _cleanup(void)
{
   eo_del(o_text);
}

/* loop - do things */
static void _loop(double t, int f)
{
   Evas_Coord x, y, w, h, w0, h0;
   int i = 0;

   if (o_text)
	eo_do(o_text, evas_obj_textblock_size_native_get(&w0, &h0));
   w = w0;
   h = h0;
   x = (win_w / 2) - (w / 2);
   x += sin((double)(f + (i * 13)) / (31.1 * SLOW)) * (w0 / (2 * 2));
   y = (win_h / 2) - (h / 2);
   y += cos((double)(f + (i * 28)) / (19.6 * SLOW)) * (h0 / (2 * 2));
   if (o_text)
	eo_do(o_text, evas_obj_position_set(x, y));
   if (o_text)
	eo_do(o_text, evas_obj_size_set(w, h));

   FPS_STD(NAME);
}

/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
   KEY_STD;
}












/* template stuff - ignore */
# endif
#endif

#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif

#ifdef PROTO
void FNAME(void);
#endif

#ifndef PROTO
# ifndef UI
void FNAME(void)
{
   ui_func_set(_key, _loop);
   _setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON