packaging: cleanup
[platform/upstream/dmxproto.git] / dmxproto.h
1 /*
2  * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
3  *
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation on the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial
16  * portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * 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
25  * SOFTWARE.
26  */
27
28 /*
29  * Authors:
30  *   Rickard E. (Rik) Faith <faith@redhat.com>
31  *
32  */
33
34 /** \file
35  * This file describes the structures necessary to implement the wire
36  * protocol for the DMX protocol extension.  It should be included only
37  * in files that implement the client-side (or server-side) part of the
38  * protocol (i.e., client-side applications should \b not include this
39  * file). */
40
41 #ifndef _DMXSTR_H_
42 #define _DMXSTR_H_
43
44 #define DMX_EXTENSION_NAME  "DMX"
45 #define DMX_EXTENSION_MAJOR 2
46 #define DMX_EXTENSION_MINOR 2
47 #define DMX_EXTENSION_PATCH 20040604
48
49 /* These values must be larger than LastExtensionError.
50    The values in dmxext.h and dmxproto.h *MUST* match. */
51 #define DMX_BAD_XINERAMA     1001
52 #define DMX_BAD_VALUE        1002
53
54 #define X_DMXQueryVersion                   0
55 #define X_DMXGetScreenCount                 1
56 #define X_DMXGetScreenInformationDEPRECATED 2
57 #define X_DMXGetWindowAttributes            3
58 #define X_DMXGetInputCount                  4
59 #define X_DMXGetInputAttributes             5
60 #define X_DMXForceWindowCreationDEPRECATED  6
61 #define X_DMXReconfigureScreenDEPRECATED    7
62 #define X_DMXSync                           8
63 #define X_DMXForceWindowCreation            9
64 #define X_DMXGetScreenAttributes           10
65 #define X_DMXChangeScreensAttributes       11
66 #define X_DMXAddScreen                     12
67 #define X_DMXRemoveScreen                  13
68 #define X_DMXGetDesktopAttributes          14
69 #define X_DMXChangeDesktopAttributes       15
70 #define X_DMXAddInput                      16
71 #define X_DMXRemoveInput                   17
72
73 /** Wire-level description of DMXQueryVersion protocol request. */
74 typedef struct {
75     CARD8   reqType;            /* dmxcode */
76     CARD8   dmxReqType;         /* X_DMXQueryVersion */
77     CARD16  length B16;
78 } xDMXQueryVersionReq;
79 #define sz_xDMXQueryVersionReq 4
80
81 /** Wire-level description of DMXQueryVersion protocol reply. */
82 typedef struct {
83     BYTE    type;               /* X_Reply */
84     CARD8   ununsed;
85     CARD16  sequenceNumber B16;
86     CARD32  length B32;
87     CARD32  majorVersion B32;
88     CARD32  minorVersion B32;
89     CARD32  patchVersion B32;
90     CARD32  pad0 B32;
91     CARD32  pad1 B32;
92     CARD32  pad2 B32;
93 } xDMXQueryVersionReply;
94 #define sz_xDMXQueryVersionReply 32
95
96 /** Wire-level description of DMXSync protocol request. */
97 typedef struct {
98     CARD8   reqType;            /* DMXCode */
99     CARD8   dmxReqType;         /* X_DMXSync */
100     CARD16  length B16;
101 } xDMXSyncReq;
102 #define sz_xDMXSyncReq 4
103
104 /** Wire-level description of DMXSync protocol reply. */
105 typedef struct {
106     BYTE    type;               /* X_Reply */
107     CARD8   unused;
108     CARD16  sequenceNumber B16;
109     CARD32  length B32;
110     CARD32  status B32;
111     CARD32  pad0 B32;
112     CARD32  pad1 B32;
113     CARD32  pad2 B32;
114     CARD32  pad3 B32;
115     CARD32  pad4 B32;
116 } xDMXSyncReply;
117 #define sz_xDMXSyncReply 32
118
119 /** Wire-level description of DMXForceWindowCreation protocol request. */
120 typedef struct {
121     CARD8   reqType;            /* DMXCode */
122     CARD8   dmxReqType;         /* X_DMXForceWindowCreation */
123     CARD16  length B16;
124     CARD32  window B32;
125 } xDMXForceWindowCreationReq;
126 #define sz_xDMXForceWindowCreationReq 8
127
128 /** Wire-level description of DMXForceWindowCreation protocol reply. */
129 typedef struct {
130     BYTE    type;               /* X_Reply */
131     CARD8   unused;
132     CARD16  sequenceNumber B16;
133     CARD32  length B32;
134     CARD32  status B32;
135     CARD32  pad0 B32;
136     CARD32  pad1 B32;
137     CARD32  pad2 B32;
138     CARD32  pad3 B32;
139     CARD32  pad4 B32;
140 } xDMXForceWindowCreationReply;
141 #define sz_xDMXForceWindowCreationReply 32
142
143 /** Wire-level description of DMXGetScreenCount protocol request. */
144 typedef struct {
145     CARD8   reqType;            /* DMXCode */
146     CARD8   dmxReqType;         /* X_DMXGetScreenCount */
147     CARD16  length B16;
148 } xDMXGetScreenCountReq;
149 #define sz_xDMXGetScreenCountReq 4
150
151 /** Wire-level description of DMXGetScreenCount protocol reply. */
152 typedef struct {
153     BYTE    type;               /* X_Reply */
154     CARD8   unused;
155     CARD16  sequenceNumber B16;
156     CARD32  length B32;
157     CARD32  screenCount B32;
158     CARD32  pad0 B32;
159     CARD32  pad1 B32;
160     CARD32  pad2 B32;
161     CARD32  pad3 B32;
162     CARD32  pad4 B32;
163 } xDMXGetScreenCountReply;
164 #define sz_xDMXGetScreenCountReply 32
165
166 /** Wire-level description of DMXGetScreenAttributes protocol request. */
167 typedef struct {
168     CARD8   reqType;            /* DMXCode */
169     CARD8   dmxReqType;         /* X_DMXGetScreenAttributes */
170     CARD16  length B16;
171     CARD32  physicalScreen B32;
172 } xDMXGetScreenAttributesReq;
173 #define sz_xDMXGetScreenAttributesReq 8
174
175 /** Wire-level description of DMXGetScreenAttributes protocol reply. */
176 typedef struct {
177     BYTE    type;               /* X_Reply */
178     CARD8   unused;
179     CARD16  sequenceNumber B16;
180     CARD32  length B32;
181     CARD32  displayNameLength B32;
182     CARD32  logicalScreen B32;
183
184     CARD16  screenWindowWidth B16;
185     CARD16  screenWindowHeight B16;
186     INT16   screenWindowXoffset B16;
187     INT16   screenWindowYoffset B16;
188
189     CARD16  rootWindowWidth B16;
190     CARD16  rootWindowHeight B16;
191     INT16   rootWindowXoffset B16;
192     INT16   rootWindowYoffset B16;
193     INT16   rootWindowXorigin B16;
194     INT16   rootWindowYorigin B16;
195 } xDMXGetScreenAttributesReply;
196 #define sz_xDMXGetScreenAttributesReply 36
197
198 /** Wire-level description of DMXChangeScreensAttributes protocol request. */
199 typedef struct {
200     CARD8   reqType;            /* DMXCode */
201     CARD8   dmxReqType;         /* X_DMXChangeScreensAttributes */
202     CARD16  length B16;
203     CARD32  screenCount B32;
204     CARD32  maskCount B32;
205 } xDMXChangeScreensAttributesReq;
206 #define sz_xDMXChangeScreensAttributesReq 12
207
208 /** Wire-level description of DMXChangeScreensAttributes protocol reply. */
209 typedef struct {
210     BYTE    type;               /* X_Reply */
211     CARD8   unused;
212     CARD16  sequenceNumber B16;
213     CARD32  length B32;
214     CARD32  status B32;
215     CARD32  errorScreen B32;
216     CARD32  pad0 B32;
217     CARD32  pad1 B32;
218     CARD32  pad2 B32;
219     CARD32  pad3 B32;
220 } xDMXChangeScreensAttributesReply;
221 #define sz_xDMXChangeScreensAttributesReply 32
222
223 /** Wire-level description of DMXAddScreen protocol request. */
224 typedef struct {
225     CARD8   reqType;            /* DMXCode */
226     CARD8   dmxReqType;         /* X_DMXAddScreen */
227     CARD16  length B16;
228     CARD32  displayNameLength B32;
229     CARD32  physicalScreen B32;
230     CARD32  valueMask B32;
231 } xDMXAddScreenReq;
232 #define sz_xDMXAddScreenReq 16
233
234 /** Wire-level description of DMXAddScreen protocol reply. */
235 typedef struct {
236     BYTE    type;               /* X_Reply */
237     CARD8   unused;
238     CARD16  sequenceNumber B16;
239     CARD32  length B32;
240     CARD32  status B32;
241     CARD32  physicalScreen B32;
242     CARD32  pad0 B32;
243     CARD32  pad1 B32;
244     CARD32  pad2 B32;
245     CARD32  pad3 B32;
246 } xDMXAddScreenReply;
247 #define sz_xDMXAddScreenReply 32
248
249 /** Wire-level description of DMXRemoveScreen protocol request. */
250 typedef struct {
251     CARD8   reqType;            /* DMXCode */
252     CARD8   dmxReqType;         /* X_DMXRemoveScreen */
253     CARD16  length B16;
254     CARD32  physicalScreen B32;
255 } xDMXRemoveScreenReq;
256 #define sz_xDMXRemoveScreenReq 8
257
258 /** Wire-level description of DMXRemoveScreen protocol reply. */
259 typedef struct {
260     BYTE    type;               /* X_Reply */
261     CARD8   unused;
262     CARD16  sequenceNumber B16;
263     CARD32  length B32;
264     CARD32  status B32;
265     CARD32  pad0 B32;
266     CARD32  pad1 B32;
267     CARD32  pad2 B32;
268     CARD32  pad3 B32;
269     CARD32  pad4 B32;
270 } xDMXRemoveScreenReply;
271 #define sz_xDMXRemoveScreenReply 32
272
273 /** Wire-level description of DMXGetWindowAttributes protocol request. */
274 typedef struct {
275     CARD8   reqType;            /* DMXCode */
276     CARD8   dmxReqType;         /* X_DMXGetWindowAttributes */
277     CARD16  length B16;
278     CARD32  window B32;
279 } xDMXGetWindowAttributesReq;
280 #define sz_xDMXGetWindowAttributesReq 8
281
282 /** Wire-level description of DMXGetWindowAttributes protocol reply. */
283 typedef struct {
284     BYTE    type;               /* X_Reply */
285     CARD8   unused;
286     CARD16  sequenceNumber B16;
287     CARD32  length B32;
288     CARD32  screenCount B32;
289     CARD32  pad0 B32;
290     CARD32  pad1 B32;
291     CARD32  pad2 B32;
292     CARD32  pad3 B32;
293     CARD32  pad4 B32;
294 } xDMXGetWindowAttributesReply;
295 #define sz_xDMXGetWindowAttributesReply 32
296
297 /** Wire-level description of DMXGetDesktopAttributes protocol request. */
298 typedef struct {
299     CARD8   reqType;            /* DMXCode */
300     CARD8   dmxReqType;         /* X_DMXGetDesktopAttributes */
301     CARD16  length B16;
302 } xDMXGetDesktopAttributesReq;
303 #define sz_xDMXGetDesktopAttributesReq 4
304
305 /** Wire-level description of DMXGetDesktopAttributes protocol reply. */
306 typedef struct {
307     BYTE    type;               /* X_Reply */
308     CARD8   unused;
309     CARD16  sequenceNumber B16;
310     CARD32  length B32;
311     INT16   width;
312     INT16   height;
313     INT16   shiftX;
314     INT16   shiftY;
315     CARD32  pad0 B32;
316     CARD32  pad1 B32;
317     CARD32  pad2 B32;
318     CARD32  pad3 B32;
319 } xDMXGetDesktopAttributesReply;
320 #define sz_xDMXGetDesktopAttributesReply 32
321
322 /** Wire-level description of DMXChangeDesktopAttributes protocol request. */
323 typedef struct {
324     CARD8   reqType;            /* DMXCode */
325     CARD8   dmxReqType;         /* X_DMXChangeDesktopAttributes */
326     CARD16  length B16;
327     CARD32  valueMask B32;
328 } xDMXChangeDesktopAttributesReq;
329 #define sz_xDMXChangeDesktopAttributesReq 8
330
331 /** Wire-level description of DMXChangeDesktopAttributes protocol reply. */
332 typedef struct {
333     BYTE    type;               /* X_Reply */
334     CARD8   unused;
335     CARD16  sequenceNumber B16;
336     CARD32  length B32;
337     CARD32  status B32;
338     CARD32  pad0 B32;
339     CARD32  pad1 B32;
340     CARD32  pad2 B32;
341     CARD32  pad3 B32;
342     CARD32  pad4 B32;
343 } xDMXChangeDesktopAttributesReply;
344 #define sz_xDMXChangeDesktopAttributesReply 32
345
346 /** Wire-level description of DMXGetInputCount protocol request. */
347 typedef struct {
348     CARD8   reqType;            /* DMXCode */
349     CARD8   dmxReqType;         /* X_DMXGetInputCount */
350     CARD16  length B16;
351 } xDMXGetInputCountReq;
352 #define sz_xDMXGetInputCountReq 4
353
354 /** Wire-level description of DMXGetInputCount protocol reply. */
355 typedef struct {
356     BYTE    type;               /* X_Reply */
357     CARD8   unused;
358     CARD16  sequenceNumber B16;
359     CARD32  length B32;
360     CARD32  inputCount B32;
361     CARD32  pad0 B32;
362     CARD32  pad1 B32;
363     CARD32  pad2 B32;
364     CARD32  pad3 B32;
365     CARD32  pad4 B32;
366 } xDMXGetInputCountReply;
367 #define sz_xDMXGetInputCountReply 32
368
369 /** Wire-level description of DMXGetInputAttributes protocol request. */
370 typedef struct {
371     CARD8   reqType;            /* DMXCode */
372     CARD8   dmxReqType;         /* X_DMXGetInputAttributes */
373     CARD16  length B16;
374     CARD32  deviceId B32;
375 } xDMXGetInputAttributesReq;
376 #define sz_xDMXGetInputAttributesReq 8
377
378 /** Wire-level description of DMXGetInputAttributes protocol reply. */
379 typedef struct {
380     BYTE    type;               /* X_Reply */
381     CARD8   unused;
382     CARD16  sequenceNumber B16;
383     CARD32  length B32;
384     CARD32  inputType B32;
385     CARD32  physicalScreen B32;
386     CARD32  physicalId B32;
387     CARD32  nameLength B32;
388     BOOL    isCore;
389     BOOL    sendsCore;
390     BOOL    detached;
391     CARD8   pad0;
392     CARD32  pad1 B32;
393 } xDMXGetInputAttributesReply;
394 #define sz_xDMXGetInputAttributesReply 32
395
396 /** Wire-level description of DMXAddInput protocol request. */
397 typedef struct {
398     CARD8   reqType;            /* DMXCode */
399     CARD8   dmxReqType;         /* X_DMXAddInput */
400     CARD16  length B16;
401     CARD32  displayNameLength B32;
402     CARD32  valueMask;
403 } xDMXAddInputReq;
404 #define sz_xDMXAddInputReq 12
405
406 /** Wire-level description of DMXAddInput protocol reply. */
407 typedef struct {
408     BYTE    type;               /* X_Reply */
409     CARD8   unused;
410     CARD16  sequenceNumber B16;
411     CARD32  length B32;
412     CARD32  status B32;
413     CARD32  physicalId B32;
414     CARD32  pad0 B32;
415     CARD32  pad1 B32;
416     CARD32  pad2 B32;
417     CARD32  pad3 B32;
418 } xDMXAddInputReply;
419 #define sz_xDMXAddInputReply 32
420
421 /** Wire-level description of DMXRemoveInput protocol request. */
422 typedef struct {
423     CARD8   reqType;            /* DMXCode */
424     CARD8   dmxReqType;         /* X_DMXRemoveInput */
425     CARD16  length B16;
426     CARD32  physicalId B32;
427 } xDMXRemoveInputReq;
428 #define sz_xDMXRemoveInputReq 8
429
430 /** Wire-level description of DMXRemoveInput protocol reply. */
431 typedef struct {
432     BYTE     type;
433     CARD8    unused;
434     CARD16   sequenceNumber B16;
435     CARD32   length B32;
436     CARD32   status B32;
437     CARD32   pad0 B32;
438     CARD32   pad1 B32;
439     CARD32   pad2 B32;
440     CARD32   pad3 B32;
441     CARD32   pad4 B32;
442 } xDMXRemoveInputReply;
443 #define sz_xDMXRemoveInputReply 32
444
445 #endif