Compare commits

..

9 Commits

Author SHA1 Message Date
Mike Blumenkrantz 4141a1e316 update news, bump version 2015-11-12 13:18:29 -05:00
Mike Blumenkrantz 38103c2b95 use correct int size for ds effect iterating
fixes selectively disabling desk flip effects
2015-11-10 20:25:24 -05:00
Mike Blumenkrantz a25d7a4262 update news, bump version 2015-09-11 13:21:58 -04:00
Mike Blumenkrantz c20689c6ed switch bzip2->xz in dist 2015-09-11 13:21:58 -04:00
Mike Blumenkrantz dc35b11619 reorder ds client iterator filter to catch override clients before ec->desk deref
ref D3024 and @Samis2001
2015-09-07 13:47:51 -04:00
Mike Blumenkrantz 44fa419a8c update news, bump version 2015-02-03 18:37:52 -05:00
Mike Blumenkrantz 02d437cd71 fix multiscreen zoom and current desks zoom 2015-02-03 18:35:33 -05:00
Mike Blumenkrantz 23e24c568f fix input regions on shaded clients after desk flip 2015-02-03 18:34:44 -05:00
Mike Blumenkrantz eb9a4f1833 raise client zoom obj on mouse in 2015-02-03 18:34:28 -05:00
28 changed files with 872 additions and 1290 deletions

3
.gitignore vendored
View File

@ -10,7 +10,6 @@ Makefile
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.h
config.h.in
@ -21,6 +20,7 @@ config.sub
configure
configure.ac.orig
depcomp
e-module-desksanity.edj
e_modules-desksanity.spec
install-sh
libtool
@ -28,6 +28,7 @@ ltmain.sh
*.m4
missing
mkinstalldirs
module.desktop
po/Makefile
po/Makefile.in
po/Makefile.in.in

View File

@ -1,9 +1,9 @@
ACLOCAL_AMFLAGS = -I m4
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
config.sub configure depcomp install-sh ltmain.sh \
missing module.desktop config.rpath mkinstalldirs
SUBDIRS = src
#if HAVE_PO
@ -18,15 +18,13 @@ EXTRA_DIST = module.desktop.in \
e_modules-desksanity.spec.in \
e-module-desksanity.edc \
epic-e-256.png \
win_shadow.png \
glow_bottom.png \
glow_top.png
win_shadow.png
include src/Makefile.mk
e-module-desksanity.edj: e-module-desksanity.edc
$(EDJE_CC) -id $(top_srcdir) $< $@
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)

48
NEWS
View File

@ -1,51 +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
--------------------

View File

@ -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>

View File

@ -1,4 +1,4 @@
AC_INIT(desksanity, 1.1.0, zmike@enlightenment.org)
AC_INIT(desksanity, 1.0.3, zmike@enlightenment.org)
AC_CONFIG_MACRO_DIR([m4])
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.ac)
@ -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])
release=$(pkg-config --variable=release enlightenment)
MODULE_ARCH="$host_os-$host_cpu-$release"
AC_SUBST(MODULE_ARCH)
@ -47,9 +39,24 @@ 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
src/Makefile
module.desktop
e_modules-desksanity.spec
], [
])

View File

@ -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>

504
e-module-desksanity.edc Normal file
View File

@ -0,0 +1,504 @@
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;
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;
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;
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;;
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";
parts {
rect { "clipper"; nomouse;
desc {
rel1.to: "e.swallow.content";
rel2.to: "e.swallow.content";
}
}
swallow { "e.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";
desc {
color: 51 153 255 0;
rel1.to: "e.swallow.client";
rel1.offset: -2 -2;
rel2.to: "e.swallow.client";
rel2.offset: 2 2;
visible: 0;
link.base: "e,state,unfocused" "e";
link.transition: LINEAR 0.2;
}
desc { "active"; inherit: "default";
color: 51 153 255 170;
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;
map.on: 1;
link.base: "mouse,out" "events";
link.transition: LINEAR 0.2;
//link.after: "idle";
}
desc { "active";
rel1.to: "spacer";
rel2.to: "spacer";
rel2.relative: 1.3 1.3;
rel2.offset: -1 -1;
link.base: "mouse,in" "events";
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: 255 255 255 200;
link.base: "mouse,out" "events";
link.transition: LINEAR 0.2;
}
desc { "active"; inherit: "default";
color: 255 255 255 255;
link.base: "mouse,in" "events";
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;
color2: 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";
action: SIGNAL_EMIT "e,state,active" "e";
sequence {
action: ACTION_STOP;
targets: "idle" "idle2" "idle3" "idle4";
}
}
program { signal: "mouse,out"; source: "events";
action: SIGNAL_EMIT "e,state,inactive" "e";
}
}
}
}
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";
}
}
}
}
}

Binary file not shown.

BIN
epic-e-256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -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;
}

View File

@ -1,5 +0,0 @@
[Desktop Entry]
Type=Application
Name=Start
Exec=@GADGET_DIR@/start/e_gadget_start
Icon=e/gadget/start/main

View File

@ -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;
}

View File

@ -1,4 +0,0 @@
[Desktop Entry]
Type=Application
Name=Test
Exec=@GADGET_DIR@/test/e_gadget_test

View File

@ -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']))

View File

@ -1,6 +0,0 @@
#!/bin/sh
for x in "$@" ; do
dir="$(dirname $x)"
mv "$DESTDIR"/"$x" "$DESTDIR"/"$dir"/module.so
done

27
src/Makefile.am Normal file
View File

@ -0,0 +1,27 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -I. \
-I$(top_srcdir) \
-I$(includedir) \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DPACKAGE_DATA_DIR=\"$(module_dir)/$(PACKAGE)\" \
@E_CFLAGS@
pkgdir = $(module_dir)/$(PACKAGE)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = e_mod_main.h \
e_mod_main.c \
ds_config.c \
maximize.c \
moveresize.c \
pip.c \
zoom.c \
magnify.c \
desksanity.c
module_la_LIBADD = @E_LIBS@
module_la_LDFLAGS = -module -avoid-version
module_la_DEPENDENCIES = $(top_builddir)/config.h
clean-local:
rm -rf *~

View File

@ -1,24 +0,0 @@
AM_CPPFLAGS = \
-Isrc \
-I$(top_srcdir) \
-I$(includedir) \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DPACKAGE_DATA_DIR=\"$(module_dir)/$(PACKAGE)\" \
@E_CFLAGS@
pkgdir = $(module_dir)/$(PACKAGE)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = \
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
module_la_LIBADD = @E_LIBS@
module_la_LDFLAGS = -module -avoid-version
module_la_DEPENDENCIES = $(top_builddir)/config.h

View File

@ -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);
@ -19,7 +19,7 @@ _ds_end(void *data EINA_UNUSED, E_Efx_Map_Data *emd EINA_UNUSED, Evas_Object *ob
if (desk_show)
{
e_desk_flip_end(desk_show);
e_comp_shape_queue_block(0);
e_comp_shape_queue_block(e_comp_get(desk_show), 0);
}
/* hide/delete current desk's mirror */
@ -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);
}
@ -69,7 +69,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
E_FREE_FUNC(dm_show, evas_object_del);
/* iterate all clients */
E_CLIENT_FOREACH(ec)
E_CLIENT_FOREACH(desk->zone->comp, ec)
{
/* skip clients from other screens, iconic clients, and ignorable clients */
if (e_client_util_ignored_get(ec) || (ec->desk->zone != desk->zone) || (ec->iconic)) continue;
@ -96,7 +96,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
}
desk_show = desk;
e_comp_shape_queue_block(1);
e_comp_shape_queue_block(e_comp_get(desk), 1);
/* guarantee that the user gets to see each flip
* at least once
*/
@ -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;
@ -192,24 +192,24 @@ _ds_show(E_Desk *desk, int dx, int dy)
else if (!dy)
h = desk->zone->h;
dm_show = dm_add(desk);
o = evas_object_rectangle_add(e_comp->evas);
o = evas_object_rectangle_add(e_comp_get(desk)->evas);
evas_object_geometry_set(o, x, y, w, h);
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:
{
@ -235,7 +235,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
dmh = dm_add(desk_hide);
e_comp_object_util_del_list_append(dm_hide, dmh);
}
clip = evas_object_rectangle_add(e_comp->evas);
clip = evas_object_rectangle_add(e_comp_get(desk_show)->evas);
e_comp_object_util_del_list_append(dm_hide, clip);
if (dx)
evas_object_geometry_set(clip, desk->zone->x, desk->zone->y + (i * h), w, h);
@ -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;
}
@ -293,14 +293,14 @@ _ds_show(E_Desk *desk, int dx, int dy)
e_comp_object_util_del_list_append(dm_hide, dmh[i]);
}
/* clip the quad */
clip[i] = evas_object_rectangle_add(e_comp->evas);
clip[i] = evas_object_rectangle_add(e_comp_get(desk)->evas);
e_comp_object_util_del_list_append(dm_hide, clip[i]);
/* lay out 2x2 grid */
evas_object_geometry_set(clip[i], cxy[i].x, cxy[i].y, desk->zone->w / 2, desk->zone->h / 2);
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);
}
}
@ -327,15 +327,15 @@ _ds_show(E_Desk *desk, int dx, int dy)
e_comp_object_util_del_list_append(dm_hide, dmh[i]);
}
/* clip the quad */
clip[i] = evas_object_rectangle_add(e_comp->evas);
clip[i] = evas_object_rectangle_add(e_comp_get(desk)->evas);
e_comp_object_util_del_list_append(dm_hide, clip[i]);
/* lay out 2x2 grid */
evas_object_geometry_set(clip[i], cxy[i].x, cxy[i].y, desk->zone->w / 2, desk->zone->h / 2);
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);
}
}
@ -348,13 +348,13 @@ _ds_show(E_Desk *desk, int dx, int dy)
evas_object_geometry_set(dm_show, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
evas_object_hide(dm_show);
bg = evas_object_rectangle_add(e_comp->evas);
bg = evas_object_rectangle_add(e_comp_get(desk)->evas);
e_comp_object_util_del_list_append(dm_show, bg);
evas_object_color_set(bg, 0, 0, 0, 255);
evas_object_layer_set(bg, E_LAYER_MENU + 99);
evas_object_geometry_set(bg, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
evas_object_show(bg);
clip = evas_object_rectangle_add(e_comp->evas);
clip = evas_object_rectangle_add(e_comp_get(desk)->evas);
e_comp_object_util_del_list_append(dm_show, clip);
/* fit clipper to zone */
evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
@ -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;
@ -371,15 +371,15 @@ _ds_show(E_Desk *desk, int dx, int dy)
{
Evas_Object *clip;
clip = evas_object_rectangle_add(e_comp->evas);
clip = evas_object_rectangle_add(e_comp_get(desk)->evas);
/* fit clipper to zone */
evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
evas_object_clip_set(dm_hide, clip);
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;
@ -394,7 +394,7 @@ _ds_hide(E_Desk *desk)
E_Client *ec;
E_FREE_FUNC(dm_hide, evas_object_del);
E_CLIENT_FOREACH(ec)
E_CLIENT_FOREACH(desk->zone->comp, ec)
{
/* same as above */
if (e_client_util_ignored_get(ec) || (ec->desk->zone != desk->zone) || (ec->iconic)) continue;
@ -403,7 +403,6 @@ _ds_hide(E_Desk *desk)
/* comp hide clients */
e_client_comp_hidden_set(ec, EINA_TRUE);
ec->hidden = 1;
evas_object_show(ec->frame);
evas_object_hide(ec->frame);
}
if (ds_config->disabled_transition_count == DS_LAST) return;

View File

@ -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);

View File

@ -1,6 +1,6 @@
#include "e_mod_main.h"
E_API E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Desksanity"};
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Desksanity"};
static E_Config_DD *conf_edd = NULL;
EINTERN Mod *mod = NULL;
@ -8,19 +8,8 @@ EINTERN Config *ds_config = NULL;
static Evas_Object *fade_obj = NULL;
static E_Action *act;
static Eina_List *urgent;
static Eina_List *focus_list;
static Eina_List *handlers;
static Ecore_Timer *ds_key_focus_timeout;
static Eina_List *ds_key_focus_desks;
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)
@ -68,169 +57,7 @@ _e_mod_ds_config_load(void)
ds_config->config_version = MOD_CONFIG_FILE_VERSION;
}
static E_Client *
ds_client_urgent_pop(E_Client *ec)
{
Eina_List *l;
if (!urgent) return NULL;
l = eina_list_data_find_list(urgent, ec);
if (!l) return NULL;
urgent = eina_list_remove_list(urgent, l);
return !!e_object_unref(E_OBJECT(ec)) ? ec : NULL;
}
static Eina_List *
ds_key_list_init(const E_Zone *zone)
{
int i;
Eina_List *desks = NULL;
for (i = 0; i < zone->desk_x_count * zone->desk_y_count; i++)
{
if (zone->desks[i]->visible) continue;
e_object_ref(E_OBJECT(zone->desks[i]));
desks = eina_list_append(desks, zone->desks[i]);
}
return desks;
}
static Eina_Bool
ds_key_focus_timeout_cb(void *d EINA_UNUSED)
{
E_Client *ec;
e_client_focus_track_thaw();
ec = e_client_focused_get();
if (ec)
e_client_focus_latest_set(ec);
ds_key_focus_timeout = NULL;
E_FREE_LIST(ds_key_focus_desks, e_object_unref);
return EINA_FALSE;
}
static void
ds_key_focus(void)
{
Eina_List *l;
E_Client *ec;
E_Zone *focus_zone = NULL;
static double last;
double t = 0.0;
Eina_Bool skip = EINA_FALSE;
if (!focus_list)
{
focus_zone = e_zone_current_get();
if (!ds_key_focus_desks)
ds_key_focus_desks = ds_key_list_init(focus_zone);
if (!ds_key_focus_timeout)
{
e_client_focus_track_freeze();
ds_key_focus_timeout = ecore_timer_add(0.25, ds_key_focus_timeout_cb, NULL);
}
t = ecore_time_unix_get();
skip = (t - last < 0.25);
if (skip)
ecore_timer_reset(ds_key_focus_timeout);
}
else
{
E_FREE_FUNC(ds_key_focus_timeout, ecore_timer_del);
E_FREE_LIST(ds_key_focus_desks, e_object_unref);
e_client_focus_track_thaw();
}
EINA_LIST_FOREACH(focus_list ?: e_client_focus_stack_get(), l, ec)
if ((!ec->iconic) && (!ec->focused) &&
((!focus_zone) || ((ec->zone == focus_zone) && eina_list_data_find(ds_key_focus_desks, ec->desk))))
{
if (ds_key_focus_desks)
{
ds_key_focus_desks = eina_list_remove(ds_key_focus_desks, ec->desk);
e_object_unref(E_OBJECT(ec->desk));
}
if (!pending_flip)
focus_last_focused_per_desktop = e_config->focus_last_focused_per_desktop;
if (!ec->desk->visible)
{
e_config->focus_last_focused_per_desktop = 0;
pending_flip++;
}
if (ec->sticky)
{
E_Client *tec;
E_CLIENT_FOREACH(tec)
if ((!tec->sticky) && (tec->desk == ec->desk)) break;
/* do not flip to a sticky window if there are no other windows on its desk */
if ((!tec) || (tec->desk != ec->desk)) continue;
e_desk_show(ec->desk);
}
e_client_activate(ec, 1);
break;
}
last = t;
focus_list = eina_list_free(focus_list);
}
static void
ds_key(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
E_Client *ec = NULL;
if (!urgent)
{
ds_key_focus();
return;
}
while (!ec)
ec = ds_client_urgent_pop(eina_list_data_get(urgent));
if (ec)
{
eina_list_free(focus_list);
focus_list = eina_list_clone(e_client_focus_stack_get());
e_client_activate(ec, 1);
}
else
ds_key_focus();
}
static Eina_Bool
ds_desk_after_show(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Desk_After_Show *ev EINA_UNUSED)
{
if (pending_flip)
pending_flip--,
e_config->focus_last_focused_per_desktop = focus_last_focused_per_desktop;
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
ds_client_remove(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
{
ds_client_urgent_pop(ev->ec);
if (focus_list)
focus_list = eina_list_remove(focus_list, ev->ec);
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
ds_client_urgent(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Property *ev)
{
if (!(ev->property & E_CLIENT_PROPERTY_URGENCY)) return ECORE_CALLBACK_RENEW;
if (ev->ec->urgent)
{
e_object_ref(E_OBJECT(ev->ec));
urgent = eina_list_append(urgent, ev->ec);
}
else
ds_client_urgent_pop(ev->ec);
return ECORE_CALLBACK_RENEW;
}
E_API void *
EAPI void *
e_modapi_init(E_Module *m)
{
char buf[PATH_MAX];
@ -241,7 +68,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,35 +80,24 @@ 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);
act = e_action_add("ds_key");
e_action_predef_name_set(D_("Desksanity"), D_("Manage Window Focus For Me"), "ds_key", NULL, NULL, 0);
act->func.go = ds_key;
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)
@ -292,18 +108,11 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
E_CONFIG_DD_FREE(conf_edd);
eina_stringshare_del(mod->edje_file);
E_FREE(mod);
E_FREE_FUNC(act, e_action_del);
e_action_predef_name_del(D_("Desksanity"), "ds_key");
E_FREE_LIST(handlers, ecore_event_handler_del);
E_FREE_LIST(urgent, e_object_unref);
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...
//efx_shutdown(); broken...
return 1;
}
E_API int
EAPI int
e_modapi_save(E_Module *m EINA_UNUSED)
{
e_config_domain_save("module.desksanity", conf_edd, ds_config);
@ -311,27 +120,25 @@ e_modapi_save(E_Module *m EINA_UNUSED)
}
EINTERN void
ds_fade_setup(Evas_Object_Event_Cb click_cb)
ds_fade_setup(E_Comp *comp, Evas_Object_Event_Cb click_cb)
{
if (fade_obj) return;
fade_obj = evas_object_rectangle_add(e_comp->evas);
fade_obj = evas_object_rectangle_add(comp->evas);
if (click_cb)
evas_object_event_callback_add(fade_obj, EVAS_CALLBACK_MOUSE_DOWN, click_cb, NULL);
evas_object_name_set(fade_obj, "fade_obj");
evas_object_geometry_set(fade_obj, 0, 0, e_comp->w, e_comp->h);
evas_object_geometry_set(fade_obj, 0, 0, comp->man->w, comp->man->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
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);
}

View File

@ -6,6 +6,7 @@
#endif
#include <e.h>
#include <Efx.h>
#ifdef ENABLE_NLS
# include <libintl.h>
@ -82,7 +83,7 @@ typedef struct Config
extern Mod *mod;
extern Config *ds_config;
EINTERN void ds_fade_setup(Evas_Object_Event_Cb click_cb);
EINTERN void ds_fade_setup(E_Comp *comp, Evas_Object_Event_Cb click_cb);
EINTERN void ds_fade_end(Ecore_Cb cb, Evas_Object_Event_Cb click_cb);
EINTERN void ds_init(void);
@ -90,10 +91,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 +106,4 @@ EINTERN void zoom_shutdown(void);
EINTERN void mag_init(void);
EINTERN void mag_shutdown(void);
#endif

View File

@ -15,9 +15,11 @@ static void
_magnify_end(void)
{
unsigned int n;
E_Comp *comp;
if (!magnifiers) return;
for (n = 0; n < eina_list_count(e_comp->zones); n++)
comp = e_comp_get(NULL);
for (n = 0; n < eina_list_count(comp->zones); n++)
E_FREE_FUNC(magnifiers[n], evas_object_del);
E_FREE(magnifiers);
E_FREE_FUNC(clip, evas_object_del);
@ -30,7 +32,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;
}
@ -40,20 +42,20 @@ _magnify_update(int x, int y)
int w, h;
E_Zone *zone;
zone = e_comp_zone_xy_get(x, y);
zone = e_comp_zone_xy_get(e_comp_get(NULL), x, y);
if ((int)zone->num != current_mag)
_current_update(zone->num);
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
_magnify_move(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
{
_magnify_update(e_comp_canvas_x_root_adjust(ev->root.x), e_comp_canvas_y_root_adjust(ev->root.y));
_magnify_update(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x), e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y));
return ECORE_CALLBACK_RENEW;
}
@ -62,7 +64,7 @@ _magnify_poll(void *d EINA_UNUSED)
{
int x, y;
ecore_evas_pointer_xy_get(e_comp->ee, &x, &y);
ecore_evas_pointer_xy_get(e_comp_get(NULL)->ee, &x, &y);
_magnify_update(x, y);
return ECORE_CALLBACK_RENEW;
}
@ -85,35 +87,37 @@ _magnify_new(E_Desk *desk)
static void
_magnify_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
E_Comp *comp;
E_Zone *zone;
unsigned int n;
int x, y, w, h;
Eina_List *l;
comp = e_comp_get(NULL);
if (magnifiers)
{
_magnify_end();
return;
}
clip = evas_object_rectangle_add(e_comp->evas);
clip = evas_object_rectangle_add(comp->evas);
evas_object_show(clip);
ecore_evas_pointer_xy_get(e_comp->ee, &x, &y);
magnifiers = malloc(sizeof(void*) * eina_list_count(e_comp->zones));
for (n = 0, l = e_comp->zones, zone = eina_list_data_get(l);
n < eina_list_count(e_comp->zones);
ecore_evas_pointer_xy_get(comp->ee, &x, &y);
magnifiers = malloc(sizeof(void*) * eina_list_count(comp->zones));
for (n = 0, l = comp->zones, zone = eina_list_data_get(l);
n < eina_list_count(comp->zones);
n++, l = eina_list_next(l), zone = eina_list_data_get(l))
{
_magnify_new(e_desk_current_get(zone));
evas_object_clip_set(magnifiers[n], clip);
if (zone != e_zone_current_get()) continue;
if (zone != e_zone_current_get(comp)) continue;
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);
_current_update(n);
}
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
if (comp->comp_type == E_PIXMAP_TYPE_X)
timer = ecore_timer_add(0.05, _magnify_poll, NULL);
else
handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, (Ecore_Event_Handler_Cb)_magnify_move, NULL);

View File

@ -1,12 +1,11 @@
#include "e_mod_main.h"
#if E_VERSION_MAJOR == 20
static Ecore_Event_Handler *eh = NULL;
static Eina_Bool
_ds_unmaximize_render(void *d EINA_UNUSED)
{
e_comp_render_queue();
e_comp_render_queue(e_comp_get(NULL));
return EINA_FALSE;
}
@ -19,7 +18,6 @@ _ds_unmaximize_post(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
double time = 0.15;
if (e_comp_config_get()->match.disable_borders) return;
if (e_client_has_xwindow(ec) && (!e_comp_object_frame_allowed(ec->frame))) return;
if (e_comp_config_get()->fast_borders)
time /= 2;
w = ec->w, h = ec->h;
@ -29,7 +27,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 +53,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;
@ -77,7 +75,6 @@ _ds_maximize(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNU
double time = 0.2;
if (e_comp_config_get()->match.disable_borders) return;
if (e_client_has_xwindow(ec) && (!e_comp_object_frame_allowed(ec->frame))) return;
if (e_comp_config_get()->fast_borders)
time /= 2;
ecx = ec->x, ecy = ec->y, ecw = ec->w, ech = ec->h;
@ -86,7 +83,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 +95,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
@ -124,7 +121,7 @@ maximize_init(void)
{
E_Client *ec;
E_CLIENT_FOREACH(ec)
E_CLIENT_FOREACH(e_comp_get(NULL), ec)
_ds_maximize_check(ec);
eh = ecore_event_handler_add(E_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_ds_maximize_add, NULL);
}
@ -134,7 +131,7 @@ maximize_shutdown(void)
{
E_Client *ec;
E_CLIENT_FOREACH(ec)
E_CLIENT_FOREACH(e_comp_get(NULL), ec)
{
if (e_client_util_ignored_get(ec)) continue;
evas_object_smart_callback_del(ec->frame, "maximize_done", _ds_maximize);
@ -145,4 +142,3 @@ maximize_shutdown(void)
}
E_FREE_FUNC(eh, ecore_event_handler_del);
}
#endif

View File

@ -40,7 +40,7 @@ clear_all(void)
static void
_fade_end(void *d EINA_UNUSED)
{
e_comp_shape_queue_block(0);
e_comp_shape_queue_block(client->comp, 0);
clear_all();
}
@ -51,13 +51,13 @@ move_x_update(E_Client *ec)
int w, h;
E_Zone *zone;
zone = e_comp_zone_xy_get(ec->x, ec->y);
zone = e_comp_zone_xy_get(ec->comp, ec->x, ec->y);
if (!zone) zone = ec->zone;
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);
@ -77,13 +77,13 @@ move_y_update(E_Client *ec)
int w, h;
E_Zone *zone;
zone = e_comp_zone_xy_get(ec->x, ec->y);
zone = e_comp_zone_xy_get(ec->comp, ec->x, ec->y);
if (!zone) zone = ec->zone;
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);
@ -160,9 +160,9 @@ resize_text_update(E_Client *ec)
if (resize_rect[0])
{
zone1 = e_comp_zone_xy_get(ec->x, ec->y);
zone1 = e_comp_zone_xy_get(ec->comp, ec->x, ec->y);
if (!zone1) zone1 = ec->zone;
zone2 = e_comp_zone_xy_get(ec->x + ec->w, ec->y);
zone2 = e_comp_zone_xy_get(ec->comp, ec->x + ec->w, ec->y);
if (!zone2) zone2 = ec->zone;
if (zone1 == zone2)
x = zone1->w;
@ -174,9 +174,9 @@ resize_text_update(E_Client *ec)
if (resize_rect[1])
{
zone1 = e_comp_zone_xy_get(ec->x + ec->w, ec->y);
zone1 = e_comp_zone_xy_get(ec->comp, ec->x + ec->w, ec->y);
if (!zone1) zone1 = ec->zone;
zone2 = e_comp_zone_xy_get(ec->x + ec->w, ec->y + ec->h);
zone2 = e_comp_zone_xy_get(ec->comp, ec->x + ec->w, ec->y + ec->h);
if (!zone2) zone2 = ec->zone;
if (zone1 == zone2)
y = zone1->h;
@ -188,9 +188,9 @@ resize_text_update(E_Client *ec)
if (resize_rect[2])
{
zone1 = e_comp_zone_xy_get(ec->x, ec->y + ec->h);
zone1 = e_comp_zone_xy_get(ec->comp, ec->x, ec->y + ec->h);
if (!zone1) zone1 = ec->zone;
zone2 = e_comp_zone_xy_get(ec->x + ec->w, ec->y + ec->h);
zone2 = e_comp_zone_xy_get(ec->comp, ec->x + ec->w, ec->y + ec->h);
if (!zone2) zone2 = ec->zone;
if (zone1 == zone2)
x = zone1->w;
@ -202,9 +202,9 @@ resize_text_update(E_Client *ec)
if (resize_rect[3])
{
zone1 = e_comp_zone_xy_get(ec->x, ec->y);
zone1 = e_comp_zone_xy_get(ec->comp, ec->x, ec->y);
if (!zone1) zone1 = ec->zone;
zone2 = e_comp_zone_xy_get(ec->x, ec->y + ec->h);
zone2 = e_comp_zone_xy_get(ec->comp, ec->x, ec->y + ec->h);
if (!zone2) zone2 = ec->zone;
if (zone1 == zone2)
y = zone1->h;
@ -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
@ -254,20 +253,20 @@ move_start(E_Client *ec)
if (!ec->moving) return;
clear_all();
client = ec;
e_comp_shape_queue_block(1);
e_comp_shape_queue_block(ec->comp, 1);
ds_fade_setup(NULL);
ds_fade_setup(ec->comp, NULL);
ec->layer_block = 1;
evas_object_layer_set(ec->frame, E_LAYER_MENU + 1);
mr_line_x = line_add(e_comp->evas);
mr_line_y = line_add(e_comp->evas);
mr_line_x = line_add(ec->comp->evas);
mr_line_y = line_add(ec->comp->evas);
move_text_x = text_add(e_comp->evas);
move_text_x = text_add(ec->comp->evas);
move_x_update(ec);
move_text_y = text_add(e_comp->evas);
move_text_y = text_add(ec->comp->evas);
move_y_update(ec);
pulse(NULL, NULL, mr_line_x);
@ -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);
}
@ -309,9 +308,9 @@ resize_start(E_Client *ec)
if (!e_client_util_resizing_get(ec)) return;
clear_all();
client = ec;
e_comp_shape_queue_block(1);
e_comp_shape_queue_block(ec->comp, 1);
ds_fade_setup(NULL);
ds_fade_setup(ec->comp, NULL);
ec->layer_block = 1;
evas_object_layer_set(ec->frame, E_LAYER_MENU + 1);
@ -319,32 +318,32 @@ resize_start(E_Client *ec)
switch (ec->resize_mode)
{
case E_POINTER_RESIZE_TL:
resize_rect[0] = line_add(e_comp->evas);
resize_rect[3] = line_add(e_comp->evas);
resize_rect[0] = line_add(ec->comp->evas);
resize_rect[3] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_T:
resize_rect[0] = line_add(e_comp->evas);
resize_rect[0] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_TR:
resize_rect[0] = line_add(e_comp->evas);
resize_rect[1] = line_add(e_comp->evas);
resize_rect[0] = line_add(ec->comp->evas);
resize_rect[1] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_R:
resize_rect[1] = line_add(e_comp->evas);
resize_rect[1] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_BR:
resize_rect[1] = line_add(e_comp->evas);
resize_rect[2] = line_add(e_comp->evas);
resize_rect[1] = line_add(ec->comp->evas);
resize_rect[2] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_B:
resize_rect[2] = line_add(e_comp->evas);
resize_rect[2] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_BL:
resize_rect[2] = line_add(e_comp->evas);
resize_rect[3] = line_add(e_comp->evas);
resize_rect[2] = line_add(ec->comp->evas);
resize_rect[3] = line_add(ec->comp->evas);
break;
case E_POINTER_RESIZE_L:
resize_rect[3] = line_add(e_comp->evas);
resize_rect[3] = line_add(ec->comp->evas);
break;
default: break;
}
@ -352,7 +351,7 @@ resize_start(E_Client *ec)
if (resize_rect[x])
pulse(NULL, NULL, resize_rect[x]);
resize_text = text_add(e_comp->evas);
resize_text = text_add(ec->comp->evas);
resize_text_update(ec);
}
@ -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);
}

226
src/pip.c
View File

@ -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)
{
@ -38,7 +37,7 @@ pips_noedit()
evas_object_pass_events_set(pip->pip, 1);
}
eina_iterator_free(it);
e_comp_shape_queue();
e_comp_shape_queue(e_comp_get(NULL));
E_FREE_FUNC(action_handler, ecore_event_handler_del);
}
@ -47,11 +46,12 @@ pips_edit(void)
{
Pip *pip;
Eina_Iterator *it;
E_Comp *comp;
if (e_comp->nocomp) return;
comp = e_comp_get(NULL);
if (comp->nocomp) return;
editing = EINA_TRUE;
ds_fade_setup(pips_noedit);
e_comp_grab_input(1, 1);
ds_fade_setup(comp, pips_noedit);
it = eina_hash_iterator_data_new(pips);
EINA_ITERATOR_FOREACH(it, pip)
{
@ -59,87 +59,17 @@ pips_edit(void)
evas_object_pass_events_set(pip->pip, 0);
}
eina_iterator_free(it);
e_comp_shape_queue();
}
static void
_pip_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec = data;
eina_hash_del_by_key(pips, &ec->frame);
if (editing && (!eina_hash_population(pips)))
pips_noedit();
e_comp_shape_queue(comp);
}
static void
pip_free(Pip *pip)
{
evas_object_event_callback_del(pip->pip, EVAS_CALLBACK_DEL, _pip_del);
evas_object_del(pip->pip);
evas_object_del(pip->clip);
free(pip);
}
static void
_pip_resize(Pip *pip, int *ox, int *oy, int *ow, int *oh, Ecore_Event_Mouse_Move *ev)
{
int x, y, w, h;
x = *ox, y = *oy, w = *ow, h = *oh;
if ((pip->resize_mode == E_POINTER_RESIZE_B) ||
(pip->resize_mode == E_POINTER_RESIZE_BL) ||
(pip->resize_mode == E_POINTER_RESIZE_BR))
h = MAX(e_comp_canvas_y_root_adjust(ev->root.y) - y, 5);
else if ((pip->resize_mode == E_POINTER_RESIZE_T) ||
(pip->resize_mode == E_POINTER_RESIZE_TL) ||
(pip->resize_mode == E_POINTER_RESIZE_TR))
{
h = MAX((y + h) - (e_comp_canvas_y_root_adjust(ev->root.y) - pip->down.y), 5);
y = e_comp_canvas_y_root_adjust(ev->root.y) - pip->down.y;
}
if ((pip->resize_mode == E_POINTER_RESIZE_R) ||
(pip->resize_mode == E_POINTER_RESIZE_TR) ||
(pip->resize_mode == E_POINTER_RESIZE_BR))
w = MAX(e_comp_canvas_x_root_adjust(ev->root.x) - x, 5);
else if ((pip->resize_mode == E_POINTER_RESIZE_L) ||
(pip->resize_mode == E_POINTER_RESIZE_TL) ||
(pip->resize_mode == E_POINTER_RESIZE_BL))
{
w = MAX((x + w) - (e_comp_canvas_x_root_adjust(ev->root.x) - pip->down.x), 5);
x = e_comp_canvas_x_root_adjust(ev->root.x) - pip->down.x;
}
{
E_Client *ec;
ec = evas_object_data_get(pip->pip, "E_Client");
switch (pip->resize_mode)
{
case E_POINTER_RESIZE_TL:
case E_POINTER_RESIZE_TR:
case E_POINTER_RESIZE_BR:
case E_POINTER_RESIZE_BL:
if (abs(e_comp_canvas_x_root_adjust(ev->root.x) - pip->down.x) > abs(e_comp_canvas_y_root_adjust(ev->root.y) - pip->down.y))
h = (ec->h * w) / ec->w;
else
w = (ec->w * h) / ec->h;
break;
case E_POINTER_RESIZE_T:
case E_POINTER_RESIZE_B:
w = (ec->w * h) / ec->h;
break;
case E_POINTER_RESIZE_R:
case E_POINTER_RESIZE_L:
h = (ec->h * w) / ec->w;
break;
default: break;
}
}
*ox = x, *oy = y, *ow = w, *oh = h;
}
static Eina_Bool
_pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
{
@ -148,49 +78,78 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
evas_object_geometry_get(pip->pip, &x, &y, &w, &h);
if (pip->resize)
{
_pip_resize(pip, &x, &y, &w, &h, ev);
evas_object_geometry_set(pip->pip, x, y, w, h);
if (pip->clip)
if ((pip->resize_mode == E_POINTER_RESIZE_B) ||
(pip->resize_mode == E_POINTER_RESIZE_BL) ||
(pip->resize_mode == E_POINTER_RESIZE_BR))
h = MAX(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - y, 5);
else if ((pip->resize_mode == E_POINTER_RESIZE_T) ||
(pip->resize_mode == E_POINTER_RESIZE_TL) ||
(pip->resize_mode == E_POINTER_RESIZE_TR))
{
evas_object_geometry_get(pip->clip, &x, &y, &w, &h);
_pip_resize(pip, &x, &y, &w, &h, ev);
evas_object_geometry_set(pip->clip, x, y, w, h);
h = MAX((y + h) - (e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y), 5);
y = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y;
}
if ((pip->resize_mode == E_POINTER_RESIZE_R) ||
(pip->resize_mode == E_POINTER_RESIZE_TR) ||
(pip->resize_mode == E_POINTER_RESIZE_BR))
w = MAX(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - x, 5);
else if ((pip->resize_mode == E_POINTER_RESIZE_L) ||
(pip->resize_mode == E_POINTER_RESIZE_TL) ||
(pip->resize_mode == E_POINTER_RESIZE_BL))
{
w = MAX((x + w) - (e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x), 5);
x = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x;
}
{
E_Client *ec;
ec = evas_object_data_get(pip->pip, "E_Client");
switch (pip->resize_mode)
{
case E_POINTER_RESIZE_TL:
case E_POINTER_RESIZE_TR:
case E_POINTER_RESIZE_BR:
case E_POINTER_RESIZE_BL:
if (abs(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x) > abs(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y))
h = (ec->h * w) / ec->w;
else
w = (ec->w * h) / ec->h;
break;
case E_POINTER_RESIZE_T:
case E_POINTER_RESIZE_B:
w = (ec->w * h) / ec->h;
break;
case E_POINTER_RESIZE_R:
case E_POINTER_RESIZE_L:
h = (ec->h * w) / ec->w;
break;
default: break;
}
}
evas_object_geometry_set(pip->pip, x, y, w, h);
}
else if (pip->move)
{
if (pip->clip)
{
int cx, cy, cw, ch, dx, dy;
evas_object_geometry_get(pip->clip, &cx, &cy, &cw, &ch);
dx = cx - x, dy = cy - y;
evas_object_move(pip->clip,
E_CLAMP(e_comp_canvas_x_root_adjust(ev->root.x) - pip->down.x, 0, e_comp->w - (cw / 2)),
E_CLAMP(e_comp_canvas_y_root_adjust(ev->root.y) - pip->down.y, 0, e_comp->h - (ch / 2)));
evas_object_geometry_get(pip->clip, &cx, &cy, NULL, NULL);
evas_object_move(pip->pip, cx - dx, cy - dy);
}
else
evas_object_move(pip->pip,
E_CLAMP(e_comp_canvas_x_root_adjust(ev->root.x) - pip->down.x, 0, e_comp->w - (w / 2)),
E_CLAMP(e_comp_canvas_y_root_adjust(ev->root.y) - pip->down.y, 0, e_comp->h - (h / 2)));
E_Comp *comp = e_comp_util_evas_object_comp_get(pip->pip);
evas_object_move(pip->pip,
E_CLAMP(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x, 0, comp->man->w - (w / 2)),
E_CLAMP(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y, 0, comp->man->h - (h / 2)));
}
else if (pip->crop)
{
int cx, cy;
if (x + pip->down.x < e_comp_canvas_x_root_adjust(ev->root.x))
if (x + pip->down.x < e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x))
cx = x + pip->down.x;
else
cx = e_comp_canvas_x_root_adjust(ev->root.x);
if (y + pip->down.y < e_comp_canvas_y_root_adjust(ev->root.y))
cx = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x);
if (y + pip->down.y < e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y))
cy = y + pip->down.y;
else
cy = e_comp_canvas_y_root_adjust(ev->root.y);
evas_object_geometry_set(pip->clip, cx, cy, abs(cx - e_comp_canvas_x_root_adjust(ev->root.x)), abs(cy - e_comp_canvas_y_root_adjust(ev->root.y)));
cy = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y);
evas_object_geometry_set(pip->clip, cx, cy, abs(cx - e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x)), abs(cy - e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y)));
}
return ECORE_CALLBACK_RENEW;
}
@ -205,9 +164,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,29 +174,19 @@ _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);
}
}
static void
_pip_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
_pip_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Pip *pip = data;
Evas_Event_Mouse_Up *ev = event_info;
if (pip->crop)
{
int x, y;
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
if ((abs((x + pip->down.x) - ev->output.x) < 3) &&
(abs((y + pip->down.y) - ev->output.y) < 3))
E_FREE_FUNC(pip->clip, evas_object_del);
else
{
evas_object_color_set(pip->clip, 255, 255, 255, 255);
evas_object_clip_set(pip->pip, pip->clip);
}
evas_object_color_set(pip->clip, 255, 255, 255, 255);
evas_object_clip_set(pip->pip, pip->clip);
}
pip->down.x = pip->down.y = 0;
pip->move = pip->resize = pip->crop = 0;
@ -257,7 +206,9 @@ _pip_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
eina_hash_del_by_data(pips, pip);
return;
}
evas_object_geometry_get(obj, &x, &y, &w, &h);
pip->down.x = ev->output.x - x;
pip->down.y = ev->output.y - y;
if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
pip->crop = ev->button == 1;
else if (!evas_key_modifier_is_set(ev->modifiers, "Control"))
@ -265,11 +216,6 @@ _pip_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
pip->move = ev->button == 1;
pip->resize = ev->button == 2;
}
if (pip->clip && (!pip->crop))
obj = pip->clip;
evas_object_geometry_get(obj, &x, &y, &w, &h);
pip->down.x = ev->output.x - x;
pip->down.y = ev->output.y - y;
if (pip->resize)
{
if ((ev->output.x > (x + w / 5)) &&
@ -334,6 +280,15 @@ _pip_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
action_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, (Ecore_Event_Handler_Cb)_pip_mouse_move, pip);
}
static void
_pip_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec = data;
eina_hash_del_by_key(pips, &ec->frame);
if (editing && (!eina_hash_population(pips)))
pips_noedit();
}
static void
_pip_delete(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
{
@ -347,9 +302,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,18 +334,10 @@ _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)
{
evas_object_layer_set(pip->pip, E_LAYER_MENU + 1);
evas_object_pass_events_set(pip->pip, 0);
e_comp_shape_queue();
}
else
pips_edit();
}
static void
@ -433,7 +380,6 @@ _pip_hook(void *d EINA_UNUSED, E_Client *ec)
static void
_pip_action_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
if (!eina_hash_population(pips)) return;
if (editing)
pips_noedit();
else

View File

@ -57,7 +57,7 @@ _edje_custom_setup(Evas_Object *obj, const E_Client *ec, int x, int y, int w, in
static void
_hid(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
{
e_comp_shape_queue();
e_comp_shape_queue(e_comp_util_evas_object_comp_get(obj));
evas_object_hide(obj);
evas_object_del(obj);
}
@ -75,10 +75,10 @@ _zoom_hide(void)
}
else
EINA_LIST_FREE(zoom_objs, zoom_obj)
elm_layout_signal_emit(zoom_obj, "e,state,inactive", "e");
edje_object_signal_emit(zoom_obj, "e,state,inactive", "e");
E_FREE_LIST(handlers, ecore_event_handler_del);
e_comp_ungrab_input(1, 1);
e_comp_shape_queue();
e_comp_ungrab_input(e_comp_get(NULL), 1, 1);
e_comp_shape_queue(e_comp_get(NULL));
current = NULL;
cur_act = NULL;
}
@ -100,26 +100,9 @@ _client_mouse_down(E_Client *ec EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o
}
static void
_client_mouse_out(E_Client *ec EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
_client_mouse_in(E_Client *ec, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Event_Mouse_Up *ev)
{
if (current)
edje_object_signal_emit(evas_object_smart_parent_get(eina_list_data_get(current)), "e,state,inactive", "e");
}
static void
_client_mouse_in(E_Client *ec EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *ev EINA_UNUSED)
{
Eina_List *l;
Evas_Object *zoom_obj, *m;
evas_object_raise(obj);
m = edje_object_part_swallow_get(obj, "e.swallow.client");
if (current && (eina_list_data_get(current) != m))
edje_object_signal_emit(evas_object_smart_parent_get(eina_list_data_get(current)), "e,state,inactive", "e");
zoom_obj = evas_object_data_get(obj, "__DSZOOMOBJ");
l = evas_object_data_get(zoom_obj, "__DSCLIENTS");
current = eina_list_data_find_list(l, m);
edje_object_signal_emit(obj, "e,state,active", "e");
}
static void
@ -134,16 +117,16 @@ _client_mouse_up(E_Client *ec, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
_drag_reset();
return;
}
zone = e_comp_zone_xy_get(ev->output.x, ev->output.y);
zone = e_comp_zone_xy_get(e_comp_get(NULL), ev->output.x, ev->output.y);
desk = e_desk_current_get(zone);
ec->hidden = 0;
e_client_desk_set(ec, desk);
e_client_activate(ec, 1);
evas_object_geometry_get(elm_object_part_content_get(dm_drag, "e.swallow.client"), &x, &y, &w, &h);
_edje_custom_setup(elm_layout_edje_get(dm_drag), ec, x, y, w, h);
evas_object_geometry_get(edje_object_part_swallow_get(dm_drag, "e.swallow.client"), &x, &y, &w, &h);
_edje_custom_setup(dm_drag, ec, x, y, w, h);
elm_layout_signal_emit(dm_drag, "e,drag,release", "e");
edje_object_signal_emit(dm_drag, "e,drag,release", "e");
}
static Eina_Bool
@ -161,29 +144,29 @@ _client_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Mov
/* no adjust, not X coords */
if ((abs(ev->root.x - dx) < DRAG_RESIST) && (abs(ev->root.y - dy) < DRAG_RESIST)) return ECORE_CALLBACK_RENEW;
dm_drag = elm_layout_add(e_comp->elm);
dm_drag = edje_object_add(evas_object_evas_get(dm));
evas_object_pass_events_set(dm_drag, 1);
evas_object_size_hint_min_get(dm, &w, &h);
e_theme_edje_object_set(dm_drag, NULL, "e/modules/desksanity/zoom/client/drag");
elm_layout_signal_callback_add(dm_drag, "e,action,done", "e", _dismiss, NULL);
edje_object_signal_callback_add(dm_drag, "e,action,done", "e", _dismiss, NULL);
evas_object_layer_set(dm_drag, E_LAYER_POPUP);
evas_object_resize(dm_drag, w, h);
m = e_comp_object_util_mirror_add(dm);
e_comp_object_util_del_list_append(dm_drag, m);
evas_object_size_hint_min_set(m, w, h);
elm_object_part_content_set(dm_drag, "e.swallow.client", m);
edje_object_part_swallow(dm_drag, "e.swallow.client", m);
evas_object_show(dm_drag);
EINA_LIST_FOREACH(zoom_objs, l, zoom_obj)
{
elm_layout_signal_emit(zoom_obj, "e,state,dragging", "e");
if (e_comp_object_util_zone_get(zoom_obj) == e_zone_current_get())
elm_layout_signal_emit(zoom_obj, "e,state,current", "e");
edje_object_signal_emit(zoom_obj, "e,state,dragging", "e");
if (e_comp_object_util_zone_get(zoom_obj) == e_zone_current_get(e_comp_util_evas_object_comp_get(zoom_obj)))
edje_object_signal_emit(zoom_obj, "e,state,current", "e");
}
}
evas_object_move(dm_drag,
e_comp_canvas_x_root_adjust(ev->root.x) - (dx - x),
e_comp_canvas_y_root_adjust(ev->root.y) - (dy - y));
e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - (dx - x),
e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - (dy - y));
return ECORE_CALLBACK_RENEW;
}
@ -194,6 +177,12 @@ _client_activate(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_
_zoom_hide();
}
static void
_client_active(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
{
evas_object_raise(obj);
}
static void
_zoomobj_pack_client(const E_Client *ec, const E_Zone *zone, Evas_Object *tb, Evas_Object *m, unsigned int id, unsigned int cols)
{
@ -217,8 +206,8 @@ _zoomobj_pack_client(const E_Client *ec, const E_Zone *zone, Evas_Object *tb, Ev
r = (id - 1) / cols;
c = (id - 1) % cols;
evas_object_size_hint_min_set(e, zmw + w, zmh + h);
elm_table_pack(tb, e, c, r, 1, 1);
e_table_pack(tb, e, c, r, 1, 1);
e_table_pack_options_set(e, 0, 0, 0, 0, 0.5, 0.5, zmw + w, zmh + h, 9999, 9999);
}
static void
@ -228,31 +217,31 @@ _zoomobj_add_client(Evas_Object *zoom_obj, Eina_List *l, Evas_Object *m)
Evas_Object *ic, *e;
ec = evas_object_data_get(m, "E_Client");
e = elm_layout_add(e_comp->elm);
evas_object_data_set(elm_layout_edje_get(e), "__DSZOOMOBJ", zoom_obj);
e = edje_object_add(ec->comp->evas);
evas_object_data_set(e, "__DSZOOMOBJ", zoom_obj);
e_comp_object_util_del_list_append(zoom_obj, e);
e_comp_object_util_del_list_append(zoom_obj, m);
e_theme_edje_object_set(e, NULL, "e/modules/desksanity/zoom/client");
evas_object_event_callback_add(elm_layout_edje_get(e), EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_client_mouse_down, ec);
evas_object_event_callback_add(elm_layout_edje_get(e), EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_client_mouse_up, ec);
evas_object_event_callback_add(elm_layout_edje_get(e), EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_client_mouse_in, ec);
evas_object_event_callback_add(elm_layout_edje_get(e), EVAS_CALLBACK_MOUSE_OUT, (Evas_Object_Event_Cb)_client_mouse_out, ec);
evas_object_event_callback_add(e, EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_client_mouse_down, ec);
evas_object_event_callback_add(e, EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_client_mouse_up, ec);
evas_object_event_callback_add(e, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_client_mouse_in, ec);
if ((!zmw) && (!zmh))
edje_object_size_min_calc(elm_layout_edje_get(e), &zmw, &zmh);
elm_layout_signal_callback_add(e, "e,action,activate", "e", _client_activate, ec);
edje_object_size_min_calc(e, &zmw, &zmh);
edje_object_signal_callback_add(e, "e,action,activate", "e", _client_activate, ec);
edje_object_signal_callback_add(e, "e,state,active", "e", _client_active, ec);
if (e_client_focused_get() == ec)
{
elm_layout_signal_emit(e, "e,state,focused", "e");
edje_object_signal_emit(e, "e,state,focused", "e");
current = l;
}
elm_object_part_content_set(e, "e.swallow.client", m);
elm_object_part_text_set(e, "e.text.title", e_client_util_name_get(ec));
edje_object_part_swallow(e, "e.swallow.client", m);
edje_object_part_text_set(e, "e.text.title", e_client_util_name_get(ec));
if (ec->urgent)
elm_layout_signal_emit(e, "e,state,urgent", "e");
ic = e_client_icon_add(ec, e_comp->evas);
edje_object_signal_emit(e, "e,state,urgent", "e");
ic = e_client_icon_add(ec, ec->comp->evas);
if (ic)
{
elm_object_part_content_set(e, "e.swallow.icon", ic);
edje_object_part_swallow(e, "e.swallow.icon", ic);
e_comp_object_util_del_list_append(zoom_obj, ic);
}
evas_object_show(e);
@ -267,8 +256,7 @@ _zoomobj_position_client(Evas_Object *m)
e = evas_object_smart_parent_get(m);
ec = evas_object_data_get(m, "E_Client");
evas_object_geometry_get(e, &x, &y, NULL, NULL);
evas_object_size_hint_min_get(e, &w, &h);
evas_object_geometry_get(e, &x, &y, &w, &h);
_edje_custom_setup(e, ec, x, y, w, h);
edje_object_signal_emit(e, "e,action,show", "e");
}
@ -281,29 +269,16 @@ _zoom_key(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
if (!e_util_strcmp(ev->key, "Escape"))
_zoom_hide();
else if (!e_util_strcmp(ev->key, "Left"))
{
if (current)
n = eina_list_prev(current) ?: eina_list_last(current);
else
{
n = evas_object_data_get(eina_list_nth(zoom_objs, e_zone_current_get()->num), "__DSCLIENTS");
n = eina_list_last(n);
}
}
n = eina_list_prev(current) ?: eina_list_last(current);
else if (!e_util_strcmp(ev->key, "Right"))
{
if (current)
n = eina_list_next(current);
if (!n)
{
n = eina_list_next(current);
if (!n)
{
Eina_List *f;
Eina_List *f;
for (f = n = current; f; n = f, f = eina_list_prev(f));
}
for (f = n = current; f; n = f, f = eina_list_prev(f));
}
else
n = evas_object_data_get(eina_list_nth(zoom_objs, e_zone_current_get()->num), "__DSCLIENTS");
}
else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
{
@ -318,13 +293,13 @@ _zoom_key(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
E_Zone *zone;
e = evas_object_smart_parent_get(eina_list_data_get(n));
edje_object_signal_emit(e, "e,state,active", "e");
edje_object_signal_emit(evas_object_smart_parent_get(eina_list_data_get(current)), "e,state,inactive", "e");
edje_object_signal_emit(e, "e,state,focused", "e");
edje_object_signal_emit(evas_object_smart_parent_get(eina_list_data_get(current)), "e,state,unfocused", "e");
current = n;
evas_object_geometry_get(e, &x, &y, &w, &h);
scr = elm_object_part_content_get(evas_object_data_get(e, "__DSZOOMOBJ"), "e.swallow.layout");
scr = edje_object_part_swallow_get(evas_object_data_get(e, "__DSZOOMOBJ"), "e.swallow.layout");
zone = e_comp_object_util_zone_get(scr);
elm_scroller_region_bring_in(scr, x - zone->x, y - zone->y, w, h);
e_scrollframe_child_region_show(scr, x - zone->x, y - zone->y, w, h);
}
return ECORE_CALLBACK_DONE;
}
@ -334,23 +309,25 @@ _relayout(Evas_Object *zoom_obj, Evas_Object *scr, Evas_Object *tb)
{
Eina_List *l, *clients;
Evas_Object *m;
int tw, th;
unsigned int id = 1;
clients = evas_object_data_get(zoom_obj, "__DSCLIENTS");
e_comp_object_util_del_list_remove(zoom_obj, tb);
evas_object_del(tb);
tb = elm_table_add(e_comp->elm);
E_EXPAND(tb);
E_FILL(tb);
tb = e_table_add(evas_object_evas_get(zoom_obj));
e_comp_object_util_del_list_append(zoom_obj, tb);
elm_table_homogeneous_set(tb, 1);
e_table_homogenous_set(tb, 1);
e_table_freeze(tb);
EINA_LIST_FOREACH(clients, l, m)
_zoomobj_pack_client(evas_object_data_get(m, "E_Client"),
e_comp_object_util_zone_get(zoom_obj), tb, m, id++,
_cols_calc(eina_list_count(clients)));
elm_object_content_set(scr, tb);
evas_object_smart_need_recalculate_set(tb, 1);
evas_object_smart_calculate(tb);
e_table_thaw(tb);
e_table_size_min_get(tb, &tw, &th);
evas_object_size_hint_min_set(tb, tw, th);
evas_object_resize(tb, tw, th);
e_scrollframe_child_set(scr, tb);
E_LIST_FOREACH(clients, _zoomobj_position_client);
}
@ -368,8 +345,8 @@ _zoom_client_add_post(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *e
if (!m) return;
clients = evas_object_data_get(data, "__DSCLIENTS");
clients = eina_list_append(clients, m);
scr = elm_object_part_content_get(data, "e.swallow.layout");
tb = elm_object_content_get(scr);
scr = edje_object_part_swallow_get(data, "e.swallow.layout");
tb = e_pan_child_get(edje_object_part_swallow_get(e_scrollframe_edje_object_get(scr), "e.swallow.content"));
c = _cols_calc(eina_list_count(clients));
pc = _cols_calc(eina_list_count(clients) - 1);
_zoomobj_add_client(data, eina_list_last(clients), m);
@ -391,7 +368,7 @@ _zoom_client_add(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
if (e_client_util_ignored_get(ev->ec)) return ECORE_CALLBACK_RENEW;
if (ev->ec->iconic && (!e_config->winlist_list_show_iconified)) return ECORE_CALLBACK_RENEW;
if (((cur_act == act_zoom_zone) || (cur_act == act_zoom_desk)) &&
(ev->ec->zone != e_zone_current_get())) return ECORE_CALLBACK_RENEW;
(ev->ec->zone != e_zone_current_get(ev->ec->comp))) return ECORE_CALLBACK_RENEW;
if (((cur_act == act_zoom_desk) || (cur_act == act_zoom_desk_all)) &&
(!ev->ec->desk->visible)) return ECORE_CALLBACK_RENEW;
@ -427,15 +404,16 @@ _zoom_client_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
e = evas_object_smart_parent_get(m);
e_comp_object_util_del_list_remove(zoom_obj, m);
e_comp_object_util_del_list_remove(zoom_obj, e);
ic = elm_object_part_content_get(e, "e.swallow.icon");
ic = edje_object_part_swallow_get(e, "e.swallow.icon");
e_comp_object_util_del_list_remove(zoom_obj, ic);
evas_object_del(ic);
evas_object_data_set(zoom_obj, "__DSCLIENTS", eina_list_remove_list(clients, ll));
e_table_unpack(e);
evas_object_del(ic);
evas_object_del(e);
evas_object_del(m);
scr = elm_object_part_content_get(zoom_obj, "e.swallow.layout");
tb = elm_object_content_get(scr);
scr = edje_object_part_swallow_get(zoom_obj, "e.swallow.layout");
tb = e_pan_child_get(edje_object_part_swallow_get(e_scrollframe_edje_object_get(scr), "e.swallow.content"));
_relayout(zoom_obj, scr, tb);
return ECORE_CALLBACK_RENEW;
}
@ -474,13 +452,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");
}
}
@ -488,15 +465,17 @@ _hiding(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, c
static void
zoom(Eina_List *clients, E_Zone *zone)
{
E_Comp *comp = zone->comp;
Evas_Object *m, *bg_obj, *scr, *tb, *zoom_obj;
unsigned int cols, id = 1;
int tw, th;
Eina_Stringshare *bgf;
Eina_List *l;
if (!zoom_objs)
{
e_comp_shape_queue();
e_comp_grab_input(1, 1);
e_comp_shape_queue(comp);
e_comp_grab_input(comp, 1, 1);
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _zoom_key, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY, _zoom_client_property, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ADD, _zoom_client_add, NULL);
@ -504,52 +483,53 @@ zoom(Eina_List *clients, E_Zone *zone)
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE, _client_mouse_move, NULL);
}
zoom_obj = elm_layout_add(e_comp->elm);
elm_layout_signal_callback_add(zoom_obj, "e,state,hiding", "e", _hiding, NULL);
elm_layout_signal_callback_add(zoom_obj, "e,action,dismiss", "e", _dismiss, NULL);
elm_layout_signal_callback_add(zoom_obj, "e,action,done", "e", _hid, NULL);
zoom_obj = edje_object_add(comp->evas);
edje_object_signal_callback_add(zoom_obj, "e,state,hiding", "e", _hiding, NULL);
edje_object_signal_callback_add(zoom_obj, "e,action,dismiss", "e", _dismiss, NULL);
edje_object_signal_callback_add(zoom_obj, "e,action,done", "e", _hid, NULL);
evas_object_geometry_set(zoom_obj, zone->x, zone->y, zone->w, zone->h);
evas_object_layer_set(zoom_obj, E_LAYER_POPUP);
e_theme_edje_object_set(zoom_obj, NULL, "e/modules/desksanity/zoom/base");
bg_obj = e_icon_add(e_comp->evas);
bgf = e_bg_file_get(zone->num, zone->desk_x_current, zone->desk_y_current);
bg_obj = e_icon_add(comp->evas);
bgf = e_bg_file_get(comp->man->num, zone->num, zone->desk_x_current, zone->desk_y_current);
if (eina_str_has_extension(bgf, ".edj"))
e_icon_file_edje_set(bg_obj, bgf, "e/desktop/background");
else
e_icon_file_set(bg_obj, bgf);
eina_stringshare_del(bgf);
e_comp_object_util_del_list_append(zoom_obj, bg_obj);
elm_object_part_content_set(zoom_obj, "e.swallow.background", bg_obj);
edje_object_part_swallow(zoom_obj, "e.swallow.background", bg_obj);
scr = elm_scroller_add(zoom_obj);
e_theme_edje_object_set(scr, NULL, "e/modules/desksanity/zoom/scrollframe");
elm_object_part_content_set(zoom_obj, "e.swallow.layout", scr);
scr = e_scrollframe_add(comp->evas);
e_comp_object_util_del_list_append(zoom_obj, scr);
e_scrollframe_custom_theme_set(scr, NULL, "e/modules/desksanity/zoom/scrollframe");
edje_object_part_swallow(zoom_obj, "e.swallow.layout", scr);
tb = elm_table_add(scr);
E_EXPAND(tb);
E_FILL(tb);
elm_table_homogeneous_set(tb, 1);
evas_object_show(tb);
tb = e_table_add(comp->evas);
e_comp_object_util_del_list_append(zoom_obj, tb);
e_table_homogenous_set(tb, 1);
evas_object_show(zoom_obj);
cols = _cols_calc(eina_list_count(clients));
e_table_freeze(tb);
EINA_LIST_FOREACH(clients, l, m)
{
_zoomobj_add_client(zoom_obj, l, m);
_zoomobj_pack_client(evas_object_data_get(m, "E_Client"), zone, tb, m, id++, cols);
}
evas_object_geometry_set(tb, zone->x, zone->y, zone->w, zone->h);
evas_object_smart_need_recalculate_set(tb, 1);
evas_object_smart_calculate(tb);
elm_layout_signal_emit(zoom_obj, "e,state,active", "e");
e_table_thaw(tb);
e_table_size_min_get(tb, &tw, &th);
evas_object_size_hint_min_set(tb, tw, th);
evas_object_resize(tb, tw, th);
e_scrollframe_child_set(scr, tb);
edje_object_signal_emit(zoom_obj, "e,state,active", "e");
E_LIST_FOREACH(clients, _zoomobj_position_client);
evas_object_data_set(zoom_obj, "__DSCLIENTS", clients);
elm_object_content_set(scr, tb);
zoom_objs = eina_list_append(zoom_objs, zoom_obj);
}
@ -604,18 +584,19 @@ _zoom_desk_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
ZOOM_CHECK;
cur_act = act_zoom_desk;
_zoom_begin(_filter_desk, e_zone_current_get());
_zoom_begin(_filter_desk, e_zone_current_get(e_comp_get(NULL)));
}
static void
_zoom_desk_all_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
E_Comp *comp = e_comp_get(NULL);
E_Zone *zone;
Eina_List *l;
ZOOM_CHECK;
cur_act = act_zoom_desk_all;
EINA_LIST_FOREACH(e_comp->zones, l, zone)
EINA_LIST_FOREACH(comp->zones, l, zone)
_zoom_begin(_filter_desk_all, zone);
}
@ -624,18 +605,19 @@ _zoom_zone_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
ZOOM_CHECK;
cur_act = act_zoom_zone;
_zoom_begin(_filter_zone, e_zone_current_get());
_zoom_begin(_filter_zone, e_zone_current_get(e_comp_get(NULL)));
}
static void
_zoom_zone_all_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
{
E_Comp *comp = e_comp_get(NULL);
E_Zone *zone;
Eina_List *l;
ZOOM_CHECK;
cur_act = act_zoom_zone_all;
EINA_LIST_FOREACH(e_comp->zones, l, zone)
EINA_LIST_FOREACH(comp->zones, l, zone)
_zoom_begin(_filter_zone, zone);
}

BIN
win_shadow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B