7.5 KB、307行 生 Blame 履歴
1/***************************************************************************
2 * Copyright 1995 Network Computing Devices
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Network Computing Devices
9 * not be used in advertising or publicity pertaining to distribution
10 * of the software without specific, written prior permission.
11 *
12 * NETWORK COMPUTING DEVICES DISCLAIMs ALL WARRANTIES WITH REGARD TO
13 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14 * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE
15 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
17 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
18 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 **************************************************************************/
20
21#ifndef _RECORDPROTO_H_
22#define _RECORDPROTO_H_
23
24#include <X11/Xmd.h>
25#include <X11/extensions/recordconst.h>
26
27/* only difference between 1.12 and 1.13 is byte order of device events,
28 which the library doesn't deal with. */
29
30/*********************************************************
31 *
32 * Protocol request constants
33 *
34 */
35#define X_RecordQueryVersion 0 /* First request from client */
36#define X_RecordCreateContext 1 /* Create client RC */
37#define X_RecordRegisterClients 2 /* Add to client RC */
38#define X_RecordUnregisterClients 3 /* Delete from client RC */
39#define X_RecordGetContext 4 /* Query client RC */
40#define X_RecordEnableContext 5 /* Enable interception and reporting */
41#define X_RecordDisableContext 6 /* Disable interception and reporting */
42#define X_RecordFreeContext 7 /* Free client RC */
43
44#define sz_XRecordRange 32
45#define sz_XRecordClientInfo 12
46#define sz_XRecordState 16
47#define sz_XRecordDatum 32
48
49
50#define XRecordGlobaldef
51#define XRecordGlobalref extern
52
53#define RecordMaxEvent (128L-1L)
54#define RecordMinDeviceEvent (2L)
55#define RecordMaxDeviceEvent (6L)
56#define RecordMaxError (256L-1L)
57#define RecordMaxCoreRequest (128L-1L)
58#define RecordMaxExtRequest (256L-1L)
59#define RecordMinExtRequest (129L-1L)
60
61#define RECORD_RC CARD32
62#define RECORD_XIDBASE CARD32
63#define RECORD_CLIENTSPEC CARD32
64#define RECORD_ELEMENT_HEADER CARD8
65
66typedef RECORD_CLIENTSPEC RecordClientSpec, *RecordClientSpecPtr;
67
68typedef struct
69{
70 CARD8 first;
71 CARD8 last;
72} RECORD_RANGE8;
73
74typedef struct
75{
76 CARD16 first;
77 CARD16 last;
78} RECORD_RANGE16;
79
80typedef struct
81{
82 RECORD_RANGE8 majorCode;
83 RECORD_RANGE16 minorCode;
84} RECORD_EXTRANGE;
85
86typedef struct
87{
88 RECORD_RANGE8 coreRequests;
89 RECORD_RANGE8 coreReplies;
90 RECORD_EXTRANGE extRequests;
91 RECORD_EXTRANGE extReplies;
92 RECORD_RANGE8 deliveredEvents;
93 RECORD_RANGE8 deviceEvents;
94 RECORD_RANGE8 errors;
95 BOOL clientStarted;
96 BOOL clientDied;
97} RECORDRANGE;
98#define sz_RECORDRANGE 24
99
100/* typedef RECORDRANGE xRecordRange, *xRecordRangePtr;
101#define sz_xRecordRange 24 */
102
103/* Cannot have structures within structures going over the wire */
104typedef struct
105{
106 CARD8 coreRequestsFirst;
107 CARD8 coreRequestsLast;
108 CARD8 coreRepliesFirst;
109 CARD8 coreRepliesLast;
110 CARD8 extRequestsMajorFirst;
111 CARD8 extRequestsMajorLast;
112 CARD16 extRequestsMinorFirst;
113 CARD16 extRequestsMinorLast;
114 CARD8 extRepliesMajorFirst;
115 CARD8 extRepliesMajorLast;
116 CARD16 extRepliesMinorFirst;
117 CARD16 extRepliesMinorLast;
118 CARD8 deliveredEventsFirst;
119 CARD8 deliveredEventsLast;
120 CARD8 deviceEventsFirst;
121 CARD8 deviceEventsLast;
122 CARD8 errorsFirst;
123 CARD8 errorsLast;
124 BOOL clientStarted;
125 BOOL clientDied;
126} xRecordRange;
127#define sz_xRecordRange 24
128
129typedef struct
130{
131 RECORD_CLIENTSPEC clientResource;
132 CARD32 nRanges;
133/* LISTofRECORDRANGE */
134} RECORD_CLIENT_INFO;
135
136typedef RECORD_CLIENT_INFO xRecordClientInfo;
137
138/*
139 * Initialize
140 */
141typedef struct {
142 CARD8 reqType;
143 CARD8 recordReqType;
144 CARD16 length;
145 CARD16 majorVersion;
146 CARD16 minorVersion;
147} xRecordQueryVersionReq;
148#define sz_xRecordQueryVersionReq 8
149
150typedef struct
151{
152 CARD8 type;
153 CARD8 pad0;
154 CARD16 sequenceNumber;
155 CARD32 length;
156 CARD16 majorVersion;
157 CARD16 minorVersion;
158 CARD32 pad1;
159 CARD32 pad2;
160 CARD32 pad3;
161 CARD32 pad4;
162 CARD32 pad5;
163 } xRecordQueryVersionReply;
164#define sz_xRecordQueryVersionReply 32
165
166/*
167 * Create RC
168 */
169typedef struct
170{
171 CARD8 reqType;
172 CARD8 recordReqType;
173 CARD16 length;
174 RECORD_RC context;
175 RECORD_ELEMENT_HEADER elementHeader;
176 CARD8 pad;
177 CARD16 pad0;
178 CARD32 nClients;
179 CARD32 nRanges;
180/* LISTofRECORD_CLIENTSPEC */
181/* LISTofRECORDRANGE */
182} xRecordCreateContextReq;
183#define sz_xRecordCreateContextReq 20
184
185/*
186 * Add to RC
187 */
188typedef struct
189{
190 CARD8 reqType;
191 CARD8 recordReqType;
192 CARD16 length;
193 RECORD_RC context;
194 RECORD_ELEMENT_HEADER elementHeader;
195 CARD8 pad;
196 CARD16 pad0;
197 CARD32 nClients;
198 CARD32 nRanges;
199/* LISTofRECORD_CLIENTSPEC */
200/* LISTofRECORDRANGE */
201} xRecordRegisterClientsReq;
202#define sz_xRecordRegisterClientsReq 20
203
204/*
205 * Delete from RC
206 */
207typedef struct
208{
209 CARD8 reqType;
210 CARD8 recordReqType;
211 CARD16 length;
212 RECORD_RC context;
213 CARD32 nClients;
214/* LISTofRECORD_CLIENTSPEC */
215} xRecordUnregisterClientsReq;
216#define sz_xRecordUnregisterClientsReq 12
217
218/*
219 * Query RC
220 */
221typedef struct
222{
223 CARD8 reqType;
224 CARD8 recordReqType;
225 CARD16 length;
226 RECORD_RC context;
227} xRecordGetContextReq;
228#define sz_xRecordGetContextReq 8
229
230typedef struct
231{
232 CARD8 type;
233 BOOL enabled;
234 CARD16 sequenceNumber;
235 CARD32 length;
236 RECORD_ELEMENT_HEADER elementHeader;
237 CARD8 pad;
238 CARD16 pad0;
239 CARD32 nClients;
240 CARD32 pad1;
241 CARD32 pad2;
242 CARD32 pad3;
243 CARD32 pad4;
244/* LISTofCLIENT_INFO */ /* intercepted-clients */
245} xRecordGetContextReply;
246#define sz_xRecordGetContextReply 32
247
248/*
249 * Enable data interception
250 */
251typedef struct
252{
253 CARD8 reqType;
254 CARD8 recordReqType;
255 CARD16 length;
256 RECORD_RC context;
257} xRecordEnableContextReq;
258#define sz_xRecordEnableContextReq 8
259
260typedef struct
261{
262 CARD8 type;
263 CARD8 category;
264 CARD16 sequenceNumber;
265 CARD32 length;
266 RECORD_ELEMENT_HEADER elementHeader;
267 BOOL clientSwapped;
268 CARD16 pad1;
269 RECORD_XIDBASE idBase;
270 CARD32 serverTime;
271 CARD32 recordedSequenceNumber;
272 CARD32 pad3;
273 CARD32 pad4;
274 /* BYTE data; */
275} xRecordEnableContextReply;
276#define sz_xRecordEnableContextReply 32
277
278/*
279 * Disable data interception
280 */
281typedef struct
282{
283 CARD8 reqType;
284 CARD8 recordReqType;
285 CARD16 length;
286 RECORD_RC context;
287} xRecordDisableContextReq;
288#define sz_xRecordDisableContextReq 8
289
290/*
291 * Free RC
292 */
293typedef struct
294{
295 CARD8 reqType;
296 CARD8 recordReqType;
297 CARD16 length;
298 RECORD_RC context;
299} xRecordFreeContextReq;
300#define sz_xRecordFreeContextReq 8
301
302#undef RECORD_RC
303#undef RECORD_XIDBASE
304#undef RECORD_ELEMENT_HEADER
305#undef RECORD_CLIENTSPEC
306
307#endif