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