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