split comp effect edc into separate file
This commit is contained in:
parent
e54edab54c
commit
8c509d0a18
|
@ -32,6 +32,7 @@ edc/clock.edc \
|
|||
edc/colors.edc \
|
||||
edc/colorwell.edc \
|
||||
edc/comp.edc \
|
||||
edc/comp_effects.edc \
|
||||
edc/conf.edc \
|
||||
edc/connman.edc \
|
||||
edc/cpufreq.edc \
|
||||
|
|
|
@ -4,6 +4,7 @@ collections {
|
|||
#include "colorclasses.edc"
|
||||
// desktop in general
|
||||
#include "edc/comp.edc"
|
||||
#include "edc/comp_effects.edc"
|
||||
#include "edc/deskmirror.edc"
|
||||
#include "edc/background.edc"
|
||||
#include "edc/shelf.edc"
|
||||
|
|
|
@ -241,391 +241,6 @@ group { name: "e/comp/screen/overlay/noeffects";
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/none";
|
||||
parts {
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* non-auto effects are assumed to be run frame by frame by an animator */
|
||||
group { name: "e/comp/effects/move";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* x,y coords to move to */
|
||||
new x, y;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "mover"; type: SPACER;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "custom" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* auto effects are "start and forget" */
|
||||
group { name: "e/comp/effects/auto/pane";
|
||||
//data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom[4] / screen size[2] / desk change direction[2] */
|
||||
new x, y, sw, sh, dx, dy;
|
||||
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
dx = getarg(8);
|
||||
dy = getarg(9);
|
||||
|
||||
x = round(sw*dx*1.5);
|
||||
y = round(sh*dy*1.5);
|
||||
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "mover"; type: SPACER;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "custom" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/diagonal";
|
||||
inherit: "e/comp/effects/auto/pane";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom / screen size / desk change direction */
|
||||
new x, y, w, h, sw, sh, mx, my, bx, by;
|
||||
new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
|
||||
mx = sw/2;
|
||||
my = sh/2;
|
||||
|
||||
bx = x+(w/2)-mx;
|
||||
by = y+(h/2)-my;
|
||||
if (bx == 0) bx = 1;
|
||||
if (by == 0) by = 1;
|
||||
fx = bx/(w/2);
|
||||
fy = by/(h/2);
|
||||
ang = atan(fy/fx);
|
||||
if (fx < 0.0)
|
||||
ang = PI+ang;
|
||||
len = sqrt((bx*bx)+(by*by));
|
||||
lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
|
||||
rad = sqrt((w*w)+(h*h))/2.0;
|
||||
x = round(cos(ang)*(lmax-len+rad));
|
||||
y = round(sin(ang)*(lmax-len+rad));
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/zoom";
|
||||
inherit: "e/comp/effects/auto/diagonal";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1) {
|
||||
/* starting from offscreen */
|
||||
set_state_val(PART:"mover", STATE_REL1, 0.3, 0.3);
|
||||
set_state_val(PART:"mover", STATE_REL2, 0.7, 0.7);
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
set_state(PART:"clip", "hidden", 0.0);
|
||||
} else {
|
||||
/* starting from normal position */
|
||||
set_state_val(PART:"mover", STATE_REL1, -1.7, -1.7);
|
||||
set_state_val(PART:"mover", STATE_REL2, 1.7, 1.7);
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
set_state(PART:"clip", "default", 0.0);
|
||||
}
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom / screen size / desk change direction */
|
||||
new x, y, w, h, sw, sh, mx, my, bx, by;
|
||||
new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
|
||||
mx = sw/2;
|
||||
my = sh/2;
|
||||
|
||||
bx = x+(w/2)-mx;
|
||||
by = y+(h/2)-my;
|
||||
if (bx == 0) bx = 1;
|
||||
if (by == 0) by = 1;
|
||||
fx = bx/(w/2);
|
||||
fy = by/(h/2);
|
||||
ang = atan(fy/fx);
|
||||
if (fx < 0.0)
|
||||
ang = PI+ang;
|
||||
len = sqrt((bx*bx)+(by*by));
|
||||
lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
|
||||
rad = sqrt((w*w)+(h*h))/2.0;
|
||||
x = round(cos(ang)*(lmax-len+rad));
|
||||
y = round(sin(ang)*(lmax-len+rad));
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "clip"; type: RECT; mouse_events: 0;
|
||||
insert_after: "mover";
|
||||
description { state: "default";
|
||||
rel1.to: "mover";
|
||||
rel1.offset: -20 -20;
|
||||
rel2.to: "mover";
|
||||
rel2.offset: 20 20;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "hidden";
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; clip_to: "clip";
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show2";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "hidden" 0.0;
|
||||
transition: ACCELERATE 0.4 CURRENT;
|
||||
target: "clip";
|
||||
}
|
||||
program {
|
||||
name: "hide2";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: ACCELERATE 0.4 CURRENT;
|
||||
target: "clip";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/blend";
|
||||
//data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1) {
|
||||
/* starting from hidden */
|
||||
set_state(PART:"clip", "hidden", 0.0);
|
||||
} else {
|
||||
set_state(PART:"clip", "default", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "clip"; type: RECT; mouse_events: 0;
|
||||
description { state: "default";
|
||||
rel1.to: "e.swallow.content";
|
||||
rel1.offset: -20 -20;
|
||||
rel2.to: "e.swallow.content";
|
||||
rel2.offset: 20 20;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "hidden";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
clip_to: "clip";
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "clip" "default";
|
||||
action: STATE_SET "hidden" 0.0;
|
||||
transition: LINEAR 0.4 CURRENT;
|
||||
target: "clip";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "clip" "hidden";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.4 CURRENT;
|
||||
target: "clip";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/border/default";
|
||||
images.image: "win_shadow.png" COMP;
|
||||
images.image: "win_glow.png" COMP;
|
||||
|
|
|
@ -0,0 +1,385 @@
|
|||
|
||||
group { name: "e/comp/effects/none";
|
||||
parts {
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* non-auto effects are assumed to be run frame by frame by an animator */
|
||||
group { name: "e/comp/effects/move";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* x,y coords to move to */
|
||||
new x, y;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "mover"; type: SPACER;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "custom" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* auto effects are "start and forget" */
|
||||
group { name: "e/comp/effects/auto/pane";
|
||||
//data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom[4] / screen size[2] / desk change direction[2] */
|
||||
new x, y, sw, sh, dx, dy;
|
||||
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
dx = getarg(8);
|
||||
dy = getarg(9);
|
||||
|
||||
x = round(sw*dx*1.5);
|
||||
y = round(sh*dy*1.5);
|
||||
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "mover"; type: SPACER;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "custom" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "mover";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/diagonal";
|
||||
inherit: "e/comp/effects/auto/pane";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
|
||||
if (st == 1)
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
else
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom / screen size / desk change direction */
|
||||
new x, y, w, h, sw, sh, mx, my, bx, by;
|
||||
new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
|
||||
mx = sw/2;
|
||||
my = sh/2;
|
||||
|
||||
bx = x+(w/2)-mx;
|
||||
by = y+(h/2)-my;
|
||||
if (bx == 0) bx = 1;
|
||||
if (by == 0) by = 1;
|
||||
fx = bx/(w/2);
|
||||
fy = by/(h/2);
|
||||
ang = atan(fy/fx);
|
||||
if (fx < 0.0)
|
||||
ang = PI+ang;
|
||||
len = sqrt((bx*bx)+(by*by));
|
||||
lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
|
||||
rad = sqrt((w*w)+(h*h))/2.0;
|
||||
x = round(cos(ang)*(lmax-len+rad));
|
||||
y = round(sin(ang)*(lmax-len+rad));
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/zoom";
|
||||
inherit: "e/comp/effects/auto/diagonal";
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1) {
|
||||
/* starting from offscreen */
|
||||
set_state_val(PART:"mover", STATE_REL1, 0.3, 0.3);
|
||||
set_state_val(PART:"mover", STATE_REL2, 0.7, 0.7);
|
||||
set_state(PART:"mover", "custom", 0.0);
|
||||
set_state(PART:"clip", "hidden", 0.0);
|
||||
} else {
|
||||
/* starting from normal position */
|
||||
set_state_val(PART:"mover", STATE_REL1, -1.7, -1.7);
|
||||
set_state_val(PART:"mover", STATE_REL2, 1.7, 1.7);
|
||||
set_state(PART:"mover", "default", 0.0);
|
||||
set_state(PART:"clip", "default", 0.0);
|
||||
}
|
||||
} else if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
/* border geom / screen size / desk change direction */
|
||||
new x, y, w, h, sw, sh, mx, my, bx, by;
|
||||
new Float:fx, Float:fy, Float:ang, Float:len, Float:lmax, Float:rad;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
sw = getarg(6);
|
||||
sh = getarg(7);
|
||||
custom_state(PART:"mover", "default", 0.0);
|
||||
|
||||
mx = sw/2;
|
||||
my = sh/2;
|
||||
|
||||
bx = x+(w/2)-mx;
|
||||
by = y+(h/2)-my;
|
||||
if (bx == 0) bx = 1;
|
||||
if (by == 0) by = 1;
|
||||
fx = bx/(w/2);
|
||||
fy = by/(h/2);
|
||||
ang = atan(fy/fx);
|
||||
if (fx < 0.0)
|
||||
ang = PI+ang;
|
||||
len = sqrt((bx*bx)+(by*by));
|
||||
lmax = sqrt(((sw/2)*(sw/2))+((sh/2)*(sh/2)));
|
||||
rad = sqrt((w*w)+(h*h))/2.0;
|
||||
x = round(cos(ang)*(lmax-len+rad));
|
||||
y = round(sin(ang)*(lmax-len+rad));
|
||||
set_state_val(PART:"mover", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"mover", STATE_REL2_OFFSET, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "clip"; type: RECT; mouse_events: 0;
|
||||
insert_after: "mover";
|
||||
description { state: "default";
|
||||
rel1.to: "mover";
|
||||
rel1.offset: -20 -20;
|
||||
rel2.to: "mover";
|
||||
rel2.offset: 20 20;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "hidden";
|
||||
rel1.to: "mover";
|
||||
rel2.to: "mover";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; clip_to: "clip";
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show2";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "default";
|
||||
action: STATE_SET "hidden" 0.0;
|
||||
transition: ACCELERATE 0.4 CURRENT;
|
||||
target: "clip";
|
||||
}
|
||||
program {
|
||||
name: "hide2";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "mover" "custom";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: ACCELERATE 0.4 CURRENT;
|
||||
target: "clip";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/effects/auto/blend";
|
||||
//data.item: "noclip" "1"; //setting this prevents object from being clipped to its zone during effect
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
/* set state */
|
||||
new st;
|
||||
|
||||
st = getarg(2);
|
||||
if (st == 1) {
|
||||
/* starting from hidden */
|
||||
set_state(PART:"clip", "hidden", 0.0);
|
||||
} else {
|
||||
set_state(PART:"clip", "default", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "clip"; type: RECT; mouse_events: 0;
|
||||
description { state: "default";
|
||||
rel1.to: "e.swallow.content";
|
||||
rel1.offset: -20 -20;
|
||||
rel2.to: "e.swallow.content";
|
||||
rel2.offset: 20 20;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "hidden";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
clip_to: "clip";
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
name: "show";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "clip" "default";
|
||||
action: STATE_SET "hidden" 0.0;
|
||||
transition: LINEAR 0.4 CURRENT;
|
||||
target: "clip";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "hide";
|
||||
signal: "e,action,go";
|
||||
source: "e";
|
||||
filter: "clip" "hidden";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.4 CURRENT;
|
||||
target: "clip";
|
||||
after: "done";
|
||||
}
|
||||
program {
|
||||
name: "stop";
|
||||
signal: "e,action,stop";
|
||||
source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "show";
|
||||
target: "hide";
|
||||
}
|
||||
program {
|
||||
name: "done";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue