experimental-legacy/ecdb/trunk/data/themes/default/macros/button.edc
2009-01-24 21:00:34 +00:00

493 lines
14 KiB
Plaintext

/* vim: set sw=3 ts=3 sts=3 expandtab: */
#define BUTTON_ICON(partname, partnametext, iconimage, minx, miny, maxx, maxy, rel1xto, rel1yto, rel1x, rel1y, rel2xto, rel2yto, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y, alignx, aligny) \
part { \
name: partname; \
type: IMAGE; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
min: minx miny; \
max: maxx maxy; \
color: 255 255 255 178; \
align: alignx aligny; \
rel1 { \
to_x: rel1xto; \
to_y: rel1yto; \
relative: rel1x rel1y; \
offset: offset1x offset1y; \
} \
rel2 { \
to_x: rel2xto; \
to_y: rel2yto; \
relative: rel2x rel2y; \
offset: offset2x offset2y; \
} \
image { \
normal: "button_base.png"; \
border: 7 7 7 7; \
} \
} \
} \
part { \
name: partname"button_clip"; \
type: RECT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 255; \
rel1 { \
to: partname; \
relative: 0.0 0.0; \
offset: 3 1; \
} \
rel2 { \
to: partname; \
relative: 1.0 1.0; \
offset: -4 -2; \
} \
} \
} \
part { \
name: partname"focus_clip"; \
type: RECT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 0; \
rel1 { \
to: partname"button"; \
offset: -1 0; \
} \
rel2 { \
to: partname"button"; \
offset: 0 -1; \
} \
} \
description { \
state: "visible" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partname"focus"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"focus_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
rel1 { \
to: partname"focus_clip"; \
} \
rel2 { \
to: partname"focus_clip"; \
} \
image { \
normal: "focus.png"; \
border: 7 7 7 7; \
} \
} \
} \
part { \
name: partname"button"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button.png"; \
border: 7 7 7 7; \
} \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
image { \
normal: "button_disabled.png"; \
border: 11 11 10 10; \
} \
} \
} \
part { \
name: partname"shadow"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
color: 255 255 255 0; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button_shadow.png"; \
border: 6 6 0 6; \
} \
} \
description { \
state: "clicked" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partname"shadow_overlay"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
color: 255 255 255 0; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button_shadow_overlay.png"; \
border: 6 6 6 13; \
} \
} \
description { \
state: "clicked" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partnametext; \
type: TEXT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
align: 0.0 0.5; \
color: 60 60 60 255; \
fixed: 1 1; \
rel1 { \
to: partname"ecdb.swallow.icon"; \
offset: 40 0; \
} \
rel2 { \
to: partname"ecdb.swallow.icon"; \
} \
text { \
text: ""; \
font: "ecdb/default"; \
min: 1 1; \
size: 11; \
align: 0.5 0.5; \
} \
} \
} \
part { \
name: partname"icon"; \
type: IMAGE; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
max: 32 32; \
align: 0.0 0.5; \
rel1 { \
to: partname"button_clip"; \
offset: 15 0; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: iconimage; \
} \
} \
}
#define BUTTON_PROGS(partname) \
program { \
name: partname"clicked"; \
action: STATE_SET "clicked" 0.0; \
signal: "mouse,down,1"; \
source: partname"*"; \
target: partname"shadow_overlay"; \
target: partname"shadow"; \
transition: DECELERATE 0.2; \
} \
program { \
name: partname"focus_in,mouse"; \
signal: "mouse,down,1"; \
action: STATE_SET "visible" 0.0; \
source: partname"*"; \
target: partname"focus_clip"; \
transition: DECELERATE 0.5; \
} \
program { \
name: partname"focus_in,ecdb"; \
signal: "ecdb,focus,in,"partname; \
action: STATE_SET "visible" 0.0; \
source: "ecdb"; \
target: partname"focus_clip"; \
transition: DECELERATE 0.5; \
} \
program { \
name: partname"unclick"; \
signal: "mouse,clicked,1"; \
signal: "mouse,up,1"; \
action: STATE_SET "default" 0.0; \
source: partname"*"; \
target: partname"shadow_overlay"; \
target: partname"shadow"; \
transition: DECELERATE 0.2; \
} \
program { \
name: partname"click_emit"; \
signal: "mouse,clicked,1"; \
source: partname"*"; \
action: SIGNAL_EMIT partname",clicked" partname; \
} \
program { \
name: partname"focus_out"; \
signal: "ecdb,focus,out,"partname; \
action: STATE_SET "default" 0.0; \
source: "ecdb"; \
target: partname"focus_clip"; \
transition: DECELERATE 0.5; \
} \
program { \
name: partname"disable"; \
signal: "ecdb,disable,"partname; \
action: STATE_SET "disabled" 0.0; \
source: "ecdb"; \
target: partname"button"; \
} \
program { \
name: partname"enable"; \
signal: "ecdb,enable,"partname; \
action: STATE_SET "default" 0.0; \
source: "ecdb"; \
target: partname"button"; \
}
#define BUTTON(partname, partnametext, minx, miny, maxx, maxy, rel1xto, rel1yto, rel1x, rel1y, rel2xto, rel2yto, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y, alignx, aligny) \
part { \
name: partname; \
type: IMAGE; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
min: minx miny; \
max: maxx maxy; \
color: 255 255 255 178; \
align: alignx aligny; \
rel1 { \
to_x: rel1xto; \
to_y: rel1yto; \
relative: rel1x rel1y; \
offset: offset1x offset1y; \
} \
rel2 { \
to_x: rel2xto; \
to_y: rel2yto; \
relative: rel2x rel2y; \
offset: offset2x offset2y; \
} \
image { \
normal: "button_base.png"; \
border: 7 7 7 7; \
} \
} \
} \
part { \
name: partname"button_clip"; \
type: RECT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 255; \
rel1 { \
to: partname; \
relative: 0.0 0.0; \
offset: 3 1; \
} \
rel2 { \
to: partname; \
relative: 1.0 1.0; \
offset: -4 -2; \
} \
} \
} \
part { \
name: partname"focus_clip"; \
type: RECT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 0; \
rel1 { \
to: partname"button"; \
offset: -1 0; \
} \
rel2 { \
to: partname"button"; \
offset: 0 -1; \
} \
} \
description { \
state: "visible" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partname"focus"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"focus_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
rel1 { \
to: partname"focus_clip"; \
} \
rel2 { \
to: partname"focus_clip"; \
} \
image { \
normal: "focus.png"; \
border: 7 7 7 7; \
} \
} \
} \
part { \
name: partname"button"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button.png"; \
border: 7 7 7 7; \
} \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
image { \
normal: "button_disabled.png"; \
border: 11 11 10 10; \
} \
} \
} \
part { \
name: partname"shadow"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
color: 255 255 255 0; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button_shadow.png"; \
border: 6 6 0 6; \
} \
} \
description { \
state: "clicked" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partname"shadow_overlay"; \
type: IMAGE; \
mouse_events: 1; \
clip_to: partname"button_clip"; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 0 24; \
color: 255 255 255 0; \
rel1 { \
to: partname"button_clip"; \
} \
rel2 { \
to: partname"button_clip"; \
} \
image { \
normal: "button_shadow_overlay.png"; \
border: 6 6 6 13; \
} \
} \
description { \
state: "clicked" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
part { \
name: partnametext; \
type: TEXT; \
mouse_events: 1; \
scale: 1; \
description { \
state: "default" 0.0; \
align: 0.0 0.5; \
color: 60 60 60 255; \
fixed: 1 1; \
rel1 { \
to: partname; \
} \
rel2 { \
to: partname; \
} \
text { \
text: ""; \
font: "ecdb/default"; \
min: 1 1; \
size: 11; \
align: 0.5 0.5; \
} \
} \
}