theme cleanup
[profile/ivi/lemolo.git] / data / themes / includes / main.edc
1 group {
2    name: "elm/layout/dialer/main";
3
4    min: WIDTH HEIGHT;
5
6    /*
7     * Represents the dialer main layout with actions and swallows.
8     *
9     * Parts:
10     *   SWALLOW: elm.swallow.keypad
11     *   SWALLOW: elm.swallow.contacts
12     *   SWALLOW: elm.swallow.history
13     *   SWALLOW: elm.swallow.activecall
14     *
15     * Signals:
16     *   Emit (source is "gui"):
17     *     pressed,<ID>:  key <ID> was pressed
18     *     released,<ID>: key <ID> was released
19     *     clicked,<ID>:  key <ID> was clicked (press and release in the key)
20     *   Listens (source is "gui"):
21     *     show,<ID>:       have <ID> to be visible (swallow and action)
22     *     toggle,on,<ID>:  force <ID> to be marked as selected
23     *     toggle,off,<ID>: force <ID> to be marked as unselected
24     *
25     * Where <ID> is: keypad, contacts, history, activecall.
26     */
27
28    images {
29       image: "ico_keypad.png" COMP;
30       image: "ico_contacts.png" COMP;
31       image: "ico_history.png" COMP;
32    }
33
34    parts {
35       part {
36          name: "bg";
37          type: RECT;
38          mouse_events: 0;
39          description {
40             state: "default" 0.0;
41             color: 0 0 0 255;
42          }
43       }
44
45       part {
46          name: "elm.swallow.activecall";
47          type: SWALLOW;
48          api: "activecall" "where to place the active call, if any";
49          description {
50             state: "default" 0.0;
51             visible: 0;
52             align: 0.5 0.0;
53             fixed: 1 1;
54             visible: 1;
55             rel2 {
56                relative: 1.0 0.0;
57                offset: -1 -1;
58             }
59          }
60          description {
61             state: "visible" 0.0;
62             inherit: "default" 0.0;
63             visible: 1;
64          }
65       }
66       programs {
67          program {
68             signal: "show,activecall";
69             source: "gui";
70             action: STATE_SET "visible" 0.0;
71             target: "elm.swallow.activecall";
72             api: "activecall_show" "make the activecall swallow visible";
73          }
74          program {
75             signal: "hide,activecall";
76             source: "gui";
77             action: STATE_SET "default" 0.0;
78             target: "elm.swallow.activecall";
79             api: "activecall_hide" "make the activecall swallow hidden";
80          }
81       }
82
83       part {
84          name: "elm.swallow.keypad";
85          type: SWALLOW;
86          api: "keypad" "where to place the keypad";
87          description {
88             state: "default" 0.0;
89             rel1 {
90                to_y: "elm.swallow.activecall";
91                relative: 0.0 1.0;
92                offset: 0 0;
93             }
94          rel2.offset: -1 (-ACTION_HEIGHT - 1);
95          }
96          description {
97             state: "hidden" 0.0;
98             inherit: "default" 0.0;
99             visible: 0;
100          }
101       }
102       part {
103          name: "elm.swallow.contacts";
104          type: SWALLOW;
105          api: "contacts" "where to place the contacts";
106          description {
107             state: "default" 0.0;
108             rel1 {
109                to_y: "elm.swallow.activecall";
110                relative: 0.0 1.0;
111                offset: 0 0;
112             }
113          rel2.offset: -1 (-ACTION_HEIGHT - 1);
114          }
115          description {
116             state: "hidden" 0.0;
117             inherit: "default" 0.0;
118             visible: 0;
119          }
120       }
121       part {
122          name: "elm.swallow.history";
123          type: SWALLOW;
124          api: "history" "where to place the history";
125          description {
126             state: "default" 0.0;
127             rel1 {
128                to_y: "elm.swallow.activecall";
129                relative: 0.0 1.0;
130                offset: 0 0;
131             }
132          rel2.offset: -1 (-ACTION_HEIGHT - 1);
133          }
134          description {
135             state: "hidden" 0.0;
136             inherit: "default" 0.0;
137             visible: 0;
138          }
139       }
140
141       part {
142          name: "bg.actions";
143          type: RECT;
144          mouse_events: 0;
145          description {
146             state: "default" 0.0;
147             color: 0 0 0 0;
148             min: WIDTH ACTION_HEIGHT;
149             max: WIDTH 99999; /* keep it tight centered */
150             fixed: 1 1;
151             rel1 {
152                relative: 0.0 1.0;
153                offset: 0 -ACTION_HEIGHT;
154             }
155          }
156       }
157
158 #define ACTION_TOGGLE(id, x1, x2)                                       \
159       part {                                                            \
160          name: "button."##id;                                           \
161          type: RECT;                                                    \
162          mouse_events: 1;                                               \
163          clip_to: "clipper.toggle."##id;                                \
164          description {                                                  \
165             state: "default" 0.0;                                       \
166             color: 255 255 255 0;                                       \
167             color_class: "action";                                      \
168             min: ACTION_WIDTH ACTION_HEIGHT;                            \
169             max: ACTION_WIDTH ACTION_HEIGHT;                            \
170             fixed: 1 1;                                                 \
171             rel1 {                                                      \
172                to: "bg.actions";                                        \
173                relative: x1 0.0;                                        \
174             }                                                           \
175             rel2 {                                                      \
176                to: "bg.actions";                                        \
177                relative: x2 1.0;                                        \
178                offset: -1 -1;                                           \
179             }                                                           \
180          }                                                              \
181          description {                                                  \
182             state: "pressed" 0.0;                                       \
183             inherit: "default" 0.0;                                     \
184             color: 255 255 255 255;                                     \
185          }                                                              \
186       }                                                                 \
187       part {                                                            \
188          name: "button.ico."##id;                                       \
189          type: IMAGE;                                                   \
190          mouse_events: 0;                                               \
191          clip_to: "clipper.toggle."##id;                                \
192          description {                                                  \
193             state: "default" 0.0;                                       \
194             color: 255 255 255 255;                                     \
195             color_class: "action";                                      \
196             min: ACTION_HEIGHT ACTION_HEIGHT;                           \
197             max: ACTION_HEIGHT ACTION_HEIGHT;                           \
198             fixed: 1 1;                                                 \
199             rel1.to: "button."##id;                                     \
200             rel2.to: "button."##id;                                     \
201             image.normal: "ico_"##id".png";                             \
202          }                                                              \
203          description {                                                  \
204             state: "pressed" 0.0;                                       \
205             inherit: "default" 0.0;                                     \
206             color_class: "bg";                                          \
207          }                                                              \
208       }                                                                 \
209       part {                                                            \
210          name: "clipper.toggle."##id;                                   \
211          type: RECT;                                                    \
212          mouse_events: 0;                                               \
213          description {                                                  \
214             state: "default" 0.0;                                       \
215             color: 255 255 255 255;                                     \
216             visible: 1;                                                 \
217          }                                                              \
218          description {                                                  \
219             state: "on" 0.0;                                            \
220             inherit: "default" 0.0;                                     \
221             color: 255 255 255 0;                                       \
222             visible: 0;                                                 \
223          }                                                              \
224       }                                                                 \
225       part {                                                            \
226          name: "button.toggle."##id;                                    \
227          type: RECT;                                                    \
228          mouse_events: 1;                                               \
229          description {                                                  \
230             state: "default" 0.0;                                       \
231             color: 255 255 255 0;                                       \
232             color_class: "action";                                      \
233             min: ACTION_WIDTH ACTION_HEIGHT;                            \
234             max: ACTION_WIDTH ACTION_HEIGHT;                            \
235             fixed: 1 1;                                                 \
236             visible: 0;                                                 \
237             rel1 {                                                      \
238                to: "bg.actions";                                        \
239                relative: x1 0.0;                                        \
240             }                                                           \
241             rel2 {                                                      \
242                to: "bg.actions";                                        \
243                relative: x2 1.0;                                        \
244                offset: -1 -1;                                           \
245             }                                                           \
246          }                                                              \
247          description {                                                  \
248             state: "on" 0.0;                                            \
249             inherit: "default" 0.0;                                     \
250             color: 255 255 255 255;                                     \
251             visible: 1;                                                 \
252          }                                                              \
253       }                                                                 \
254       part {                                                            \
255          name: "button.toggle.ico."##id;                                \
256          type: IMAGE;                                                   \
257          mouse_events: 0;                                               \
258          description {                                                  \
259             state: "default" 0.0;                                       \
260             color: 255 255 255 255;                                     \
261             color_class: "action";                                      \
262             min: ACTION_HEIGHT ACTION_HEIGHT;                           \
263             max: ACTION_HEIGHT ACTION_HEIGHT;                           \
264             fixed: 1 1;                                                 \
265             visible: 0;                                                 \
266             rel1.to: "button.toggle."##id;                              \
267             rel2.to: "button.toggle."##id;                              \
268             image.normal: "ico_"##id".png";                             \
269          }                                                              \
270          description {                                                  \
271             state: "on" 0.0;                                            \
272             inherit: "default" 0.0;                                     \
273             color_class: "bg";                                          \
274             visible: 1;                                                 \
275          }                                                              \
276       }                                                                 \
277       part {                                                            \
278          name: "blocker."##id;                                          \
279          type: RECT;                                                    \
280          mouse_events: 1;                                               \
281          description {                                                  \
282             state: "default" 0.0;                                       \
283             color: 0 0 0 0;                                             \
284             visible: 0;                                                 \
285          }                                                              \
286          description {                                                  \
287             state: "disabled" 0.0;                                      \
288             inherit: "default" 0.0;                                     \
289             visible: 1;                                                 \
290          }                                                              \
291       }                                                                 \
292       programs {                                                        \
293          program {                                                      \
294             signal: "mouse,up,1";                                       \
295             source: "button."##id;                                      \
296             action: SIGNAL_EMIT "released,"##id "gui";                  \
297             after: "show_up_"##id;                                      \
298             api: id"_released" id" was released";                       \
299          }                                                              \
300          program {                                                      \
301             name: "show_up_"##id;                                       \
302             action: STATE_SET "default" 0.0;                            \
303             transition: DECELERATE 0.1;                                 \
304             target: "button."##id;                                      \
305             target: "button.ico."##id;                                  \
306          }                                                              \
307          program {                                                      \
308             signal: "mouse,down,1";                                     \
309             source: "button."##id;                                      \
310             after: "show_down_"##id;                                    \
311             action: SIGNAL_EMIT "pressed,"##id "gui";                   \
312             api: id"_pressed" id" was pressed";                         \
313          }                                                              \
314          program {                                                      \
315             name: "show_down_"##id;                                     \
316             action: STATE_SET "pressed" 0.0;                            \
317             transition: ACCELERATE 0.1;                                 \
318             target: "button."##id;                                      \
319             target: "button.ico."##id;                                  \
320          }                                                              \
321          program {                                                      \
322             signal: "mouse,clicked,1";                                  \
323             source: "button."##id;                                      \
324             action: SIGNAL_EMIT "clicked,"##id "gui";                   \
325             api: id"_clicked" id" was clicked";                         \
326          }                                                              \
327          program {                                                      \
328             signal: "mouse,clicked,1";                                  \
329             source: "button.toggle."##id;                               \
330             action: SIGNAL_EMIT "clicked,"##id "gui";                   \
331             api: id"_clicked" id" was clicked";                         \
332          }                                                              \
333          program {                                                      \
334             signal: "toggle,on,"##id;                                   \
335             source: "gui";                                              \
336             action: STATE_SET "on" 0.0;                                 \
337             target: "clipper.toggle."##id;                              \
338             target: "button.toggle."##id;                               \
339             target: "button.toggle.ico."##id;                           \
340          }                                                              \
341          program {                                                      \
342             signal: "toggle,off,"##id;                                  \
343             source: "gui";                                              \
344             action: STATE_SET "default" 0.0;                            \
345             target: "clipper.toggle."##id;                              \
346             target: "button.toggle."##id;                               \
347             target: "button.toggle.ico."##id;                           \
348          }                                                              \
349       }
350
351       ACTION_TOGGLE("keypad",   0.000000000, 0.333333333);
352       ACTION_TOGGLE("contacts", 0.333333333, 0.666666666);
353       ACTION_TOGGLE("history",  0.666666666, 1.000000000);
354 #undef ACTION_TOGGLE
355
356       programs {
357          program {
358             name: "show-keypad-swallow-phase1";
359             signal: "show,keypad";
360             source: "gui";
361             action: STATE_SET "hidden" 0.0;
362             target: "elm.swallow.contacts";
363             target: "elm.swallow.history";
364             after: "show-keypad-swallow-phase2";
365          }
366          program {
367             name: "show-keypad-swallow-phase2";
368             action: STATE_SET "default" 0.0;
369             target: "elm.swallow.keypad";
370          }
371
372          program {
373             signal: "show,keypad";
374             source: "gui";
375             action: SIGNAL_EMIT "toggle,on,keypad" "gui";
376          }
377          program {
378             signal: "show,keypad";
379             source: "gui";
380             action: SIGNAL_EMIT "toggle,off,contacts" "gui";
381          }
382          program {
383             signal: "show,keypad";
384             source: "gui";
385             action: SIGNAL_EMIT "toggle,off,history" "gui";
386          }
387
388          program {
389             name: "show-contacts-swallow-phase1";
390             signal: "show,contacts";
391             source: "gui";
392             action: STATE_SET "hidden" 0.0;
393             target: "elm.swallow.keypad";
394             target: "elm.swallow.history";
395             after: "show-contacts-swallow-phase2";
396          }
397          program {
398             name: "show-contacts-swallow-phase2";
399             action: STATE_SET "default" 0.0;
400             target: "elm.swallow.contacts";
401          }
402
403          program {
404             signal: "show,contacts";
405             source: "gui";
406             action: SIGNAL_EMIT "toggle,on,contacts" "gui";
407          }
408          program {
409             signal: "show,contacts";
410             source: "gui";
411             action: SIGNAL_EMIT "toggle,off,keypad" "gui";
412          }
413          program {
414             signal: "show,contacts";
415             source: "gui";
416             action: SIGNAL_EMIT "toggle,off,history" "gui";
417          }
418
419          program {
420             name: "show-history-swallow-phase1";
421             signal: "show,history";
422             source: "gui";
423             action: STATE_SET "hidden" 0.0;
424             target: "elm.swallow.contacts";
425             target: "elm.swallow.keypad";
426             after: "show-history-swallow-phase2";
427          }
428          program {
429             name: "show-history-swallow-phase2";
430             action: STATE_SET "default" 0.0;
431             target: "elm.swallow.history";
432          }
433
434          program {
435             signal: "show,history";
436             source: "gui";
437             action: SIGNAL_EMIT "toggle,on,history" "gui";
438          }
439          program {
440             signal: "show,history";
441             source: "gui";
442             action: SIGNAL_EMIT "toggle,off,contacts" "gui";
443          }
444          program {
445             signal: "show,history";
446             source: "gui";
447             action: SIGNAL_EMIT "toggle,off,keypad" "gui";
448          }
449       }
450    }
451 }