1 /************************************************************
3 Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
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
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.
24 ********************************************************/
26 /********************************************************************
27 * Interface of 'exevents.c'
33 #include <X11/extensions/XIproto.h>
36 /***************************************************************
37 * Interface available to drivers *
38 ***************************************************************/
41 * Scroll flags for ::SetScrollValuator.
46 * Do not emulate legacy button events for valuator events on this axis.
48 SCROLL_FLAG_DONT_EMULATE
= (1 << 1),
50 * This axis is the preferred axis for valuator emulation for this axis'
53 SCROLL_FLAG_PREFERRED
= (1 << 2)
56 extern _X_EXPORT
int InitProximityClassDeviceStruct(DeviceIntPtr
/* dev */ );
58 extern _X_EXPORT Bool
InitValuatorAxisStruct(DeviceIntPtr
/* dev */ ,
63 int /* resolution */ ,
68 extern _X_EXPORT Bool
SetScrollValuator(DeviceIntPtr
/* dev */ ,
70 enum ScrollType
/* type */ ,
71 double /* increment */ ,
74 /* Input device properties */
75 extern _X_EXPORT
void XIDeleteAllDeviceProperties(DeviceIntPtr
/* device */
78 extern _X_EXPORT
int XIDeleteDeviceProperty(DeviceIntPtr
/* device */ ,
83 extern _X_EXPORT
int XIChangeDeviceProperty(DeviceIntPtr
/* dev */ ,
88 unsigned long /* len */ ,
89 const void * /* value */ ,
93 extern _X_EXPORT
int XIGetDeviceProperty(DeviceIntPtr
/* dev */ ,
95 XIPropertyValuePtr
* /* value */
98 extern _X_EXPORT
int XISetDevicePropertyDeletable(DeviceIntPtr
/* dev */ ,
103 extern _X_EXPORT
long XIRegisterPropertyHandler(DeviceIntPtr dev
,
104 int (*SetProperty
) (DeviceIntPtr
112 int (*GetProperty
) (DeviceIntPtr
116 int (*DeleteProperty
)
121 extern _X_EXPORT
void XIUnregisterPropertyHandler(DeviceIntPtr dev
, long id
);
123 extern _X_EXPORT Atom
XIGetKnownProperty(const char *name
);
125 extern _X_EXPORT DeviceIntPtr
XIGetDevice(xEvent
*ev
);
127 extern _X_EXPORT
int XIPropToInt(XIPropertyValuePtr val
,
128 int *nelem_return
, int **buf_return
);
130 extern _X_EXPORT
int XIPropToFloat(XIPropertyValuePtr val
,
131 int *nelem_return
, float **buf_return
);
133 /****************************************************************************
134 * End of driver interface *
135 ****************************************************************************/
138 * Attached to the devPrivates of each client. Specifies the version number as
139 * supported by the client.
141 typedef struct _XIClientRec
{
144 } XIClientRec
, *XIClientPtr
;
146 typedef struct _GrabParameters
{
147 int grabtype
; /* CORE, etc. */
148 unsigned int ownerEvents
;
149 unsigned int this_device_mode
;
150 unsigned int other_devices_mode
;
154 unsigned int modifiers
;
158 UpdateDeviceState(DeviceIntPtr
/* device */ ,
159 DeviceEvent
* /* xE */ );
162 ProcessOtherEvent(InternalEvent
* /* ev */ ,
163 DeviceIntPtr
/* other */ );
166 CheckGrabValues(ClientPtr
/* client */ ,
167 GrabParameters
* /* param */ );
170 GrabButton(ClientPtr
/* client */ ,
171 DeviceIntPtr
/* dev */ ,
172 DeviceIntPtr
/* modifier_device */ ,
174 GrabParameters
* /* param */ ,
175 enum InputLevel
/* grabtype */ ,
176 GrabMask
* /* eventMask */ );
179 GrabKey(ClientPtr
/* client */ ,
180 DeviceIntPtr
/* dev */ ,
181 DeviceIntPtr
/* modifier_device */ ,
183 GrabParameters
* /* param */ ,
184 enum InputLevel
/* grabtype */ ,
185 GrabMask
* /* eventMask */ );
188 GrabWindow(ClientPtr
/* client */ ,
189 DeviceIntPtr
/* dev */ ,
191 GrabParameters
* /* param */ ,
192 GrabMask
* /* eventMask */ );
195 GrabTouch(ClientPtr
/* client */ ,
196 DeviceIntPtr
/* dev */ ,
197 DeviceIntPtr
/* mod_dev */ ,
198 GrabParameters
* /* param */ ,
199 GrabMask
* /* eventMask */ );
202 SelectForWindow(DeviceIntPtr
/* dev */ ,
203 WindowPtr
/* pWin */ ,
204 ClientPtr
/* client */ ,
206 Mask
/* exclusivemasks */ );
209 AddExtensionClient(WindowPtr
/* pWin */ ,
210 ClientPtr
/* client */ ,
215 RecalculateDeviceDeliverableEvents(WindowPtr
/* pWin */ );
218 InputClientGone(WindowPtr
/* pWin */ ,
222 WindowGone(WindowPtr
/* win */ );
225 SendEvent(ClientPtr
/* client */ ,
226 DeviceIntPtr
/* d */ ,
228 Bool
/* propagate */ ,
234 SetButtonMapping(ClientPtr
/* client */ ,
235 DeviceIntPtr
/* dev */ ,
240 ChangeKeyMapping(ClientPtr
/* client */ ,
241 DeviceIntPtr
/* dev */ ,
244 KeyCode
/* firstKeyCode */ ,
245 CARD8
/* keyCodes */ ,
246 CARD8
/* keySymsPerKeyCode */ ,
247 KeySym
* /* map */ );
250 DeleteWindowFromAnyExtEvents(WindowPtr
/* pWin */ ,
251 Bool
/* freeResources */ );
254 MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer
* /* pEvents */ ,
258 CheckDeviceGrabAndHintWindow(WindowPtr
/* pWin */ ,
260 deviceKeyButtonPointer
* /* xE */ ,
262 ClientPtr
/* client */ ,
263 Mask
/* deliveryMask */ );
266 MaybeStopDeviceHint(DeviceIntPtr
/* dev */ ,
267 ClientPtr
/* client */ );
270 DeviceEventSuppressForWindow(WindowPtr
/* pWin */ ,
271 ClientPtr
/* client */ ,
276 SendEventToAllWindows(DeviceIntPtr
/* dev */ ,
282 TouchRejected(DeviceIntPtr
/* sourcedev */ ,
283 TouchPointInfoPtr
/* ti */ ,
285 TouchOwnershipEvent
* /* ev */ );
287 extern _X_HIDDEN
void XI2EventSwap(xGenericEvent
* /* from */ ,
288 xGenericEvent
* /* to */ );
290 /* For an event such as MappingNotify which affects client interpretation
291 * of input events sent by device dev, should we notify the client, or
292 * would it merely be irrelevant and confusing? */
294 XIShouldNotify(ClientPtr client
, DeviceIntPtr dev
);
297 XISendDeviceChangedEvent(DeviceIntPtr device
, DeviceChangedEvent
*dce
);
301 XISetEventMask(DeviceIntPtr dev
, WindowPtr win
, ClientPtr client
,
302 unsigned int len
, unsigned char *mask
);
305 XICheckInvalidMaskBits(ClientPtr client
, unsigned char *mask
, int len
);
307 #endif /* EXEVENTS_H */