tizen 2.4 release
[framework/uifw/elementary.git] / data / themes / edc / comp_effects.edc
1 #define COMP_EFFECT_DURATION 0.4
2 #define COMP_EFFECT_DURATION_FAST 0.2
3
4 group { name: "e/comp/effects/none";
5    parts {
6       part { name: "e.swallow.content"; type: SWALLOW;
7         description { state: "default" 0.0;
8         }
9       }
10    }
11 }
12
13 /* non-auto effects are assumed to be run frame by frame by an animator */
14 group { name: "e/comp/effects/move";
15    script {
16       public message(Msg_Type:type, id, ...) {
17          if ((type == MSG_INT_SET) && (id == 0)) {
18             /* set state */
19             new st;
20
21             st = getarg(2);
22             if (st == 1)
23               set_state(PART:"mover", "custom", 0.0);
24             else
25               set_state(PART:"mover", "default", 0.0);
26          } else if ((type == MSG_INT_SET) && (id == 1)) {
27             /* x,y coords to move to */
28             new x, y;
29
30             x = getarg(2);
31             y = getarg(3);
32
33             custom_state(PART:"mover", "default", 0.0);
34             set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
35             set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
36          }
37       }
38    }
39    parts {
40       part { name: "mover"; type: SPACER;
41         description { state: "default" 0.0;
42         }
43       }
44       part { name: "e.swallow.content"; type: SWALLOW;
45         description { state: "default" 0.0;
46            rel1.to: "mover";
47            rel2.to: "mover";
48         }
49       }
50    }
51    programs {
52       program {
53          name: "show";
54          signal: "e,action,go";
55          source: "e";
56          filter: "mover" "default";
57          action: STATE_SET "custom" 0.0;
58          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
59          target: "mover";
60          after: "done";
61       }
62       program {
63          name: "hide";
64          signal: "e,action,go";
65          source: "e";
66          filter: "mover" "custom";
67          action: STATE_SET "default" 0.0;
68          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
69          target: "mover";
70          after: "done";
71       }
72       program {
73          name: "stop";
74          signal: "e,action,stop";
75          source: "e";
76          action: ACTION_STOP;
77          target: "show";
78          target: "hide";
79       }
80       program {
81          name: "done";
82          action: SIGNAL_EMIT "e,action,done" "e";
83       }
84    }
85 }
86
87 /* auto effects are "start and forget" */
88 group { name: "e/comp/effects/auto/pane";
89    //data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
90    script {
91       public message(Msg_Type:type, id, ...) {
92          if ((type == MSG_INT_SET) && (id == 0)) {
93             /* set state */
94             new st;
95
96             st = getarg(2);
97             if (st == 1)
98               set_state(PART:"mover", "custom", 0.0);
99             else
100               set_state(PART:"mover", "default", 0.0);
101          } else if ((type == MSG_INT_SET) && (id == 1)) {
102             /* border geom[4] / screen size[2] / desk change direction[2] */
103             new x, y, sw, sh, dx, dy;
104
105             sw = getarg(6);
106             sh = getarg(7);
107             dx = getarg(8);
108             dy = getarg(9);
109
110             x = round(sw*dx*1.5);
111             y = round(sh*dy*1.5);
112
113             custom_state(PART:"mover", "default", 0.0);
114             set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
115             set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
116          }
117       }
118    }
119    parts {
120       part { name: "mover"; type: SPACER;
121         description { state: "default" 0.0;
122         }
123       }
124       part { name: "e.swallow.content"; type: SWALLOW;
125         description { state: "default" 0.0;
126            rel1.to: "mover";
127            rel2.to: "mover";
128         }
129       }
130    }
131    programs {
132       program {
133          name: "show";
134          signal: "e,action,go";
135          source: "e";
136          filter: "mover" "default";
137          action: STATE_SET "custom" 0.0;
138          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
139          target: "mover";
140          after: "done";
141       }
142       program {
143          name: "hide";
144          signal: "e,action,go";
145          source: "e";
146          filter: "mover" "custom";
147          action: STATE_SET "default" 0.0;
148          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
149          target: "mover";
150          after: "done";
151       }
152       program {
153          name: "stop";
154          signal: "e,action,stop";
155          source: "e";
156          action: ACTION_STOP;
157          target: "show";
158          target: "hide";
159       }
160       program {
161          name: "done";
162          action: SIGNAL_EMIT "e,action,done" "e";
163       }
164    }
165 }
166
167 group { name: "e/comp/effects/auto/diagonal";
168    inherit: "e/comp/effects/auto/pane";
169    script {
170       public message(Msg_Type:type, id, ...) {
171          if ((type == MSG_INT_SET) && (id == 0)) {
172             /* set state */
173             new st;
174
175             st = getarg(2);
176
177             if (st == 1)
178               set_state(PART:"mover", "custom", 0.0);
179             else
180               set_state(PART:"mover", "default", 0.0);
181          } else if ((type == MSG_INT_SET) && (id == 1)) {
182             /* border geom / screen size / desk change direction */
183             new x, y, w, h, sw, sh, mx, my, bx, by;
184             new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
185
186             x = getarg(2);
187             y = getarg(3);
188             w = getarg(4);
189             h = getarg(5);
190             sw = getarg(6);
191             sh = getarg(7);
192             custom_state(PART:"mover", "default", 0.0);
193
194             mx = sw/2;
195             my = sh/2;
196
197             bx = x+(w/2)-mx;
198             by = y+(h/2)-my;
199             if (bx == 0) bx = 1;
200             if (by == 0) by = 1;
201             fx = bx/(w/2);
202             fy = by/(h/2);
203             ang = atan(fy/fx);
204             if (fx < 0.0)
205               ang = PI+ang;
206             len = sqrt((bx*bx)+(by*by));
207             lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
208             rad = sqrt((w*w)+(h*h))/2.0;
209             x = round(cos(ang)*(lmax-len+rad));
210             y = round(sin(ang)*(lmax-len+rad));
211             set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
212             set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
213          }
214       }
215    }
216 }
217
218 group { name: "e/comp/effects/auto/zoom";
219    inherit: "e/comp/effects/auto/diagonal";
220    script {
221       public message(Msg_Type:type, id, ...) {
222          if ((type == MSG_INT_SET) && (id == 0)) {
223             /* set state */
224             new st;
225
226             st = getarg(2);
227             if (st == 1) {
228               /* starting from offscreen */
229               set_state_val(PART:"mover", STATE_REL1, 0.3, 0.3);
230               set_state_val(PART:"mover", STATE_REL2, 0.7, 0.7);
231               set_state(PART:"mover", "custom", 0.0);
232               set_state(PART:"clip", "hidden", 0.0);
233             } else {
234               /* starting from normal position */
235               set_state_val(PART:"mover", STATE_REL1, -1.7, -1.7);
236               set_state_val(PART:"mover", STATE_REL2, 1.7, 1.7);
237               set_state(PART:"mover", "default", 0.0);
238               set_state(PART:"clip", "default", 0.0);
239             }
240          } else if ((type == MSG_INT_SET) && (id == 1)) {
241             /* border geom / screen size / desk change direction */
242             new x, y, w, h, sw, sh, mx, my, bx, by;
243             new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
244
245             x = getarg(2);
246             y = getarg(3);
247             w = getarg(4);
248             h = getarg(5);
249             sw = getarg(6);
250             sh = getarg(7);
251             custom_state(PART:"mover", "default", 0.0);
252
253             mx = sw/2;
254             my = sh/2;
255
256             bx = x+(w/2)-mx;
257             by = y+(h/2)-my;
258             if (bx == 0) bx = 1;
259             if (by == 0) by = 1;
260             fx = bx/(w/2);
261             fy = by/(h/2);
262             ang = atan(fy/fx);
263             if (fx < 0.0)
264               ang = PI+ang;
265             len = sqrt((bx*bx)+(by*by));
266             lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
267             rad = sqrt((w*w)+(h*h))/2.0;
268             x = round(cos(ang)*(lmax-len+rad));
269             y = round(sin(ang)*(lmax-len+rad));
270             set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
271             set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
272          }
273       }
274    }
275    parts {
276       part { name: "clip"; type: RECT; mouse_events: 0;
277          insert_after: "mover";
278          description { state: "default";
279             rel1.to: "mover";
280             rel1.offset: -20 -20;
281             rel2.to: "mover";
282             rel2.offset: 20 20;
283             color: 255 255 255 255;
284          }
285          description { state: "hidden";
286             rel1.to: "mover";
287             rel2.to: "mover";
288             color: 255 255 255 0;
289          }
290       }
291       part { name: "e.swallow.content"; clip_to: "clip";
292       }
293    }
294    programs {
295       program {
296          name: "show2";
297          signal: "e,action,go";
298          source: "e";
299          filter: "mover" "default";
300          action: STATE_SET "hidden" 0.0;
301          transition: ACCELERATE COMP_EFFECT_DURATION CURRENT;
302          target: "clip";
303       }
304       program {
305          name: "hide2";
306          signal: "e,action,go";
307          source: "e";
308          filter: "mover" "custom";
309          action: STATE_SET "default" 0.0;
310          transition: ACCELERATE COMP_EFFECT_DURATION CURRENT;
311          target: "clip";
312       }
313    }
314 }
315
316 group { name: "e/comp/effects/auto/blend";
317    //data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
318    script {
319       public message(Msg_Type:type, id, ...) {
320          if ((type == MSG_INT_SET) && (id == 0)) {
321             /* set state */
322             new st;
323
324             st = getarg(2);
325             if (st == 1) {
326               /* starting from hidden */
327               set_state(PART:"clip", "hidden", 0.0);
328             } else {
329               set_state(PART:"clip", "default", 0.0);
330             }
331          }
332       }
333    }
334    parts {
335       part { name: "clip"; type: RECT; mouse_events: 0;
336          description { state: "default";
337             rel1.to: "e.swallow.content";
338             rel1.offset: -20 -20;
339             rel2.to: "e.swallow.content";
340             rel2.offset: 20 20;
341             color: 255 255 255 255;
342          }
343          description { state: "hidden";
344             inherit: "default" 0.0;
345             color: 255 255 255 0;
346          }
347       }
348       part { name: "e.swallow.content"; type: SWALLOW;
349         clip_to: "clip";
350         description { state: "default" 0.0;
351         }
352       }
353    }
354    programs {
355       program {
356          name: "show";
357          signal: "e,action,go";
358          source: "e";
359          filter: "clip" "default";
360          action: STATE_SET "hidden" 0.0;
361          transition: LINEAR COMP_EFFECT_DURATION CURRENT;
362          target: "clip";
363          after: "done";
364       }
365       program {
366          name: "hide";
367          signal: "e,action,go";
368          source: "e";
369          filter: "clip" "hidden";
370          action: STATE_SET "default" 0.0;
371          transition: LINEAR COMP_EFFECT_DURATION CURRENT;
372          target: "clip";
373          after: "done";
374       }
375       program {
376          name: "stop";
377          signal: "e,action,stop";
378          source: "e";
379          action: ACTION_STOP;
380          target: "show";
381          target: "hide";
382       }
383       program {
384          name: "done";
385          action: SIGNAL_EMIT "e,action,done" "e";
386       }
387    }
388 }
389
390 group { name: "e/comp/effects/auto/grow";
391    inherit: "e/comp/effects/auto/pane";
392    //data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
393    script {
394       public message(Msg_Type:type, id, ...) {
395          if ((type == MSG_INT_SET) && (id == 0)) {
396             /* set state */
397             new st;
398
399             st = getarg(2);
400             if (st == 1)
401               set_state(PART:"mover", "custom", 0.0);
402             else
403               set_state(PART:"mover", "default", 0.0);
404          } else if ((type == MSG_INT_SET) && (id == 1)) {
405             /* border geom[4] / screen size[2] / desk change direction[2] */
406             new dx, dy;
407             new Float:r1x = 0.0, Float:r1y = 0.0, Float:r2x = 1.0, Float:r2y = 1.0;
408
409             dx = getarg(8);
410             dy = getarg(9);
411
412             custom_state(PART:"mover", "default", 0.0);
413             if (dx == 1) r1x = 1.0;
414             else if (dx == -1) r2x = 0.0;
415             if (dy == 1) r1y = 1.0;
416             else if (dy == -1) r2y = 0.0;
417             set_state_val(PART:"mover", STATE_REL1, r1x, r1y);
418             set_state_val(PART:"mover", STATE_REL2, r2x, r2y);
419          }
420       }
421    }
422 }
423
424 group { name: "e/comp/effects/iconify/default";
425    alias: "e/comp/effects/iconify/ibar";
426    alias: "e/comp/effects/iconify/ibox";
427    alias: "e/comp/effects/iconify/tasks";
428    inherit: "e/comp/effects/auto/pane";
429    data.item: "noclip" "1";
430    script {
431       public message(Msg_Type:type, id, ...) {
432          if ((type == MSG_INT_SET) && (id == 0)) {
433             /* set state */
434             new st;
435
436             st = getarg(2);
437
438             if (st == 1)
439               set_state(PART:"mover", "custom", 0.0);
440             else
441               set_state(PART:"mover", "default", 0.0);
442          } else if ((type == MSG_INT_SET) && (id == 1)) {
443             // border geom[4] / destination[4]
444             new x, y, w, h;
445             new dx, dy, dw, dh;
446             x = getarg(2);
447             y = getarg(3);
448             w = getarg(4);
449             h = getarg(5);
450             dx = getarg(6);
451             dy = getarg(7);
452             dw = getarg(8);
453             dh = getarg(9);
454             x = x + (w / 2);
455             y = y + (h / 2);
456             dx = dx - x;
457             dy = dy - y;
458             custom_state(PART:"mover", "default", 0.0);
459             set_state_val(PART:"mover", STATE_REL1, 1.0, 1.0);
460             set_state_val(PART:"mover", STATE_REL2, 0.0, 0.0);
461             set_state_val(PART:"mover", STATE_REL1_OFFSET, dx, dy);
462             set_state_val(PART:"mover", STATE_REL2_OFFSET, dx + dw - 1, dy + dh - 1);
463          }
464       }
465    }
466    programs {
467       program {
468          name: "show"; //iconify
469          signal: "e,action,go";
470          source: "e";
471          filter: "mover" "default";
472          action: STATE_SET "custom" 0.0;
473          transition: ACCELERATE_FACTOR COMP_EFFECT_DURATION 2 CURRENT;
474          target: "mover";
475          after: "done";
476       }
477       program {
478          name: "hide"; //uniconify
479          signal: "e,action,go";
480          source: "e";
481          filter: "mover" "custom";
482          action: STATE_SET "default" 0.0;
483          transition: DECELERATE_FACTOR COMP_EFFECT_DURATION_FAST 2 CURRENT;
484          target: "mover";
485          after: "done";
486       }
487       program {
488          name: "stop";
489          signal: "e,action,stop";
490          source: "e";
491          action: ACTION_STOP;
492          target: "show";
493          target: "hide";
494       }
495       program {
496          name: "done";
497          action: SIGNAL_EMIT "e,action,done" "e";
498       }
499    }
500 }
501
502 #if 0 //this is weirdly broken with proxy visibility somehow...
503 group { name: "e/comp/effects/auto/rotate";
504    inherit: "e/comp/effects/auto/pane";
505    script {
506       public message(Msg_Type:type, id, ...) {
507          if ((type == MSG_INT_SET) && (id == 0)) {
508             /* set state */
509             new st;
510
511             st = getarg(2);
512
513             if (st == 1) {
514                set_state(PART:"mover", "custom", 0.0);
515                set_state(PART:"proxy", "hidden", 0.0);
516             } else {
517                set_state(PART:"mover", "default", 0.0);
518                set_state(PART:"proxy", "default", 0.0);
519             }
520          }
521 #if 0
522          else if ((type == MSG_INT_SET) && (id == 1)) {
523             /* desk change direction */
524             new Float:mx, Float:my;
525             mx = get_float(getarg(8) * 180);
526             my = get_float(getarg(9) * 180);
527             custom_state(PART:"proxy", "hidden", 0.0);
528             set_state_val(PART:"proxy", STATE_MAP_ROT_Y, mx);
529             set_state_val(PART:"proxy", STATE_MAP_ROT_X, my);
530          }
531 #endif
532       }
533    }
534    parts {
535       part { name: "proxy"; type: PROXY; mouse_events: 0;
536          insert_after: "e.swallow.content";
537          description { state: "default";
538             source: "e.swallow.content";
539             map {
540                on: 1;
541                perspective_on: 1;
542                perspective: "e.swallow.content";
543                smooth: 1;
544                rotation.y: 0;
545                rotation.x: 0;
546             }
547          }
548          description { state: "hidden" 0.0;
549             inherit: "default";
550             map.rotation.y: -180;
551             map.rotation.x: -180;
552             proxy.source_visible: 0;
553             map.backface_cull: 1;
554          }
555       }
556    }
557    programs {
558       program {
559          name: "show2";
560          signal: "e,action,go";
561          source: "e";
562          action: STATE_SET "hidden" 0.0;
563          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
564          target: "proxy";
565       }
566       program {
567          name: "hide2";
568          signal: "e,action,go";
569          source: "e";
570          action: STATE_SET "default" 0.0;
571          transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
572          target: "proxy";
573       }
574    }
575 }
576 #endif