1 #define COMP_EFFECT_DURATION 0.4
2 #define COMP_EFFECT_DURATION_FAST 0.2
4 group { name: "e/comp/effects/none";
6 part { name: "e.swallow.content"; type: SWALLOW;
7 description { state: "default" 0.0;
13 /* non-auto effects are assumed to be run frame by frame by an animator */
14 group { name: "e/comp/effects/move";
16 public message(Msg_Type:type, id, ...) {
17 if ((type == MSG_INT_SET) && (id == 0)) {
23 set_state(PART:"mover", "custom", 0.0);
25 set_state(PART:"mover", "default", 0.0);
26 } else if ((type == MSG_INT_SET) && (id == 1)) {
27 /* x,y coords to move to */
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);
40 part { name: "mover"; type: SPACER;
41 description { state: "default" 0.0;
44 part { name: "e.swallow.content"; type: SWALLOW;
45 description { state: "default" 0.0;
54 signal: "e,action,go";
56 filter: "mover" "default";
57 action: STATE_SET "custom" 0.0;
58 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
64 signal: "e,action,go";
66 filter: "mover" "custom";
67 action: STATE_SET "default" 0.0;
68 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
74 signal: "e,action,stop";
82 action: SIGNAL_EMIT "e,action,done" "e";
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
91 public message(Msg_Type:type, id, ...) {
92 if ((type == MSG_INT_SET) && (id == 0)) {
98 set_state(PART:"mover", "custom", 0.0);
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;
110 x = round(sw*dx*1.5);
111 y = round(sh*dy*1.5);
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);
120 part { name: "mover"; type: SPACER;
121 description { state: "default" 0.0;
124 part { name: "e.swallow.content"; type: SWALLOW;
125 description { state: "default" 0.0;
134 signal: "e,action,go";
136 filter: "mover" "default";
137 action: STATE_SET "custom" 0.0;
138 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
144 signal: "e,action,go";
146 filter: "mover" "custom";
147 action: STATE_SET "default" 0.0;
148 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
154 signal: "e,action,stop";
162 action: SIGNAL_EMIT "e,action,done" "e";
167 group { name: "e/comp/effects/auto/diagonal";
168 inherit: "e/comp/effects/auto/pane";
170 public message(Msg_Type:type, id, ...) {
171 if ((type == MSG_INT_SET) && (id == 0)) {
178 set_state(PART:"mover", "custom", 0.0);
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;
192 custom_state(PART:"mover", "default", 0.0);
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);
218 group { name: "e/comp/effects/auto/zoom";
219 inherit: "e/comp/effects/auto/diagonal";
221 public message(Msg_Type:type, id, ...) {
222 if ((type == MSG_INT_SET) && (id == 0)) {
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);
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);
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;
251 custom_state(PART:"mover", "default", 0.0);
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);
276 part { name: "clip"; type: RECT; mouse_events: 0;
277 insert_after: "mover";
278 description { state: "default";
280 rel1.offset: -20 -20;
283 color: 255 255 255 255;
285 description { state: "hidden";
288 color: 255 255 255 0;
291 part { name: "e.swallow.content"; clip_to: "clip";
297 signal: "e,action,go";
299 filter: "mover" "default";
300 action: STATE_SET "hidden" 0.0;
301 transition: ACCELERATE COMP_EFFECT_DURATION CURRENT;
306 signal: "e,action,go";
308 filter: "mover" "custom";
309 action: STATE_SET "default" 0.0;
310 transition: ACCELERATE COMP_EFFECT_DURATION CURRENT;
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
319 public message(Msg_Type:type, id, ...) {
320 if ((type == MSG_INT_SET) && (id == 0)) {
326 /* starting from hidden */
327 set_state(PART:"clip", "hidden", 0.0);
329 set_state(PART:"clip", "default", 0.0);
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";
341 color: 255 255 255 255;
343 description { state: "hidden";
344 inherit: "default" 0.0;
345 color: 255 255 255 0;
348 part { name: "e.swallow.content"; type: SWALLOW;
350 description { state: "default" 0.0;
357 signal: "e,action,go";
359 filter: "clip" "default";
360 action: STATE_SET "hidden" 0.0;
361 transition: LINEAR COMP_EFFECT_DURATION CURRENT;
367 signal: "e,action,go";
369 filter: "clip" "hidden";
370 action: STATE_SET "default" 0.0;
371 transition: LINEAR COMP_EFFECT_DURATION CURRENT;
377 signal: "e,action,stop";
385 action: SIGNAL_EMIT "e,action,done" "e";
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
394 public message(Msg_Type:type, id, ...) {
395 if ((type == MSG_INT_SET) && (id == 0)) {
401 set_state(PART:"mover", "custom", 0.0);
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] */
407 new Float:r1x = 0.0, Float:r1y = 0.0, Float:r2x = 1.0, Float:r2y = 1.0;
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);
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";
431 public message(Msg_Type:type, id, ...) {
432 if ((type == MSG_INT_SET) && (id == 0)) {
439 set_state(PART:"mover", "custom", 0.0);
441 set_state(PART:"mover", "default", 0.0);
442 } else if ((type == MSG_INT_SET) && (id == 1)) {
443 // border geom[4] / destination[4]
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);
468 name: "show"; //iconify
469 signal: "e,action,go";
471 filter: "mover" "default";
472 action: STATE_SET "custom" 0.0;
473 transition: ACCELERATE_FACTOR COMP_EFFECT_DURATION 2 CURRENT;
478 name: "hide"; //uniconify
479 signal: "e,action,go";
481 filter: "mover" "custom";
482 action: STATE_SET "default" 0.0;
483 transition: DECELERATE_FACTOR COMP_EFFECT_DURATION_FAST 2 CURRENT;
489 signal: "e,action,stop";
497 action: SIGNAL_EMIT "e,action,done" "e";
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";
506 public message(Msg_Type:type, id, ...) {
507 if ((type == MSG_INT_SET) && (id == 0)) {
514 set_state(PART:"mover", "custom", 0.0);
515 set_state(PART:"proxy", "hidden", 0.0);
517 set_state(PART:"mover", "default", 0.0);
518 set_state(PART:"proxy", "default", 0.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);
535 part { name: "proxy"; type: PROXY; mouse_events: 0;
536 insert_after: "e.swallow.content";
537 description { state: "default";
538 source: "e.swallow.content";
542 perspective: "e.swallow.content";
548 description { state: "hidden" 0.0;
550 map.rotation.y: -180;
551 map.rotation.x: -180;
552 proxy.source_visible: 0;
553 map.backface_cull: 1;
560 signal: "e,action,go";
562 action: STATE_SET "hidden" 0.0;
563 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;
568 signal: "e,action,go";
570 action: STATE_SET "default" 0.0;
571 transition: DECELERATE COMP_EFFECT_DURATION CURRENT;