Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_bindings.c e_bindings.h e_border.c e_border.h e_zone.c Log Message: fix up button bindings for windows - return the action found too so we can track. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_bindings.c 30 Apr 2005 04:21:55 -0000 1.7 +++ e_bindings.c 30 Apr 2005 05:07:27 -0000 1.8 @@ -72,7 +72,7 @@ "desk_flip_by", "0 -1"); e_bindings_key_add(E_BINDING_CONTEXT_ANY, "Down", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0, - "desk_flip_by", "0 -1"); + "desk_flip_by", "0 1"); e_bindings_key_add(E_BINDING_CONTEXT_ANY, "Up", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, "window_raise", ""); @@ -226,7 +226,7 @@ } } -int +E_Action * e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev) { E_Binding_Modifier mod = 0; @@ -255,16 +255,16 @@ act->func.go_mouse(obj, bind->params, ev); else if (act->func.go) act->func.go(obj, bind->params); - return 1; + return act; } - return 0; + return NULL; } } } - return 0; + return NULL; } -int +E_Action * e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev) { E_Binding_Modifier mod = 0; @@ -293,13 +293,13 @@ act->func.end_mouse(obj, bind->params, ev); else if (act->func.end) act->func.end(obj, bind->params); - return 1; + return act; } - return 0; + return NULL; } } } - return 0; + return NULL; } /* FIXME: finish off key bindings */ @@ -394,7 +394,7 @@ } } -int +E_Action * e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev) { E_Binding_Modifier mod = 0; @@ -423,16 +423,16 @@ act->func.go_key(obj, bind->params, ev); else if (act->func.go) act->func.go(obj, bind->params); - return 1; + return act; } - return 0; + return NULL; } } } - return 0; + return NULL; } -int +E_Action * e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev) { E_Binding_Modifier mod = 0; @@ -461,13 +461,13 @@ act->func.end_key(obj, bind->params, ev); else if (act->func.end) act->func.end(obj, bind->params); - return 1; + return act; } - return 0; + return NULL; } } } - return 0; + return NULL; } /* FIXME: finish off signal bindings */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_bindings.h 29 Apr 2005 19:42:18 -0000 1.6 +++ e_bindings.h 30 Apr 2005 05:07:27 -0000 1.7 @@ -36,15 +36,15 @@ EAPI void e_bindings_mouse_del(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, char *action, char *params); EAPI void e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win); EAPI void e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win); -EAPI int e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev); -EAPI int e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev); +EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev); +EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev); EAPI void e_bindings_key_add(E_Binding_Context ctxt, char *key, E_Binding_Modifier mod, int any_mod, char *action, char *params); EAPI void e_bindings_key_del(E_Binding_Context ctxt, char *key, E_Binding_Modifier mod, int any_mod, char *action, char *params); EAPI void e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win); EAPI void e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win); -EAPI int e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev); -EAPI int e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Up *ev); +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 int e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, char *sig, char *src); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.169 retrieving revision 1.170 diff -u -3 -r1.169 -r1.170 --- e_border.c 29 Apr 2005 19:42:18 -0000 1.169 +++ e_border.c 30 Apr 2005 05:07:27 -0000 1.170 @@ -2346,8 +2346,11 @@ } bd->mouse.current.mx = ev->root.x; bd->mouse.current.my = ev->root.y; - if (e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev)) + if (!bd->cur_mouse_action) { + bd->cur_mouse_action = + e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER, + E_OBJECT(bd), ev); } } if (ev->win != bd->event_win) return 1; @@ -2399,9 +2402,20 @@ } bd->mouse.current.mx = ev->root.x; bd->mouse.current.my = ev->root.y; - if (e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev)) - { + /* bug/problem. this action COULD be deleted during a move */ + /* ... VERY unlikely though... VERY */ + /* also we dont pass the same params that went in - then again that */ + /* should be ok as we are just ending the action if it has an end */ + if (bd->cur_mouse_action) + { + if (bd->cur_mouse_action->func.end_mouse) + bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev); + else if (bd->cur_mouse_action->func.end) + bd->cur_mouse_action->func.end(E_OBJECT(bd), ""); + bd->cur_mouse_action = NULL; } + else + e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev); } if (ev->win != bd->event_win) return 1; if ((ev->button >= 1) && (ev->button <= 3)) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- e_border.h 29 Apr 2005 19:42:18 -0000 1.39 +++ e_border.h 30 Apr 2005 05:07:28 -0000 1.40 @@ -223,6 +223,7 @@ } drag; unsigned int layer; + E_Action *cur_mouse_action; }; struct _E_Border_Pending_Move_Resize =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- e_zone.c 30 Apr 2005 04:21:55 -0000 1.40 +++ e_zone.c 30 Apr 2005 05:07:28 -0000 1.41 @@ -503,7 +503,7 @@ e_zone_desk_flip_by(E_Zone *zone, int dx, int dy) { dx = zone->desk_x_current + dx; - dy = zone->desk_x_current + dy; + dy = zone->desk_y_current + dy; e_zone_desk_flip_to(zone, dx, dy); } @@ -539,6 +539,7 @@ y = x / zone->desk_x_count; x = x - (y * zone->desk_x_count); + y = y % zone->desk_y_count; e_zone_desk_flip_to(zone, x, y); } ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs