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 | /**
|
---|
41 | * Scroll flags for ::SetScrollValuator.
|
---|
42 | */
|
---|
43 | enum ScrollFlags {
|
---|
44 | SCROLL_FLAG_NONE = 0,
|
---|
45 | /**
|
---|
46 | * Do not emulate legacy button events for valuator events on this axis.
|
---|
47 | */
|
---|
48 | SCROLL_FLAG_DONT_EMULATE = (1 << 1),
|
---|
49 | /**
|
---|
50 | * This axis is the preferred axis for valuator emulation for this axis'
|
---|
51 | * scroll type.
|
---|
52 | */
|
---|
53 | SCROLL_FLAG_PREFERRED = (1 << 2)
|
---|
54 | };
|
---|
55 |
|
---|
56 | extern _X_EXPORT int InitProximityClassDeviceStruct(
|
---|
57 | DeviceIntPtr /* dev */);
|
---|
58 |
|
---|
59 | extern _X_EXPORT Bool InitValuatorAxisStruct(
|
---|
60 | DeviceIntPtr /* dev */,
|
---|
61 | int /* axnum */,
|
---|
62 | Atom /* label */,
|
---|
63 | int /* minval */,
|
---|
64 | int /* maxval */,
|
---|
65 | int /* resolution */,
|
---|
66 | int /* min_res */,
|
---|
67 | int /* max_res */,
|
---|
68 | int /* mode */);
|
---|
69 |
|
---|
70 | extern _X_EXPORT Bool SetScrollValuator(
|
---|
71 | DeviceIntPtr /* dev */,
|
---|
72 | int /* axnum */,
|
---|
73 | enum ScrollType /* type */,
|
---|
74 | double /* increment */,
|
---|
75 | int /* flags */);
|
---|
76 |
|
---|
77 | /* Input device properties */
|
---|
78 | extern _X_EXPORT void XIDeleteAllDeviceProperties(
|
---|
79 | DeviceIntPtr /* device */
|
---|
80 | );
|
---|
81 |
|
---|
82 | extern _X_EXPORT int XIDeleteDeviceProperty(
|
---|
83 | DeviceIntPtr /* device */,
|
---|
84 | Atom /* property */,
|
---|
85 | Bool /* fromClient */
|
---|
86 | );
|
---|
87 |
|
---|
88 | extern _X_EXPORT int XIChangeDeviceProperty(
|
---|
89 | DeviceIntPtr /* dev */,
|
---|
90 | Atom /* property */,
|
---|
91 | Atom /* type */,
|
---|
92 | int /* format*/,
|
---|
93 | int /* mode*/,
|
---|
94 | unsigned long /* len*/,
|
---|
95 | const void* /* value*/,
|
---|
96 | Bool /* sendevent*/
|
---|
97 | );
|
---|
98 |
|
---|
99 | extern _X_EXPORT int XIGetDeviceProperty(
|
---|
100 | DeviceIntPtr /* dev */,
|
---|
101 | Atom /* property */,
|
---|
102 | XIPropertyValuePtr* /* value */
|
---|
103 | );
|
---|
104 |
|
---|
105 | extern _X_EXPORT int XISetDevicePropertyDeletable(
|
---|
106 | DeviceIntPtr /* dev */,
|
---|
107 | Atom /* property */,
|
---|
108 | Bool /* deletable */
|
---|
109 | );
|
---|
110 |
|
---|
111 | extern _X_EXPORT long XIRegisterPropertyHandler(
|
---|
112 | DeviceIntPtr dev,
|
---|
113 | int (*SetProperty) (DeviceIntPtr dev,
|
---|
114 | Atom property,
|
---|
115 | XIPropertyValuePtr prop,
|
---|
116 | BOOL checkonly),
|
---|
117 | int (*GetProperty) (DeviceIntPtr dev,
|
---|
118 | Atom property),
|
---|
119 | int (*DeleteProperty) (DeviceIntPtr dev,
|
---|
120 | Atom property)
|
---|
121 | );
|
---|
122 |
|
---|
123 | extern _X_EXPORT void XIUnregisterPropertyHandler(
|
---|
124 | DeviceIntPtr dev,
|
---|
125 | long id
|
---|
126 | );
|
---|
127 |
|
---|
128 | extern _X_EXPORT Atom XIGetKnownProperty(
|
---|
129 | const char* name
|
---|
130 | );
|
---|
131 |
|
---|
132 | extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
---|
133 |
|
---|
134 | extern _X_EXPORT int XIPropToInt(
|
---|
135 | XIPropertyValuePtr val,
|
---|
136 | int *nelem_return,
|
---|
137 | int **buf_return
|
---|
138 | );
|
---|
139 |
|
---|
140 | extern _X_EXPORT int XIPropToFloat(
|
---|
141 | XIPropertyValuePtr val,
|
---|
142 | int *nelem_return,
|
---|
143 | float **buf_return
|
---|
144 | );
|
---|
145 |
|
---|
146 | /****************************************************************************
|
---|
147 | * End of driver interface *
|
---|
148 | ****************************************************************************/
|
---|
149 |
|
---|
150 |
|
---|
151 | /**
|
---|
152 | * Attached to the devPrivates of each client. Specifies the version number as
|
---|
153 | * supported by the client.
|
---|
154 | */
|
---|
155 | typedef struct _XIClientRec {
|
---|
156 | int major_version;
|
---|
157 | int minor_version;
|
---|
158 | } XIClientRec, *XIClientPtr;
|
---|
159 |
|
---|
160 |
|
---|
161 | typedef struct _GrabParameters {
|
---|
162 | int grabtype; /* CORE, etc. */
|
---|
163 | unsigned int ownerEvents;
|
---|
164 | unsigned int this_device_mode;
|
---|
165 | unsigned int other_devices_mode;
|
---|
166 | Window grabWindow;
|
---|
167 | Window confineTo;
|
---|
168 | Cursor cursor;
|
---|
169 | unsigned int modifiers;
|
---|
170 | } GrabParameters;
|
---|
171 |
|
---|
172 |
|
---|
173 | extern int
|
---|
174 | UpdateDeviceState (
|
---|
175 | DeviceIntPtr /* device */,
|
---|
176 | DeviceEvent* /* xE */);
|
---|
177 |
|
---|
178 | extern void
|
---|
179 | ProcessOtherEvent (
|
---|
180 | InternalEvent* /* ev */,
|
---|
181 | DeviceIntPtr /* other */);
|
---|
182 |
|
---|
183 | extern void
|
---|
184 | DeviceFocusEvent(
|
---|
185 | DeviceIntPtr /* dev */,
|
---|
186 | int /* type */,
|
---|
187 | int /* mode */,
|
---|
188 | int /* detail */,
|
---|
189 | WindowPtr /* pWin */);
|
---|
190 |
|
---|
191 | extern int
|
---|
192 | CheckGrabValues(
|
---|
193 | ClientPtr /* client */,
|
---|
194 | GrabParameters* /* param */);
|
---|
195 |
|
---|
196 | extern int
|
---|
197 | GrabButton(
|
---|
198 | ClientPtr /* client */,
|
---|
199 | DeviceIntPtr /* dev */,
|
---|
200 | DeviceIntPtr /* modifier_device */,
|
---|
201 | int /* button */,
|
---|
202 | GrabParameters* /* param */,
|
---|
203 | enum InputLevel /* grabtype */,
|
---|
204 | GrabMask* /* eventMask */);
|
---|
205 |
|
---|
206 | extern int
|
---|
207 | GrabKey(
|
---|
208 | ClientPtr /* client */,
|
---|
209 | DeviceIntPtr /* dev */,
|
---|
210 | DeviceIntPtr /* modifier_device */,
|
---|
211 | int /* key */,
|
---|
212 | GrabParameters* /* param */,
|
---|
213 | enum InputLevel /* grabtype */,
|
---|
214 | GrabMask* /* eventMask */);
|
---|
215 |
|
---|
216 | extern int
|
---|
217 | GrabWindow(
|
---|
218 | ClientPtr /* client */,
|
---|
219 | DeviceIntPtr /* dev */,
|
---|
220 | int /* type */,
|
---|
221 | GrabParameters* /* param */,
|
---|
222 | GrabMask* /* eventMask */);
|
---|
223 |
|
---|
224 | extern int
|
---|
225 | GrabTouch(
|
---|
226 | ClientPtr /* client */,
|
---|
227 | DeviceIntPtr /* dev */,
|
---|
228 | DeviceIntPtr /* mod_dev */,
|
---|
229 | GrabParameters* /* param */,
|
---|
230 | GrabMask* /* eventMask */);
|
---|
231 |
|
---|
232 | extern int
|
---|
233 | SelectForWindow(
|
---|
234 | DeviceIntPtr /* dev */,
|
---|
235 | WindowPtr /* pWin */,
|
---|
236 | ClientPtr /* client */,
|
---|
237 | Mask /* mask */,
|
---|
238 | Mask /* exclusivemasks */);
|
---|
239 |
|
---|
240 | extern int
|
---|
241 | AddExtensionClient (
|
---|
242 | WindowPtr /* pWin */,
|
---|
243 | ClientPtr /* client */,
|
---|
244 | Mask /* mask */,
|
---|
245 | int /* mskidx */);
|
---|
246 |
|
---|
247 | extern void
|
---|
248 | RecalculateDeviceDeliverableEvents(
|
---|
249 | WindowPtr /* pWin */);
|
---|
250 |
|
---|
251 | extern int
|
---|
252 | InputClientGone(
|
---|
253 | WindowPtr /* pWin */,
|
---|
254 | XID /* id */);
|
---|
255 |
|
---|
256 | extern void
|
---|
257 | WindowGone(
|
---|
258 | WindowPtr /* win */);
|
---|
259 |
|
---|
260 | extern int
|
---|
261 | SendEvent (
|
---|
262 | ClientPtr /* client */,
|
---|
263 | DeviceIntPtr /* d */,
|
---|
264 | Window /* dest */,
|
---|
265 | Bool /* propagate */,
|
---|
266 | xEvent * /* ev */,
|
---|
267 | Mask /* mask */,
|
---|
268 | int /* count */);
|
---|
269 |
|
---|
270 | extern int
|
---|
271 | SetButtonMapping (
|
---|
272 | ClientPtr /* client */,
|
---|
273 | DeviceIntPtr /* dev */,
|
---|
274 | int /* nElts */,
|
---|
275 | BYTE * /* map */);
|
---|
276 |
|
---|
277 | extern int
|
---|
278 | ChangeKeyMapping(
|
---|
279 | ClientPtr /* client */,
|
---|
280 | DeviceIntPtr /* dev */,
|
---|
281 | unsigned /* len */,
|
---|
282 | int /* type */,
|
---|
283 | KeyCode /* firstKeyCode */,
|
---|
284 | CARD8 /* keyCodes */,
|
---|
285 | CARD8 /* keySymsPerKeyCode */,
|
---|
286 | KeySym * /* map */);
|
---|
287 |
|
---|
288 | extern void
|
---|
289 | DeleteWindowFromAnyExtEvents(
|
---|
290 | WindowPtr /* pWin */,
|
---|
291 | Bool /* freeResources */);
|
---|
292 |
|
---|
293 | extern int
|
---|
294 | MaybeSendDeviceMotionNotifyHint (
|
---|
295 | deviceKeyButtonPointer * /* pEvents */,
|
---|
296 | Mask /* mask */);
|
---|
297 |
|
---|
298 | extern void
|
---|
299 | CheckDeviceGrabAndHintWindow (
|
---|
300 | WindowPtr /* pWin */,
|
---|
301 | int /* type */,
|
---|
302 | deviceKeyButtonPointer * /* xE */,
|
---|
303 | GrabPtr /* grab */,
|
---|
304 | ClientPtr /* client */,
|
---|
305 | Mask /* deliveryMask */);
|
---|
306 |
|
---|
307 | extern void
|
---|
308 | MaybeStopDeviceHint(
|
---|
309 | DeviceIntPtr /* dev */,
|
---|
310 | ClientPtr /* client */);
|
---|
311 |
|
---|
312 | extern int
|
---|
313 | DeviceEventSuppressForWindow(
|
---|
314 | WindowPtr /* pWin */,
|
---|
315 | ClientPtr /* client */,
|
---|
316 | Mask /* mask */,
|
---|
317 | int /* maskndx */);
|
---|
318 |
|
---|
319 | extern void
|
---|
320 | SendEventToAllWindows(
|
---|
321 | DeviceIntPtr /* dev */,
|
---|
322 | Mask /* mask */,
|
---|
323 | xEvent * /* ev */,
|
---|
324 | int /* count */);
|
---|
325 |
|
---|
326 | extern void
|
---|
327 | TouchRejected(
|
---|
328 | DeviceIntPtr /* sourcedev */,
|
---|
329 | TouchPointInfoPtr /* ti */,
|
---|
330 | XID /* resource */,
|
---|
331 | TouchOwnershipEvent * /* ev */);
|
---|
332 |
|
---|
333 | extern _X_HIDDEN void XI2EventSwap(
|
---|
334 | xGenericEvent * /* from */,
|
---|
335 | xGenericEvent * /* to */);
|
---|
336 |
|
---|
337 | /* For an event such as MappingNotify which affects client interpretation
|
---|
338 | * of input events sent by device dev, should we notify the client, or
|
---|
339 | * would it merely be irrelevant and confusing? */
|
---|
340 | extern int
|
---|
341 | XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
---|
342 |
|
---|
343 | extern void
|
---|
344 | XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce);
|
---|
345 |
|
---|
346 | extern int
|
---|
347 | XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
---|
348 | unsigned int len, unsigned char* mask);
|
---|
349 |
|
---|
350 | extern int
|
---|
351 | XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
|
---|
352 |
|
---|
353 | #endif /* EXEVENTS_H */
|
---|