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