Compare commits
29 Commits
master
...
devs/disco
Author | SHA1 | Date |
---|---|---|
Mike Blumenkrantz | 27322fc770 | |
Mike Blumenkrantz | 2258646cfd | |
Mike Blumenkrantz | 40616fb203 | |
Mike Blumenkrantz | 33f735be17 | |
Mike Blumenkrantz | 402ad56164 | |
Mike Blumenkrantz | 75259485e0 | |
Mike Blumenkrantz | d3b055925b | |
Mike Blumenkrantz | cd3855c28c | |
Mike Blumenkrantz | 2e315664d4 | |
Mike Blumenkrantz | 5a6285920a | |
Mike Blumenkrantz | e17d1db9bf | |
Mike Blumenkrantz | 40cf98dfcd | |
Mike Blumenkrantz | 0d27de5cee | |
Mike Blumenkrantz | 02c33256d8 | |
Mike Blumenkrantz | 73b366c37f | |
Mike Blumenkrantz | 31ab01325d | |
Mike Blumenkrantz | 152ffee59e | |
Mike Blumenkrantz | 74aa33bf60 | |
Mike Blumenkrantz | ae23b2dfbc | |
Mike Blumenkrantz | 52abf2ce1b | |
Mike Blumenkrantz | b413a619e9 | |
Mike Blumenkrantz | f85d5e2cb3 | |
Mike Blumenkrantz | 0a4bb33218 | |
Mike Blumenkrantz | 459cf14f08 | |
Mike Blumenkrantz | c62120d935 | |
Mike Blumenkrantz | c224b458b5 | |
Mike Blumenkrantz | 6aa305d098 | |
Mike Blumenkrantz | ed4168b133 | |
Mike Blumenkrantz | 2ca0a31a8b |
|
@ -51,3 +51,6 @@ src/.libs/
|
|||
src/Makefile
|
||||
src/Makefile.in
|
||||
stamp-h1
|
||||
.deps
|
||||
.libs
|
||||
.dirstamp
|
||||
|
|
|
@ -24,9 +24,10 @@ glow_top.png
|
|||
|
||||
|
||||
include src/Makefile.mk
|
||||
include src/gadgets/Makefile.mk
|
||||
|
||||
e-module-desksanity.edj: e-module-desksanity.edc
|
||||
$(EDJE_CC) -id $(top_srcdir) $< $@
|
||||
e-module-desksanity.edj: e-module-desksanity.edc edc/*edc
|
||||
$(EDJE_CC) -id $(top_srcdir) -id $(top_srcdir)/edc $< $@
|
||||
|
||||
clean-local:
|
||||
rm -rf *.edj module.desktop e_modules-desksanity.spec *~
|
||||
|
|
|
@ -665,4 +665,5 @@ collections {
|
|||
}
|
||||
}
|
||||
}
|
||||
#include "edc/all.edc"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#include "macros.edc"
|
||||
#include "bryce.edc"
|
||||
#include "bryce_editor.edc"
|
||||
#include "wireless.edc"
|
After Width: | Height: | Size: 93 B |
|
@ -0,0 +1,371 @@
|
|||
group { name: "z/bryce/default/base"; nomouse;
|
||||
data {
|
||||
/* this tells e the number of pixels of the bryce to leave "exposed"
|
||||
* when auto-hiding the bryce */
|
||||
item: "hidden_state_size" "2";
|
||||
}
|
||||
images.image: "vgrad_med.png" COMP;
|
||||
images.image: "vgrad_tall.png" COMP;
|
||||
images.image: "bevel_out.png" COMP;
|
||||
images.image: "holes_vert.png" COMP;
|
||||
images.image: "holes_horiz.png" COMP;
|
||||
images.image: "shine.png" COMP;
|
||||
parts {
|
||||
rect { "mouse"; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "vgrad_med.png";
|
||||
fill.smooth: 0;
|
||||
TILED_HORIZ(120)
|
||||
color_class: "bryce_base";
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
image.normal: "vgrad_tall.png";
|
||||
fill.smooth: 0;
|
||||
TILED_HORIZ(40)
|
||||
color_class: "bryce_base";
|
||||
}
|
||||
}
|
||||
part { name: "bevel";
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "bevel_out.png";
|
||||
image.border: 1 1 1 1;
|
||||
image.middle: 0;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
part { name: "dots_start";
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "holes_vert.png";
|
||||
rel1.offset: 2 2;
|
||||
rel2.relative: 0.0 1.0;
|
||||
rel2.offset: 5 -3;
|
||||
FIXED_SIZE(4, 14)
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
image.normal: "holes_horiz.png";
|
||||
rel1.offset: 2 2;
|
||||
rel2.relative: 1.0 0.0;
|
||||
rel2.offset: -3 5;
|
||||
FIXED_SIZE(14, 4)
|
||||
}
|
||||
}
|
||||
part { name: "dots_end";
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "holes_vert.png";
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.offset: -6 2;
|
||||
rel2.offset: -3 -3;
|
||||
FIXED_SIZE(4, 14)
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
image.normal: "holes_horiz.png";
|
||||
rel1.relative: 0.0 1.0;
|
||||
rel1.offset: 2 -6;
|
||||
rel2.offset: -3 -3;
|
||||
FIXED_SIZE(14, 4)
|
||||
}
|
||||
}
|
||||
spacer { "sizer";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 1 0;
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.to_x: "dots_start";
|
||||
rel2.offset: -2 -1;
|
||||
rel2.to_x: "dots_end";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 0 1;
|
||||
rel1.relative: 0.0 1.0;
|
||||
rel1.to_y: "dots_start";
|
||||
rel2.offset: -1 -2;
|
||||
rel2.to_y: "dots_end";
|
||||
rel2.relative: 1.0 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW; mouse;
|
||||
desc {
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,visible" "e";
|
||||
}
|
||||
desc { "hidden"; hid;
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,hidden" "e";
|
||||
}
|
||||
}
|
||||
part { name: "shine";
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "shine.png";
|
||||
rel1.offset: 0 -2;
|
||||
rel2.relative: 1.0 0.0;
|
||||
rel2.offset: -1 2;
|
||||
FIXED_SIZE(69, 5)
|
||||
}
|
||||
}
|
||||
rect { "text_fader"; mouse;
|
||||
desc { hid;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
desc { "active";
|
||||
color: 0 0 0 192;
|
||||
}
|
||||
}
|
||||
text { "e.text"; scale;
|
||||
effect: SHADOW BOTTOM;
|
||||
desc { hid;
|
||||
color: 255 255 255 0;
|
||||
text { font: "Sans:style=Bold"; size: 14;
|
||||
min: 1 1;
|
||||
ellipsis: -1;
|
||||
}
|
||||
}
|
||||
desc { "active"; inherit; vis;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
program { signal: "e,action,resize"; source: "e";
|
||||
action: STATE_SET "active";
|
||||
transition: LINEAR 0.1;
|
||||
targets: "e.text" "text_fader";
|
||||
sequence {
|
||||
action: ACTION_STOP;
|
||||
target: "text_hide";
|
||||
action: STATE_SET "default";
|
||||
name: "text_hide";
|
||||
in: 1.0 0;
|
||||
transition: LINEAR 0.2;
|
||||
targets: "e.text" "text_fader";
|
||||
}
|
||||
}
|
||||
programs {
|
||||
#define ORIENT_SATE(_ORIENT, _STATE) \
|
||||
program { \
|
||||
signal: "e,state,orient,"_ORIENT; source: "e"; \
|
||||
action: STATE_SET _STATE 0.0; \
|
||||
target: "bg"; \
|
||||
target: "sizer"; \
|
||||
target: "dots_start"; \
|
||||
target: "dots_end"; \
|
||||
}
|
||||
}
|
||||
ORIENT_SATE("horizontal", "default")
|
||||
ORIENT_SATE("vertical", "vert")
|
||||
#undef ORIENT_SATE
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "z/bryce/invisible/base"; nomouse;
|
||||
inherit: "z/bryce/default/base";
|
||||
data.item: "noshadow" "1";
|
||||
parts {
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "bevel";
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "shine";
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "dots_start";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: -1 -1;
|
||||
min: 0 0;
|
||||
max: 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: -1 -1;
|
||||
min: 0 0;
|
||||
max: 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "dots_end";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: -1 -1;
|
||||
min: 0 0;
|
||||
max: 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: -1 -1;
|
||||
min: 0 0;
|
||||
max: 0 0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "z/bryce/translucent/base"; nomouse;
|
||||
inherit: "z/bryce/default/base";
|
||||
data.item: "noshadow" "1";
|
||||
parts {
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
color: 127 127 127 135;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
color: 127 127 127 135;
|
||||
}
|
||||
}
|
||||
part { name: "bevel";
|
||||
description { state: "default" 0.0;
|
||||
color: 127 127 127 135;
|
||||
}
|
||||
}
|
||||
part { name: "shine";
|
||||
description { state: "default" 0.0;
|
||||
color: 127 127 127 135;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "z/bryce/default/inset"; nomouse;
|
||||
alias: "z/bryce/invisible/inset";
|
||||
alias: "z/bryce/translucent/inset";
|
||||
images.image: "horiz_bar_inset.png" COMP;
|
||||
images.image: "vert_bar_inset.png" COMP;
|
||||
parts {
|
||||
rect { "mouse"; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
part { name: "base"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 3 1;
|
||||
rel2.offset: -4 -2;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 1 3;
|
||||
rel2.offset: -2 -4;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
spacer { "sizer";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 4 1;
|
||||
rel2.offset: -5 -2;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 1 4;
|
||||
rel2.offset: -2 -5;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW; mouse;
|
||||
clip_to: "clip";
|
||||
desc {
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,visible" "e";
|
||||
}
|
||||
desc { "hidden"; hid;
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,hidden" "e";
|
||||
}
|
||||
}
|
||||
part { name: "inset";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 2 0;
|
||||
rel2.offset: -3 -1;
|
||||
image.normal: "horiz_bar_inset.png";
|
||||
image.border: 7 7 1 1;
|
||||
image.middle: 0;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
description { state: "vert" 0.0;
|
||||
rel1.offset: 0 2;
|
||||
rel2.offset: -1 -3;
|
||||
image.normal: "vert_bar_inset.png";
|
||||
image.border: 1 1 8 6;
|
||||
image.middle: 0;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
rect { "events"; repeat; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
}
|
||||
programs {
|
||||
#define ORIENT_SATE(_ORIENT, _STATE) \
|
||||
program { \
|
||||
signal: "e,state,orient,"_ORIENT; source: "e"; \
|
||||
action: STATE_SET _STATE 0.0; \
|
||||
target: "sizer"; \
|
||||
target: "inset"; \
|
||||
target: "clip"; \
|
||||
}
|
||||
ORIENT_SATE("horizontal", "default")
|
||||
ORIENT_SATE("vertical", "vert")
|
||||
#undef ORIENT_SATE
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "z/bryce/default/plain"; nomouse;
|
||||
alias: "z/bryce/invisible/plain";
|
||||
alias: "z/bryce/translucent/plain";
|
||||
parts {
|
||||
rect { "mouse"; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
part { name: "base"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
spacer { "sizer";
|
||||
desc {
|
||||
rel1.offset: 1 1;
|
||||
rel2.offset: -2 -2;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content"; type: SWALLOW; mouse;
|
||||
clip_to: "clip";
|
||||
desc {
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,visible" "e";
|
||||
}
|
||||
desc { "hidden"; hid;
|
||||
rel.to: "sizer";
|
||||
link.base: "e,state,hidden" "e";
|
||||
}
|
||||
}
|
||||
rect { "events"; repeat; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { "elm/scroller/base/bryce";
|
||||
parts {
|
||||
rect { "clip"; }
|
||||
swallow { "elm.swallow.content" clip: "clip"; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,411 @@
|
|||
group { "bryce_editor_text"; inherit_only: 1;
|
||||
parts {
|
||||
text { "e.text"; scale; nomouse;
|
||||
effect: SHADOW BOTTOM;
|
||||
desc {
|
||||
color: 255 255 255 255;
|
||||
text { font: "Sans:style=Bold"; size: 18;
|
||||
min: 1 1;
|
||||
ellipsis: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/side";
|
||||
parts {
|
||||
rect { "base"; desc { color: 0 0 0 192; } }
|
||||
program { signal: "mouse,down,*"; source: "base";
|
||||
action: SIGNAL_EMIT "e,action,dismiss" "e";
|
||||
}
|
||||
rect { "bottom"; scale;
|
||||
desc {
|
||||
min: 33 32;
|
||||
align: 0 1;
|
||||
rel1.relative: 0.3 1;
|
||||
rel2.relative: 0.7 1;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "bottom";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "bottom";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,bottom" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "bottom";
|
||||
action: SIGNAL_EMIT "e,bryce,add,bottom" "e";
|
||||
}
|
||||
rect { "top"; scale;
|
||||
desc {
|
||||
min: 33 32;
|
||||
align: 0 0;
|
||||
rel1.relative: 0.3 0;
|
||||
rel2.relative: 0.7 0;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "top";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "top";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,top" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "top";
|
||||
action: SIGNAL_EMIT "e,bryce,add,top" "e";
|
||||
}
|
||||
rect { "left"; scale;
|
||||
desc {
|
||||
min: 32 33;
|
||||
align: 0 0;
|
||||
rel1.relative: 0 0.3;
|
||||
rel2.relative: 0 0.7;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "left";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "left";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,left" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "left";
|
||||
action: SIGNAL_EMIT "e,bryce,add,left" "e";
|
||||
}
|
||||
rect { "right"; scale;
|
||||
desc {
|
||||
min: 32 33;
|
||||
align: 1 0;
|
||||
rel1.relative: 1 0.3;
|
||||
rel2.relative: 1 0.7;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "right";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "right";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,right" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "right";
|
||||
action: SIGNAL_EMIT "e,bryce,add,right" "e";
|
||||
}
|
||||
}
|
||||
inherit: "bryce_editor_text";
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/side/horizontal";
|
||||
parts {
|
||||
rect { "base"; desc { color: 0 0 0 192; } }
|
||||
program { signal: "mouse,down,*"; source: "base";
|
||||
action: SIGNAL_EMIT "e,action,dismiss" "e";
|
||||
}
|
||||
spacer { "pos";
|
||||
desc { align: 0 0;
|
||||
min: 0 32;
|
||||
rel2.relative: 1 0;
|
||||
}
|
||||
desc { "bottom";
|
||||
align: 0 1;
|
||||
min: 0 32;
|
||||
rel1.relative: 0 1;
|
||||
link.base: "e,state,bottom" "e";
|
||||
}
|
||||
}
|
||||
rect { "center"; scale;
|
||||
desc {
|
||||
min: 33 32;
|
||||
align: 0 0;
|
||||
rel.to_y: "pos";
|
||||
rel1.relative: 0.4 0;
|
||||
rel2.relative: 0.6 1;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "center";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "center";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,center" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "center";
|
||||
action: SIGNAL_EMIT "e,bryce,add,center" "e";
|
||||
}
|
||||
rect { "left"; scale;
|
||||
desc {
|
||||
min: 33 32;
|
||||
align: 0 0;
|
||||
rel.to_y: "pos";
|
||||
rel1.relative: 0 0;
|
||||
rel2.relative: 0.2 1;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "left";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "left";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,left" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "left";
|
||||
action: SIGNAL_EMIT "e,bryce,add,left" "e";
|
||||
}
|
||||
rect { "right"; scale;
|
||||
desc {
|
||||
min: 33 32;
|
||||
align: 1 0;
|
||||
rel.to_y: "pos";
|
||||
rel1.relative: 0.8 0;
|
||||
rel2.relative: 1 1;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "right";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "right";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,right" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "right";
|
||||
action: SIGNAL_EMIT "e,bryce,add,right" "e";
|
||||
}
|
||||
}
|
||||
inherit: "bryce_editor_text";
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/side/vertical";
|
||||
parts {
|
||||
rect { "base"; desc { color: 0 0 0 192; } }
|
||||
program { signal: "mouse,down,*"; source: "base";
|
||||
action: SIGNAL_EMIT "e,action,dismiss" "e";
|
||||
}
|
||||
spacer { "pos";
|
||||
desc { align: 0 0;
|
||||
min: 32 0;
|
||||
rel2.relative: 0 1;
|
||||
}
|
||||
desc { "right";
|
||||
align: 1 0;
|
||||
min: 32 0;
|
||||
rel1.relative: 1 0;
|
||||
link.base: "e,state,right" "e";
|
||||
}
|
||||
}
|
||||
rect { "center"; scale;
|
||||
desc {
|
||||
min: 32 33;
|
||||
align: 0 0;
|
||||
rel.to_x: "pos";
|
||||
rel1.relative: 0 0.4;
|
||||
rel2.relative: 1 0.6;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "center";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "center";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,center" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "center";
|
||||
action: SIGNAL_EMIT "e,bryce,add,center" "e";
|
||||
}
|
||||
rect { "top"; scale;
|
||||
desc {
|
||||
min: 32 33;
|
||||
align: 0 0;
|
||||
rel.to_x: "pos";
|
||||
rel1.relative: 0 0;
|
||||
rel2.relative: 1 0.2;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "top";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "top";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,top" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "top";
|
||||
action: SIGNAL_EMIT "e,bryce,add,top" "e";
|
||||
}
|
||||
rect { "bottom"; scale;
|
||||
desc {
|
||||
min: 32 33;
|
||||
align: 0 1;
|
||||
rel.to_x: "pos";
|
||||
rel1.relative: 0 0.8;
|
||||
rel2.relative: 1 1;
|
||||
color: 52 153 255 90;
|
||||
link.base: "mouse,out" "bottom";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "bottom";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "hid"; hid;
|
||||
link.base: "e,bryce,exists,bottom" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "bottom";
|
||||
action: SIGNAL_EMIT "e,bryce,add,bottom" "e";
|
||||
}
|
||||
}
|
||||
inherit: "bryce_editor_text";
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/style/item"; nomouse;
|
||||
parts {
|
||||
rect { "highlight_t"; scale;
|
||||
desc {
|
||||
align: 0.5 0;
|
||||
max: -1 1;
|
||||
color: 255 255 255 150;
|
||||
link.base: "mouse,out" "events";
|
||||
}
|
||||
desc { "active"; max: -1 1;
|
||||
align: 0.5 0;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "events";
|
||||
}
|
||||
}
|
||||
rect { "highlight_l"; scale;
|
||||
desc { align: 0 0.5;
|
||||
max: 1 -1;
|
||||
color: 255 255 255 150;
|
||||
link.base: "mouse,out" "events";
|
||||
}
|
||||
desc { "active"; max: 1 -1;
|
||||
align: 0 0.5;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "events";
|
||||
}
|
||||
}
|
||||
rect { "highlight_r"; scale;
|
||||
desc {
|
||||
align: 1 0.5;
|
||||
max: 1 -1;
|
||||
color: 255 255 255 150;
|
||||
link.base: "mouse,out" "events";
|
||||
}
|
||||
desc { "active"; align: 1 0.5;
|
||||
max: 1 -1;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "events";
|
||||
}
|
||||
}
|
||||
rect { "highlight_b"; scale;
|
||||
desc {
|
||||
align: 0.5 1;
|
||||
max: -1 1;
|
||||
color: 255 255 255 150;
|
||||
link.base: "mouse,out" "events";
|
||||
}
|
||||
desc { "active"; align: 0.5 1;
|
||||
max: -1 1;
|
||||
color: 52 153 255 230;
|
||||
link.base: "mouse,in" "events";
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.content";
|
||||
desc {
|
||||
rel1.offset: 1 1;
|
||||
rel2.offset: -2 -2;
|
||||
}
|
||||
}
|
||||
text { "e.text"; scale;
|
||||
effect: SHADOW BOTTOM;
|
||||
desc {
|
||||
color: 255 255 255 255;
|
||||
text { font: "Sans:style=Bold"; size: 14;
|
||||
min: 1 1;
|
||||
ellipsis: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
rect { "events"; mouse;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/style";
|
||||
parts {
|
||||
rect { "base"; desc { color: 0 0 0 192; } }
|
||||
program { signal: "mouse,down,*"; source: "base";
|
||||
action: SIGNAL_EMIT "e,action,dismiss" "e";
|
||||
}
|
||||
swallow { "e.swallow.content";
|
||||
desc { align: 0.5 0;
|
||||
rel1.to_y: "e.text";
|
||||
rel1.relative: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
inherit: "bryce_editor_text";
|
||||
parts {
|
||||
text { "e.text";
|
||||
desc { "default";
|
||||
align: 0.5 0;
|
||||
rel2.relative: 1 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { "z/bryce/editor/finish"; inherit: "z/bryce/editor/style";
|
||||
parts {
|
||||
swallow { "e.swallow.content";
|
||||
desc { "default";
|
||||
rel1.relative: 1 1;
|
||||
rel2.to_y: "e.swallow.button";
|
||||
rel2.relative: 0 0;
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.button";
|
||||
desc { align: 0.5 1;
|
||||
rel1.relative: 1 1;
|
||||
rel2.relative: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 543 B |
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 128 B |
After Width: | Height: | Size: 184 B |
After Width: | Height: | Size: 194 B |
After Width: | Height: | Size: 278 B |
After Width: | Height: | Size: 225 B |
After Width: | Height: | Size: 234 B |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 6.9 KiB |
|
@ -0,0 +1,11 @@
|
|||
#define ASPECT_FILL(_ASPECT) \
|
||||
aspect: _ASPECT _ASPECT; aspect_preference: NONE;
|
||||
#define TILED_PATTERN(_WIDTH, _HEIGHT) \
|
||||
fill { size { relative: 0.0 0.0; offset: _WIDTH _HEIGHT; } }
|
||||
#define TILED_HORIZ(_WIDTH) \
|
||||
fill { size { relative: 0.0 1.0; offset: _WIDTH 0; } }
|
||||
#define FIXED_SIZE(_WIDTH, _HEIGHT) \
|
||||
min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1;
|
||||
|
||||
#define DARK_GREY_BG_COLOR 48 48 48 255
|
||||
#define DARK_GREY_BG_DISABLED_COLOR 64 64 64 255
|
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 199 B |
After Width: | Height: | Size: 269 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1,954 @@
|
|||
group { name: "e/modules/wireless/ethernet"; nomouse;
|
||||
images.image: "slot_horiz_top.png" COMP;
|
||||
images.image: "slot_horiz_bottom.png" COMP;
|
||||
images.image: "eth.png" COMP;
|
||||
images.image: "exlclam.png" COMP;
|
||||
images.image: "hole_tiny.png" COMP;
|
||||
images.image: "led_tiny_orange.png" COMP;
|
||||
images.image: "led_tiny_green.png" COMP;
|
||||
images.image: "lock_locked.png" COMP;
|
||||
images.image: "lock_insecure.png" COMP;
|
||||
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
new state = getarg(2);
|
||||
if ((state == 1)) {
|
||||
set_state(PART:"led", "default", 0.0);
|
||||
run_program(PROGRAM:"connecting");
|
||||
return;
|
||||
}
|
||||
else if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
|
||||
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
|
||||
else { set_state(PART:"led", "default", 0.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "slot_bottom";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "slot";
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to: "slot";
|
||||
min: 0 3;
|
||||
image.normal: "slot_horiz_bottom.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "exclam_base";
|
||||
clip_to: "clip_exclam";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (71/144) (71/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "exlclam.png";
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "eth_base";
|
||||
clip_to: "clip_eth";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (60/144) (60/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "eth.png";
|
||||
}
|
||||
}
|
||||
part { name: "slot";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 -1;
|
||||
rel1.relative: (21/160) 1.0;
|
||||
rel2.offset: -1 -1;
|
||||
rel2.relative: (140/160) 1.0;
|
||||
align: 0.5 1.0;
|
||||
min: 0 6;
|
||||
image.normal: "slot_horiz_top.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
part { name: "hole";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: -4 -4;
|
||||
rel1.relative: 1.0 1.0;
|
||||
rel2.offset: -4 -4;
|
||||
align: 1.0 1.0;
|
||||
min: 4 4;
|
||||
max: 4 4;
|
||||
image.normal: "hole_tiny.png";
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
part { name: "clip_exclam"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "eth" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip_eth"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "eth" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "led";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "hole";
|
||||
rel2.to: "hole";
|
||||
min: 10 10;
|
||||
max: 10 10;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "online" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "event"; type: RECT; mouse;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
programs {
|
||||
program { name: "connecting";
|
||||
action: STATE_SET "connected" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting2";
|
||||
}
|
||||
program { name: "connecting2";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting";
|
||||
}
|
||||
target_group: "clips" "clip_exclam" "clip_eth";
|
||||
program {
|
||||
signal: "e,state,error"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
groups: "clips";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,default"; source: "e";
|
||||
action: STATE_SET "eth" 0.0;
|
||||
groups: "clips";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/wireless/wifi"; nomouse;
|
||||
images.image: "slot_horiz_top.png" COMP;
|
||||
images.image: "slot_horiz_bottom.png" COMP;
|
||||
images.image: "wifi_shadow.png" COMP;
|
||||
images.image: "wifi_base.png" COMP;
|
||||
images.image: "wifi_sig_1.png" COMP;
|
||||
images.image: "wifi_sig_2.png" COMP;
|
||||
images.image: "wifi_sig_3.png" COMP;
|
||||
images.image: "exlclam.png" COMP;
|
||||
images.image: "hole_tiny.png" COMP;
|
||||
images.image: "led_tiny_orange.png" COMP;
|
||||
images.image: "led_tiny_green.png" COMP;
|
||||
images.image: "lock_locked.png" COMP;
|
||||
images.image: "lock_insecure.png" COMP;
|
||||
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
new state = getarg(2), signl = getarg(3);
|
||||
if (state <= 1) {
|
||||
set_state(PART:"wifi_1", "default", 0.0);
|
||||
set_state(PART:"wifi_2", "default", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
set_state(PART:"led", "default", 0.0);
|
||||
}
|
||||
if (state == 1) {
|
||||
run_program(PROGRAM:"connecting");
|
||||
run_program(PROGRAM:"connecting_wifi");
|
||||
return;
|
||||
}
|
||||
stop_programs_on(PART:"led");
|
||||
if (signl <= 14) {
|
||||
set_state(PART:"wifi_1", "default", 0.0);
|
||||
set_state(PART:"wifi_2", "default", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 28) {
|
||||
set_state(PART:"wifi_1", "partly", 0.0);
|
||||
set_state(PART:"wifi_2", "default", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 42) {
|
||||
set_state(PART:"wifi_1", "visible", 0.0);
|
||||
set_state(PART:"wifi_2", "default", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 57) {
|
||||
set_state(PART:"wifi_1", "visible", 0.0);
|
||||
set_state(PART:"wifi_2", "partly", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 71) {
|
||||
set_state(PART:"wifi_1", "visible", 0.0);
|
||||
set_state(PART:"wifi_2", "visible", 0.0);
|
||||
set_state(PART:"wifi_3", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 85) {
|
||||
set_state(PART:"wifi_1", "visible", 0.0);
|
||||
set_state(PART:"wifi_2", "visible", 0.0);
|
||||
set_state(PART:"wifi_3", "partly", 0.0);
|
||||
}
|
||||
else {
|
||||
set_state(PART:"wifi_1", "visible", 0.0);
|
||||
set_state(PART:"wifi_2", "visible", 0.0);
|
||||
set_state(PART:"wifi_3", "visible", 0.0);
|
||||
}
|
||||
if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
|
||||
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
|
||||
else { set_state(PART:"led", "default", 0.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "slot_bottom";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "slot";
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to: "slot";
|
||||
min: 0 3;
|
||||
image.normal: "slot_horiz_bottom.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "exclam_base";
|
||||
clip_to: "clip_exclam";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (71/144) (71/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "exlclam.png";
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "wifi_shadow";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (160/144) (160/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "wifi_shadow.png";
|
||||
}
|
||||
}
|
||||
part { name: "wifi_base";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (160/144) (160/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "wifi_base.png";
|
||||
}
|
||||
}
|
||||
part { name: "wifi_1";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "wifi_base";
|
||||
rel2.to: "wifi_base";
|
||||
image.normal: "wifi_sig_1.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "wifi_2";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "wifi_base";
|
||||
rel2.to: "wifi_base";
|
||||
image.normal: "wifi_sig_2.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "wifi_3";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "wifi_base";
|
||||
rel2.to: "wifi_base";
|
||||
image.normal: "wifi_sig_3.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "lock";
|
||||
clip_to: "clip_wifi";
|
||||
description { state: "default" 0.0; hid;
|
||||
aspect: (160/144) (160/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "lock_locked.png";
|
||||
link.base: "e,state,unsecured" "e";
|
||||
}
|
||||
desc { "insecure"; inherit; vis;
|
||||
image.normal: "lock_insecure.png";
|
||||
link.base: "e,state,insecure" "e";
|
||||
}
|
||||
desc { "secure"; inherit; vis;
|
||||
link.base: "e,state,secure" "e";
|
||||
}
|
||||
}
|
||||
//////////////////////////
|
||||
part { name: "slot";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 -1;
|
||||
rel1.relative: (21/160) 1.0;
|
||||
rel2.offset: -1 -1;
|
||||
rel2.relative: (140/160) 1.0;
|
||||
align: 0.5 1.0;
|
||||
min: 0 6;
|
||||
image.normal: "slot_horiz_top.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
part { name: "hole";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: -4 -4;
|
||||
rel1.relative: 1.0 1.0;
|
||||
rel2.offset: -4 -4;
|
||||
align: 1.0 1.0;
|
||||
min: 4 4;
|
||||
max: 4 4;
|
||||
image.normal: "hole_tiny.png";
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
part { name: "clip_exclam"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "wifi" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip_wifi"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "wifi" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "led";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "hole";
|
||||
rel2.to: "hole";
|
||||
min: 10 10;
|
||||
max: 10 10;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "online" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "event"; type: RECT; mouse;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { "connecting_wifi";
|
||||
action: STATE_SET "default";
|
||||
targets: "wifi_1" "wifi_2" "wifi_3";
|
||||
sequence {
|
||||
action: STATE_SET "partly";
|
||||
target: "wifi_1";
|
||||
transition: LINEAR 0.085;
|
||||
action: STATE_SET "visible";
|
||||
target: "wifi_1";
|
||||
transition: LINEAR 0.085;
|
||||
action: STATE_SET "partly";
|
||||
target: "wifi_2";
|
||||
transition: LINEAR 0.085;
|
||||
action: STATE_SET "visible";
|
||||
target: "wifi_2";
|
||||
transition: LINEAR 0.085;
|
||||
action: STATE_SET "partly";
|
||||
target: "wifi_3";
|
||||
transition: LINEAR 0.085;
|
||||
action: STATE_SET "visible";
|
||||
target: "wifi_3";
|
||||
transition: LINEAR 0.085;
|
||||
after: "connecting_wifi";
|
||||
}
|
||||
}
|
||||
program { "connecting";
|
||||
action: STATE_SET "connected";
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
sequence {
|
||||
action: STATE_SET "default";
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting";
|
||||
}
|
||||
}
|
||||
target_group: "clips" "clip_exclam" "clip_wifi";
|
||||
program {
|
||||
signal: "e,state,error"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
groups: "clips";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,default"; source: "e";
|
||||
action: STATE_SET "wifi" 0.0;
|
||||
groups: "clips";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/wireless/bluetooth"; nomouse;
|
||||
images.image: "slot_horiz_top.png" COMP;
|
||||
images.image: "slot_horiz_bottom.png" COMP;
|
||||
images.image: "exlclam.png" COMP;
|
||||
images.image: "hole_tiny.png" COMP;
|
||||
images.image: "led_tiny_orange.png" COMP;
|
||||
images.image: "led_tiny_green.png" COMP;
|
||||
images.image: "bt_base.png" COMP;
|
||||
images.image: "bt_sig_1.png" COMP;
|
||||
images.image: "bt_sig_2.png" COMP;
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
new state = getarg(2), signl = getarg(3);
|
||||
if (signl <= 20) {
|
||||
set_state(PART:"bt_1", "default", 0.0);
|
||||
set_state(PART:"bt_2", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 40) {
|
||||
set_state(PART:"bt_1", "partly", 0.0);
|
||||
set_state(PART:"bt_2", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 60) {
|
||||
set_state(PART:"bt_1", "visible", 0.0);
|
||||
set_state(PART:"bt_2", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 80) {
|
||||
set_state(PART:"bt_1", "visible", 0.0);
|
||||
set_state(PART:"bt_2", "partly", 0.0);
|
||||
}
|
||||
else {
|
||||
set_state(PART:"bt_1", "visible", 0.0);
|
||||
set_state(PART:"bt_2", "visible", 0.0);
|
||||
}
|
||||
if ((state == 2)) {
|
||||
set_state(PART:"led", "default", 0.0);
|
||||
run_program(PROGRAM:"connecting");
|
||||
return;
|
||||
}
|
||||
else if ((state == 3)) { return; }
|
||||
else if ((state == 4)) { set_state(PART:"led", "connected", 0.0); }
|
||||
else if ((state == 5)) { set_state(PART:"led", "online", 0.0); }
|
||||
else { set_state(PART:"led", "default", 0.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "slot_bottom";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "slot";
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to: "slot";
|
||||
min: 0 3;
|
||||
image.normal: "slot_horiz_bottom.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "exclam_base";
|
||||
clip_to: "clip_exclam";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (71/144) (71/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "exlclam.png";
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "bt_base";
|
||||
clip_to: "clip_bt";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (160/144) (160/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "bt_base.png";
|
||||
}
|
||||
}
|
||||
part { name: "bt_1";
|
||||
clip_to: "clip_bt";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "bt_base";
|
||||
rel2.to: "bt_base";
|
||||
image.normal: "bt_sig_1.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "bt_2";
|
||||
clip_to: "clip_bt";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "bt_base";
|
||||
rel2.to: "bt_base";
|
||||
image.normal: "bt_sig_2.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "slot";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 -1;
|
||||
rel1.relative: (21/160) 1.0;
|
||||
rel2.offset: -1 -1;
|
||||
rel2.relative: (140/160) 1.0;
|
||||
align: 0.5 1.0;
|
||||
min: 0 6;
|
||||
image.normal: "slot_horiz_top.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
part { name: "hole";
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: -4 -4;
|
||||
rel1.relative: 1.0 1.0;
|
||||
rel2.offset: -4 -4;
|
||||
align: 1.0 1.0;
|
||||
min: 4 4;
|
||||
max: 4 4;
|
||||
image.normal: "hole_tiny.png";
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
part { name: "clip_exclam"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "bt" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip_bt"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "bt" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "led";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "hole";
|
||||
rel2.to: "hole";
|
||||
min: 10 10;
|
||||
max: 10 10;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "online" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "event"; type: RECT; mouse;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "connecting";
|
||||
action: STATE_SET "connected" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting2";
|
||||
}
|
||||
program { name: "connecting2";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,error"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "clip_exclam";
|
||||
target: "clip_bt";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,default"; source: "e";
|
||||
action: STATE_SET "bt" 0.0;
|
||||
target: "clip_exclam";
|
||||
target: "clip_bt";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/modules/wireless/cellular";
|
||||
images.image: "slot_horiz_top.png" COMP;
|
||||
images.image: "slot_horiz_bottom.png" COMP;
|
||||
images.image: "exlclam.png" COMP;
|
||||
images.image: "hole_tiny.png" COMP;
|
||||
images.image: "led_tiny_orange.png" COMP;
|
||||
images.image: "led_tiny_green.png" COMP;
|
||||
images.image: "cell_base.png" COMP;
|
||||
images.image: "cell_sig_1.png" COMP;
|
||||
images.image: "cell_sig_2.png" COMP;
|
||||
images.image: "cell_sig_3.png" COMP;
|
||||
images.image: "cell_sig_4.png" COMP;
|
||||
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 1)) {
|
||||
new state = getarg(2), signl = getarg(3);
|
||||
if (signl <= 11) {
|
||||
set_state(PART:"cell_1", "default", 0.0);
|
||||
set_state(PART:"cell_2", "default", 0.0);
|
||||
set_state(PART:"cell_3", "default", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 22) {
|
||||
set_state(PART:"cell_1", "partly", 0.0);
|
||||
set_state(PART:"cell_2", "default", 0.0);
|
||||
set_state(PART:"cell_3", "default", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 33) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "default", 0.0);
|
||||
set_state(PART:"cell_3", "default", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 44) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "partly", 0.0);
|
||||
set_state(PART:"cell_3", "default", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 55) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "visible", 0.0);
|
||||
set_state(PART:"cell_3", "default", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 66) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "visible", 0.0);
|
||||
set_state(PART:"cell_3", "partly", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 77) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "visible", 0.0);
|
||||
set_state(PART:"cell_3", "visible", 0.0);
|
||||
set_state(PART:"cell_4", "default", 0.0);
|
||||
}
|
||||
else if (signl <= 88) {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "visible", 0.0);
|
||||
set_state(PART:"cell_3", "visible", 0.0);
|
||||
set_state(PART:"cell_4", "partly", 0.0);
|
||||
}
|
||||
else {
|
||||
set_state(PART:"cell_1", "visible", 0.0);
|
||||
set_state(PART:"cell_2", "visible", 0.0);
|
||||
set_state(PART:"cell_3", "visible", 0.0);
|
||||
set_state(PART:"cell_4", "visible", 0.0);
|
||||
}
|
||||
if ((state == 1)) {
|
||||
set_state(PART:"led", "default", 0.0);
|
||||
run_program(PROGRAM:"connecting");
|
||||
return;
|
||||
}
|
||||
else if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
|
||||
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
|
||||
else { set_state(PART:"led", "default", 0.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "slot_bottom"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "slot";
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to: "slot";
|
||||
min: 0 3;
|
||||
image.normal: "slot_horiz_bottom.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "exclam_base"; mouse_events: 0;
|
||||
clip_to: "clip_exclam";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (71/144) (71/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "exlclam.png";
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "cell_base"; mouse_events: 0;
|
||||
clip_to: "clip_cell";
|
||||
description { state: "default" 0.0;
|
||||
aspect: (160/144) (160/144); aspect_preference: BOTH;
|
||||
align: 0.5 1.0;
|
||||
rel2.relative: 1.0 0.5;
|
||||
rel2.to_y: "slot";
|
||||
image.normal: "cell_base.png";
|
||||
}
|
||||
}
|
||||
part { name: "cell_1"; mouse_events: 0;
|
||||
clip_to: "clip_cell";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "cell_base";
|
||||
rel2.to: "cell_base";
|
||||
image.normal: "cell_sig_1.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "cell_2"; mouse_events: 0;
|
||||
clip_to: "clip_cell";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "cell_base";
|
||||
rel2.to: "cell_base";
|
||||
image.normal: "cell_sig_2.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "cell_3"; mouse_events: 0;
|
||||
clip_to: "clip_cell";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "cell_base";
|
||||
rel2.to: "cell_base";
|
||||
image.normal: "cell_sig_3.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "cell_4"; mouse_events: 0;
|
||||
clip_to: "clip_cell";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "cell_base";
|
||||
rel2.to: "cell_base";
|
||||
image.normal: "cell_sig_4.png";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "partly" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
///////////////////////
|
||||
part { name: "slot"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: 0 -1;
|
||||
rel1.relative: (21/160) 1.0;
|
||||
rel2.offset: -1 -1;
|
||||
rel2.relative: (140/160) 1.0;
|
||||
align: 0.5 1.0;
|
||||
min: 0 6;
|
||||
image.normal: "slot_horiz_top.png";
|
||||
fixed: 0 1;
|
||||
}
|
||||
}
|
||||
part { name: "hole"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: -4 -4;
|
||||
rel1.relative: 1.0 1.0;
|
||||
rel2.offset: -4 -4;
|
||||
align: 1.0 1.0;
|
||||
min: 4 4;
|
||||
max: 4 4;
|
||||
image.normal: "hole_tiny.png";
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
part { name: "clip_exclam"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "cell" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip_cell"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "cell" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "led"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "hole";
|
||||
rel2.to: "hole";
|
||||
min: 10 10;
|
||||
max: 10 10;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_orange.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "online" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "led_tiny_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "event"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
programs {
|
||||
program { name: "connecting";
|
||||
action: STATE_SET "connected" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting2";
|
||||
}
|
||||
program { name: "connecting2";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "led";
|
||||
in: 0.3 0.0;
|
||||
after: "connecting";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,error"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "clip_exclam";
|
||||
target: "clip_cell";
|
||||
}
|
||||
program {
|
||||
signal: "e,state,default"; source: "e";
|
||||
action: STATE_SET "cell" 0.0;
|
||||
target: "clip_exclam";
|
||||
target: "clip_cell";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,15 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "gadget.h"
|
||||
|
||||
|
||||
EINTERN void
|
||||
gadget_demo(void);
|
||||
|
||||
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Desksanity"};
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
|
||||
EINTERN Eina_List *save_cbs;
|
||||
|
||||
EINTERN Mod *mod = NULL;
|
||||
EINTERN Config *ds_config = NULL;
|
||||
|
||||
|
@ -268,6 +275,8 @@ e_modapi_init(E_Module *m)
|
|||
e_action_predef_name_set(D_("Desksanity"), D_("Manage Window Focus For Me"), "ds_key", NULL, NULL, 0);
|
||||
act->func.go = ds_key;
|
||||
|
||||
gadget_demo();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
@ -296,14 +305,21 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
|||
focus_list = eina_list_free(focus_list);
|
||||
E_FREE_FUNC(ds_key_focus_timeout, ecore_timer_del);
|
||||
E_FREE_LIST(ds_key_focus_desks, e_object_unref);
|
||||
//efx_shutdown(); broken...
|
||||
save_cbs = eina_list_free(save_cbs);
|
||||
efx_shutdown();
|
||||
|
||||
z_gadget_type_del("Start");
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
E_Comp_Cb cb;
|
||||
Eina_List *l;
|
||||
e_config_domain_save("module.desksanity", conf_edd, ds_config);
|
||||
EINA_LIST_FOREACH(save_cbs, l, cb)
|
||||
cb();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -325,6 +341,7 @@ ds_fade_setup(Evas_Object_Event_Cb click_cb)
|
|||
EINTERN void
|
||||
ds_fade_end(Ecore_Cb end_cb, Evas_Object_Event_Cb click_cb)
|
||||
{
|
||||
if (!fade_obj) return;
|
||||
evas_object_pass_events_set(fade_obj, 1);
|
||||
efx_fade(fade_obj, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, (Efx_End_Cb)_ds_fade_end, end_cb);
|
||||
if (click_cb)
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#endif
|
||||
|
||||
#define N_(str) (str)
|
||||
#define _(str) (str)
|
||||
|
||||
#define MOD_CONFIG_FILE_EPOCH 0
|
||||
#define MOD_CONFIG_FILE_GENERATION 1
|
||||
|
@ -82,6 +83,7 @@ typedef struct Config
|
|||
|
||||
extern Mod *mod;
|
||||
extern Config *ds_config;
|
||||
extern Eina_List *save_cbs;
|
||||
|
||||
EINTERN void ds_fade_setup(Evas_Object_Event_Cb click_cb);
|
||||
EINTERN void ds_fade_end(Ecore_Cb cb, Evas_Object_Event_Cb click_cb);
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
AM_CPPFLAGS += \
|
||||
-Isrc/gadgets
|
||||
|
||||
module_la_SOURCES += \
|
||||
src/gadgets/bryce.c \
|
||||
src/gadgets/bryce_config.c \
|
||||
src/gadgets/bryce.h \
|
||||
src/gadgets/core.c \
|
||||
src/gadgets/site_config.c \
|
||||
src/gadgets/demo.c \
|
||||
src/gadgets/gadget.h \
|
||||
src/gadgets/start/start.c \
|
||||
src/gadgets/clock/clock.c \
|
||||
src/gadgets/clock/config.c \
|
||||
src/gadgets/clock/clock.h \
|
||||
src/gadgets/clock/mod.c \
|
||||
src/gadgets/clock/time.c \
|
||||
src/gadgets/ibar/ibar.c \
|
||||
src/gadgets/ibar/ibar.h \
|
||||
src/gadgets/wireless/connman.c \
|
||||
src/gadgets/wireless/mod.c \
|
||||
src/gadgets/wireless/wireless.c \
|
||||
src/gadgets/wireless/wireless.h
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef BRYCE_H
|
||||
# define BRYCE_H
|
||||
|
||||
#include "e.h"
|
||||
|
||||
Z_API void z_bryce_init(void);
|
||||
Z_API void z_bryce_shutdown(void);
|
||||
|
||||
Z_API Evas_Object *z_bryce_add(Evas_Object *parent, const char *name, Z_Gadget_Site_Orient orient, Z_Gadget_Site_Anchor an);
|
||||
Z_API void z_bryce_orient(Evas_Object *bryce, Z_Gadget_Site_Orient orient, Z_Gadget_Site_Anchor an);
|
||||
Z_API Evas_Object *z_bryce_site_get(Evas_Object *bryce);
|
||||
Z_API void z_bryce_autosize_set(Evas_Object *bryce, Eina_Bool set);
|
||||
Z_API void z_bryce_autohide_set(Evas_Object *bryce, Eina_Bool set);
|
||||
Z_API Eina_Bool z_bryce_exists(Evas_Object *parent, Z_Gadget_Site_Orient orient, Z_Gadget_Site_Anchor an);
|
||||
Z_API Eina_List *z_bryce_list(Evas_Object *parent);
|
||||
Z_API void z_bryce_style_set(Evas_Object *bryce, const char *style);
|
||||
Z_API void z_bryce_autosize_set(Evas_Object *bryce, Eina_Bool set);
|
||||
Z_API void z_bryce_autohide_set(Evas_Object *bryce, Eina_Bool set);
|
||||
|
||||
Z_API Evas_Object *z_bryce_editor_add(Evas_Object *parent);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,308 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "gadget.h"
|
||||
#include "bryce.h"
|
||||
|
||||
#define DEFAULT_AUTOSIZE EINA_TRUE
|
||||
#define DEFAULT_AUTOHIDE EINA_FALSE
|
||||
#define DEFAULT_LAYER E_LAYER_CLIENT_EDGE
|
||||
|
||||
typedef struct Bryce_Info
|
||||
{
|
||||
Z_Gadget_Site_Anchor anchor;
|
||||
Z_Gadget_Site_Orient orient;
|
||||
Eina_Stringshare *style;
|
||||
Eina_Bool stack_under;
|
||||
Eina_Bool autohide;
|
||||
Eina_Bool autosize;
|
||||
} Bryce_Info;
|
||||
|
||||
|
||||
static void _editor_add_bottom(void *data, Evas_Object *obj, const char *sig, const char *src);
|
||||
static void _editor_add_top(void *data, Evas_Object *obj, const char *sig, const char *src);
|
||||
static void _editor_add_left(void *data, Evas_Object *obj, const char *sig, const char *src);
|
||||
static void _editor_add_right(void *data, Evas_Object *obj, const char *sig, const char *src);
|
||||
|
||||
static void
|
||||
setup_exists(Evas_Object *editor, Evas_Object *parent, Z_Gadget_Site_Anchor an)
|
||||
{
|
||||
/* FIXME: eliminate existing shelf areas during location step */
|
||||
if (z_bryce_exists(parent, Z_GADGET_SITE_ORIENT_HORIZONTAL, Z_GADGET_SITE_ANCHOR_BOTTOM | an))
|
||||
elm_object_signal_emit(editor, "e,bryce,exists,bottom", "e");
|
||||
if (z_bryce_exists(parent, Z_GADGET_SITE_ORIENT_HORIZONTAL, Z_GADGET_SITE_ANCHOR_TOP | an))
|
||||
elm_object_signal_emit(editor, "e,bryce,exists,top", "e");
|
||||
if (z_bryce_exists(parent, Z_GADGET_SITE_ORIENT_VERTICAL, Z_GADGET_SITE_ANCHOR_LEFT | an))
|
||||
elm_object_signal_emit(editor, "e,bryce,exists,left", "e");
|
||||
if (z_bryce_exists(parent, Z_GADGET_SITE_ORIENT_VERTICAL, Z_GADGET_SITE_ANCHOR_RIGHT | an))
|
||||
elm_object_signal_emit(editor, "e,bryce,exists,right", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_bryce_add(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object *b, *site;
|
||||
char buf[1024];
|
||||
const char *loc;
|
||||
Bryce_Info *bi;
|
||||
Z_Gadget_Site_Gravity gravity = Z_GADGET_SITE_GRAVITY_CENTER;
|
||||
|
||||
bi = evas_object_data_get(obj, "__bryce_info");
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_TOP)
|
||||
loc = "top";
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
loc = "bottom";
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_LEFT)
|
||||
loc = "left";
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_RIGHT)
|
||||
loc = "right";
|
||||
snprintf(buf, sizeof(buf), "demo_%s", loc);
|
||||
if (bi->orient == Z_GADGET_SITE_ORIENT_HORIZONTAL)
|
||||
{
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_LEFT)
|
||||
gravity = Z_GADGET_SITE_GRAVITY_LEFT;
|
||||
else if (bi->anchor & Z_GADGET_SITE_ANCHOR_RIGHT)
|
||||
gravity = Z_GADGET_SITE_GRAVITY_RIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bi->anchor & Z_GADGET_SITE_ANCHOR_TOP)
|
||||
gravity = Z_GADGET_SITE_GRAVITY_TOP;
|
||||
else if (bi->anchor & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
gravity = Z_GADGET_SITE_GRAVITY_BOTTOM;
|
||||
}
|
||||
b = z_bryce_add(e_comp->elm, buf, bi->orient, bi->anchor);
|
||||
site = z_bryce_site_get(b);
|
||||
|
||||
z_gadget_site_gadget_add(site, "Wireless", 0);
|
||||
z_gadget_site_gravity_set(site, gravity);
|
||||
z_bryce_style_set(b, bi->style);
|
||||
z_bryce_autohide_set(b, bi->autohide);
|
||||
z_bryce_autosize_set(b, bi->autosize);
|
||||
evas_object_layer_set(b, bi->stack_under ? E_LAYER_DESKTOP : E_LAYER_CLIENT_EDGE);
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_finish(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
_editor_bryce_add(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_autosize(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Bryce_Info *bi = data;
|
||||
|
||||
bi->autosize = !bi->autosize;
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_autohide(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Bryce_Info *bi = data;
|
||||
|
||||
bi->autohide = !bi->autohide;
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_stacking(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Bryce_Info *bi = data;
|
||||
|
||||
bi->stack_under = !bi->stack_under;
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_style_click(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
const char *g;
|
||||
char style[1024] = {0};
|
||||
Bryce_Info *bi;
|
||||
Evas_Object *ly, *box, *ck, *button;
|
||||
|
||||
ly = elm_object_part_content_get(obj, "e.swallow.content");
|
||||
elm_layout_file_get(ly, NULL, &g);
|
||||
g += (sizeof("z/bryce/") - 1);
|
||||
memcpy(style, g, MIN(sizeof(style) - 1, strchr(g, '/') - g));
|
||||
|
||||
bi = evas_object_data_get(data, "__bryce_info");
|
||||
bi->style = eina_stringshare_add(style);
|
||||
e_theme_edje_object_set(data, NULL, "z/bryce/editor/finish");
|
||||
elm_object_part_text_set(data, "e.text", _("Finishing touches... (4/4)"));
|
||||
box = elm_box_add(data);
|
||||
elm_box_padding_set(box, 0, 20 * e_scale);
|
||||
|
||||
ck = elm_check_add(box);
|
||||
E_ALIGN(ck, 0, 0.5);
|
||||
evas_object_show(ck);
|
||||
elm_object_text_set(ck, _("Automatically size based on contents"));
|
||||
evas_object_smart_callback_add(ck, "changed", _editor_autosize, bi);
|
||||
elm_box_pack_end(box, ck);
|
||||
|
||||
ck = elm_check_add(box);
|
||||
E_ALIGN(ck, 0, 0.5);
|
||||
evas_object_show(ck);
|
||||
elm_object_text_set(ck, _("Automatically hide"));
|
||||
evas_object_smart_callback_add(ck, "changed", _editor_autohide, bi);
|
||||
elm_box_pack_end(box, ck);
|
||||
|
||||
ck = elm_check_add(box);
|
||||
E_ALIGN(ck, 0, 0.5);
|
||||
evas_object_show(ck);
|
||||
elm_object_text_set(ck, _("Do not stack above windows"));
|
||||
evas_object_smart_callback_add(ck, "changed", _editor_stacking, bi);
|
||||
elm_box_pack_end(box, ck);
|
||||
|
||||
//ck = elm_check_add(box);
|
||||
//elm_object_text_set(ck, _("Allow windows to overlap"));
|
||||
//evas_object_smart_callback_add(ck, "changed", _editor_overlap, data);
|
||||
//elm_box_pack_end(box, ck);
|
||||
|
||||
elm_object_part_content_set(data, "e.swallow.content", box);
|
||||
|
||||
button = elm_button_add(data);
|
||||
elm_object_text_set(button, _("Finish!"));
|
||||
evas_object_smart_callback_add(button, "clicked", _editor_finish, data);
|
||||
elm_object_part_content_set(data, "e.swallow.button", button);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_style(Evas_Object *obj)
|
||||
{
|
||||
Eina_List *l;
|
||||
Eina_Stringshare *style;
|
||||
Evas_Object *box;
|
||||
int w;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &w, NULL);
|
||||
box = elm_box_add(obj);
|
||||
e_theme_edje_object_set(obj, NULL, "z/bryce/editor/style");
|
||||
elm_object_part_text_set(obj, "e.text", _("Choose style (3/4)"));
|
||||
elm_box_homogeneous_set(box, 1);
|
||||
elm_box_padding_set(box, 0, 20 * e_scale);
|
||||
l = elm_theme_group_base_list(NULL, "z/bryce/");
|
||||
EINA_LIST_FREE(l, style)
|
||||
{
|
||||
Evas_Object *ly, *bryce;
|
||||
char buf[1024] = {0};
|
||||
size_t len;
|
||||
|
||||
if (!eina_str_has_suffix(style, "/base"))
|
||||
{
|
||||
eina_stringshare_del(style);
|
||||
continue;
|
||||
}
|
||||
ly = elm_layout_add(box);
|
||||
e_theme_edje_object_set(ly, NULL, "z/bryce/editor/style/item");
|
||||
bryce = edje_object_add(evas_object_evas_get(box));
|
||||
elm_object_part_content_set(ly, "e.swallow.content", bryce);
|
||||
len = strlen(style);
|
||||
strncpy(buf, style + sizeof("z/bryce/") - 1,
|
||||
MIN(sizeof(buf) - 1, len - (sizeof("z/bryce/") - 1) - (sizeof("/base") - 1)));
|
||||
buf[0] = toupper(buf[0]);
|
||||
elm_object_part_text_set(ly, "e.text", buf);
|
||||
e_comp_object_util_del_list_append(ly, bryce);
|
||||
e_theme_edje_object_set(bryce, NULL, style);
|
||||
evas_object_size_hint_min_set(bryce, w * 2 / 3, 48 * e_scale);
|
||||
evas_object_show(ly);
|
||||
evas_object_event_callback_add(ly, EVAS_CALLBACK_MOUSE_DOWN, _editor_style_click, obj);
|
||||
elm_box_pack_end(box, ly);
|
||||
}
|
||||
elm_object_part_content_set(obj, "e.swallow.content", box);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_info_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Bryce_Info *bi = data;
|
||||
|
||||
eina_stringshare_del(bi->style);
|
||||
free(bi);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add(Evas_Object *obj, Z_Gadget_Site_Orient orient, Z_Gadget_Site_Anchor an)
|
||||
{
|
||||
char buf[1024];
|
||||
Bryce_Info *bi;
|
||||
|
||||
bi = evas_object_data_get(obj, "__bryce_info");
|
||||
if (bi)
|
||||
{
|
||||
bi->anchor |= an;
|
||||
_editor_style(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
bi = E_NEW(Bryce_Info, 1);
|
||||
bi->anchor = an;
|
||||
bi->orient = orient;
|
||||
evas_object_data_set(obj, "__bryce_info", bi);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _editor_info_del, bi);
|
||||
snprintf(buf, sizeof(buf), "z/bryce/editor/side/%s",
|
||||
orient == Z_GADGET_SITE_ORIENT_HORIZONTAL ? "horizontal" : "vertical");
|
||||
e_theme_edje_object_set(obj, NULL, buf);
|
||||
elm_object_part_text_set(obj, "e.text", _("Choose position (2/4)"));
|
||||
if (an & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
elm_object_signal_emit(obj, "e,state,bottom", "e");
|
||||
else if (an & Z_GADGET_SITE_ANCHOR_RIGHT)
|
||||
elm_object_signal_emit(obj, "e,state,right", "e");
|
||||
setup_exists(obj, evas_object_data_get(obj, "__bryce_editor_site"), an);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add_bottom(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
_editor_add(obj, Z_GADGET_SITE_ORIENT_HORIZONTAL, Z_GADGET_SITE_ANCHOR_BOTTOM);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add_top(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
_editor_add(obj, Z_GADGET_SITE_ORIENT_HORIZONTAL, Z_GADGET_SITE_ANCHOR_TOP);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add_left(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
_editor_add(obj, Z_GADGET_SITE_ORIENT_VERTICAL, Z_GADGET_SITE_ANCHOR_LEFT);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add_center(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
_editor_add(obj, Z_GADGET_SITE_ORIENT_NONE, Z_GADGET_SITE_ANCHOR_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_add_right(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
_editor_add(obj, Z_GADGET_SITE_ORIENT_VERTICAL, Z_GADGET_SITE_ANCHOR_RIGHT);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_dismiss(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
Z_API Evas_Object *
|
||||
z_bryce_editor_add(Evas_Object *parent)
|
||||
{
|
||||
Evas_Object *editor;
|
||||
|
||||
editor = elm_layout_add(parent);
|
||||
evas_object_data_set(editor, "__bryce_editor_site", parent);
|
||||
e_theme_edje_object_set(editor, NULL, "z/bryce/editor/side");
|
||||
elm_object_part_text_set(editor, "e.text", _("Choose screen edge (1/4)"));
|
||||
|
||||
setup_exists(editor, parent, 0);
|
||||
|
||||
elm_object_signal_callback_add(editor, "e,action,dismiss", "e", _editor_dismiss, editor);
|
||||
elm_object_signal_callback_add(editor, "e,bryce,add,bottom", "e", _editor_add_bottom, editor);
|
||||
elm_object_signal_callback_add(editor, "e,bryce,add,top", "e", _editor_add_top, editor);
|
||||
elm_object_signal_callback_add(editor, "e,bryce,add,left", "e", _editor_add_left, editor);
|
||||
elm_object_signal_callback_add(editor, "e,bryce,add,right", "e", _editor_add_right, editor);
|
||||
elm_object_signal_callback_add(editor, "e,bryce,add,center", "e", _editor_add_center, editor);
|
||||
return editor;
|
||||
}
|
|
@ -0,0 +1,383 @@
|
|||
#include "clock.h"
|
||||
|
||||
EINTERN Config *clock_config = NULL;
|
||||
EINTERN Eina_List *clock_instances = NULL;
|
||||
|
||||
static void
|
||||
_clock_calendar_month_update(Instance *inst)
|
||||
{
|
||||
Evas_Object *od, *oi;
|
||||
int x, y;
|
||||
|
||||
oi = elm_layout_edje_get(inst->o_cal);
|
||||
edje_object_part_text_set(oi, "e.text.month", inst->month);
|
||||
edje_object_part_text_set(oi, "e.text.year", inst->year);
|
||||
for (x = 0; x < 7; x++)
|
||||
{
|
||||
od = edje_object_part_table_child_get(oi, "e.table.daynames", x, 0);
|
||||
edje_object_part_text_set(od, "e.text.label", inst->daynames[x]);
|
||||
edje_object_message_signal_process(od);
|
||||
if (inst->dayweekends[x][0])
|
||||
edje_object_signal_emit(od, "e,state,weekend", "e");
|
||||
else
|
||||
edje_object_signal_emit(od, "e,state,weekday", "e");
|
||||
}
|
||||
|
||||
for (y = 0; y < 6; y++)
|
||||
{
|
||||
for (x = 0; x < 7; x++)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
od = edje_object_part_table_child_get(oi, "e.table.days", x, y);
|
||||
snprintf(buf, sizeof(buf), "%i", (int)inst->daynums[x][y]);
|
||||
edje_object_part_text_set(od, "e.text.label", buf);
|
||||
if (inst->dayweekends[x][y])
|
||||
edje_object_signal_emit(od, "e,state,weekend", "e");
|
||||
else
|
||||
edje_object_signal_emit(od, "e,state,weekday", "e");
|
||||
if (inst->dayvalids[x][y])
|
||||
edje_object_signal_emit(od, "e,state,visible", "e");
|
||||
else
|
||||
edje_object_signal_emit(od, "e,state,hidden", "e");
|
||||
if (inst->daytoday[x][y])
|
||||
edje_object_signal_emit(od, "e,state,today", "e");
|
||||
else
|
||||
edje_object_signal_emit(od, "e,state,someday", "e");
|
||||
edje_object_message_signal_process(od);
|
||||
}
|
||||
}
|
||||
edje_object_message_signal_process(oi);
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_month_prev_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
inst->madj--;
|
||||
time_instance_update(inst);
|
||||
_clock_calendar_month_update(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_month_next_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
inst->madj++;
|
||||
time_instance_update(inst);
|
||||
_clock_calendar_month_update(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_settings_cb(void *d1, void *d2 EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = d1;
|
||||
|
||||
z_gadget_configure(inst->o_clock);
|
||||
elm_ctxpopup_dismiss(inst->popup);
|
||||
inst->popup = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
|
||||
{
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_edje_init(Instance *inst, Evas_Object *o)
|
||||
{
|
||||
char todaystr[128];
|
||||
|
||||
time_string_format(inst, todaystr, sizeof(todaystr) - 1);
|
||||
if (inst->cfg->digital_clock)
|
||||
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
||||
"e/modules/clock/digital");
|
||||
else
|
||||
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
||||
"e/modules/clock/main");
|
||||
if (inst->cfg->show_date)
|
||||
elm_layout_signal_emit(o, "e,state,date,on", "e");
|
||||
else
|
||||
elm_layout_signal_emit(o, "e,state,date,off", "e");
|
||||
if (inst->cfg->digital_24h)
|
||||
elm_layout_signal_emit(o, "e,state,24h,on", "e");
|
||||
else
|
||||
elm_layout_signal_emit(o, "e,state,24h,off", "e");
|
||||
if (inst->cfg->show_seconds)
|
||||
elm_layout_signal_emit(o, "e,state,seconds,on", "e");
|
||||
else
|
||||
elm_layout_signal_emit(o, "e,state,seconds,off", "e");
|
||||
|
||||
elm_object_part_text_set(o, "e.text.today", todaystr);
|
||||
edje_object_message_signal_process(elm_layout_edje_get(o));
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_popup_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
if (obj != inst->popup) return;
|
||||
inst->o_table = inst->o_popclock = inst->o_cal = NULL;
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
clock_popup_new(Instance *inst)
|
||||
{
|
||||
Evas *evas;
|
||||
Evas_Object *o, *oi;
|
||||
|
||||
if (inst->popup) return;
|
||||
|
||||
inst->madj = 0;
|
||||
|
||||
time_instance_update(inst);
|
||||
|
||||
inst->popup = elm_ctxpopup_add(inst->o_clock);
|
||||
elm_object_style_set(inst->popup, "noblock");
|
||||
evas_object_smart_callback_add(inst->popup, "dismissed", _clock_popup_dismissed, inst);
|
||||
evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_DEL, _clock_popup_del, inst);
|
||||
evas = e_comp->evas;
|
||||
|
||||
inst->o_table = elm_table_add(inst->popup);
|
||||
|
||||
oi = elm_layout_add(inst->o_table);
|
||||
inst->o_popclock = oi;
|
||||
E_EXPAND(oi);
|
||||
E_FILL(oi);
|
||||
|
||||
_clock_edje_init(inst, oi);
|
||||
|
||||
elm_layout_sizing_eval(oi);
|
||||
elm_table_pack(inst->o_table, oi, 0, 0, 1, 1);
|
||||
evas_object_show(oi);
|
||||
|
||||
o = evas_object_rectangle_add(evas);
|
||||
evas_object_size_hint_min_set(o, 80 * e_scale, 80 * e_scale);
|
||||
elm_table_pack(inst->o_table, o, 0, 0, 1, 1);
|
||||
|
||||
o = e_widget_button_add(evas, _("Settings"), "preferences-system",
|
||||
_clock_settings_cb, inst, NULL);
|
||||
elm_table_pack(inst->o_table, o, 0, 2, 1, 1);
|
||||
evas_object_show(o);
|
||||
|
||||
oi = elm_layout_add(inst->o_table);
|
||||
inst->o_cal = oi;
|
||||
e_theme_edje_object_set(oi, "base/theme/modules/clock",
|
||||
"e/modules/clock/calendar");
|
||||
_clock_calendar_month_update(inst);
|
||||
|
||||
elm_object_signal_callback_add(oi, "e,action,prev", "*",
|
||||
_clock_month_prev_cb, inst);
|
||||
elm_object_signal_callback_add(oi, "e,action,next", "*",
|
||||
_clock_month_next_cb, inst);
|
||||
edje_object_message_signal_process(elm_layout_edje_get(oi));
|
||||
elm_layout_sizing_eval(oi);
|
||||
elm_table_pack(inst->o_table, oi, 0, 1, 1, 1);
|
||||
evas_object_show(oi);
|
||||
|
||||
elm_object_content_set(inst->popup, inst->o_table);
|
||||
z_gadget_util_ctxpopup_place(inst->o_clock, inst->popup);
|
||||
evas_object_show(inst->popup);
|
||||
}
|
||||
|
||||
static void
|
||||
_eval_instance_size(Instance *inst)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
int sw = 0, sh = 0;
|
||||
|
||||
edje_object_size_min_get(elm_layout_edje_get(inst->o_clock), &mw, &mh);
|
||||
|
||||
if ((mw < 1) || (mh < 1))
|
||||
{
|
||||
Evas_Object *owner;
|
||||
|
||||
owner = z_gadget_site_get(inst->o_clock);
|
||||
switch (z_gadget_site_orient_get(owner))
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
evas_object_geometry_get(owner, NULL, NULL, NULL, &sh);
|
||||
break;
|
||||
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
evas_object_geometry_get(owner, NULL, NULL, &sw, NULL);
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
evas_object_resize(inst->o_clock, sw, sh);
|
||||
edje_object_message_signal_process(elm_layout_edje_get(inst->o_clock));
|
||||
|
||||
edje_object_parts_extends_calc(elm_layout_edje_get(inst->o_clock), NULL, NULL, &mw, &mh);
|
||||
}
|
||||
|
||||
if (mw < 4) mw = 4;
|
||||
if (mh < 4) mh = 4;
|
||||
|
||||
if (mw < sw) mw = sw;
|
||||
if (mh < sh) mh = sh;
|
||||
|
||||
evas_object_size_hint_aspect_set(inst->o_clock, EVAS_ASPECT_CONTROL_BOTH, mw, mh);
|
||||
}
|
||||
|
||||
void
|
||||
e_int_clock_instances_redo(Eina_Bool all)
|
||||
{
|
||||
Eina_List *l;
|
||||
Instance *inst;
|
||||
|
||||
EINA_LIST_FOREACH(clock_instances, l, inst)
|
||||
{
|
||||
Evas_Object *o = inst->o_clock;
|
||||
|
||||
if ((!all) && (!inst->cfg->changed)) continue;
|
||||
_clock_edje_init(inst, o);
|
||||
_eval_instance_size(inst);
|
||||
|
||||
if (inst->o_popclock)
|
||||
_clock_edje_init(inst, inst->o_popclock);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_menu_cb_cfg(void *data, E_Menu *menu EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
E_FREE_FUNC(inst->popup, e_object_del);
|
||||
//e_int_config_clock_module(NULL, inst->cfg);
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Instance *inst = data;
|
||||
Evas_Event_Mouse_Down *ev = event;
|
||||
|
||||
if (ev->button == 1)
|
||||
{
|
||||
if (inst->popup)
|
||||
{
|
||||
elm_ctxpopup_dismiss(inst->popup);
|
||||
inst->popup = NULL;
|
||||
}
|
||||
else clock_popup_new(inst);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_sizing_changed_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
_eval_instance_size(data);
|
||||
}
|
||||
|
||||
static void
|
||||
clock_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
clock_instances = eina_list_remove(clock_instances, inst);
|
||||
evas_object_del(inst->popup);
|
||||
time_daynames_clear(inst);
|
||||
free(inst);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buf[4096];
|
||||
|
||||
o = edje_object_add(evas);
|
||||
snprintf(buf, sizeof(buf), "%s/e-module-clock.edj",
|
||||
e_module_dir_get(clock_config->module));
|
||||
edje_object_file_set(o, buf, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static Config_Item *
|
||||
_conf_item_get(int *id)
|
||||
{
|
||||
Config_Item *ci;
|
||||
Eina_List *l;
|
||||
|
||||
if (*id)
|
||||
{
|
||||
EINA_LIST_FOREACH(clock_config->items, l, ci)
|
||||
if (*id == ci->id) return ci;
|
||||
}
|
||||
|
||||
ci = E_NEW(Config_Item, 1);
|
||||
ci->id = clock_config->items ? eina_list_count(clock_config->items) : 1;
|
||||
ci->weekend.start = 6;
|
||||
ci->weekend.len = 2;
|
||||
ci->week.start = 1;
|
||||
ci->digital_clock = 1;
|
||||
ci->digital_24h = 0;
|
||||
ci->show_seconds = 0;
|
||||
ci->show_date = 0;
|
||||
|
||||
clock_config->items = eina_list_append(clock_config->items, ci);
|
||||
e_config_save_queue();
|
||||
|
||||
return ci;
|
||||
}
|
||||
|
||||
static void
|
||||
_clock_gadget_created_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
_eval_instance_size(inst);
|
||||
z_gadget_configure_cb_set(inst->o_clock, config_clock);
|
||||
evas_object_smart_callback_del_full(obj, "gadget_created", _clock_gadget_created_cb, data);
|
||||
}
|
||||
|
||||
EINTERN Evas_Object *
|
||||
clock_create(Evas_Object *parent, int *id, Z_Gadget_Site_Orient orient)
|
||||
{
|
||||
Evas_Object *o;
|
||||
Instance *inst;
|
||||
const char *sig = NULL;
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
inst->cfg = _conf_item_get(id);
|
||||
|
||||
inst->o_clock = o = elm_layout_add(parent);
|
||||
elm_layout_signal_callback_add(o, "e,state,sizing,changed", "*",
|
||||
_clock_sizing_changed_cb, inst);
|
||||
|
||||
_clock_edje_init(inst, o);
|
||||
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
sig = "e,state,horizontal";
|
||||
break;
|
||||
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
sig = "e,state,vertical";
|
||||
break;
|
||||
|
||||
default:
|
||||
sig = "e,state,float";
|
||||
}
|
||||
|
||||
elm_layout_signal_emit(inst->o_clock, sig, "e");
|
||||
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, clock_del, inst);
|
||||
evas_object_smart_callback_add(parent, "gadget_created", _clock_gadget_created_cb, inst);
|
||||
evas_object_data_set(o, "clock", inst);
|
||||
|
||||
evas_object_event_callback_add(inst->o_clock,
|
||||
EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_clock_cb_mouse_down,
|
||||
inst);
|
||||
|
||||
clock_instances = eina_list_append(clock_instances, inst);
|
||||
|
||||
return o;
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
#ifndef CLOCK_H
|
||||
#define CLOCK_H
|
||||
|
||||
#include "e.h"
|
||||
#include "gadget.h"
|
||||
|
||||
#define _(X) (X)
|
||||
#define N_(X) (X)
|
||||
|
||||
E_API extern E_Module_Api e_modapi;
|
||||
|
||||
E_API void *e_modapi_init (E_Module *m);
|
||||
E_API int e_modapi_shutdown (E_Module *m);
|
||||
E_API int e_modapi_save (E_Module *m);
|
||||
|
||||
typedef struct _Config Config;
|
||||
typedef struct _Config_Item Config_Item;
|
||||
typedef struct _Instance Instance;
|
||||
|
||||
struct _Config
|
||||
{
|
||||
Eina_List *items;
|
||||
|
||||
E_Module *module;
|
||||
E_Config_Dialog *config_dialog;
|
||||
};
|
||||
|
||||
struct _Config_Item
|
||||
{
|
||||
int id;
|
||||
struct {
|
||||
int start, len; // 0->6 0 == sun, 6 == sat, number of days
|
||||
} weekend;
|
||||
struct {
|
||||
int start; // 0->6 0 == sun, 6 == sat
|
||||
} week;
|
||||
int digital_clock;
|
||||
int digital_24h;
|
||||
int show_seconds;
|
||||
int show_date;
|
||||
Eina_Bool changed;
|
||||
};
|
||||
|
||||
|
||||
struct _Instance
|
||||
{
|
||||
Evas_Object *o_clock, *o_table, *o_popclock, *o_cal;
|
||||
Evas_Object *popup;
|
||||
|
||||
int madj;
|
||||
|
||||
char year[8];
|
||||
char month[64];
|
||||
const char *daynames[7];
|
||||
unsigned char daynums[7][6];
|
||||
Eina_Bool dayweekends[7][6];
|
||||
Eina_Bool dayvalids[7][6];
|
||||
Eina_Bool daytoday[7][6];
|
||||
Config_Item *cfg;
|
||||
};
|
||||
|
||||
EINTERN Evas_Object *config_clock(Evas_Object *g);
|
||||
void e_int_clock_instances_redo(Eina_Bool all);
|
||||
|
||||
EINTERN void time_daynames_clear(Instance *inst);
|
||||
EINTERN void time_string_format(Instance *inst, char *buf, int bufsz);
|
||||
EINTERN void time_instance_update(Instance *inst);
|
||||
EINTERN void time_init(void);
|
||||
EINTERN void time_shutdown(void);
|
||||
|
||||
EINTERN Evas_Object *clock_create(Evas_Object *parent, int *id, Z_Gadget_Site_Orient orient);
|
||||
EINTERN void clock_popup_new(Instance *inst);
|
||||
|
||||
extern Config *clock_config;
|
||||
extern Eina_List *clock_instances;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,177 @@
|
|||
#include "clock.h"
|
||||
|
||||
struct _E_Config_Dialog_Data
|
||||
{
|
||||
Config_Item cfg;
|
||||
};
|
||||
|
||||
/* Protos */
|
||||
static void *_create_data(E_Config_Dialog *cfd);
|
||||
static void _free_data(E_Config_Dialog *cfd,
|
||||
E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd,
|
||||
Evas *evas,
|
||||
E_Config_Dialog_Data *cfdata);
|
||||
static int _basic_apply_data(E_Config_Dialog *cfd,
|
||||
E_Config_Dialog_Data *cfdata);
|
||||
|
||||
EINTERN Evas_Object *
|
||||
config_clock(Evas_Object *g)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
E_Config_Dialog_View *v;
|
||||
char buf[4096];
|
||||
Instance *inst;
|
||||
|
||||
inst = evas_object_data_get(g, "clock");
|
||||
v = E_NEW(E_Config_Dialog_View, 1);
|
||||
|
||||
v->create_cfdata = _create_data;
|
||||
v->free_cfdata = _free_data;
|
||||
v->basic.apply_cfdata = _basic_apply_data;
|
||||
v->basic.create_widgets = _basic_create_widgets;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/e-module-clock.edj",
|
||||
e_module_dir_get(clock_config->module));
|
||||
cfd = e_config_dialog_new(NULL, _("Clock Settings"),
|
||||
"E", "utils/clock", buf, 0, v, inst->cfg);
|
||||
clock_config->config_dialog = cfd;
|
||||
return cfd->dia->win;
|
||||
}
|
||||
|
||||
static void *
|
||||
_create_data(E_Config_Dialog *cfd EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
Config_Item *ci;
|
||||
|
||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||
ci = cfd->data;
|
||||
|
||||
memcpy(&(cfdata->cfg), ci, sizeof(Config_Item));
|
||||
|
||||
return cfdata;
|
||||
}
|
||||
|
||||
static void
|
||||
_free_data(E_Config_Dialog *cfd EINA_UNUSED,
|
||||
E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
clock_config->config_dialog = NULL;
|
||||
free(cfdata);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED,
|
||||
Evas *evas,
|
||||
E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *ob, *tab, *of;
|
||||
E_Radio_Group *rg;
|
||||
char daynames[7][64];
|
||||
struct tm tm;
|
||||
int i;
|
||||
|
||||
memset(&tm, 0, sizeof(struct tm));
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
tm.tm_wday = i;
|
||||
strftime(daynames[i], sizeof(daynames[i]), "%A", &tm);
|
||||
}
|
||||
|
||||
tab = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
|
||||
of = e_widget_frametable_add(evas, _("Clock"), 0);
|
||||
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.digital_clock));
|
||||
ob = e_widget_radio_add(evas, _("Analog"), 0, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("Digital"), 1, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_check_add(evas, _("Seconds"), &(cfdata->cfg.show_seconds));
|
||||
e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 0, 0);
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.digital_24h));
|
||||
ob = e_widget_radio_add(evas, _("12 h"), 0, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 3, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("24 h"), 1, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 4, 1, 1, 1, 1, 0, 0);
|
||||
|
||||
e_widget_table_object_append(tab, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
|
||||
of = e_widget_frametable_add(evas, _("Date"), 0);
|
||||
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.show_date));
|
||||
ob = e_widget_radio_add(evas, _("None"), 0, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("Full"), 1, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("Numbers"), 2, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("Date Only"), 3, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 3, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, _("ISO 8601"), 4, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, 4, 1, 1, 1, 1, 0, 0);
|
||||
|
||||
e_widget_table_object_append(tab, of, 0, 1, 1, 1, 1, 1, 1, 1);
|
||||
|
||||
of = e_widget_frametable_add(evas, _("Week"), 0);
|
||||
|
||||
ob = e_widget_label_add(evas, _("Start"));
|
||||
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 0, 1, 0, 0);
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.week.start));
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
ob = e_widget_radio_add(evas, daynames[i], i, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, i + 1, 1, 1, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
e_widget_table_object_append(tab, of, 1, 0, 1, 2, 1, 1, 1, 1);
|
||||
|
||||
of = e_widget_frametable_add(evas, _("Weekend"), 0);
|
||||
|
||||
ob = e_widget_label_add(evas, _("Start"));
|
||||
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 0, 1, 0, 0);
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.weekend.start));
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
ob = e_widget_radio_add(evas, daynames[i], i, rg);
|
||||
e_widget_frametable_object_append(of, ob, 0, i + 1, 1, 1, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
ob = e_widget_label_add(evas, _("Days"));
|
||||
e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 0, 1, 0, 0);
|
||||
rg = e_widget_radio_group_new(&(cfdata->cfg.weekend.len));
|
||||
ob = e_widget_radio_add(evas, _("None"), 0, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "1", 1, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "2", 2, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 3, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "3", 3, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 4, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "4", 4, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 5, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "5", 5, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 6, 1, 1, 1, 1, 0, 0);
|
||||
ob = e_widget_radio_add(evas, "6", 6, rg);
|
||||
e_widget_frametable_object_append(of, ob, 1, 7, 1, 1, 1, 1, 0, 0);
|
||||
|
||||
e_widget_table_object_append(tab, of, 2, 0, 1, 2, 1, 1, 1, 1);
|
||||
return tab;
|
||||
}
|
||||
|
||||
static int
|
||||
_basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED,
|
||||
E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Config_Item *ci;
|
||||
|
||||
ci = cfd->data;
|
||||
memcpy(ci, &(cfdata->cfg), sizeof(Config_Item));
|
||||
ci->changed = EINA_TRUE;
|
||||
e_int_clock_instances_redo(EINA_FALSE);
|
||||
ci->changed = EINA_FALSE;
|
||||
e_config_save_queue();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
#include "clock.h"
|
||||
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
static E_Config_DD *conf_item_edd = NULL;
|
||||
static E_Action *act = NULL;
|
||||
|
||||
static void
|
||||
_e_mod_action_cb(E_Object *obj EINA_UNUSED, const char *params, ...)
|
||||
{
|
||||
Eina_List *l;
|
||||
Instance *inst;
|
||||
|
||||
if (!eina_streq(params, "show_calendar")) return;
|
||||
|
||||
EINA_LIST_FOREACH(clock_instances, l, inst)
|
||||
if (inst->popup)
|
||||
{
|
||||
elm_ctxpopup_dismiss(inst->popup);
|
||||
inst->popup = NULL;
|
||||
}
|
||||
else
|
||||
clock_popup_new(inst);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
clock_init(void)
|
||||
{
|
||||
conf_item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Config_Item
|
||||
#define D conf_item_edd
|
||||
E_CONFIG_VAL(D, T, id, UINT);
|
||||
E_CONFIG_VAL(D, T, weekend.start, INT);
|
||||
E_CONFIG_VAL(D, T, weekend.len, INT);
|
||||
E_CONFIG_VAL(D, T, week.start, INT);
|
||||
E_CONFIG_VAL(D, T, digital_clock, INT);
|
||||
E_CONFIG_VAL(D, T, digital_24h, INT);
|
||||
E_CONFIG_VAL(D, T, show_seconds, INT);
|
||||
E_CONFIG_VAL(D, T, show_date, INT);
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Config", Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_LIST(D, T, items, conf_item_edd);
|
||||
|
||||
clock_config = e_config_domain_load("module.clock", conf_edd);
|
||||
|
||||
if (!clock_config)
|
||||
clock_config = E_NEW(Config, 1);
|
||||
|
||||
act = e_action_add("clock");
|
||||
if (act)
|
||||
{
|
||||
act->func.go = (void*)_e_mod_action_cb;
|
||||
act->func.go_key = (void*)_e_mod_action_cb;
|
||||
act->func.go_mouse = (void*)_e_mod_action_cb;
|
||||
act->func.go_edge = (void*)_e_mod_action_cb;
|
||||
|
||||
e_action_predef_name_set(N_("Clock"), N_("Toggle calendar"), "clock", "show_calendar", NULL, 0);
|
||||
}
|
||||
|
||||
z_gadget_type_add("Clock", clock_create);
|
||||
time_init();
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
clock_shutdown(void)
|
||||
{
|
||||
if (act)
|
||||
{
|
||||
e_action_predef_name_del("Clock", "Toggle calendar");
|
||||
e_action_del("clock");
|
||||
act = NULL;
|
||||
}
|
||||
if (clock_config)
|
||||
{
|
||||
Config_Item *ci;
|
||||
|
||||
if (clock_config->config_dialog)
|
||||
e_object_del(E_OBJECT(clock_config->config_dialog));
|
||||
|
||||
EINA_LIST_FREE(clock_config->items, ci)
|
||||
free(ci);
|
||||
|
||||
free(clock_config);
|
||||
clock_config = NULL;
|
||||
}
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
E_CONFIG_DD_FREE(conf_item_edd);
|
||||
conf_item_edd = NULL;
|
||||
conf_edd = NULL;
|
||||
|
||||
z_gadget_type_del("Clock");
|
||||
time_shutdown();
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* module setup */
|
||||
E_API E_Module_Api e_modapi =
|
||||
{
|
||||
E_MODULE_API_VERSION,
|
||||
"Clock"
|
||||
};
|
||||
|
||||
E_API void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
clock_init();
|
||||
|
||||
clock_config->module = m;
|
||||
return m;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
e_config_domain_save("module.clock", conf_edd, clock_config);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,279 @@
|
|||
#include "clock.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
static Eio_Monitor *clock_tz_monitor = NULL;
|
||||
static Eio_Monitor *clock_tz2_monitor = NULL;
|
||||
static Eio_Monitor *clock_tzetc_monitor = NULL;
|
||||
static Eina_List *clock_eio_handlers = NULL;
|
||||
|
||||
static Ecore_Timer *update_today = NULL;
|
||||
|
||||
EINTERN void
|
||||
time_daynames_clear(Instance *inst)
|
||||
{
|
||||
int x;
|
||||
|
||||
for (x = 0; x < 7; x++)
|
||||
eina_stringshare_replace(&inst->daynames[x], NULL);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
time_string_format(Instance *inst, char *buf, int bufsz)
|
||||
{
|
||||
if (!inst->cfg->show_date)
|
||||
{
|
||||
buf[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct timeval timev;
|
||||
struct tm *tm;
|
||||
time_t tt;
|
||||
|
||||
tzset();
|
||||
gettimeofday(&timev, NULL);
|
||||
tt = (time_t)(timev.tv_sec);
|
||||
tm = localtime(&tt);
|
||||
if (tm)
|
||||
{
|
||||
if (inst->cfg->show_date == 1)
|
||||
strftime(buf, bufsz, _("%a, %e %b, %Y"), (const struct tm *)tm);
|
||||
else if (inst->cfg->show_date == 2)
|
||||
strftime(buf, bufsz, _("%a, %x"), (const struct tm *)tm);
|
||||
else if (inst->cfg->show_date == 3)
|
||||
strftime(buf, bufsz, "%x", (const struct tm *)tm);
|
||||
else if (inst->cfg->show_date == 4)
|
||||
strftime(buf, bufsz, "%F", (const struct tm *)tm);
|
||||
}
|
||||
else
|
||||
buf[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EINTERN void
|
||||
time_instance_update(Instance *inst)
|
||||
{
|
||||
struct timeval timev;
|
||||
struct tm *tm, tms, tmm, tm2;
|
||||
time_t tt;
|
||||
int started = 0, num, i;
|
||||
int day;
|
||||
|
||||
tzset();
|
||||
gettimeofday(&timev, NULL);
|
||||
tt = (time_t)(timev.tv_sec);
|
||||
tm = localtime(&tt);
|
||||
|
||||
time_daynames_clear(inst);
|
||||
if (!tm) return;
|
||||
|
||||
// tms == current date time "saved"
|
||||
// tm2 == date to look at adjusting for madj
|
||||
// tm2 == month baseline @ 1st
|
||||
memcpy(&tms, tm, sizeof(struct tm));
|
||||
num = 0;
|
||||
for (day = (0 - 6); day < (31 + 16); day++)
|
||||
{
|
||||
memcpy(&tmm, &tms, sizeof(struct tm));
|
||||
tmm.tm_sec = 0;
|
||||
tmm.tm_min = 0;
|
||||
tmm.tm_hour = 10;
|
||||
tmm.tm_mon += inst->madj;
|
||||
tmm.tm_mday = 1; // start at the 1st of the month
|
||||
tmm.tm_wday = 0; // ignored by mktime
|
||||
tmm.tm_yday = 0; // ignored by mktime
|
||||
tmm.tm_isdst = 0; // ignored by mktime
|
||||
tt = mktime(&tmm);
|
||||
tm = localtime(&tt);
|
||||
memcpy(&tm2, tm, sizeof(struct tm));
|
||||
|
||||
tt = mktime(&tmm);
|
||||
tt += (day * 60 * 60 * 24);
|
||||
tm = localtime(&tt);
|
||||
memcpy(&tmm, tm, sizeof(struct tm));
|
||||
if (!started)
|
||||
{
|
||||
if (tm->tm_wday == inst->cfg->week.start)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
for (i = 0; i < 7; i++, tm->tm_wday = (tm->tm_wday + 1) % 7)
|
||||
{
|
||||
strftime(buf, sizeof(buf), "%a", tm);
|
||||
inst->daynames[i] = eina_stringshare_add(buf);
|
||||
}
|
||||
started = 1;
|
||||
}
|
||||
}
|
||||
if (started)
|
||||
{
|
||||
int y = num / 7;
|
||||
int x = num % 7;
|
||||
|
||||
if (y < 6)
|
||||
{
|
||||
inst->daynums[x][y] = tmm.tm_mday;
|
||||
|
||||
inst->dayvalids[x][y] = 0;
|
||||
if (tmm.tm_mon == tm2.tm_mon) inst->dayvalids[x][y] = 1;
|
||||
|
||||
inst->daytoday[x][y] = 0;
|
||||
if ((tmm.tm_mon == tms.tm_mon) &&
|
||||
(tmm.tm_year == tms.tm_year) &&
|
||||
(tmm.tm_mday == tms.tm_mday))
|
||||
inst->daytoday[x][y] = 1;
|
||||
|
||||
inst->dayweekends[x][y] = 0;
|
||||
for (i = inst->cfg->weekend.start;
|
||||
i < (inst->cfg->weekend.start + inst->cfg->weekend.len);
|
||||
i++)
|
||||
{
|
||||
if (tmm.tm_wday == (i % 7))
|
||||
{
|
||||
inst->dayweekends[x][y] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&tmm, &tms, sizeof(struct tm));
|
||||
tmm.tm_sec = 0;
|
||||
tmm.tm_min = 0;
|
||||
tmm.tm_hour = 10;
|
||||
tmm.tm_mon += inst->madj;
|
||||
tmm.tm_mday = 1; // start at the 1st of the month
|
||||
tmm.tm_wday = 0; // ignored by mktime
|
||||
tmm.tm_yday = 0; // ignored by mktime
|
||||
tmm.tm_isdst = 0; // ignored by mktime
|
||||
tt = mktime(&tmm);
|
||||
tm = localtime(&tt);
|
||||
memcpy(&tm2, tm, sizeof(struct tm));
|
||||
inst->year[sizeof(inst->year) - 1] = 0;
|
||||
strftime(inst->year, sizeof(inst->year) - 1, "%Y", (const struct tm *)&tm2);
|
||||
inst->month[sizeof(inst->month) - 1] = 0;
|
||||
strftime(inst->month, sizeof(inst->month) - 1, "%B", (const struct tm *)&tm2); // %b for short month
|
||||
}
|
||||
|
||||
|
||||
static Eina_Bool
|
||||
_update_today_timer(void *data EINA_UNUSED)
|
||||
{
|
||||
time_t t, t_tomorrow;
|
||||
const struct tm *now;
|
||||
struct tm today;
|
||||
|
||||
t = time(NULL);
|
||||
now = localtime(&t);
|
||||
memcpy(&today, now, sizeof(today));
|
||||
today.tm_sec = 1;
|
||||
today.tm_min = 0;
|
||||
today.tm_hour = 0;
|
||||
|
||||
t_tomorrow = mktime(&today) + 24 * 60 * 60;
|
||||
if (update_today) ecore_timer_interval_set(update_today, t_tomorrow - t);
|
||||
else update_today = ecore_timer_add(t_tomorrow - t, _update_today_timer, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Eina_Bool
|
||||
_clock_eio_update(void *d EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Eio_Monitor_Event *ev = event;
|
||||
|
||||
if ((ev->monitor == clock_tz_monitor) ||
|
||||
(ev->monitor == clock_tz2_monitor) ||
|
||||
(ev->monitor == clock_tzetc_monitor))
|
||||
{
|
||||
if ((ev->filename) &&
|
||||
((!strcmp(ev->filename, "/etc/localtime")) ||
|
||||
(!strcmp(ev->filename, "/etc/timezone"))))
|
||||
{
|
||||
e_int_clock_instances_redo(EINA_TRUE);
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_clock_time_update(void *d EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
e_int_clock_instances_redo(EINA_TRUE);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_clock_eio_error(void *d EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Eio_Monitor_Event *ev = event;
|
||||
|
||||
if ((ev->monitor == clock_tz_monitor) ||
|
||||
(ev->monitor == clock_tz2_monitor) ||
|
||||
(ev->monitor == clock_tzetc_monitor))
|
||||
{
|
||||
if (clock_tz_monitor)
|
||||
{
|
||||
eio_monitor_del(clock_tz_monitor);
|
||||
clock_tz_monitor = NULL;
|
||||
}
|
||||
if (ecore_file_exists("/etc/localtime"))
|
||||
clock_tz_monitor = eio_monitor_add("/etc/localtime");
|
||||
|
||||
if (clock_tz2_monitor)
|
||||
{
|
||||
eio_monitor_del(clock_tz2_monitor);
|
||||
clock_tz2_monitor = NULL;
|
||||
}
|
||||
if (ecore_file_exists("/etc/timezone"))
|
||||
clock_tz2_monitor = eio_monitor_add("/etc/timezone");
|
||||
if (clock_tzetc_monitor)
|
||||
{
|
||||
eio_monitor_del(clock_tzetc_monitor);
|
||||
clock_tzetc_monitor = NULL;
|
||||
}
|
||||
if (ecore_file_is_dir("/etc"))
|
||||
clock_tzetc_monitor = eio_monitor_add("/etc");
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
time_init(void)
|
||||
{
|
||||
if (ecore_file_exists("/etc/localtime"))
|
||||
clock_tz_monitor = eio_monitor_add("/etc/localtime");
|
||||
if (ecore_file_exists("/etc/timezone"))
|
||||
clock_tz2_monitor = eio_monitor_add("/etc/timezone");
|
||||
if (ecore_file_is_dir("/etc"))
|
||||
clock_tzetc_monitor = eio_monitor_add("/etc");
|
||||
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_ERROR, _clock_eio_error, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_CREATED, _clock_eio_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_MODIFIED, _clock_eio_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_DELETED, _clock_eio_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_SELF_DELETED, _clock_eio_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_SELF_RENAME, _clock_eio_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, E_EVENT_SYS_RESUME, _clock_time_update, NULL);
|
||||
E_LIST_HANDLER_APPEND(clock_eio_handlers, ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED, _clock_time_update, NULL);
|
||||
_update_today_timer(NULL);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
time_shutdown(void)
|
||||
{
|
||||
E_FREE_FUNC(update_today, ecore_timer_del);
|
||||
if (clock_tz_monitor) eio_monitor_del(clock_tz_monitor);
|
||||
if (clock_tz2_monitor) eio_monitor_del(clock_tz2_monitor);
|
||||
if (clock_tzetc_monitor) eio_monitor_del(clock_tzetc_monitor);
|
||||
clock_tz_monitor = NULL;
|
||||
clock_tz2_monitor = NULL;
|
||||
clock_tzetc_monitor = NULL;
|
||||
|
||||
}
|
|
@ -0,0 +1,210 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "gadget.h"
|
||||
#include "bryce.h"
|
||||
|
||||
EINTERN Evas_Object *start_create(Evas_Object *parent, int *id EINA_UNUSED, Z_Gadget_Site_Orient orient);;
|
||||
|
||||
EINTERN void clock_init(void);
|
||||
EINTERN void clock_shutdown(void);
|
||||
EINTERN void ibar_init(void);
|
||||
EINTERN void wireless_init(void);
|
||||
|
||||
static Eina_List *handlers;
|
||||
static Evas_Object *rect;
|
||||
static Eina_Bool added = 1;
|
||||
|
||||
static void
|
||||
_gadget_desklock_del(void)
|
||||
{
|
||||
e_desklock_hide();
|
||||
}
|
||||
|
||||
static void
|
||||
_edit_end()
|
||||
{
|
||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_gadget_key_handler(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
|
||||
{
|
||||
if (eina_streq(ev->key, "Escape"))
|
||||
_gadget_desklock_del();
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_mouse_up_handler()
|
||||
{
|
||||
if (!added)
|
||||
_gadget_desklock_del();
|
||||
added = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_added()
|
||||
{
|
||||
added = 1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_gadget_desklock_handler(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Comp_Object *ev)
|
||||
{
|
||||
E_Notification_Notify n;
|
||||
int w, h;
|
||||
const char *name;
|
||||
Evas_Object *site, *editor, *comp_object;
|
||||
|
||||
name = evas_object_name_get(ev->comp_object);
|
||||
if (!name) return ECORE_CALLBACK_RENEW;
|
||||
if (strncmp(name, "desklock", 8)) return ECORE_CALLBACK_RENEW;
|
||||
evas_object_layer_set(ev->comp_object, E_LAYER_POPUP - 1);
|
||||
site = z_gadget_site_auto_add(Z_GADGET_SITE_ORIENT_NONE, name);
|
||||
evas_object_smart_callback_add(site, "gadget_added", _gadget_added, NULL);
|
||||
evas_object_layer_set(site, E_LAYER_POPUP);
|
||||
editor = z_gadget_editor_add(e_comp->elm, site);
|
||||
comp_object = e_comp_object_util_add(editor, E_COMP_OBJECT_TYPE_POPUP);
|
||||
evas_object_resize(comp_object, 300 * e_scale, 300 * e_scale);
|
||||
e_comp_object_util_center(comp_object);
|
||||
evas_object_layer_set(comp_object, E_LAYER_POPUP);
|
||||
evas_object_show(comp_object);
|
||||
evas_object_size_hint_min_get(editor, &w, &h);
|
||||
evas_object_resize(comp_object, 300 * e_scale, h * e_scale);
|
||||
e_comp_object_util_center(comp_object);
|
||||
e_comp_object_util_del_list_append(ev->comp_object, comp_object);
|
||||
e_comp_object_util_del_list_append(ev->comp_object, rect);
|
||||
|
||||
memset(&n, 0, sizeof(E_Notification_Notify));
|
||||
n.timeout = 3000;
|
||||
n.summary = _("Lockscreen Gadgets");
|
||||
n.body = _("Press Escape or click the background to exit.");
|
||||
n.urgency = E_NOTIFICATION_NOTIFY_URGENCY_NORMAL;
|
||||
e_notification_client_send(&n, NULL, NULL);
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_conf()
|
||||
{
|
||||
rect = evas_object_rectangle_add(e_comp->evas);
|
||||
evas_object_event_callback_add(rect, EVAS_CALLBACK_DEL, _edit_end, NULL);
|
||||
evas_object_color_set(rect, 0, 0, 0, 0);
|
||||
evas_object_resize(rect, e_comp->w, e_comp->h);
|
||||
evas_object_layer_set(rect, E_LAYER_POPUP);
|
||||
evas_object_show(rect);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, _gadget_desklock_handler, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _gadget_key_handler, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _gadget_mouse_up_handler, NULL);
|
||||
e_desklock_demo();
|
||||
}
|
||||
|
||||
static void
|
||||
_bryce_edit_end(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
e_bindings_disabled_set(0);
|
||||
evas_object_hide(data);
|
||||
evas_object_del(data);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_bryce_editor_key_down()
|
||||
{
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_bryce_conf()
|
||||
{
|
||||
Evas_Object *editor, *comp_object;
|
||||
E_Zone *zone;
|
||||
int x, y, w, h;
|
||||
|
||||
zone = e_zone_current_get();
|
||||
x = zone->x, y = zone->y, w = zone->w, h = zone->h;
|
||||
e_bindings_disabled_set(1);
|
||||
editor = z_bryce_editor_add(e_comp->elm);
|
||||
|
||||
evas_object_geometry_set(editor, x, y, w, h);
|
||||
comp_object = e_comp_object_util_add(editor, E_COMP_OBJECT_TYPE_NONE);
|
||||
evas_object_event_callback_add(editor, EVAS_CALLBACK_DEL, _bryce_edit_end, comp_object);
|
||||
evas_object_layer_set(comp_object, E_LAYER_POPUP);
|
||||
evas_object_show(comp_object);
|
||||
|
||||
e_comp_object_util_autoclose(comp_object, NULL, _bryce_editor_key_down, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_menu(void *d EINA_UNUSED, E_Menu *m)
|
||||
{
|
||||
E_Menu_Item *mi;
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Lockscreen Gadgets"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-wallpaper");
|
||||
e_menu_item_callback_set(mi, _gadget_conf, NULL);
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Bryces"));
|
||||
//e_util_menu_item_theme_icon_set(mi, "preferences-desktop-wallpaper");
|
||||
e_menu_item_callback_set(mi, _bryce_conf, NULL);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
gadget_demo(void)
|
||||
{
|
||||
Evas_Object *b, *site;
|
||||
|
||||
if (!eina_streq(getenv("USER"), "cedric")) return;
|
||||
|
||||
z_gadget_type_add("Start", start_create);
|
||||
clock_init();
|
||||
ibar_init();
|
||||
wireless_init();
|
||||
z_gadget_init();
|
||||
z_bryce_init();
|
||||
|
||||
if (!e_config->null_container_win)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Config_Binding_Mouse *ebm;
|
||||
|
||||
e_module_disable(e_module_find("connman"));
|
||||
EINA_LIST_FOREACH(e_bindings->mouse_bindings, l, ebm)
|
||||
{
|
||||
if (eina_streq(ebm->action, "window_move"))
|
||||
{
|
||||
e_bindings_mouse_add(E_BINDING_CONTEXT_ANY, ebm->button, ebm->modifiers,
|
||||
ebm->any_mod, "gadget_move", NULL);
|
||||
}
|
||||
else if (eina_streq(ebm->action, "window_resize"))
|
||||
{
|
||||
e_bindings_mouse_add(E_BINDING_CONTEXT_ANY, ebm->button, ebm->modifiers,
|
||||
ebm->any_mod, "gadget_resize", NULL);
|
||||
}
|
||||
else if (eina_streq(ebm->action, "window_menu"))
|
||||
{
|
||||
e_bindings_mouse_add(E_BINDING_CONTEXT_ANY, ebm->button, ebm->modifiers,
|
||||
ebm->any_mod, "gadget_menu", NULL);
|
||||
e_bindings_mouse_add(E_BINDING_CONTEXT_ANY, ebm->button, ebm->modifiers,
|
||||
ebm->any_mod, "bryce_menu", NULL);
|
||||
}
|
||||
}
|
||||
e_bindings_wheel_add(E_BINDING_CONTEXT_ANY, 0, 1, E_BINDING_MODIFIER_CTRL, 0, "bryce_resize", NULL);
|
||||
e_bindings_wheel_add(E_BINDING_CONTEXT_ANY, 0, -1, E_BINDING_MODIFIER_CTRL, 0, "bryce_resize", NULL);
|
||||
e_config->null_container_win = 1;
|
||||
ecore_job_add(_bryce_conf, NULL);
|
||||
e_config_save_queue();
|
||||
}
|
||||
|
||||
//b = z_bryce_add(e_comp->elm, "demo");
|
||||
//site = z_bryce_site_get(b);
|
||||
|
||||
//z_gadget_site_gadget_add(site, "Start", 0);
|
||||
//z_gadget_site_gadget_add(site, "Clock", 0);
|
||||
//z_gadget_site_gadget_add(site, "IBar", 0);
|
||||
//z_bryce_autosize_set(b, 1);
|
||||
//z_bryce_autohide_set(b, 1);
|
||||
|
||||
e_int_menus_menu_augmentation_add_sorted("config/1", "Gadgets 2.0", _gadget_menu, NULL, NULL, NULL);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef Z_GADGET_H
|
||||
# define Z_GADGET_H
|
||||
|
||||
#include "e.h"
|
||||
#define Z_API __attribute__ ((visibility("default")))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Z_GADGET_SITE_GRAVITY_NONE = 0,
|
||||
Z_GADGET_SITE_GRAVITY_LEFT,
|
||||
Z_GADGET_SITE_GRAVITY_RIGHT,
|
||||
Z_GADGET_SITE_GRAVITY_TOP,
|
||||
Z_GADGET_SITE_GRAVITY_BOTTOM,
|
||||
Z_GADGET_SITE_GRAVITY_CENTER,
|
||||
} Z_Gadget_Site_Gravity;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Z_GADGET_SITE_ORIENT_NONE = 0,
|
||||
Z_GADGET_SITE_ORIENT_HORIZONTAL,
|
||||
Z_GADGET_SITE_ORIENT_VERTICAL,
|
||||
} Z_Gadget_Site_Orient;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Z_GADGET_SITE_ANCHOR_NONE = 0,
|
||||
Z_GADGET_SITE_ANCHOR_LEFT = (1 << 0),
|
||||
Z_GADGET_SITE_ANCHOR_RIGHT = (1 << 1),
|
||||
Z_GADGET_SITE_ANCHOR_TOP = (1 << 2),
|
||||
Z_GADGET_SITE_ANCHOR_BOTTOM = (1 << 3),
|
||||
} Z_Gadget_Site_Anchor;
|
||||
|
||||
typedef Evas_Object *(*Z_Gadget_Create_Cb)(Evas_Object *parent, int *id, Z_Gadget_Site_Orient orient);
|
||||
typedef Evas_Object *(*Z_Gadget_Configure_Cb)(Evas_Object *gadget);
|
||||
typedef void (*Z_Gadget_Style_Cb)(Evas_Object *owner, Eina_Stringshare *name, Evas_Object *g);
|
||||
|
||||
Z_API void z_gadget_init(void);
|
||||
Z_API void z_gadget_shutdown(void);
|
||||
|
||||
Z_API Evas_Object *z_gadget_site_add(Z_Gadget_Site_Orient orient, const char *name);
|
||||
Z_API Evas_Object *z_gadget_site_auto_add(Z_Gadget_Site_Orient orient, const char *name);
|
||||
Z_API void z_gadget_site_del(Evas_Object *obj);
|
||||
Z_API Z_Gadget_Site_Anchor z_gadget_site_anchor_get(Evas_Object *obj);
|
||||
Z_API void z_gadget_site_owner_setup(Evas_Object *obj, Z_Gadget_Site_Anchor an, Z_Gadget_Style_Cb cb);
|
||||
Z_API Z_Gadget_Site_Orient z_gadget_site_orient_get(Evas_Object *obj);
|
||||
Z_API Z_Gadget_Site_Gravity z_gadget_site_gravity_get(Evas_Object *obj);
|
||||
Z_API void z_gadget_site_gravity_set(Evas_Object *obj, Z_Gadget_Site_Gravity gravity);
|
||||
Z_API void z_gadget_site_gadget_add(Evas_Object *obj, const char *type, Eina_Bool demo);
|
||||
Z_API Eina_List *z_gadget_site_gadgets_list(Evas_Object *obj);
|
||||
|
||||
|
||||
Z_API void z_gadget_configure_cb_set(Evas_Object *g, Z_Gadget_Configure_Cb cb);
|
||||
Z_API void z_gadget_configure(Evas_Object *g);
|
||||
Z_API Eina_Bool z_gadget_has_wizard(Evas_Object *g);
|
||||
Z_API Evas_Object *z_gadget_site_get(Evas_Object *g);
|
||||
Z_API Eina_Stringshare *z_gadget_type_get(Evas_Object *g);
|
||||
|
||||
Z_API void z_gadget_type_add(const char *type, Z_Gadget_Create_Cb callback);
|
||||
Z_API void z_gadget_type_del(const char *type);
|
||||
Z_API Eina_Iterator *z_gadget_type_iterator_get(void);
|
||||
|
||||
Z_API Evas_Object *z_gadget_util_layout_style_init(Evas_Object *g, Evas_Object *style);
|
||||
Z_API void z_gadget_util_ctxpopup_place(Evas_Object *g, Evas_Object *ctx);
|
||||
Z_API void z_gadget_util_allow_deny_ctxpopup(Evas_Object *g, const char *text, Evas_Smart_Cb allow_cb, Evas_Smart_Cb deny_cb, const void *data);
|
||||
|
||||
Z_API Evas_Object *z_gadget_editor_add(Evas_Object *parent, Evas_Object *site);
|
||||
#endif
|
|
@ -0,0 +1,53 @@
|
|||
#ifndef IBAR_H
|
||||
#define IBAR_H
|
||||
|
||||
#define N_(X) (X)
|
||||
|
||||
typedef struct _Config Config;
|
||||
typedef struct _Config_Item Config_Item;
|
||||
|
||||
struct _Config
|
||||
{
|
||||
/* saved * loaded config values */
|
||||
Eina_List *items;
|
||||
/* just config state */
|
||||
E_Module *module;
|
||||
E_Config_Dialog *config_dialog;
|
||||
Eina_List *instances;
|
||||
Eina_List *handlers;
|
||||
};
|
||||
|
||||
struct _Config_Item
|
||||
{
|
||||
int id;
|
||||
const char *dir;
|
||||
int show_label;
|
||||
int eap_label;
|
||||
int lock_move;
|
||||
int dont_add_nonorder;
|
||||
unsigned char dont_track_launch;
|
||||
unsigned char dont_icon_menu_mouseover;
|
||||
};
|
||||
|
||||
E_API extern E_Module_Api e_modapi;
|
||||
|
||||
E_API void *e_modapi_init (E_Module *m);
|
||||
E_API int e_modapi_shutdown (E_Module *m);
|
||||
E_API int e_modapi_save (E_Module *m);
|
||||
|
||||
void _ibar_config_update(Config_Item *ci);
|
||||
void _config_ibar_module(Config_Item *ci);
|
||||
extern Config *ibar_config;
|
||||
|
||||
/**
|
||||
* @addtogroup Optional_Gadgets
|
||||
* @{
|
||||
*
|
||||
* @defgroup Module_IBar IBar (Icon Launch Bar)
|
||||
*
|
||||
* Launches applications from an icon bar, usually placed on shelves.
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,168 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "gadget.h"
|
||||
|
||||
typedef struct Gadget_Item
|
||||
{
|
||||
Evas_Object *editor;
|
||||
Evas_Object *gadget;
|
||||
Evas_Object *site;
|
||||
} Gadget_Item;
|
||||
|
||||
static Evas_Object *pointer_site;
|
||||
static Eina_List *handlers;
|
||||
|
||||
static void
|
||||
_editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
E_FREE_LIST(data, free);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_pointer_site_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
free(data);
|
||||
pointer_site = NULL;
|
||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_site_hints(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
||||
evas_object_size_hint_min_get(obj, &w, &h);
|
||||
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
|
||||
evas_object_geometry_set(pointer_site, x - (w / 2), y - (h / 2), w, h);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_editor_pointer_button(Gadget_Item *active, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
||||
evas_object_geometry_get(active->site, &x, &y, &w, &h);
|
||||
if ((ev->buttons == 1) && E_INSIDE(ev->x, ev->y, x, y, w, h))
|
||||
evas_object_smart_callback_call(active->site, "gadget_site_dropped", pointer_site);
|
||||
evas_object_pass_events_set(active->site, 0);
|
||||
elm_object_disabled_set(active->editor, 1);
|
||||
e_comp_object_util_del_list_remove(active->editor, pointer_site);
|
||||
E_FREE_FUNC(pointer_site, evas_object_del);
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_editor_pointer_move(Gadget_Item *active EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
evas_object_geometry_get(pointer_site, NULL, NULL, &w, &h);
|
||||
evas_object_move(pointer_site, ev->x - (w / 2), ev->y - (h / 2));
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_gadget_new(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Gadget_Item *active, *gi = data;
|
||||
Evas_Object *site, *rect;
|
||||
Z_Gadget_Site_Orient orient;
|
||||
int size;
|
||||
|
||||
orient = z_gadget_site_orient_get(gi->site);
|
||||
|
||||
pointer_site = site = z_gadget_site_add(orient, NULL);
|
||||
if (orient == Z_GADGET_SITE_ORIENT_HORIZONTAL)
|
||||
evas_object_geometry_get(gi->site, NULL, NULL, NULL, &size);
|
||||
else if (orient == Z_GADGET_SITE_ORIENT_VERTICAL)
|
||||
evas_object_geometry_get(gi->site, NULL, NULL, &size, NULL);
|
||||
else
|
||||
size = 96 * e_scale;
|
||||
evas_object_resize(site, size, size);
|
||||
evas_object_layer_set(site, E_LAYER_MENU);
|
||||
evas_object_pass_events_set(site, 1);
|
||||
evas_object_show(site);
|
||||
active = E_NEW(Gadget_Item, 1);
|
||||
active->editor = gi->editor;
|
||||
active->site = gi->site;
|
||||
e_comp_object_util_del_list_append(gi->editor, pointer_site);
|
||||
evas_object_pass_events_set(active->site, 1);
|
||||
evas_object_event_callback_add(site, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _editor_site_hints, active);
|
||||
evas_object_event_callback_add(site, EVAS_CALLBACK_DEL, _editor_pointer_site_del, active);
|
||||
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE, _editor_pointer_move, active);
|
||||
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, _editor_pointer_button, active);
|
||||
|
||||
rect = evas_object_rectangle_add(e_comp->evas);
|
||||
evas_object_resize(rect, e_comp->w, e_comp->h);
|
||||
evas_object_color_set(rect, 0, 0, 0, 0);
|
||||
evas_object_layer_set(rect, E_LAYER_MENU + 1);
|
||||
e_comp_object_util_del_list_append(pointer_site, rect);
|
||||
evas_object_show(rect);
|
||||
|
||||
z_gadget_site_gadget_add(site, z_gadget_type_get(gi->gadget), 0);
|
||||
elm_object_disabled_set(gi->editor, 1);
|
||||
elm_list_item_selected_set(event_info, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
_editor_gadget_configure(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Z_API Evas_Object *
|
||||
z_gadget_editor_add(Evas_Object *parent, Evas_Object *site)
|
||||
{
|
||||
Evas_Object *list, *tempsite, *g;
|
||||
Eina_Iterator *it;
|
||||
Eina_List *gadgets, *items = NULL;
|
||||
const char *type;
|
||||
|
||||
list = elm_list_add(parent);
|
||||
E_EXPAND(list);
|
||||
E_FILL(list);
|
||||
elm_list_mode_set(list, ELM_LIST_COMPRESS);
|
||||
elm_scroller_content_min_limit(list, 1, 1);
|
||||
tempsite = z_gadget_site_add(Z_GADGET_SITE_ORIENT_HORIZONTAL, NULL);
|
||||
z_gadget_site_gravity_set(tempsite, Z_GADGET_SITE_GRAVITY_NONE);
|
||||
|
||||
it = z_gadget_type_iterator_get();
|
||||
/* FIXME: no types available */
|
||||
EINA_ITERATOR_FOREACH(it, type)
|
||||
z_gadget_site_gadget_add(tempsite, type, 1);
|
||||
eina_iterator_free(it);
|
||||
|
||||
gadgets = z_gadget_site_gadgets_list(tempsite);
|
||||
EINA_LIST_FREE(gadgets, g)
|
||||
{
|
||||
Evas_Object *box, *button = NULL;
|
||||
char buf[1024];
|
||||
Gadget_Item *gi;
|
||||
|
||||
gi = E_NEW(Gadget_Item, 1);
|
||||
gi->editor = list;
|
||||
gi->gadget = g;
|
||||
gi->site = site;
|
||||
items = eina_list_append(items, gi);
|
||||
box = elm_box_add(list);
|
||||
elm_box_horizontal_set(box, 1);
|
||||
E_EXPAND(g);
|
||||
E_FILL(g);
|
||||
elm_box_pack_end(box, g);
|
||||
evas_object_pass_events_set(g, 1);
|
||||
if (z_gadget_has_wizard(g))
|
||||
{
|
||||
button = elm_button_add(list);
|
||||
elm_object_text_set(button, "Configure...");
|
||||
evas_object_smart_callback_add(button, "clicked", _editor_gadget_configure, gi);
|
||||
evas_object_propagate_events_set(button, 0);
|
||||
}
|
||||
strncpy(buf, z_gadget_type_get(g), sizeof(buf) - 1);
|
||||
buf[0] = toupper(buf[0]);
|
||||
elm_list_item_append(list, buf, box, button, _editor_gadget_new, gi);
|
||||
elm_box_recalculate(box);
|
||||
}
|
||||
evas_object_data_set(list, "__gadget_items", items);
|
||||
evas_object_event_callback_add(list, EVAS_CALLBACK_DEL, _editor_del, items);
|
||||
elm_list_go(list);
|
||||
return list;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
#include "e.h"
|
||||
|
||||
/* module setup */
|
||||
E_API E_Module_Api e_modapi =
|
||||
{
|
||||
E_MODULE_API_VERSION,
|
||||
"Start"
|
||||
};
|
||||
|
||||
E_API void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
start_module = m;
|
||||
e_gadcon_provider_register(&_gadcon_class);
|
||||
return m;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
start_module = NULL;
|
||||
e_gadcon_provider_unregister(&_gadcon_class);
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,230 @@
|
|||
/**
|
||||
* @addtogroup Optional_Gadgets
|
||||
* @{
|
||||
*
|
||||
* @defgroup Module_Start Start Button
|
||||
*
|
||||
* Shows a "start here" button or icon.
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "gadget.h"
|
||||
|
||||
/* actual module specifics */
|
||||
typedef struct _Instance Instance;
|
||||
|
||||
struct _Instance
|
||||
{
|
||||
Evas_Object *o_button;
|
||||
E_Menu *main_menu;
|
||||
};
|
||||
|
||||
static void
|
||||
do_orient(Instance *inst, Z_Gadget_Site_Orient orient, Z_Gadget_Site_Anchor anchor)
|
||||
{
|
||||
char buf[4096];
|
||||
const char *s = "float";
|
||||
|
||||
if (anchor & Z_GADGET_SITE_ANCHOR_LEFT)
|
||||
{
|
||||
if (anchor & Z_GADGET_SITE_ANCHOR_TOP)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "top_left";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "left_top";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_NONE:
|
||||
s = "left_top";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (anchor & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "bottom_left";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "left_bottom";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_NONE:
|
||||
s = "left_bottom";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
s = "left";
|
||||
}
|
||||
else if (anchor & Z_GADGET_SITE_ANCHOR_RIGHT)
|
||||
{
|
||||
if (anchor & Z_GADGET_SITE_ANCHOR_TOP)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "top_right";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "right_top";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_NONE:
|
||||
s = "right_top";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (anchor & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "bottom_right";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "right_bottom";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_NONE:
|
||||
s = "right_bottom";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
s = "right";
|
||||
}
|
||||
else if (anchor & Z_GADGET_SITE_ANCHOR_TOP)
|
||||
s = "top";
|
||||
else if (anchor & Z_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
s = "bottom";
|
||||
else
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case Z_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "horizontal";
|
||||
break;
|
||||
case Z_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "vertical";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "e,state,orientation,%s", s);
|
||||
elm_layout_signal_emit(inst->o_button, buf, "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_cb_post(void *data, E_Menu *m)
|
||||
{
|
||||
Instance *inst = data;
|
||||
Eina_Bool fin;
|
||||
|
||||
if (stopping || (!inst->main_menu)) return;
|
||||
fin = m == inst->main_menu;
|
||||
e_object_del(E_OBJECT(m));
|
||||
if (!fin) return;
|
||||
elm_layout_signal_emit(inst->o_button, "e,state,unfocused", "e");
|
||||
inst->main_menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Instance *inst = data;
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
Evas_Coord x, y, w, h;
|
||||
int cx, cy;
|
||||
Evas_Object *win;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
|
||||
evas_object_geometry_get(inst->o_button, &x, &y, &w, &h);
|
||||
win = e_win_evas_object_win_get(inst->o_button);
|
||||
evas_object_geometry_get(win, &cx, &cy, NULL, NULL);
|
||||
x += cx;
|
||||
y += cy;
|
||||
if (!inst->main_menu)
|
||||
inst->main_menu = e_int_menus_main_new();
|
||||
if (!inst->main_menu) return;
|
||||
e_menu_post_deactivate_callback_set(inst->main_menu,
|
||||
_menu_cb_post, inst);
|
||||
e_menu_activate_mouse(inst->main_menu,
|
||||
e_zone_current_get(),
|
||||
x, y, w, h, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
evas_object_smart_callback_call(z_gadget_site_get(inst->o_button),
|
||||
"gadget_popup", inst->main_menu->comp_object);
|
||||
elm_layout_signal_emit(inst->o_button, "e,state,focused", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
start_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
if (inst->main_menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(inst->main_menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(inst->main_menu));
|
||||
}
|
||||
free(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_anchor_change(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
|
||||
do_orient(inst, z_gadget_site_orient_get(obj), z_gadget_site_anchor_get(obj));
|
||||
}
|
||||
|
||||
EINTERN Evas_Object *
|
||||
start_create(Evas_Object *parent, unsigned int *id EINA_UNUSED, Z_Gadget_Site_Orient orient)
|
||||
{
|
||||
Evas_Object *o;
|
||||
Instance *inst;
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
|
||||
o = elm_layout_add(parent);
|
||||
|
||||
e_theme_edje_object_set(o, "base/theme/modules/start",
|
||||
"e/modules/start/main");
|
||||
elm_layout_signal_emit(o, "e,state,unfocused", "e");
|
||||
|
||||
inst->o_button = o;
|
||||
evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_button_cb_mouse_down, inst);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, start_del, inst);
|
||||
evas_object_smart_callback_add(parent, "gadget_anchor", _anchor_change, inst);
|
||||
do_orient(inst, orient, z_gadget_site_anchor_get(parent));
|
||||
|
||||
return o;
|
||||
}
|
||||
#if 0
|
||||
/* module setup */
|
||||
E_API E_Module_Api e_modapi =
|
||||
{
|
||||
E_MODULE_API_VERSION,
|
||||
"Start"
|
||||
};
|
||||
|
||||
E_API void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
z_gadget_type_add("Start", start_create);
|
||||
return m;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
z_gadget_type_del("Start");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#include "e.h"
|
||||
|
||||
EINTERN void wireless_gadget_init(void);
|
||||
EINTERN void wireless_gadget_shutdown(void);
|
||||
|
||||
EINTERN void connman_init(void);
|
||||
EINTERN void connman_shutdown(void);
|
||||
|
||||
EINTERN Eldbus_Connection *dbus_conn;
|
||||
|
||||
EINTERN void
|
||||
wireless_init(void)
|
||||
{
|
||||
dbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
|
||||
connman_init();
|
||||
wireless_gadget_init();
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
wireless_shutdown(void)
|
||||
{
|
||||
wireless_gadget_shutdown();
|
||||
connman_shutdown();
|
||||
E_FREE_FUNC(dbus_conn, eldbus_connection_unref);
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
#ifndef E_WIRELESS_H
|
||||
# define E_WIRELESS_H
|
||||
|
||||
#include "e.h"
|
||||
#include "gadget.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_SERVICE_TYPE_NONE = -1,
|
||||
WIRELESS_SERVICE_TYPE_ETHERNET,
|
||||
WIRELESS_SERVICE_TYPE_WIFI,
|
||||
WIRELESS_SERVICE_TYPE_BLUETOOTH,
|
||||
WIRELESS_SERVICE_TYPE_CELLULAR,
|
||||
WIRELESS_SERVICE_TYPE_LAST,
|
||||
} Wireless_Service_Type;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_NETWORK_STATE_NONE,
|
||||
WIRELESS_NETWORK_STATE_CONFIGURING,
|
||||
WIRELESS_NETWORK_STATE_CONNECTED,
|
||||
WIRELESS_NETWORK_STATE_ONLINE,
|
||||
WIRELESS_NETWORK_STATE_FAILURE,
|
||||
} Wireless_Network_State;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_NETWORK_SECURITY_NONE = 0,
|
||||
WIRELESS_NETWORK_SECURITY_WEP = (1 << 0),
|
||||
WIRELESS_NETWORK_SECURITY_PSK = (1 << 1),
|
||||
WIRELESS_NETWORK_SECURITY_IEEE8021X = (1 << 2),
|
||||
WIRELESS_NETWORK_SECURITY_WPS = (1 << 3),
|
||||
} Wireless_Network_Security;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_NETWORK_IPV4_METHOD_OFF,
|
||||
WIRELESS_NETWORK_IPV4_METHOD_MANUAL,
|
||||
WIRELESS_NETWORK_IPV4_METHOD_DHCP,
|
||||
WIRELESS_NETWORK_IPV4_METHOD_FIXED,
|
||||
} Wireless_Network_IPv4_Method;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_NETWORK_IPV6_METHOD_OFF,
|
||||
WIRELESS_NETWORK_IPV6_METHOD_MANUAL,
|
||||
WIRELESS_NETWORK_IPV6_METHOD_AUTO,
|
||||
WIRELESS_NETWORK_IPV6_METHOD_6TO4,
|
||||
} Wireless_Network_IPv6_Method;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_NETWORK_IPV6_PRIVACY_DISABLED,
|
||||
WIRELESS_NETWORK_IPV6_PRIVACY_ENABLED,
|
||||
WIRELESS_NETWORK_IPV6_PRIVACY_PREFERRED,
|
||||
} Wireless_Network_IPv6_Privacy;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIRELESS_PROXY_TYPE_DIRECT,
|
||||
WIRELESS_PROXY_TYPE_MANUAL,
|
||||
WIRELESS_PROXY_TYPE_AUTO,
|
||||
} Wireless_Proxy_Type;
|
||||
|
||||
typedef struct Wireless_Network Wireless_Network;
|
||||
|
||||
typedef Eina_Bool (*Wireless_Network_Connect_Cb)(Wireless_Network *);
|
||||
|
||||
struct Wireless_Network
|
||||
{
|
||||
Eina_Stringshare *path;//dbus path
|
||||
Eina_Stringshare *name;
|
||||
Wireless_Network_Security security;
|
||||
Wireless_Network_State state;
|
||||
Wireless_Service_Type type;
|
||||
uint8_t strength;
|
||||
|
||||
Wireless_Network_Connect_Cb connect_cb;
|
||||
};
|
||||
|
||||
typedef struct Wireless_Connection
|
||||
{
|
||||
Wireless_Network *wn;
|
||||
unsigned int method;
|
||||
Eina_Stringshare *address;
|
||||
Eina_Stringshare *gateway;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
Eina_Stringshare *netmask;
|
||||
} v4;
|
||||
struct
|
||||
{
|
||||
Eina_Stringshare *prefixlength;
|
||||
Wireless_Network_IPv6_Privacy privacy;
|
||||
} v6;
|
||||
} ip;
|
||||
Wireless_Proxy_Type proxy_type;
|
||||
Eina_Stringshare *proxy_url;
|
||||
Eina_Array *proxy_servers;
|
||||
Eina_Array *proxy_excludes;
|
||||
Eina_Bool ipv6 : 1;
|
||||
} Wireless_Connection;
|
||||
|
||||
typedef void (*Wireless_Auth_Cb)(void *data, const Eina_Array *fields);
|
||||
|
||||
extern Eldbus_Connection *dbus_conn;
|
||||
|
||||
EINTERN void wireless_service_type_available_set(Eina_Bool *avail);
|
||||
EINTERN void wireless_service_type_enabled_set(Eina_Bool *enabled);
|
||||
EINTERN void wireless_wifi_current_networks_set(Wireless_Connection **current);
|
||||
EINTERN Eina_Array *wireless_wifi_networks_set(Eina_Array *networks);
|
||||
EINTERN void wireless_airplane_mode_set(Eina_Bool enabled);
|
||||
EINTERN void wireless_authenticate(const Eina_Array *fields, Wireless_Auth_Cb cb, void *data);
|
||||
EINTERN void wireless_authenticate_cancel(void);
|
||||
EINTERN void wireless_authenticate_external(Wireless_Network *wn, const char *url);
|
||||
#endif
|