Expedite initialize.
[framework/uifw/expedite.git] / src / bin / .svn / text-base / textblock_basic.c.svn-base
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME textblock_basic_start
7 #define NAME "Textblock Basic"
8 #define ICON "text.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 /* standard var */
15 static int done = 0;
16
17 /* private data */
18 static Evas_Object *o_text;
19
20 /* setup */
21 static void _setup(void)
22 {
23    Evas_Object *o;
24    Evas_Textblock_Style *st;
25
26    o = evas_object_textblock_add(evas);
27    o_text = o;
28    st = evas_textblock_style_new();
29    evas_textblock_style_set
30      (st,
31       "DEFAULT='font=Vera,Kochi font_size=8 align=left color=#000000 wrap=word'"
32       "center='+ font=Vera,Kochi font_size=10 align=center'"
33       "/center='- \n'"
34       "right='+ font=Vera,Kochi font_size=10 align=right'"
35       "/right='- \n'"
36       "blockquote='+ left_margin=+24 right_margin=+24 font=Vera,Kochi font_size=10 align=left'"
37       "h1='+ font_size=20'"
38       "red='+ color=#ff0000'"
39       "p='+ font=Vera,Kochi font_size=10 align=left'"
40       "/p='- \n'"
41       "br='\n'"
42       "tab='\t'"
43       );
44    evas_object_textblock_style_set(o, st);
45    evas_textblock_style_free(st);
46    evas_object_textblock_clear(o);
47
48    evas_object_textblock_text_markup_set
49      (o,
50       "<center><h1>Title</h1></center><br>"
51       "<p><tab>A pragraph here <red>red text</red> and stuff.</p>"
52       "<p>And escaping &lt; and &gt; as well as &amp; as <h1>normal.</h1></p>"
53       "<p>If you want a newline use &lt;br&gt;<br>woo a new line!</p>"
54       "<right>Right "
55       "<style=outline color=#fff outline_color=#000>aligned</> "
56       "<style=shadow shadow_color=#fff8>text</> "
57       "<style=soft_shadow shadow_color=#0002>should</> "
58       "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >go here</> "
59       "<style=far_shadow shadow_color=#0005>as it is</> "
60       "<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>within</> "
61       "<style=outline_soft_shadow color=#fff outline_color=#8228 shadow_color=#0002>right tags</> "
62       "<style=far_soft_shadow color=#fff shadow_color=#0002>to make it align to the</> "
63       "<underline=on underline_color=#00f>right hand</> "
64       "<backing=on backing_color=#fff8>side </><backing_color=#ff08>of</><backing_color=#0f08> </>"
65       "<strikethrough=on strikethrough_color=#f0f8>the textblock</>.</right>"
66       "<p>And "
67       "<underline=double underline_color=#f00 underline2_color=#00f>now we need</> "
68       "to test some <color=#f00 font_size=8>C</><color=#0f0 font_size=10>O</>"
69       "<color=#00f font_size=12>L</><color=#fff font_size=14>O</>"
70       "<color=#ff0 font_size=16>R</><color=#0ff font_size=18> Bla Rai</>"
71       "<color=#f0f font_size=20> Stuff</>.</p>"
72       "<backing=on backing_color=#f00 linesize=20>20 Linesize<br>"
73       "<backing=on backing_color=#0f0 linesize=40>40 Linesize<br>"
74       "<backing=on backing_color=#f00 linerelsize=100%>100 percent Linerelsize<br>"
75       "<backing=on backing_color=#0f0 linerelsize=150%>150 percent Linerelsize<br>"
76       "<backing=on backing_color=#00f linerelsize=200%>200 percent Linerelsize<br>"
77       "<backing=off linerelsize=0%>"
78       "<blockquote>"
79       "(日本語 カタカナ ひらがな) "
80       "<style=outline color=#fff outline_color=#000>Round about the cauldron go;</> "
81       "In the poison'd entrails throw. "
82       "<style=shadow shadow_color=#fff8>Toad, that under cold stone</> "
83       "Days and nights has thirty-one "
84       "<style=soft_shadow shadow_color=#0002>Swelter'd venom sleeping got,</> "
85       "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >Boil thou first i' the charmed pot.</> "
86       "Double, double toil and trouble; "
87       "Fire burn, and cauldron bubble. "
88       "<style=far_shadow shadow_color=#0005>Fillet of a fenny snake,</> "
89       "In the cauldron boil and bake; "
90       "<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>Eye of newt and toe of frog,</> "
91       "<underline=on underline_color=#00f>Wool of bat and tongue of dog,</> "
92       "<backing=on backing_color=#ff08>Adder's fork and blind-worm's sting,</> "
93       "<underline=double underline_color=#f00 underline2_color=#00f>Lizard's leg and owlet's wing,</> "
94       "<color=#808 font_size=20>For a charm of powerful trouble, "
95       "Like a hell-broth boil and bubble. "
96       "Double, double toil and trouble;</> "
97       "Fire burn and cauldron bubble. "
98       "Scale of dragon, tooth of wolf, "
99       "Witches' mummy, maw and gulf "
100       "Of the ravin'd salt-sea shark, "
101       "Root of hemlock digg'd i' the dark, "
102       "Liver of blaspheming Jew, "
103       "Gall of goat, and slips of yew "
104       "Silver'd in the moon's eclipse, "
105       "Nose of Turk and Tartar's lips, "
106       "Finger of birth-strangled babe "
107       "Ditch-deliver'd by a drab, "
108       "Make the gruel thick and slab: "
109       "Add thereto a tiger's chaudron, "
110       "For the ingredients of our cauldron. "
111       "Double, double toil and trouble; "
112       "Fire burn and cauldron bubble. "
113       "Cool it with a baboon's blood, "
114       "Then the charm is firm and good. "
115       "Heizölrückstoßabdämpfung fløde pingüino kilómetros cœur déçu l'âme "
116       "plutôt naïve Louÿs rêva crapaüter Íosa Úrmhac Óighe pór Éava Ádhaim"
117       "</blockquote>"
118       );
119
120    evas_object_show(o);
121
122    done = 0;
123 }
124
125 /* cleanup */
126 static void _cleanup(void)
127 {
128    evas_object_del(o_text);
129 }
130
131 /* loop - do things */
132 static void _loop(double t, int f)
133 {
134    Evas_Coord x, y, w, h, w0, h0;
135    int i = 0;
136
137    w0 = 160;
138    h0 = 120;
139    w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2);
140    h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2);
141    x = (win_w / 2) - (w / 2);
142    x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2);
143    y = (win_h / 2) - (h / 2);
144    y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2);
145    evas_object_move(o_text, x, y);
146    evas_object_resize(o_text, w, 5000);
147
148    FPS_STD(NAME);
149 }
150
151 /* prepend special key handlers if interactive (before STD) */
152 static void _key(char *key)
153 {
154    KEY_STD;
155 }
156
157
158
159
160
161
162
163
164
165
166
167
168 /* template stuff - ignore */
169 # endif
170 #endif
171
172 #ifdef UI
173 _ui_menu_item_add(ICON, NAME, FNAME);
174 #endif
175
176 #ifdef PROTO
177 void FNAME(void);
178 #endif
179
180 #ifndef PROTO
181 # ifndef UI
182 void FNAME(void)
183 {
184    ui_func_set(_key, _loop);
185    _setup();
186 }
187 # endif
188 #endif
189 #undef FNAME
190 #undef NAME
191 #undef ICON