summaryrefslogtreecommitdiff
path: root/legacy/edje/doc
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2011-08-24 16:31:11 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2011-08-24 16:31:11 +0000
commit73aa354e05d47b0752cf907c562fc5df7cea5a93 (patch)
tree992d76b2e947bfb60620a3b630a6bb01026378b9 /legacy/edje/doc
parentcea7b9dddb76ec92c420255514574979c7832516 (diff)
[edje] Putting edc examples in src/examples dir, so that
docs find them as well. SVN revision: 62754
Diffstat (limited to 'legacy/edje/doc')
-rw-r--r--legacy/edje/doc/examples/embryo_custom_state.edc134
-rw-r--r--legacy/edje/doc/examples/embryo_pong.edc273
-rw-r--r--legacy/edje/doc/examples/embryo_run_program.edc66
-rw-r--r--legacy/edje/doc/examples/embryo_set_state.edc46
-rw-r--r--legacy/edje/doc/examples/embryo_set_text.edc39
-rw-r--r--legacy/edje/doc/examples/embryo_timer.edc90
-rw-r--r--legacy/edje/doc/examples/external_elm_anchorblock.edc160
-rw-r--r--legacy/edje/doc/examples/external_elm_button.edc270
-rw-r--r--legacy/edje/doc/examples/external_elm_check.edc211
-rw-r--r--legacy/edje/doc/examples/external_elm_panes.edc140
-rw-r--r--legacy/edje/doc/examples/external_emotion_elm.edc239
-rw-r--r--legacy/edje/doc/examples/lua_script.edc146
-rw-r--r--legacy/edje/doc/examples/toggle_using_filter.edc66
13 files changed, 0 insertions, 1880 deletions
diff --git a/legacy/edje/doc/examples/embryo_custom_state.edc b/legacy/edje/doc/examples/embryo_custom_state.edc
deleted file mode 100644
index 9277c9075b..0000000000
--- a/legacy/edje/doc/examples/embryo_custom_state.edc
+++ /dev/null
@@ -1,134 +0,0 @@
1collections {
2 group { name: "main";
3 script {
4 /* define 3 global vars to hold the rotation values */
5 public rotx;
6 public roty;
7 public rotz;
8 }
9 parts {
10 part { name: "bg";
11 type: RECT;
12 description { state: "default" 0.0;
13 color: 255 255 255 255;
14 }
15 }
16 part { name: "title";
17 type: TEXT;
18 description { state: "default" 0.0;
19 color: 0 0 0 255;
20 text {
21 text: "Click labels to rotate";
22 font: "Sans";
23 size: 12;
24 align: 0.5 0.0;
25 }
26 }
27 }
28 part { name: "X";
29 type: TEXT;
30 description { state: "default" 0.0;
31 color: 0 0 0 255;
32 text {
33 text: "Rot X (0)";
34 font: "Sans";
35 size: 12;
36 align: 0.1 0.5;
37 }
38 }
39 }
40 part { name: "Y";
41 type: TEXT;
42 description { state: "default" 0.0;
43 color: 0 0 0 255;
44 text {
45 text: "Rot Y (0)";
46 font: "Sans";
47 size: 12;
48 align: 0.5 0.9;
49 }
50 }
51 }
52 part { name: "Z";
53 type: TEXT;
54 description { state: "default" 0.0;
55 color: 0 0 0 255;
56 text {
57 text: "Rot Z (0)";
58 font: "Sans";
59 size: 12;
60 align: 0.9 0.5;
61 }
62 }
63 }
64 part { name: "rect";
65 type: RECT;
66 mouse_events: 0;
67 description { state: "default" 0.0;
68 color: 255 0 0 150;
69 max: 150 150;
70 align: 0.5 0.5;
71 map {
72 on: 1;
73 perspective_on: 1;
74 smooth: 1;
75 alpha: 1;
76 }
77 }
78 }
79 }
80 programs {
81 program {
82 signal: "mouse,down,1";
83 source: "X";
84 script {
85 /* define local vars */
86 new buf[32];
87 new Float:x;
88
89 /* get global var (and increment) */
90 x = get_int(rotx) + 10;
91 /* set global var */
92 set_int(rotx, round(x));
93 /* crete a new custom state (inherit from default 0.0) */
94 custom_state(PART:"rect", "default", 0.0);
95 /* change the rotation in the custom state */
96 set_state_val(PART:"rect", STATE_MAP_ROT_X, x);
97 /* apply the custom state */
98 set_state(PART:"rect", "custom", 0.0);
99 /* update the label to show the current value */
100 snprintf(buf, sizeof(buf), "Rot X (%d)", round(x));
101 set_text(PART:"X", buf);
102 }
103 }
104 program {
105 signal: "mouse,down,1";
106 source: "Y";
107 script {
108 new buf[32];
109 new Float:y = get_int(roty) + 10;
110 set_int(roty, round(y));
111 custom_state(PART:"rect", "default", 0.0);
112 set_state_val(PART:"rect", STATE_MAP_ROT_Y, y);
113 set_state(PART:"rect", "custom", 0.0);
114 snprintf(buf, sizeof(buf), "Rot Y (%d)", round(y));
115 set_text(PART:"Y", buf);
116 }
117 }
118 program {
119 signal: "mouse,down,1";
120 source: "Z";
121 script {
122 new buf[32];
123 new Float:z = get_int(rotz) + 10;
124 set_int(rotz, round(z));
125 custom_state(PART:"rect", "default", 0.0);
126 set_state_val(PART:"rect", STATE_MAP_ROT_Z, z);
127 set_state(PART:"rect", "custom", 0.0);
128 snprintf(buf, sizeof(buf), "Rot Z (%d)", round(z));
129 set_text(PART:"Z", buf);
130 }
131 }
132 }
133 }
134}
diff --git a/legacy/edje/doc/examples/embryo_pong.edc b/legacy/edje/doc/examples/embryo_pong.edc
deleted file mode 100644
index 863b5648a9..0000000000
--- a/legacy/edje/doc/examples/embryo_pong.edc
+++ /dev/null
@@ -1,273 +0,0 @@
1
2#define DEBUG_ENABLE 0
3#define FPS 30
4#define COLOR_BG 50 50 50 255
5#define COLOR_FG 222 222 222 255
6#define PAD_SIZE 60
7#define PAD_DISTANCE 20
8#define BALL_SPEED 5.0
9#define BALL_SPEEDUP 0.1
10#define BALL_SIZE 10
11
12#if DEBUG_ENABLE
13#define DBG(...) { \
14 new _buf[128]; \
15 snprintf(_buf, sizeof(_buf), __VA_ARGS__); \
16 set_text(PART:"dbg", _buf); }
17#else
18#define DBG(...)
19#endif
20
21collections {
22 group { name: "main";
23 min: 500 300;
24 script {
25 public ballx, bally;
26 public ballspeedx, ballspeedy;
27 public player_score, ai_score;
28
29 public game_reset() {
30 set_int(ai_score, 0);
31 set_int(player_score, 0);
32 set_text(PART:"score1", "0");
33 set_text(PART:"score2", "0");
34 game_init();
35 }
36
37 public game_init() {
38 set_float(ballspeedx, 0.0);
39 set_float(ballspeedy, 0.0);
40 set_float(ballx, 100);
41 set_float(bally, 100);
42 }
43
44 public start_game() {
45 set_float(ballspeedx, BALL_SPEED);
46 set_float(ballspeedy, BALL_SPEED * randf());
47 }
48
49 public player_wins() {
50 new buf[16]
51 set_int(player_score, get_int(player_score) + 1);
52 snprintf(buf, sizeof(buf), "%d", get_int(player_score));
53 set_text(PART:"score1", buf);
54 game_init();
55 }
56
57 public ai_wins() {
58 new buf[16]
59 set_int(ai_score, get_int(ai_score) + 1);
60 snprintf(buf, sizeof(buf), "%d", get_int(ai_score));
61 set_text(PART:"score2", buf);
62 game_init();
63 }
64
65 public game_loop(count) {
66 count++;
67
68 /* get field geometry */
69 new fx, fy, fw, fh;
70 get_geometry(PART:"bg", fx, fy, fw, fh);
71
72 /* get mouse coords */
73 new mx, my;
74 get_mouse(mx, my);
75
76 /* get the ball info */
77 new Float:bx = get_float(ballx);
78 new Float:by = get_float(bally);
79 new Float:speedx = get_float(ballspeedx);
80 new Float:speedy = get_float(ballspeedy);
81
82 /* move the player pad */
83 new pady = my - PAD_SIZE / 2;
84 if (pady < 0) pady = 0;
85 else if (pady + PAD_SIZE > fh) pady = fh - PAD_SIZE;
86 custom_state(PART:"pad1", "default", 0.0);
87 set_state_val(PART:"pad1", STATE_REL1_OFFSET, 20, pady);
88 set_state(PART:"pad1", "custom", 0.0);
89
90 /* move the AI pad */
91 new pad2y = round(by) - PAD_SIZE / 2 - BALL_SIZE / 2;
92 if (pad2y < 0) pad2y = 0;
93 else if (pad2y + PAD_SIZE > fh) pad2y = fh - PAD_SIZE;
94 custom_state(PART:"pad2", "default", 0.0);
95 set_state_val(PART:"pad2", STATE_REL1_OFFSET, 20, pad2y);
96 set_state(PART:"pad2", "custom", 0.0);
97
98 /* calc new ball position */
99 bx += speedx;
100 by += speedy;
101
102 /* check walls collision */
103 if (by < 0)
104 {
105 speedy = -speedy;
106 by = 0;
107 }
108 else if (by + BALL_SIZE > fh)
109 {
110 speedy = -speedy;
111 by = fh - BALL_SIZE - 1;
112 }
113
114 /* check player pad collision */
115 if ((speedx < 0) &&
116 (bx < PAD_DISTANCE + 10) && (bx > 0) &&
117 (by + BALL_SIZE > pady) && (by < pady + PAD_SIZE))
118 {
119 new Float:dy = by - pady - PAD_SIZE / 2;
120 speedy += dy / 10;
121 speedx = -speedx + BALL_SPEEDUP;
122 }
123
124 /* check AI pad collision */
125 else if ((bx + BALL_SIZE > fw - PAD_DISTANCE - 10) &&
126 (bx + BALL_SIZE < fw) &&
127 (by + BALL_SIZE > pad2y) && (by < pad2y + PAD_SIZE))
128 {
129 new Float:dy = by - pad2y - PAD_SIZE / 2;
130 speedy += dy / 10;
131 speedx = -speedx - BALL_SPEEDUP;
132 }
133
134 /* apply the new ball position */
135 custom_state(PART:"ball", "default", 0.0);
136 set_state_val(PART:"ball", STATE_REL1_OFFSET, round(bx), round(by));
137 set_state(PART:"ball", "custom", 0.0);
138
139 /* update global vars */
140 set_float(ballx, bx);
141 set_float(bally, by);
142 set_float(ballspeedx, speedx);
143 set_float(ballspeedy, speedy);
144
145 /* AI score a point */
146 if (bx < 0) ai_wins();
147 /* player score a point */
148 if (bx + BALL_SIZE > fw) player_wins();
149
150 /* show debug info (if debug enabled) */
151 DBG("loop:%d [speed %f %f] [mouse: %d %d] [ball: %f %f]",
152 count, speedx, speedy, mx, my, bx, by)
153
154 /* recall the loop in n seconds */
155 timer(1.0 / FPS, "game_loop", count);
156 }
157 }
158 parts {
159 part { name: "bg";
160 type: RECT;
161 description { state: "default" 0.0;
162 color: COLOR_BG;
163 }
164 }
165 part { name: "net";
166 type: RECT;
167 description { state: "default" 0.0;
168 color: COLOR_FG;
169 max: 10 9999;
170 }
171 }
172 part { name: "score1";
173 type: TEXT;
174 description { state: "default" 0.0;
175 color: COLOR_FG;
176 rel2.relative: 0.5 0.5;
177 rel2.offset: -20 0;
178 text {
179 text: "0";
180 font: "Sans";
181 size: 50;
182 align: 1.0 0.0;
183 }
184 }
185 }
186 part { name: "score2";
187 type: TEXT;
188 description { state: "default" 0.0;
189 color: COLOR_FG;
190 rel1.relative: 0.5 0.0;
191 rel1.offset: 20 0;
192 text {
193 text: "0";
194 font: "Sans";
195 size: 50;
196 align: 0.0 0.0;
197 }
198 }
199 }
200 part { name: "pad1";
201 type: RECT;
202 description { state: "default" 0.0;
203 color: COLOR_FG;
204 max: 10 PAD_SIZE;
205 fixed: 1 1;
206 align: 0.0 0.0;
207 rel1.offset: PAD_DISTANCE 0;
208 }
209 }
210 part { name: "pad2";
211 type: RECT;
212 description { state: "default" 0.0;
213 color: COLOR_FG;
214 max: 10 PAD_SIZE;
215 fixed: 1 1;
216 align: 1.0 0.0;
217 rel2.offset: -PAD_DISTANCE 0;
218 }
219 }
220 part { name: "ball";
221 type: RECT;
222 description { state: "default" 0.0;
223 color: COLOR_FG;
224 max: BALL_SIZE BALL_SIZE;
225 fixed: 1 1;
226 align: 0.0 0.0;
227 rel1.offset: 100 100;
228 }
229 }
230 #if DEBUG_ENABLE
231 part { name: "dbg";
232 type: TEXT;
233 description { state: "default" 0.0;
234 color: 255 255 255 200;
235 text {
236 font: "Sans";
237 size: 12;
238 align: 1.0 1.0;
239 }
240 }
241 }
242 #endif
243 }
244 programs {
245 /* on load: reset the game and start the game loop */
246 program {
247 signal: "load";
248 source: "";
249 script {
250 game_reset();
251 timer(0.1 , "game_loop", 0);
252 }
253 }
254 /* mouse left click: start the game, if not yet started */
255 program {
256 signal: "mouse,down,1";
257 source: "bg";
258 script {
259 if (get_float(ballspeedx) == 0.0)
260 start_game();
261 }
262 }
263 /* mouse right click: restart the game*/
264 program {
265 signal: "mouse,down,3";
266 source: "bg";
267 script {
268 game_reset();
269 }
270 }
271 }
272 }
273}
diff --git a/legacy/edje/doc/examples/embryo_run_program.edc b/legacy/edje/doc/examples/embryo_run_program.edc
deleted file mode 100644
index 4833b930ee..0000000000
--- a/legacy/edje/doc/examples/embryo_run_program.edc
+++ /dev/null
@@ -1,66 +0,0 @@
1collections {
2 group { name: "main";
3 script {
4 public toggle;
5 }
6 parts {
7 part { name: "bg";
8 type: RECT;
9 description { state: "default" 0.0;
10 color: 255 255 255 255;
11 }
12 }
13 part { name: "label";
14 type: TEXT;
15 description { state: "default" 0.0;
16 color: 0 0 0 255;
17 text {
18 text: "Click me.";
19 font: "Sans";
20 size: 12;
21 align: 0.5 0.8;
22 }
23 }
24 }
25 part { name: "rect";
26 type: RECT;
27 description { state: "default" 0.0;
28 color: 255 0 0 255;
29 max: 30 30;
30 align: 0.1 0.2;
31 }
32 description { state: "default" 1.0;
33 inherit: "default" 0.0;
34 color: 0 0 255 255;
35 align: 0.9 0.2;
36 }
37 }
38 }
39 programs {
40 program { name: "go_right";
41 action: STATE_SET "default" 1.0;
42 transition: SINUSOIDAL 1.0;
43 target: "rect";
44 }
45 program { name: "go_left";
46 action: STATE_SET "default" 0.0;
47 transition: SINUSOIDAL 1.0;
48 target: "rect";
49 }
50 program {
51 signal: "mouse,down,1";
52 source: "label";
53 script {
54 if (get_int(toggle) == 0) {
55 run_program(PROGRAM:"go_right");
56 set_int(toggle, 1);
57 }
58 else {
59 run_program(PROGRAM:"go_left");
60 set_int(toggle, 0);
61 }
62 }
63 }
64 }
65 }
66}
diff --git a/legacy/edje/doc/examples/embryo_set_state.edc b/legacy/edje/doc/examples/embryo_set_state.edc
deleted file mode 100644
index e752fadda9..0000000000
--- a/legacy/edje/doc/examples/embryo_set_state.edc
+++ /dev/null
@@ -1,46 +0,0 @@
1collections {
2 group { name: "main";
3 parts {
4 part { name: "bg";
5 type: RECT;
6 description { state: "default" 0.0;
7 color: 255 255 255 255;
8 }
9 }
10 part { name: "label";
11 type: TEXT;
12 description { state: "default" 0.0;
13 color: 0 0 0 255;
14 text {
15 text: "Click me.";
16 font: "Sans";
17 size: 12;
18 align: 0.0 0.7;
19 }
20 }
21 }
22 part { name: "red_rect";
23 type: RECT;
24 description { state: "default" 0.0;
25 color: 255 0 0 255;
26 max: 30 30;
27 align: 0.1 0.2;
28 }
29 description { state: "default" 1.0;
30 inherit: "default" 0.0;
31 color: 0 0 255 255;
32 align: 0.9 0.2;
33 }
34 }
35 }
36 programs {
37 program {
38 signal: "mouse,down,1";
39 source: "label";
40 script {
41 set_state(PART:"red_rect", "default", 1.0);
42 }
43 }
44 }
45 }
46}
diff --git a/legacy/edje/doc/examples/embryo_set_text.edc b/legacy/edje/doc/examples/embryo_set_text.edc
deleted file mode 100644
index d656019fb1..0000000000
--- a/legacy/edje/doc/examples/embryo_set_text.edc
+++ /dev/null
@@ -1,39 +0,0 @@
1collections {
2 group { name: "main";
3 parts {
4 part { name: "bg";
5 type: RECT;
6 description { state: "default" 0.0;
7 color: 255 255 255 255;
8 }
9 }
10 part { name: "label";
11 type: TEXT;
12 description { state: "default" 0.0;
13 color: 0 0 0 255;
14 text {
15 text: "Click me.";
16 font: "Sans";
17 size: 12;
18 }
19 }
20 }
21 }
22 programs {
23 program {
24 signal: "mouse,down,1";
25 source: "label";
26 script {
27 set_text(PART:"label", "Clicked!");
28 }
29 }
30 program {
31 signal: "mouse,up,1";
32 source: "label";
33 script {
34 set_text(PART:"label", "Click me.");
35 }
36 }
37 }
38 }
39}
diff --git a/legacy/edje/doc/examples/embryo_timer.edc b/legacy/edje/doc/examples/embryo_timer.edc
deleted file mode 100644
index 2c2f8e510e..0000000000
--- a/legacy/edje/doc/examples/embryo_timer.edc
+++ /dev/null
@@ -1,90 +0,0 @@
1collections {
2 group { name: "main";
3 script {
4 public timer_cb(val) {
5 new x, y, w, h;
6 new buf[32];
7
8 /* set labels with object info */
9 get_geometry(PART:"red_rect", x, y, w, h);
10 snprintf(buf, sizeof(buf), "Timer called %d times.", val);
11 set_text(PART:"label1", buf)
12 snprintf(buf, sizeof(buf), "Object x: %d w: %d", x, w);
13 set_text(PART:"label2", buf)
14
15 /* renew the timer */
16 timer(1 / 30, "timer_cb", val + 1);
17 }
18 }
19 parts {
20 part { name: "bg";
21 type: RECT;
22 description { state: "default" 0.0;
23 color: 255 255 255 255;
24 }
25 }
26 part { name: "label1";
27 type: TEXT;
28 description { state: "default" 0.0;
29 color: 0 0 0 255;
30 text {
31 text: "";
32 font: "Sans";
33 size: 12;
34 align: 0.0 0.7;
35 }
36 }
37 }
38 part { name: "label2";
39 type: TEXT;
40 description { state: "default" 0.0;
41 color: 0 0 0 255;
42 text {
43 font: "Sans";
44 size: 12;
45 align: 0.0 0.8;
46 }
47 }
48 }
49 part { name: "red_rect";
50 type: RECT;
51 description { state: "default" 0.0;
52 color: 255 0 0 255;
53 max: 30 30;
54 align: 0.1 0.2;
55 }
56 description { state: "default" 1.0;
57 inherit: "default" 0.0;
58 color: 0 0 255 255;
59 max: 50 30;
60 align: 0.9 0.2;
61 }
62 }
63 }
64 programs {
65 /* move the red rect back an forth in a loop */
66 program { name: "init";
67 signal: "load";
68 source: "";
69 action: STATE_SET "default" 1.0;
70 transition: SINUSOIDAL 1.0;
71 target: "red_rect";
72 after: "loop";
73 }
74 program { name: "loop";
75 action: STATE_SET "default" 0.0;
76 transition: SINUSOIDAL 1.0;
77 target: "red_rect";
78 after: "init";
79 }
80 /* run the timer_cb for the first time */
81 program { name: "init2";
82 signal: "load";
83 source: "";
84 script {
85 timer_cb(0);
86 }
87 }
88 }
89 }
90}
diff --git a/legacy/edje/doc/examples/external_elm_anchorblock.edc b/legacy/edje/doc/examples/external_elm_anchorblock.edc
deleted file mode 100644
index 33f99daa43..0000000000
--- a/legacy/edje/doc/examples/external_elm_anchorblock.edc
+++ /dev/null
@@ -1,160 +0,0 @@
1
2#define LOREM "Vestibulum nunc mi, adipiscing dapibus turpis. Integer ornare \
3vestibulum. Quisque libero augue, non tristique tortor. Praesent urna augue, \
4blandit id sodales vel, varius at purus. Ut congue mollis elit, quis vehicula \
5enim ornare vitae. Suspendisse non faucibus massa. Nunc facilisis sapien ut \
6erat laoreet vitae pharetra purus commodo. Donec in ipsum justo, sit amet \
7lacinia massa. Pellentesque sed dolor lectus. Integer nec nisi ut massa \
8vestibulum vulputate mollis ut lacus. Morbi lobortis dictum lacus nec \
9faucibus. <item relsize=16x16 vsize=full href=emoticon/angry></item> \
10<item relsize=16x16 vsize=full href=emoticon/evil></item> \
11<item relsize=16x16 vsize=full href=emoticon/google-smile></item> \
12<item relsize=16x16 vsize=full href=emoticon/omg></item><br><br> \
13Phasellus ultricies nisl sit amet ligula tristique in adipiscing neque \
14vulputate. Maecenas est ante, porttitor eget commodo non, blandit et erat. \
15Duis adipiscing, tortor quis gravida vulputate, magna lorem mollis tortor, \
16elementum ullamcorper dui mi ut metus. Nunc dictum nisi sed arcu mattis \
17pellentesque. Aliquam erat volutpat. Nullam faucibus suscipit dui a \
18condimentum. Fusce a diam tortor. Curabitur egestas gravida magna, eget \
19lacinia magna fringilla in. Donec eget tincidunt ipsum. Suspendisse velit \
20massa, sollicitudin in laoreet a, posuere malesuada enim. \
21Duis a nulla purus.<br><br> \
22Aenean nec sodales lacus. Sed ipsum felis, blandit sed aliquet ac, viverra \
23vitae odio. Proin nisi nisi, commodo at cursus ut, auctor at elit. Sed tempor \
24placerat orci eget venenatis. Duis ut dolor nibh, non luctus tellus. Duis \
25placerat aliquet sem, et dignissim tellus rutrum at. Etiam sapien lacus, \
26auctor quis interdum vel, pellentesque sit amet arcu. Proin accumsan, mauris \
27non dapibus fermentum, nisl leo cursus nisi, eget auctor lacus ante a nisl. \
28Suspendisse ullamcorper suscipit mi, et blandit augue aliquet non. Aenean \
29vulputate ullamcorper ante, ut tincidunt orci sagittis nec. In hendrerit nunc \
30eget sapien eleifend luctus. Pellentesque vulputate diam ac arcu suscipit nec \
31vestibulum dolor blandit. Sed et massa vel ante tempor fermentum nec ac arcu. \
32Duis turpis odio, vehicula sit amet pellentesque non, facilisis quis ligula. \
33Sed ante nisl, cursus in pulvinar in, interdum vitae diam. Cras condimentum \
34diam ac purus tempor suscipit eget sed metus. Nam erat nunc, eleifend vitae \
35vehicula vitae, venenatis faucibus est. Nam auctor mauris metus. Nam eget \
36vehicula nunc. Nulla ut nisi id sapien rhoncus vestibulum."
37
38collections {
39 group { name: "main";
40 /* set a min window size */
41 min: 300 400;
42
43 /* tell edje that we are going to use elementary external parts */
44 externals {
45 external: "elm";
46 }
47
48 parts {
49 part { name: "bg";
50 type: RECT;
51 description { state: "default" 0.0;
52 color: 255 255 255 255;
53 }
54 }
55
56 part { name: "title";
57 type: TEXT;
58 effect: SOFT_SHADOW;
59 description { state: "default" 0.0;
60 color: 255 255 255 255;
61 color3: 70 70 70 70;
62 text {
63 text: "Elementary Anchorblock";
64 font: "Sans";
65 size: 16;
66 align: 0.5 0.0;
67 }
68 }
69 }
70
71 /* EXTERNAL elementary anchorblock */
72 part { name: "anchorblock";
73 type: EXTERNAL;
74 source: "elm/anchorblock";
75 description { state: "default" 0.0;
76 color: 200 200 0 200;
77 rel1.offset: 5 35;
78 rel2.offset: -6 -45;
79 align: 0.0 0.0;
80 map {
81 on: 1;
82 perspective_on: 1;
83 smooth: 1;
84 }
85 params.string: "text" LOREM;
86 }
87 description { state: "anim" 0.0;
88 inherit: "default" 0.0;
89 map.rotation.z: 100;
90 }
91 description { state: "anim" 0.1;
92 inherit: "default" 0.0;
93 map.rotation.y: 180;
94 }
95 description { state: "anim" 0.2;
96 inherit: "default" 0.0;
97 map.rotation.x: 150;
98 }
99 description { state: "anim" 0.3;
100 inherit: "default" 0.0;
101 map.rotation.z: 100;
102 map.rotation.y: 100;
103 }
104 }
105
106 /* EXTERNAL elementary button to trigger the animation */
107 part { name: "button";
108 type: EXTERNAL;
109 source: "elm/button";
110 description { state: "default" 0;
111 rel1 {
112 relative: 0.0 1.0;
113 offset: 5 -40;
114 }
115 rel2 {
116 offset: -6 -2;
117 }
118 params {
119 string: "label" "Animate";
120 }
121 }
122 }
123 }
124
125 programs {
126 /* button clicked, start the animation cycle */
127 program { name: "button_click";
128 signal: "clicked";
129 source: "button";
130 action: STATE_SET "anim" 0.0;
131 transition: LINEAR 1.0;
132 target: "anchorblock";
133 after: "anim2";
134 }
135 program { name: "anim2";
136 action: STATE_SET "anim" 0.1;
137 transition: LINEAR 1.0;
138 target: "anchorblock";
139 after: "anim3";
140 }
141 program { name: "anim3";
142 action: STATE_SET "anim" 0.2;
143 transition: LINEAR 1.0;
144 target: "anchorblock";
145 after: "anim4";
146 }
147 program { name: "anim4";
148 action: STATE_SET "anim" 0.3;
149 transition: LINEAR 1.0;
150 target: "anchorblock";
151 after: "anim5";
152 }
153 program { name: "anim5";
154 action: STATE_SET "default" 0.0;
155 transition: LINEAR 1.0;
156 target: "anchorblock";
157 }
158 }
159 }
160}
diff --git a/legacy/edje/doc/examples/external_elm_button.edc b/legacy/edje/doc/examples/external_elm_button.edc
deleted file mode 100644
index b7796d87ce..0000000000
--- a/legacy/edje/doc/examples/external_elm_button.edc
+++ /dev/null
@@ -1,270 +0,0 @@
1collections {
2 /* those 2 groups are used as custom icons for the buttons */
3 group { name: "icon_green";
4 parts {
5 part { name: "icon_green";
6 type: RECT;
7 description { state: "default" 0.0;
8 color: 0 255 0 255;
9 aspect: 1 1;
10 aspect_preference: VERTICAL;
11 }
12 }
13 }
14 }
15 group { name: "icon_red";
16 parts {
17 part { name: "icon_red";
18 type: RECT;
19 description { state: "default" 0.0;
20 color: 255 0 0 255;
21 aspect: 1 1;
22 aspect_preference: VERTICAL;
23 }
24 }
25 }
26 }
27
28 group { name: "main";
29 /* set a min window size */
30 min: 250 250;
31
32 /* tell edje that we are going to use elementary external parts */
33 externals {
34 external: "elm";
35 }
36
37 /* define global variables */
38 script {
39 public counter, toggle1, toggle2, toggle3, toggle4;
40 }
41
42 parts {
43 part { name: "bg";
44 type: RECT;
45 description { state: "default" 0.0;
46 color: 255 255 255 255;
47 }
48 }
49
50 part { name: "title";
51 type: TEXT;
52 effect: SOFT_SHADOW;
53 description { state: "default" 0.0;
54 color: 255 255 255 255;
55 color3: 70 70 70 70;
56 text {
57 text: "Elementary buttons";
58 font: "Sans";
59 size: 16;
60 align: 0.5 0.0;
61 }
62 }
63 }
64
65 /* bottom label used for reporting */
66 part { name: "label";
67 type: TEXT;
68 description { state: "default" 0.0;
69 color: 0 0 0 255;
70 text {
71 text: "try every buttons";
72 font: "Sans";
73 size: 12;
74 align: 0.5 1.0;
75 }
76 }
77 }
78
79 /* EXTERNAL elementary button with a label */
80 part { name: "bt1";
81 type: EXTERNAL;
82 source: "elm/button";
83 description { state: "default" 0;
84 rel1 {
85 offset: 5 35;
86 }
87 rel2 {
88 relative: 1.0 0.0;
89 offset: -6 60;
90 }
91 params {
92 string: "label" "Label only";
93 }
94 }
95 }
96
97 /* EXTERNAL elementary button with label + standard icon */
98 part { name: "bt2";
99 type: EXTERNAL;
100 source: "elm/button";
101 description { state: "default" 0;
102 rel1 {
103 to: "bt1";
104 relative: 0.0 1.0;
105 offset: 0 5;
106 }
107 rel2 {
108 to: "bt1";
109 relative: 1.0 2.0;
110 offset: -1 5;
111 }
112 params {
113 string: "label" "Label + standard icon";
114 string: "icon" "home";
115 }
116 }
117 }
118
119 /* EXTERNAL elementary button with a label and a custom icon */
120 part { name: "bt3";
121 type: EXTERNAL;
122 source: "elm/button";
123 description { state: "default" 0;
124 rel1 {
125 to: "bt2";
126 relative: 0.0 1.0;
127 offset: 0 5;
128 }
129 rel2 {
130 to: "bt2";
131 relative: 1.0 2.0;
132 offset: -1 5;
133 }
134 params {
135 string: "label" "Label + custom icon";
136 string: "icon" "icon_green";
137 }
138 }
139 }
140
141 /* EXTERNAL elementary button with just a standard icon */
142 part { name: "bt4";
143 type: EXTERNAL;
144 source: "elm/button";
145 description { state: "default" 0;
146 rel1 {
147 to: "bt3";
148 relative: 0.0 1.0;
149 offset: 0 5;
150 }
151 rel2 {
152 to: "bt3";
153 relative: 0.5 2.0;
154 offset: -6 5;
155 }
156 params {
157 string: "icon" "folder";
158 }
159 }
160 }
161
162 /* EXTERNAL elementary button with just a custom icon */
163 part { name: "bt5";
164 type: EXTERNAL;
165 source: "elm/button";
166 description { state: "default" 0;
167 rel1 {
168 to: "bt3";
169 relative: 0.5 1.0;
170 offset: 5 5;
171 }
172 rel2 {
173 to: "bt3";
174 relative: 1.0 2.0;
175 offset: 0 5;
176 }
177 params {
178 string: "icon" "icon_green";
179 }
180 }
181 }
182 }
183
184 programs {
185 /* bt1 clicked, change it's label and count the clicks */
186 program { name: "bt1_click";
187 signal: "clicked";
188 source: "bt1";
189 script {
190 new buf[32];
191 /* increment the global counter*/
192 set_int(counter, get_int(counter) + 1);
193 /* set the button label */
194 snprintf(buf, sizeof(buf), "Clicked %d times", get_int(counter));
195 external_param_set_str(PART:"bt1", "label", buf);
196 /* set the bottom label */
197 set_text(PART:"label", "button 1 clicked: set label");
198 }
199 }
200
201 /* bt2 clicked, toggle it's standard icon */
202 program { name: "bt2_click";
203 signal: "clicked";
204 source: "bt2";
205 script {
206 if (get_int(toggle1) == 0) {
207 external_param_set_str(PART:"bt2", "icon", "home");
208 set_int(toggle1, 1);
209 }
210 else {
211 external_param_set_str(PART:"bt2", "icon", "folder");
212 set_int(toggle1, 0);
213 }
214 set_text(PART:"label", "button 2 clicked: toggle icon");
215 }
216 }
217
218 /* bt3 clicked, toggle it's custom icon */
219 program { name: "bt3_click";
220 signal: "clicked";
221 source: "bt3";
222 script {
223 if (get_int(toggle2) == 0) {
224 external_param_set_str(PART:"bt3", "icon", "icon_red");
225 set_int(toggle2, 1);
226 }
227 else {
228 external_param_set_str(PART:"bt3", "icon", "icon_green");
229 set_int(toggle2, 0);
230 }
231 set_text(PART:"label", "button 3 clicked: toggle icon");
232 }
233 }
234
235 /* bt4 clicked, toggle it's icon */
236 program { name: "bt4_click";
237 signal: "clicked";
238 source: "bt4";
239 script {
240 if (get_int(toggle3) == 0) {
241 external_param_set_str(PART:"bt4", "icon", "home");
242 set_int(toggle3, 1);
243 }
244 else {
245 external_param_set_str(PART:"bt4", "icon", "folder");
246 set_int(toggle3, 0);
247 }
248 set_text(PART:"label", "button 4 clicked: toggle icon");
249 }
250 }
251
252 /* bt5 clicked, toggle it's icon */
253 program { name: "bt5_click";
254 signal: "clicked";
255 source: "bt5";
256 script {
257 if (get_int(toggle4) == 0) {
258 external_param_set_str(PART:"bt5", "icon", "icon_red");
259 set_int(toggle4, 1);
260 }
261 else {
262 external_param_set_str(PART:"bt5", "icon", "icon_green");
263 set_int(toggle4, 0);
264 }
265 set_text(PART:"label", "button 5 clicked: toggle icon");
266 }
267 }
268 }
269 }
270}
diff --git a/legacy/edje/doc/examples/external_elm_check.edc b/legacy/edje/doc/examples/external_elm_check.edc
deleted file mode 100644
index 0d5423f1c1..0000000000
--- a/legacy/edje/doc/examples/external_elm_check.edc
+++ /dev/null
@@ -1,211 +0,0 @@
1collections {
2 /* this groups is used as custom icon */
3 group { name: "icon_green";
4 parts {
5 part { name: "icon_green";
6 type: RECT;
7 description { state: "default" 0.0;
8 color: 0 255 0 255;
9 aspect: 1 1;
10 aspect_preference: VERTICAL;
11 }
12 }
13 }
14 }
15
16 group { name: "main";
17 /* set a min window size */
18 min: 200 300;
19
20 /* tell edje that we are going to use elementary external parts */
21 externals {
22 external: "elm";
23 }
24
25 parts {
26 part { name: "bg";
27 type: RECT;
28 description { state: "default" 0.0;
29 color: 255 255 255 255;
30 }
31 }
32
33 part { name: "title";
34 type: TEXT;
35 effect: SOFT_SHADOW;
36 description { state: "default" 0.0;
37 color: 255 255 255 255;
38 color3: 70 70 70 70;
39 text {
40 text: "Elementary Checks";
41 font: "Sans";
42 size: 16;
43 align: 0.5 0.0;
44 }
45 }
46 }
47
48 /* EXTERNAL elementary check with a label */
49 part { name: "check1";
50 type: EXTERNAL;
51 source: "elm/check";
52 description { state: "default" 0;
53 rel1 {
54 offset: 5 35;
55 }
56 rel2 {
57 relative: 1.0 0.0;
58 offset: -6 60;
59 }
60 params {
61 string: "label" "Label only";
62 }
63 }
64 }
65
66 /* EXTERNAL elementary check with label + standard icon */
67 part { name: "check2";
68 type: EXTERNAL;
69 source: "elm/check";
70 description { state: "default" 0;
71 rel1 {
72 to: "check1";
73 relative: 0.0 1.0;
74 offset: 0 5;
75 }
76 rel2 {
77 to: "check1";
78 relative: 1.0 2.0;
79 offset: -1 5;
80 }
81 params {
82 string: "label" "Label + standard icon";
83 string: "icon" "home";
84 }
85 }
86 }
87
88 /* EXTERNAL elementary check with a label and a custom icon */
89 part { name: "check3";
90 type: EXTERNAL;
91 source: "elm/check";
92 description { state: "default" 0;
93 rel1 {
94 to: "check2";
95 relative: 0.0 1.0;
96 offset: 0 5;
97 }
98 rel2 {
99 to: "check2";
100 relative: 1.0 2.0;
101 offset: -1 5;
102 }
103 params {
104 string: "label" "Label + custom icon";
105 string: "icon" "icon_green";
106 }
107 }
108 }
109
110 /* EXTERNAL elementary check with just a custom icon */
111 part { name: "check4";
112 type: EXTERNAL;
113 source: "elm/check";
114 description { state: "default" 0;
115 rel1 {
116 to: "check3";
117 relative: 0.0 1.0;
118 offset: 0 5;
119 }
120 rel2 {
121 to: "check3";
122 relative: 1.0 2.0;
123 offset: -1 5;
124 }
125 params {
126 string: "icon" "home";
127 }
128 }
129 }
130
131 /* EXTERNAL elementary check with just a custom icon */
132 part { name: "check5";
133 type: EXTERNAL;
134 source: "elm/check";
135 description { state: "default" 0;
136 rel1 {
137 to: "check4";
138 relative: 0.0 1.0;
139 offset: 0 5;
140 }
141 rel2 {
142 to: "check4";
143 relative: 1.0 2.0;
144 offset: -1 5;
145 }
146 params {
147 string: "icon" "icon_green";
148 }
149 }
150 }
151 }
152
153 programs {
154 /* on edje load start the programs loop */
155 program {
156 signal: "load";
157 after: "loop1";
158 }
159
160 /* wait 0.2, toggle the state of check1, trigger next prog */
161 program { name: "loop1";
162 in: 0.2 0.0;
163 script {
164 external_param_set_bool(PART:"check1", "state",
165 !external_param_get_bool(PART:"check1", "state"));
166 }
167 after: "loop2";
168 }
169
170 /* wait 0.2, toggle the state of check2, trigger next prog */
171 program { name: "loop2";
172 in: 0.2 0.0;
173 script {
174 external_param_set_bool(PART:"check2", "state",
175 !external_param_get_bool(PART:"check2", "state"));
176 }
177 after: "loop3";
178 }
179
180 /* wait 0.2, toggle the state of check3, trigger next prog */
181 program { name: "loop3";
182 in: 0.2 0.0;
183 script {
184 external_param_set_bool(PART:"check3", "state",
185 !external_param_get_bool(PART:"check3", "state"));
186 }
187 after: "loop4";
188 }
189
190 /* wait 0.2, toggle the state of check4, trigger next prog */
191 program { name: "loop4";
192 in: 0.2 0.0;
193 script {
194 external_param_set_bool(PART:"check4", "state",
195 !external_param_get_bool(PART:"check4", "state"));
196 }
197 after: "loop5";
198 }
199
200 /* wait 0.2, toggle the state of check5, restart from the first prog */
201 program { name: "loop5";
202 in: 0.2 0.0;
203 script {
204 external_param_set_bool(PART:"check5", "state",
205 !external_param_get_bool(PART:"check5", "state"));
206 }
207 after: "loop1";
208 }
209 }
210 }
211}
diff --git a/legacy/edje/doc/examples/external_elm_panes.edc b/legacy/edje/doc/examples/external_elm_panes.edc
deleted file mode 100644
index 8833668f7c..0000000000
--- a/legacy/edje/doc/examples/external_elm_panes.edc
+++ /dev/null
@@ -1,140 +0,0 @@
1collections {
2 /* tell edje that we are going to use elementary external parts */
3 externals {
4 external: "elm";
5 }
6
7 /* those groups are the buttons used as content for the panes */
8 group { name: "button1";
9 parts {
10 part { name: "btn";
11 type: EXTERNAL;
12 source: "elm/button";
13 description { state: "default" 0.0;
14 params.string: "label" "Left";
15 }
16 }
17 }
18 }
19 group { name: "button2";
20 parts {
21 part { name: "btn";
22 type: EXTERNAL;
23 source: "elm/button";
24 description { state: "default" 0.0;
25 params.string: "label" "Top";
26 }
27 }
28 }
29 }
30 group { name: "button3";
31 parts {
32 part { name: "btn";
33 type: EXTERNAL;
34 source: "elm/button";
35 description { state: "default" 0.0;
36 params.string: "label" "Right";
37 }
38 }
39 }
40 }
41
42 /* this is the vertical panes */
43 group { name: "panes2";
44 parts {
45 part { name: "panes";
46 type: EXTERNAL;
47 source: "elm/panes";
48 description { state: "default" 0.0;
49 params {
50 bool: "horizontal" 1;
51 string: "content left" "button2";
52 string: "content right" "button3";
53 }
54 }
55 }
56 }
57 }
58
59 group { name: "main";
60 /* set a min window size */
61 min: 300 400;
62
63 parts {
64 part { name: "bg";
65 type: RECT;
66 description { state: "default" 0.0;
67 color: 255 255 255 255;
68 }
69 }
70
71 part { name: "title";
72 type: TEXT;
73 effect: SOFT_SHADOW;
74 description { state: "default" 0.0;
75 color: 255 255 255 255;
76 color3: 70 70 70 70;
77 text {
78 text: "Elementary Panes";
79 font: "Sans";
80 size: 16;
81 align: 0.5 0.0;
82 }
83 }
84 }
85
86 /* first panes (horiz) */
87 part { name: "panes1";
88 type: EXTERNAL;
89 source: "elm/panes";
90 description { state: "default" 0.0;
91 rel1.offset: 0 35;
92 rel2.offset: 0 -45;
93 params {
94 string: "content left" "button1";
95 string: "content right" "panes2";
96 }
97 }
98 description { state: "swapped" 0.0;
99 inherit: "default" 0.0;
100 params {
101 string: "content left" "panes2";
102 string: "content right" "button1";
103 }
104 }
105 }
106
107 /* button used to swap the content of the panes1 */
108 part { name: "swap_button";
109 type: EXTERNAL;
110 source: "elm/button";
111 description { state: "default" 0.0;
112 rel1 {
113 relative: 0.0 1.0;
114 offset: 0 -40;
115 }
116 params {
117 string: "label" "Swap & back";
118 }
119 }
120 }
121 }
122
123 programs {
124 /* when button is pressed set the 'swapped' state */
125 program { name: "swap";
126 signal: "clicked";
127 source: "swap_button";
128 action: STATE_SET "swapped" 0.0;
129 target: "panes1";
130 after: "go_back";
131 }
132 /* after 1 second return to the 'default' state */
133 program { name: "go_back";
134 in: 1.0 0.0;
135 action: STATE_SET "default" 0.0;
136 target: "panes1";
137 }
138 }
139 }
140}
diff --git a/legacy/edje/doc/examples/external_emotion_elm.edc b/legacy/edje/doc/examples/external_emotion_elm.edc
deleted file mode 100644
index 686e10f3e4..0000000000
--- a/legacy/edje/doc/examples/external_emotion_elm.edc
+++ /dev/null
@@ -1,239 +0,0 @@
1/*
2 Super-concise video player example using Edje/Emotion/Elementary.
3
4 This is all in Edje by means of type:EXTERNAL, you don't need any C
5 code other than emotion and edje installed with edje_external
6 support enabled.
7
8 Compile: edje_cc external-emotion-elm.edc
9 Run....: edje_player external-emotion-elm.edj
10
11 */
12collections {
13 group { name: "main";
14 min: 350 200; /* set a min window size */
15
16 externals { /* declare the modules you want to load */
17 external: "emotion"; /* video player engine */
18 external: "elm"; /* toolkit/widgets */
19 }
20
21 parts {
22 part { name: "bg"; /* dark gray rectangle as background */
23 type: RECT;
24 description { state: "default" 0.0;
25 color: 64 64 64 255;
26 }
27 }
28
29 part { name: "video"; /* video object */
30 type: EXTERNAL;
31 source: "emotion";
32 description { state: "default" 0.0;
33 params {
34 /* explicitly select the emotion engine
35 * ['xine', 'gstreamer' or 'vlc']
36 * or comment the line to autoselect the engine */
37 // choice: "engine" "gstreamer";
38 }
39 }
40 }
41
42 part { name: "title";
43 type: TEXT;
44 effect: SOFT_SHADOW;
45 description { state: "default" 0.0;
46 color: 255 255 255 0;
47 color3: 0 0 0 0;
48 align: 0.5 0.0;
49 rel1 {
50 relative: 0.0 0.0;
51 offset: 10 2;
52 }
53 rel2 {
54 relative: 1.0 0.0;
55 offset: -11 10;
56 }
57 text {
58 font: "Sans:style=Bold";
59 align: 0.5 0.0;
60 size: 10;
61 min: 0 1;
62 text: "";
63 }
64 }
65 description { state: "visible" 0.0;
66 inherit: "default" 0.0;
67 color: 255 255 255 255;
68 color3: 0 0 0 255;
69 }
70 }
71
72 part { name: "controls-clipper"; /* clipper to control visibility */
73 type: RECT;
74 description { state: "default" 0.0;
75 color: 255 255 255 32;
76 }
77 description { state: "visible" 0.0;
78 color: 255 255 255 255;
79 }
80 }
81
82 part { name: "controls-bg"; /* controls background as
83 semi-transparent black at bottom edge */
84 type: RECT;
85 clip_to: "controls-clipper";
86 description { state: "default" 0.0;
87 color: 0 0 0 128;
88 rel1 {
89 relative: 0.0 1.0;
90 offset: 0 -40;
91 }
92 rel2 {
93 relative: 1.0 1.0;
94 offset: -1 -1;
95 }
96 }
97 }
98
99 part { name: "play"; /* play button at bottom-left (relative
100 to controls-bg) */
101 type: EXTERNAL;
102 source: "elm/button";
103 clip_to: "controls-clipper";
104 description { state: "default" 0.0;
105 rel1 {
106 relative: 0.0 0.0;
107 offset: 0 0;
108 to: "controls-bg";
109 }
110 rel2 {
111 relative: 0.0 1.0;
112 offset: 50 -1;
113 to: "controls-bg";
114 }
115 params.string: "icon" "apps";
116 }
117 }
118
119 part { name: "open"; /* open file button next to play button */
120 type: EXTERNAL;
121 source: "elm/fileselector_button";
122 clip_to: "controls-clipper";
123 description { state: "default" 0.0;
124 rel1 {
125 relative: 0.0 0.0;
126 offset: 52 0;
127 to: "controls-bg";
128 }
129 rel2 {
130 relative: 0.0 1.0;
131 offset: 102 -1;
132 to: "controls-bg";
133 }
134 params.string: "icon" "folder";
135 }
136 }
137
138 part { name: "time"; /* time/progress */
139 type: EXTERNAL;
140 source: "elm/slider";
141 clip_to: "controls-clipper";
142 description { state: "default" 0.0;
143 rel1 {
144 relative: 0.0 0.0;
145 offset: 104 0;
146 to: "controls-bg";
147 }
148 rel2 {
149 relative: 1.0 1.0;
150 offset: -1 -1;
151 to: "controls-bg";
152 }
153 }
154 }
155
156 part { name: "controls-eventarea"; /* event area so we catch mouse in
157 and out, repeat events so
158 buttons get them */
159 type: RECT;
160 repeat_events: 1;
161 description {
162 state: "default" 0.0;
163 color: 255 255 255 0; /* fully transparent as we don't
164 need any visual feedback */
165 rel1.to: "controls-bg";
166 rel2.to: "controls-bg";
167 }
168 }
169
170 programs {
171 /* animated 0.2 linear fade in/out if mouse is over controls */
172 program { signal: "mouse,in";
173 source: "controls-eventarea";
174 action: STATE_SET "visible" 0.0;
175 transition: LINEAR 0.2;
176 target: "controls-clipper";
177 target: "title";
178 }
179 program { signal: "mouse,out";
180 source: "controls-eventarea";
181 action: STATE_SET "default" 0.0;
182 transition: LINEAR 0.2;
183 target: "controls-clipper";
184 target: "title";
185 }
186
187 /* toggle video playing state when play is clicked */
188 program { name: "toggle-play-video";
189 signal: "clicked";
190 source: "play";
191 script {
192 new v = external_param_get_bool(PART:"video", "play");
193 external_param_set_bool(PART:"video", "play", !v);
194 }
195 }
196
197 /* whenever file is chosen, set and play it */
198 program { signal: "file,chosen";
199 source: "open";
200 action: PARAM_COPY "open" "path" "video" "file";
201 after: "play-video";
202 after: "set-title";
203 }
204 program { name: "play-video";
205 action: PARAM_SET "video" "play" "1";
206 }
207 program { name: "set-title";
208 action: PARAM_COPY "open" "path" "title" "text";
209 }
210
211 /* if position changes, set slider (time) */
212 program { signal: "position_update";
213 source: "video";
214 script {
215 new Float:p, Float:len;
216
217 p = external_param_get_float(PART:"video", "position");
218 len = external_param_get_float(PART:"video", "play_length");
219 if (len > 0.0)
220 external_param_set_float(PART:"time", "value", p / len);
221 }
222 }
223
224 /* if slider (time) changes, set the position (seek) */
225 program { signal: "changed";
226 source: "time";
227 script {
228 new Float:v, Float:len;
229
230 v = external_param_get_float(PART:"time", "value");
231 len = external_param_get_float(PART:"video", "play_length");
232 if (len > 0.0)
233 external_param_set_float(PART:"video", "position", v * len);
234 }
235 }
236 }
237 }
238 }
239}
diff --git a/legacy/edje/doc/examples/lua_script.edc b/legacy/edje/doc/examples/lua_script.edc
deleted file mode 100644
index be0bafe88d..0000000000
--- a/legacy/edje/doc/examples/lua_script.edc
+++ /dev/null
@@ -1,146 +0,0 @@
1collections {
2 group { name: "example";
3 lua_script_only: 1;
4 lua_script {
5 --// stick object private/local vars here
6 local D;
7 local count = 0;
8 local fndata = 99;
9
10 local function mycb3 (v)
11 print("lua::callback transition " .. D.val .. " v: " .. v);
12 d = {};
13 edje.size(d);
14 print("lua::objsize= " .. d.w .. " , " .. d.h);
15 sz = {w=v * 80, h=v * 40};
16 D.rect:geom(((d.w / 2) * math.sin(v * 2 * math.pi)) + ((d.w - sz.w) / 2),
17 ((d.h / 2) * math.cos(v * 2 * math.pi)) + ((d.h - sz.h) / 2),
18 sz.w, sz.h);
19 D.rect:color(255, 128, v * 255, 255);
20 D.rect:move(d);
21 print("lua::pos= " .. d.x .. " , " .. d.y);
22
23 r = D.rect:above();
24 if (r ~= nil) then
25 print("lua::rcol");
26 r:color(20, v * 255, 60, 255);
27 else
28 print("lua::r none!!!!!!!!!!!!!!1");
29 end
30 d = edje.size();
31 D.clip:geom(10, 10, d.w - 20, d.h - 20);
32 c = D.clip:clipees();
33 for i=1,table.getn(c),1 do
34 d = c[i]:geom();
35 print("lua::" .. i .. " geom = " .. d.x .. "," .. d.y .. " " .. d.w .. "x" .. d.h);
36 end
37 return true; --// repeat the timer
38 end
39
40 local function mycb2 ()
41 print("lua::callback animator " .. count);
42 print("lua:: seconds: " .. edje.seconds());
43 print("lua:: looptime: " .. edje.looptime());
44 local date = edje.date();
45 print("lua:: date: " ..
46 date.year .. "|" ..
47 date.month .. "|" ..
48 date.day .. "|" ..
49 date.yearday .. "|" ..
50 date.weekday .. "|" ..
51 date.hour .. "|" ..
52 date.min .. "|" ..
53 date.sec
54 );
55 return true; --// repeat the timer
56 end
57
58 local function mycb ()
59 print("lua::callback " .. count .. " fndata = " .. fndata);
60 count = count + 1; --// keep count of calls - object data
61 fndata = fndata + 3; --// play with object vars to see if they persist
62 D.tim = edje.timer(0.25, mycb); --// inside cb add new timer
63 D.ani = edje.animator(mycb2);
64 return false; --// cease repeating the timer
65 end
66
67 --// init object here
68 D = {}; --// data is empty table to start
69 D.val = math.random(); --// start with some random value so
70 fndata = fndata + D.val; --// func data start point
71 print("lua::init ... " .. D.val);
72 edje.echo("lua::echo('hello world')");
73
74 --// actually add the timer to call mycb in 1.23 sec
75 D.tim = edje.timer(1.23, mycb);
76 D.tra = edje.transition(5.0, mycb3);
77
78 if (edje.spanky) then edje.spanky(); end
79
80 --// send some random edje message
81 edje.messagesend(7, "none" );
82 edje.messagesend(7, "sig", "signal", "source");
83 edje.messagesend(7, "str", "hello world");
84 edje.messagesend(7, "int", 987);
85 edje.messagesend(7, "float", 987.321);
86 edje.messagesend(7, "strset", {"hello", "there", "world"});
87 edje.messagesend(7, "intset", {1, 2, 3});
88 edje.messagesend(7, "floatset", {1.1, 2.2, 3.3});
89 edje.messagesend(7, "strint", "hello world", 7);
90 edje.messagesend(7, "strfloat", "hello world", 7.654);
91 edje.messagesend(7, "strintset","hello world", {1, 2, 3});
92
93 D.rect = edje.rect();
94 D.rect:geom (5, 10, 50, 30);
95 D.rect:color (255, 128, 60, 255);
96 D.rect:show ();
97
98 D.rect2 = edje.rect();
99 D.rect2:geom (50, 50, 50, 50);
100 D.rect2:color (20, 30, 60, 120);
101 D.rect2:show ();
102
103 D.clip = edje.rect();
104 D.clip:geom (10, 10, 150, 150);
105 D.clip:color (200, 200, 50, 200);
106 D.clip:show ();
107
108 D.rect2:clip(D.clip);
109 D.rect:clip(D.clip);
110
111 --// example of deleting something
112 --// D.tim:del();
113
114 --// shutdown func - generally empty or not there. everything gcd for you
115 function shutdown ()
116 print("lua::shutdown ... " .. D.val);
117 end
118 function show ()
119 print("lua::show ... " .. D.val);
120 end
121 function hide ()
122 print("lua::hide ... " .. D.val);
123 end
124 function move (x, y)
125 print("lua::move ... " .. D.val);
126 print(" x=" .. x .. " x=" .. y);
127 end
128 function resize (w, h)
129 print("lua::resize ... " .. D.val);
130 print(" w=" .. w .. " h=" .. h);
131 end
132 function message (id, type, v1, v2)
133 print("lua::message ... " .. D.val);
134 print(" id=" .. id .. " type=" .. type);
135 --// handle youre message type here. chekc id + type then use v1
136 --// and/or v2 (or neither) appropriately. they are the same as
137 --// the 2nd and 3rd param passed to edje.messagesend() (if any
138 --// are passed at all)
139 end
140 function signal (sig, src)
141 print("lua::signal ... " .. D.val);
142 print(" sig=" .. sig .. " src=" .. src);
143 end
144 }
145 }
146}
diff --git a/legacy/edje/doc/examples/toggle_using_filter.edc b/legacy/edje/doc/examples/toggle_using_filter.edc
deleted file mode 100644
index 9971fc0b50..0000000000
--- a/legacy/edje/doc/examples/toggle_using_filter.edc
+++ /dev/null
@@ -1,66 +0,0 @@
1collections {
2 group { name: "main";
3 parts {
4 /* white background */
5 part { name: "bg";
6 type: RECT;
7 description { state: "default" 0.0;
8 color: 255 255 255 255;
9 }
10 }
11 /* title label */
12 part { name: "title";
13 type: TEXT;
14 description { state: "default" 0.0;
15 color: 0 0 0 255;
16 text {
17 text: "Toggle using filter";
18 font: "Sans";
19 size: 12;
20 align: 0.5 0.0;
21 }
22 }
23 }
24 /* the rectangle, will toggle color on click */
25 part { name: "rect";
26 type: RECT;
27 mouse_events: 1;
28 description { state: "default" 0.0;
29 color: 255 0 0 150;
30 max: 150 150;
31 align: 0.5 0.5;
32 map {
33 on: 1;
34 perspective_on: 1;
35 smooth: 1;
36 alpha: 1;
37 }
38 }
39 description { state: "blue" 0.0;
40 inherit: "default" 0.0;
41 color: 0 0 255 255;
42 }
43 }
44 }
45 programs {
46 /* on mouse click set the blue state, if we are in the default state */
47 program {
48 signal: "mouse,down,1";
49 source: "rect";
50 filter: "rect" "default";
51 action: STATE_SET "blue" 0.0;
52 transition: SINUSOIDAL 0.4;
53 target: "rect";
54 }
55 /* or back to the default state if we are in the blue state */
56 program {
57 signal: "mouse,down,1";
58 source: "rect";
59 filter: "rect" "blue";
60 action: STATE_SET "default" 0.0;
61 transition: SINUSOIDAL 0.4;
62 target: "rect";
63 }
64 }
65 }
66}