enlightenment/data/themes/edc/clock.edc

587 lines
18 KiB
Plaintext

#if 0
group { name: "e/modules/clock/digital";
}
#endif
#if 0
group { name: "e/modules/clock/main";
images {
image: "clock_base.png" COMP;
image: "tacho_fg.png" COMP;
image: "ch-h1.png" COMP;
image: "ch-h2.png" COMP;
image: "ch-m1.png" COMP;
image: "ch-m2.png" COMP;
image: "ch-s1.png" COMP;
image: "ch-s2.png" COMP;
}
min: 16 16;
max: 128 128;
script {
public do_seconds, tick_timer;
public clock_cb(val) {
new year, month, day, yearday, weekday, hour, minute;
new Float:second;
new v, dosec, tim;
new x, y, w, h;
date(year, month, day, yearday, weekday, hour, minute, second);
get_geometry(PART:"hour", x, y, w, h);
dosec = get_int(do_seconds);
if (dosec) {
v = round(second);
tim = timer(1.0 - (second - v), "clock_cb", 1);
custom_state(PART:"seconds", "default", 0.0);
set_state_val(PART:"seconds", STATE_MAP_ROT_Z, (v * 360.0) / 60.0);
set_state_val(PART:"seconds", STATE_IMAGE, IMAGE:"ch-s1.png");
set_state(PART:"seconds", "custom", 0.0);
custom_state(PART:"seconds-sh", "default", 0.0);
set_state_val(PART:"seconds-sh", STATE_MAP_ROT_Z, (v * 360.0) / 60.0);
set_state_val(PART:"seconds-sh", STATE_IMAGE, IMAGE:"ch-s2.png");
set_state(PART:"seconds-sh", "custom", 0.0);
}
else {
tim = timer(60.0 - (second), "clock_cb", 1);
}
set_int(tick_timer, tim);
custom_state(PART:"minutes", "default", 0.0);
set_state_val(PART:"minutes", STATE_MAP_ROT_Z, (float(minute) * 360.0) / 60.0);
set_state_val(PART:"minutes", STATE_IMAGE, IMAGE:"ch-m1.png");
set_state(PART:"minutes", "custom", 0.0);
custom_state(PART:"minutes-sh", "default", 0.0);
set_state_val(PART:"minutes-sh", STATE_MAP_ROT_Z, (float(minute) * 360.0) / 60.0);
set_state_val(PART:"minutes-sh", STATE_IMAGE, IMAGE:"ch-m2.png");
set_state(PART:"minutes-sh", "custom", 0.0);
custom_state(PART:"hour", "default", 0.0);
set_state_val(PART:"hour", STATE_MAP_ROT_Z, ((float(hour) + (float(minute) / 60.0)) * 360.0) / 12.0);
set_state_val(PART:"hour", STATE_IMAGE, IMAGE:"ch-h1.png");
set_state(PART:"hour", "custom", 0.0);
custom_state(PART:"hour-sh", "default", 0.0);
set_state_val(PART:"hour-sh", STATE_MAP_ROT_Z, ((float(hour) + (float(minute) / 60.0)) * 360.0) / 12.0);
set_state_val(PART:"hour-sh", STATE_IMAGE, IMAGE:"ch-h2.png");
set_state(PART:"hour-sh", "custom", 0.0);
}
}
parts {
part { name: "base";
description { state: "default" 0.0;
aspect: 1.0 1.0;
image.normal: "clock_base.png";
}
}
part { name: "base2"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
rel1.to: "base";
rel1.relative: (2.0/128.0) (2.0/128.0);
rel2.to: "base";
rel2.relative: (1.0+(2.0/128.0)) (1.0+(2.0/128.0));
}
}
part { name: "seconds-sh"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base2";
rel1.relative: 0.3125 0.0;
rel2.to: "base2";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-s2.png";
map. on: 1;
map.rotation.center: "base2";
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "seconds"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel1.relative: 0.3125 0.0;
rel2.to: "base";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-s1.png";
map.on: 1;
map.rotation.center: "base";
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "minutes-sh"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base2";
rel1.relative: 0.3125 0.0;
rel2.to: "base2";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-m2.png";
map.on: 1;
map.rotation.center: "base2";
}
}
part { name: "minutes"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel1.relative: 0.3125 0.0;
rel2.to: "base";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-m1.png";
map.on: 1;
map.rotation.center: "base";
}
}
part { name: "hour-sh"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base2";
rel1.relative: 0.3125 0.0;
rel2.to: "base2";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-h2.png";
map.on: 1;
map.rotation.center: "base2";
}
}
part { name: "hour"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel1.relative: 0.3125 0.0;
rel2.to: "base";
rel2.relative: 0.6875 0.6875;
image.normal: "ch-h1.png";
map.on: 1;
map.rotation.center: "base";
}
}
part { name: "over"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "tacho_fg.png";
}
}
}
programs {
program {
signal: "load"; source: "";
script {
clock_cb(0);
}
}
program {
signal: "e,state,seconds,on"; source: "e";
action: STATE_SET "default" 0.0;
target: "seconds";
target: "seconds-sh";
after: "sec2";
}
program { name: "sec2";
script {
new tim;
set_int(do_seconds, 1);
tim = get_int(tick_timer);
if (tim) {
cancel_timer(tim);
set_int(tick_timer, 0);
}
clock_cb(0);
}
}
program {
signal: "e,state,seconds,off"; source: "e";
action: STATE_SET "hidden" 0.0;
target: "seconds";
target: "seconds-sh";
after: "sec3";
}
program { name: "sec3";
script {
new tim;
set_int(do_seconds, 0);
tim = get_int(tick_timer);
if (tim) {
cancel_timer(tim);
set_int(tick_timer, 0);
}
clock_cb(0);
}
}
}
}
#endif
group { name: "e/modules/clock/calendar/dayname";
parts {
part { name: "e.text.label"; type: TEXT; mouse_events: 0;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
color: 21 21 21 255;
color3: 255 255 255 25;
text { font: "Sans"; size: 8;
min: 1 1;
align: 0.5 0.5;
text_class: "module_small";
}
}
description { state: "weekend" 0.0;
inherit: "default" 0.0;
color: 48 48 48 255;
}
}
}
programs {
program {
signal: "e,state,weekend"; source: "e";
action: STATE_SET "weekend" 0.0;
target: "e.text.label";
}
program {
signal: "e,state,weekday"; source: "e";
action: STATE_SET "default" 0.0;
target: "e.text.label";
}
}
}
group { name: "e/modules/clock/calendar/day";
script {
public day_state = 0;
evalstate() {
new vv = get_int(day_state);
if (vv & 2)
{
set_state(PART:"e.text.label", "today", 0.0);
set_state(PART:"label2", "today", 0.0);
}
else if (vv & 4)
{
set_state(PART:"e.text.label", "hidden", 0.0);
set_state(PART:"label2", "default", 0.0);
}
else if (vv & 1)
{
set_state(PART:"e.text.label", "weekend", 0.0);
set_state(PART:"label2", "default", 0.0);
}
else
{
set_state(PART:"e.text.label", "default", 0.0);
set_state(PART:"label2", "default", 0.0);
}
}
}
parts {
part { name: "e.text.label"; type: TEXT; mouse_events: 0;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
color: 255 255 255 255;
color3: 0 0 0 128;
text { font: "Sans"; size: 10;
min: 1 1;
align: 0.5 0.5;
}
}
description { state: "today" 0.0;
inherit: "default" 0.0;
visible: 0;
}
description { state: "weekend" 0.0;
inherit: "default" 0.0;
color: 128 128 128 255;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 21 21 21 255;
color3: 255 255 255 25;
}
}
part { name: "label2"; type: TEXT; mouse_events: 0;
effect: GLOW;
scale: 1;
description { state: "default" 0.0;
rel1.offset: -3 -3;
rel1.to: "e.text.label";
rel2.offset: 2 1;
rel2.to: "e.text.label";
color: 51 153 255 255;
color2: 51 153 255 24;
color3: 51 153 255 18;
text { font: "Sans"; size: 10;
text_source: "e.text.label";
min: 1 1;
align: 0.5 0.5;
}
visible: 0;
}
description { state: "today" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
}
programs {
program {
signal: "e,state,weekend"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv | 1);
evalstate();
}
}
program {
signal: "e,state,weekday"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv & (~1));
evalstate();
}
}
program {
signal: "e,state,today"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv | 2);
evalstate();
}
}
program {
signal: "e,state,someday"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv & (~2));
evalstate();
}
}
program {
signal: "e,state,hidden"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv | 4);
evalstate();
}
}
program {
signal: "e,state,visible"; source: "e";
script {
new vv = get_int(day_state);
set_int(day_state, vv & (~4));
evalstate();
}
}
}
}
group { name: "e/modules/clock/calendar";
images.image: "separator_horiz.png" COMP;
images.image: "sym_left_light_normal.png" COMP;
images.image: "sym_right_light_normal.png" COMP;
images.image: "sym_left_glow_normal.png" COMP;
images.image: "sym_right_glow_normal.png" COMP;
parts {
part { name: "e.text.month"; type: TEXT;
effect: SHADOW BOTTOM;
mouse_events: 1;
scale: 1;
description { state: "default" 0.0;
fixed: 0 1;
align: 0.0 0.0;
rel1.to_x: "prev";
rel1.relative: 1.0 0.0;
rel2.relative: 1.0 0.0;
color: 255 255 255 255;
color3: 0 0 0 128;
text { font: "Sans:style=Bold"; size: 10;
align: 0.0 0.5;
min: 0 1;
text_class: "module_normal";
}
}
}
part { name: "e.text.year"; type: TEXT; mouse_events: 0;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
fixed: 0 1;
align: 1.0 0.0;
rel1.relative: 0.0 0.0;
rel2.to_x: "next";
rel2.relative: 0.0 0.0;
color: 255 255 255 255;
color3: 0 0 0 128;
text { font: "Sans:style=Bold"; size: 10;
align: 1.0 0.5;
min: 0 1;
text_class: "module_normal";
}
}
}
part { name: "previm"; mouse_events: 0;
description { state: "default" 0.0;
min: 15 15;
max: 15 15;
rel1.to: "prev";
rel2.to: "prev";
image.normal: "sym_left_light_normal.png";
}
description { state: "pressed" 0.0;
inherit: "default" 0.0;
image.normal: "sym_left_glow_normal.png";
}
}
part { name: "prev"; type: RECT;
description { state: "default" 0.0;
align: 0.0 0.5;
color: 0 0 0 0;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
rel1.to_y: "e.text.month";
rel1.relative: 0.0 0.0;
rel2.to_y: "e.text.month";
rel2.relative: 0.0 1.0;
}
program { name: "prev_down";
signal: "mouse,down,1*"; source: "prev";
action: STATE_SET "pressed" 0.0;
target: "previm";
}
program { name: "prev_up";
signal: "mouse,up,1"; source: "prev";
action: STATE_SET "default" 0.0;
target: "previm";
}
program { name: "prev_clicked";
signal: "mouse,clicked,1*"; source: "prev";
action: SIGNAL_EMIT "e,action,prev" "";
}
}
part { name: "nextim"; mouse_events: 0;
description { state: "default" 0.0;
min: 15 15;
max: 15 15;
rel1.to: "next";
rel2.to: "next";
image.normal: "sym_right_light_normal.png";
}
description { state: "pressed" 0.0;
inherit: "default" 0.0;
image.normal: "sym_right_glow_normal.png";
}
}
part { name: "next"; type: RECT;
description { state: "default" 0.0;
align: 1.0 0.5;
color: 0 0 0 0;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
rel1.to_y: "e.text.month";
rel1.relative: 1.0 0.0;
rel2.to_y: "e.text.month";
rel2.relative: 1.0 1.0;
}
program { name: "next_down";
signal: "mouse,down,1"; source: "next";
action: STATE_SET "pressed" 0.0;
target: "nextim";
}
program { name: "next_up";
signal: "mouse,up,1"; source: "next";
action: STATE_SET "default" 0.0;
target: "nextim";
}
program { name: "next_clicked";
signal: "mouse,clicked,1"; source: "next";
action: SIGNAL_EMIT "e,action,next" "";
}
}
part { name: "sel";
description { state: "default" 0.0;
image.normal: "separator_horiz.png";
rel1.relative: 0.0 1.0;
rel1.offset: 0 0;
rel1.to: "e.table.daynames";
rel2.offset: -1 1;
rel2.to: "e.table.daynames";
min: 0 2;
fill.smooth: 0;
}
}
part { name: "e.table.daynames"; type: TABLE;
description { state: "default" 0.0;
fixed: 0 1;
align: 0.5 0.0;
rel1.to_y: "e.text.month";
rel1.relative: 0.0 1.0;
rel1.offset: 2 2;
rel2.to_y: "e.text.month";
rel2.relative: 1.0 1.0;
rel2.offset: -3 2;
step: 7 1;
table { homogeneous: TABLE;
padding: 1 1;
align: 0.5 0.5;
min: 1 1;
}
}
table {
items {
#define D(x) \
item { \
position: x 0; \
span: 1 1; \
source: "e/modules/clock/calendar/dayname"; \
weight: 1.0 1.0; \
align: -1.0 -1.0; \
}
D(0) D(1) D(2) D(3) D(4) D(5) D(6)
#undef D
}
}
}
part { name: "e.table.days"; type: TABLE;
description { state: "default" 0.0;
rel1.to_y: "e.table.daynames";
rel1.relative: 0.0 1.0;
rel1.offset: 2 2;
rel2.offset: -3 -3;
step: 7 5;
table { homogeneous: TABLE;
padding: 1 1;
align: 0.5 0.5;
min: 1 1;
}
}
table {
items {
#define D(x, y) \
item { \
position: x y; \
span: 1 1; \
source: "e/modules/clock/calendar/day"; \
weight: 1.0 1.0; \
align: -1.0 -1.0; \
}
D(0, 0) D(1, 0) D(2, 0) D(3, 0) D(4, 0) D(5, 0) D(6, 0)
D(0, 1) D(1, 1) D(2, 1) D(3, 1) D(4, 1) D(5, 1) D(6, 1)
D(0, 2) D(1, 2) D(2, 2) D(3, 2) D(4, 2) D(5, 2) D(6, 2)
D(0, 3) D(1, 3) D(2, 3) D(3, 3) D(4, 3) D(5, 3) D(6, 3)
D(0, 4) D(1, 4) D(2, 4) D(3, 4) D(4, 4) D(5, 4) D(6, 4)
D(0, 5) D(1, 5) D(2, 5) D(3, 5) D(4, 5) D(5, 5) D(6, 5)
#undef D
}
}
}
}
}