enlightenment-module-net/net.edc

138 lines
2.6 KiB
Plaintext

images
{
image: "module_icon.png" COMP;
}
fonts
{
font: "VeraMono.ttf" "VeraMono";
}
collections
{
group
{
name: "modules/net/main";
script {
public message(Msg_Type:type, id, ...) {
if (type == MSG_INT_SET) {
new tmp;
new in_str[64];
new out_str[64];
tmp = getarg(2);
if (tmp > 1048576) {
tmp = tmp / 1048576;
snprintf(in_str, sizeof(in_str), "%i MB", tmp);
}
else if (tmp > 1024 && tmp < 1048576) {
tmp = tmp / 1024;
snprintf(in_str, sizeof(in_str), "%i KB", tmp);
}
else {
snprintf(in_str, sizeof(in_str), "%i B", tmp);
}
set_text(PART:"in-text", in_str);
tmp = getarg(3);
if (tmp > 1048576) {
tmp = tmp / 1048576;
snprintf(out_str, sizeof(out_str), "%i MB", tmp);
}
else if (tmp > 1024 && tmp < 1048576) {
tmp = tmp / 1024;
snprintf(out_str, sizeof(out_str), "%i KB", tmp);
}
else {
snprintf(out_str, sizeof(out_str), "%i B", tmp);
}
set_text(PART:"out-text", out_str);
}
}
}
parts{
part {
name: "net";
mouse_events: 0;
description {
state: "default" 0.0;
color: 255 255 255 255;
aspect: 1.0 1.0;
rel1 {
offset: 0 0;
}
rel2 {
offset: -1 -1;
}
image {
normal: "module_icon.png";
}
fill {
smooth: 0;
}
}
}
part
{
name: "out-text";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
align: 1.0 0.0;
rel1 {
relative: 1.0 0.0;
to_x: "net";
offset: -2 1;
}
rel2 {
relative: 1.0 0.0;
}
color: 255 255 255 255;
color3: 0 0 0 100;
text {
text: "out";
font: "VeraMono";
size: 10;
min: 1 1;
align: 1.0 0.0;
}
}
}
part
{
name: "in-text";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
align: 1.0 0.0;
rel1 {
relative: 1.0 1.0;
to_x: "net";
offset: -2 -10;
}
rel2 {
relative: 1.0 1.0;
}
color: 255 255 255 255;
color3: 0 0 0 100;
text {
text: "in";
font: "VeraMono";
size: 10;
min: 1 1;
align: 1.0 0.0;
}
}
}
}
}//close group net
}