1 | /************************************************************
|
---|
2 |
|
---|
3 | Copyright 1996 by Thomas E. Dickey <[email protected]>
|
---|
4 |
|
---|
5 | All Rights Reserved
|
---|
6 |
|
---|
7 | Permission to use, copy, modify, and distribute this software and its
|
---|
8 | documentation for any purpose and without fee is hereby granted,
|
---|
9 | provided that the above copyright notice appear in all copies and that
|
---|
10 | both that copyright notice and this permission notice appear in
|
---|
11 | supporting documentation, and that the name of the above listed
|
---|
12 | copyright holder(s) not be used in advertising or publicity pertaining
|
---|
13 | to distribution of the software without specific, written prior
|
---|
14 | permission.
|
---|
15 |
|
---|
16 | THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
|
---|
17 | TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
---|
18 | AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
|
---|
19 | LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
---|
20 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
---|
21 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
---|
22 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
---|
23 |
|
---|
24 | ********************************************************/
|
---|
25 |
|
---|
26 | /********************************************************************
|
---|
27 | * Interface of 'exevents.c'
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef EXEVENTS_H
|
---|
31 | #define EXEVENTS_H
|
---|
32 |
|
---|
33 | #include <X11/extensions/XIproto.h>
|
---|
34 | #include "inputstr.h"
|
---|
35 |
|
---|
36 | /***************************************************************
|
---|
37 | * Interface available to drivers *
|
---|
38 | ***************************************************************/
|
---|
39 |
|
---|
40 | extern _X_EXPORT int InitProximityClassDeviceStruct(
|
---|
41 | DeviceIntPtr /* dev */);
|
---|
42 |
|
---|
43 | extern _X_EXPORT void InitValuatorAxisStruct(
|
---|
44 | DeviceIntPtr /* dev */,
|
---|
45 | int /* axnum */,
|
---|
46 | Atom /* label */,
|
---|
47 | int /* minval */,
|
---|
48 | int /* maxval */,
|
---|
49 | int /* resolution */,
|
---|
50 | int /* min_res */,
|
---|
51 | int /* max_res */);
|
---|
52 |
|
---|
53 | /* Input device properties */
|
---|
54 | extern _X_EXPORT void XIDeleteAllDeviceProperties(
|
---|
55 | DeviceIntPtr /* device */
|
---|
56 | );
|
---|
57 |
|
---|
58 | extern _X_EXPORT int XIDeleteDeviceProperty(
|
---|
59 | DeviceIntPtr /* device */,
|
---|
60 | Atom /* property */,
|
---|
61 | Bool /* fromClient */
|
---|
62 | );
|
---|
63 |
|
---|
64 | extern _X_EXPORT int XIChangeDeviceProperty(
|
---|
65 | DeviceIntPtr /* dev */,
|
---|
66 | Atom /* property */,
|
---|
67 | Atom /* type */,
|
---|
68 | int /* format*/,
|
---|
69 | int /* mode*/,
|
---|
70 | unsigned long /* len*/,
|
---|
71 | pointer /* value*/,
|
---|
72 | Bool /* sendevent*/
|
---|
73 | );
|
---|
74 |
|
---|
75 | extern _X_EXPORT int XIGetDeviceProperty(
|
---|
76 | DeviceIntPtr /* dev */,
|
---|
77 | Atom /* property */,
|
---|
78 | XIPropertyValuePtr* /* value */
|
---|
79 | );
|
---|
80 |
|
---|
81 | extern _X_EXPORT int XISetDevicePropertyDeletable(
|
---|
82 | DeviceIntPtr /* dev */,
|
---|
83 | Atom /* property */,
|
---|
84 | Bool /* deletable */
|
---|
85 | );
|
---|
86 |
|
---|
87 | extern _X_EXPORT long XIRegisterPropertyHandler(
|
---|
88 | DeviceIntPtr dev,
|
---|
89 | int (*SetProperty) (DeviceIntPtr dev,
|
---|
90 | Atom property,
|
---|
91 | XIPropertyValuePtr prop,
|
---|
92 | BOOL checkonly),
|
---|
93 | int (*GetProperty) (DeviceIntPtr dev,
|
---|
94 | Atom property),
|
---|
95 | int (*DeleteProperty) (DeviceIntPtr dev,
|
---|
96 | Atom property)
|
---|
97 | );
|
---|
98 |
|
---|
99 | extern _X_EXPORT void XIUnregisterPropertyHandler(
|
---|
100 | DeviceIntPtr dev,
|
---|
101 | long id
|
---|
102 | );
|
---|
103 |
|
---|
104 | extern _X_EXPORT Atom XIGetKnownProperty(
|
---|
105 | char* name
|
---|
106 | );
|
---|
107 |
|
---|
108 | extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
---|
109 |
|
---|
110 | extern _X_EXPORT int XIPropToInt(
|
---|
111 | XIPropertyValuePtr val,
|
---|
112 | int *nelem_return,
|
---|
113 | int **buf_return
|
---|
114 | );
|
---|
115 |
|
---|
116 | extern _X_EXPORT int XIPropToFloat(
|
---|
117 | XIPropertyValuePtr val,
|
---|
118 | int *nelem_return,
|
---|
119 | float **buf_return
|
---|
120 | );
|
---|
121 |
|
---|
122 | /****************************************************************************
|
---|
123 | * End of driver interface *
|
---|
124 | ****************************************************************************/
|
---|
125 |
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * Attached to the devPrivates of each client. Specifies the version number as
|
---|
129 | * supported by the client.
|
---|
130 | */
|
---|
131 | typedef struct _XIClientRec {
|
---|
132 | int major_version;
|
---|
133 | int minor_version;
|
---|
134 | } XIClientRec, *XIClientPtr;
|
---|
135 |
|
---|
136 |
|
---|
137 | typedef struct _GrabParameters {
|
---|
138 | int grabtype; /* GRABTYPE_CORE, etc. */
|
---|
139 | unsigned int ownerEvents;
|
---|
140 | unsigned int this_device_mode;
|
---|
141 | unsigned int other_devices_mode;
|
---|
142 | Window grabWindow;
|
---|
143 | Window confineTo;
|
---|
144 | Cursor cursor;
|
---|
145 | unsigned int modifiers;
|
---|
146 | } GrabParameters;
|
---|
147 |
|
---|
148 |
|
---|
149 | extern void
|
---|
150 | RegisterOtherDevice (
|
---|
151 | DeviceIntPtr /* device */);
|
---|
152 |
|
---|
153 | extern int
|
---|
154 | UpdateDeviceState (
|
---|
155 | DeviceIntPtr /* device */,
|
---|
156 | DeviceEvent* /* xE */);
|
---|
157 |
|
---|
158 | extern void
|
---|
159 | ProcessOtherEvent (
|
---|
160 | InternalEvent* /* ev */,
|
---|
161 | DeviceIntPtr /* other */);
|
---|
162 |
|
---|
163 | extern void
|
---|
164 | DeviceFocusEvent(
|
---|
165 | DeviceIntPtr /* dev */,
|
---|
166 | int /* type */,
|
---|
167 | int /* mode */,
|
---|
168 | int /* detail */,
|
---|
169 | WindowPtr /* pWin */);
|
---|
170 |
|
---|
171 | extern int
|
---|
172 | CheckGrabValues(
|
---|
173 | ClientPtr /* client */,
|
---|
174 | GrabParameters* /* param */);
|
---|
175 |
|
---|
176 | extern int
|
---|
177 | GrabButton(
|
---|
178 | ClientPtr /* client */,
|
---|
179 | DeviceIntPtr /* dev */,
|
---|
180 | DeviceIntPtr /* modifier_device */,
|
---|
181 | int /* button */,
|
---|
182 | GrabParameters* /* param */,
|
---|
183 | GrabType /* grabtype */,
|
---|
184 | GrabMask* /* eventMask */);
|
---|
185 |
|
---|
186 | extern int
|
---|
187 | GrabKey(
|
---|
188 | ClientPtr /* client */,
|
---|
189 | DeviceIntPtr /* dev */,
|
---|
190 | DeviceIntPtr /* modifier_device */,
|
---|
191 | int /* key */,
|
---|
192 | GrabParameters* /* param */,
|
---|
193 | GrabType /* grabtype */,
|
---|
194 | GrabMask* /* eventMask */);
|
---|
195 |
|
---|
196 | extern int
|
---|
197 | GrabWindow(
|
---|
198 | ClientPtr /* client */,
|
---|
199 | DeviceIntPtr /* dev */,
|
---|
200 | int /* type */,
|
---|
201 | GrabParameters* /* param */,
|
---|
202 | GrabMask* /* eventMask */);
|
---|
203 |
|
---|
204 | extern int
|
---|
205 | SelectForWindow(
|
---|
206 | DeviceIntPtr /* dev */,
|
---|
207 | WindowPtr /* pWin */,
|
---|
208 | ClientPtr /* client */,
|
---|
209 | Mask /* mask */,
|
---|
210 | Mask /* exclusivemasks */);
|
---|
211 |
|
---|
212 | extern int
|
---|
213 | AddExtensionClient (
|
---|
214 | WindowPtr /* pWin */,
|
---|
215 | ClientPtr /* client */,
|
---|
216 | Mask /* mask */,
|
---|
217 | int /* mskidx */);
|
---|
218 |
|
---|
219 | extern void
|
---|
220 | RecalculateDeviceDeliverableEvents(
|
---|
221 | WindowPtr /* pWin */);
|
---|
222 |
|
---|
223 | extern int
|
---|
224 | InputClientGone(
|
---|
225 | WindowPtr /* pWin */,
|
---|
226 | XID /* id */);
|
---|
227 |
|
---|
228 | extern int
|
---|
229 | SendEvent (
|
---|
230 | ClientPtr /* client */,
|
---|
231 | DeviceIntPtr /* d */,
|
---|
232 | Window /* dest */,
|
---|
233 | Bool /* propagate */,
|
---|
234 | xEvent * /* ev */,
|
---|
235 | Mask /* mask */,
|
---|
236 | int /* count */);
|
---|
237 |
|
---|
238 | extern int
|
---|
239 | SetButtonMapping (
|
---|
240 | ClientPtr /* client */,
|
---|
241 | DeviceIntPtr /* dev */,
|
---|
242 | int /* nElts */,
|
---|
243 | BYTE * /* map */);
|
---|
244 |
|
---|
245 | extern int
|
---|
246 | ChangeKeyMapping(
|
---|
247 | ClientPtr /* client */,
|
---|
248 | DeviceIntPtr /* dev */,
|
---|
249 | unsigned /* len */,
|
---|
250 | int /* type */,
|
---|
251 | KeyCode /* firstKeyCode */,
|
---|
252 | CARD8 /* keyCodes */,
|
---|
253 | CARD8 /* keySymsPerKeyCode */,
|
---|
254 | KeySym * /* map */);
|
---|
255 |
|
---|
256 | extern void
|
---|
257 | DeleteWindowFromAnyExtEvents(
|
---|
258 | WindowPtr /* pWin */,
|
---|
259 | Bool /* freeResources */);
|
---|
260 |
|
---|
261 | extern int
|
---|
262 | MaybeSendDeviceMotionNotifyHint (
|
---|
263 | deviceKeyButtonPointer * /* pEvents */,
|
---|
264 | Mask /* mask */);
|
---|
265 |
|
---|
266 | extern void
|
---|
267 | CheckDeviceGrabAndHintWindow (
|
---|
268 | WindowPtr /* pWin */,
|
---|
269 | int /* type */,
|
---|
270 | deviceKeyButtonPointer * /* xE */,
|
---|
271 | GrabPtr /* grab */,
|
---|
272 | ClientPtr /* client */,
|
---|
273 | Mask /* deliveryMask */);
|
---|
274 |
|
---|
275 | extern void
|
---|
276 | MaybeStopDeviceHint(
|
---|
277 | DeviceIntPtr /* dev */,
|
---|
278 | ClientPtr /* client */);
|
---|
279 |
|
---|
280 | extern int
|
---|
281 | DeviceEventSuppressForWindow(
|
---|
282 | WindowPtr /* pWin */,
|
---|
283 | ClientPtr /* client */,
|
---|
284 | Mask /* mask */,
|
---|
285 | int /* maskndx */);
|
---|
286 |
|
---|
287 | extern void
|
---|
288 | SendEventToAllWindows(
|
---|
289 | DeviceIntPtr /* dev */,
|
---|
290 | Mask /* mask */,
|
---|
291 | xEvent * /* ev */,
|
---|
292 | int /* count */);
|
---|
293 |
|
---|
294 | extern _X_HIDDEN void XI2EventSwap(
|
---|
295 | xGenericEvent * /* from */,
|
---|
296 | xGenericEvent * /* to */);
|
---|
297 |
|
---|
298 | /* For an event such as MappingNotify which affects client interpretation
|
---|
299 | * of input events sent by device dev, should we notify the client, or
|
---|
300 | * would it merely be irrelevant and confusing? */
|
---|
301 | extern int
|
---|
302 | XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
---|
303 |
|
---|
304 | extern void
|
---|
305 | XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
|
---|
306 | DeviceChangedEvent *dce);
|
---|
307 |
|
---|
308 | extern int
|
---|
309 | XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
---|
310 | unsigned int len, unsigned char* mask);
|
---|
311 |
|
---|
312 | extern int
|
---|
313 | XICheckInvalidMaskBits(unsigned char *mask, int len);
|
---|
314 |
|
---|
315 | #endif /* EXEVENTS_H */
|
---|