The edge/corner picker needs some love from someone who is not artistically challenged. And a proper module icon as well.
SVN revision: 39220
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;
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;
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;
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;
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;
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;
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";
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;
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;
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;
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";
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;
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;
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;
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";
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;
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";
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;
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;
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";
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;
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)
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
}
}
+/////////////////////////////////////////////////////////////////////////////
+ /*** 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
}
#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); \
}
}
+/***************************************************************************/
+#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)
{
"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)"),
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);
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 */
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;
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;
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)
{
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)
{
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;
+}
+
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;
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;
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);
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;
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
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); /**/
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); /**/
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);
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);
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)
{
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;
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);
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;
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?
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
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;
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);
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);
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;
{
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;
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;
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
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)
{
static void
_e_desk_show_end(E_Desk *desk)
{
+ E_Event_Desk_After_Show *ev;
E_Border_List *bl;
E_Border *bd;
}
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
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;
E_Desk *desk;
};
+struct _E_Event_Desk_After_Show
+{
+ E_Desk *desk;
+};
struct _E_Event_Desk_Name_Change
{
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;
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;
#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)
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)
#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)
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;
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);
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);
else
e_shelf_show(es);
- if (es->popup)
- _e_shelf_edge_event_register(es, 1);
e_shelf_toggle(es, 0);
return 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))
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;
- }
-}
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);
#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)
{
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;
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,
_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);
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 =
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);
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);
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);
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);
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
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)
{
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))
+ 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
{
- /* 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;
+ noflip:
+
+ if (zone->flip.es)
+ e_shelf_toggle(zone->flip.es, 0);
+ zone->flip.es = NULL;
+ return;
}
- else if ((one_row) && (y == (zone->h - 1)) && E_ZONE_FLIP_DOWN(zone))
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- /* 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;
+ 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);
}
- else if ((one_col) && (x == 0) && E_ZONE_FLIP_LEFT(zone))
+ ok = 0;
+ switch(edge)
{
- /* 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;
+ 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;
}
- else
+ if (!ok) return;
+ bind = e_bindings_edge_get("desk_flip_in_direction", edge);
+ if (bind)
{
- noflip:
- /* in zone */
- 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 = 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);
}
}
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)
{
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);
}
}
}
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)
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,
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)
{
}
}
-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)
{
{
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;
- }
-
- 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;
- }
+ 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_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;
}
{
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;
}
{
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;
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;
-
- if (e_config->edge_flip_moving)
- {
- /* 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++;
- }
+ E_Zone *zone;
+ E_Action *act;
- if (one_row && E_ZONE_FLIP_DOWN(zone))
- {
- zone->flip.bottom = 1;
- zone->show.bottom++;
- }
+ zone = data;
+ act = e_action_find(zone->flip.bind->action);
+ if (!act)
+ {
+ 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
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;
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;
E_Zone *zone;
E_Zone_Edge edge;
int x, y;
+ int modifiers;
};
EAPI int e_zone_init(void);
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;
SUBDIRS += conf_mousebindings
endif
+if USE_MODULE_CONF_EDGEBINDINGS
+SUBDIRS += conf_edgebindings
+endif
+
if USE_MODULE_CONF_MOUSE
SUBDIRS += conf_mouse
endif
conf_shelves \
conf_keybindings \
conf_mousebindings \
+conf_edgebindings \
conf_mouse \
conf_window_display \
conf_window_focus \
/*- 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;
{
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;
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 */
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 */
}
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);
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);
--- /dev/null
+.deps
+.libs
+Makefile
+Makefile.in
+*.lo
+module.la
+module.desktop
--- /dev/null
+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)
--- /dev/null
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+#include "e.h"
+
+#define TEXT_NONE_ACTION_EDGE _("<None>")
+#define TEXT_PRESS_EDGE_SEQUENCE _("Please select an edge,<br>" \
+ "or click <hilight>Close</hilight> to abort.<br><br>" \
+ "To change the delay of this action,<br>use the slider:" \
+ )
+
+#define TEXT_NO_PARAMS _("<None>")
+
+static void *_create_data(E_Config_Dialog *cfd);
+static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
+ E_Config_Dialog_Data *cfdata);
+
+/********* private functions ***************/
+static void _fill_actions_list(E_Config_Dialog_Data *cfdata);
+
+/**************** Updates ***********/
+static void _update_edge_binding_list(E_Config_Dialog_Data *cfdata);
+static void _update_action_list(E_Config_Dialog_Data *cfdata);
+static void _update_action_params(E_Config_Dialog_Data *cfdata);
+static void _update_buttons(E_Config_Dialog_Data *cfdata);
+
+/**************** Callbacks *********/
+static void _binding_change_cb(void *data);
+static void _action_change_cb(void *data);
+static void _delete_all_edge_binding_cb(void *data, void *data2);
+static void _delete_edge_binding_cb(void *data, void *data2);
+static void _restore_edge_binding_defaults_cb(void *data, void *data2);
+static void _add_edge_binding_cb(void *data, void *data2);
+static void _modify_edge_binding_cb(void *data, void *data2);
+
+/********* Helper *************************/
+static char *_edge_binding_text_get(E_Zone_Edge edge, float delay, int mod);
+static void _auto_apply_changes(E_Config_Dialog_Data *cfdata);
+static void _find_edge_binding_action(const char *action, const char *params, int *g, int *a, int *n);
+
+/********* Sorting ************************/
+static int _edge_binding_sort_cb(const void *d1, const void *d2);
+
+/**************** grab window *******/
+static void _edge_grab_wnd_show(E_Config_Dialog_Data *cfdata);
+static void _edge_grab_wnd_cb_apply(void *data, E_Dialog *dia);
+static void _edge_grab_wnd_cb_close(void *data, E_Dialog *dia);
+static void _edge_grab_wnd_slider_changed_cb(void *data, Evas_Object *obj);
+static void _edge_grab_wnd_selected_edge_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _edge_grab_wnd_selection_apply(E_Config_Dialog_Data *cfdata);
+
+struct _E_Config_Dialog_Data
+{
+ Evas *evas;
+ struct
+ {
+ Eina_List *edge;
+ } binding;
+ struct
+ {
+ char *binding, *action, *params;
+ const char *cur;
+ double delay;
+ int cur_act, add;
+ E_Zone_Edge edge;
+ int modifiers;
+
+ E_Dialog *dia;
+ } locals;
+ struct
+ {
+ Evas_Object *o_add, *o_mod, *o_del, *o_del_all;
+ Evas_Object *o_binding_list, *o_action_list;
+ Evas_Object *o_params, *o_selector, *o_slider;
+ } gui;
+
+ const char *params;
+ E_Config_Dialog *cfd;
+};
+
+EAPI E_Config_Dialog *
+e_int_config_edgebindings(E_Container *con, const char *params)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_edgebindings_dialog")) return NULL;
+ v = E_NEW(E_Config_Dialog_View, 1);
+
+ v->create_cfdata = _create_data;
+ v->free_cfdata = _free_data;
+ v->basic.apply_cfdata = _basic_apply_data;
+ v->basic.create_widgets = _basic_create_widgets;
+ v->override_auto_apply = 1;
+
+ cfd = e_config_dialog_new(con, _("Edge Binding Settings"), "E",
+ "_config_edgebindings_dialog",
+ "enlightenment/edges", 0, v, NULL);
+ if ((params) && (params[0]))
+ {
+ cfd->cfdata->params = eina_stringshare_add(params);
+ _add_edge_binding_cb(cfd->cfdata, NULL);
+ }
+
+ return cfd;
+}
+
+static void
+_fill_data(E_Config_Dialog_Data *cfdata)
+{
+ Eina_List *l = NULL;
+ E_Config_Binding_Edge *bi, *bi2;
+
+ cfdata->locals.action = strdup("");
+ cfdata->locals.params = strdup("");
+ cfdata->locals.binding = strdup("");
+ cfdata->locals.cur = NULL;
+ cfdata->locals.dia = NULL;
+ cfdata->locals.delay = 0.3;
+ cfdata->binding.edge = NULL;
+
+ for (l = e_config->edge_bindings; l; l = l->next)
+ {
+ bi = l->data;
+ if (!bi) continue;
+
+ bi2 = E_NEW(E_Config_Binding_Edge, 1);
+ bi2->context = bi->context;
+ bi2->edge = bi->edge;
+ bi2->modifiers = bi->modifiers;
+ bi2->any_mod = bi->any_mod;
+ bi2->delay = bi->delay;
+ bi2->action = bi->action == NULL ? NULL : eina_stringshare_add(bi->action);
+ bi2->params = bi->params == NULL ? NULL : eina_stringshare_add(bi->params);
+
+ cfdata->binding.edge = eina_list_append(cfdata->binding.edge, bi2);
+ }
+}
+
+static void *
+_create_data(E_Config_Dialog *cfd)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = E_NEW(E_Config_Dialog_Data, 1);
+ cfdata->cfd = cfd;
+ _fill_data(cfdata);
+
+ return cfdata;
+}
+
+static void
+_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ E_Config_Binding_Edge *bi;
+
+ while (cfdata->binding.edge)
+ {
+ bi = cfdata->binding.edge->data;
+ if (bi->action) eina_stringshare_del(bi->action);
+ if (bi->params) eina_stringshare_del(bi->params);
+ E_FREE(bi);
+ cfdata->binding.edge = eina_list_remove_list(cfdata->binding.edge, cfdata->binding.edge);
+ }
+
+ if (cfdata->locals.cur) eina_stringshare_del(cfdata->locals.cur);
+ if (cfdata->locals.binding) free(cfdata->locals.binding);
+ if (cfdata->locals.action) free(cfdata->locals.action);
+ if (cfdata->locals.params) free(cfdata->locals.params);
+ if (cfdata->params) eina_stringshare_del(cfdata->params);
+ E_FREE(cfdata);
+}
+
+static int
+_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ Eina_List *l = NULL;
+ E_Config_Binding_Edge *bi, *bi2;
+
+ _auto_apply_changes(cfdata);
+
+ while (e_config->edge_bindings)
+ {
+ bi = e_config->edge_bindings->data;
+ e_bindings_edge_del(bi->context, bi->edge, bi->modifiers, bi->any_mod,
+ bi->action, bi->params, bi->delay);
+ e_config->edge_bindings =
+ eina_list_remove_list(e_config->edge_bindings, e_config->edge_bindings);
+
+ if (bi->action) eina_stringshare_del(bi->action);
+ if (bi->params) eina_stringshare_del(bi->params);
+ E_FREE(bi);
+ }
+
+ for (l = cfdata->binding.edge; l; l = l->next)
+ {
+ bi2 = l->data;
+
+ if (bi2->edge < 0) continue;
+
+ bi = E_NEW(E_Config_Binding_Edge, 1);
+ bi->context = bi2->context;
+ bi->edge = bi2->edge;
+ bi->modifiers = bi2->modifiers;
+ bi->any_mod = bi2->any_mod;
+ bi->delay = bi2->delay;
+ bi->action =
+ ((!bi2->action) || (!bi2->action[0])) ? NULL : eina_stringshare_add(bi2->action);
+ bi->params =
+ ((!bi2->params) || (!bi2->params[0])) ? NULL : eina_stringshare_add(bi2->params);
+
+ e_config->edge_bindings = eina_list_append(e_config->edge_bindings, bi);
+ e_bindings_edge_add(bi->context, bi->edge, bi->modifiers, bi->any_mod,
+ bi->action, bi->params, bi->delay);
+ }
+ e_config_save_queue();
+
+ return 1;
+}
+
+static Evas_Object *
+_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *o, *ot, *of, *ob;
+
+ cfdata->evas = evas;
+ o = e_widget_list_add(evas, 0, 1);
+
+ of = e_widget_frametable_add(evas, _("Edge Bindings"), 0);
+ ob = e_widget_ilist_add(evas, 32, 32, &(cfdata->locals.binding));
+ cfdata->gui.o_binding_list = ob;
+ e_widget_min_size_set(ob, 200, 200);
+ e_widget_frametable_object_append(of, ob, 0, 0, 2, 1, 1, 1, 1, 1);
+ ob = e_widget_button_add(evas, _("Add Edge"), NULL, _add_edge_binding_cb, cfdata, NULL);
+ cfdata->gui.o_add = ob;
+ e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_button_add(evas, _("Delete Edge"), NULL, _delete_edge_binding_cb, cfdata, NULL);
+ cfdata->gui.o_del = ob;
+ e_widget_disabled_set(ob, 1);
+ e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_button_add(evas, _("Modify Edge"), NULL, _modify_edge_binding_cb, cfdata, NULL);
+ cfdata->gui.o_mod = ob;
+ e_widget_disabled_set(ob, 1);
+ e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_button_add(evas, _("Delete All"), NULL, _delete_all_edge_binding_cb, cfdata, NULL);
+ cfdata->gui.o_del_all = ob;
+ e_widget_disabled_set(ob, 1);
+ e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_button_add(evas, _("Restore Default Bindings"), "enlightenment/e", _restore_edge_binding_defaults_cb, cfdata, NULL);
+ e_widget_frametable_object_append(of, ob, 0, 3, 2, 1, 1, 0, 1, 0);
+ e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+ ot = e_widget_table_add(evas, 0);
+ of = e_widget_framelist_add(evas, _("Action"), 0);
+ ob = e_widget_ilist_add(evas, 24, 24, &(cfdata->locals.action));
+ cfdata->gui.o_action_list = ob;
+ e_widget_min_size_set(ob, 200, 280);
+ e_widget_framelist_object_append(of, ob);
+ e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
+
+ of = e_widget_framelist_add(evas, _("Action Params"), 0);
+ ob = e_widget_entry_add(evas, &(cfdata->locals.params), NULL, NULL, NULL);
+ cfdata->gui.o_params = ob;
+ e_widget_disabled_set(ob, 1);
+ e_widget_framelist_object_append(of, ob);
+ e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 1, 1, 0);
+ e_widget_list_object_append(o, ot, 1, 1, 0.5);
+
+ _update_edge_binding_list(cfdata);
+ _fill_actions_list(cfdata);
+
+ e_dialog_resizable_set(cfd->dia, 1);
+ return o;
+}
+
+static void
+_fill_actions_list(E_Config_Dialog_Data *cfdata)
+{
+ char buf[1024];
+ Eina_List *l, *l2;
+ E_Action_Group *actg;
+ E_Action_Description *actd;
+ int g, a;
+
+ evas_event_freeze(evas_object_evas_get(cfdata->gui.o_action_list));
+ edje_freeze();
+ e_widget_ilist_freeze(cfdata->gui.o_action_list);
+
+ e_widget_ilist_clear(cfdata->gui.o_action_list);
+ for (l = e_action_groups_get(), g = 0; l; l = l->next, g++)
+ {
+ actg = l->data;
+
+ if (!actg->acts) continue;
+
+ e_widget_ilist_header_append(cfdata->gui.o_action_list, NULL, actg->act_grp);
+
+ for (l2 = actg->acts, a = 0; l2; l2 = l2->next, a++)
+ {
+ actd = l2->data;
+
+ snprintf(buf, sizeof(buf), "%d %d", g, a);
+ e_widget_ilist_append(cfdata->gui.o_action_list, NULL, actd->act_name,
+ _action_change_cb, cfdata, buf);
+ }
+ }
+ e_widget_ilist_go(cfdata->gui.o_action_list);
+ e_widget_ilist_thaw(cfdata->gui.o_action_list);
+ edje_thaw();
+ evas_event_thaw(evas_object_evas_get(cfdata->gui.o_action_list));
+}
+
+/**************** Callbacks *********/
+
+static void
+_add_edge_binding_cb(void *data, void *data2)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+
+ _auto_apply_changes(cfdata);
+
+ cfdata->locals.add = 1;
+ _edge_grab_wnd_show(cfdata);
+}
+
+static void
+_modify_edge_binding_cb(void *data, void *data2)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+
+ _auto_apply_changes(cfdata);
+
+ cfdata->locals.add = 0;
+ if (cfdata->locals.cur && cfdata->locals.cur[0])
+ {
+ E_Config_Binding_Edge *bi;
+ int n;
+
+ if (sscanf(cfdata->locals.cur, "e%d", &n) != 1)
+ return;
+
+ bi = eina_list_nth(cfdata->binding.edge, n);
+ cfdata->locals.edge = bi->edge;
+ cfdata->locals.delay = ((double) bi->delay);
+ cfdata->locals.modifiers = bi->modifiers;
+ }
+ else return;
+ _edge_grab_wnd_show(cfdata);
+}
+
+static void
+_binding_change_cb(void *data)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+
+ _auto_apply_changes(cfdata);
+ if (cfdata->locals.cur) eina_stringshare_del(cfdata->locals.cur);
+ cfdata->locals.cur = NULL;
+
+ if ((!cfdata->locals.binding) || (!cfdata->locals.binding[0])) return;
+
+ cfdata->locals.cur = eina_stringshare_add(cfdata->locals.binding);
+
+ _update_buttons(cfdata);
+ _update_action_list(cfdata);
+}
+
+static void
+_action_change_cb(void *data)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+ _update_action_params(cfdata);
+}
+
+static void
+_delete_all_edge_binding_cb(void *data, void *data2)
+{
+ E_Config_Binding_Edge *bi;
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+
+ while (cfdata->binding.edge)
+ {
+ bi = cfdata->binding.edge->data;
+ if (bi->action) eina_stringshare_del(bi->action);
+ if (bi->params) eina_stringshare_del(bi->params);
+ E_FREE(bi);
+
+ cfdata->binding.edge = eina_list_remove_list(cfdata->binding.edge, cfdata->binding.edge);
+ }
+
+ if (cfdata->locals.cur) eina_stringshare_del(cfdata->locals.cur);
+ cfdata->locals.cur = NULL;
+
+ e_widget_ilist_clear(cfdata->gui.o_binding_list);
+ e_widget_ilist_go(cfdata->gui.o_binding_list);
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+
+ _update_buttons(cfdata);
+}
+
+static void
+_delete_edge_binding_cb(void *data, void *data2)
+{
+ Eina_List *l = NULL;
+ int sel, n;
+ E_Config_Dialog_Data *cfdata;
+ E_Config_Binding_Edge *bi;
+
+ cfdata = data;
+
+ sel = e_widget_ilist_selected_get(cfdata->gui.o_binding_list);
+ if (cfdata->locals.binding[0] == 'e')
+ {
+ if (sscanf(cfdata->locals.binding, "e%d", &n) != 1)
+ return;
+
+ l = eina_list_nth_list(cfdata->binding.edge, n);
+
+ if (l)
+ {
+ bi = l->data;
+ if (bi->action) eina_stringshare_del(bi->action);
+ if (bi->params) eina_stringshare_del(bi->params);
+ E_FREE(bi);
+ cfdata->binding.edge = eina_list_remove_list(cfdata->binding.edge, l);
+ }
+ }
+
+ _update_edge_binding_list(cfdata);
+
+ if (sel >= e_widget_ilist_count(cfdata->gui.o_binding_list))
+ sel = e_widget_ilist_count(cfdata->gui.o_binding_list) - 1;
+
+ if (cfdata->locals.cur) eina_stringshare_del(cfdata->locals.cur);
+ cfdata->locals.cur = NULL;
+
+ e_widget_ilist_selected_set(cfdata->gui.o_binding_list, sel);
+ if (sel < 0)
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ _update_buttons(cfdata);
+ }
+}
+static void
+_restore_edge_binding_defaults_cb(void *data, void *data2)
+{
+ E_Config_Dialog_Data *cfdata;
+ E_Config_Binding_Edge *bi;
+
+ cfdata = data;
+
+ while (cfdata->binding.edge)
+ {
+ bi = cfdata->binding.edge->data;
+ if (bi->action) eina_stringshare_del(bi->action);
+ if (bi->params) eina_stringshare_del(bi->params);
+ E_FREE(bi);
+ cfdata->binding.edge = eina_list_remove_list(cfdata->binding.edge, cfdata->binding.edge);
+ }
+
+#define CFG_EDGEBIND_DFLT(_context, _edge, _modifiers, _anymod, _action, _params, _delay) \
+ bi = E_NEW(E_Config_Binding_Edge, 1); \
+ bi->context = _context; \
+ bi->edge = _edge; \
+ bi->modifiers = _modifiers; \
+ bi->any_mod = _anymod; \
+ bi->delay = _delay; \
+ bi->action = _action == NULL ? NULL : eina_stringshare_add(_action); \
+ bi->params = _params == NULL ? NULL : eina_stringshare_add(_params); \
+ cfdata->binding.edge = eina_list_append(cfdata->binding.edge, bi)
+
+ CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT,
+ 0, 0, "desk_flip_in_direction", NULL, 0.3);
+ CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT,
+ 0, 0, "desk_flip_in_direction", NULL, 0.3);
+ CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP,
+ 0, 0, "desk_flip_in_direction", NULL, 0.3);
+ CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM,
+ 0, 0, "desk_flip_in_direction", NULL, 0.3);
+
+ if (cfdata->locals.cur) eina_stringshare_del(cfdata->locals.cur);
+ cfdata->locals.cur = NULL;
+
+ _update_edge_binding_list(cfdata);
+ _update_buttons(cfdata);
+
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+}
+
+/**************** Updates ***********/
+static void
+_update_action_list(E_Config_Dialog_Data *cfdata)
+{
+ E_Config_Binding_Edge *bi;
+ int j = -1, i, n;
+ const char *action, *params;
+
+ if (!cfdata->locals.cur) return;
+
+ if (cfdata->locals.cur[0] == 'e')
+ {
+ if (sscanf(cfdata->locals.cur, "e%d", &n) != 1)
+ return;
+
+ bi = eina_list_nth(cfdata->binding.edge, n);
+ if (!bi)
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ return;
+ }
+ action = bi->action;
+ params = bi->params;
+ }
+ else
+ return;
+
+ _find_edge_binding_action(action, params, NULL, NULL, &j);
+
+ if (j >= 0)
+ {
+ for (i = 0; i < e_widget_ilist_count(cfdata->gui.o_action_list); i++)
+ {
+ if (i > j) break;
+ if (e_widget_ilist_nth_is_header(cfdata->gui.o_action_list, i)) j++;
+ }
+ }
+
+ if (j >= 0)
+ {
+ if (j == e_widget_ilist_selected_get(cfdata->gui.o_action_list))
+ _update_action_params(cfdata);
+ else
+ e_widget_ilist_selected_set(cfdata->gui.o_action_list, j);
+ }
+ else
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ if (cfdata->locals.action) free(cfdata->locals.action);
+ cfdata->locals.action = strdup("");
+ e_widget_entry_clear(cfdata->gui.o_params);
+ }
+
+ /*if (cfdata->locals.cur[0] == 'e')
+ {
+ sscanf(cfdata->locals.cur, "e%d", &n);
+ bi = eina_list_nth(cfdata->binding.edge, n);
+ if (!bi)
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ return;
+ }
+
+ _find_edge_binding_action(bi, NULL, NULL, &j);
+ if (j >= 0)
+ {
+ for (i = 0; i < e_widget_ilist_count(cfdata->gui.o_action_list); i++)
+ {
+ if (i > j) break;
+ if (e_widget_ilist_nth_is_header(cfdata->gui.o_action_list, i)) j++;
+ }
+ }
+
+ if (j >= 0)
+ {
+ if (j == e_widget_ilist_selected_get(cfdata->gui.o_action_list))
+ _update_action_params(cfdata);
+ else
+ e_widget_ilist_selected_set(cfdata->gui.o_action_list, j);
+ }
+ else
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ if (cfdata->locals.action) free(cfdata->locals.action);
+ cfdata->locals.action = strdup("");
+ e_widget_entry_clear(cfdata->gui.o_params);
+ }
+ }*/
+}
+
+static void
+_update_action_params(E_Config_Dialog_Data *cfdata)
+{
+ int g, a, b;
+ E_Action_Group *actg;
+ E_Action_Description *actd;
+ E_Config_Binding_Edge *bi;
+ const char *action, *params;
+
+#define EDGE_EXAMPLE_PARAMS \
+ if ((!actd->param_example) || (!actd->param_example[0])) \
+ e_widget_entry_text_set(cfdata->gui.o_params, TEXT_NO_PARAMS); \
+ else \
+ e_widget_entry_text_set(cfdata->gui.o_params, actd->param_example)
+
+
+ if ((!cfdata->locals.action) || (!cfdata->locals.action[0]))
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ e_widget_entry_clear(cfdata->gui.o_params);
+ return;
+ }
+ if (sscanf(cfdata->locals.action, "%d %d", &g, &a) != 2)
+ return;
+
+ actg = eina_list_nth(e_action_groups_get(), g);
+ if (!actg) return;
+ actd = eina_list_nth(actg->acts, a);
+ if (!actd) return;
+
+ if (actd->act_params)
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ e_widget_entry_text_set(cfdata->gui.o_params, actd->act_params);
+ return;
+ }
+
+ if ((!cfdata->locals.cur) || (!cfdata->locals.cur[0]))
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ EDGE_EXAMPLE_PARAMS;
+ return;
+ }
+
+ if (!actd->editable)
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ else
+ e_widget_disabled_set(cfdata->gui.o_params, 0);
+
+ if (cfdata->locals.cur[0] == 'e')
+ {
+ if (sscanf(cfdata->locals.cur, "e%d", &b) != 1)
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ EDGE_EXAMPLE_PARAMS;
+ return;
+ }
+
+ bi = eina_list_nth(cfdata->binding.edge, b);
+ if (!bi)
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ EDGE_EXAMPLE_PARAMS;
+ return;
+ }
+ action = bi->action;
+ params = bi->params;
+ }
+ else
+ {
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ EDGE_EXAMPLE_PARAMS;
+ return;
+ }
+
+ if (action)
+ {
+ if (!strcmp(action, actd->act_cmd))
+ {
+ if ((!params) || (!params[0]))
+ EDGE_EXAMPLE_PARAMS;
+ else
+ e_widget_entry_text_set(cfdata->gui.o_params, params);
+ }
+ else
+ EDGE_EXAMPLE_PARAMS;
+ }
+ else
+ EDGE_EXAMPLE_PARAMS;
+}
+
+static void
+_update_edge_binding_list(E_Config_Dialog_Data *cfdata)
+{
+ int i;
+ char *b, b2[64];
+ Eina_List *l;
+ E_Config_Binding_Edge *bi;
+
+ evas_event_freeze(evas_object_evas_get(cfdata->gui.o_binding_list));
+ edje_freeze();
+ e_widget_ilist_freeze(cfdata->gui.o_binding_list);
+
+ e_widget_ilist_clear(cfdata->gui.o_binding_list);
+ e_widget_ilist_go(cfdata->gui.o_binding_list);
+
+ if (cfdata->binding.edge)
+ {
+ cfdata->binding.edge = eina_list_sort(cfdata->binding.edge,
+ eina_list_count(cfdata->binding.edge), _edge_binding_sort_cb);
+ }
+
+ for (l = cfdata->binding.edge, i = 0; l; l = l->next, i++)
+ {
+ Evas_Object *ic;
+
+ bi = l->data;
+
+ b = _edge_binding_text_get(bi->edge, bi->delay, bi->modifiers);
+ if (!b) continue;
+
+ ic = edje_object_add(cfdata->evas);
+ e_util_edje_icon_set(ic, "enlightenment/edges");
+
+ snprintf(b2, sizeof(b2), "e%d", i);
+ e_widget_ilist_append(cfdata->gui.o_binding_list, ic, b,
+ _binding_change_cb, cfdata, b2);
+ free(b);
+ }
+ e_widget_ilist_go(cfdata->gui.o_binding_list);
+
+ e_widget_ilist_thaw(cfdata->gui.o_binding_list);
+ edje_thaw();
+ evas_event_thaw(evas_object_evas_get(cfdata->gui.o_binding_list));
+
+ if (eina_list_count(cfdata->binding.edge))
+ e_widget_disabled_set(cfdata->gui.o_del_all, 0);
+ else
+ e_widget_disabled_set(cfdata->gui.o_del_all, 1);
+}
+
+static void
+_update_buttons(E_Config_Dialog_Data *cfdata)
+{
+ if (e_widget_ilist_count(cfdata->gui.o_binding_list))
+ e_widget_disabled_set(cfdata->gui.o_del_all, 0);
+ else
+ e_widget_disabled_set(cfdata->gui.o_del_all, 1);
+
+ if (!cfdata->locals.cur)
+ {
+ e_widget_disabled_set(cfdata->gui.o_mod, 1);
+ e_widget_disabled_set(cfdata->gui.o_del, 1);
+ return;
+ }
+ e_widget_disabled_set(cfdata->gui.o_mod, 0);
+ e_widget_disabled_set(cfdata->gui.o_del, 0);
+}
+
+/*************** Sorting *****************************/
+static int
+_edge_binding_sort_cb(const void *d1, const void *d2)
+{
+ int i, j;
+ const E_Config_Binding_Edge *bi, *bi2;
+
+ bi = d1;
+ bi2 = d2;
+
+ i = 0; j = 0;
+ if (bi->modifiers & E_BINDING_MODIFIER_CTRL) i++;
+ if (bi->modifiers & E_BINDING_MODIFIER_ALT) i++;
+ if (bi->modifiers & E_BINDING_MODIFIER_SHIFT) i++;
+ if (bi->modifiers & E_BINDING_MODIFIER_WIN) i++;
+
+ if (bi2->modifiers & E_BINDING_MODIFIER_CTRL) j++;
+ if (bi2->modifiers & E_BINDING_MODIFIER_ALT) j++;
+ if (bi2->modifiers & E_BINDING_MODIFIER_SHIFT) j++;
+ if (bi2->modifiers & E_BINDING_MODIFIER_WIN) j++;
+
+ if (i < j) return -1;
+ else if (i > j) return 1;
+
+ if (bi->modifiers < bi2->modifiers) return -1;
+ else if (bi->modifiers > bi2->modifiers) return 1;
+
+ if (bi->edge < bi2->edge) return -1;
+ else if (bi->edge > bi2->edge) return 1;
+
+ return 0;
+}
+
+/**************** grab window *******/
+static void
+_edge_grab_wnd_show(E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *o, *obg, *os;
+ E_Manager *man;
+ Evas *evas;
+ Evas_Coord minw, minh;
+ const char *bgfile;
+ int tw, th;
+
+ if (cfdata->locals.dia != 0) return;
+
+ man = e_manager_current_get();
+
+ cfdata->locals.dia = e_dialog_normal_win_new(e_container_current_get(man),
+ "E", "_edgebind_getedge_dialog");
+ if (!cfdata->locals.dia) return;
+ e_dialog_title_set(cfdata->locals.dia, _("Edge Binding Sequence"));
+ e_dialog_icon_set(cfdata->locals.dia, "enlightenment/edges", 48);
+ e_dialog_button_add(cfdata->locals.dia, _("Apply"), NULL, _edge_grab_wnd_cb_apply, cfdata);
+ e_dialog_button_add(cfdata->locals.dia, _("Close"), NULL, _edge_grab_wnd_cb_close, cfdata);
+ e_win_centered_set(cfdata->locals.dia->win, 1);
+
+ evas = e_win_evas_get(cfdata->locals.dia->win);
+
+ cfdata->gui.o_selector = o = edje_object_add(evas);
+ e_theme_edje_object_set(o, "base/theme/modules/conf_edgebindings",
+ "e/modules/conf_edgebindings/selection");
+
+ cfdata->gui.o_slider = os = e_widget_slider_add(evas, 1, 0, _("%.2f seconds"), 0.0, 2.0, 0.05, 0, &(cfdata->locals.delay), NULL, 200);
+ edje_object_part_swallow(o, "e.swallow.slider", os);
+ e_widget_on_change_hook_set(os, _edge_grab_wnd_slider_changed_cb, cfdata);
+ evas_object_show(os);
+
+ edje_object_part_text_set(o, "e.text.description", TEXT_PRESS_EDGE_SEQUENCE);
+
+ edje_object_size_min_get(o, &minw, &minh);
+ if (!minw || !minh)
+ edje_object_size_min_calc(o, &minw, &minh);
+
+ e_dialog_content_set(cfdata->locals.dia, o, minw, minh);
+
+ bgfile = e_bg_file_get(0, 0, 0, 0);
+ obg = e_thumb_icon_add(evas);
+ e_icon_fill_inside_set(obg, 0);
+ e_thumb_icon_file_set(obg, bgfile, "e/desktop/background");
+ edje_object_part_geometry_get(o, "e.swallow.background", NULL, NULL, &tw, &th);
+ e_thumb_icon_size_set(obg, tw, th);
+ edje_object_part_swallow(o, "e.swallow.background", obg);
+ e_thumb_icon_begin(obg);
+ evas_object_show(obg);
+
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
+ _edge_grab_wnd_selected_edge_cb, cfdata);
+
+ e_dialog_show(cfdata->locals.dia);
+ ecore_x_icccm_transient_for_set(cfdata->locals.dia->win->evas_win, cfdata->cfd->dia->win->evas_win);
+}
+
+static void
+_edge_grab_wnd_hide(E_Config_Dialog_Data *cfdata)
+{
+ e_object_del(E_OBJECT(cfdata->locals.dia));
+ cfdata->locals.dia = NULL;
+}
+
+static void
+_edge_grab_wnd_cb_apply(void *data, E_Dialog *dia)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+ _edge_grab_wnd_selection_apply(cfdata);
+ _edge_grab_wnd_hide(cfdata);
+}
+
+static void
+_edge_grab_wnd_cb_close(void *data, E_Dialog *dia)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+ _edge_grab_wnd_hide(cfdata);
+}
+
+static void
+_edge_grab_wnd_slider_changed_cb(void *data, Evas_Object *obj)
+{
+ E_Config_Dialog_Data *cfdata;
+ cfdata = data;
+ char *label = NULL;
+
+ if (!cfdata->locals.edge) return;
+ label = _edge_binding_text_get(cfdata->locals.edge, ((float) cfdata->locals.delay), cfdata->locals.modifiers);
+ edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
+ if (label) E_FREE(label);
+}
+
+static void
+_edge_grab_wnd_selected_edge_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *event;
+ E_Config_Dialog_Data *cfdata;
+ E_Zone_Edge edge;
+ Evas_Coord xx, yy, x, y, w, h;
+ char *label;
+
+ if (!(cfdata = data)) return;
+ if (!(event = event_info)) return;
+ if (event->button != 1) return;
+
+ evas_object_geometry_get(cfdata->gui.o_selector, &xx, &yy, NULL, NULL);
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.top_left", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_TOP_LEFT;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.top", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_TOP;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.top_right", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_TOP_RIGHT;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.right", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_RIGHT;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.bottom_right", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_BOTTOM_RIGHT;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.bottom", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_BOTTOM;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.bottom_left", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_BOTTOM_LEFT;
+ goto stop;
+ }
+ edje_object_part_geometry_get(cfdata->gui.o_selector, "e.edge.left", &x, &y, &w, &h);
+ if (E_INSIDE(event->canvas.x, event->canvas.y, x + xx, y + yy, w, h))
+ {
+ edge = E_ZONE_EDGE_LEFT;
+ goto stop;
+ }
+ return;
+
+stop:
+ cfdata->locals.edge = edge;
+ cfdata->locals.modifiers = 0;
+
+ if (evas_key_modifier_is_set(event->modifiers, "Control"))
+ cfdata->locals.modifiers |= E_BINDING_MODIFIER_CTRL;
+ if (evas_key_modifier_is_set(event->modifiers, "Shift"))
+ cfdata->locals.modifiers |= E_BINDING_MODIFIER_SHIFT;
+ if (evas_key_modifier_is_set(event->modifiers, "Alt"))
+ cfdata->locals.modifiers |= E_BINDING_MODIFIER_ALT;
+ if (evas_key_modifier_is_set(event->modifiers, "Win"))
+ cfdata->locals.modifiers |= E_BINDING_MODIFIER_WIN;
+
+ label = _edge_binding_text_get(cfdata->locals.edge, ((float) cfdata->locals.delay), cfdata->locals.modifiers);
+ edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
+ if (label) E_FREE(label);
+}
+
+static void
+_edge_grab_wnd_selection_apply(E_Config_Dialog_Data *cfdata)
+{
+ E_Config_Binding_Edge *bi = NULL, *bi2 = NULL;
+ Eina_List *l;
+ char *label;
+ int found = 0, n = -1;
+
+ if (cfdata->locals.add)
+ {
+ found = 0;
+ for (l = cfdata->binding.edge; l && !found; l = l->next)
+ {
+ bi = l->data;
+ if ((bi->modifiers == cfdata->locals.modifiers) &&
+ (bi->edge == cfdata->locals.edge) &&
+ ((bi->delay * 1000) == (cfdata->locals.delay * 1000)))
+ found = 1;
+ }
+ }
+ else
+ {
+ if (cfdata->locals.cur && cfdata->locals.cur[0] &&
+ (sscanf(cfdata->locals.cur, "e%d", &n) == 1))
+ {
+ found = 0;
+ bi = eina_list_nth(cfdata->binding.edge, n);
+
+ for (l = cfdata->binding.edge; l && !found; l = l->next)
+ {
+ bi2 = l->data;
+ if (bi == bi2) continue;
+ if ((bi->modifiers == cfdata->locals.modifiers) &&
+ (bi->edge == cfdata->locals.edge) &&
+ ((bi->delay * 1000) == (cfdata->locals.delay * 1000)))
+ found = 1;
+ }
+ }
+ }
+
+ if (!found)
+ {
+ if (cfdata->locals.add)
+ {
+ bi = E_NEW(E_Config_Binding_Edge, 1);
+ bi->context = E_BINDING_CONTEXT_ZONE;
+ bi->edge = cfdata->locals.edge;
+ bi->any_mod = 0;
+ bi->delay = (float) (cfdata->locals.delay);
+ bi->action = NULL;
+ bi->params = NULL;
+ bi->modifiers = cfdata->locals.modifiers;
+ cfdata->binding.edge = eina_list_append(cfdata->binding.edge, bi);
+ }
+ else
+ {
+ if (cfdata->locals.cur && cfdata->locals.cur[0] &&
+ (sscanf(cfdata->locals.cur, "e%d", &n) == 1))
+ {
+ bi = eina_list_nth(cfdata->binding.edge, n);
+
+ bi->modifiers = cfdata->locals.modifiers;
+ bi->delay = cfdata->locals.delay;
+ bi->edge = cfdata->locals.edge;
+ }
+ }
+
+ if (cfdata->locals.add)
+ {
+ _update_edge_binding_list(cfdata);
+
+ for (l = cfdata->binding.edge, n = 0; l; l = l->next, n++)
+ {
+ if (l->data == bi) break;
+ }
+ e_widget_ilist_selected_set(cfdata->gui.o_binding_list, n);
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ if (cfdata->locals.action) free(cfdata->locals.action);
+ cfdata->locals.action = strdup("");
+ if ((cfdata->params) && (cfdata->params[0]))
+ {
+ int j, g = -1;
+ _find_edge_binding_action("exec", NULL, &g, NULL, &j);
+ if (j >= 0)
+ {
+ e_widget_ilist_unselect(cfdata->gui.o_action_list);
+ e_widget_ilist_selected_set(cfdata->gui.o_action_list, (j + g + 1));
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_entry_text_set(cfdata->gui.o_params, cfdata->params);
+ }
+ }
+ else
+ {
+ e_widget_entry_clear(cfdata->gui.o_params);
+ e_widget_disabled_set(cfdata->gui.o_params, 1);
+ }
+ }
+ else
+ {
+ label = _edge_binding_text_get(bi->edge, bi->delay, bi->modifiers);
+ e_widget_ilist_nth_label_set(cfdata->gui.o_binding_list, n, label);
+ free(label);
+ }
+ }
+ else
+ {
+ int g, a, j;
+ const char *label = NULL;
+ E_Action_Group *actg = NULL;
+ E_Action_Description *actd = NULL;
+
+ if (cfdata->locals.add)
+ _find_edge_binding_action(bi->action, bi->params, &g, &a, &j);
+ else
+ _find_edge_binding_action(bi2->action, bi2->params, &g, &a, &j);
+
+ actg = eina_list_nth(e_action_groups_get(), g);
+ if (actg) actd = eina_list_nth(actg->acts, a);
+
+ if (actd) label = actd->act_name;
+
+ e_util_dialog_show(_("Binding Edge Error"),
+ _("The binding key sequence, that you choose,"
+ " is already used by <br>"
+ "<hilight>%s</hilight> action.<br>"
+ "Please choose another binding edge sequence."),
+ label ? label : _("Unknown"));
+ }
+}
+
+
+/********** Helper *********************************/
+static void
+_auto_apply_changes(E_Config_Dialog_Data *cfdata)
+{
+ int n, g, a, ok;
+ E_Config_Binding_Edge *bi;
+ E_Action_Group *actg;
+ E_Action_Description *actd;
+
+ if ((!cfdata->locals.cur) || (!cfdata->locals.cur[0]) ||
+ (!cfdata->locals.action) || (!cfdata->locals.action[0])) return;
+
+ if (sscanf(cfdata->locals.cur, "e%d", &n) != 1)
+ return;
+ if (sscanf(cfdata->locals.action, "%d %d", &g, &a) != 2)
+ return;
+
+ bi = eina_list_nth(cfdata->binding.edge, n);
+ if (!bi) return;
+
+ actg = eina_list_nth(e_action_groups_get(), g);
+ if (!actg) return;
+ actd = eina_list_nth(actg->acts, a);
+ if (!actd) return;
+
+ if (bi->action) eina_stringshare_del(bi->action);
+ bi->action = NULL;
+
+ if (actd->act_cmd) bi->action = eina_stringshare_add(actd->act_cmd);
+
+ if (bi->params) eina_stringshare_del(bi->params);
+ bi->params = NULL;
+
+ if (actd->act_params)
+ bi->params = eina_stringshare_add(actd->act_params);
+ else
+ {
+ ok = 1;
+ if (cfdata->locals.params)
+ {
+ if (!strcmp(cfdata->locals.params, TEXT_NO_PARAMS))
+ ok = 0;
+
+ if ((actd->param_example) && (!strcmp(cfdata->locals.params, actd->param_example)))
+ ok = 0;
+ }
+ else
+ ok = 0;
+
+ if (ok)
+ bi->params = eina_stringshare_add(cfdata->locals.params);
+ }
+}
+
+static void
+_find_edge_binding_action(const char *action, const char *params, int *g, int *a, int *n)
+{
+ Eina_List *l, *l2;
+ int gg = -1, aa = -1, nn = -1, found;
+ E_Action_Group *actg;
+ E_Action_Description *actd;
+
+ if (g) *g = -1;
+ if (a) *a = -1;
+ if (n) *n = -1;
+
+ found = 0;
+ for (l = e_action_groups_get(), gg = 0, nn = 0; l; l = l->next, gg++)
+ {
+ actg = l->data;
+
+ for (l2 = actg->acts, aa = 0; l2; l2 = l2->next, aa++)
+ {
+ actd = l2->data;
+ if (!strcmp((!action ? "" : action), (!actd->act_cmd ? "" : actd->act_cmd)))
+ {
+ if (!params || !params[0])
+ {
+ if ((!actd->act_params) || (!actd->act_params[0]))
+ {
+ if (g) *g = gg;
+ if (a) *a = aa;
+ if (n) *n = nn;
+ return;
+ }
+ else
+ continue;
+ }
+ else
+ {
+ if ((!actd->act_params) || (!actd->act_params[0]))
+ {
+ if (g) *g = gg;
+ if (a) *a = aa;
+ if (n) *n = nn;
+ found = 1;
+ }
+ else
+ {
+ if (!strcmp(params, actd->act_params))
+ {
+ if (g) *g = gg;
+ if (a) *a = aa;
+ if (n) *n = nn;
+ return;
+ }
+ }
+ }
+ }
+ nn++;
+ }
+ if (found) break;
+ }
+
+ if (!found)
+ {
+ if (g) *g = -1;
+ if (a) *a = -1;
+ if (n) *n = -1;
+ }
+}
+
+static char *
+_edge_binding_text_get(E_Zone_Edge edge, float delay, int mod)
+{
+ char b[256] = "";
+
+ if (mod & E_BINDING_MODIFIER_CTRL)
+ strcat(b, _("CTRL"));
+
+ if (mod & E_BINDING_MODIFIER_ALT)
+ {
+ if (b[0]) strcat(b, " + ");
+ strcat(b, _("ALT"));
+ }
+
+ if (mod & E_BINDING_MODIFIER_SHIFT)
+ {
+ if (b[0]) strcat(b, " + ");
+ strcat(b, _("SHIFT"));
+ }
+
+ if (mod & E_BINDING_MODIFIER_WIN)
+ {
+ if (b[0]) strcat(b, " + ");
+ strcat(b, _("WIN"));
+ }
+
+ if (edge)
+ {
+ char *l;
+ if (b[0]) strcat(b, " + ");
+
+ if (edge == E_ZONE_EDGE_LEFT)
+ l = strdup("Left Edge");
+ else if (edge == E_ZONE_EDGE_TOP)
+ l = strdup("Top Edge");
+ else if (edge == E_ZONE_EDGE_RIGHT)
+ l = strdup("Right Edge");
+ else if (edge == E_ZONE_EDGE_BOTTOM)
+ l = strdup("Bottom Edge");
+ else if (edge == E_ZONE_EDGE_TOP_LEFT)
+ l = strdup("Top Left Edge");
+ else if (edge == E_ZONE_EDGE_TOP_RIGHT)
+ l = strdup("Top Right Edge");
+ else if (edge == E_ZONE_EDGE_BOTTOM_RIGHT)
+ l = strdup("Bottom Right Edge");
+ else if (edge == E_ZONE_EDGE_BOTTOM_LEFT)
+ l = strdup("Bottom Left Edge");
+
+ strcat(b, l);
+ free(l);
+ }
+
+ if (delay)
+ {
+ char buf[20];
+
+ if (b[0]) strcat(b, " ");
+ snprintf(buf, 20, "%.2fs", delay);
+ strcat(b, buf);
+ }
+
+ if (!b[0]) return strdup(TEXT_NONE_ACTION_EDGE);
+ return strdup(b);
+}
--- /dev/null
+#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
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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
--- /dev/null
+[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