Compare commits

..

9 Commits

Author SHA1 Message Date
Mike Blumenkrantz 4141a1e316 update news, bump version 7 years ago
Mike Blumenkrantz 38103c2b95 use correct int size for ds effect iterating 7 years ago
Mike Blumenkrantz a25d7a4262 update news, bump version 7 years ago
Mike Blumenkrantz c20689c6ed switch bzip2->xz in dist 7 years ago
Mike Blumenkrantz dc35b11619 reorder ds client iterator filter to catch override clients before ec->desk deref 7 years ago
Mike Blumenkrantz 44fa419a8c update news, bump version 8 years ago
Mike Blumenkrantz 02d437cd71 fix multiscreen zoom and current desks zoom 8 years ago
Mike Blumenkrantz 23e24c568f fix input regions on shaded clients after desk flip 8 years ago
Mike Blumenkrantz eb9a4f1833 raise client zoom obj on mouse in 8 years ago
  1. 3
      .gitignore
  2. 18
      Makefile.am
  3. 48
      NEWS
  4. 77
      action_route.xml
  5. 27
      configure.ac
  6. 38
      e-gadget.xml
  7. 504
      e-module-desksanity.edc
  8. BIN
      e-module-desksanity.edj
  9. BIN
      epic-e-256.png
  10. 182
      loader/start.c
  11. 5
      loader/start.desktop.in
  12. 121
      loader/test.c
  13. 4
      loader/test.desktop.in
  14. 182
      meson.build
  15. 6
      meson_modules.sh
  16. 0
      module.desktop.in
  17. 27
      src/Makefile.am
  18. 24
      src/Makefile.mk
  19. 75
      src/desksanity.c
  20. 7
      src/ds_config.c
  21. 219
      src/e_mod_main.c
  22. 8
      src/e_mod_main.h
  23. 30
      src/magnify.c
  24. 20
      src/maximize.c
  25. 99
      src/moveresize.c
  26. 226
      src/pip.c
  27. 212
      src/zoom.c
  28. BIN
      win_shadow.png

3
.gitignore vendored

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

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

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

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

@ -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
], [
])

@ -1,38 +0,0 @@
<protocol name="e_gadget">
<interface name="e_gadget" version="1">
<enum name="orient">
<entry name="none" value="0"/>
<entry name="horizontal" value="1"/>
<entry name="vertical" value="2"/>
</enum>
<enum name="gravity">
<entry name="none" value="0"/>
<entry name="left" value="1"/>
<entry name="right" value="2"/>
<entry name="top" value="3"/>
<entry name="bottom" value="4"/>
<entry name="center" value="5"/>
</enum>
<enum name="anchor" bitfield="true">
<entry name="none" value="0"/>
<entry name="left" value="1"/>
<entry name="right" value="2"/>
<entry name="top" value="4"/>
<entry name="bottom" value="8"/>
</enum>
<event name="gadget_anchor">
<arg name="anchor" type="uint" enum="anchor"/>
</event>
<event name="gadget_orient">
<arg name="orient" type="uint" enum="orient"/>
</event>
<event name="gadget_gravity">
<arg name="gravity" type="uint" enum="gravity"/>
</event>
<request name="open_uri">
<arg name="uri" type="string"/>
</request>
</interface>
</protocol>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

@ -1,182 +0,0 @@
#include <Elementary.h>
#include <e_gadget_types.h>
static E_Gadget_Site_Orient gorient;
static E_Gadget_Site_Anchor ganchor;
static char *menu_action;
static void
do_orient(Evas_Object *ly, E_Gadget_Site_Orient orient, E_Gadget_Site_Anchor anchor)
{
char buf[4096];
const char *s = "float";
if (anchor & E_GADGET_SITE_ANCHOR_LEFT)
{
if (anchor & E_GADGET_SITE_ANCHOR_TOP)
{
switch (orient)
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
s = "top_left";
break;
case E_GADGET_SITE_ORIENT_VERTICAL:
s = "left_top";
break;
case E_GADGET_SITE_ORIENT_NONE:
s = "left_top";
break;
}
}
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
{
switch (orient)
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
s = "bottom_left";
break;
case E_GADGET_SITE_ORIENT_VERTICAL:
s = "left_bottom";
break;
case E_GADGET_SITE_ORIENT_NONE:
s = "left_bottom";
break;
}
}
else
s = "left";
}
else if (anchor & E_GADGET_SITE_ANCHOR_RIGHT)
{
if (anchor & E_GADGET_SITE_ANCHOR_TOP)
{
switch (orient)
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
s = "top_right";
break;
case E_GADGET_SITE_ORIENT_VERTICAL:
s = "right_top";
break;
case E_GADGET_SITE_ORIENT_NONE:
s = "right_top";
break;
}
}
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
{
switch (orient)
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
s = "bottom_right";
break;
case E_GADGET_SITE_ORIENT_VERTICAL:
s = "right_bottom";
break;
case E_GADGET_SITE_ORIENT_NONE:
s = "right_bottom";
break;
}
}
else
s = "right";
}
else if (anchor & E_GADGET_SITE_ANCHOR_TOP)
s = "top";
else if (anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
s = "bottom";
else
{
switch (orient)
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
s = "horizontal";
break;
case E_GADGET_SITE_ORIENT_VERTICAL:
s = "vertical";
break;
default: break;
}
}
snprintf(buf, sizeof(buf), "e,state,orientation,%s", s);
elm_layout_signal_emit(ly, buf, "e");
}
static void
_menu_cb_post(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
if (eina_streq(event_info, menu_action))
elm_layout_signal_emit(data, "e,state,unfocused", "e");
}
static void
_button_cb_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (!menu_action) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
evas_object_smart_callback_call(elm_win_get(obj), menu_action, "main");
elm_layout_signal_emit(obj, "e,state,focused", "e");
}
static void
anchor_change(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
ganchor = (uintptr_t)event_info;
do_orient(data, gorient, ganchor);
}
static void
orient_change(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
gorient = (uintptr_t)event_info;
do_orient(data, gorient, ganchor);
}
static void
action_deleted(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
if (eina_streq(menu_action, event_info))
{
free(menu_action);
menu_action = NULL;
}
}
static void
action_return(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
fprintf(stderr, "AR RETURN: %s\n", (char*)event_info);
menu_action = eina_strdup(event_info);
}
int
main(int argc, char *argv[])
{
Evas_Object *win, *ly;
elm_init(argc, (char**)argv);
win = elm_win_add(NULL, "start", ELM_WIN_BASIC);
elm_win_autodel_set(win, 1);
elm_win_alpha_set(win, 1);
ly = elm_layout_add(win);
evas_object_size_hint_min_set(win, 100, 100);
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
elm_layout_file_set(ly,
elm_theme_group_path_find(NULL, "e/gadget/start/main"), "e/gadget/start/main");
elm_win_resize_object_add(win, ly);
evas_object_show(ly);
evas_object_smart_callback_add(win, "gadget_site_anchor", anchor_change, ly);
evas_object_smart_callback_add(win, "gadget_site_orient", orient_change, ly);
evas_object_smart_callback_add(win, "gadget_action", action_return, NULL);
evas_object_smart_callback_add(win, "gadget_action_end", _menu_cb_post, ly);
evas_object_smart_callback_add(win, "gadget_action_deleted", action_deleted, NULL);
evas_object_event_callback_add(ly, EVAS_CALLBACK_MOUSE_DOWN, _button_cb_mouse_down, NULL);
evas_object_smart_callback_call(win, "gadget_action_request", "menu_show_object");
evas_object_show(win);
ecore_main_loop_begin();
return 0;
}

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

@ -1,121 +0,0 @@
#include <Elementary.h>
static Evas_Object *popup;
static Evas_Object *child;
static void
popup_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
popup = NULL;
}
static void
child_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
child = NULL;
}
static void
popup_unfocus(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
evas_object_del(obj);
}
static void
mouse_button(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
{
Evas_Object *ic;
Evas_Event_Mouse_Down *ev = event_info;
char buf[PATH_MAX];
int w, h;
Evas_Object *win;
Elm_Win_Type type = ELM_WIN_POPUP_MENU;
if ((ev->button != 1) && (ev->button != 3)) return;
if (ev->button == 3)
{
type = ELM_WIN_BASIC;
if (child)
{
evas_object_del(child);
return;
}
}
else
{
if (popup)
{
evas_object_del(popup);
return;
}
}
win = elm_win_add(elm_win_get(obj), "win", type);
elm_win_alpha_set(win, 1);
if (ev->button == 3)
{
child = win;
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, child_del, NULL);
}
else
{
popup = win;
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, popup_del, NULL);
}
if (ev->button == 3)
evas_object_event_callback_add(win, EVAS_CALLBACK_FOCUS_OUT, popup_unfocus, NULL);
ic = elm_icon_add(win);
snprintf(buf, sizeof(buf), "%s/images/bubble.png", elm_app_data_dir_get());
elm_image_file_set(ic, buf, NULL);
elm_image_object_size_get(ic, &w, &h);
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, w, h);
if (ev->button == 1)
{
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
elm_image_no_scale_set(ic, EINA_TRUE);
}
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(ic, 0.5, 0.5);
evas_object_size_hint_min_set(ic, 100, 100);
elm_win_resize_object_add(win, ic);
evas_object_show(ic);
evas_object_show(win);
}
int
main(int argc, char *argv[])
{
Evas_Object *win, *ic;
char buf[PATH_MAX];
int w, h;
elm_init(argc, (char**)argv);
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_app_info_set(main, "elementary", "images/logo.png");
win = elm_win_add(NULL, "icon-transparent", ELM_WIN_BASIC);
elm_win_title_set(win, "Icon Transparent");
elm_win_autodel_set(win, EINA_TRUE);
elm_win_alpha_set(win, EINA_TRUE);
ic = elm_icon_add(win);
elm_object_tooltip_text_set(ic, "this is some test text which is probably going to be a lot longer than the overall icon size haHAA");
elm_object_tooltip_window_mode_set(ic, 1);
snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
elm_image_file_set(ic, buf, NULL);
elm_image_object_size_get(ic, &w, &h);
evas_object_size_hint_aspect_set(win, EVAS_ASPECT_CONTROL_BOTH, w, h);
if (argc > 1)
{
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
elm_image_no_scale_set(ic, EINA_TRUE);
}
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(ic, 0.5, 0.5);
evas_object_size_hint_min_set(ic, 100, 100);
elm_win_resize_object_add(win, ic);
evas_object_show(ic);
evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_DOWN, mouse_button, NULL);
evas_object_show(win);
ecore_main_loop_begin();
return 0;
}

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

@ -1,182 +0,0 @@
project('desksanity', 'c',
version: '1.1.99',
license: 'BSD 2 clause',
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version: '>= 0.40.0')
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
dir_prefix = get_option('prefix')
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_sysconf = get_option('sysconfdir')
dir_data = join_paths(dir_prefix, get_option('datadir'))
dir_include = join_paths(dir_prefix, get_option('includedir'))
dir_include_e = join_paths(dir_include, meson.project_name())
dir_lib = join_paths(dir_prefix, get_option('libdir'))
pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')
# disable for release builds
dev_cflags = []
dev_cflags_try = [
'-Wall',
'-W',
'-Wpointer-arith',
'-Wshadow',
'-Wno-missing-field-initializers',
'-Wfloat-equal',
'-Wuninitialized',
'-Wundef',
'-Wcast-align',
'-Wformat=2',
'-Wno-format-y2k',
]
foreach cf: dev_cflags_try
if cc.has_argument(cf) == true
dev_cflags += cf
endif
endforeach
add_global_arguments(dev_cflags, language: 'c')
dep_e = dependency('enlightenment')
release = dep_e.get_pkgconfig_variable('release')
host_os = host_machine.system()
if host_os == 'linux'
if cc.has_header_symbol('features.h', '__UCLIBC__')
host_os = 'linux-uclibc'
elif cc.has_header_symbol('features.h', '__dietlibc__')
host_os = 'linux-dietlibc'
else
host_os = 'linux-gnu'
endif
endif
module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
config_h = configuration_data()
config_h.set('_GNU_SOURCE', '1')
config_h.set('_ALL_SOURCE', '1')
config_h.set('_POSIX_PTHREAD_SEMANTICS', '1')
config_h.set('_TANDEM_SOURCE', '1')
config_h.set('__EXTENSIONS__', '1')
config_h.set_quoted('MODULE_ARCH', module_arch)
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('VERSION', meson.project_version())
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('BINDIR', dir_bin)
config_h.set_quoted('DATADIR', dir_data)
if cc.has_function('setenv') == true
config_h.set('HAVE_SETENV', '1')
endif
if cc.has_function('unsetenv') == true
config_h.set('HAVE_UNSETENV', '1')
endif
if cc.has_function('clearenv') == true
config_h.set('HAVE_CLEARENV', '1')
endif
if cc.has_header('features.h') == true
config_h.set('HAVE_FEATURES_H', '1')
endif
if cc.has_header('sys/ptrace.h') == true
config_h.set('HAVE_SYS_PTRACE_H', '1')
endif
if cc.has_header('arpa/inet.h') == true
config_h.set('HAVE_ARPA_INET_H', '1')
endif
if cc.has_header('netinet/in.h') == true
config_h.set('HAVE_NETINET_IN_H', '1')
endif
if cc.has_header('execinfo.h') == true
config_h.set('HAVE_EXECINFO_H', '1')
elif cc.has_function('backtrace_symbols_fd', dependencies: 'execinfo') == false
execinfo_dep = dependency('execinfo', required: false)
endif
if cc.has_header('fnmatch.h') == false
error('fnmatch.h not found')
endif
if cc.has_function('fnmatch') == false
dep_fnmatch = dependency('fnmatch', required: true)
endif
add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c')
add_global_arguments('-DPACKAGE_LIB_DIR="@0@"'.format(dir_lib), language: 'c')
add_global_arguments('-DPACKAGE_DATA_DIR="@0@"'.format(join_paths(dir_data, meson.project_name())), language: 'c')
add_global_arguments('-DPACKAGE_SYSCONF_DIR="@0@"'.format(dir_sysconf), language: 'c')
dep_efl_wl = dependency('efl-wl', required: false)
dir_module_e = join_paths([dep_e.get_pkgconfig_variable('modules'), 'desksanity'])
edje_cc = find_program('edje_cc')
install_data(['e-module-desksanity.edj', 'module.desktop'],
install_dir: dir_module_e,
install_mode: 'rw-rw-r--')
build_files = [
'src/e_mod_main.h',
'src/e_mod_main.c',
'src/ds_config.c',
'src/maximize.c',
'src/moveresize.c',
'src/pip.c',
'src/zoom.c',
'src/magnify.c',
'src/desksanity.c'
]
if dep_efl_wl.found() == true and dep_e.get_pkgconfig_variable('wayland') == 'true'
config_h.set('HAVE_RUNNER', '1')
dir_gadgets = join_paths([dir_lib, 'enlightenment/gadgets', module_arch])
executable('e_gadget_start',
'loader/start.c',
c_args: '-fPIE',
link_args: '-fPIE',
dependencies: [dependency('elementary'), dependency('enlightenment')],
install_dir: join_paths([dir_gadgets, 'start']),
install: true)
executable('e_gadget_test',
'loader/test.c',
c_args: '-fPIE',
link_args: '-fPIE',
dependencies: dependency('elementary'),
install_dir: join_paths([dir_gadgets, 'test']),
install: true)
config_h.set_quoted('GADGET_DIR', dir_gadgets)
desktop_data = configuration_data()
desktop_data.set('GADGET_DIR', dir_gadgets)
configure_file(input: 'loader/test.desktop.in',
output: 'test.desktop',
install: true,
install_dir: join_paths([dir_gadgets, 'test']),
configuration: desktop_data)
configure_file(input: 'loader/start.desktop.in',
output: 'start.desktop',
install: true,
install_dir: join_paths([dir_gadgets, 'start']),
configuration: desktop_data)
endif
configure_file(output: 'config.h',
install: false,
configuration: config_h)
shared_module('desksanity', build_files,
include_directories: include_directories(['src']),
name_prefix: '',
dependencies: [dep_e, dep_efl_wl],
install_dir: join_paths([dir_module_e, module_arch]),
install: true)
meson.add_install_script('meson_modules.sh', join_paths([dir_module_e, module_arch, 'desksanity.so']))

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

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

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

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