edge and corner binding infrastructure. If you have an old config, enable the conf_edgebindings module and hit 'Reset to defaults' to get edge desktop switching.

The edge/corner picker needs some love from someone who is not artistically challenged.  And a proper module icon as well.


SVN revision: 39220
This commit is contained in:
Viktor Kojouharov 2009-02-25 22:21:46 +00:00
parent 5b0166b41e
commit 9bbc8158bd
31 changed files with 2695 additions and 580 deletions

View File

@ -10,6 +10,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 4096;
value "font_cache" int: 512;
value "edje_cache" int: 10;
@ -19,8 +20,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 0;
value "edge_flip_moving" int: 0;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;

View File

@ -10,6 +10,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 2048;
value "font_cache" int: 512;
value "edje_cache" int: 8;
@ -19,8 +20,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 0;
value "edge_flip_dragging" int: 0;
value "edge_flip_moving" int: 0;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;

View File

@ -11,6 +11,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 4096;
value "font_cache" int: 512;
value "edje_cache" int: 32;
@ -20,8 +21,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "edge_flip_moving" int: 1;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;
@ -266,6 +265,14 @@ group "E_Config" struct {
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_edgebindings";
value "enabled" uchar: 1;
value "delayed" uchar: 1;
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_profiles";
@ -907,6 +914,46 @@ group "E_Config" struct {
value "any_mod" uchar: 0;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 1;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 2;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 3;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 4;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "signal_bindings" list {
group "E_Config_Binding_Signal" struct {
value "context" int: 2;

View File

@ -11,6 +11,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 4096;
value "font_cache" int: 512;
value "edje_cache" int: 32;
@ -20,8 +21,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "edge_flip_moving" int: 1;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;
@ -298,6 +297,14 @@ group "E_Config" struct {
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_edgebindings";
value "enabled" uchar: 1;
value "delayed" uchar: 1;
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_profiles";
@ -971,6 +978,46 @@ group "E_Config" struct {
value "any_mod" uchar: 0;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 1;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 2;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 3;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 4;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "signal_bindings" list {
group "E_Config_Binding_Signal" struct {
value "context" int: 2;

View File

@ -10,6 +10,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 4096;
value "font_cache" int: 512;
value "edje_cache" int: 32;
@ -19,8 +20,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "edge_flip_moving" int: 1;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;
@ -177,6 +176,14 @@ group "E_Config" struct {
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_edgebindings";
value "enabled" uchar: 1;
value "delayed" uchar: 1;
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_paths";
@ -994,6 +1001,46 @@ group "E_Config" struct {
value "any_mod" uchar: 0;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 1;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 2;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 3;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 4;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "signal_bindings" list {
group "E_Config_Binding_Signal" struct {
value "context" int: 2;

View File

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65836;
value "config_version" int: 65837;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i";
@ -10,6 +10,7 @@ group "E_Config" struct {
value "border_shade_transition" int: 3;
value "border_shade_speed" double: 3000.0000000000000000000000000;
value "framerate" double: 30.0000000000000000000000000;
value "priority" int: 1;
value "image_cache" int: 4096;
value "font_cache" int: 512;
value "edje_cache" int: 32;
@ -19,8 +20,6 @@ group "E_Config" struct {
value "use_virtual_roots" int: 0;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "edge_flip_moving" int: 1;
value "edge_flip_timeout" double: 0.2500000000000000000000000;
value "evas_engine_default" int: 1;
value "evas_engine_container" int: 0;
value "evas_engine_init" int: 0;
@ -177,6 +176,14 @@ group "E_Config" struct {
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_edgebindings";
value "enabled" uchar: 1;
value "delayed" uchar: 1;
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "conf_paths";
@ -994,6 +1001,56 @@ group "E_Config" struct {
value "any_mod" uchar: 0;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 1;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 2;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 3;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_flip_in_direction";
value "edge" uchar: 4;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "edge_bindings" list {
group "E_Config_Binding_Edge" struct {
value "context" int: 3;
value "modifiers" int: 0;
value "action" string: "desk_deskshow_toggle";
value "edge" uchar: 6;
value "any_mod" uchar: 0;
value "delay" float: 0.3000000000000000000000000;
}
}
group "signal_bindings" list {
group "E_Config_Binding_Signal" struct {
value "context" int: 2;

View File

@ -392,6 +392,7 @@ AC_E_OPTIONAL_MODULE([conf_dpms], true)
AC_E_OPTIONAL_MODULE([conf_shelves], true)
AC_E_OPTIONAL_MODULE([conf_keybindings], true)
AC_E_OPTIONAL_MODULE([conf_mousebindings], true)
AC_E_OPTIONAL_MODULE([conf_edgebindings], true)
AC_E_OPTIONAL_MODULE([conf_mouse], true)
AC_E_OPTIONAL_MODULE([conf_window_display], true)
AC_E_OPTIONAL_MODULE([conf_window_focus], true)
@ -496,6 +497,8 @@ src/modules/conf_keybindings/Makefile
src/modules/conf_keybindings/module.desktop
src/modules/conf_mousebindings/Makefile
src/modules/conf_mousebindings/module.desktop
src/modules/conf_edgebindings/Makefile
src/modules/conf_edgebindings/module.desktop
src/modules/conf_mouse/Makefile
src/modules/conf_mouse/module.desktop
src/modules/conf_window_display/Makefile

View File

@ -6873,6 +6873,215 @@ collections { /* begin the collection of edje groups that are in this file */
}
}
/////////////////////////////////////////////////////////////////////////////
/*** MOD: CONF_EDGEBINDINGS ***/
/* This group draws the edge and corners for the user to pick.
* XXX: Needs some love from masters of the brush! */
group {
name: "e/modules/conf_edgebindings/selection"; // for gadget
parts {
part { name: "e.swallow.background";
type: SWALLOW;
mouse_events: 0;
description { state: "default" 0.0;
min: 210 150;
rel1.offset: 4 4;
rel2 {
relative: 0.5 1;
offset: -2 -5;
}
}
}
part { name: "e.edge.top_left";
type: RECT;
description { state: "default" 0.0;
rel1 {
to: "e.swallow.background";
}
rel2 {
relative: 0 0;
offset: 20 20;
to: "e.swallow.background";
}
color: 255 0 0 150;
}
}
part { name: "e.edge.top";
type: RECT;
description { state: "default" 0.0;
rel1 {
offset: 20 0;
to: "e.swallow.background";
}
rel2 {
relative: 1 0;
offset: -20 15;
to: "e.swallow.background";
}
color: 255 255 0 150;
}
}
part { name: "e.edge.top_right";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 1 0;
offset: -20 0;
to: "e.swallow.background";
}
rel2 {
relative: 1 0;
offset: 0 20;
to: "e.swallow.background";
}
color: 255 0 0 150;
}
}
part { name: "e.edge.right";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 1 0;
offset: -15 20;
to: "e.swallow.background";
}
rel2 {
relative: 1 1;
offset: 0 -20;
to: "e.swallow.background";
}
color: 255 255 0 150;
}
}
part { name: "e.edge.bottom_right";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 1 1;
offset: -20 -20;
to: "e.swallow.background";
}
rel2 {
relative: 1 1;
offset: 0 0;
to: "e.swallow.background";
}
color: 255 0 0 150;
}
}
part { name: "e.edge.bottom";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 0 1;
offset: 20 -15;
to: "e.swallow.background";
}
rel2 {
relative: 1 1;
offset: -20 0;
to: "e.swallow.background";
}
color: 255 255 0 150;
}
}
part { name: "e.edge.bottom_left";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 0 1;
offset: 0 -20;
to: "e.swallow.background";
}
rel2 {
relative: 0 1;
offset: 20 0;
to: "e.swallow.background";
}
color: 255 0 0 150;
}
}
part { name: "e.edge.left";
type: RECT;
description { state: "default" 0.0;
rel1 {
relative: 0 0;
offset: 0 20;
to: "e.swallow.background";
}
rel2 {
relative: 0 1;
offset: 15 -20;
to: "e.swallow.background";
}
color: 255 255 0 150;
}
}
part { name: "e.swallow.slider";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 1 1;
offset: 5 4;
to_x: "e.swallow.background";
to_y: "e.text.description";
}
rel2 {
relative: 1 1;
offset: -5 -5;
to_y: "e.swallow.background";
}
}
}
part { name: "e.text.description";
type: TEXTBLOCK;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
rel1 {
relative: 1 0;
offset: 5 4;
to_x: "e.swallow.background";
}
rel2 {
relative: 1 1;
offset: -5 -45;
}
text {
style: "dialog_style";
min: 1 1;
}
}
}
part { name: "e.text.selection";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description { state: "default" 0.0;
align: 0.5 0.5;
rel1 {
relative: 1 1;
offset: 5 5;
to: "e.edge.top_left";
}
rel2 {
relative: 0 0;
offset: -5 -5;
to: "e.edge.bottom_right";
}
color: 224 224 224 255;
color3: 0 0 0 64;
text {
font: "Sans:style=Bold";
size: 12;
align: 0.5 0.5;
fit: 1 1;
}
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
/*** MOD: START ***/
/* This is for the "start" module - i.e. a "start" button. It simply

View File

@ -29,6 +29,13 @@
}
#define ACT_FN_GO_WHEEL(act) \
static void _e_actions_act_##act##_go_wheel(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Wheel *ev)
#define ACT_GO_EDGE(name) \
{ \
act = e_action_add(#name); \
if (act) act->func.go_edge = _e_actions_act_##name##_go_edge; \
}
#define ACT_FN_GO_EDGE(act) \
static void _e_actions_act_##act##_go_edge(E_Object *obj, const char *params, E_Event_Zone_Edge *ev)
#define ACT_GO_SIGNAL(name) \
{ \
act = e_action_add(#name); \
@ -1096,6 +1103,118 @@ ACT_FN_GO(desk_flip_to)
}
}
/***************************************************************************/
#define ACT_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
#define ACT_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count))
#define ACT_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0))
#define ACT_FLIP_DOWN(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || (((zone)->desk_y_current + 1) < (zone)->desk_y_count))
#define ACT_FLIP_UP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_UP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_DOWN_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
#define ACT_FLIP_DOWN_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
ACT_FN_GO_EDGE(desk_flip_in_direction)
{
E_Zone *zone;
E_Desk *prev = NULL, *current = NULL;
E_Event_Pointer_Warp *wev;
int x, y, offset = 25;
zone = _e_actions_zone_get(obj);
wev = E_NEW(E_Event_Pointer_Warp, 1);
if ((!wev) || (!zone)) return;
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
wev->prev.x = x;
wev->prev.y = y;
prev = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current);
if (params)
{
if (sscanf(params, "%i", &offset) != 1)
offset = 25;
}
switch(ev->edge)
{
case E_ZONE_EDGE_LEFT:
if (ACT_FLIP_LEFT(zone))
{
e_zone_desk_flip_by(zone, -1, 0);
ecore_x_pointer_warp(zone->container->win, zone->w - offset, y);
wev->curr.y = y;
wev->curr.x = zone->w - offset;
}
break;
case E_ZONE_EDGE_RIGHT:
if (ACT_FLIP_RIGHT(zone))
{
e_zone_desk_flip_by(zone, 1, 0);
ecore_x_pointer_warp(zone->container->win, offset, y);
wev->curr.y = y;
wev->curr.x = offset;
}
break;
case E_ZONE_EDGE_TOP:
if (ACT_FLIP_UP(zone))
{
e_zone_desk_flip_by(zone, 0, -1);
ecore_x_pointer_warp(zone->container->win, x, zone->h - offset);
wev->curr.x = x;
wev->curr.y = zone->h - offset;
}
break;
case E_ZONE_EDGE_BOTTOM:
if (ACT_FLIP_DOWN(zone))
{
e_zone_desk_flip_by(zone, 0, 1);
ecore_x_pointer_warp(zone->container->win, x, offset);
wev->curr.x = x;
wev->curr.y = offset;
}
break;
case E_ZONE_EDGE_TOP_LEFT:
if (ACT_FLIP_UP_LEFT(zone))
{
e_zone_desk_flip_by(zone, -1, -1);
ecore_x_pointer_warp(zone->container->win, zone->w - offset, zone->h - offset);
wev->curr.x = zone->w - offset;
wev->curr.y = zone->h - offset;
}
break;
case E_ZONE_EDGE_TOP_RIGHT:
if (ACT_FLIP_UP_RIGHT(zone))
{
e_zone_desk_flip_by(zone, 1, -1);
ecore_x_pointer_warp(zone->container->win, offset, zone->h - offset);
wev->curr.x = offset;
wev->curr.y = zone->h - offset;
}
break;
case E_ZONE_EDGE_BOTTOM_LEFT:
if (ACT_FLIP_DOWN_LEFT(zone))
{
e_zone_desk_flip_by(zone, -1, 1);
ecore_x_pointer_warp(zone->container->win, zone->w - offset, offset);
wev->curr.y = offset;
wev->curr.x = zone->w - offset;
}
break;
case E_ZONE_EDGE_BOTTOM_RIGHT:
if (ACT_FLIP_DOWN_RIGHT(zone))
{
e_zone_desk_flip_by(zone, 1, 1);
ecore_x_pointer_warp(zone->container->win, offset, offset);
wev->curr.y = offset;
wev->curr.x = offset;
}
break;
}
current = e_desk_current_get(zone);
if (current)
ecore_event_add(E_EVENT_POINTER_WARP, wev, NULL, NULL);
else
free(wev);
}
/***************************************************************************/
ACT_FN_GO(desk_linear_flip_by)
{
@ -2501,6 +2620,11 @@ e_actions_init(void)
"desk_linear_flip_by_all",
NULL, "syntax: N-offset, example: -2", 1);
/* desk_flip_in_direction */
ACT_GO_EDGE(desk_flip_in_direction);
e_action_predef_name_set(_("Desktop"), _("Flip Desktop In Direction..."),
"desk_flip_in_direction", NULL, "syntax: N-pixel-offset, example: 25", 1);
/* desk_linear_flip_to_all */
ACT_GO(desk_linear_flip_to_all);
e_action_predef_name_set(_("Desktop"), _("Switch To Desktop 0 (All Screens)"),

View File

@ -22,6 +22,7 @@ struct _E_Action
void (*go) (E_Object *obj, const char *params);
void (*go_mouse) (E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev);
void (*go_wheel) (E_Object *obj, const char *params, Ecore_X_Event_Mouse_Wheel *ev);
void (*go_edge) (E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
void (*go_key) (E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev);
void (*go_signal) (E_Object *obj, const char *params, const char *sig, const char *src);
void (*end) (E_Object *obj, const char *params);

View File

@ -7,16 +7,29 @@
static void _e_bindings_mouse_free(E_Binding_Mouse *bind);
static void _e_bindings_key_free(E_Binding_Key *bind);
static void _e_bindings_edge_free(E_Binding_Edge *bind);
static void _e_bindings_signal_free(E_Binding_Signal *bind);
static void _e_bindings_wheel_free(E_Binding_Wheel *bind);
static int _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt);
static int _e_bindings_edge_cb_timer(void *data);
/* local subsystem globals */
static Eina_List *mouse_bindings = NULL;
static Eina_List *key_bindings = NULL;
static Eina_List *mouse_bindings = NULL;
static Eina_List *key_bindings = NULL;
static Eina_List *edge_bindings = NULL;
static Eina_List *signal_bindings = NULL;
static Eina_List *wheel_bindings = NULL;
static Eina_List *wheel_bindings = NULL;
typedef struct _E_Binding_Edge_Data E_Binding_Edge_Data;
struct _E_Binding_Edge_Data
{
E_Binding_Edge *bind;
E_Event_Zone_Edge *ev;
E_Action *act;
E_Object *obj;
};
/* externally accessible functions */
@ -43,6 +56,15 @@ e_bindings_init(void)
eb->any_mod, eb->action, eb->params);
}
for (l = e_config->edge_bindings; l; l = l->next)
{
E_Config_Binding_Edge *eb;
eb = l->data;
e_bindings_edge_add(eb->context, eb->edge, eb->modifiers,
eb->any_mod, eb->action, eb->params, eb->delay);
}
for (l = e_config->signal_bindings; l; l = l->next)
{
E_Config_Binding_Signal *eb;
@ -97,6 +119,14 @@ e_bindings_shutdown(void)
key_bindings = eina_list_remove_list(key_bindings, key_bindings);
_e_bindings_key_free(bind);
}
while (edge_bindings)
{
E_Binding_Edge *bind;
bind = edge_bindings->data;
edge_bindings = eina_list_remove_list(edge_bindings, edge_bindings);
_e_bindings_edge_free(bind);
}
while (signal_bindings)
{
E_Binding_Signal *bind;
@ -516,6 +546,146 @@ e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Ev
return NULL;
}
EAPI void
e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay)
{
E_Binding_Edge *bind;
bind = calloc(1, sizeof(E_Binding_Edge));
bind->ctxt = ctxt;
bind->edge = edge;
bind->mod = mod;
bind->any_mod = any_mod;
bind->delay = delay;
if (action) bind->action = eina_stringshare_add(action);
if (params) bind->params = eina_stringshare_add(params);
edge_bindings = eina_list_append(edge_bindings, bind);
}
EAPI E_Binding_Edge *
e_bindings_edge_get(const char *action, E_Zone_Edge edge)
{
Eina_List *l;
for (l = edge_bindings; l; l = l->next)
{
E_Binding_Edge *bind;
bind = l->data;
if ((bind->edge == edge) && bind->action &&
action && !strcmp(action, bind->action))
return bind;
}
return NULL;
}
EAPI void
e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay)
{
Eina_List *l;
for (l = edge_bindings; l; l = l->next)
{
E_Binding_Edge *bind;
bind = l->data;
if ((bind->ctxt == ctxt) &&
(bind->edge == edge) &&
(bind->mod == mod) &&
((bind->delay * 1000) == (delay * 1000)) &&
(bind->any_mod == any_mod) &&
(((bind->action) && (action) && (!strcmp(bind->action, action))) ||
((!bind->action) && (!action))) &&
(((bind->params) && (params) && (!strcmp(bind->params, params))) ||
((!bind->params) && (!params))))
{
_e_bindings_edge_free(bind);
edge_bindings = eina_list_remove_list(edge_bindings, l);
break;
}
}
}
EAPI E_Action *
e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev)
{
E_Binding_Modifier mod = 0;
E_Action *act = NULL;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
for (l = edge_bindings; l; l = l->next)
{
E_Binding_Edge *bind;
bind = l->data;
if (((bind->edge == ev->edge)) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
act = e_action_find(bind->action);
if (act)
{
E_Binding_Edge_Data *ed = E_NEW(E_Binding_Edge_Data, 1);
E_Event_Zone_Edge *ev2 = E_NEW(E_Event_Zone_Edge, 1);
/* The original event will be freed before it can be
* used again */
ev2->zone = ev->zone;
ev2->edge = ev->edge;
ev2->x = ev->x;
ev2->y = ev->y;
ed->bind = bind;
ed->obj = obj;
ed->act = act;
ed->ev = ev2;
bind->timer = ecore_timer_add(((double) bind->delay), _e_bindings_edge_cb_timer, ed);
}
}
}
}
return act;
}
EAPI E_Action *
e_bindings_edge_out_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev)
{
E_Binding_Modifier mod = 0;
E_Action *act = NULL;
Eina_List *l;
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT;
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN;
for (l = edge_bindings; l; l = l->next)
{
E_Binding_Edge *bind;
bind = l->data;
if ((bind->edge == ev->edge) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
if (bind->timer)
ecore_timer_del(bind->timer);
bind->timer = NULL;
act = e_action_find(bind->action);
if (act && act->func.end)
act->func.end(obj, bind->params);
}
}
}
return act;
}
EAPI void
e_bindings_signal_add(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params)
{
@ -801,6 +971,21 @@ _e_bindings_key_free(E_Binding_Key *bind)
free(bind);
}
static void
_e_bindings_edge_free(E_Binding_Edge *bind)
{
if (bind->action) eina_stringshare_del(bind->action);
if (bind->params) eina_stringshare_del(bind->params);
if (bind->timer)
{
E_Binding_Edge_Data *ed;
ed = ecore_timer_del(bind->timer);
E_FREE(ed);
}
free(bind);
}
static void
_e_bindings_signal_free(E_Binding_Signal *bind)
{
@ -827,3 +1012,34 @@ _e_bindings_context_match(E_Binding_Context bctxt, E_Binding_Context ctxt)
if (bctxt == ctxt) return 1;
return 0;
}
static int
_e_bindings_edge_cb_timer(void *data)
{
E_Binding_Edge_Data *ed;
E_Event_Zone_Edge *ev;
E_Binding_Edge *bind;
E_Action *act;
E_Object *obj;
ed = data;
bind = ed->bind;
act = ed->act;
obj = ed->obj;
ev = ed->ev;
E_FREE(ed);
if (act->func.go_edge)
act->func.go_edge(obj, bind->params, ev);
else if (act->func.go)
act->func.go(obj, bind->params);
bind->timer = NULL;
/* Duplicate event */
E_FREE(ev);
return 0;
}

View File

@ -32,6 +32,7 @@ typedef enum _E_Binding_Modifier
typedef struct _E_Binding_Mouse E_Binding_Mouse;
typedef struct _E_Binding_Key E_Binding_Key;
typedef struct _E_Binding_Edge E_Binding_Edge;
typedef struct _E_Binding_Signal E_Binding_Signal;
typedef struct _E_Binding_Wheel E_Binding_Wheel;
@ -59,6 +60,19 @@ struct _E_Binding_Key
const char *params;
};
struct _E_Binding_Edge
{
E_Binding_Context ctxt;
E_Zone_Edge edge;
E_Binding_Modifier mod;
unsigned char any_mod : 1;
const char *action;
const char *params;
float delay;
Ecore_Timer *timer;
};
struct _E_Binding_Signal
{
E_Binding_Context ctxt;
@ -101,6 +115,12 @@ EAPI void e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window wi
EAPI E_Action *e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev);
EAPI E_Action *e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev);
EAPI void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge);
EAPI void e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI E_Action *e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev);
EAPI E_Action *e_bindings_edge_out_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev);
EAPI void e_bindings_signal_add(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
EAPI void e_bindings_signal_del(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
EAPI E_Action *e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj, const char *sig, const char *src, E_Binding_Signal **bind_ret);

View File

@ -29,6 +29,7 @@ static E_Config_DD *_e_config_font_default_edd = NULL;
static E_Config_DD *_e_config_theme_edd = NULL;
static E_Config_DD *_e_config_bindings_mouse_edd = NULL;
static E_Config_DD *_e_config_bindings_key_edd = NULL;
static E_Config_DD *_e_config_bindings_edge_edd = NULL;
static E_Config_DD *_e_config_bindings_signal_edd = NULL;
static E_Config_DD *_e_config_bindings_wheel_edd = NULL;
static E_Config_DD *_e_config_path_append_edd = NULL;
@ -266,6 +267,20 @@ e_config_init(void)
E_CONFIG_VAL(D, T, params, STR);
E_CONFIG_VAL(D, T, any_mod, UCHAR);
_e_config_bindings_edge_edd = E_CONFIG_DD_NEW("E_Config_Binding_Edge",
E_Config_Binding_Edge);
#undef T
#undef D
#define T E_Config_Binding_Edge
#define D _e_config_bindings_edge_edd
E_CONFIG_VAL(D, T, context, INT);
E_CONFIG_VAL(D, T, modifiers, INT);
E_CONFIG_VAL(D, T, action, STR);
E_CONFIG_VAL(D, T, params, STR);
E_CONFIG_VAL(D, T, edge, UCHAR);
E_CONFIG_VAL(D, T, any_mod, UCHAR);
E_CONFIG_VAL(D, T, delay, FLOAT);
_e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal",
E_Config_Binding_Signal);
#undef T
@ -424,8 +439,6 @@ e_config_init(void)
E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a config option (for now) */
E_CONFIG_VAL(D, T, show_desktop_icons, INT); /**/
E_CONFIG_VAL(D, T, edge_flip_dragging, INT); /**/
E_CONFIG_VAL(D, T, edge_flip_moving, INT); /**/
E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE); /**/
E_CONFIG_VAL(D, T, evas_engine_default, INT); /**/
E_CONFIG_VAL(D, T, evas_engine_container, INT); /**/
E_CONFIG_VAL(D, T, evas_engine_init, INT); /**/
@ -444,6 +457,7 @@ e_config_init(void)
E_CONFIG_LIST(D, T, themes, _e_config_theme_edd); /**/
E_CONFIG_LIST(D, T, mouse_bindings, _e_config_bindings_mouse_edd); /**/
E_CONFIG_LIST(D, T, key_bindings, _e_config_bindings_key_edd); /**/
E_CONFIG_LIST(D, T, edge_bindings, _e_config_bindings_edge_edd); /**/
E_CONFIG_LIST(D, T, signal_bindings, _e_config_bindings_signal_edd); /**/
E_CONFIG_LIST(D, T, wheel_bindings, _e_config_bindings_wheel_edd); /**/
E_CONFIG_LIST(D, T, path_append_data, _e_config_path_append_edd); /**/
@ -680,6 +694,7 @@ e_config_shutdown(void)
E_CONFIG_DD_FREE(_e_config_theme_edd);
E_CONFIG_DD_FREE(_e_config_bindings_mouse_edd);
E_CONFIG_DD_FREE(_e_config_bindings_key_edd);
E_CONFIG_DD_FREE(_e_config_bindings_edge_edd);
E_CONFIG_DD_FREE(_e_config_bindings_signal_edd);
E_CONFIG_DD_FREE(_e_config_bindings_wheel_edd);
E_CONFIG_DD_FREE(_e_config_path_append_edd);
@ -884,8 +899,6 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
E_CONFIG_LIMIT(e_config->show_desktop_icons, 0, 1);
E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1);
E_CONFIG_LIMIT(e_config->edge_flip_moving, 0, 1);
E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART, E_WINDOW_PLACEMENT_MANUAL);
E_CONFIG_LIMIT(e_config->focus_policy, 0, 2);
E_CONFIG_LIMIT(e_config->focus_setting, 0, 3);
@ -1351,6 +1364,30 @@ e_config_binding_key_match(E_Config_Binding_Key *eb_in)
return NULL;
}
EAPI E_Config_Binding_Edge *
e_config_binding_edge_match(E_Config_Binding_Edge *eb_in)
{
Eina_List *l;
for (l = e_config->edge_bindings; l; l = l->next)
{
E_Config_Binding_Edge *eb;
eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->modifiers == eb_in->modifiers) &&
(eb->any_mod == eb_in->any_mod) &&
(eb->edge == eb_in->edge) &&
(eb->delay == eb_in->delay) &&
(((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) ||
((!eb->action) && (!eb_in->action))) &&
(((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) ||
((!eb->params) && (!eb_in->params))))
return eb;
}
return NULL;
}
EAPI E_Config_Binding_Signal *
e_config_binding_signal_match(E_Config_Binding_Signal *eb_in)
{
@ -1419,6 +1456,7 @@ _e_config_free(E_Config *ecf)
E_Config_Binding_Wheel *ebw;
E_Config_Syscon_Action *sca;
E_Config_Binding_Key *ebk;
E_Config_Binding_Edge *ebe;
E_Font_Fallback *eff;
E_Config_Module *em;
E_Font_Default *efd;
@ -1464,6 +1502,12 @@ _e_config_free(E_Config *ecf)
if (ebk->params) eina_stringshare_del(ebk->params);
E_FREE(ebk);
}
EINA_LIST_FREE(ecf->edge_bindings, ebe)
{
if (ebe->action) eina_stringshare_del(ebe->action);
if (ebe->params) eina_stringshare_del(ebe->params);
E_FREE(ebe);
}
EINA_LIST_FREE(ecf->signal_bindings, ebs)
{
if (ebs->signal) eina_stringshare_del(ebs->signal);

View File

@ -10,6 +10,7 @@ typedef struct _E_Config_Module E_Config_Module;
typedef struct _E_Config_Theme E_Config_Theme;
typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse;
typedef struct _E_Config_Binding_Key E_Config_Binding_Key;
typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge;
typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal;
typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel;
typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background;
@ -82,8 +83,6 @@ struct _E_Config
int use_virtual_roots; // NO GUI - maybe remove?
int show_desktop_icons; // GUI
int edge_flip_dragging; // GUI
int edge_flip_moving; // GUI
double edge_flip_timeout; // GUI
int evas_engine_default; // GUI
int evas_engine_container; // NO GUI - maybe remove?
int evas_engine_init; // NO GUI - maybe remove?
@ -102,6 +101,7 @@ struct _E_Config
Eina_List *themes; // GUI
Eina_List *mouse_bindings; // GUI
Eina_List *key_bindings; // GUI
Eina_List *edge_bindings; // GUI
Eina_List *signal_bindings;
Eina_List *wheel_bindings; // GUI
Eina_List *path_append_data; // GUI
@ -374,6 +374,17 @@ struct _E_Config_Binding_Key
unsigned char any_mod;
};
struct _E_Config_Binding_Edge
{
int context;
int modifiers;
float delay;
const char *action;
const char *params;
unsigned char edge;
unsigned char any_mod;
};
struct _E_Config_Binding_Signal
{
int context;
@ -503,6 +514,7 @@ EAPI int e_config_domain_save(const char *domain, E_Config_DD *edd, const
EAPI E_Config_Binding_Mouse *e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *eb_in);
EAPI E_Config_Binding_Edge *e_config_binding_edge_match(E_Config_Binding_Edge *eb_in);
EAPI E_Config_Binding_Signal *e_config_binding_signal_match(E_Config_Binding_Signal *eb_in);
EAPI E_Config_Binding_Wheel *e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in);

View File

@ -11,6 +11,7 @@
static void _e_desk_free(E_Desk *desk);
static void _e_border_event_desk_show_free(void *data, void *ev);
static void _e_border_event_desk_before_show_free(void *data, void *ev);
static void _e_border_event_desk_after_show_free(void *data, void *ev);
static void _e_border_event_desk_deskshow_free(void *data, void *ev);
static void _e_border_event_desk_name_change_free(void *data, void *ev);
static void _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy);
@ -22,6 +23,7 @@ static int _e_desk_hide_animator(void *data);
EAPI int E_EVENT_DESK_SHOW = 0;
EAPI int E_EVENT_DESK_BEFORE_SHOW = 0;
EAPI int E_EVENT_DESK_AFTER_SHOW = 0;
EAPI int E_EVENT_DESK_DESKSHOW = 0;
EAPI int E_EVENT_DESK_NAME_CHANGE = 0;
@ -30,6 +32,7 @@ e_desk_init(void)
{
E_EVENT_DESK_SHOW = ecore_event_type_new();
E_EVENT_DESK_BEFORE_SHOW = ecore_event_type_new();
E_EVENT_DESK_AFTER_SHOW = ecore_event_type_new();
E_EVENT_DESK_DESKSHOW = ecore_event_type_new();
E_EVENT_DESK_NAME_CHANGE = ecore_event_type_new();
return 1;
@ -204,6 +207,7 @@ e_desk_show(E_Desk *desk)
E_Border *bd;
E_Event_Desk_Show *ev;
E_Event_Desk_Before_Show *eev;
E_Event_Desk_After_Show *eeev;
Eina_List *l;
int was_zone = 0, x, y, dx = 0, dy = 0;
@ -311,6 +315,16 @@ e_desk_show(E_Desk *desk)
else
e_shelf_hide(es);
}
if (e_config->desk_flip_animate_mode == 0)
{
eeev = E_NEW(E_Event_Desk_After_Show, 1);
eeev->desk = e_desk_current_get(desk->zone);
e_object_ref(E_OBJECT(eeev->desk));
ecore_event_add(E_EVENT_DESK_AFTER_SHOW, eeev,
_e_border_event_desk_after_show_free, NULL);
}
}
EAPI void
@ -532,6 +546,16 @@ _e_border_event_desk_before_show_free(void *data, void *event)
free(ev);
}
static void
_e_border_event_desk_after_show_free(void *data, void *event)
{
E_Event_Desk_After_Show *ev;
ev = event;
e_object_unref(E_OBJECT(ev->desk));
free(ev);
}
static void
_e_border_event_desk_deskshow_free(void *data, void *event)
{
@ -628,6 +652,7 @@ _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy)
static void
_e_desk_show_end(E_Desk *desk)
{
E_Event_Desk_After_Show *ev;
E_Border_List *bl;
E_Border *bd;
@ -644,6 +669,11 @@ _e_desk_show_end(E_Desk *desk)
}
e_container_border_list_free(bl);
ecore_x_window_shadow_tree_flush();
ev = E_NEW(E_Event_Desk_After_Show, 1);
ev->desk = e_desk_current_get(desk->zone);
e_object_ref(E_OBJECT(ev->desk));
ecore_event_add(E_EVENT_DESK_AFTER_SHOW, ev,
_e_border_event_desk_after_show_free, NULL);
}
static int

View File

@ -6,6 +6,7 @@
typedef struct _E_Desk E_Desk;
typedef struct _E_Event_Desk_Show E_Event_Desk_Show;
typedef struct _E_Event_Desk_Before_Show E_Event_Desk_Before_Show;
typedef struct _E_Event_Desk_After_Show E_Event_Desk_After_Show;
typedef struct _E_Event_Desk_DeskShow E_Event_Desk_DeskShow;
typedef struct _E_Event_Desk_Name_Change E_Event_Desk_Name_Change;
@ -40,6 +41,10 @@ struct _E_Event_Desk_Before_Show
E_Desk *desk;
};
struct _E_Event_Desk_After_Show
{
E_Desk *desk;
};
struct _E_Event_Desk_Name_Change
{
@ -69,6 +74,7 @@ EAPI void e_desk_col_remove(E_Zone *zone);
extern EAPI int E_EVENT_DESK_SHOW;
extern EAPI int E_EVENT_DESK_BEFORE_SHOW;
extern EAPI int E_EVENT_DESK_AFTER_SHOW;
extern EAPI int E_EVENT_DESK_DESKSHOW;
extern EAPI int E_EVENT_DESK_NAME_CHANGE;

View File

@ -399,7 +399,6 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_shelf_toggle(cfdata->es, 0);
else if (!cfdata->escfg->autohide && cfdata->es->hidden)
e_shelf_toggle(cfdata->es, 1);
e_zone_update_flip_all();
cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
cfdata->escfg->desk_list = NULL;

View File

@ -1791,47 +1791,6 @@ break;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_MOVING_SET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-edge-flip-moving-set", 1, "Set the edge flip while moving policy flag (0/1)", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_INT(atoi(params[0]), HDL);
#elif (TYPE == E_WM_IN)
START_INT(value, HDL);
e_config->edge_flip_moving = value;
E_CONFIG_LIMIT(e_config->edge_flip_moving, 0, 1);
e_zone_update_flip_all();
SAVE;
END_INT;
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_MOVING_GET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-edge-flip-moving-get", 0, "Get the edge flip while moving policy flag", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL)
#elif (TYPE == E_WM_IN)
SEND_INT(e_config->edge_flip_moving, E_IPC_OP_EDGE_FLIP_MOVING_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_MOVING_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
#elif (TYPE == E_REMOTE_IN)
START_INT(val, HDL)
printf("REPLY: %i\n", val);
END_INT;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_DRAGGING_SET
#if (TYPE == E_REMOTE_OPTIONS)
@ -1842,7 +1801,6 @@ break;
START_INT(value, HDL);
e_config->edge_flip_dragging = value;
E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1);
e_zone_update_flip_all();
SAVE;
END_INT;
#elif (TYPE == E_REMOTE_IN)
@ -1873,46 +1831,6 @@ break;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_TIMEOUT_SET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-edge-flip-timeout-set", 1, "Set the edge flip timeout (sec)", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_DOUBLE(atof(params[0]), HDL)
#elif (TYPE == E_WM_IN)
START_DOUBLE(dbl, HDL);
e_config->edge_flip_timeout = dbl;
E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
SAVE;
END_DOUBLE;
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_TIMEOUT_GET
#if (TYPE == E_REMOTE_OPTIONS)
OP("-edge-flip-timeout-get", 0, "Get the edge flip timeout", 1, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_NULL(HDL)
#elif (TYPE == E_WM_IN)
SEND_DOUBLE(e_config->edge_flip_timeout, E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY, HDL);
#elif (TYPE == E_REMOTE_IN)
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY
#if (TYPE == E_REMOTE_OPTIONS)
#elif (TYPE == E_REMOTE_OUT)
#elif (TYPE == E_WM_IN)
#elif (TYPE == E_REMOTE_IN)
START_DOUBLE(val, HDL)
printf("REPLY: %3.3f\n", val);
END_DOUBLE;
#endif
#undef HDL
/****************************************************************************/
#define HDL E_IPC_OP_FONT_CACHE_SET
#if (TYPE == E_REMOTE_OPTIONS)

View File

@ -26,8 +26,6 @@ static int _e_shelf_cb_hide_animator_timer(void *data);
static int _e_shelf_cb_instant_hide_timer(void *data);
static void _e_shelf_menu_pre_cb(void *data, E_Menu *m);
static void _e_shelf_edge_event_register(E_Shelf *es, int reg);
static Eina_List *shelves = NULL;
static Eina_Hash *winid_shelves = NULL;
@ -628,8 +626,6 @@ e_shelf_popup_set(E_Shelf *es, int popup)
evas_object_show(es->o_base);
e_popup_edje_bg_object_set(es->popup, es->o_base);
_e_shelf_edge_event_register(es, 1);
e_drop_xdnd_register_set(es->popup->evas_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->popup->evas_win);
e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win);
@ -648,7 +644,6 @@ e_shelf_popup_set(E_Shelf *es, int popup)
evas_object_layer_set(es->o_event, es->cfg->layer);
evas_object_layer_set(es->o_base, es->cfg->layer);
_e_shelf_edge_event_register(es, 0);
e_drop_xdnd_register_set(es->zone->container->bg_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->zone->container->bg_win);
e_gadcon_dnd_window_set(es->gadcon, es->zone->container->event_win);
@ -695,8 +690,6 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
else
e_shelf_show(es);
if (es->popup)
_e_shelf_edge_event_register(es, 1);
e_shelf_toggle(es, 0);
return es;
}
@ -738,7 +731,6 @@ _e_shelf_free(E_Shelf *es)
evas_object_del(es->o_base);
if (es->popup)
{
_e_shelf_edge_event_register(es, 0);
e_drop_xdnd_register_set(es->popup->evas_win, 0);
eina_hash_del(winid_shelves, e_util_winid_str_get(es->popup->evas_win), es);
if (!eina_hash_population(winid_shelves))
@ -1694,51 +1686,3 @@ _e_shelf_menu_pre_cb(void *data, E_Menu *m)
e_util_menu_item_edje_icon_set(mi, "widget/del");
e_menu_item_callback_set(mi, _e_shelf_cb_menu_delete, es);
}
static void
_e_shelf_edge_event_register(E_Shelf *es, int reg)
{
if (!es) return;
if ((!reg) && (!es->edge)) return;
if ((reg) && (es->edge)) return;
if ((reg) && ((!es->cfg->autohide) || (es->cfg->autohide_show_action) || (!es->popup))) return;
es->edge = reg;
switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_LEFT:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
break;
case E_GADCON_ORIENT_RIGHT:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
break;
case E_GADCON_ORIENT_TOP:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
break;
case E_GADCON_ORIENT_BOTTOM:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
break;
case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_LT:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
break;
case E_GADCON_ORIENT_CORNER_TR:
case E_GADCON_ORIENT_CORNER_RT:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
break;
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_LB:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
break;
case E_GADCON_ORIENT_CORNER_BR:
case E_GADCON_ORIENT_CORNER_RB:
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
break;
default:
break;
}
}

View File

@ -10,15 +10,12 @@
static void _e_zone_free(E_Zone *zone);
static void _e_zone_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _e_zone_cb_bg_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _e_zone_cb_bg_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _e_zone_event_zone_desk_count_set_free(void *data, void *ev);
static int _e_zone_cb_mouse_in(void *data, int type, void *event);
static int _e_zone_cb_mouse_out(void *data, int type, void *event);
static int _e_zone_cb_mouse_move(void *data, int type, void *event);
static int _e_zone_cb_timer(void *data);
static int _e_zone_cb_desk_show(void *data, int type, void *event);
static void _e_zone_update_flip(E_Zone *zone);
static void _e_zone_update_edge(E_Zone *zone);
static int _e_zone_cb_desk_after_show(void *data, int type, void *event);
static int _e_zone_cb_edge_timer(void *data);
static void _e_zone_event_move_resize_free(void *data, void *ev);
static void _e_zone_event_add_free(void *data, void *ev);
static void _e_zone_event_del_free(void *data, void *ev);
@ -38,6 +35,8 @@ EAPI int E_EVENT_ZONE_EDGE_MOVE = 0;
#define E_ZONE_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0))
#define E_ZONE_FLIP_DOWN(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || (((zone)->desk_y_current + 1) < (zone)->desk_y_count))
#define E_ZONE_CORNER_RATIO 0.025;
EAPI int
e_zone_init(void)
{
@ -65,6 +64,7 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
char name[40];
Evas_Object *o;
E_Event_Zone_Add *ev;
int cw, ch;
zone = E_OBJECT_ALLOC(E_Zone, E_ZONE_TYPE, _e_zone_free);
if (!zone) return NULL;
@ -78,15 +78,64 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
zone->num = num;
zone->id = id;
zone->edge.left = ecore_x_window_input_new(con->win, zone->x, zone->y, 1, zone->h);
cw = w * E_ZONE_CORNER_RATIO;
ch = h * E_ZONE_CORNER_RATIO;
zone->corner.left_bottom = ecore_x_window_input_new(con->win,
zone->x, zone->y + zone->h - ch, 1, ch);
zone->edge.left = ecore_x_window_input_new(con->win,
zone->x, zone->y + ch, 1, zone->h - 2 * ch);
zone->corner.left_top = ecore_x_window_input_new(con->win,
zone->x, zone->y, 1, ch);
zone->corner.top_left = ecore_x_window_input_new(con->win,
zone->x + 1, zone->y, cw, 1);
zone->edge.top = ecore_x_window_input_new(con->win,
zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1);
zone->corner.top_right = ecore_x_window_input_new(con->win,
zone->x + zone->w - cw - 2, zone->y, cw, 1);
zone->corner.right_top = ecore_x_window_input_new(con->win,
zone->x + zone->w - 1, zone->y, 1, ch);
zone->edge.right = ecore_x_window_input_new(con->win,
zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch);
zone->corner.right_bottom = ecore_x_window_input_new(con->win,
zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch);
zone->corner.bottom_right = ecore_x_window_input_new(con->win,
zone->x + 1, zone->y + zone->h - 1, cw, 1);
zone->edge.bottom = ecore_x_window_input_new(con->win,
zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1);
zone->corner.bottom_left = ecore_x_window_input_new(con->win,
zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1);
e_container_window_raise(zone->container, zone->corner.left_bottom, 999);
e_container_window_raise(zone->container, zone->corner.left_top, 999);
e_container_window_raise(zone->container, zone->corner.top_left, 999);
e_container_window_raise(zone->container, zone->corner.top_right, 999);
e_container_window_raise(zone->container, zone->corner.right_top, 999);
e_container_window_raise(zone->container, zone->corner.right_bottom, 999);
e_container_window_raise(zone->container, zone->corner.bottom_right, 999);
e_container_window_raise(zone->container, zone->corner.bottom_left, 999);
e_container_window_raise(zone->container, zone->edge.left, 999);
zone->edge.right = ecore_x_window_input_new(con->win, zone->x + zone->w - 1, zone->y, 1, zone->h);
e_container_window_raise(zone->container, zone->edge.right, 999);
zone->edge.top = ecore_x_window_input_new(con->win, zone->x + 1, zone->y, zone->w - 2, 1);
e_container_window_raise(zone->container, zone->edge.top, 999);
zone->edge.bottom = ecore_x_window_input_new(con->win, zone->x + 1, zone->y + zone->h - 1, zone->w - 2, 1);
e_container_window_raise(zone->container, zone->edge.bottom, 999);
ecore_x_window_show(zone->edge.left);
ecore_x_window_show(zone->edge.right);
ecore_x_window_show(zone->edge.top);
ecore_x_window_show(zone->edge.bottom);
ecore_x_window_show(zone->corner.left_bottom);
ecore_x_window_show(zone->corner.left_top);
ecore_x_window_show(zone->corner.top_left);
ecore_x_window_show(zone->corner.top_right);
ecore_x_window_show(zone->corner.right_top);
ecore_x_window_show(zone->corner.right_bottom);
ecore_x_window_show(zone->corner.bottom_right);
ecore_x_window_show(zone->corner.bottom_left);
zone->handlers =
eina_list_append(zone->handlers,
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN,
@ -101,8 +150,8 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
_e_zone_cb_mouse_move, zone));
zone->handlers =
eina_list_append(zone->handlers,
ecore_event_handler_add(E_EVENT_DESK_SHOW,
_e_zone_cb_desk_show, zone));
ecore_event_handler_add(E_EVENT_DESK_AFTER_SHOW,
_e_zone_cb_desk_after_show, zone));
snprintf(name, sizeof(name), "Zone %d", zone->num);
zone->name = eina_stringshare_add(name);
@ -126,7 +175,6 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_zone_cb_bg_mouse_down, zone);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_zone_cb_bg_mouse_up, zone);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _e_zone_cb_bg_mouse_move, zone);
/* TODO: config the ecore_evas type. */
zone->black_ecore_evas =
@ -153,9 +201,6 @@ e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
e_zone_desk_count_set(zone, e_config->zone_desks_x_count,
e_config->zone_desks_y_count);
_e_zone_update_flip(zone);
_e_zone_update_edge(zone);
e_object_del_attach_func_set(E_OBJECT(zone), _e_zone_object_del_attach);
ev = E_NEW(E_Event_Zone_Add, 1);
@ -180,6 +225,7 @@ EAPI void
e_zone_move(E_Zone *zone, int x, int y)
{
E_Event_Zone_Move_Resize *ev;
int cw, ch;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -196,16 +242,42 @@ e_zone_move(E_Zone *zone, int x, int y)
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.top, zone->x + 1, zone->y, zone->w - 2, 1);
ecore_x_window_move_resize(zone->edge.bottom, zone->x + 1, zone->y + zone->h - 1, zone->w - 2, 1);
cw = zone->w * E_ZONE_CORNER_RATIO;
ch = zone->h * E_ZONE_CORNER_RATIO;
ecore_x_window_move_resize(zone->corner.left_bottom,
zone->x, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->edge.left,
zone->x, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.left_top,
zone->x, zone->y, 1, ch);
ecore_x_window_move_resize(zone->corner.top_left,
zone->x + 1, zone->y, cw, 1);
ecore_x_window_move_resize(zone->edge.top,
zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1);
ecore_x_window_move_resize(zone->corner.top_right,
zone->x + zone->w - cw - 2, zone->y, cw, 1);
ecore_x_window_move_resize(zone->corner.right_top,
zone->x + zone->w - 1, zone->y, 1, ch);
ecore_x_window_move_resize(zone->edge.right,
zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.right_bottom,
zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->corner.bottom_right,
zone->x + 1, zone->y + zone->h - 1, cw, 1);
ecore_x_window_move_resize(zone->edge.bottom,
zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1);
ecore_x_window_move_resize(zone->corner.bottom_left,
zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1);
}
EAPI void
e_zone_resize(E_Zone *zone, int w, int h)
{
E_Event_Zone_Move_Resize *ev;
int cw, ch;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -223,19 +295,42 @@ e_zone_resize(E_Zone *zone, int w, int h)
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev,
_e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1,
zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.top, zone->x + 1, zone->y,
zone->w - 2, 1);
ecore_x_window_move_resize(zone->edge.bottom, zone->x + 1,
zone->y + zone->h - 1, zone->w - 2, 1);
cw = zone->w * E_ZONE_CORNER_RATIO;
ch = zone->h * E_ZONE_CORNER_RATIO;
ecore_x_window_move_resize(zone->corner.left_bottom,
zone->x, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->edge.left,
zone->x, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.left_top,
zone->x, zone->y, 1, ch);
ecore_x_window_move_resize(zone->corner.top_left,
zone->x + 1, zone->y, cw, 1);
ecore_x_window_move_resize(zone->edge.top,
zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1);
ecore_x_window_move_resize(zone->corner.top_right,
zone->x + zone->w - cw - 2, zone->y, cw, 1);
ecore_x_window_move_resize(zone->corner.right_top,
zone->x + zone->w - 1, zone->y, 1, ch);
ecore_x_window_move_resize(zone->edge.right,
zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.right_bottom,
zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->corner.bottom_right,
zone->x + 1, zone->y + zone->h - 1, cw, 1);
ecore_x_window_move_resize(zone->edge.bottom,
zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1);
ecore_x_window_move_resize(zone->corner.bottom_left,
zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1);
}
EAPI void
e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h)
{
E_Event_Zone_Move_Resize *ev;
int cw, ch;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
@ -261,13 +356,35 @@ e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h)
ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev,
_e_zone_event_move_resize_free, NULL);
ecore_x_window_move_resize(zone->edge.left, zone->x, zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.right, zone->x + zone->w - 1,
zone->y, 1, zone->h);
ecore_x_window_move_resize(zone->edge.top, zone->x + 1, zone->y,
zone->w - 2, 1);
ecore_x_window_move_resize(zone->edge.bottom, zone->x + 1,
zone->y + zone->h - 1, zone->w - 2, 1);
cw = zone->w * E_ZONE_CORNER_RATIO;
ch = zone->h * E_ZONE_CORNER_RATIO;
ecore_x_window_move_resize(zone->corner.left_bottom,
zone->x, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->edge.left,
zone->x, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.left_top,
zone->x, zone->y, 1, ch);
ecore_x_window_move_resize(zone->corner.top_left,
zone->x + 1, zone->y, cw, 1);
ecore_x_window_move_resize(zone->edge.top,
zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1);
ecore_x_window_move_resize(zone->corner.top_right,
zone->x + zone->w - cw - 2, zone->y, cw, 1);
ecore_x_window_move_resize(zone->corner.right_top,
zone->x + zone->w - 1, zone->y, 1, ch);
ecore_x_window_move_resize(zone->edge.right,
zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch);
ecore_x_window_move_resize(zone->corner.right_bottom,
zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch);
ecore_x_window_move_resize(zone->corner.bottom_right,
zone->x + 1, zone->y + zone->h - 1, cw, 1);
ecore_x_window_move_resize(zone->edge.bottom,
zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1);
ecore_x_window_move_resize(zone->corner.bottom_left,
zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1);
}
EAPI void
@ -327,13 +444,19 @@ e_zone_bg_reconfigure(E_Zone *zone)
EAPI void
e_zone_flip_coords_handle(E_Zone *zone, int x, int y)
{
E_Event_Zone_Edge *zev;
E_Binding_Edge *bind;
E_Zone_Edge edge;
Eina_List *l;
E_Shelf *es;
int ok = 0;
int one_row = 1;
int one_col = 1;
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
if (!e_config->edge_flip_dragging) return;
if (!e_config->edge_flip_dragging || zone->flip.switching) return;
/* if we have only 1 row we can flip up/down even if we have xinerama */
if (eina_list_count(zone->container->zones) > 1)
{
@ -358,44 +481,91 @@ e_zone_flip_coords_handle(E_Zone *zone, int x, int y)
goto noflip;
if (!E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h))
goto noflip;
if ((one_row) && (y == 0) && E_ZONE_FLIP_UP(zone))
{
/* top */
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_UP;
}
else if ((one_col) && (x == (zone->w - 1)) && E_ZONE_FLIP_RIGHT(zone))
{
/* right */
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_RIGHT;
}
else if ((one_row) && (y == (zone->h - 1)) && E_ZONE_FLIP_DOWN(zone))
{
/* bottom */
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_DOWN;
}
else if ((one_col) && (x == 0) && E_ZONE_FLIP_LEFT(zone))
{
/* left */
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_LEFT;
}
if ((one_row) && (y == 0))
edge = E_ZONE_EDGE_TOP;
else if ((one_col) && (x == (zone->w - 1)))
edge = E_ZONE_EDGE_RIGHT;
else if ((one_row) && (y == (zone->h - 1)))
edge = E_ZONE_EDGE_BOTTOM;
else if ((one_col) && (x == 0))
edge = E_ZONE_EDGE_LEFT;
else
{
noflip:
/* in zone */
if (zone->flip.timer) ecore_timer_del(zone->flip.timer);
zone->flip.timer = NULL;
if (zone->flip.es)
e_shelf_toggle(zone->flip.es, 0);
zone->flip.es = NULL;
return;
}
EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
ok = 0;
if (es->zone != zone) continue;
switch(es->gadcon->orient)
{
case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR:
if (edge == E_ZONE_EDGE_TOP) ok = 1;
break;
case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR:
if (edge == E_ZONE_EDGE_BOTTOM) ok = 1;
break;
case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LT:
case E_GADCON_ORIENT_CORNER_LB:
if (edge == E_ZONE_EDGE_LEFT) ok = 1;
break;
case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RT:
case E_GADCON_ORIENT_CORNER_RB:
if (edge == E_ZONE_EDGE_RIGHT) ok = 1;
break;
}
if (!ok) continue;
if (!E_INSIDE(x, y, es->x, es->y, es->w, es->h))
continue;
if (zone->flip.es)
e_shelf_toggle(zone->flip.es, 0);
zone->flip.es = es;
e_shelf_toggle(es, 1);
}
ok = 0;
switch(edge)
{
case E_ZONE_EDGE_LEFT:
if (E_ZONE_FLIP_LEFT(zone)) ok = 1;
break;
case E_ZONE_EDGE_TOP:
if (E_ZONE_FLIP_UP(zone)) ok = 1;
break;
case E_ZONE_EDGE_RIGHT:
if (E_ZONE_FLIP_RIGHT(zone)) ok = 1;
break;
case E_ZONE_EDGE_BOTTOM:
if (E_ZONE_FLIP_DOWN(zone)) ok = 1;
break;
}
if (!ok) return;
bind = e_bindings_edge_get("desk_flip_in_direction", edge);
if (bind)
{
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = x;
zev->y = y;
zev->edge = edge;
zone->flip.ev = zev;
zone->flip.bind = bind;
zone->flip.switching = 1;
bind->timer = ecore_timer_add(((double) bind->delay), _e_zone_cb_edge_timer, zone);
}
}
@ -522,36 +692,6 @@ e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count)
if (y_count) *y_count = zone->desk_y_count;
}
EAPI void
e_zone_update_flip(E_Zone *zone)
{
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
_e_zone_update_flip(zone);
_e_zone_update_edge(zone);
}
EAPI void
e_zone_update_flip_all(void)
{
Eina_List *l, *ll;
E_Manager *man;
E_Container *con;
E_Zone *zone;
for (l = e_manager_list(); l; l = l->next)
{
man = l->data;
for (ll = man->containers; ll; ll = ll->next)
{
con = ll->data;
zone = e_zone_current_get(con);
e_zone_update_flip(zone);
}
}
}
EAPI void
e_zone_desk_flip_by(E_Zone *zone, int dx, int dy)
{
@ -638,6 +778,14 @@ e_zone_flip_win_disable(void)
ecore_x_window_hide(zone->edge.right);
ecore_x_window_hide(zone->edge.top);
ecore_x_window_hide(zone->edge.bottom);
ecore_x_window_hide(zone->corner.left_bottom);
ecore_x_window_hide(zone->corner.left_top);
ecore_x_window_hide(zone->corner.top_left);
ecore_x_window_hide(zone->corner.top_right);
ecore_x_window_hide(zone->corner.right_top);
ecore_x_window_hide(zone->corner.right_bottom);
ecore_x_window_hide(zone->corner.bottom_right);
ecore_x_window_hide(zone->corner.bottom_left);
}
}
}
@ -661,37 +809,23 @@ e_zone_flip_win_restore(void)
E_Zone *zone;
zone = lll->data;
_e_zone_update_edge(zone);
ecore_x_window_show(zone->edge.left);
ecore_x_window_show(zone->edge.right);
ecore_x_window_show(zone->edge.top);
ecore_x_window_show(zone->edge.bottom);
ecore_x_window_show(zone->corner.left_bottom);
ecore_x_window_show(zone->corner.left_top);
ecore_x_window_show(zone->corner.top_left);
ecore_x_window_show(zone->corner.top_right);
ecore_x_window_show(zone->corner.right_top);
ecore_x_window_show(zone->corner.right_bottom);
ecore_x_window_show(zone->corner.bottom_right);
ecore_x_window_show(zone->corner.bottom_left);
}
}
}
}
EAPI void
e_zone_edge_event_register(E_Zone *zone, E_Zone_Edge edge, int reg)
{
switch (edge)
{
case E_ZONE_EDGE_LEFT:
if (reg) zone->show.left++;
else zone->show.left--;
break;
case E_ZONE_EDGE_RIGHT:
if (reg) zone->show.right++;
else zone->show.right--;
break;
case E_ZONE_EDGE_TOP:
if (reg) zone->show.top++;
else zone->show.top--;
break;
case E_ZONE_EDGE_BOTTOM:
if (reg) zone->show.bottom++;
else zone->show.bottom--;
break;
}
_e_zone_update_edge(zone);
}
/* local subsystem functions */
static void
_e_zone_free(E_Zone *zone)
@ -705,6 +839,14 @@ _e_zone_free(E_Zone *zone)
if (zone->edge.bottom) ecore_x_window_del(zone->edge.bottom);
if (zone->edge.left) ecore_x_window_del(zone->edge.left);
if (zone->edge.right) ecore_x_window_del(zone->edge.right);
if (zone->corner.left_bottom) ecore_x_window_del(zone->corner.left_bottom);
if (zone->corner.left_top) ecore_x_window_del(zone->corner.left_top);
if (zone->corner.top_left) ecore_x_window_del(zone->corner.top_left);
if (zone->corner.top_right) ecore_x_window_del(zone->corner.top_right);
if (zone->corner.right_top) ecore_x_window_del(zone->corner.right_top);
if (zone->corner.right_bottom) ecore_x_window_del(zone->corner.right_bottom);
if (zone->corner.bottom_right) ecore_x_window_del(zone->corner.bottom_right);
if (zone->corner.bottom_left) ecore_x_window_del(zone->corner.bottom_left);
/* Delete the object event callbacks */
evas_object_event_callback_del(zone->bg_event_object,
@ -713,9 +855,6 @@ _e_zone_free(E_Zone *zone)
evas_object_event_callback_del(zone->bg_event_object,
EVAS_CALLBACK_MOUSE_UP,
_e_zone_cb_bg_mouse_up);
evas_object_event_callback_del(zone->bg_event_object,
EVAS_CALLBACK_MOUSE_MOVE,
_e_zone_cb_bg_mouse_move);
if (zone->black_ecore_evas)
{
@ -826,16 +965,6 @@ _e_zone_cb_bg_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_inf
}
}
static void
_e_zone_cb_bg_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
E_Zone *zone;
Evas_Event_Mouse_Move *ev;
ev = (Evas_Event_Mouse_Move *)event_info;
zone = data;
}
static void
_e_zone_event_zone_desk_count_set_free(void *data, void *ev)
{
@ -851,78 +980,43 @@ _e_zone_cb_mouse_in(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_In *ev;
E_Event_Zone_Edge *zev;
E_Zone_Edge edge;
E_Zone *zone;
ev = event;
zone = data;
if (ev->win == zone->edge.top)
{
if (zone->flip.top)
{
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_UP;
}
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
zev->edge = E_ZONE_EDGE_TOP;
ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
}
if (ev->win == zone->edge.left)
edge = E_ZONE_EDGE_LEFT;
else if (ev->win == zone->edge.top)
edge = E_ZONE_EDGE_TOP;
else if (ev->win == zone->edge.right)
{
if (zone->flip.right)
{
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_RIGHT;
}
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
zev->edge = E_ZONE_EDGE_RIGHT;
ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
}
edge = E_ZONE_EDGE_RIGHT;
else if (ev->win == zone->edge.bottom)
{
if (zone->flip.bottom)
{
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_DOWN;
}
edge = E_ZONE_EDGE_BOTTOM;
else if ((ev->win == zone->corner.left_top) ||
(ev->win == zone->corner.top_left))
edge = E_ZONE_EDGE_TOP_LEFT;
else if ((ev->win == zone->corner.right_top) ||
(ev->win == zone->corner.top_right))
edge = E_ZONE_EDGE_TOP_RIGHT;
else if ((ev->win == zone->corner.right_bottom) ||
(ev->win == zone->corner.bottom_right))
edge = E_ZONE_EDGE_BOTTOM_RIGHT;
else if ((ev->win == zone->corner.left_bottom) ||
(ev->win == zone->corner.bottom_left))
edge = E_ZONE_EDGE_BOTTOM_LEFT;
else return 1;
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
zev->edge = E_ZONE_EDGE_BOTTOM;
ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
}
else if (ev->win == zone->edge.left)
{
if (zone->flip.left)
{
if (!zone->flip.timer)
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_LEFT;
}
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->edge = edge;
zev->x = ev->x;
zev->y = ev->y;
zev->modifiers = ev->modifiers;
ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
e_bindings_edge_in_event_handle(E_BINDING_CONTEXT_ZONE, E_OBJECT(zone), zev);
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
zev->edge = E_ZONE_EDGE_LEFT;
ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
}
return 1;
}
@ -931,29 +1025,42 @@ _e_zone_cb_mouse_out(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Out *ev;
E_Event_Zone_Edge *zev;
E_Zone_Edge edge;
E_Zone *zone;
ev = event;
zone = data;
if ((ev->win == zone->edge.top) ||
(ev->win == zone->edge.bottom) ||
(ev->win == zone->edge.left) ||
(ev->win == zone->edge.right))
{
if (zone->flip.timer)
ecore_timer_del(zone->flip.timer);
zone->flip.timer = NULL;
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
if (ev->win == zone->edge.top) zev->edge = E_ZONE_EDGE_TOP;
else if (ev->win == zone->edge.bottom) zev->edge = E_ZONE_EDGE_BOTTOM;
else if (ev->win == zone->edge.left) zev->edge = E_ZONE_EDGE_LEFT;
else if (ev->win == zone->edge.right) zev->edge = E_ZONE_EDGE_RIGHT;
ecore_event_add(E_EVENT_ZONE_EDGE_OUT, zev, NULL, NULL);
}
if (ev->win == zone->edge.left)
edge = E_ZONE_EDGE_LEFT;
else if (ev->win == zone->edge.top)
edge = E_ZONE_EDGE_TOP;
else if (ev->win == zone->edge.right)
edge = E_ZONE_EDGE_RIGHT;
else if (ev->win == zone->edge.bottom)
edge = E_ZONE_EDGE_BOTTOM;
else if ((ev->win == zone->corner.left_top) ||
(ev->win == zone->corner.top_left))
edge = E_ZONE_EDGE_TOP_LEFT;
else if ((ev->win == zone->corner.right_top) ||
(ev->win == zone->corner.top_right))
edge = E_ZONE_EDGE_TOP_RIGHT;
else if ((ev->win == zone->corner.right_bottom) ||
(ev->win == zone->corner.bottom_right))
edge = E_ZONE_EDGE_BOTTOM_RIGHT;
else if ((ev->win == zone->corner.left_bottom) ||
(ev->win == zone->corner.bottom_left))
edge = E_ZONE_EDGE_BOTTOM_LEFT;
else return 1;
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->edge = edge;
zev->x = ev->x;
zev->y = ev->y;
zev->modifiers = ev->modifiers;
ecore_event_add(E_EVENT_ZONE_EDGE_OUT, zev, NULL, NULL);
e_bindings_edge_out_event_handle(E_BINDING_CONTEXT_ZONE, E_OBJECT(zone), zev);
return 1;
}
@ -962,105 +1069,46 @@ _e_zone_cb_mouse_move(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Move *ev;
E_Event_Zone_Edge *zev;
E_Zone_Edge edge;
E_Zone *zone;
ev = event;
zone = data;
if ((ev->win == zone->edge.top) ||
(ev->win == zone->edge.bottom) ||
(ev->win == zone->edge.left) ||
(ev->win == zone->edge.right))
{
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->x = ev->x;
zev->y = ev->y;
if (ev->win == zone->edge.top) zev->edge = E_ZONE_EDGE_TOP;
else if (ev->win == zone->edge.bottom) zev->edge = E_ZONE_EDGE_BOTTOM;
else if (ev->win == zone->edge.left) zev->edge = E_ZONE_EDGE_LEFT;
else if (ev->win == zone->edge.right) zev->edge = E_ZONE_EDGE_RIGHT;
ecore_event_add(E_EVENT_ZONE_EDGE_MOVE, zev, NULL, NULL);
}
if (ev->win == zone->edge.left)
edge = E_ZONE_EDGE_LEFT;
else if (ev->win == zone->edge.top)
edge = E_ZONE_EDGE_TOP;
else if (ev->win == zone->edge.right)
edge = E_ZONE_EDGE_RIGHT;
else if (ev->win == zone->edge.bottom)
edge = E_ZONE_EDGE_BOTTOM;
else if ((ev->win == zone->corner.left_top) ||
(ev->win == zone->corner.top_left))
edge = E_ZONE_EDGE_TOP_LEFT;
else if ((ev->win == zone->corner.right_top) ||
(ev->win == zone->corner.top_right))
edge = E_ZONE_EDGE_TOP_RIGHT;
else if ((ev->win == zone->corner.right_bottom) ||
(ev->win == zone->corner.bottom_right))
edge = E_ZONE_EDGE_BOTTOM_RIGHT;
else if ((ev->win == zone->corner.left_bottom) ||
(ev->win == zone->corner.bottom_left))
edge = E_ZONE_EDGE_BOTTOM_LEFT;
else return 1;
zev = E_NEW(E_Event_Zone_Edge, 1);
zev->zone = zone;
zev->edge = edge;
zev->x = ev->x;
zev->y = ev->y;
zev->modifiers = ev->modifiers;
ecore_event_add(E_EVENT_ZONE_EDGE_MOVE, zev, NULL, NULL);
return 1;
}
static int
_e_zone_cb_timer(void *data)
{
E_Zone *zone;
E_Desk *prev = NULL, *current = NULL;
E_Event_Pointer_Warp *ev;
int x, y;
ev = E_NEW(E_Event_Pointer_Warp, 1);
if (!ev) return 0;
zone = data;
if (zone != e_zone_current_get(zone->container))
{
zone->flip.timer = NULL;
return 0;
}
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
ev->prev.x = x;
ev->prev.y = y;
prev = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current);
switch (zone->flip.direction)
{
case E_DIRECTION_UP:
if (E_ZONE_FLIP_UP(zone))
{
e_zone_desk_flip_by(zone, 0, -1);
ecore_x_pointer_warp(zone->container->win, x, zone->h - 2);
ev->curr.x = x;
ev->curr.y = zone->h - 2;
}
break;
case E_DIRECTION_RIGHT:
if (E_ZONE_FLIP_RIGHT(zone))
{
e_zone_desk_flip_by(zone, 1, 0);
ecore_x_pointer_warp(zone->container->win, 2, y);
ev->curr.y = y;
ev->curr.x = 2;
}
break;
case E_DIRECTION_DOWN:
if (E_ZONE_FLIP_DOWN(zone))
{
e_zone_desk_flip_by(zone, 0, 1);
ecore_x_pointer_warp(zone->container->win, x, 2);
ev->curr.x = x;
ev->curr.y = 2;
}
break;
case E_DIRECTION_LEFT:
if (E_ZONE_FLIP_LEFT(zone))
{
e_zone_desk_flip_by(zone, -1, 0);
ecore_x_pointer_warp(zone->container->win, zone->w - 2, y);
ev->curr.y = y;
ev->curr.x = zone->w - 2;
}
break;
}
zone->flip.timer = NULL;
current = e_desk_current_get(zone);
if (current)
ecore_event_add(E_EVENT_POINTER_WARP, ev, NULL, NULL);
else
free(ev);
return 0;
}
static int
_e_zone_cb_desk_show(void *data, int type, void *event)
_e_zone_cb_desk_after_show(void *data, int type, void *event)
{
E_Event_Desk_Show *ev;
E_Zone *zone;
@ -1069,94 +1117,33 @@ _e_zone_cb_desk_show(void *data, int type, void *event)
zone = data;
if (ev->desk->zone != zone) return 1;
_e_zone_update_flip(zone);
_e_zone_update_edge(zone);
zone->flip.switching = 0;
return 1;
}
static void
_e_zone_update_flip(E_Zone *zone)
static int
_e_zone_cb_edge_timer(void *data)
{
if (zone->flip.left) zone->show.left--;
zone->flip.left = 0;
if (zone->flip.right) zone->show.right--;
zone->flip.right = 0;
if (zone->flip.top) zone->show.top--;
zone->flip.top = 0;
if (zone->flip.bottom) zone->show.bottom--;
zone->flip.bottom = 0;
E_Zone *zone;
E_Action *act;
if (e_config->edge_flip_moving)
zone = data;
act = e_action_find(zone->flip.bind->action);
if (!act)
{
/* if we have only 1 row we can flip up/down even if we have xinerama */
int one_row = 1;
int one_col = 1;
if (eina_list_count(zone->container->zones) > 1)
{
Eina_List *zones;
E_Zone *next_zone;
int x, y;
zones = zone->container->zones;
next_zone = (E_Zone *)eina_list_data_get(zones);
x = next_zone->x;
y = next_zone->y;
zones = eina_list_next(zones);
while (zones)
{
next_zone = (E_Zone *)zones->data;
if (next_zone->x != x) one_col = 0;
if (next_zone->y != y) one_row = 0;
zones = zones->next;
}
}
if (eina_list_count(zone->container->manager->containers) > 1)
{
one_col = 0;
one_row = 0;
}
if (one_col && E_ZONE_FLIP_LEFT(zone))
{
zone->flip.left = 1;
zone->show.left++;
}
if (one_col && E_ZONE_FLIP_RIGHT(zone))
{
zone->flip.right = 1;
zone->show.right++;
}
if (one_row && E_ZONE_FLIP_UP(zone))
{
zone->flip.top = 1;
zone->show.top++;
}
if (one_row && E_ZONE_FLIP_DOWN(zone))
{
zone->flip.bottom = 1;
zone->show.bottom++;
}
E_FREE(zone->flip.ev);
return 0;
}
}
static void
_e_zone_update_edge(E_Zone *zone)
{
if (zone->show.left) ecore_x_window_show(zone->edge.left);
else ecore_x_window_hide(zone->edge.left);
if (act->func.go_edge)
act->func.go_edge(E_OBJECT(zone), zone->flip.bind->params, zone->flip.ev);
else if (act->func.go)
act->func.go(E_OBJECT(zone), zone->flip.bind->params);
if (zone->show.right) ecore_x_window_show(zone->edge.right);
else ecore_x_window_hide(zone->edge.right);
zone->flip.bind->timer = NULL;
if (zone->show.top) ecore_x_window_show(zone->edge.top);
else ecore_x_window_hide(zone->edge.top);
if (zone->show.bottom) ecore_x_window_show(zone->edge.bottom);
else ecore_x_window_hide(zone->edge.bottom);
E_FREE(zone->flip.ev);
return 0;
}
static void

View File

@ -5,10 +5,15 @@
typedef enum _E_Zone_Edge
{
E_ZONE_EDGE_NONE,
E_ZONE_EDGE_LEFT,
E_ZONE_EDGE_RIGHT,
E_ZONE_EDGE_TOP,
E_ZONE_EDGE_BOTTOM
E_ZONE_EDGE_BOTTOM,
E_ZONE_EDGE_TOP_LEFT,
E_ZONE_EDGE_TOP_RIGHT,
E_ZONE_EDGE_BOTTOM_RIGHT,
E_ZONE_EDGE_BOTTOM_LEFT
} E_Zone_Edge;
typedef struct _E_Zone E_Zone;
@ -52,20 +57,19 @@ struct _E_Zone
Eina_List *handlers;
struct {
unsigned char top : 1;
unsigned char right : 1;
unsigned char bottom : 1;
unsigned char left : 1;
Ecore_Timer *timer;
E_Direction direction;
unsigned char switching : 1;
E_Shelf *es;
E_Event_Zone_Edge *ev;
E_Binding_Edge *bind;
} flip;
struct {
Ecore_X_Window top, right, bottom, left;
} edge;
struct {
int top, right, bottom, left;
} show;
Ecore_X_Window left_top, top_left, top_right, right_top,
right_bottom, bottom_right, bottom_left, left_bottom;
} corner;
E_Action *cur_mouse_action;
Eina_List *popups;
@ -111,6 +115,7 @@ struct _E_Event_Zone_Edge
E_Zone *zone;
E_Zone_Edge edge;
int x, y;
int modifiers;
};
EAPI int e_zone_init(void);
@ -126,15 +131,12 @@ EAPI void e_zone_bg_reconfigure(E_Zone *zone);
EAPI void e_zone_flip_coords_handle(E_Zone *zone, int x, int y);
EAPI void e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count);
EAPI void e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count);
EAPI void e_zone_update_flip(E_Zone *zone);
EAPI void e_zone_update_flip_all(void);
EAPI void e_zone_desk_flip_by(E_Zone *zone, int dx, int dy);
EAPI void e_zone_desk_flip_to(E_Zone *zone, int x, int y);
EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
EAPI void e_zone_flip_win_disable(void);
EAPI void e_zone_flip_win_restore(void);
EAPI void e_zone_edge_event_register(E_Zone *zone, E_Zone_Edge edge, int reg);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;

View File

@ -154,6 +154,10 @@ if USE_MODULE_CONF_MOUSEBINDINGS
SUBDIRS += conf_mousebindings
endif
if USE_MODULE_CONF_EDGEBINDINGS
SUBDIRS += conf_edgebindings
endif
if USE_MODULE_CONF_MOUSE
SUBDIRS += conf_mouse
endif
@ -276,6 +280,7 @@ conf_dpms \
conf_shelves \
conf_keybindings \
conf_mousebindings \
conf_edgebindings \
conf_mouse \
conf_window_display \
conf_window_focus \

View File

@ -18,13 +18,10 @@ struct _E_Config_Dialog_Data
/*- BASIC -*/
int x;
int y;
int edge_flip_basic;
int flip_animate;
/*- ADVANCED -*/
int edge_flip_moving;
int edge_flip_dragging;
double edge_flip_timeout;
int flip_wrap;
int flip_mode;
int flip_interp;
@ -65,11 +62,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->x = e_config->zone_desks_x_count;
cfdata->y = e_config->zone_desks_y_count;
cfdata->edge_flip_basic = e_config->edge_flip_moving || e_config->edge_flip_dragging;
cfdata->flip_animate = e_config->desk_flip_animate_mode > 0;
cfdata->edge_flip_moving = e_config->edge_flip_moving;
cfdata->edge_flip_dragging = e_config->edge_flip_dragging;
cfdata->edge_flip_timeout = e_config->edge_flip_timeout;
cfdata->flip_wrap = e_config->desk_flip_wrap;
cfdata->flip_mode = e_config->desk_flip_animate_mode;
cfdata->flip_interp = e_config->desk_flip_animate_interpolation;
@ -132,9 +126,6 @@ _basic_apply_data(E_Config_Dialog *cdd, E_Config_Dialog_Data *cfdata)
cfdata->flip_mode = 0;
e_config->desk_flip_animate_mode = 0;
}
e_config->edge_flip_dragging = cfdata->edge_flip_basic;
e_config->edge_flip_moving = cfdata->edge_flip_basic;
e_zone_update_flip_all();
e_config_save_queue();
return 1; /* Apply was OK */
@ -167,12 +158,9 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->desk_flip_animate_interpolation = cfdata->flip_interp;
e_config->desk_flip_animate_time = cfdata->flip_speed;
e_config->edge_flip_moving = cfdata->edge_flip_moving;
e_config->edge_flip_dragging = cfdata->edge_flip_dragging;
e_config->edge_flip_timeout = cfdata->edge_flip_timeout;
e_config->desk_flip_wrap = cfdata->flip_wrap;
e_zone_update_flip_all();
e_config_save_queue();
return 1; /* Apply was OK */
}
@ -206,8 +194,6 @@ _basic_create_widgets(E_Config_Dialog *cdd, Evas *evas, E_Config_Dialog_Data *cf
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Desktop Mouse Flip"), 0);
ob = e_widget_check_add(evas, _("Flip desktops when mouse at screen edge"), &(cfdata->edge_flip_basic));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Animated flip"), &(cfdata->flip_animate));
e_widget_framelist_object_append(of, ob);
@ -245,14 +231,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
e_widget_table_object_append(ott, of, 0, 0, 1, 2, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Desktop Mouse Flip"), 0);
ob = e_widget_check_add(evas, _("Flip when moving mouse to the screen edge"), &(cfdata->edge_flip_moving));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Flip when dragging objects to the screen edge"), &(cfdata->edge_flip_dragging));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Time the mouse is at the edge before flipping:"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f sec"), 0.0, 2.0, 0.05, 0, &(cfdata->edge_flip_timeout), NULL, 200);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Wrap desktops around when flipping"), &(cfdata->flip_wrap));
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(ott, of, 1, 0, 1, 1, 1, 0, 1, 0);

View File

@ -0,0 +1,7 @@
.deps
.libs
Makefile
Makefile.in
*.lo
module.la
module.desktop

View File

@ -0,0 +1,31 @@
MAINTAINERCLEANFILES = Makefile.in
MODULE = conf_edgebindings
# data files for the module
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
files_DATA = \
e-module-$(MODULE).edj module.desktop
EXTRA_DIST = $(files_DATA)
# the module .so file
INCLUDES = -I. \
-I$(top_srcdir) \
-I$(top_srcdir)/src/modules/$(MODULE) \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/modules \
@e_cflags@
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = e_mod_main.c \
e_mod_main.h \
e_int_config_edgebindings.c \
e_int_config_edgebindings.h
module_la_LIBADD = @e_libs@ @dlopen_libs@
module_la_LDFLAGS = -module -avoid-version
module_la_DEPENDENCIES = $(top_builddir)/config.h
uninstall:
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_EDGEBINDINGS_H
#define E_INT_CONFIG_EDGEBINDINGS_H
EAPI E_Config_Dialog *e_int_config_edgebindings(E_Container *con, const char *params __UNUSED__);
#endif
#endif

View File

@ -0,0 +1,56 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#include "e_mod_main.h"
/***************************************************************************/
/**/
/* actual module specifics */
static E_Module *conf_module = NULL;
/**/
/***************************************************************************/
/***************************************************************************/
/**/
/**/
/***************************************************************************/
/***************************************************************************/
/**/
/* module setup */
EAPI E_Module_Api e_modapi =
{
E_MODULE_API_VERSION,
"Settings - Edge Bindings"
};
EAPI void *
e_modapi_init(E_Module *m)
{
e_configure_registry_category_add("keyboard_and_mouse", 40, _("Input"), NULL, "enlightenment/behavior");
e_configure_registry_item_add("keyboard_and_mouse/edge_bindings", 10, _("Edge Bindings"), NULL, "enlightenment/edges", e_int_config_edgebindings);
conf_module = m;
e_module_delayed_set(m, 1);
return m;
}
EAPI int
e_modapi_shutdown(E_Module *m)
{
E_Config_Dialog *cfd;
while ((cfd = e_config_dialog_get("E", "_config_edgebindings_dialog"))) e_object_del(E_OBJECT(cfd));
e_configure_registry_item_del("keyboard_and_mouse/edge_bindings");
e_configure_registry_category_del("keyboard_and_mouse");
conf_module = NULL;
return 1;
}
EAPI int
e_modapi_save(E_Module *m)
{
return 1;
}

View File

@ -0,0 +1,19 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H
#define E_TYPEDEFS 1
#include "e_int_config_edgebindings.h"
#undef E_TYPEDEFS
#include "e_int_config_edgebindings.h"
EAPI extern E_Module_Api e_modapi;
EAPI void *e_modapi_init (E_Module *m);
EAPI int e_modapi_shutdown (E_Module *m);
EAPI int e_modapi_save (E_Module *m);
#endif

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Type=Link
Name=Settings - Edge Bindings
Icon=e-module-conf_edgebindings
Comment=<title>E17 Settings Applet</title><br>Configure your edgebindings here.
X-Enlightenment-ModuleType=config