1 | /************************************************************
|
---|
2 |
|
---|
3 | Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
---|
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 | int /* mode */);
|
---|
53 |
|
---|
54 | /* Input device properties */
|
---|
55 | extern _X_EXPORT void XIDeleteAllDeviceProperties(
|
---|
56 | DeviceIntPtr /* device */
|
---|
57 | );
|
---|
58 |
|
---|
59 | extern _X_EXPORT int XIDeleteDeviceProperty(
|
---|
60 | DeviceIntPtr /* device */,
|
---|
61 | Atom /* property */,
|
---|
62 | Bool /* fromClient */
|
---|
63 | );
|
---|
64 |
|
---|
65 | extern _X_EXPORT int XIChangeDeviceProperty(
|
---|
66 | DeviceIntPtr /* dev */,
|
---|
67 | Atom /* property */,
|
---|
68 | Atom /* type */,
|
---|
69 | int /* format*/,
|
---|
70 | int /* mode*/,
|
---|
71 | unsigned long /* len*/,
|
---|
72 | const pointer /* value*/,
|
---|
73 | Bool /* sendevent*/
|
---|
74 | );
|
---|
75 |
|
---|
76 | extern _X_EXPORT int XIGetDeviceProperty(
|
---|
77 | DeviceIntPtr /* dev */,
|
---|
78 | Atom /* property */,
|
---|
79 | XIPropertyValuePtr* /* value */
|
---|
80 | );
|
---|
81 |
|
---|
82 | extern _X_EXPORT int XISetDevicePropertyDeletable(
|
---|
83 | DeviceIntPtr /* dev */,
|
---|
84 | Atom /* property */,
|
---|
85 | Bool /* deletable */
|
---|
86 | );
|
---|
87 |
|
---|
88 | extern _X_EXPORT long XIRegisterPropertyHandler(
|
---|
89 | DeviceIntPtr dev,
|
---|
90 | int (*SetProperty) (DeviceIntPtr dev,
|
---|
91 | Atom property,
|
---|
92 | XIPropertyValuePtr prop,
|
---|
93 | BOOL checkonly),
|
---|
94 | int (*GetProperty) (DeviceIntPtr dev,
|
---|
95 | Atom property),
|
---|
96 | int (*DeleteProperty) (DeviceIntPtr dev,
|
---|
97 | Atom property)
|
---|
98 | );
|
---|
99 |
|
---|
100 | extern _X_EXPORT void XIUnregisterPropertyHandler(
|
---|
101 | DeviceIntPtr dev,
|
---|
102 | long id
|
---|
103 | );
|
---|
104 |
|
---|
105 | extern _X_EXPORT Atom XIGetKnownProperty(
|
---|
106 | char* name
|
---|
107 | );
|
---|
108 |
|
---|
109 | extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
---|
110 |
|
---|
111 | extern _X_EXPORT int XIPropToInt(
|
---|
112 | XIPropertyValuePtr val,
|
---|
113 | int *nelem_return,
|
---|
114 | int **buf_return
|
---|
115 | );
|
---|
116 |
|
---|
117 | extern _X_EXPORT int XIPropToFloat(
|
---|
118 | XIPropertyValuePtr val,
|
---|
119 | int *nelem_return,
|
---|
120 | float **buf_return
|
---|
121 | );
|
---|
122 |
|
---|
123 | /****************************************************************************
|
---|
124 | * End of driver interface *
|
---|
125 | ****************************************************************************/
|
---|
126 |
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Attached to the devPrivates of each client. Specifies the version number as
|
---|
130 | * supported by the client.
|
---|
131 | */
|
---|
132 | typedef struct _XIClientRec {
|
---|
133 | int major_version;
|
---|
134 | int minor_version;
|
---|
135 | } XIClientRec, *XIClientPtr;
|
---|
136 |
|
---|
137 |
|
---|
138 | typedef struct _GrabParameters {
|
---|
139 | int grabtype; /* GRABTYPE_CORE, etc. */
|
---|
140 | unsigned int ownerEvents;
|
---|
141 | unsigned int this_device_mode;
|
---|
142 | unsigned int other_devices_mode;
|
---|
143 | Window grabWindow;
|
---|
144 | Window confineTo;
|
---|
145 | Cursor cursor;
|
---|
146 | unsigned int modifiers;
|
---|
147 | } GrabParameters;
|
---|
148 |
|
---|
149 |
|
---|
150 | extern int
|
---|
151 | UpdateDeviceState (
|
---|
152 | DeviceIntPtr /* device */,
|
---|
153 | DeviceEvent* /* xE */);
|
---|
154 |
|
---|
155 | extern void
|
---|
156 | ProcessOtherEvent (
|
---|
157 | InternalEvent* /* ev */,
|
---|
158 | DeviceIntPtr /* other */);
|
---|
159 |
|
---|
160 | extern void
|
---|
161 | DeviceFocusEvent(
|
---|
162 | DeviceIntPtr /* dev */,
|
---|
163 | int /* type */,
|
---|
164 | int /* mode */,
|
---|
165 | int /* detail */,
|
---|
166 | WindowPtr /* pWin */);
|
---|
167 |
|
---|
168 | extern int
|
---|
169 | CheckGrabValues(
|
---|
170 | ClientPtr /* client */,
|
---|
171 | GrabParameters* /* param */);
|
---|
172 |
|
---|
173 | extern int
|
---|
174 | GrabButton(
|
---|
175 | ClientPtr /* client */,
|
---|
176 | DeviceIntPtr /* dev */,
|
---|
177 | DeviceIntPtr /* modifier_device */,
|
---|
178 | int /* button */,
|
---|
179 | GrabParameters* /* param */,
|
---|
180 | GrabType /* grabtype */,
|
---|
181 | GrabMask* /* eventMask */);
|
---|
182 |
|
---|
183 | extern int
|
---|
184 | GrabKey(
|
---|
185 | ClientPtr /* client */,
|
---|
186 | DeviceIntPtr /* dev */,
|
---|
187 | DeviceIntPtr /* modifier_device */,
|
---|
188 | int /* key */,
|
---|
189 | GrabParameters* /* param */,
|
---|
190 | GrabType /* grabtype */,
|
---|
191 | GrabMask* /* eventMask */);
|
---|
192 |
|
---|
193 | extern int
|
---|
194 | GrabWindow(
|
---|
195 | ClientPtr /* client */,
|
---|
196 | DeviceIntPtr /* dev */,
|
---|
197 | int /* type */,
|
---|
198 | GrabParameters* /* param */,
|
---|
199 | GrabMask* /* eventMask */);
|
---|
200 |
|
---|
201 | extern int
|
---|
202 | SelectForWindow(
|
---|
203 | DeviceIntPtr /* dev */,
|
---|
204 | WindowPtr /* pWin */,
|
---|
205 | ClientPtr /* client */,
|
---|
206 | Mask /* mask */,
|
---|
207 | Mask /* exclusivemasks */);
|
---|
208 |
|
---|
209 | extern int
|
---|
210 | AddExtensionClient (
|
---|
211 | WindowPtr /* pWin */,
|
---|
212 | ClientPtr /* client */,
|
---|
213 | Mask /* mask */,
|
---|
214 | int /* mskidx */);
|
---|
215 |
|
---|
216 | extern void
|
---|
217 | RecalculateDeviceDeliverableEvents(
|
---|
218 | WindowPtr /* pWin */);
|
---|
219 |
|
---|
220 | extern int
|
---|
221 | InputClientGone(
|
---|
222 | WindowPtr /* pWin */,
|
---|
223 | XID /* id */);
|
---|
224 |
|
---|
225 | extern int
|
---|
226 | SendEvent (
|
---|
227 | ClientPtr /* client */,
|
---|
228 | DeviceIntPtr /* d */,
|
---|
229 | Window /* dest */,
|
---|
230 | Bool /* propagate */,
|
---|
231 | xEvent * /* ev */,
|
---|
232 | Mask /* mask */,
|
---|
233 | int /* count */);
|
---|
234 |
|
---|
235 | extern int
|
---|
236 | SetButtonMapping (
|
---|
237 | ClientPtr /* client */,
|
---|
238 | DeviceIntPtr /* dev */,
|
---|
239 | int /* nElts */,
|
---|
240 | BYTE * /* map */);
|
---|
241 |
|
---|
242 | extern int
|
---|
243 | ChangeKeyMapping(
|
---|
244 | ClientPtr /* client */,
|
---|
245 | DeviceIntPtr /* dev */,
|
---|
246 | unsigned /* len */,
|
---|
247 | int /* type */,
|
---|
248 | KeyCode /* firstKeyCode */,
|
---|
249 | CARD8 /* keyCodes */,
|
---|
250 | CARD8 /* keySymsPerKeyCode */,
|
---|
251 | KeySym * /* map */);
|
---|
252 |
|
---|
253 | extern void
|
---|
254 | DeleteWindowFromAnyExtEvents(
|
---|
255 | WindowPtr /* pWin */,
|
---|
256 | Bool /* freeResources */);
|
---|
257 |
|
---|
258 | extern int
|
---|
259 | MaybeSendDeviceMotionNotifyHint (
|
---|
260 | deviceKeyButtonPointer * /* pEvents */,
|
---|
261 | Mask /* mask */);
|
---|
262 |
|
---|
263 | extern void
|
---|
264 | CheckDeviceGrabAndHintWindow (
|
---|
265 | WindowPtr /* pWin */,
|
---|
266 | int /* type */,
|
---|
267 | deviceKeyButtonPointer * /* xE */,
|
---|
268 | GrabPtr /* grab */,
|
---|
269 | ClientPtr /* client */,
|
---|
270 | Mask /* deliveryMask */);
|
---|
271 |
|
---|
272 | extern void
|
---|
273 | MaybeStopDeviceHint(
|
---|
274 | DeviceIntPtr /* dev */,
|
---|
275 | ClientPtr /* client */);
|
---|
276 |
|
---|
277 | extern int
|
---|
278 | DeviceEventSuppressForWindow(
|
---|
279 | WindowPtr /* pWin */,
|
---|
280 | ClientPtr /* client */,
|
---|
281 | Mask /* mask */,
|
---|
282 | int /* maskndx */);
|
---|
283 |
|
---|
284 | extern void
|
---|
285 | SendEventToAllWindows(
|
---|
286 | DeviceIntPtr /* dev */,
|
---|
287 | Mask /* mask */,
|
---|
288 | xEvent * /* ev */,
|
---|
289 | int /* count */);
|
---|
290 |
|
---|
291 | extern _X_HIDDEN void XI2EventSwap(
|
---|
292 | xGenericEvent * /* from */,
|
---|
293 | xGenericEvent * /* to */);
|
---|
294 |
|
---|
295 | /* For an event such as MappingNotify which affects client interpretation
|
---|
296 | * of input events sent by device dev, should we notify the client, or
|
---|
297 | * would it merely be irrelevant and confusing? */
|
---|
298 | extern int
|
---|
299 | XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
---|
300 |
|
---|
301 | extern void
|
---|
302 | XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
|
---|
303 | DeviceChangedEvent *dce);
|
---|
304 |
|
---|
305 | extern int
|
---|
306 | XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
---|
307 | unsigned int len, unsigned char* mask);
|
---|
308 |
|
---|
309 | extern int
|
---|
310 | XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
|
---|
311 |
|
---|
312 | #endif /* EXEVENTS_H */
|
---|