1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun Copyright 1989, 1998 The Open Group 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun Permission to use, copy, modify, distribute, and sell this software and its 6*4882a593Smuzhiyun documentation for any purpose is hereby granted without fee, provided that 7*4882a593Smuzhiyun the above copyright notice appear in all copies and that both that 8*4882a593Smuzhiyun copyright notice and this permission notice appear in supporting 9*4882a593Smuzhiyun documentation. 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun The above copyright notice and this permission notice shall be included in 12*4882a593Smuzhiyun all copies or substantial portions of the Software. 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15*4882a593Smuzhiyun IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16*4882a593Smuzhiyun FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17*4882a593Smuzhiyun OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18*4882a593Smuzhiyun AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19*4882a593Smuzhiyun CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun Except as contained in this notice, the name of The Open Group shall not be 22*4882a593Smuzhiyun used in advertising or otherwise to promote the sale, use or other dealings 23*4882a593Smuzhiyun in this Software without prior written authorization from The Open Group. 24*4882a593Smuzhiyun */ 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun #ifndef MIPOINTER_H 27*4882a593Smuzhiyun #define MIPOINTER_H 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun #include "cursor.h" 30*4882a593Smuzhiyun #include "input.h" 31*4882a593Smuzhiyun #include "privates.h" 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun typedef struct _miPointerSpriteFuncRec { 34*4882a593Smuzhiyun Bool (*RealizeCursor) (DeviceIntPtr /* pDev */ , 35*4882a593Smuzhiyun ScreenPtr /* pScr */ , 36*4882a593Smuzhiyun CursorPtr /* pCurs */ 37*4882a593Smuzhiyun ); 38*4882a593Smuzhiyun Bool (*UnrealizeCursor) (DeviceIntPtr /* pDev */ , 39*4882a593Smuzhiyun ScreenPtr /* pScr */ , 40*4882a593Smuzhiyun CursorPtr /* pCurs */ 41*4882a593Smuzhiyun ); 42*4882a593Smuzhiyun void (*SetCursor) (DeviceIntPtr /* pDev */ , 43*4882a593Smuzhiyun ScreenPtr /* pScr */ , 44*4882a593Smuzhiyun CursorPtr /* pCurs */ , 45*4882a593Smuzhiyun int /* x */ , 46*4882a593Smuzhiyun int /* y */ 47*4882a593Smuzhiyun ); 48*4882a593Smuzhiyun void (*MoveCursor) (DeviceIntPtr /* pDev */ , 49*4882a593Smuzhiyun ScreenPtr /* pScr */ , 50*4882a593Smuzhiyun int /* x */ , 51*4882a593Smuzhiyun int /* y */ 52*4882a593Smuzhiyun ); 53*4882a593Smuzhiyun Bool (*DeviceCursorInitialize) (DeviceIntPtr /* pDev */ , 54*4882a593Smuzhiyun ScreenPtr /* pScr */ 55*4882a593Smuzhiyun ); 56*4882a593Smuzhiyun void (*DeviceCursorCleanup) (DeviceIntPtr /* pDev */ , 57*4882a593Smuzhiyun ScreenPtr /* pScr */ 58*4882a593Smuzhiyun ); 59*4882a593Smuzhiyun } miPointerSpriteFuncRec, *miPointerSpriteFuncPtr; 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun typedef struct _miPointerScreenFuncRec { 62*4882a593Smuzhiyun Bool (*CursorOffScreen) (ScreenPtr * /* ppScr */ , 63*4882a593Smuzhiyun int * /* px */ , 64*4882a593Smuzhiyun int * /* py */ 65*4882a593Smuzhiyun ); 66*4882a593Smuzhiyun void (*CrossScreen) (ScreenPtr /* pScr */ , 67*4882a593Smuzhiyun int /* entering */ 68*4882a593Smuzhiyun ); 69*4882a593Smuzhiyun void (*WarpCursor) (DeviceIntPtr /*pDev */ , 70*4882a593Smuzhiyun ScreenPtr /* pScr */ , 71*4882a593Smuzhiyun int /* x */ , 72*4882a593Smuzhiyun int /* y */ 73*4882a593Smuzhiyun ); 74*4882a593Smuzhiyun } miPointerScreenFuncRec, *miPointerScreenFuncPtr; 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ , 77*4882a593Smuzhiyun miPointerScreenFuncPtr /*screenFuncs */ 78*4882a593Smuzhiyun ); 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun extern _X_EXPORT Bool miPointerInitialize(ScreenPtr /*pScreen */ , 81*4882a593Smuzhiyun miPointerSpriteFuncPtr 82*4882a593Smuzhiyun /*spriteFuncs */ , 83*4882a593Smuzhiyun miPointerScreenFuncPtr 84*4882a593Smuzhiyun /*screenFuncs */ , 85*4882a593Smuzhiyun Bool /*waitForUpdate */ 86*4882a593Smuzhiyun ); 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun extern _X_EXPORT void miPointerWarpCursor(DeviceIntPtr /*pDev */ , 89*4882a593Smuzhiyun ScreenPtr /*pScreen */ , 90*4882a593Smuzhiyun int /*x */ , 91*4882a593Smuzhiyun int /*y */ 92*4882a593Smuzhiyun ); 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun extern _X_EXPORT ScreenPtr 95*4882a593Smuzhiyun miPointerGetScreen(DeviceIntPtr pDev); 96*4882a593Smuzhiyun extern _X_EXPORT void 97*4882a593Smuzhiyun miPointerSetScreen(DeviceIntPtr pDev, int screen_num, int x, int y); 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun /* Returns the current cursor position. */ 100*4882a593Smuzhiyun extern _X_EXPORT void 101*4882a593Smuzhiyun miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y); 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun /* Moves the cursor to the specified position. May clip the co-ordinates: 104*4882a593Smuzhiyun * x and y are modified in-place. */ 105*4882a593Smuzhiyun extern _X_EXPORT ScreenPtr 106*4882a593Smuzhiyun miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y, 107*4882a593Smuzhiyun int *nevents, InternalEvent *events); 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun extern _X_EXPORT void 110*4882a593Smuzhiyun miPointerUpdateSprite(DeviceIntPtr pDev); 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun /* Invalidate current sprite, forcing reload on next 113*4882a593Smuzhiyun * sprite setting (window crossing, grab action, etc) 114*4882a593Smuzhiyun */ 115*4882a593Smuzhiyun extern _X_EXPORT void 116*4882a593Smuzhiyun miPointerInvalidateSprite(DeviceIntPtr pDev); 117*4882a593Smuzhiyun 118*4882a593Smuzhiyun /* Sets whether the sprite should be updated immediately on pointer moves */ 119*4882a593Smuzhiyun extern _X_EXPORT Bool 120*4882a593Smuzhiyun miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait); 121*4882a593Smuzhiyun 122*4882a593Smuzhiyun extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec; 123*4882a593Smuzhiyun 124*4882a593Smuzhiyun #define miPointerPrivKey (&miPointerPrivKeyRec) 125*4882a593Smuzhiyun 126*4882a593Smuzhiyun extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec; 127*4882a593Smuzhiyun 128*4882a593Smuzhiyun #define miPointerScreenKey (&miPointerScreenKeyRec) 129*4882a593Smuzhiyun 130*4882a593Smuzhiyun #endif /* MIPOINTER_H */ 131