comparison src/gui_x11.c @ 88:2b4debdc8d2c v7.0035

updated for version 7.0035
author vimboss
date Sat, 08 Jan 2005 21:49:45 +0000
parents 8c25f10d49e7
children 7fd70926e2e1
comparison
equal deleted inserted replaced
87:014ba200db86 88:2b4debdc8d2c
3274 ButtonMotionMask | PointerMotionMask, 3274 ButtonMotionMask | PointerMotionMask,
3275 FALSE, gui_x11_mouse_cb, (XtPointer)0); 3275 FALSE, gui_x11_mouse_cb, (XtPointer)0);
3276 } 3276 }
3277 3277
3278 /* 3278 /*
3279 * Get current y mouse coordinate in text window. 3279 * Get current mouse coordinates in text window.
3280 * Return -1 when unknown. 3280 */
3281 */ 3281 void
3282 int 3282 gui_mch_getmouse(int *x, int *y)
3283 gui_mch_get_mouse_x()
3284 { 3283 {
3285 int rootx, rooty, winx, winy; 3284 int rootx, rooty, winx, winy;
3286 Window root, child; 3285 Window root, child;
3287 unsigned int mask; 3286 unsigned int mask;
3288 3287
3289 if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child, 3288 if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child,
3290 &rootx, &rooty, &winx, &winy, &mask)) 3289 &rootx, &rooty, &winx, &winy, &mask)) {
3291 return winx; 3290 *x = winx;
3292 return -1; 3291 *y = winy;
3293 } 3292 } else {
3294 3293 *x = -1;
3295 int 3294 *y = -1;
3296 gui_mch_get_mouse_y() 3295 }
3297 {
3298 int rootx, rooty, winx, winy;
3299 Window root, child;
3300 unsigned int mask;
3301
3302 if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child,
3303 &rootx, &rooty, &winx, &winy, &mask))
3304 return winy;
3305 return -1;
3306 } 3296 }
3307 3297
3308 void 3298 void
3309 gui_mch_setmouse(x, y) 3299 gui_mch_setmouse(x, y)
3310 int x; 3300 int x;