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