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 |
|
@ -21,6 +21,7 @@ config.sub
|
|||
configure
|
||||
configure.ac.orig
|
||||
depcomp
|
||||
e-module-desksanity.edj
|
||||
e_modules-desksanity.spec
|
||||
install-sh
|
||||
libtool
|
||||
|
@ -28,6 +29,7 @@ ltmain.sh
|
|||
*.m4
|
||||
missing
|
||||
mkinstalldirs
|
||||
module.desktop
|
||||
po/Makefile
|
||||
po/Makefile.in
|
||||
po/Makefile.in.in
|
||||
|
@ -49,3 +51,6 @@ src/.libs/
|
|||
src/Makefile
|
||||
src/Makefile.in
|
||||
stamp-h1
|
||||
.deps
|
||||
.libs
|
||||
.dirstamp
|
||||
|
|
|
@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = subdir-objects
|
|||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure compile depcomp install-sh ltmain.sh \
|
||||
missing config.rpath mkinstalldirs
|
||||
missing module.desktop config.rpath mkinstalldirs
|
||||
|
||||
#if HAVE_PO
|
||||
|
||||
|
@ -24,9 +24,13 @@ glow_top.png
|
|||
|
||||
|
||||
include src/Makefile.mk
|
||||
include src/gadgets/Makefile.mk
|
||||
|
||||
e-module-desksanity.edj: e-module-desksanity.edc edc/*edc
|
||||
$(EDJE_CC) -id $(top_srcdir) -id $(top_srcdir)/edc $< $@
|
||||
|
||||
clean-local:
|
||||
rm rf e_modules-desksanity.spec *~
|
||||
rm -rf *.edj module.desktop e_modules-desksanity.spec *~
|
||||
|
||||
uninstall-local:
|
||||
rm -rf $(DESTDIR)$(module_dir)/$(PACKAGE)
|
||||
|
|
63
NEWS
|
@ -1,64 +1,3 @@
|
|||
Release 1.1.0
|
||||
--------------------
|
||||
Highlights:
|
||||
* Convert to Elementary widgets
|
||||
* Greatly improve PiP UX
|
||||
* Tweaks to Zoom effect
|
||||
* Superkey binding for managing window focus
|
||||
|
||||
|
||||
Mike Blumenkrantz (44):
|
||||
e_comp_get() -> e_comp
|
||||
convert zoom to elm widgets
|
||||
remove bad comp usage in pip
|
||||
zsq
|
||||
fix edje warnings
|
||||
more elm conversions
|
||||
bump e version req
|
||||
make pip crop reset if user shift+clicks without moving
|
||||
and null the clip pointer because this module is way too smart to crash
|
||||
disallow pip manage action if no pips exist
|
||||
update to latest api changes
|
||||
more api updates
|
||||
ignore/clean 'compile' file
|
||||
maybe fix zoom animation geometries?
|
||||
show clients before performing desk flip
|
||||
fix zoom key actions
|
||||
add scroller indicator for zoom effect
|
||||
fix zoom focus rect sizing to be even on all sides
|
||||
clip zoom client focus rect to clipper
|
||||
make zoom focus rect more translucent when active
|
||||
don't enable map for zoom client effect
|
||||
make zoom effect more subtle when indicating which window is "active"
|
||||
use color3 for setting OUTLINE color on zoom text
|
||||
redo "active" signalling for zoom effect to be more easily themable
|
||||
improve keyboard navigation for zoom effect
|
||||
use bring_in for zoom keyboard navigation
|
||||
disable maximize effect for x11 csd windows
|
||||
force sizing of zoom effect tables before adding to layout
|
||||
remove pip delete callback during pip free
|
||||
make pip move/resize while clipped more accurate based on clip geometry
|
||||
enable pip edit mode when creating a pip
|
||||
add Super Ultimate Window Management binding under Desksanity actions
|
||||
add multipress functionality for superkey
|
||||
add handling for maintaining sticky windows with superkey
|
||||
move to single makefile build
|
||||
require E20+
|
||||
|
||||
|
||||
Release 1.0.3
|
||||
--------------------
|
||||
|
||||
Mike Blumenkrantz (1):
|
||||
use correct int size for ds effect iterating
|
||||
|
||||
Release 1.0.2
|
||||
--------------------
|
||||
|
||||
Mike Blumenkrantz (1):
|
||||
reorder ds client iterator filter to catch override clients before ec->desk deref
|
||||
|
||||
|
||||
Release 1.0.1
|
||||
--------------------
|
||||
|
||||
|
@ -67,5 +6,3 @@ Mike Blumenkrantz (3):
|
|||
fix input regions on shaded clients after desk flip
|
||||
fix multiscreen zoom and current desks zoom
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
<protocol name="zwp_action_route">
|
||||
<interface name="action_route" version="1">
|
||||
<enum name="mode">
|
||||
<description summary="types of state on the surface">
|
||||
</description>
|
||||
<entry name="focus_shared" value="1" summary="Activatable by any surface if its wl_client has focus">
|
||||
</entry>
|
||||
<entry name="focus_topmost" value="2" summary="Activatable by topmost surface with focus">
|
||||
<description summary="Restricts activation to only the top-most client"/>
|
||||
</entry>
|
||||
<entry name="exclusive" value="3" summary="Activatable by one surface at any time">
|
||||
<description summary="Allows activation for exactly one client at all times"/>
|
||||
</entry>
|
||||
</enum>
|
||||
<enum name="modifiers">
|
||||
<entry name="shift" value="1"></entry>
|
||||
<entry name="control" value="2"></entry>
|
||||
<entry name="alt" value="4"></entry>
|
||||
<entry name="win" value="8"></entry>
|
||||
<entry name="altgr" value="16"></entry>
|
||||
</enum>
|
||||
<request name="bind_action">
|
||||
<description summary="Request a new grab for a key press">
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="action_route_bind"/>
|
||||
<arg name="action" type="string"/>
|
||||
</request>
|
||||
<request name="grab_key">
|
||||
<description summary="Request a new grab for a key press">
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="action_route_key_grab"/>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
<arg name="key" type="string"/>
|
||||
<arg name="mode" type="uint"/>
|
||||
<arg name="modifiers" type="uint"/>
|
||||
<arg name="action" type="string"/>
|
||||
<arg name="params" type="string" allow-null="true"/>
|
||||
</request>
|
||||
</interface>
|
||||
<interface name="action_route_bind" version="1">
|
||||
<enum name="state">
|
||||
<entry name="Rejected" value="0"></entry>
|
||||
<entry name="Active" value="1"></entry>
|
||||
<entry name="Queued" value="2"></entry>
|
||||
</enum>
|
||||
<event name="status">
|
||||
<description summary="Status update on a bind request"></description>
|
||||
<arg name="state" type="uint"/>
|
||||
</event>
|
||||
<request name="activate">
|
||||
<description summary="Activate a bind"/>
|
||||
<arg name="params" type="string" allow-null="true"/>
|
||||
</request>
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="Destroy a requested bind">
|
||||
</description>
|
||||
</request>
|
||||
<event name="end">
|
||||
<description summary="The bind has completed execution"/>
|
||||
</event>
|
||||
</interface>
|
||||
<interface name="action_route_key_grab" version="1">
|
||||
<enum name="state">
|
||||
<entry name="Rejected" value="0"></entry>
|
||||
<entry name="Active" value="1"></entry>
|
||||
<entry name="Queued" value="2"></entry>
|
||||
</enum>
|
||||
<event name="status">
|
||||
<description summary="Status update on a grab request"></description>
|
||||
<arg name="state" type="uint"/>
|
||||
</event>
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="Destroy a requested grab">
|
||||
</description>
|
||||
</request>
|
||||
</interface>
|
||||
</protocol>
|
28
configure.ac
|
@ -1,4 +1,4 @@
|
|||
AC_INIT(desksanity, 1.1.0, zmike@enlightenment.org)
|
||||
AC_INIT(desksanity, 1.0.1, zmike@enlightenment.org)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_PREREQ(2.52)
|
||||
AC_CONFIG_SRCDIR(configure.ac)
|
||||
|
@ -6,7 +6,7 @@ AC_CANONICAL_BUILD
|
|||
AC_CANONICAL_HOST
|
||||
AC_ISC_POSIX
|
||||
|
||||
AM_INIT_AUTOMAKE([1.8 dist-xz])
|
||||
AM_INIT_AUTOMAKE([1.8 dist-bzip2])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
|
@ -30,15 +30,7 @@ AC_PROG_LIBTOOL
|
|||
#])
|
||||
#AC_SUBST(LTLIBINTL)
|
||||
|
||||
PKG_CHECK_EXISTS([efl-wl], [build_runner="yes"], [build_runner="no"])
|
||||
|
||||
if test "x$build_runner" = "xyes" ; then
|
||||
runner="efl-wl"
|
||||
AC_DEFINE_UNQUOTED(HAVE_RUNNER, 1, "have runner deps")
|
||||
fi
|
||||
AM_CONDITIONAL([BUILD_RUNNER], [test "x${build_runner}" = "xyes"])
|
||||
|
||||
PKG_CHECK_MODULES([E], [enlightenment >= 0.21.0 $runner])
|
||||
PKG_CHECK_MODULES([E], [efx enlightenment >= 0.19.99])
|
||||
release=$(pkg-config --variable=release enlightenment)
|
||||
MODULE_ARCH="$host_os-$host_cpu-$release"
|
||||
AC_SUBST(MODULE_ARCH)
|
||||
|
@ -47,9 +39,23 @@ AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
|
|||
module_dir="$(pkg-config --variable=modules enlightenment)"
|
||||
AC_SUBST(module_dir)
|
||||
datadir="$module_dir/desksanity"
|
||||
# Find edje_cc
|
||||
AC_ARG_WITH(edje-cc,
|
||||
AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]),
|
||||
[
|
||||
v=$withval;
|
||||
EDJE_CC=$v
|
||||
],[
|
||||
EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc
|
||||
]
|
||||
)
|
||||
AC_SUBST(EDJE_CC)
|
||||
AC_MSG_CHECKING([Which edje_cc to use])
|
||||
AC_MSG_RESULT(${EDJE_CC})
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
module.desktop
|
||||
e_modules-desksanity.spec
|
||||
], [
|
||||
])
|
||||
|
|
38
e-gadget.xml
|
@ -1,38 +0,0 @@
|
|||
<protocol name="e_gadget">
|
||||
|
||||
<interface name="e_gadget" version="1">
|
||||
<enum name="orient">
|
||||
<entry name="none" value="0"/>
|
||||
<entry name="horizontal" value="1"/>
|
||||
<entry name="vertical" value="2"/>
|
||||
</enum>
|
||||
<enum name="gravity">
|
||||
<entry name="none" value="0"/>
|
||||
<entry name="left" value="1"/>
|
||||
<entry name="right" value="2"/>
|
||||
<entry name="top" value="3"/>
|
||||
<entry name="bottom" value="4"/>
|
||||
<entry name="center" value="5"/>
|
||||
</enum>
|
||||
<enum name="anchor" bitfield="true">
|
||||
<entry name="none" value="0"/>
|
||||
<entry name="left" value="1"/>
|
||||
<entry name="right" value="2"/>
|
||||
<entry name="top" value="4"/>
|
||||
<entry name="bottom" value="8"/>
|
||||
</enum>
|
||||
<event name="gadget_anchor">
|
||||
<arg name="anchor" type="uint" enum="anchor"/>
|
||||
</event>
|
||||
<event name="gadget_orient">
|
||||
<arg name="orient" type="uint" enum="orient"/>
|
||||
</event>
|
||||
<event name="gadget_gravity">
|
||||
<arg name="gravity" type="uint" enum="gravity"/>
|
||||
</event>
|
||||
<request name="open_uri">
|
||||
<arg name="uri" type="string"/>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
</protocol>
|
|
@ -0,0 +1,669 @@
|
|||
collections {
|
||||
group { name: "icon";
|
||||
images.image: "epic-e-256.png" COMP;
|
||||
parts {
|
||||
part { name: "icon"; mouse_events: 0;
|
||||
description { state: "default";
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "epic-e-256.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/modules/desksanity/moveresize";
|
||||
parts {
|
||||
part { name: "outline"; type: TEXT; mouse_events: 0;
|
||||
effect: OUTLINE;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "e.text";
|
||||
rel1.offset: -1 -1;
|
||||
rel2.to: "e.text";
|
||||
color: 0 0 0 255;
|
||||
color2: 0 0 0 255;
|
||||
color3: 0 0 0 255;
|
||||
text { font: "Sans"; size: 16;
|
||||
text_source: "e.text";
|
||||
min: 1 1;
|
||||
ellipsis: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "e.text"; type: TEXT; mouse_events: 0;
|
||||
effect: GLOW;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 51 153 255 255;
|
||||
color2: 51 153 255 24;
|
||||
color3: 51 153 255 18;
|
||||
text { font: "Sans"; size: 16;
|
||||
min: 1 1;
|
||||
ellipsis: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/modules/desksanity/zoom/base"; program_source: "e";
|
||||
parts {
|
||||
rect { "drag_clip"; nomouse;
|
||||
desc { hid; }
|
||||
desc { "vis";
|
||||
link.base: "e,state,dragging";
|
||||
}
|
||||
}
|
||||
rect { "zoomt"; clip: "drag_clip"; nomouse;
|
||||
desc {
|
||||
min: 0 4;
|
||||
max: -1 4;
|
||||
fixed: 1 1;
|
||||
rel2.relative: 1 0;
|
||||
color: 51 153 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "enable"; inherit: "default";
|
||||
color: 51 153 255 200;
|
||||
vis;
|
||||
}
|
||||
desc { "anim"; inherit: "enable";
|
||||
rel1.relative: 0.5 0.5;
|
||||
rel2.relative: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
rect { "zooml"; clip: "drag_clip"; nomouse;
|
||||
desc {
|
||||
min: 4 0;
|
||||
max: 4 -1;
|
||||
fixed: 1 1;
|
||||
rel2.relative: 0 1;
|
||||
color: 51 153 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "enable"; inherit: "default";
|
||||
color: 51 153 255 200;
|
||||
vis;
|
||||
}
|
||||
desc { "anim"; inherit: "enable";
|
||||
rel1.relative: 0.5 0.5;
|
||||
rel2.relative: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
rect { "zoomr"; clip: "drag_clip"; nomouse;
|
||||
desc {
|
||||
min: 4 0;
|
||||
max: 4 -1;
|
||||
fixed: 1 1;
|
||||
rel1.relative: 1 0;
|
||||
color: 51 153 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "enable"; inherit: "default";
|
||||
color: 51 153 255 200;
|
||||
vis;
|
||||
}
|
||||
desc { "anim"; inherit: "enable";
|
||||
rel1.relative: 0.5 0.5;
|
||||
rel2.relative: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
rect { "zoomb"; clip: "drag_clip"; nomouse;
|
||||
desc {
|
||||
min: 0 4;
|
||||
max: -1 4;
|
||||
fixed: 1 1;
|
||||
rel1.relative: 0 1;
|
||||
color: 51 153 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "enable"; inherit: "default";
|
||||
color: 51 153 255 200;
|
||||
vis;
|
||||
}
|
||||
desc { "anim"; inherit: "enable";
|
||||
rel1.relative: 0.5 0.5;
|
||||
rel2.relative: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
program { signal: "e,state,current";
|
||||
after: "drag_start";
|
||||
}
|
||||
program { "drag_start"; filter: "drag_clip" "vis";
|
||||
signal: "mouse,in"; source: "events";
|
||||
action: STATE_SET "enable";
|
||||
transition: LINEAR 0.1;
|
||||
targets: "zoomt" "zooml" "zoomr" "zoomb";
|
||||
after: "drag_anim";
|
||||
}
|
||||
program { filter: "drag_clip" "vis";
|
||||
signal: "mouse,out"; source: "events";
|
||||
action: STATE_SET "default";
|
||||
transition: ACCEL 0.1;
|
||||
targets: "zoomt" "zooml" "zoomr" "zoomb";
|
||||
}
|
||||
program { "drag_anim";
|
||||
action: STATE_SET "anim";
|
||||
transition: ACCEL 0.8;
|
||||
targets: "zoomt" "zooml" "zoomr" "zoomb";
|
||||
after: "drag_anim2";
|
||||
}
|
||||
program { "drag_anim2";
|
||||
action: STATE_SET "default";
|
||||
targets: "zoomt" "zooml" "zoomr" "zoomb";
|
||||
after: "drag_anim";
|
||||
}
|
||||
swallow { "e.swallow.background"; clip: "clip";
|
||||
}
|
||||
rect { "fader";
|
||||
desc {
|
||||
color: 0 0 0 0;
|
||||
link.base: "e,state,dragging";
|
||||
link.transition: LINEAR 0.3;
|
||||
link.base: "e,state,inactive";
|
||||
link.transition: LINEAR 0.3;
|
||||
link.after: "fade_post";
|
||||
}
|
||||
desc { "fade";
|
||||
color: 0 0 0 192;
|
||||
link.base: "e,state,active";
|
||||
link.transition: LINEAR 0.3;
|
||||
}
|
||||
program { "fade_post";
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
rect { "clip";
|
||||
desc { hid; color: 255 255 255 0;
|
||||
link.base: "e,state,dragging";
|
||||
link.transition: LINEAR 0.3;
|
||||
link.base: "e,state,inactive";
|
||||
link.transition: LINEAR 0.3;
|
||||
}
|
||||
desc { "active";
|
||||
link.base: "e,state,active";
|
||||
link.transition: LINEAR 0.3;
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.layout"; clip: "clip"; }
|
||||
program { signal: "e,state,inactive";
|
||||
action: SIGNAL_EMIT "e,state,hiding" "e";
|
||||
}
|
||||
rect { "events"; repeat;
|
||||
desc { color: 0 0 0 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/modules/desksanity/zoom/scrollframe";
|
||||
images.image: "glow_bottom.png" COMP;
|
||||
images.image: "glow_top.png" COMP;
|
||||
script {
|
||||
public visible;
|
||||
public top_visible() {
|
||||
new st[31], Float:vl;
|
||||
get_state(PART:"top_clip", st, 30, vl);
|
||||
if (!strcmp(st, "default")) {
|
||||
run_program(get_program_id("tp_vis"));
|
||||
run_program(get_program_id("tp_glow"));
|
||||
}
|
||||
}
|
||||
public bottom_visible() {
|
||||
new st[31], Float:vl;
|
||||
get_state(PART:"bottom_clip", st, 30, vl);
|
||||
if (!strcmp(st, "default")) {
|
||||
run_program(get_program_id("btm_vis"));
|
||||
run_program(get_program_id("btm_glow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
rect { "elm.dragable.vbar";
|
||||
dragable.x: 0 0 0;
|
||||
dragable.y: 1 1 0;
|
||||
dragable.confine: "elm.swallow.content";
|
||||
desc {
|
||||
max: 0 0;
|
||||
fixed: 1 1;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
rect { "elm.dragable.hbar";
|
||||
dragable.x: 0 0 0;
|
||||
dragable.y: 1 1 0;
|
||||
dragable.confine: "elm.swallow.content";
|
||||
desc {
|
||||
max: 0 0;
|
||||
fixed: 1 1;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
rect { "top_clip";
|
||||
desc {
|
||||
color: 255 255 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "visible";
|
||||
color: 255 255 255 180;
|
||||
vis;
|
||||
}
|
||||
}
|
||||
part { "glow_top"; clip: "top_clip";
|
||||
desc { "default";
|
||||
fixed: 0 1;
|
||||
min: 16 2;
|
||||
image.normal: "glow_top.png";
|
||||
aspect: 330 32;
|
||||
rel2.relative: 1 0;
|
||||
rel2.to_y: "elm.swallow.content";
|
||||
rel1.offset: 0 4;
|
||||
}
|
||||
desc { "glow"; inherit: "default";
|
||||
color: 255 255 255 100;
|
||||
}
|
||||
}
|
||||
program { name: "scr_eval";
|
||||
signal: "drag,set"; source: "elm.dragable.vbar";
|
||||
script {
|
||||
new Float:x, Float:y;
|
||||
|
||||
if (get_int(visible)) {
|
||||
get_drag(PART:"elm.dragable.vbar", x, y);
|
||||
if (y < 1.0)
|
||||
bottom_visible();
|
||||
else
|
||||
run_program(get_program_id("bottom_hidden"));
|
||||
if (y > 0.0)
|
||||
top_visible();
|
||||
else
|
||||
run_program(get_program_id("top_hidden"));
|
||||
}
|
||||
}
|
||||
}
|
||||
program { "tp_vis";
|
||||
action: STATE_SET "visible";
|
||||
target: "top_clip";
|
||||
transition: LINEAR 0.2;
|
||||
}
|
||||
program { "tp_glow";
|
||||
action: STATE_SET "glow";
|
||||
target: "glow_top";
|
||||
transition: SINUSOIDAL 0.7;
|
||||
sequence {
|
||||
action: STATE_SET "default";
|
||||
target: "glow_top";
|
||||
transition: SINUSOIDAL 0.7;
|
||||
after: "tp_glow";
|
||||
}
|
||||
}
|
||||
program { name: "top_hidden";
|
||||
action: STATE_SET "default";
|
||||
targets: "top_clip" "glow_top";
|
||||
transition: LINEAR 0.2 CURRENT;
|
||||
}
|
||||
program { signal: "elm,action,show,vbar"; source: "elm";
|
||||
script {
|
||||
set_int(visible, 1);
|
||||
}
|
||||
after: "scr_eval";
|
||||
}
|
||||
program { signal: "elm,action,hide,vbar"; source: "elm";
|
||||
script {
|
||||
set_int(visible, 0);
|
||||
}
|
||||
sequence {
|
||||
action: STATE_SET "default";
|
||||
targets: "top_clip" "bottom_clip";
|
||||
transition: LINEAR 0.2;
|
||||
}
|
||||
}
|
||||
rect { "bottom_clip";
|
||||
desc {
|
||||
color: 255 255 255 0;
|
||||
hid;
|
||||
}
|
||||
desc { "visible";
|
||||
color: 255 255 255 180;
|
||||
vis;
|
||||
}
|
||||
}
|
||||
part { "glow_bottom"; clip: "bottom_clip";
|
||||
desc {
|
||||
fixed: 0 1;
|
||||
min: 16 2;
|
||||
image.normal: "glow_bottom.png";
|
||||
aspect: 330 32;
|
||||
rel1.relative: 0 1;
|
||||
rel1.to_y: "elm.swallow.content";
|
||||
}
|
||||
desc { "glow"; inherit: "default";
|
||||
color: 255 255 255 100;
|
||||
}
|
||||
}
|
||||
program { "btm_vis";
|
||||
action: STATE_SET "visible";
|
||||
target: "bottom_clip";
|
||||
transition: LINEAR 0.2;
|
||||
}
|
||||
program { "btm_glow";
|
||||
action: STATE_SET "glow";
|
||||
target: "glow_bottom";
|
||||
transition: SINUSOIDAL 0.7;
|
||||
sequence {
|
||||
action: STATE_SET "default";
|
||||
target: "glow_bottom";
|
||||
transition: SINUSOIDAL 0.7;
|
||||
after: "btm_glow";
|
||||
}
|
||||
}
|
||||
program { name: "bottom_hidden";
|
||||
action: STATE_SET "default";
|
||||
targets: "bottom_clip" "glow_bottom";
|
||||
transition: LINEAR 0.2 CURRENT;
|
||||
}
|
||||
rect { "clipper"; nomouse;
|
||||
desc {
|
||||
rel1.to: "elm.swallow.content";
|
||||
rel2.to: "elm.swallow.content";
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.content";
|
||||
clip: "clipper";
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/modules/desksanity/zoom/client"; nomouse;
|
||||
images.image: "win_shadow.png" COMP;
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if (type == MSG_INT_SET) {
|
||||
/* client diff geom[4] */
|
||||
new x, y, w, h;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
|
||||
custom_state(PART:"spacer", "default", 0.0);
|
||||
set_state_val(PART:"spacer", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"spacer", STATE_REL2_OFFSET, w, h);
|
||||
set_state(PART:"spacer", "custom", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
spacer { "spacer";
|
||||
program { signal: "e,action,show"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.3;
|
||||
target: "spacer";
|
||||
//after: "idle";
|
||||
}
|
||||
program { signal: "e,action,hide"; source: "e";
|
||||
action: STATE_SET "custom" 0.0;
|
||||
transition: LINEAR 0.3;
|
||||
target: "spacer";
|
||||
}
|
||||
}
|
||||
part { "shadow"; clip: "clip";
|
||||
desc {
|
||||
image.normal: "win_shadow.png";
|
||||
image.border: 14 14 14 14;
|
||||
image.middle: 0;
|
||||
rel1.to: "e.swallow.client";
|
||||
rel1.offset: -7 -3;
|
||||
rel2.to: "e.swallow.client";
|
||||
rel2.offset: 6 11;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
rect { "outline"; clip: "clip";
|
||||
desc {
|
||||
color: 51 153 255 0;
|
||||
rel1.to: "e.swallow.client";
|
||||
rel1.offset: -2 -2;
|
||||
rel2.to: "e.swallow.client";
|
||||
rel2.offset: 1 1;
|
||||
visible: 0;
|
||||
link.base: "e,state,unfocused" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit: "default";
|
||||
color: 51 153 255 140;
|
||||
visible: 1;
|
||||
link.base: "e,state,focused" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
}
|
||||
rect { "bg";
|
||||
desc {
|
||||
color: 0 0 0 255;
|
||||
rel1.to: "e.swallow.client";
|
||||
rel2.to: "e.swallow.client";
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.client"; clip: "clip";
|
||||
desc {
|
||||
rel1.to: "spacer";
|
||||
rel2.to: "spacer";
|
||||
rel1.offset: 10 10;
|
||||
rel2.offset: -10 -10;
|
||||
link.base: "e,state,inactive" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
//link.after: "idle";
|
||||
}
|
||||
desc { "active";
|
||||
rel1.to: "spacer";
|
||||
rel2.to: "spacer";
|
||||
rel1.relative: -0.01 -0.01;
|
||||
rel2.relative: 1.01 1.01;
|
||||
rel2.offset: -1 -1;
|
||||
link.base: "e,state,active" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "idle1"; inherit: "default";
|
||||
map.on: 1;
|
||||
map.rotation.z: -5;
|
||||
}
|
||||
desc { "idle2"; inherit: "idle1";
|
||||
map.rotation.z: 5;
|
||||
}
|
||||
desc { "idle3"; inherit: "idle1";
|
||||
map.rotation.z: 5;
|
||||
map.rotation.x: -70;
|
||||
}
|
||||
desc { "idle4"; inherit: "idle1";
|
||||
map.rotation.z: 0;
|
||||
map.rotation.x: -360;
|
||||
map.rotation.y: 360;
|
||||
}
|
||||
program { "idle";
|
||||
in: 2.0 10.0;
|
||||
action: STATE_SET "idle1";
|
||||
transition: SINUSOIDAL 6.0;
|
||||
target: "e.swallow.client";
|
||||
sequence {
|
||||
action: STATE_SET "idle2";
|
||||
name: "idle2";
|
||||
transition: SINUSOIDAL 6.0;
|
||||
target: "e.swallow.client";
|
||||
in: 2.0 10.0;
|
||||
|
||||
action: STATE_SET "idle3";
|
||||
name: "idle3";
|
||||
transition: ACCEL 6.0;
|
||||
target: "e.swallow.client";
|
||||
in: 2.0 10.0;
|
||||
|
||||
action: STATE_SET "idle4";
|
||||
name: "idle4";
|
||||
transition: SINUSOIDAL 6.0;
|
||||
target: "e.swallow.client";
|
||||
in: 2.0 10.0;
|
||||
after: "idle";
|
||||
}
|
||||
}
|
||||
}
|
||||
rect { "clip";
|
||||
desc {
|
||||
rel1.offset: -9999 -9999;
|
||||
rel2.offset: 9999 9999;
|
||||
color: 200 200 200 200;
|
||||
link.base: "e,state,inactive" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
desc { "active"; inherit: "default";
|
||||
color: 255 255 255 255;
|
||||
link.base: "e,state,active" "e";
|
||||
link.transition: LINEAR 0.2;
|
||||
}
|
||||
}
|
||||
proxy { "clone";
|
||||
desc {
|
||||
source: "e.swallow.client";
|
||||
rel1.to: "e.swallow.client";
|
||||
rel2.to: "e.swallow.client";
|
||||
hid;
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
desc { "urgent1"; inherit: "default";
|
||||
vis;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
desc { "urgent2"; inherit: "default";
|
||||
vis;
|
||||
rel1.relative: -0.5 -0.5;
|
||||
rel2.relative: 1.5 1.5;
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
program { name: "urgent";
|
||||
signal: "e,state,urgent"; source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "go_big";
|
||||
target: "go_big2";
|
||||
after: "go_big";
|
||||
}
|
||||
program { name: "go_big";
|
||||
action: STATE_SET "urgent1" 0.0;
|
||||
target: "clone";
|
||||
after: "go_big2";
|
||||
}
|
||||
program { name: "go_big2";
|
||||
action: STATE_SET "urgent2" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "clone";
|
||||
after: "go_big";
|
||||
}
|
||||
program { name: "not_urgent";
|
||||
signal: "e,state,not_urgent"; source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "go_big";
|
||||
target: "go_big2";
|
||||
after: "go_hid";
|
||||
}
|
||||
program { name: "go_hid";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "clone";
|
||||
}
|
||||
}
|
||||
text { "e.text.title"; clip: "clip"; effect: OUTLINE;
|
||||
desc {
|
||||
fixed: 1 1;
|
||||
align: 0.0 0.0;
|
||||
rel1.to_x: "e.swallow.icon";
|
||||
rel1.to_y: "e.swallow.client";
|
||||
rel1.relative: 1.0 1.0;
|
||||
rel1.offset: 0 10;
|
||||
rel2.to: "e.swallow.client";
|
||||
color: 255 255 255 255;
|
||||
color3: 0 0 0 255;
|
||||
text {
|
||||
font: "Sans:style=Bold"; size: 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.icon"; clip: "clip";
|
||||
desc {
|
||||
fixed: 1 1;
|
||||
min: 16 16;
|
||||
align: 0.0 0.0;
|
||||
rel1.to_x: "e.swallow.client";
|
||||
rel1.to_y: "e.text.title";
|
||||
rel1.offset: 0 -6;
|
||||
rel2.to: "e.swallow.client";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
}
|
||||
rect { "events"; mouse; repeat;
|
||||
desc { color: 0 0 0 0; };
|
||||
program { signal: "mouse,clicked,1"; source: "events";
|
||||
action: SIGNAL_EMIT "e,action,activate" "e";
|
||||
}
|
||||
program { signal: "mouse,in"; source: "events";
|
||||
sequence {
|
||||
action: ACTION_STOP;
|
||||
targets: "idle" "idle2" "idle3" "idle4";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { "e/modules/desksanity/zoom/client/drag";
|
||||
images.image: "win_shadow.png" COMP;
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if (type == MSG_INT_SET) {
|
||||
/* client diff geom[4] */
|
||||
new x, y, w, h;
|
||||
|
||||
x = getarg(2);
|
||||
y = getarg(3);
|
||||
w = getarg(4);
|
||||
h = getarg(5);
|
||||
|
||||
custom_state(PART:"e.swallow.client", "default", 0.0);
|
||||
set_state_val(PART:"e.swallow.client", STATE_REL1_OFFSET, x, y);
|
||||
set_state_val(PART:"e.swallow.client", STATE_REL2_OFFSET, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
rect { "clip";
|
||||
desc {}
|
||||
desc { "hid"; hid;
|
||||
color: 255 255 255 0;
|
||||
link.base: "e,drag,release" "e";
|
||||
link.transition: LINEAR 0.1;
|
||||
}
|
||||
}
|
||||
image { "shadow"; clip: "clip";
|
||||
desc {
|
||||
image.normal: "win_shadow.png";
|
||||
image.border: 14 14 14 14;
|
||||
image.middle: 0;
|
||||
rel1.to: "e.swallow.client";
|
||||
rel1.offset: -7 -3;
|
||||
rel2.to: "e.swallow.client";
|
||||
rel2.offset: 6 11;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
swallow { "e.swallow.client"; }
|
||||
rect { "over"; clip: "clip";
|
||||
desc {
|
||||
rel1.to: "e.swallow.client";
|
||||
rel2.to: "e.swallow.client";
|
||||
color: 255 255 255 90;
|
||||
}
|
||||
}
|
||||
program { signal: "e,drag,release"; source: "e";
|
||||
action: STATE_SET "custom";
|
||||
target: "e.swallow.client";
|
||||
transition: LINEAR 0.1;
|
||||
sequence {
|
||||
action: SIGNAL_EMIT "e,action,done" "e";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#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";
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.9 KiB |
182
loader/start.c
|
@ -1,182 +0,0 @@
|
|||
#include <Elementary.h>
|
||||
#include <e_gadget_types.h>
|
||||
|
||||
static E_Gadget_Site_Orient gorient;
|
||||
static E_Gadget_Site_Anchor ganchor;
|
||||
static char *menu_action;
|
||||
|
||||
static void
|
||||
do_orient(Evas_Object *ly, E_Gadget_Site_Orient orient, E_Gadget_Site_Anchor anchor)
|
||||
{
|
||||
char buf[4096];
|
||||
const char *s = "float";
|
||||
|
||||
if (anchor & E_GADGET_SITE_ANCHOR_LEFT)
|
||||
{
|
||||
if (anchor & E_GADGET_SITE_ANCHOR_TOP)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "top_left";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "left_top";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_NONE:
|
||||
s = "left_top";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "bottom_left";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "left_bottom";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_NONE:
|
||||
s = "left_bottom";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
s = "left";
|
||||
}
|
||||
else if (anchor & E_GADGET_SITE_ANCHOR_RIGHT)
|
||||
{
|
||||
if (anchor & E_GADGET_SITE_ANCHOR_TOP)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "top_right";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "right_top";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_NONE:
|
||||
s = "right_top";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "bottom_right";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "right_bottom";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_NONE:
|
||||
s = "right_bottom";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
s = "right";
|
||||
}
|
||||
else if (anchor & E_GADGET_SITE_ANCHOR_TOP)
|
||||
s = "top";
|
||||
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
|
||||
s = "bottom";
|
||||
else
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||
s = "horizontal";
|
||||
break;
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
s = "vertical";
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "e,state,orientation,%s", s);
|
||||
elm_layout_signal_emit(ly, buf, "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_cb_post(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
if (eina_streq(event_info, menu_action))
|
||||
elm_layout_signal_emit(data, "e,state,unfocused", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_button_cb_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
if (!menu_action) return;
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
evas_object_smart_callback_call(elm_win_get(obj), menu_action, "main");
|
||||
elm_layout_signal_emit(obj, "e,state,focused", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
anchor_change(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
ganchor = (uintptr_t)event_info;
|
||||
do_orient(data, gorient, ganchor);
|
||||
}
|
||||
|
||||
static void
|
||||
orient_change(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
gorient = (uintptr_t)event_info;
|
||||
do_orient(data, gorient, ganchor);
|
||||
}
|
||||
|
||||
static void
|
||||
action_deleted(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
if (eina_streq(menu_action, event_info))
|
||||
{
|
||||
free(menu_action);
|
||||
menu_action = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
action_return(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
fprintf(stderr, "AR RETURN: %s\n", (char*)event_info);
|
||||
menu_action = eina_strdup(event_info);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
Evas_Object *win, *ly;
|
||||
|
||||
elm_init(argc, (char**)argv);
|
||||
win = elm_win_add(NULL, "start", ELM_WIN_BASIC);
|
||||
elm_win_autodel_set(win, 1);
|
||||
elm_win_alpha_set(win, 1);
|
||||
ly = elm_layout_add(win);
|
||||
evas_object_size_hint_min_set(win, 100, 100);
|
||||
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
elm_layout_file_set(ly,
|
||||
elm_theme_group_path_find(NULL, "e/gadget/start/main"), "e/gadget/start/main");
|
||||
elm_win_resize_object_add(win, ly);
|
||||
evas_object_show(ly);
|
||||
evas_object_smart_callback_add(win, "gadget_site_anchor", anchor_change, ly);
|
||||
evas_object_smart_callback_add(win, "gadget_site_orient", orient_change, ly);
|
||||
evas_object_smart_callback_add(win, "gadget_action", action_return, NULL);
|
||||
evas_object_smart_callback_add(win, "gadget_action_end", _menu_cb_post, ly);
|
||||
evas_object_smart_callback_add(win, "gadget_action_deleted", action_deleted, NULL);
|
||||
evas_object_event_callback_add(ly, EVAS_CALLBACK_MOUSE_DOWN, _button_cb_mouse_down, NULL);
|
||||
evas_object_smart_callback_call(win, "gadget_action_request", "menu_show_object");
|
||||
evas_object_show(win);
|
||||
ecore_main_loop_begin();
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Start
|
||||
Exec=@GADGET_DIR@/start/e_gadget_start
|
||||
Icon=e/gadget/start/main
|
121
loader/test.c
|
@ -1,121 +0,0 @@
|
|||
#include <Elementary.h>
|
||||
|
||||
static Evas_Object *popup;
|
||||
static Evas_Object *child;
|
||||
|
||||
static void
|
||||
popup_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
popup = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
child_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
child = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
popup_unfocus(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
mouse_button(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *ic;
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
char buf[PATH_MAX];
|
||||
int w, h;
|
||||
Evas_Object *win;
|
||||
Elm_Win_Type type = ELM_WIN_POPUP_MENU;
|
||||
|
||||
if ((ev->button != 1) && (ev->button != 3)) return;
|
||||
if (ev->button == 3)
|
||||
{
|
||||
type = ELM_WIN_BASIC;
|
||||
if (child)
|
||||
{
|
||||
evas_object_del(child);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (popup)
|
||||
{
|
||||
evas_object_del(popup);
|
||||
return;
|
||||
}
|
||||
}
|
||||
win = elm_win_add(elm_win_get(obj), "win", type);
|
||||
elm_win_alpha_set(win, 1);
|
||||
if (ev->button == 3)
|
||||
{
|
||||
child = win;
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, child_del, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
popup = win;
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, popup_del, NULL);
|
||||
}
|
||||
if (ev->button == 3)
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_FOCUS_OUT, popup_unfocus, NULL);
|
||||
ic = elm_icon_add(win);
|
||||
snprintf(buf, sizeof(buf), "%s/images/bubble.png", elm_app_data_dir_get());
|
||||
elm_image_file_set(ic, buf, NULL);
|
||||
elm_image_object_size_get(ic, &w, &h);
|
||||
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, w, h);
|
||||
if (ev->button == 1)
|
||||
{
|
||||
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
|
||||
elm_image_no_scale_set(ic, EINA_TRUE);
|
||||
}
|
||||
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_fill_set(ic, 0.5, 0.5);
|
||||
evas_object_size_hint_min_set(ic, 100, 100);
|
||||
elm_win_resize_object_add(win, ic);
|
||||
evas_object_show(ic);
|
||||
evas_object_show(win);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
Evas_Object *win, *ic;
|
||||
char buf[PATH_MAX];
|
||||
int w, h;
|
||||
|
||||
elm_init(argc, (char**)argv);
|
||||
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||
elm_app_info_set(main, "elementary", "images/logo.png");
|
||||
win = elm_win_add(NULL, "icon-transparent", ELM_WIN_BASIC);
|
||||
elm_win_title_set(win, "Icon Transparent");
|
||||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
elm_win_alpha_set(win, EINA_TRUE);
|
||||
|
||||
ic = elm_icon_add(win);
|
||||
elm_object_tooltip_text_set(ic, "this is some test text which is probably going to be a lot longer than the overall icon size haHAA");
|
||||
elm_object_tooltip_window_mode_set(ic, 1);
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
|
||||
elm_image_file_set(ic, buf, NULL);
|
||||
elm_image_object_size_get(ic, &w, &h);
|
||||
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, w, h);
|
||||
if (argc > 1)
|
||||
{
|
||||
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
|
||||
elm_image_no_scale_set(ic, EINA_TRUE);
|
||||
}
|
||||
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_fill_set(ic, 0.5, 0.5);
|
||||
evas_object_size_hint_min_set(ic, 100, 100);
|
||||
elm_win_resize_object_add(win, ic);
|
||||
evas_object_show(ic);
|
||||
evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_DOWN, mouse_button, NULL);
|
||||
|
||||
evas_object_show(win);
|
||||
ecore_main_loop_begin();
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Test
|
||||
Exec=@GADGET_DIR@/test/e_gadget_test
|
182
meson.build
|
@ -1,182 +0,0 @@
|
|||
project('desksanity', 'c',
|
||||
version: '1.1.99',
|
||||
license: 'BSD 2 clause',
|
||||
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
|
||||
meson_version: '>= 0.40.0')
|
||||
|
||||
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
||||
dir_prefix = get_option('prefix')
|
||||
dir_bin = join_paths(dir_prefix, get_option('bindir'))
|
||||
dir_sysconf = get_option('sysconfdir')
|
||||
dir_data = join_paths(dir_prefix, get_option('datadir'))
|
||||
dir_include = join_paths(dir_prefix, get_option('includedir'))
|
||||
dir_include_e = join_paths(dir_include, meson.project_name())
|
||||
dir_lib = join_paths(dir_prefix, get_option('libdir'))
|
||||
|
||||
|
||||
pkgconfig = import('pkgconfig')
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
# disable for release builds
|
||||
dev_cflags = []
|
||||
dev_cflags_try = [
|
||||
'-Wall',
|
||||
'-W',
|
||||
'-Wpointer-arith',
|
||||
'-Wshadow',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wfloat-equal',
|
||||
'-Wuninitialized',
|
||||
'-Wundef',
|
||||
'-Wcast-align',
|
||||
'-Wformat=2',
|
||||
'-Wno-format-y2k',
|
||||
]
|
||||
|
||||
foreach cf: dev_cflags_try
|
||||
if cc.has_argument(cf) == true
|
||||
dev_cflags += cf
|
||||
endif
|
||||
endforeach
|
||||
add_global_arguments(dev_cflags, language: 'c')
|
||||
|
||||
dep_e = dependency('enlightenment')
|
||||
release = dep_e.get_pkgconfig_variable('release')
|
||||
host_os = host_machine.system()
|
||||
if host_os == 'linux'
|
||||
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
||||
host_os = 'linux-uclibc'
|
||||
elif cc.has_header_symbol('features.h', '__dietlibc__')
|
||||
host_os = 'linux-dietlibc'
|
||||
else
|
||||
host_os = 'linux-gnu'
|
||||
endif
|
||||
endif
|
||||
|
||||
module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
|
||||
|
||||
config_h = configuration_data()
|
||||
config_h.set('_GNU_SOURCE', '1')
|
||||
config_h.set('_ALL_SOURCE', '1')
|
||||
config_h.set('_POSIX_PTHREAD_SEMANTICS', '1')
|
||||
config_h.set('_TANDEM_SOURCE', '1')
|
||||
config_h.set('__EXTENSIONS__', '1')
|
||||
|
||||
config_h.set_quoted('MODULE_ARCH', module_arch)
|
||||
config_h.set_quoted('PACKAGE', meson.project_name())
|
||||
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
config_h.set_quoted('VERSION', meson.project_version())
|
||||
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
|
||||
config_h.set_quoted('BINDIR', dir_bin)
|
||||
config_h.set_quoted('DATADIR', dir_data)
|
||||
|
||||
if cc.has_function('setenv') == true
|
||||
config_h.set('HAVE_SETENV', '1')
|
||||
endif
|
||||
if cc.has_function('unsetenv') == true
|
||||
config_h.set('HAVE_UNSETENV', '1')
|
||||
endif
|
||||
if cc.has_function('clearenv') == true
|
||||
config_h.set('HAVE_CLEARENV', '1')
|
||||
endif
|
||||
if cc.has_header('features.h') == true
|
||||
config_h.set('HAVE_FEATURES_H', '1')
|
||||
endif
|
||||
if cc.has_header('sys/ptrace.h') == true
|
||||
config_h.set('HAVE_SYS_PTRACE_H', '1')
|
||||
endif
|
||||
if cc.has_header('arpa/inet.h') == true
|
||||
config_h.set('HAVE_ARPA_INET_H', '1')
|
||||
endif
|
||||
if cc.has_header('netinet/in.h') == true
|
||||
config_h.set('HAVE_NETINET_IN_H', '1')
|
||||
endif
|
||||
if cc.has_header('execinfo.h') == true
|
||||
config_h.set('HAVE_EXECINFO_H', '1')
|
||||
elif cc.has_function('backtrace_symbols_fd', dependencies: 'execinfo') == false
|
||||
execinfo_dep = dependency('execinfo', required: false)
|
||||
endif
|
||||
|
||||
if cc.has_header('fnmatch.h') == false
|
||||
error('fnmatch.h not found')
|
||||
endif
|
||||
|
||||
if cc.has_function('fnmatch') == false
|
||||
dep_fnmatch = dependency('fnmatch', required: true)
|
||||
endif
|
||||
|
||||
add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c')
|
||||
add_global_arguments('-DPACKAGE_LIB_DIR="@0@"'.format(dir_lib), language: 'c')
|
||||
add_global_arguments('-DPACKAGE_DATA_DIR="@0@"'.format(join_paths(dir_data, meson.project_name())), language: 'c')
|
||||
add_global_arguments('-DPACKAGE_SYSCONF_DIR="@0@"'.format(dir_sysconf), language: 'c')
|
||||
|
||||
dep_efl_wl = dependency('efl-wl', required: false)
|
||||
|
||||
dir_module_e = join_paths([dep_e.get_pkgconfig_variable('modules'), 'desksanity'])
|
||||
edje_cc = find_program('edje_cc')
|
||||
|
||||
install_data(['e-module-desksanity.edj', 'module.desktop'],
|
||||
install_dir: dir_module_e,
|
||||
install_mode: 'rw-rw-r--')
|
||||
|
||||
build_files = [
|
||||
'src/e_mod_main.h',
|
||||
'src/e_mod_main.c',
|
||||
'src/ds_config.c',
|
||||
'src/maximize.c',
|
||||
'src/moveresize.c',
|
||||
'src/pip.c',
|
||||
'src/zoom.c',
|
||||
'src/magnify.c',
|
||||
'src/desksanity.c'
|
||||
]
|
||||
|
||||
if dep_efl_wl.found() == true and dep_e.get_pkgconfig_variable('wayland') == 'true'
|
||||
config_h.set('HAVE_RUNNER', '1')
|
||||
|
||||
dir_gadgets = join_paths([dir_lib, 'enlightenment/gadgets', module_arch])
|
||||
executable('e_gadget_start',
|
||||
'loader/start.c',
|
||||
c_args: '-fPIE',
|
||||
link_args: '-fPIE',
|
||||
dependencies: [dependency('elementary'), dependency('enlightenment')],
|
||||
install_dir: join_paths([dir_gadgets, 'start']),
|
||||
install: true)
|
||||
|
||||
executable('e_gadget_test',
|
||||
'loader/test.c',
|
||||
c_args: '-fPIE',
|
||||
link_args: '-fPIE',
|
||||
dependencies: dependency('elementary'),
|
||||
install_dir: join_paths([dir_gadgets, 'test']),
|
||||
install: true)
|
||||
|
||||
config_h.set_quoted('GADGET_DIR', dir_gadgets)
|
||||
desktop_data = configuration_data()
|
||||
desktop_data.set('GADGET_DIR', dir_gadgets)
|
||||
configure_file(input: 'loader/test.desktop.in',
|
||||
output: 'test.desktop',
|
||||
install: true,
|
||||
install_dir: join_paths([dir_gadgets, 'test']),
|
||||
configuration: desktop_data)
|
||||
configure_file(input: 'loader/start.desktop.in',
|
||||
output: 'start.desktop',
|
||||
install: true,
|
||||
install_dir: join_paths([dir_gadgets, 'start']),
|
||||
configuration: desktop_data)
|
||||
endif
|
||||
|
||||
|
||||
configure_file(output: 'config.h',
|
||||
install: false,
|
||||
configuration: config_h)
|
||||
|
||||
shared_module('desksanity', build_files,
|
||||
include_directories: include_directories(['src']),
|
||||
name_prefix: '',
|
||||
dependencies: [dep_e, dep_efl_wl],
|
||||
install_dir: join_paths([dir_module_e, module_arch]),
|
||||
install: true)
|
||||
|
||||
|
||||
meson.add_install_script('meson_modules.sh', join_paths([dir_module_e, module_arch, 'desksanity.so']))
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
for x in "$@" ; do
|
||||
dir="$(dirname $x)"
|
||||
mv "$DESTDIR"/"$x" "$DESTDIR"/"$dir"/module.so
|
||||
done
|
|
@ -8,7 +8,7 @@ static Evas_Object *dm_hide = NULL;
|
|||
static DS_Type cur_type = DS_PAN;
|
||||
|
||||
static void
|
||||
_ds_end(void *data EINA_UNUSED, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
_ds_end(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
{
|
||||
/* hide/delete previous desk's mirror */
|
||||
evas_object_hide(dm_hide);
|
||||
|
@ -48,12 +48,12 @@ dm_add(E_Desk *desk)
|
|||
}
|
||||
|
||||
static void
|
||||
_ds_blink2(void *data EINA_UNUSED, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
_ds_blink2(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
{
|
||||
E_FREE_FUNC(dm_hide, evas_object_del);
|
||||
evas_object_show(dm_show);
|
||||
e_efx_resize(obj, E_EFX_EFFECT_SPEED_DECELERATE,
|
||||
E_EFX_POINT(desk_show->zone->x, desk_show->zone->y),
|
||||
efx_resize(obj, EFX_EFFECT_SPEED_DECELERATE,
|
||||
EFX_POINT(desk_show->zone->x, desk_show->zone->y),
|
||||
desk_show->zone->w, desk_show->zone->h,
|
||||
0.45, _ds_end, NULL);
|
||||
}
|
||||
|
@ -153,30 +153,30 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
}
|
||||
dm_show = dm_add(desk);
|
||||
evas_object_move(dm_show, x, y);
|
||||
e_efx_move(dm_hide, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_POINT(hx, hy), 0.2, NULL, NULL);
|
||||
e_efx_move(dm_show, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_POINT(desk->zone->x, desk->zone->y), 0.2, _ds_end, NULL);
|
||||
efx_move(dm_hide, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(hx, hy), 0.2, NULL, NULL);
|
||||
efx_move(dm_show, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(desk->zone->x, desk->zone->y), 0.2, _ds_end, NULL);
|
||||
break;
|
||||
case DS_FADE_OUT:
|
||||
e_efx_fade(dm_hide, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(0, 0, 0), 0, 0.25, _ds_end, NULL);
|
||||
efx_fade(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.25, _ds_end, NULL);
|
||||
break;
|
||||
case DS_FADE_IN:
|
||||
E_FREE_FUNC(dm_hide, evas_object_del);
|
||||
dm_show = dm_add(desk);
|
||||
e_efx_fade(dm_show, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
e_efx_fade(dm_show, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(255, 255, 255), 255, 0.25, _ds_end, NULL);
|
||||
efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 255, 255), 255, 0.25, _ds_end, NULL);
|
||||
break;
|
||||
case DS_BATMAN:
|
||||
evas_object_raise(dm_hide);
|
||||
e_efx_spin_start(dm_hide, 1080.0, NULL);
|
||||
e_efx_zoom(dm_hide, E_EFX_EFFECT_SPEED_LINEAR, 1.0, 0.00001, NULL, 0.4, _ds_end, NULL);
|
||||
efx_spin_start(dm_hide, 1080.0, NULL);
|
||||
efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.00001, NULL, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_ZOOM_IN:
|
||||
dm_show = dm_add(desk);
|
||||
e_efx_zoom(dm_show, E_EFX_EFFECT_SPEED_LINEAR, 0.000001, 1.0, NULL, 0.4, _ds_end, NULL);
|
||||
efx_zoom(dm_show, EFX_EFFECT_SPEED_LINEAR, 0.000001, 1.0, NULL, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_ZOOM_OUT:
|
||||
evas_object_raise(dm_hide);
|
||||
e_efx_zoom(dm_hide, E_EFX_EFFECT_SPEED_LINEAR, 1.0, 0.0000001, NULL, 0.4, _ds_end, NULL);
|
||||
efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.0000001, NULL, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_GROW:
|
||||
x = hx = desk->zone->x;
|
||||
|
@ -197,19 +197,19 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
evas_object_clip_set(dm_show, o);
|
||||
evas_object_show(o);
|
||||
e_comp_object_util_del_list_append(dm_show, o);
|
||||
e_efx_resize(o, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_POINT(hx, hy), desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL);
|
||||
efx_resize(o, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(hx, hy), desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_ROTATE_OUT:
|
||||
e_efx_move_circle(dm_hide, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
efx_move_circle(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
720, 0.4, NULL, NULL);
|
||||
e_efx_resize(dm_hide, E_EFX_EFFECT_SPEED_LINEAR, NULL, 1, 1, 0.4, _ds_end, NULL);
|
||||
efx_resize(dm_hide, EFX_EFFECT_SPEED_LINEAR, NULL, 1, 1, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_ROTATE_IN:
|
||||
dm_show = dm_add(desk);
|
||||
evas_object_resize(dm_show, 1, 1);
|
||||
e_efx_move_circle(dm_show, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
efx_move_circle(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
720, 0.4, NULL, NULL);
|
||||
e_efx_resize(dm_show, E_EFX_EFFECT_SPEED_LINEAR, NULL, desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL);
|
||||
efx_resize(dm_show, EFX_EFFECT_SPEED_LINEAR, NULL, desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL);
|
||||
break;
|
||||
case DS_SLIDE_SPLIT:
|
||||
{
|
||||
|
@ -259,7 +259,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
else
|
||||
exy.y = desk_show->zone->y + (dy * desk_show->zone->h);
|
||||
}
|
||||
e_efx_move(dmh, E_EFX_EFFECT_SPEED_ACCELERATE,
|
||||
efx_move(dmh, EFX_EFFECT_SPEED_ACCELERATE,
|
||||
&exy, 0.5, (i == (num - 1)) ? _ds_end : NULL, NULL);
|
||||
dmh = NULL;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
evas_object_clip_set(dmh[i], clip[i]);
|
||||
evas_object_show(clip[i]);
|
||||
/* apply effect coords */
|
||||
e_efx_move(clip[i], E_EFX_EFFECT_SPEED_ACCELERATE,
|
||||
efx_move(clip[i], EFX_EFFECT_SPEED_ACCELERATE,
|
||||
&exy[i], 0.8, (i == 3) ? _ds_end : NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -334,8 +334,8 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
evas_object_clip_set(dmh[i], clip[i]);
|
||||
evas_object_show(clip[i]);
|
||||
/* resize all quads to 1x1 while moving towards center */
|
||||
e_efx_resize(clip[i], E_EFX_EFFECT_SPEED_ACCELERATE,
|
||||
E_EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
efx_resize(clip[i], EFX_EFFECT_SPEED_ACCELERATE,
|
||||
EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
1, 1 ,0.8, (i == 3) ? _ds_end : NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -362,8 +362,8 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
evas_object_clip_set(dm_show, clip);
|
||||
evas_object_show(clip);
|
||||
/* resize clip to 1px high while moving towards center */
|
||||
e_efx_resize(clip, E_EFX_EFFECT_SPEED_ACCELERATE,
|
||||
E_EFX_POINT(desk->zone->x, desk->zone->y + (desk->zone->h / 2)),
|
||||
efx_resize(clip, EFX_EFFECT_SPEED_ACCELERATE,
|
||||
EFX_POINT(desk->zone->x, desk->zone->y + (desk->zone->h / 2)),
|
||||
desk->zone->w, 1, 0.45, _ds_blink2, NULL);
|
||||
}
|
||||
break;
|
||||
|
@ -378,8 +378,8 @@ _ds_show(E_Desk *desk, int dx, int dy)
|
|||
e_comp_object_util_del_list_append(dm_hide, clip);
|
||||
evas_object_show(clip);
|
||||
/* resize clip to 1x1 while moving towards center */
|
||||
e_efx_resize(clip, E_EFX_EFFECT_SPEED_DECELERATE,
|
||||
E_EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
efx_resize(clip, EFX_EFFECT_SPEED_DECELERATE,
|
||||
EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
|
||||
1, 1, 0.6, _ds_end, NULL);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -32,7 +32,7 @@ _ds_menu_ruler(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
|
|||
mr_init();
|
||||
e_config_save_queue();
|
||||
}
|
||||
#if E_VERSION_MAJOR == 20
|
||||
|
||||
static void
|
||||
_ds_menu_maximize(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
|
||||
{
|
||||
|
@ -43,7 +43,6 @@ _ds_menu_maximize(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi
|
|||
maximize_init();
|
||||
e_config_save_queue();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_ds_menu_transitions(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
|
||||
|
@ -91,13 +90,13 @@ _ds_menu_add(void *data EINA_UNUSED, E_Menu *m)
|
|||
e_menu_item_check_set(mi, 1);
|
||||
e_menu_item_toggle_set(mi, ds_config->disable_ruler);
|
||||
e_menu_item_callback_set(mi, _ds_menu_ruler, NULL);
|
||||
#if E_VERSION_MAJOR == 20
|
||||
|
||||
mi = e_menu_item_new(subm);
|
||||
e_menu_item_label_set(mi, D_("Disable Maximize Effects"));
|
||||
e_menu_item_check_set(mi, 1);
|
||||
e_menu_item_toggle_set(mi, ds_config->disable_maximize);
|
||||
e_menu_item_callback_set(mi, _ds_menu_maximize, NULL);
|
||||
#endif
|
||||
|
||||
mi = e_menu_item_new(subm);
|
||||
e_menu_item_label_set(mi, D_("Disable Transition Effects"));
|
||||
e_menu_item_check_set(mi, 1);
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "gadget.h"
|
||||
|
||||
E_API E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Desksanity"};
|
||||
|
||||
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;
|
||||
|
||||
|
@ -20,7 +27,7 @@ static Eina_Bool focus_last_focused_per_desktop;
|
|||
static unsigned int pending_flip;
|
||||
|
||||
static void
|
||||
_ds_fade_end(Ecore_Cb cb, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
_ds_fade_end(Ecore_Cb cb, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
{
|
||||
E_FREE_FUNC(fade_obj, evas_object_del);
|
||||
if (cb)
|
||||
|
@ -230,7 +237,7 @@ ds_client_urgent(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Property
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
E_API void *
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
|
@ -241,7 +248,7 @@ e_modapi_init(E_Module *m)
|
|||
snprintf(buf, sizeof(buf), "%s/e-module-desksanity.edj", m->dir);
|
||||
elm_theme_overlay_add(NULL, buf);
|
||||
|
||||
e_efx_init();
|
||||
efx_init();
|
||||
_e_mod_ds_config_load();
|
||||
|
||||
mod = E_NEW(Mod, 1);
|
||||
|
@ -253,14 +260,13 @@ e_modapi_init(E_Module *m)
|
|||
ds_init();
|
||||
if (!ds_config->disable_ruler)
|
||||
mr_init();
|
||||
#if E_VERSION_MAJOR == 20
|
||||
if (!ds_config->disable_maximize)
|
||||
maximize_init();
|
||||
#endif
|
||||
|
||||
pip_init();
|
||||
zoom_init();
|
||||
mag_init();
|
||||
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY, ds_client_urgent, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE, ds_client_remove, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_AFTER_SHOW, ds_desk_after_show, NULL);
|
||||
|
@ -269,19 +275,19 @@ 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;
|
||||
}
|
||||
|
||||
E_API int
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
mag_shutdown();
|
||||
zoom_shutdown();
|
||||
pip_shutdown();
|
||||
#if E_VERSION_MAJOR == 20
|
||||
if (!ds_config->disable_maximize)
|
||||
maximize_shutdown();
|
||||
#endif
|
||||
if (!ds_config->disable_ruler)
|
||||
mr_shutdown();
|
||||
if (!ds_config->disable_transitions)
|
||||
|
@ -299,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);
|
||||
//e_efx_shutdown(); broken...
|
||||
save_cbs = eina_list_free(save_cbs);
|
||||
efx_shutdown();
|
||||
|
||||
z_gadget_type_del("Start");
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API int
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -320,10 +333,9 @@ ds_fade_setup(Evas_Object_Event_Cb click_cb)
|
|||
evas_object_name_set(fade_obj, "fade_obj");
|
||||
evas_object_geometry_set(fade_obj, 0, 0, e_comp->w, e_comp->h);
|
||||
evas_object_layer_set(fade_obj, E_LAYER_MENU + 1);
|
||||
evas_object_pass_events_set(fade_obj, 1);
|
||||
evas_object_show(fade_obj);
|
||||
e_efx_fade(fade_obj, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
e_efx_fade(fade_obj, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(0, 0, 0), 192, 0.3, NULL, NULL);
|
||||
efx_fade(fade_obj, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
efx_fade(fade_obj, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 192, 0.3, NULL, NULL);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
|
@ -331,7 +343,7 @@ 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);
|
||||
e_efx_fade(fade_obj, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, (E_Efx_End_Cb)_ds_fade_end, end_cb);
|
||||
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)
|
||||
evas_object_event_callback_del(fade_obj, EVAS_CALLBACK_MOUSE_DOWN, click_cb);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#endif
|
||||
|
||||
#include <e.h>
|
||||
#include <Efx.h>
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
|
@ -19,6 +20,7 @@
|
|||
#endif
|
||||
|
||||
#define N_(str) (str)
|
||||
#define _(str) (str)
|
||||
|
||||
#define MOD_CONFIG_FILE_EPOCH 0
|
||||
#define MOD_CONFIG_FILE_GENERATION 1
|
||||
|
@ -81,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);
|
||||
|
@ -90,10 +93,10 @@ EINTERN void ds_shutdown(void);
|
|||
|
||||
EINTERN void mr_shutdown(void);
|
||||
EINTERN void mr_init(void);
|
||||
#if E_VERSION_MAJOR == 20
|
||||
|
||||
EINTERN void maximize_init(void);
|
||||
EINTERN void maximize_shutdown(void);
|
||||
#endif
|
||||
|
||||
EINTERN void pip_init(void);
|
||||
EINTERN void pip_shutdown(void);
|
||||
|
||||
|
@ -105,5 +108,4 @@ EINTERN void zoom_shutdown(void);
|
|||
|
||||
EINTERN void mag_init(void);
|
||||
EINTERN void mag_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
|
@ -30,7 +30,7 @@ static void
|
|||
_current_update(int n)
|
||||
{
|
||||
if (current_mag != -1)
|
||||
e_efx_zoom_reset(magnifiers[current_mag]);
|
||||
efx_zoom_reset(magnifiers[current_mag]);
|
||||
current_mag = n;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ _magnify_update(int x, int y)
|
|||
w = zone->w / MAG_SIZE_FACTOR;
|
||||
h = zone->h / MAG_SIZE_FACTOR;
|
||||
evas_object_geometry_set(clip, x - (w / 2), y - (h / 2), w, h);
|
||||
e_efx_zoom(magnifiers[zone->num], E_EFX_EFFECT_SPEED_LINEAR, 0, 2.0, E_EFX_POINT(x, y), 0, NULL, NULL);
|
||||
efx_zoom(magnifiers[zone->num], EFX_EFFECT_SPEED_LINEAR, 0, 2.0, EFX_POINT(x, y), 0, NULL, NULL);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "e_mod_main.h"
|
||||
#if E_VERSION_MAJOR == 20
|
||||
|
||||
static Ecore_Event_Handler *eh = NULL;
|
||||
|
||||
|
@ -29,7 +28,7 @@ _ds_unmaximize_post(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
if (!rect) return;
|
||||
evas_object_geometry_set(obj, rect->x, rect->y, rect->w, rect->h);
|
||||
free(rect);
|
||||
e_efx_resize(ec->frame, E_EFX_EFFECT_SPEED_SINUSOIDAL, E_EFX_POINT(x, y), w, h, time, NULL, NULL);
|
||||
efx_resize(ec->frame, EFX_EFFECT_SPEED_SINUSOIDAL, EFX_POINT(x, y), w, h, time, NULL, NULL);
|
||||
ecore_timer_add(0.1, _ds_unmaximize_render, NULL);
|
||||
}
|
||||
|
||||
|
@ -55,12 +54,12 @@ _ds_unmaximize_pre(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
|
|||
|
||||
max = !!evas_object_data_del(ec->frame, "__DSMAX");
|
||||
if (max)
|
||||
e_efx_resize_stop(ec->frame);
|
||||
efx_resize_stop(ec->frame);
|
||||
ec->maximize_override = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_ds_maximize_done(void *data, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
_ds_maximize_done(void *data, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
|
||||
{
|
||||
E_Client *ec = data;
|
||||
|
||||
|
@ -86,7 +85,7 @@ _ds_maximize(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNU
|
|||
if ((!w) || (!h)) return; //new client, don't break the universe
|
||||
ec->maximize_override = 1;
|
||||
evas_object_geometry_set(ec->frame, x, y, w, h);
|
||||
e_efx_resize(ec->frame, E_EFX_EFFECT_SPEED_SINUSOIDAL, E_EFX_POINT(ecx, ecy), ecw, ech, time, _ds_maximize_done, ec);
|
||||
efx_resize(ec->frame, EFX_EFFECT_SPEED_SINUSOIDAL, EFX_POINT(ecx, ecy), ecw, ech, time, _ds_maximize_done, ec);
|
||||
evas_object_data_set(ec->frame, "__DSMAX", (void*)1);
|
||||
}
|
||||
|
||||
|
@ -98,7 +97,7 @@ _ds_fullscreen(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
|
|||
evas_object_data_del(ec->frame, "__DSMAX");
|
||||
free(evas_object_data_del(ec->frame, "__DSUMAX"));
|
||||
ec->maximize_override = 0;
|
||||
e_efx_resize_stop(ec->frame);
|
||||
efx_resize_stop(ec->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -145,4 +144,3 @@ maximize_shutdown(void)
|
|||
}
|
||||
E_FREE_FUNC(eh, ecore_event_handler_del);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -57,7 +57,7 @@ move_x_update(E_Client *ec)
|
|||
if (evas_object_clip_get(mr_line_x) != zone->bg_clip_object)
|
||||
{
|
||||
evas_object_clip_set(mr_line_x, zone->bg_clip_object);
|
||||
e_efx_reclip(mr_line_x);
|
||||
efx_reclip(mr_line_x);
|
||||
}
|
||||
evas_object_geometry_set(mr_line_x, ec->x, zone->y, 1, zone->h);
|
||||
|
||||
|
@ -83,7 +83,7 @@ move_y_update(E_Client *ec)
|
|||
if (evas_object_clip_get(mr_line_y) != zone->bg_clip_object)
|
||||
{
|
||||
evas_object_clip_set(mr_line_y, zone->bg_clip_object);
|
||||
e_efx_reclip(mr_line_y);
|
||||
efx_reclip(mr_line_y);
|
||||
}
|
||||
evas_object_geometry_set(mr_line_y, zone->x, ec->y, zone->w, 1);
|
||||
|
||||
|
@ -221,7 +221,6 @@ text_add(Evas *e)
|
|||
Evas_Object *o;
|
||||
|
||||
o = edje_object_add(e);
|
||||
evas_object_pass_events_set(o, 1);
|
||||
evas_object_layer_set(o, E_LAYER_MENU + 2);
|
||||
edje_object_file_set(o, mod->edje_file, "e/modules/desksanity/moveresize");
|
||||
evas_object_show(o);
|
||||
|
@ -241,11 +240,11 @@ line_add(Evas *e)
|
|||
}
|
||||
|
||||
static void
|
||||
pulse(void *d EINA_UNUSED, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
pulse(void *d EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
{
|
||||
e_efx_queue_append(obj, E_EFX_EFFECT_SPEED_SINUSOIDAL, E_EFX_QUEUED_EFFECT(E_EFX_EFFECT_FADE(255, 255, 255, 255)), 0.6, NULL, NULL);
|
||||
e_efx_queue_append(obj, E_EFX_EFFECT_SPEED_SINUSOIDAL, E_EFX_QUEUED_EFFECT(E_EFX_EFFECT_FADE(120, 120, 120, 120)), 0.9, pulse, NULL);
|
||||
e_efx_queue_run(obj);
|
||||
efx_queue_append(obj, EFX_EFFECT_SPEED_SINUSOIDAL, EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(255, 255, 255, 255)), 0.6, NULL, NULL);
|
||||
efx_queue_append(obj, EFX_EFFECT_SPEED_SINUSOIDAL, EFX_QUEUED_EFFECT(EFX_EFFECT_FADE(120, 120, 120, 120)), 0.9, pulse, NULL);
|
||||
efx_queue_run(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -290,14 +289,14 @@ move_update(void *d EINA_UNUSED, E_Client *ec)
|
|||
static void
|
||||
move_end(void *d EINA_UNUSED, E_Client *ec EINA_UNUSED)
|
||||
{
|
||||
e_efx_queue_clear(mr_line_x);
|
||||
e_efx_queue_clear(mr_line_y);
|
||||
e_efx_fade_reset(mr_line_x);
|
||||
e_efx_fade_reset(mr_line_y);
|
||||
e_efx_fade(mr_line_x, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
e_efx_fade(mr_line_y, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
e_efx_fade(move_text_x, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
e_efx_fade(move_text_y, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_queue_clear(mr_line_x);
|
||||
efx_queue_clear(mr_line_y);
|
||||
efx_fade_reset(mr_line_x);
|
||||
efx_fade_reset(mr_line_y);
|
||||
efx_fade(mr_line_x, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_fade(mr_line_y, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_fade(move_text_x, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_fade(move_text_y, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
ds_fade_end(_fade_end, NULL);
|
||||
}
|
||||
|
||||
|
@ -373,12 +372,12 @@ resize_end(void *d EINA_UNUSED, E_Client *ec EINA_UNUSED)
|
|||
{
|
||||
unsigned int x;
|
||||
|
||||
e_efx_fade(resize_text, E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_fade(resize_text, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
for (x = 0; x < 4; x++)
|
||||
{
|
||||
if (!resize_rect[x]) continue;
|
||||
e_efx_fade(resize_rect[x], E_EFX_EFFECT_SPEED_DECELERATE, E_EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
e_efx_queue_clear(resize_rect[x]);
|
||||
efx_fade(resize_rect[x], EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.3, NULL, NULL);
|
||||
efx_queue_clear(resize_rect[x]);
|
||||
}
|
||||
ds_fade_end(_fade_end, NULL);
|
||||
}
|
||||
|
|
16
src/pip.c
|
@ -30,7 +30,6 @@ pips_noedit()
|
|||
|
||||
editing = EINA_FALSE;
|
||||
ds_fade_end(NULL, pips_noedit);
|
||||
e_comp_ungrab_input(1, 1);
|
||||
it = eina_hash_iterator_data_new(pips);
|
||||
EINA_ITERATOR_FOREACH(it, pip)
|
||||
{
|
||||
|
@ -51,7 +50,6 @@ pips_edit(void)
|
|||
if (e_comp->nocomp) return;
|
||||
editing = EINA_TRUE;
|
||||
ds_fade_setup(pips_noedit);
|
||||
e_comp_grab_input(1, 1);
|
||||
it = eina_hash_iterator_data_new(pips);
|
||||
EINA_ITERATOR_FOREACH(it, pip)
|
||||
{
|
||||
|
@ -205,9 +203,9 @@ _pip_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
if (evas_key_modifier_is_set(ev->modifiers, "Control"))
|
||||
{
|
||||
if (ev->z < 0)
|
||||
e_efx_zoom(pip->pip, E_EFX_EFFECT_SPEED_LINEAR, 0, pip->zoom -= 0.05, E_EFX_POINT(ev->output.x, ev->output.y), 0.2, NULL, NULL);
|
||||
efx_zoom(pip->pip, EFX_EFFECT_SPEED_LINEAR, 0, pip->zoom -= 0.05, EFX_POINT(ev->output.x, ev->output.y), 0.2, NULL, NULL);
|
||||
else if (ev->z > 0)
|
||||
e_efx_zoom(pip->pip, E_EFX_EFFECT_SPEED_LINEAR, 0, pip->zoom += 0.05, E_EFX_POINT(ev->output.x, ev->output.y), 0.2, NULL, NULL);
|
||||
efx_zoom(pip->pip, EFX_EFFECT_SPEED_LINEAR, 0, pip->zoom += 0.05, EFX_POINT(ev->output.x, ev->output.y), 0.2, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -215,7 +213,7 @@ _pip_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
pip->opacity = E_CLAMP(pip->opacity + 15, 0, 255);
|
||||
else if (ev->z > 0)
|
||||
pip->opacity = E_CLAMP(pip->opacity - 15, 0, 255);
|
||||
e_efx_fade(pip->pip, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(pip->opacity, pip->opacity, pip->opacity), pip->opacity, 0.2, NULL, NULL);
|
||||
efx_fade(pip->pip, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(pip->opacity, pip->opacity, pip->opacity), pip->opacity, 0.2, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,9 +345,9 @@ _pip_manage(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_
|
|||
}
|
||||
|
||||
static void
|
||||
_pip_fade_end(void *d EINA_UNUSED, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
_pip_fade_end(void *d EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *obj)
|
||||
{
|
||||
ecore_job_add((Ecore_Cb)e_efx_fade_reset, obj);
|
||||
ecore_job_add((Ecore_Cb)efx_fade_reset, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -379,8 +377,8 @@ _pip_create(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
|||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _pip_mouse_wheel, pip);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _pip_del, ec);
|
||||
|
||||
e_efx_fade(o, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
e_efx_fade(o, E_EFX_EFFECT_SPEED_LINEAR, E_EFX_COLOR(255, 255, 255), 255, 0.2, _pip_fade_end, NULL);
|
||||
efx_fade(o, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
|
||||
efx_fade(o, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 255, 255), 255, 0.2, _pip_fade_end, NULL);
|
||||
|
||||
eina_hash_add(pips, &ec->frame, pip);
|
||||
if (editing)
|
||||
|
|
|
@ -474,13 +474,12 @@ _zoom_client_property(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Pro
|
|||
static void
|
||||
_hiding(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
|
||||
{
|
||||
Eina_List *clients = evas_object_data_del(obj, "__DSCLIENTS");
|
||||
Eina_List *clients = evas_object_data_get(obj, "__DSCLIENTS");
|
||||
Evas_Object *m, *e;
|
||||
|
||||
EINA_LIST_FREE(clients, m)
|
||||
{
|
||||
e = evas_object_smart_parent_get(m);
|
||||
evas_object_pass_events_set(e, 1);
|
||||
edje_object_signal_emit(e, "e,action,hide", "e");
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 501 B |