Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: Ecore_X.h ecore_x.c ecore_x_window.c Log Message: some extra handy calls :) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v retrieving revision 1.155 retrieving revision 1.156 diff -u -3 -r1.155 -r1.156 --- Ecore_X.h 25 Jan 2006 13:29:42 -0000 1.155 +++ Ecore_X.h 1 Feb 2006 11:24:49 -0000 1.156 @@ -1038,6 +1038,7 @@ EAPI int ecore_x_window_visible_get(Ecore_X_Window win); EAPI Ecore_X_Window ecore_x_window_at_xy_get(int x, int y); EAPI Ecore_X_Window ecore_x_window_at_xy_with_skip_get(int x, int y, Ecore_X_Window *skip, int skip_num); +EAPI Ecore_X_Window ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y); EAPI Ecore_X_Window ecore_x_window_parent_get(Ecore_X_Window win); EAPI void ecore_x_window_background_color_set(Ecore_X_Window win, @@ -1143,7 +1144,10 @@ EAPI int ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Event_Mask mask, long d0, long d1, long d2, long d3, long d4); EAPI int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type, const void *data, int len); - +EAPI int ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y); +EAPI int ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b); +EAPI int ecore_x_mouse_up_send(Ecore_X_Window win, int x, int y, int b); + /* FIXME: these funcs need categorising */ EAPI void ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -3 -r1.103 -r1.104 --- ecore_x.c 6 Jan 2006 21:56:05 -0000 1.103 +++ ecore_x.c 1 Feb 2006 11:24:49 -0000 1.104 @@ -1652,6 +1652,81 @@ return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); } +EAPI int +ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y) +{ + XEvent xev; + XWindowAttributes att; + Window tw; + int rx, ry; + + XGetWindowAttributes(_ecore_x_disp, win, &att); + XTranslateCoordinates(_ecore_x_disp, win, att.root, x, y, &rx, &ry, &tw); + xev.xmotion.type = MotionNotify; + xev.xmotion.window = win; + xev.xmotion.root = att.root; + xev.xmotion.subwindow = win; + xev.xmotion.time = _ecore_x_event_last_time; + xev.xmotion.x = x; + xev.xmotion.y = y; + xev.xmotion.x_root = rx; + xev.xmotion.y_root = ry; + xev.xmotion.state = 0; + xev.xmotion.is_hint = 0; + xev.xmotion.same_screen = 1; + return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev); +} + +EAPI int +ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b) +{ + XEvent xev; + XWindowAttributes att; + Window tw; + int rx, ry; + + XGetWindowAttributes(_ecore_x_disp, win, &att); + XTranslateCoordinates(_ecore_x_disp, win, att.root, x, y, &rx, &ry, &tw); + xev.xbutton.type = ButtonPress; + xev.xbutton.window = win; + xev.xbutton.root = att.root; + xev.xbutton.subwindow = win; + xev.xbutton.time = _ecore_x_event_last_time; + xev.xbutton.x = x; + xev.xbutton.y = y; + xev.xbutton.x_root = rx; + xev.xbutton.y_root = ry; + xev.xbutton.state = 1 << b; + xev.xbutton.button = b; + xev.xbutton.same_screen = 1; + return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev); +} + +EAPI int +ecore_x_mouse_up_send(Ecore_X_Window win, int x, int y, int b) +{ + XEvent xev; + XWindowAttributes att; + Window tw; + int rx, ry; + + XGetWindowAttributes(_ecore_x_disp, win, &att); + XTranslateCoordinates(_ecore_x_disp, win, att.root, x, y, &rx, &ry, &tw); + xev.xbutton.type = ButtonRelease; + xev.xbutton.window = win; + xev.xbutton.root = att.root; + xev.xbutton.subwindow = win; + xev.xbutton.time = _ecore_x_event_last_time; + xev.xbutton.x = x; + xev.xbutton.y = y; + xev.xbutton.x_root = rx; + xev.xbutton.y_root = ry; + xev.xbutton.state = 0; + xev.xbutton.button = b; + xev.xbutton.same_screen = 1; + return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev); +} + EAPI void ecore_x_focus_reset(void) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- ecore_x_window.c 6 Jan 2006 20:22:09 -0000 1.45 +++ ecore_x_window.c 1 Feb 2006 11:24:49 -0000 1.46 @@ -798,6 +798,18 @@ return win ? win : root; } +EAPI Ecore_X_Window +ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y) +{ + Ecore_X_Window win, root; + + ecore_x_grab(); + win = _ecore_x_window_at_xy_get(begin, 0, 0, x, y, NULL, 0); + ecore_x_ungrab(); + + return win ? win : begin; +} + /** * Retrieves the parent window of the given window. * @param win The given window. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs