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)(
|
---|
35 | DeviceIntPtr /* pDev */,
|
---|
36 | ScreenPtr /* pScr */,
|
---|
37 | CursorPtr /* pCurs */
|
---|
38 | );
|
---|
39 | Bool (*UnrealizeCursor)(
|
---|
40 | DeviceIntPtr /* pDev */,
|
---|
41 | ScreenPtr /* pScr */,
|
---|
42 | CursorPtr /* pCurs */
|
---|
43 | );
|
---|
44 | void (*SetCursor)(
|
---|
45 | DeviceIntPtr /* pDev */,
|
---|
46 | ScreenPtr /* pScr */,
|
---|
47 | CursorPtr /* pCurs */,
|
---|
48 | int /* x */,
|
---|
49 | int /* y */
|
---|
50 | );
|
---|
51 | void (*MoveCursor)(
|
---|
52 | DeviceIntPtr /* pDev */,
|
---|
53 | ScreenPtr /* pScr */,
|
---|
54 | int /* x */,
|
---|
55 | int /* y */
|
---|
56 | );
|
---|
57 | Bool (*DeviceCursorInitialize)(
|
---|
58 | DeviceIntPtr /* pDev */,
|
---|
59 | ScreenPtr /* pScr */
|
---|
60 | );
|
---|
61 | void (*DeviceCursorCleanup)(
|
---|
62 | DeviceIntPtr /* pDev */,
|
---|
63 | ScreenPtr /* pScr */
|
---|
64 | );
|
---|
65 | } miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
|
---|
66 |
|
---|
67 | typedef struct _miPointerScreenFuncRec {
|
---|
68 | Bool (*CursorOffScreen)(
|
---|
69 | ScreenPtr* /* ppScr */,
|
---|
70 | int* /* px */,
|
---|
71 | int* /* py */
|
---|
72 | );
|
---|
73 | void (*CrossScreen)(
|
---|
74 | ScreenPtr /* pScr */,
|
---|
75 | int /* entering */
|
---|
76 | );
|
---|
77 | void (*WarpCursor)(
|
---|
78 | DeviceIntPtr /*pDev*/,
|
---|
79 | ScreenPtr /* pScr */,
|
---|
80 | int /* x */,
|
---|
81 | int /* y */
|
---|
82 | );
|
---|
83 | void (*EnqueueEvent)(
|
---|
84 | DeviceIntPtr /* pDev */,
|
---|
85 | InternalEvent* /* event */
|
---|
86 | );
|
---|
87 | void (*NewEventScreen)(
|
---|
88 | DeviceIntPtr /* pDev */,
|
---|
89 | ScreenPtr /* pScr */,
|
---|
90 | Bool /* set_dequeue_screen */
|
---|
91 | );
|
---|
92 | } miPointerScreenFuncRec, *miPointerScreenFuncPtr;
|
---|
93 |
|
---|
94 | extern _X_EXPORT Bool miDCInitialize(
|
---|
95 | ScreenPtr /*pScreen*/,
|
---|
96 | miPointerScreenFuncPtr /*screenFuncs*/
|
---|
97 | );
|
---|
98 |
|
---|
99 | extern _X_EXPORT Bool miPointerInitialize(
|
---|
100 | ScreenPtr /*pScreen*/,
|
---|
101 | miPointerSpriteFuncPtr /*spriteFuncs*/,
|
---|
102 | miPointerScreenFuncPtr /*screenFuncs*/,
|
---|
103 | Bool /*waitForUpdate*/
|
---|
104 | );
|
---|
105 |
|
---|
106 | extern _X_EXPORT void miPointerWarpCursor(
|
---|
107 | DeviceIntPtr /*pDev*/,
|
---|
108 | ScreenPtr /*pScreen*/,
|
---|
109 | int /*x*/,
|
---|
110 | int /*y*/
|
---|
111 | );
|
---|
112 |
|
---|
113 | /* Deprecated in favour of miPointerGetScreen. */
|
---|
114 | extern _X_EXPORT ScreenPtr miPointerCurrentScreen(
|
---|
115 | void
|
---|
116 | ) _X_DEPRECATED;
|
---|
117 |
|
---|
118 | extern _X_EXPORT ScreenPtr miPointerGetScreen(
|
---|
119 | DeviceIntPtr pDev);
|
---|
120 | extern _X_EXPORT void miPointerSetScreen(
|
---|
121 | DeviceIntPtr pDev,
|
---|
122 | int screen_num,
|
---|
123 | int x,
|
---|
124 | int y);
|
---|
125 |
|
---|
126 | /* Returns the current cursor position. */
|
---|
127 | extern _X_EXPORT void miPointerGetPosition(
|
---|
128 | DeviceIntPtr pDev,
|
---|
129 | int *x,
|
---|
130 | int *y);
|
---|
131 |
|
---|
132 | /* Moves the cursor to the specified position. May clip the co-ordinates:
|
---|
133 | * x and y are modified in-place. */
|
---|
134 | extern _X_EXPORT ScreenPtr miPointerSetPosition(
|
---|
135 | DeviceIntPtr pDev,
|
---|
136 | int mode,
|
---|
137 | double *x,
|
---|
138 | double *y);
|
---|
139 |
|
---|
140 | extern _X_EXPORT void miPointerUpdateSprite(
|
---|
141 | DeviceIntPtr pDev);
|
---|
142 |
|
---|
143 | /* Sets whether the sprite should be updated immediately on pointer moves */
|
---|
144 | extern _X_EXPORT Bool miPointerSetWaitForUpdate(
|
---|
145 | ScreenPtr pScreen,
|
---|
146 | Bool wait);
|
---|
147 |
|
---|
148 | extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec;
|
---|
149 | #define miPointerPrivKey (&miPointerPrivKeyRec)
|
---|
150 |
|
---|
151 | extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
|
---|
152 | #define miPointerScreenKey (&miPointerScreenKeyRec)
|
---|
153 |
|
---|
154 | #endif /* MIPOINTER_H */
|
---|