exevents.h revision 4642e01f
1/************************************************************ 2 3Copyright 1996 by Thomas E. Dickey <dickey@clark.net> 4 5 All Rights Reserved 6 7Permission to use, copy, modify, and distribute this software and its 8documentation for any purpose and without fee is hereby granted, 9provided that the above copyright notice appear in all copies and that 10both that copyright notice and this permission notice appear in 11supporting documentation, and that the name of the above listed 12copyright holder(s) not be used in advertising or publicity pertaining 13to distribution of the software without specific, written prior 14permission. 15 16THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD 17TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE 19LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 21ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 22OR 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 35/** 36 * Attached to the devPrivates of each client. Specifies the version number as 37 * supported by the client. 38 */ 39typedef struct _XIClientRec { 40 int major_version; 41 int minor_version; 42} XIClientRec, *XIClientPtr; 43 44extern void RegisterOtherDevice ( 45 DeviceIntPtr /* device */); 46 47extern int 48UpdateDeviceState ( 49 DeviceIntPtr /* device */, 50 xEventPtr /* xE */, 51 int /* count */); 52 53extern void ProcessOtherEvent ( 54 xEventPtr /* FIXME deviceKeyButtonPointer * xE */, 55 DeviceIntPtr /* other */, 56 int /* count */); 57 58extern int InitProximityClassDeviceStruct( 59 DeviceIntPtr /* dev */); 60 61extern void InitValuatorAxisStruct( 62 DeviceIntPtr /* dev */, 63 int /* axnum */, 64 int /* minval */, 65 int /* maxval */, 66 int /* resolution */, 67 int /* min_res */, 68 int /* max_res */); 69 70extern void DeviceFocusEvent( 71 DeviceIntPtr /* dev */, 72 int /* type */, 73 int /* mode */, 74 int /* detail */, 75 WindowPtr /* pWin */); 76 77extern int GrabButton( 78 ClientPtr /* client */, 79 DeviceIntPtr /* dev */, 80 BYTE /* this_device_mode */, 81 BYTE /* other_devices_mode */, 82 CARD16 /* modifiers */, 83 DeviceIntPtr /* modifier_device */, 84 CARD8 /* button */, 85 Window /* grabWindow */, 86 BOOL /* ownerEvents */, 87 Cursor /* rcursor */, 88 Window /* rconfineTo */, 89 Mask /* eventMask */); 90 91extern int GrabKey( 92 ClientPtr /* client */, 93 DeviceIntPtr /* dev */, 94 BYTE /* this_device_mode */, 95 BYTE /* other_devices_mode */, 96 CARD16 /* modifiers */, 97 DeviceIntPtr /* modifier_device */, 98 CARD8 /* key */, 99 Window /* grabWindow */, 100 BOOL /* ownerEvents */, 101 Mask /* mask */); 102 103extern int SelectForWindow( 104 DeviceIntPtr /* dev */, 105 WindowPtr /* pWin */, 106 ClientPtr /* client */, 107 Mask /* mask */, 108 Mask /* exclusivemasks */, 109 Mask /* validmasks */); 110 111extern int AddExtensionClient ( 112 WindowPtr /* pWin */, 113 ClientPtr /* client */, 114 Mask /* mask */, 115 int /* mskidx */); 116 117extern void RecalculateDeviceDeliverableEvents( 118 WindowPtr /* pWin */); 119 120extern int InputClientGone( 121 WindowPtr /* pWin */, 122 XID /* id */); 123 124extern int SendEvent ( 125 ClientPtr /* client */, 126 DeviceIntPtr /* d */, 127 Window /* dest */, 128 Bool /* propagate */, 129 xEvent * /* ev */, 130 Mask /* mask */, 131 int /* count */); 132 133extern int SetButtonMapping ( 134 ClientPtr /* client */, 135 DeviceIntPtr /* dev */, 136 int /* nElts */, 137 BYTE * /* map */); 138 139extern int SetModifierMapping( 140 ClientPtr /* client */, 141 DeviceIntPtr /* dev */, 142 int /* len */, 143 int /* rlen */, 144 int /* numKeyPerModifier */, 145 KeyCode * /* inputMap */, 146 KeyClassPtr * /* k */); 147 148extern void SendDeviceMappingNotify( 149 ClientPtr /* client, */, 150 CARD8 /* request, */, 151 KeyCode /* firstKeyCode */, 152 CARD8 /* count */, 153 DeviceIntPtr /* dev */); 154 155extern int ChangeKeyMapping( 156 ClientPtr /* client */, 157 DeviceIntPtr /* dev */, 158 unsigned /* len */, 159 int /* type */, 160 KeyCode /* firstKeyCode */, 161 CARD8 /* keyCodes */, 162 CARD8 /* keySymsPerKeyCode */, 163 KeySym * /* map */); 164 165extern void DeleteWindowFromAnyExtEvents( 166 WindowPtr /* pWin */, 167 Bool /* freeResources */); 168 169extern int MaybeSendDeviceMotionNotifyHint ( 170 deviceKeyButtonPointer * /* pEvents */, 171 Mask /* mask */); 172 173extern void CheckDeviceGrabAndHintWindow ( 174 WindowPtr /* pWin */, 175 int /* type */, 176 deviceKeyButtonPointer * /* xE */, 177 GrabPtr /* grab */, 178 ClientPtr /* client */, 179 Mask /* deliveryMask */); 180 181extern void MaybeStopDeviceHint( 182 DeviceIntPtr /* dev */, 183 ClientPtr /* client */); 184 185extern int DeviceEventSuppressForWindow( 186 WindowPtr /* pWin */, 187 ClientPtr /* client */, 188 Mask /* mask */, 189 int /* maskndx */); 190 191extern void SendEventToAllWindows( 192 DeviceIntPtr /* dev */, 193 Mask /* mask */, 194 xEvent * /* ev */, 195 int /* count */); 196 197/* Input device properties */ 198extern void XIDeleteAllDeviceProperties( 199 DeviceIntPtr /* device */ 200); 201 202extern int XIDeleteDeviceProperty( 203 DeviceIntPtr /* device */, 204 Atom /* property */, 205 Bool /* fromClient */ 206); 207 208extern int XIChangeDeviceProperty( 209 DeviceIntPtr /* dev */, 210 Atom /* property */, 211 Atom /* type */, 212 int /* format*/, 213 int /* mode*/, 214 unsigned long /* len*/, 215 pointer /* value*/, 216 Bool /* sendevent*/ 217 ); 218 219extern int XIGetDeviceProperty( 220 DeviceIntPtr /* dev */, 221 Atom /* property */, 222 XIPropertyValuePtr* /* value */ 223); 224 225extern int XISetDevicePropertyDeletable( 226 DeviceIntPtr /* dev */, 227 Atom /* property */, 228 Bool /* deletable */ 229); 230 231extern long XIRegisterPropertyHandler( 232 DeviceIntPtr dev, 233 int (*SetProperty) (DeviceIntPtr dev, 234 Atom property, 235 XIPropertyValuePtr prop, 236 BOOL checkonly), 237 int (*GetProperty) (DeviceIntPtr dev, 238 Atom property), 239 int (*DeleteProperty) (DeviceIntPtr dev, 240 Atom property) 241); 242 243extern _X_EXPORT void XIUnregisterPropertyHandler( 244 DeviceIntPtr dev, 245 long id 246); 247 248extern Atom XIGetKnownProperty( 249 char* name 250); 251 252extern DeviceIntPtr XIGetDevice(xEvent *ev); 253 254extern _X_EXPORT int XIPropToInt( 255 XIPropertyValuePtr val, 256 int *nelem_return, 257 int **buf_return 258); 259 260extern _X_EXPORT int XIPropToFloat( 261 XIPropertyValuePtr val, 262 int *nelem_return, 263 float **buf_return 264); 265 266#endif /* EXEVENTS_H */ 267