Imported Upstream version 1.7.1
[platform/upstream/edje.git] / src / examples / embryo_run_program.edc
1 collections {
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 }