Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:31

0001 /*
0002  * Copyright © 2009 Red Hat, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice (including the next
0012  * paragraph) shall be included in all copies or substantial portions of the
0013  * Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0018  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0020  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
0021  * DEALINGS IN THE SOFTWARE.
0022  *
0023  */
0024 
0025 #ifndef _XI2_H_
0026 #define _XI2_H_
0027 
0028 #define XInput_2_0                              7
0029 /* DO NOT ADD TO THIS LIST. These are libXi-specific defines.
0030    See commit libXi-1.4.2-21-ge8531dd */
0031 
0032 #define XI_2_Major                              2
0033 #define XI_2_Minor                              3
0034 
0035 /* Property event flags */
0036 #define XIPropertyDeleted                       0
0037 #define XIPropertyCreated                       1
0038 #define XIPropertyModified                      2
0039 
0040 /* Property modes */
0041 #define XIPropModeReplace                       0
0042 #define XIPropModePrepend                       1
0043 #define XIPropModeAppend                        2
0044 
0045 /* Special property type used for XIGetProperty */
0046 #define XIAnyPropertyType                       0L
0047 
0048 /* Enter/Leave and Focus In/Out modes */
0049 #define XINotifyNormal                          0
0050 #define XINotifyGrab                            1
0051 #define XINotifyUngrab                          2
0052 #define XINotifyWhileGrabbed                    3
0053 #define XINotifyPassiveGrab                     4
0054 #define XINotifyPassiveUngrab                   5
0055 
0056 /* Enter/Leave and focus In/out detail */
0057 #define XINotifyAncestor                        0
0058 #define XINotifyVirtual                         1
0059 #define XINotifyInferior                        2
0060 #define XINotifyNonlinear                       3
0061 #define XINotifyNonlinearVirtual                4
0062 #define XINotifyPointer                         5
0063 #define XINotifyPointerRoot                     6
0064 #define XINotifyDetailNone                      7
0065 
0066 /* Grab modes */
0067 #define XIGrabModeSync                          0
0068 #define XIGrabModeAsync                         1
0069 #define XIGrabModeTouch                         2
0070 
0071 /* Grab reply status codes */
0072 #define XIGrabSuccess                           0
0073 #define XIAlreadyGrabbed                        1
0074 #define XIGrabInvalidTime                       2
0075 #define XIGrabNotViewable                       3
0076 #define XIGrabFrozen                            4
0077 
0078 /* Grab owner events values */
0079 #define XIOwnerEvents                           True
0080 #define XINoOwnerEvents                         False
0081 
0082 /* Passive grab types */
0083 #define XIGrabtypeButton                        0
0084 #define XIGrabtypeKeycode                       1
0085 #define XIGrabtypeEnter                         2
0086 #define XIGrabtypeFocusIn                       3
0087 #define XIGrabtypeTouchBegin                    4
0088 
0089 /* Passive grab modifier */
0090 #define XIAnyModifier                           (1U << 31)
0091 #define XIAnyButton                             0
0092 #define XIAnyKeycode                            0
0093 
0094 /* XIAllowEvents event-modes */
0095 #define XIAsyncDevice                           0
0096 #define XISyncDevice                            1
0097 #define XIReplayDevice                          2
0098 #define XIAsyncPairedDevice                     3
0099 #define XIAsyncPair                             4
0100 #define XISyncPair                              5
0101 #define XIAcceptTouch                           6
0102 #define XIRejectTouch                           7
0103 
0104 /* DeviceChangedEvent change reasons */
0105 #define XISlaveSwitch                           1
0106 #define XIDeviceChange                          2
0107 
0108 /* Hierarchy flags */
0109 #define XIMasterAdded                           (1 << 0)
0110 #define XIMasterRemoved                         (1 << 1)
0111 #define XISlaveAdded                            (1 << 2)
0112 #define XISlaveRemoved                          (1 << 3)
0113 #define XISlaveAttached                         (1 << 4)
0114 #define XISlaveDetached                         (1 << 5)
0115 #define XIDeviceEnabled                         (1 << 6)
0116 #define XIDeviceDisabled                        (1 << 7)
0117 
0118 /* ChangeHierarchy constants */
0119 #define XIAddMaster                             1
0120 #define XIRemoveMaster                          2
0121 #define XIAttachSlave                           3
0122 #define XIDetachSlave                           4
0123 
0124 #define XIAttachToMaster                        1
0125 #define XIFloating                              2
0126 
0127 /* Valuator modes */
0128 #define XIModeRelative                          0
0129 #define XIModeAbsolute                          1
0130 
0131 /* Device types */
0132 #define XIMasterPointer                         1
0133 #define XIMasterKeyboard                        2
0134 #define XISlavePointer                          3
0135 #define XISlaveKeyboard                         4
0136 #define XIFloatingSlave                         5
0137 
0138 /* Device classes: classes that are not identical to Xi 1.x classes must be
0139  * numbered starting from 8. */
0140 #define XIKeyClass                              0
0141 #define XIButtonClass                           1
0142 #define XIValuatorClass                         2
0143 #define XIScrollClass                           3
0144 #define XITouchClass                            8
0145 
0146 /* Scroll class types */
0147 #define XIScrollTypeVertical                    1
0148 #define XIScrollTypeHorizontal                  2
0149 
0150 /* Scroll class flags */
0151 #define XIScrollFlagNoEmulation                 (1 << 0)
0152 #define XIScrollFlagPreferred                   (1 << 1)
0153 
0154 /* Device event flags (common) */
0155 /* Device event flags (key events only) */
0156 #define XIKeyRepeat                             (1 << 16)
0157 /* Device event flags (pointer events only) */
0158 #define XIPointerEmulated                       (1 << 16)
0159 /* Device event flags (touch events only) */
0160 #define XITouchPendingEnd                       (1 << 16)
0161 #define XITouchEmulatingPointer                 (1 << 17)
0162 
0163 /* Barrier event flags */
0164 #define XIBarrierPointerReleased                (1 << 0)
0165 #define XIBarrierDeviceIsGrabbed                (1 << 1)
0166 
0167 
0168 /* Touch modes */
0169 #define XIDirectTouch                           1
0170 #define XIDependentTouch                        2
0171 
0172 /* XI2 event mask macros */
0173 #define XISetMask(ptr, event)   (((unsigned char*)(ptr))[(event)>>3] |=  (1 << ((event) & 7)))
0174 #define XIClearMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &= ~(1 << ((event) & 7)))
0175 #define XIMaskIsSet(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &   (1 << ((event) & 7)))
0176 #define XIMaskLen(event)        (((event) >> 3) + 1)
0177 
0178 /* Fake device ID's for event selection */
0179 #define XIAllDevices                            0
0180 #define XIAllMasterDevices                      1
0181 
0182 /* Event types */
0183 #define XI_DeviceChanged                 1
0184 #define XI_KeyPress                      2
0185 #define XI_KeyRelease                    3
0186 #define XI_ButtonPress                   4
0187 #define XI_ButtonRelease                 5
0188 #define XI_Motion                        6
0189 #define XI_Enter                         7
0190 #define XI_Leave                         8
0191 #define XI_FocusIn                       9
0192 #define XI_FocusOut                      10
0193 #define XI_HierarchyChanged              11
0194 #define XI_PropertyEvent                 12
0195 #define XI_RawKeyPress                   13
0196 #define XI_RawKeyRelease                 14
0197 #define XI_RawButtonPress                15
0198 #define XI_RawButtonRelease              16
0199 #define XI_RawMotion                     17
0200 #define XI_TouchBegin                    18 /* XI 2.2 */
0201 #define XI_TouchUpdate                   19
0202 #define XI_TouchEnd                      20
0203 #define XI_TouchOwnership                21
0204 #define XI_RawTouchBegin                 22
0205 #define XI_RawTouchUpdate                23
0206 #define XI_RawTouchEnd                   24
0207 #define XI_BarrierHit                    25 /* XI 2.3 */
0208 #define XI_BarrierLeave                  26
0209 #define XI_LASTEVENT                     XI_BarrierLeave
0210 /* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
0211  * as XI_LASTEVENT if the server is supposed to handle masks etc. for this
0212  * type of event. */
0213 
0214 /* Event masks.
0215  * Note: the protocol spec defines a mask to be of (1 << type). Clients are
0216  * free to create masks by bitshifting instead of using these defines.
0217  */
0218 #define XI_DeviceChangedMask             (1 << XI_DeviceChanged)
0219 #define XI_KeyPressMask                  (1 << XI_KeyPress)
0220 #define XI_KeyReleaseMask                (1 << XI_KeyRelease)
0221 #define XI_ButtonPressMask               (1 << XI_ButtonPress)
0222 #define XI_ButtonReleaseMask             (1 << XI_ButtonRelease)
0223 #define XI_MotionMask                    (1 << XI_Motion)
0224 #define XI_EnterMask                     (1 << XI_Enter)
0225 #define XI_LeaveMask                     (1 << XI_Leave)
0226 #define XI_FocusInMask                   (1 << XI_FocusIn)
0227 #define XI_FocusOutMask                  (1 << XI_FocusOut)
0228 #define XI_HierarchyChangedMask          (1 << XI_HierarchyChanged)
0229 #define XI_PropertyEventMask             (1 << XI_PropertyEvent)
0230 #define XI_RawKeyPressMask               (1 << XI_RawKeyPress)
0231 #define XI_RawKeyReleaseMask             (1 << XI_RawKeyRelease)
0232 #define XI_RawButtonPressMask            (1 << XI_RawButtonPress)
0233 #define XI_RawButtonReleaseMask          (1 << XI_RawButtonRelease)
0234 #define XI_RawMotionMask                 (1 << XI_RawMotion)
0235 #define XI_TouchBeginMask                (1 << XI_TouchBegin)
0236 #define XI_TouchEndMask                  (1 << XI_TouchEnd)
0237 #define XI_TouchOwnershipChangedMask     (1 << XI_TouchOwnership)
0238 #define XI_TouchUpdateMask               (1 << XI_TouchUpdate)
0239 #define XI_RawTouchBeginMask             (1 << XI_RawTouchBegin)
0240 #define XI_RawTouchEndMask               (1 << XI_RawTouchEnd)
0241 #define XI_RawTouchUpdateMask            (1 << XI_RawTouchUpdate)
0242 #define XI_BarrierHitMask                (1 << XI_BarrierHit)
0243 #define XI_BarrierLeaveMask              (1 << XI_BarrierLeave)
0244 
0245 #endif /* _XI2_H_ */