Enlightenment CVS committal
Author : englebass
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_zone.c e_zone.h
Log Message:
Add edge events.
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_zone.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -3 -r1.124 -r1.125
--- e_zone.c 22 Nov 2007 19:46:54 -0000 1.124
+++ e_zone.c 22 Nov 2007 20:08:07 -0000 1.125
@@ -22,6 +22,8 @@
EAPI int E_EVENT_ZONE_DESK_COUNT_SET = 0;
EAPI int E_EVENT_POINTER_WARP = 0;
EAPI int E_EVENT_ZONE_MOVE_RESIZE = 0;
+EAPI int E_EVENT_ZONE_EDGE_IN = 0;
+EAPI int E_EVENT_ZONE_EDGE_OUT = 0;
#define E_ZONE_FLIP_LEFT(zone) ((e_config->desk_flip_wrap &&
((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
#define E_ZONE_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap &&
((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) <
(zone)->desk_x_count))
@@ -34,6 +36,8 @@
E_EVENT_ZONE_DESK_COUNT_SET = ecore_event_type_new();
E_EVENT_POINTER_WARP = ecore_event_type_new();
E_EVENT_ZONE_MOVE_RESIZE = ecore_event_type_new();
+ E_EVENT_ZONE_EDGE_IN = ecore_event_type_new();
+ E_EVENT_ZONE_EDGE_OUT = ecore_event_type_new();
return 1;
}
@@ -771,34 +775,67 @@
_e_zone_cb_mouse_in(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_In *ev;
+ E_Event_Zone_Edge_In *zev;
E_Zone *zone;
ev = event;
zone = data;
- if ((ev->win == zone->edge.top) && (zone->flip.top))
+ if (ev->win == zone->edge.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 ((ev->win == zone->edge.right) && (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;
- }
- else if ((ev->win == zone->edge.bottom) && (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;
- }
- else if ((ev->win == zone->edge.left) && (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;
+ 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_In, 1);
+ zev->zone = zone;
+ zev->edge = E_ZONE_EDGE_TOP;
+ ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
+ }
+ 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_In, 1);
+ zev->zone = zone;
+ zev->edge = E_ZONE_EDGE_RIGHT;
+ ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
+ }
+ 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_In, 1);
+ zev->zone = zone;
+ zev->edge = E_ZONE_EDGE_BOTTOM;
+ ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
+ }
+ else if (ev->win == zone->edge.left)
+ {
+ if (zone->flip.left)
+ {
+ if (!zone->flip.timer)
+ zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout,
_e_zone_cb_timer, zone);
+ zone->flip.direction = E_DIRECTION_LEFT;
+ }
+
+ zev = E_NEW(E_Event_Zone_Edge_In, 1);
+ zev->zone = zone;
+ zev->edge = E_ZONE_EDGE_LEFT;
+ ecore_event_add(E_EVENT_ZONE_EDGE_IN, zev, NULL, NULL);
}
return 1;
}
@@ -807,6 +844,7 @@
_e_zone_cb_mouse_out(void *data, int type, void *event)
{
Ecore_X_Event_Mouse_Out *ev;
+ E_Event_Zone_Edge_Out *zev;
E_Zone *zone;
ev = event;
@@ -820,6 +858,13 @@
if (zone->flip.timer)
ecore_timer_del(zone->flip.timer);
zone->flip.timer = NULL;
+ zev = E_NEW(E_Event_Zone_Edge_Out, 1);
+ zev->zone = zone;
+ 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);
}
return 1;
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_zone.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- e_zone.h 22 Nov 2007 19:46:54 -0000 1.44
+++ e_zone.h 22 Nov 2007 20:08:07 -0000 1.45
@@ -5,10 +5,10 @@
typedef enum _E_Zone_Edge
{
- E_ZONE_LEFT,
- E_ZONE_RIGHT,
- E_ZONE_TOP,
- E_ZONE_BOTTOM
+ E_ZONE_EDGE_LEFT,
+ E_ZONE_EDGE_RIGHT,
+ E_ZONE_EDGE_TOP,
+ E_ZONE_EDGE_BOTTOM
} E_Zone_Edge;
typedef struct _E_Zone E_Zone;
@@ -17,6 +17,8 @@
typedef struct _E_Event_Zone_Move_Resize E_Event_Zone_Move_Resize;
/* TODO: Move this to a general place? */
typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp;
+typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge_In;
+typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge_Out;
#else
#ifndef E_ZONE_H
@@ -90,6 +92,12 @@
} curr;
};
+struct _E_Event_Zone_Edge
+{
+ E_Zone *zone;
+ E_Zone_Edge edge;
+};
+
EAPI int e_zone_init(void);
EAPI int e_zone_shutdown(void);
EAPI E_Zone *e_zone_new(E_Container *con, int num, int id, int x, int y,
int w, int h);
@@ -115,6 +123,8 @@
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;
extern EAPI int E_EVENT_POINTER_WARP;
+extern EAPI int E_EVENT_ZONE_EDGE_IN;
+extern EAPI int E_EVENT_ZONE_EDGE_OUT;
#endif
#endif
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs