Mercurial > games > semicongine
comparison semiconginev2/thirdparty/x11/xi2.nim @ 1218:56781cc0fc7c compiletime-tests
did: renamge main package
| author | sam <sam@basx.dev> |
|---|---|
| date | Wed, 17 Jul 2024 21:01:37 +0700 |
| parents | semicongine/old/thirdparty/x11/xi2.nim@239adab121a3 |
| children |
comparison
equal
deleted
inserted
replaced
| 1217:f819a874058f | 1218:56781cc0fc7c |
|---|---|
| 1 # ************************************* | |
| 2 # Generated from <X11/extensions/XI2.h> | |
| 3 # ************************************* | |
| 4 | |
| 5 from xi import libXi | |
| 6 export libXi | |
| 7 | |
| 8 const | |
| 9 XInput_2_0* = 7 | |
| 10 | |
| 11 ## DO NOT ADD TO THIS LIST. These are libXi-specific defines. | |
| 12 ## See commit libXi-1.4.2-21-ge8531dd | |
| 13 | |
| 14 const | |
| 15 XI_2_Major* = 2 | |
| 16 XI_2_Minor* = 3 | |
| 17 | |
| 18 ## Property event flags | |
| 19 | |
| 20 const | |
| 21 XIPropertyDeleted* = 0 | |
| 22 XIPropertyCreated* = 1 | |
| 23 XIPropertyModified* = 2 | |
| 24 | |
| 25 ## Property modes | |
| 26 | |
| 27 const | |
| 28 XIPropModeReplace* = 0 | |
| 29 XIPropModePrepend* = 1 | |
| 30 XIPropModeAppend* = 2 | |
| 31 | |
| 32 ## Special property type used for XIGetProperty | |
| 33 | |
| 34 const | |
| 35 XIAnyPropertyType* = 0 | |
| 36 | |
| 37 ## Enter/Leave and Focus In/Out modes | |
| 38 | |
| 39 const | |
| 40 XINotifyNormal* = 0 | |
| 41 XINotifyGrab* = 1 | |
| 42 XINotifyUngrab* = 2 | |
| 43 XINotifyWhileGrabbed* = 3 | |
| 44 XINotifyPassiveGrab* = 4 | |
| 45 XINotifyPassiveUngrab* = 5 | |
| 46 | |
| 47 ## Enter/Leave and focus In/out detail | |
| 48 | |
| 49 const | |
| 50 XINotifyAncestor* = 0 | |
| 51 XINotifyVirtual* = 1 | |
| 52 XINotifyInferior* = 2 | |
| 53 XINotifyNonlinear* = 3 | |
| 54 XINotifyNonlinearVirtual* = 4 | |
| 55 XINotifyPointer* = 5 | |
| 56 XINotifyPointerRoot* = 6 | |
| 57 XINotifyDetailNone* = 7 | |
| 58 | |
| 59 ## Grab modes | |
| 60 | |
| 61 const | |
| 62 XIGrabModeSync* = 0 | |
| 63 XIGrabModeAsync* = 1 | |
| 64 XIGrabModeTouch* = 2 | |
| 65 | |
| 66 ## Grab reply status codes | |
| 67 | |
| 68 const | |
| 69 XIGrabSuccess* = 0 | |
| 70 XIAlreadyGrabbed* = 1 | |
| 71 XIGrabInvalidTime* = 2 | |
| 72 XIGrabNotViewable* = 3 | |
| 73 XIGrabFrozen* = 4 | |
| 74 | |
| 75 ## Grab owner events values | |
| 76 | |
| 77 const | |
| 78 XIOwnerEvents* = true | |
| 79 XINoOwnerEvents* = false | |
| 80 | |
| 81 ## Passive grab types | |
| 82 | |
| 83 const | |
| 84 XIGrabtypeButton* = 0 | |
| 85 XIGrabtypeKeycode* = 1 | |
| 86 XIGrabtypeEnter* = 2 | |
| 87 XIGrabtypeFocusIn* = 3 | |
| 88 XIGrabtypeTouchBegin* = 4 | |
| 89 | |
| 90 ## Passive grab modifier | |
| 91 | |
| 92 const | |
| 93 XIAnyModifier* = (1 shl 31) | |
| 94 XIAnyButton* = 0 | |
| 95 XIAnyKeycode* = 0 | |
| 96 | |
| 97 ## XIAllowEvents event-modes | |
| 98 | |
| 99 const | |
| 100 XIAsyncDevice* = 0 | |
| 101 XISyncDevice* = 1 | |
| 102 XIReplayDevice* = 2 | |
| 103 XIAsyncPairedDevice* = 3 | |
| 104 XIAsyncPair* = 4 | |
| 105 XISyncPair* = 5 | |
| 106 XIAcceptTouch* = 6 | |
| 107 XIRejectTouch* = 7 | |
| 108 | |
| 109 ## DeviceChangedEvent change reasons | |
| 110 | |
| 111 const | |
| 112 XISlaveSwitch* = 1 | |
| 113 XIDeviceChange* = 2 | |
| 114 | |
| 115 ## Hierarchy flags | |
| 116 | |
| 117 const | |
| 118 XIMasterAdded* = (1 shl 0) | |
| 119 XIMasterRemoved* = (1 shl 1) | |
| 120 XISlaveAdded* = (1 shl 2) | |
| 121 XISlaveRemoved* = (1 shl 3) | |
| 122 XISlaveAttached* = (1 shl 4) | |
| 123 XISlaveDetached* = (1 shl 5) | |
| 124 XIDeviceEnabled* = (1 shl 6) | |
| 125 XIDeviceDisabled* = (1 shl 7) | |
| 126 | |
| 127 ## ChangeHierarchy constants | |
| 128 | |
| 129 const | |
| 130 XIAddMaster* = 1 | |
| 131 XIRemoveMaster* = 2 | |
| 132 XIAttachSlave* = 3 | |
| 133 XIDetachSlave* = 4 | |
| 134 XIAttachToMaster* = 1 | |
| 135 XIFloating* = 2 | |
| 136 | |
| 137 ## Valuator modes | |
| 138 | |
| 139 const | |
| 140 XIModeRelative* = 0 | |
| 141 XIModeAbsolute* = 1 | |
| 142 | |
| 143 ## Device types | |
| 144 | |
| 145 const | |
| 146 XIMasterPointer* = 1 | |
| 147 XIMasterKeyboard* = 2 | |
| 148 XISlavePointer* = 3 | |
| 149 XISlaveKeyboard* = 4 | |
| 150 XIFloatingSlave* = 5 | |
| 151 | |
| 152 ## Device classes: classes that are not identical to Xi 1.x classes must be | |
| 153 ## numbered starting from 8. | |
| 154 | |
| 155 const | |
| 156 XIKeyClass* = 0 | |
| 157 XIButtonClass* = 1 | |
| 158 XIValuatorClass* = 2 | |
| 159 XIScrollClass* = 3 | |
| 160 XITouchClass* = 8 | |
| 161 | |
| 162 ## Scroll class types | |
| 163 | |
| 164 const | |
| 165 XIScrollTypeVertical* = 1 | |
| 166 XIScrollTypeHorizontal* = 2 | |
| 167 | |
| 168 ## Scroll class flags | |
| 169 | |
| 170 const | |
| 171 XIScrollFlagNoEmulation* = (1 shl 0) | |
| 172 XIScrollFlagPreferred* = (1 shl 1) | |
| 173 | |
| 174 ## Device event flags (common) | |
| 175 ## Device event flags (key events only) | |
| 176 | |
| 177 const | |
| 178 XIKeyRepeat* = (1 shl 16) | |
| 179 | |
| 180 ## Device event flags (pointer events only) | |
| 181 | |
| 182 const | |
| 183 XIPointerEmulated* = (1 shl 16) | |
| 184 | |
| 185 ## Device event flags (touch events only) | |
| 186 | |
| 187 const | |
| 188 XITouchPendingEnd* = (1 shl 16) | |
| 189 XITouchEmulatingPointer* = (1 shl 17) | |
| 190 | |
| 191 ## Barrier event flags | |
| 192 | |
| 193 const | |
| 194 XIBarrierPointerReleased* = (1 shl 0) | |
| 195 XIBarrierDeviceIsGrabbed* = (1 shl 1) | |
| 196 | |
| 197 ## Touch modes | |
| 198 | |
| 199 const | |
| 200 XIDirectTouch* = 1 | |
| 201 XIDependentTouch* = 2 | |
| 202 | |
| 203 ## XI2 event mask macros | |
| 204 type XIMask = ptr UncheckedArray[uint8] | |
| 205 | |
| 206 template XISetMask*(mask: pointer, event: untyped): untyped = | |
| 207 ((cast[XIMask]((mask)))[(event) shr 3] = (cast[XIMask]((mask)))[ | |
| 208 (event) shr 3] or (1 shl ((event) and 7))) | |
| 209 | |
| 210 template XIClearMask*(mask: pointer, event: untyped): untyped = | |
| 211 ((cast[XIMask]((mask)))[(event) shr 3] = (cast[XIMask]((mask)))[ | |
| 212 (event) shr 3] and not (1 shl ((event) and 7))) | |
| 213 | |
| 214 template XIMaskIsSet*(mask: pointer, event: untyped): untyped = | |
| 215 ((cast[XIMask]((mask)))[(event) shr 3].int and (1 shl ((event) and 7))) | |
| 216 | |
| 217 template XIMaskLen*(event: untyped): untyped = | |
| 218 (((event) shr 3) + 1) | |
| 219 | |
| 220 ## Fake device ID's for event selection | |
| 221 | |
| 222 const | |
| 223 XIAllDevices* = 0 | |
| 224 XIAllMasterDevices* = 1 | |
| 225 | |
| 226 ## Event types | |
| 227 | |
| 228 const | |
| 229 XI_DeviceChanged* = 1 | |
| 230 XI_KeyPress* = 2 | |
| 231 XI_KeyRelease* = 3 | |
| 232 XI_ButtonPress* = 4 | |
| 233 XI_ButtonRelease* = 5 | |
| 234 XI_Motion* = 6 | |
| 235 XI_Enter* = 7 | |
| 236 XI_Leave* = 8 | |
| 237 XI_FocusIn* = 9 | |
| 238 XI_FocusOut* = 10 | |
| 239 XI_HierarchyChanged* = 11 | |
| 240 XI_PropertyEvent* = 12 | |
| 241 XI_RawKeyPress* = 13 | |
| 242 XI_RawKeyRelease* = 14 | |
| 243 XI_RawButtonPress* = 15 | |
| 244 XI_RawButtonRelease* = 16 | |
| 245 XI_RawMotion* = 17 | |
| 246 XI_TouchBegin* = 18 | |
| 247 XI_TouchUpdate* = 19 | |
| 248 XI_TouchEnd* = 20 | |
| 249 XI_TouchOwnership* = 21 | |
| 250 XI_RawTouchBegin* = 22 | |
| 251 XI_RawTouchUpdate* = 23 | |
| 252 XI_RawTouchEnd* = 24 | |
| 253 XI_BarrierHit* = 25 | |
| 254 XI_BarrierLeave* = 26 | |
| 255 XI_LASTEVENT* = XI_BarrierLeave | |
| 256 | |
| 257 ## NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value | |
| 258 ## as XI_LASTEVENT if the server is supposed to handle masks etc. for this | |
| 259 ## type of event. | |
| 260 ## Event masks. | |
| 261 ## Note: the protocol spec defines a mask to be of (1 << type). Clients are | |
| 262 ## free to create masks by bitshifting instead of using these defines. | |
| 263 ## | |
| 264 | |
| 265 const | |
| 266 XI_DeviceChangedMask* = (1 shl XI_DeviceChanged) | |
| 267 XI_KeyPressMask* = (1 shl XI_KeyPress) | |
| 268 XI_KeyReleaseMask* = (1 shl XI_KeyRelease) | |
| 269 XI_ButtonPressMask* = (1 shl XI_ButtonPress) | |
| 270 XI_ButtonReleaseMask* = (1 shl XI_ButtonRelease) | |
| 271 XI_MotionMask* = (1 shl XI_Motion) | |
| 272 XI_EnterMask* = (1 shl XI_Enter) | |
| 273 XI_LeaveMask* = (1 shl XI_Leave) | |
| 274 XI_FocusInMask* = (1 shl XI_FocusIn) | |
| 275 XI_FocusOutMask* = (1 shl XI_FocusOut) | |
| 276 XI_HierarchyChangedMask* = (1 shl XI_HierarchyChanged) | |
| 277 XI_PropertyEventMask* = (1 shl XI_PropertyEvent) | |
| 278 XI_RawKeyPressMask* = (1 shl XI_RawKeyPress) | |
| 279 XI_RawKeyReleaseMask* = (1 shl XI_RawKeyRelease) | |
| 280 XI_RawButtonPressMask* = (1 shl XI_RawButtonPress) | |
| 281 XI_RawButtonReleaseMask* = (1 shl XI_RawButtonRelease) | |
| 282 XI_RawMotionMask* = (1 shl XI_RawMotion) | |
| 283 XI_TouchBeginMask* = (1 shl XI_TouchBegin) | |
| 284 XI_TouchEndMask* = (1 shl XI_TouchEnd) | |
| 285 XI_TouchOwnershipChangedMask* = (1 shl XI_TouchOwnership) | |
| 286 XI_TouchUpdateMask* = (1 shl XI_TouchUpdate) | |
| 287 XI_RawTouchBeginMask* = (1 shl XI_RawTouchBegin) | |
| 288 XI_RawTouchEndMask* = (1 shl XI_RawTouchEnd) | |
| 289 XI_RawTouchUpdateMask* = (1 shl XI_RawTouchUpdate) | |
| 290 XI_BarrierHitMask* = (1 shl XI_BarrierHit) | |
| 291 XI_BarrierLeaveMask* = (1 shl XI_BarrierLeave) |
