--- /dev/null
+#define KEYBOARD_EFFECT_DURATION 0.35
+group { name: "e/comp/effects/keyboard-easeout";
+ script {
+ public ang;
+ public message(Msg_Type:type, id, ...) {
+ if ((type == MSG_INT_SET) && (id == 0)) {
+ /*set state */
+ new st;
+ new rot;
+ new buf[32];
+
+ st = getarg(2);
+ rot = getarg(3);
+
+ set_int(ang, rot);
+
+ if (st == 0)
+ {
+ snprintf(buf, sizeof(buf), "default,%d", rot);
+ set_state(PART:"clipper", "default", 0.0);
+ set_state(PART:"shower", buf, 0.0);
+ }
+ else if (st == 1)
+ {
+ set_state(PART:"clipper", "visible", 0.0);
+ set_state(PART:"shower", "visible", 0.0);
+ }
+ else if (st == 2)
+ {
+ snprintf(buf, sizeof(buf), "restack_hidden,%d", rot);
+ set_state(PART:"clipper", "restack_hidden", 0.0);
+ set_state(PART:"shower", buf, 0.0);
+ }
+ else if (st == 3)
+ {
+ set_state(PART:"clipper", "restack_visible", 0.0);
+ set_state(PART:"shower", "restack_visible", 0.0);
+ }
+ else if (st == 4)
+ {
+ set_state(PART:"clipper", "restack_done", 0.0);
+ set_state(PART:"shower", "restack_done", 0.0);
+ }
+ } else if ((type == MSG_INT_SET) && (id == 1))
+ {
+ }
+ }
+ public hide_state(val, Float:pos)
+ {
+ new rot;
+ new buf[32];
+
+ rot = get_int(ang);
+ snprintf(buf, sizeof(buf), "hide,%d", rot);
+
+ set_tween_state_anim(PART:"shower", "visible", 0.0, buf, 0.0, CUBIC_BEZIER, pos, 0.25, 0.46, 0.45, 1.0);
+ set_tween_state_anim(PART:"clipper", "visible", 0.0, buf, 0.0, CUBIC_BEZIER, pos, 0.25, 0.46, 0.45, 1.0);
+
+ if (pos == 1.0)
+ {
+ if (get_int(val) == 1)
+ run_program(PROGRAM:"hide2");
+ else
+ run_program(PROGRAM:"done");
+ }
+ }
+ }
+ parts {
+ part { name: "clipper";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ rel1.relative: -1.0 -1.0;
+ rel1.offset: -9999 -9999;
+ rel2.relative: 2.0 2.0;
+ rel2.offset: 9999 9999;
+ visible: 1;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description { state: "restack_visible" 0.0;
+ inherit: "visible" 0.0;
+ }
+ description { state: "restack_hidden" 0.0;
+ inherit: "default" 0.0;
+ }
+ description { state: "restack_done" 0.0;
+ inherit: "visible" 0.0;
+ }
+ }
+ part { name: "shower";
+ type: SPACER;
+ description { state: "default" 0.0;
+ rel1.relative: 0 1;
+ rel2.relative: 1 2;
+ }
+ description { state: "default,0" 0.0;
+ inherit: "default" 0.0;
+ }
+ description { state: "default,90" 0.0;
+ rel1.relative: 1 0;
+ rel2.relative: 2 1;
+ }
+ description { state: "default,180" 0.0;
+ rel1.relative: 0 -1;
+ rel2.relative: 1 0;
+ }
+ description { state: "default,270" 0.0;
+ rel1.relative: -1 0;
+ rel2.relative: 0 1;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0 0;
+ rel1.offset: 0 0;
+ rel2.relative: 1 1;
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ }
+ description { state: "hide,0" 0.0;
+ inherit: "hide" 0.0;
+ }
+ description { state: "hide,90" 0.0;
+ inherit: "default,90" 0.0;
+ }
+ description { state: "hide,180" 0.0;
+ inherit: "default,180" 0.0;
+ }
+ description { state: "hide,270" 0.0;
+ inherit: "default,270" 0.0;
+ }
+ description { state: "restack_visible" 0.0;
+ inherit: "visible" 0.0;
+ }
+ description { state: "restack_hidden" 0.0;
+ inherit: "default" 0.0;
+ }
+ description { state: "restack_hidden,0" 0.0;
+ inherit: "restack_hidden" 0.0;
+ }
+ description { state: "restack_hidden,90" 0.0;
+ inherit: "default,90" 0.0;
+ }
+ description { state: "restack_hidden,180" 0.0;
+ inherit: "default,180" 0.0;
+ }
+ description { state: "restack_hidden,270" 0.0;
+ inherit: "default,270" 0.0;
+ }
+ description { state: "restack_done" 0.0;
+ inherit: "visible" 0.0;
+ }
+ }
+ part { name: "e.swallow.content"; type: SWALLOW;
+ type: SWALLOW;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.to: "shower";
+ rel2.to: "shower";
+ }
+ description { state: "visible" 0.0;
+ rel1.to: "shower";
+ rel2.to: "shower";
+ }
+ description { state: "hide" 0.0;
+ rel1.to: "shower";
+ rel2.to: "shower";
+ }
+ }
+ }
+ programs {
+ program { name: "show1";
+ signal: "e,action,go";
+ source: "e";
+ filter: "clipper" "default";
+ action: STATE_SET "visible" 0.0;
+ transition: CUBIC_BEZIER KEYBOARD_EFFECT_DURATION 0.25 0.46 0.45 1.0;
+ target: "shower";
+ target: "clipper";
+ target: "e.swallow.content";
+ after: "done";
+ }
+ program { name: "hide1";
+ signal: "e,action,go";
+ source: "e";
+ filter: "clipper" "visible";
+ script{
+ anim(KEYBOARD_EFFECT_DURATION, "hide_state", 1);
+ }
+ }
+ program { name: "hide2";
+ action: STATE_SET "default" 0.0;
+ target: "shower";
+ target: "clipper";
+ after: "done";
+ }
+ program { name: "restack,hide";
+ signal: "e,action,go";
+ source: "e";
+ filter: "clipper" "restack_visible";
+ script{
+ anim(KEYBOARD_EFFECT_DURATION, "hide_state", 0);
+ }
+ }
+ program { name: "restack,show";
+ signal: "e,action,go";
+ source: "e";
+ filter: "clipper" "restack_hidden";
+ action: STATE_SET "visible" 0.0;
+ transition: CUBIC_BEZIER KEYBOARD_EFFECT_DURATION 0.25 0.46 0.45 1.0;
+ target: "shower";
+ target: "clipper";
+ target: "e.swallow.content";
+ after: "done";
+ }
+ program { name: "restack,finish";
+ signal: "e,action,go";
+ source: "e";
+ filter: "clipper" "restack_done";
+ action: STATE_SET "visible" 0.0;
+ target: "shower";
+ target: "clipper";
+ target: "e.swallow.content";
+ after: "done";
+ }
+ program { name: "done";
+ action: SIGNAL_EMIT "e,action,done" "e";
+ }
+ }
+}