efl
1collections {
2group { name: "main";
3script {
4public timer_cb(val) {
5new x, y, w, h;
6new buf[32];
7
8/* set labels with object info */
9get_geometry(PART:"red_rect", x, y, w, h);
10snprintf(buf, sizeof(buf), "Timer called %d times.", val);
11set_text(PART:"label1", buf)
12snprintf(buf, sizeof(buf), "Object x: %d w: %d", x, w);
13set_text(PART:"label2", buf)
14
15/* renew the timer */
16timer(1 / 30, "timer_cb", val + 1);
17}
18}
19parts {
20part { name: "bg";
21type: RECT;
22description { state: "default" 0.0;
23color: 255 255 255 255;
24}
25}
26part { name: "label1";
27type: TEXT;
28description { state: "default" 0.0;
29color: 0 0 0 255;
30text {
31text: "";
32font: "Sans";
33size: 12;
34align: 0.0 0.7;
35}
36}
37}
38part { name: "label2";
39type: TEXT;
40description { state: "default" 0.0;
41color: 0 0 0 255;
42text {
43font: "Sans";
44size: 12;
45align: 0.0 0.8;
46}
47}
48}
49part { name: "red_rect";
50type: RECT;
51description { state: "default" 0.0;
52color: 255 0 0 255;
53max: 30 30;
54align: 0.1 0.2;
55}
56description { state: "default" 1.0;
57inherit: "default" 0.0;
58color: 0 0 255 255;
59max: 50 30;
60align: 0.9 0.2;
61}
62}
63}
64programs {
65/* move the red rect back an forth in a loop */
66program { name: "init";
67signal: "load";
68source: "";
69action: STATE_SET "default" 1.0;
70transition: SINUSOIDAL 1.0;
71target: "red_rect";
72after: "loop";
73}
74program { name: "loop";
75action: STATE_SET "default" 0.0;
76transition: SINUSOIDAL 1.0;
77target: "red_rect";
78after: "init";
79}
80/* run the timer_cb for the first time */
81program { name: "init2";
82signal: "load";
83source: "";
84script {
85timer_cb(0);
86}
87}
88}
89}
90}
91