| 1 | /* |
| 2 | * xtestext1.h |
| 3 | * |
| 4 | * X11 Input Synthesis Extension include file |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | Copyright 1986, 1987, 1988, 1998 The Open Group |
| 9 | |
| 10 | Permission to use, copy, modify, distribute, and sell this software and its |
| 11 | documentation for any purpose is hereby granted without fee, provided that |
| 12 | the above copyright notice appear in all copies and that both that |
| 13 | copyright notice and this permission notice appear in supporting |
| 14 | documentation. |
| 15 | |
| 16 | The above copyright notice and this permission notice shall be included in |
| 17 | all copies or substantial portions of the Software. |
| 18 | |
| 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 22 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 23 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | |
| 26 | Except as contained in this notice, the name of The Open Group shall not be |
| 27 | used in advertising or otherwise to promote the sale, use or other dealings |
| 28 | in this Software without prior written authorization from The Open Group. |
| 29 | |
| 30 | |
| 31 | Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation |
| 32 | |
| 33 | Permission to use, copy, modify, and distribute this |
| 34 | software and its documentation for any purpose and without |
| 35 | fee is hereby granted, provided that the above copyright |
| 36 | notice appear in all copies and that both that copyright |
| 37 | notice and this permission notice appear in supporting |
| 38 | documentation, and that the name of Hewlett-Packard not be used in |
| 39 | advertising or publicity pertaining to distribution of the |
| 40 | software without specific, written prior permission. |
| 41 | |
| 42 | Hewlett-Packard makes no representations about the |
| 43 | suitability of this software for any purpose. It is provided |
| 44 | "as is" without express or implied warranty. |
| 45 | |
| 46 | This software is not subject to any license of the American |
| 47 | Telephone and Telegraph Company or of the Regents of the |
| 48 | University of California. |
| 49 | |
| 50 | */ |
| 51 | |
| 52 | #ifndef _XTESTEXT1PROTO_H |
| 53 | #define _XTESTEXT1PROTO_H 1 |
| 54 | |
| 55 | #include <X11/extensions/xtestext1const.h> |
| 56 | |
| 57 | /* |
| 58 | * the typedefs for CARD8, CARD16, and CARD32 are defined in Xmd.h |
| 59 | */ |
| 60 | |
| 61 | /* |
| 62 | * XTest request type values |
| 63 | * |
| 64 | * used in the XTest extension protocol requests |
| 65 | */ |
| 66 | #define X_TestFakeInput 1 |
| 67 | #define X_TestGetInput 2 |
| 68 | #define X_TestStopInput 3 |
| 69 | #define X_TestReset 4 |
| 70 | #define X_TestQueryInputSize 5 |
| 71 | |
| 72 | /* |
| 73 | * This defines the maximum size of a list of input actions |
| 74 | * to be sent to the server. It should always be a multiple of |
| 75 | * 4 so that the entire xTestFakeInputReq structure size is a |
| 76 | * multiple of 4. |
| 77 | */ |
| 78 | |
| 79 | typedef struct { |
| 80 | CARD8 reqType; /* always XTestReqCode */ |
| 81 | CARD8 XTestReqType; /* always X_TestFakeInput */ |
| 82 | CARD16 length; /* 2 + XTestMAX_ACTION_LIST_SIZE/4 */ |
| 83 | CARD32 ack; |
| 84 | CARD8 action_list[XTestMAX_ACTION_LIST_SIZE]; |
| 85 | } xTestFakeInputReq; |
| 86 | #define sz_xTestFakeInputReq (XTestMAX_ACTION_LIST_SIZE + 8) |
| 87 | |
| 88 | typedef struct { |
| 89 | CARD8 reqType; /* always XTestReqCode */ |
| 90 | CARD8 XTestReqType; /* always X_TestGetInput */ |
| 91 | CARD16 length; /* 2 */ |
| 92 | CARD32 mode; |
| 93 | } xTestGetInputReq; |
| 94 | #define sz_xTestGetInputReq 8 |
| 95 | |
| 96 | typedef struct { |
| 97 | CARD8 reqType; /* always XTestReqCode */ |
| 98 | CARD8 XTestReqType; /* always X_TestStopInput */ |
| 99 | CARD16 length; /* 1 */ |
| 100 | } xTestStopInputReq; |
| 101 | #define sz_xTestStopInputReq 4 |
| 102 | |
| 103 | typedef struct { |
| 104 | CARD8 reqType; /* always XTestReqCode */ |
| 105 | CARD8 XTestReqType; /* always X_TestReset */ |
| 106 | CARD16 length; /* 1 */ |
| 107 | } xTestResetReq; |
| 108 | #define sz_xTestResetReq 4 |
| 109 | |
| 110 | typedef struct { |
| 111 | CARD8 reqType; /* always XTestReqCode */ |
| 112 | CARD8 XTestReqType; /* always X_TestQueryInputSize */ |
| 113 | CARD16 length; /* 1 */ |
| 114 | } xTestQueryInputSizeReq; |
| 115 | #define sz_xTestQueryInputSizeReq 4 |
| 116 | |
| 117 | /* |
| 118 | * This is the definition of the reply for the xTestQueryInputSize |
| 119 | * request. It should remain the same minimum size as other replies |
| 120 | * (32 bytes). |
| 121 | */ |
| 122 | typedef struct { |
| 123 | CARD8 type; /* always X_Reply */ |
| 124 | CARD8 pad1; |
| 125 | CARD16 sequenceNumber; |
| 126 | CARD32 length; /* always 0 */ |
| 127 | CARD32 size_return; |
| 128 | CARD32 pad2; |
| 129 | CARD32 pad3; |
| 130 | CARD32 pad4; |
| 131 | CARD32 pad5; |
| 132 | CARD32 pad6; |
| 133 | } xTestQueryInputSizeReply; |
| 134 | |
| 135 | /* |
| 136 | * This is the definition for the input action wire event structure. |
| 137 | * This event is sent to the client when the server has one or |
| 138 | * more user input actions to report to the client. It must |
| 139 | * remain the same size as all other wire events (32 bytes). |
| 140 | */ |
| 141 | typedef struct { |
| 142 | CARD8 type; /* always XTestInputActionType */ |
| 143 | CARD8 pad00; |
| 144 | CARD16 sequenceNumber; |
| 145 | CARD8 actions[XTestACTIONS_SIZE]; |
| 146 | } xTestInputActionEvent; |
| 147 | |
| 148 | /* |
| 149 | * This is the definition for the xTestFakeAck wire event structure. |
| 150 | * This event is sent to the client when the server has completely |
| 151 | * processed its input action buffer, and is ready for more. |
| 152 | * It must remain the same size as all other wire events (32 bytes). |
| 153 | */ |
| 154 | typedef struct { |
| 155 | CARD8 type; /* always XTestFakeAckType */ |
| 156 | CARD8 pad00; |
| 157 | CARD16 sequenceNumber; |
| 158 | CARD32 pad02; |
| 159 | CARD32 pad03; |
| 160 | CARD32 pad04; |
| 161 | CARD32 pad05; |
| 162 | CARD32 pad06; |
| 163 | CARD32 pad07; |
| 164 | CARD32 pad08; |
| 165 | } xTestFakeAckEvent; |
| 166 | |
| 167 | /* |
| 168 | * These are the definitions for key/button motion input actions. |
| 169 | */ |
| 170 | typedef struct { |
| 171 | CARD8 header; /* which device, key up/down */ |
| 172 | CARD8 keycode; /* which key/button to move */ |
| 173 | CARD16 delay_time; /* how long to delay (in ms) */ |
| 174 | } XTestKeyInfo; |
| 175 | |
| 176 | /* |
| 177 | * This is the definition for pointer jump input actions. |
| 178 | */ |
| 179 | typedef struct { |
| 180 | CARD8 header; /* which pointer */ |
| 181 | CARD8 pad1; /* unused padding byte */ |
| 182 | CARD16 jumpx; /* x coord to jump to */ |
| 183 | CARD16 jumpy; /* y coord to jump to */ |
| 184 | CARD16 delay_time; /* how long to delay (in ms) */ |
| 185 | } XTestJumpInfo; |
| 186 | |
| 187 | /* |
| 188 | * These are the definitions for pointer relative motion input |
| 189 | * actions. |
| 190 | * |
| 191 | * The sign bits for the x and y relative motions are contained |
| 192 | * in the header byte. The x and y relative motions are packed |
| 193 | * into one byte to make things fit in 32 bits. If the relative |
| 194 | * motion range is larger than +/-15, use the pointer jump action. |
| 195 | */ |
| 196 | |
| 197 | typedef struct { |
| 198 | CARD8 header; /* which pointer */ |
| 199 | CARD8 motion_data; /* x,y relative motion */ |
| 200 | CARD16 delay_time; /* how long to delay (in ms) */ |
| 201 | } XTestMotionInfo; |
| 202 | |
| 203 | /* |
| 204 | * These are the definitions for a long delay input action. It is |
| 205 | * used when more than XTestSHORT_DELAY_TIME milliseconds of delay |
| 206 | * (approximately one minute) is needed. |
| 207 | * |
| 208 | * The device ID for a delay is always set to XTestDELAY_DEVICE_ID. |
| 209 | * This guarantees that a header byte with a value of 0 is not |
| 210 | * a valid header, so it can be used as a flag to indicate that |
| 211 | * there are no more input actions in an XTestInputAction event. |
| 212 | */ |
| 213 | |
| 214 | typedef struct { |
| 215 | CARD8 header; /* always XTestDELAY_DEVICE_ID */ |
| 216 | CARD8 pad1; /* unused padding byte */ |
| 217 | CARD16 pad2; /* unused padding word */ |
| 218 | CARD32 delay_time; /* how long to delay (in ms) */ |
| 219 | } XTestDelayInfo; |
| 220 | |
| 221 | #endif /* _XTESTEXT1PROTO_H */ |