]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/lbxstr.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / include / extensions / lbxstr.h
1 /* $XConsortium: lbxstr.h /main/27 1996/12/15 21:24:11 rws $ */
2 /*
3  * Copyright 1992 Network Computing Devices
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and its
6  * documentation for any purpose is hereby granted without fee, provided that
7  * the above copyright notice appear in all copies and that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of NCD. not be used in advertising or
10  * publicity pertaining to distribution of the software without specific,
11  * written prior permission.  NCD. makes no representations about the
12  * suitability of this software for any purpose.  It is provided "as is"
13  * without express or implied warranty.
14  *
15  * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
17  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  */
23  
24 #ifndef _LBXSTR_H_
25 #define _LBXSTR_H_
26
27 #include "XLbx.h"
28
29 #define LBXNAME "LBX"
30
31 #define LBX_MAJOR_VERSION       1
32 #define LBX_MINOR_VERSION       0
33
34 typedef struct {
35     BOOL        success;                /* TRUE */
36     BOOL        changeType;
37     CARD16      majorVersion B16,
38                 minorVersion B16;
39     CARD16      length B16;             /* 1/4 additional bytes in setup info */
40     CARD32      tag B32;
41 } xLbxConnSetupPrefix;
42
43 typedef struct _LbxQueryVersion {
44     CARD8       reqType;                /* always LbxReqCode */
45     CARD8       lbxReqType;             /* always X_LbxQueryVersion */
46     CARD16      length B16;
47 } xLbxQueryVersionReq;
48 #define sz_xLbxQueryVersionReq  4
49
50 typedef struct {
51     BYTE        type;                   /* X_Reply */
52     CARD8       unused;
53     CARD16      sequenceNumber B16;
54     CARD32      length B32;
55     CARD16      majorVersion B16;       /* major version of LBX protocol */
56     CARD16      minorVersion B16;       /* minor version of LBX protocol */
57     CARD32      pad0 B32;
58     CARD32      pad1 B32;
59     CARD32      pad2 B32;
60     CARD32      pad3 B32;
61     CARD32      pad4 B32;
62 } xLbxQueryVersionReply;
63 #define sz_xLbxQueryVersionReply        32
64
65 typedef struct _LbxStartProxy {
66     CARD8       reqType;        /* always LbxReqCode */
67     CARD8       lbxReqType;     /* always X_LbxStartProxy */
68     CARD16      length B16;
69 } xLbxStartProxyReq;
70 #define sz_xLbxStartProxyReq        4
71
72 typedef struct _LbxStopProxy {
73     CARD8       reqType;        /* always LbxReqCode */
74     CARD8       lbxReqType;     /* always X_LbxStopProxy */
75     CARD16      length B16;
76 } xLbxStopProxyReq;
77 #define sz_xLbxStopProxyReq         4
78
79 typedef struct _LbxSwitch {
80     CARD8       reqType;        /* always LbxReqCode */
81     CARD8       lbxReqType;     /* always X_LbxSwitch */
82     CARD16      length B16;
83     CARD32      client B32;     /* new client */
84 } xLbxSwitchReq;
85 #define sz_xLbxSwitchReq        8
86
87 typedef struct _LbxNewClient {
88     CARD8       reqType;        /* always LbxReqCode */
89     CARD8       lbxReqType;     /* always X_LbxNewClient */
90     CARD16      length B16;
91     CARD32      client B32;     /* new client */
92 } xLbxNewClientReq;
93 #define sz_xLbxNewClientReq     8
94
95 typedef struct _LbxCloseClient {
96     CARD8       reqType;        /* always LbxReqCode */
97     CARD8       lbxReqType;     /* always X_LbxCloseClient */
98     CARD16      length B16;
99     CARD32      client B32;     /* new client */
100 } xLbxCloseClientReq;
101 #define sz_xLbxCloseClientReq   8
102
103 typedef struct _LbxModifySequence {
104     CARD8       reqType;        /* always LbxReqCode */
105     CARD8       lbxReqType;     /* always X_LbxModifySequence */
106     CARD16      length B16;
107     CARD32      adjust B32;
108 } xLbxModifySequenceReq;
109 #define sz_xLbxModifySequenceReq    8
110     
111 typedef struct _LbxAllowMotion {
112     CARD8       reqType;        /* always LbxReqCode */
113     CARD8       lbxReqType;     /* always X_LbxAllowMotion */
114     CARD16      length B16;
115     CARD32      num B32;
116 } xLbxAllowMotionReq;
117 #define sz_xLbxAllowMotionReq    8
118     
119 typedef struct {
120     CARD8       reqType;        /* always LbxReqCode */
121     CARD8       lbxReqType;     /* always X_LbxGrabCmap */
122     CARD16      length B16;
123     Colormap    cmap B32;
124 } xLbxGrabCmapReq;    
125 #define sz_xLbxGrabCmapReq      8
126
127 #define LBX_SMART_GRAB          0x80
128 #define LBX_AUTO_RELEASE        0x40
129 #define LBX_3CHANNELS           0x20
130 #define LBX_2BYTE_PIXELS        0x10
131 #define LBX_RGB_BITS_MASK       0x0f
132
133 #define LBX_LIST_END            0
134 #define LBX_PIXEL_PRIVATE       1
135 #define LBX_PIXEL_SHARED        2
136 #define LBX_PIXEL_RANGE_PRIVATE 3
137 #define LBX_PIXEL_RANGE_SHARED  4
138 #define LBX_NEXT_CHANNEL        5
139
140 typedef struct {
141     BYTE        type;                   /* X_Reply */
142     CARD8       flags;
143     CARD16      sequenceNumber B16;
144     CARD32      length B32;
145     CARD32      pad0 B16;
146     CARD32      pad1 B32;
147     CARD32      pad2 B32;
148     CARD32      pad3 B32;
149     CARD32      pad4 B32;
150     CARD32      pad5 B16;
151 } xLbxGrabCmapReply;
152 #define sz_xLbxGrabCmapReply    32
153 #define sz_xLbxGrabCmapReplyHdr 8
154
155
156 typedef struct {
157     CARD8       reqType;        /* always LbxReqCode */
158     CARD8       lbxReqType;     /* always X_LbxReleaseCmap */
159     CARD16      length B16;
160     Colormap    cmap B32;
161 } xLbxReleaseCmapReq;    
162 #define sz_xLbxReleaseCmapReq   8
163
164 typedef struct {
165     CARD8       reqType;        /* always LbxReqCode */
166     CARD8       lbxReqType;     /* always X_LbxAllocColor */
167     CARD16      length B16;
168     Colormap    cmap B32;
169     CARD32      pixel B32;
170     CARD16      red B16, green B16, blue B16;
171     CARD16      pad B16;
172 } xLbxAllocColorReq;    
173 #define sz_xLbxAllocColorReq    20
174
175 typedef struct _LbxIncrementPixel {
176     CARD8       reqType;        /* always LbxReqCode */
177     CARD8       lbxReqType;     /* always X_LbxIncrementPixel */
178     CARD16      length B16;
179     CARD32      cmap B32;
180     CARD32      pixel B32;
181 } xLbxIncrementPixelReq;
182 #define sz_xLbxIncrementPixelReq    12
183
184 typedef struct _LbxDelta {
185     CARD8       reqType;        /* always LbxReqCode */
186     CARD8       lbxReqType;     /* always X_LbxDelta */
187     CARD16      length B16;
188     CARD8       diffs;          /* number of diffs */
189     CARD8       cindex;         /* cache index */
190                                 /* list of diffs follows */
191 } xLbxDeltaReq;
192 #define sz_xLbxDeltaReq    6
193
194 typedef struct _LbxGetModifierMapping {
195     CARD8       reqType;        /* always LbxReqCode */
196     CARD8       lbxReqType;     /* always X_LbxGetModifierMapping */
197     CARD16      length B16;
198 } xLbxGetModifierMappingReq;
199 #define sz_xLbxGetModifierMappingReq    4
200
201 typedef struct {
202     BYTE        type;                   /* X_Reply */
203     CARD8       keyspermod;
204     CARD16      sequenceNumber B16;
205     CARD32      length B32;
206     CARD32      tag B32;
207     CARD32      pad0 B32;
208     CARD32      pad1 B32;
209     CARD32      pad2 B32;
210     CARD32      pad3 B32;
211     CARD32      pad4 B32;
212 } xLbxGetModifierMappingReply;
213 #define sz_xLbxGetModifierMappingReply  32
214
215 typedef struct _LbxGetKeyboardMapping {
216     CARD8       reqType;        /* always LbxReqCode */
217     CARD8       lbxReqType;     /* always X_LbxGetKeyboardMapping */
218     CARD16      length B16;
219     KeyCode     firstKeyCode;
220     CARD8       count;
221     CARD16      pad1 B16;
222 } xLbxGetKeyboardMappingReq;
223 #define sz_xLbxGetKeyboardMappingReq    8
224
225 typedef struct {
226     BYTE        type;                   /* X_Reply */
227     CARD8       keysperkeycode;
228     CARD16      sequenceNumber B16;
229     CARD32      length B32;
230     CARD32      tag B32;
231     CARD32      pad0 B32;
232     CARD32      pad1 B32;
233     CARD32      pad2 B32;
234     CARD32      pad3 B32;
235     CARD32      pad4 B32;
236 } xLbxGetKeyboardMappingReply;
237 #define sz_xLbxGetKeyboardMappingReply  32
238
239 typedef struct _LbxQueryFont {
240     CARD8       reqType;        /* always LbxReqCode */
241     CARD8       lbxReqType;     /* always X_LbxQueryFont */
242     CARD16      length B16;
243     CARD32      fid B32;
244 } xLbxQueryFontReq;
245 #define sz_xLbxQueryFontReq     8
246
247 typedef struct _LbxInternAtoms {
248     CARD8       reqType;        /* always LbxReqCode */
249     CARD8       lbxReqType;     /* always X_LbxInternAtoms */
250     CARD16      length B16;
251     CARD16      num B16;
252 } xLbxInternAtomsReq;
253 #define sz_xLbxInternAtomsReq   6  
254
255 typedef struct {
256     BYTE        type;           /* X_Reply */
257     CARD8       unused;
258     CARD16      sequenceNumber B16;
259     CARD32      length B32;
260     CARD32      atomsStart B32;
261     CARD32      pad0 B32;
262     CARD32      pad1 B32;
263     CARD32      pad2 B32;
264     CARD32      pad3 B32;
265     CARD32      pad4 B32;
266 } xLbxInternAtomsReply;
267 #define sz_xLbxInternAtomsReply         32
268 #define sz_xLbxInternAtomsReplyHdr      8
269
270
271 typedef struct _LbxGetWinAttrAndGeom {
272     CARD8       reqType;        /* always LbxReqCode */
273     CARD8       lbxReqType;     /* always X_LbxGetWinAttrAndGeom */
274     CARD16      length B16;
275     CARD32      id B32;         /* window id */
276 } xLbxGetWinAttrAndGeomReq;
277 #define sz_xLbxGetWinAttrAndGeomReq 8
278
279 typedef struct {
280     BYTE type;  /* X_Reply */
281     CARD8 backingStore;
282     CARD16 sequenceNumber B16;
283     CARD32 length B32;  /* NOT 0; this is an extra-large reply */
284     VisualID visualID B32;
285 #if defined(__cplusplus) || defined(c_plusplus)
286     CARD16 c_class B16;
287 #else
288     CARD16 class B16;
289 #endif
290     CARD8 bitGravity;
291     CARD8 winGravity;
292     CARD32 backingBitPlanes B32;
293     CARD32 backingPixel B32;
294     BOOL saveUnder;
295     BOOL mapInstalled;
296     CARD8 mapState;
297     BOOL override;
298     Colormap colormap B32;
299     CARD32 allEventMasks B32;
300     CARD32 yourEventMask B32;
301     CARD16 doNotPropagateMask B16;
302     CARD16 pad1 B16;
303     Window root B32;
304     INT16 x B16, y B16;
305     CARD16 width B16, height B16;
306     CARD16 borderWidth B16;
307     CARD8 depth;
308     CARD8 pad2;
309 } xLbxGetWinAttrAndGeomReply;
310 #define sz_xLbxGetWinAttrAndGeomReply 60
311
312
313 typedef struct {
314     CARD8       reqType;        /* always LbxReqCode */
315     CARD8       lbxReqType;     /* always X_LbxSync */
316     CARD16      length B16;
317 } xLbxSyncReq;
318 #define sz_xLbxSyncReq  4
319
320 typedef struct {
321     BYTE        type;                   /* X_Reply */
322     CARD8       pad0;
323     CARD16      sequenceNumber B16;
324     CARD32      length B32;
325     CARD32      pad1 B32;
326     CARD32      pad2 B32;
327     CARD32      pad3 B32;
328     CARD32      pad4 B32;
329     CARD32      pad5 B32;
330     CARD32      pad6 B32;
331 } xLbxSyncReply;
332 #define sz_xLbxSyncReply 32
333
334
335 /* an LBX squished charinfo packs the data in a CARD32 as follows */
336 #define LBX_WIDTH_SHIFT         26
337 #define LBX_LEFT_SHIFT          20
338 #define LBX_RIGHT_SHIFT         13
339 #define LBX_ASCENT_SHIFT        7
340 #define LBX_DESCENT_SHIFT       0
341
342 #define LBX_WIDTH_BITS          6
343 #define LBX_LEFT_BITS           6
344 #define LBX_RIGHT_BITS          7
345 #define LBX_ASCENT_BITS         6
346 #define LBX_DESCENT_BITS        7
347
348 #define LBX_WIDTH_MASK          0xfc000000
349 #define LBX_LEFT_MASK           0x03f00000
350 #define LBX_RIGHT_MASK          0x000fe000
351 #define LBX_ASCENT_MASK         0x00001f80
352 #define LBX_DESCENT_MASK        0x0000007f
353
354 #define LBX_MASK_BITS(val, n)   ((unsigned int) ((val) & ((1 << (n)) - 1)))
355
356 typedef struct {
357     CARD32      metrics B32;
358 } xLbxCharInfo;
359
360 /* note that this is identical to xQueryFontReply except for missing 
361  * first 2 words
362  */
363 typedef struct {
364     xCharInfo minBounds; 
365 /* XXX do we need to leave this gunk? */
366 #ifndef WORD64
367     CARD32 walign1 B32;
368 #endif
369     xCharInfo maxBounds; 
370 #ifndef WORD64
371     CARD32 walign2 B32;
372 #endif
373     CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
374     CARD16 defaultChar B16;
375     CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
376     CARD8 drawDirection;
377     CARD8 minByte1, maxByte1;
378     BOOL allCharsExist;
379     INT16 fontAscent B16, fontDescent B16;
380     CARD32 nCharInfos B32; /* followed by this many xLbxCharInfo structures */
381 } xLbxFontInfo;
382
383 typedef struct {
384     BYTE        type;                   /* X_Reply */
385     CARD8       compression;
386     CARD16      sequenceNumber B16;
387     CARD32      length B32;
388     CARD32      tag B32;
389     CARD32      pad0 B32;
390     CARD32      pad1 B32;
391     CARD32      pad2 B32;
392     CARD32      pad3 B32;
393     CARD32      pad4 B32;
394     /* X_QueryFont sticks much of the data in the base reply packet,
395      * but we hope that it won't be needed, (and it won't fit in 32 bytes
396      * with the tag anyways)
397      *
398      * if any additional data is needed, its sent in a xLbxFontInfo
399      */
400 } xLbxQueryFontReply;
401 #define sz_xLbxQueryFontReply   32
402
403 typedef struct _LbxChangeProperty {
404     CARD8       reqType;        /* always LbxReqCode */
405     CARD8       lbxReqType;     /* always X_LbxChangeProperty */
406     CARD16      length B16;
407     Window      window B32;
408     Atom        property B32;
409     Atom        type B32;
410     CARD8       format;
411     CARD8       mode;
412     BYTE        pad[2];
413     CARD32      nUnits B32;
414 } xLbxChangePropertyReq;
415 #define sz_xLbxChangePropertyReq        24
416
417 typedef struct {
418     BYTE        type;                   /* X_Reply */
419     CARD8       pad;
420     CARD16      sequenceNumber B16;
421     CARD32      length B32;
422     CARD32      tag B32;
423     CARD32      pad0 B32;
424     CARD32      pad1 B32;
425     CARD32      pad2 B32;
426     CARD32      pad3 B32;
427     CARD32      pad4 B32;
428 } xLbxChangePropertyReply;
429 #define sz_xLbxChangePropertyReply      32
430
431 typedef struct _LbxGetProperty {
432     CARD8       reqType;        /* always LbxReqCode */
433     CARD8       lbxReqType;     /* always X_LbxGetProperty */
434     CARD16      length B16;
435     Window      window B32;
436     Atom        property B32;
437     Atom        type B32;
438     CARD8       delete;
439     BYTE        pad[3];
440     CARD32      longOffset B32;
441     CARD32      longLength B32;
442 } xLbxGetPropertyReq;
443 #define sz_xLbxGetPropertyReq   28
444
445 typedef struct {
446     BYTE        type;                   /* X_Reply */
447     CARD8       format;
448     CARD16      sequenceNumber B16;
449     CARD32      length B32;
450     Atom        propertyType B32;
451     CARD32      bytesAfter B32;
452     CARD32      nItems B32;
453     CARD32      tag B32;
454     CARD32      pad1 B32;
455     CARD32      pad2 B32;
456 } xLbxGetPropertyReply;
457 #define sz_xLbxGetPropertyReply 32
458
459 typedef struct _LbxTagData {
460     CARD8       reqType;        /* always LbxReqCode */
461     CARD8       lbxReqType;     /* always X_LbxTagData */
462     CARD16      length B16;
463     XID         tag B32;
464     CARD32      real_length B32;
465     /* data */
466 } xLbxTagDataReq;
467 #define sz_xLbxTagDataReq       12
468
469 typedef struct _LbxInvalidateTag {
470     CARD8       reqType;        /* always LbxReqCode */
471     CARD8       lbxReqType;     /* always X_LbxInvalidateTag */
472     CARD16      length B16;
473     CARD32      tag B32;
474 } xLbxInvalidateTagReq;
475 #define sz_xLbxInvalidateTagReq 8
476
477 typedef struct _LbxPutImage {
478     CARD8       reqType;        /* always LbxReqCode */
479     CARD8       lbxReqType;     /* always X_LbxPutImage */
480     CARD16      length B16;
481     CARD8       compressionMethod;
482     CARD8       cacheEnts;
483     CARD8       bitPacked;
484     /* rest is variable */
485 } xLbxPutImageReq;
486 #define sz_xLbxPutImageReq      7
487
488 typedef struct {
489     CARD8       reqType;        /* always LbxReqCode */
490     CARD8       lbxReqType;     /* always X_LbxGetImage */
491     CARD16      length B16;
492     Drawable    drawable B32;
493     INT16       x B16, y B16;
494     CARD16      width B16, height B16;
495     CARD32      planeMask B32;
496     CARD8       format;
497     CARD8       pad1;
498     CARD16      pad2 B16;
499 } xLbxGetImageReq;    
500
501 #define sz_xLbxGetImageReq 24
502
503 typedef struct {
504     BYTE type;                  /* X_Reply */
505     CARD8 depth;
506     CARD16 sequenceNumber B16;
507     CARD32 lbxLength B32;
508     CARD32 xLength B32;
509     VisualID visual B32;
510     CARD8 compressionMethod;
511     CARD8 pad1;
512     CARD16 pad2 B16;
513     CARD32 pad3 B32;
514     CARD32 pad4 B32;
515     CARD32 pad5 B32;
516 } xLbxGetImageReply;
517
518 #define sz_xLbxGetImageReply 32
519   
520 /* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment,
521    LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */
522
523 #define GFX_CACHE_SIZE  15
524
525 #define GFXdCacheEnt(e)     ((e) & 0xf)
526 #define GFXgCacheEnt(e)     (((e) >> 4) & 0xf)
527 #define GFXCacheEnts(d,g)   (((d) & 0xf) | (((g) & 0xf) << 4))
528
529 #define GFXCacheNone   0xf
530
531 typedef struct _LbxPolyPoint {
532     CARD8       reqType;        /* always LbxReqCode */
533     CARD8       lbxReqType;
534     CARD16      length B16;
535     CARD8       cacheEnts;
536     CARD8       padBytes;
537 } xLbxPolyPointReq;
538
539 #define sz_xLbxPolyPointReq     6
540
541 typedef xLbxPolyPointReq xLbxPolyLineReq;
542 typedef xLbxPolyPointReq xLbxPolySegmentReq;
543 typedef xLbxPolyPointReq xLbxPolyRectangleReq;
544 typedef xLbxPolyPointReq xLbxPolyArcReq;
545 typedef xLbxPolyPointReq xLbxPolyFillRectangleReq;
546 typedef xLbxPolyPointReq xLbxPolyFillArcReq;
547
548 #define sz_xLbxPolyLineReq              sz_xLbxPolyPointReq
549 #define sz_xLbxPolySegmentReq           sz_xLbxPolyPointReq
550 #define sz_xLbxPolyRectangleReq         sz_xLbxPolyPointReq
551 #define sz_xLbxPolyArcReq               sz_xLbxPolyPointReq
552 #define sz_xLbxPolyFillRectangleReq     sz_xLbxPolyPointReq
553 #define sz_xLbxPolyFillArc              sz_xLbxPolyPointReq
554
555 typedef struct _LbxFillPoly {
556     CARD8       reqType;        /* always LbxReqCode */
557     CARD8       lbxReqType;
558     CARD16      length B16;
559     CARD8       cacheEnts;
560     BYTE        shape;
561     CARD8       padBytes;
562 } xLbxFillPolyReq;
563 #define sz_xLbxFillPolyReq      7
564
565 typedef struct _LbxCopyArea {
566     CARD8       reqType;        /* always LbxReqCode */
567     CARD8       lbxReqType;
568     CARD16      length B16;
569     CARD8       srcCache;       /* source drawable */
570     CARD8       cacheEnts;      /* dest drawable and gc */
571     /* followed by encoded src x, src y, dst x, dst y, width, height */
572 } xLbxCopyAreaReq;
573     
574 #define sz_xLbxCopyAreaReq  6
575
576 typedef struct _LbxCopyPlane {
577     CARD8       reqType;        /* always LbxReqCode */
578     CARD8       lbxReqType;
579     CARD16      length B16;
580     CARD32      bitPlane B32;
581     CARD8       srcCache;       /* source drawable */
582     CARD8       cacheEnts;      /* dest drawable and gc */
583     /* followed by encoded src x, src y, dst x, dst y, width, height */
584 } xLbxCopyPlaneReq;
585     
586 #define sz_xLbxCopyPlaneReq  10
587
588 typedef struct _LbxPolyText {
589     CARD8       reqType;        /* always LbxReqCode */
590     CARD8       lbxReqType;
591     CARD16      length B16;
592     CARD8       cacheEnts;
593     /* followed by encoded src x, src y coordinates and text elts */
594 } xLbxPolyTextReq;
595
596 #define sz_xLbxPolyTextReq  5
597
598 typedef xLbxPolyTextReq xLbxPolyText8Req;
599 typedef xLbxPolyTextReq xLbxPolyText16Req;
600     
601 #define sz_xLbxPolyTextReq      5
602 #define sz_xLbxPolyText8Req     5
603 #define sz_xLbxPolyText16Req    5
604
605 typedef struct _LbxImageText {
606     CARD8       reqType;        /* always LbxReqCode */
607     CARD8       lbxReqType;
608     CARD16      length B16;
609     CARD8       cacheEnts;
610     CARD8       nChars;
611     /* followed by encoded src x, src y coordinates and string */
612 } xLbxImageTextReq;
613     
614 typedef xLbxImageTextReq xLbxImageText8Req;
615 typedef xLbxImageTextReq xLbxImageText16Req;
616     
617 #define sz_xLbxImageTextReq     6
618 #define sz_xLbxImageText8Req    6
619 #define sz_xLbxImageText16Req   6
620
621 typedef struct {
622     CARD8       offset;
623     CARD8       diff;
624 } xLbxDiffItem;
625 #define sz_xLbxDiffItem    2
626
627 typedef struct {
628     BYTE        type;           /* X_Reply */
629     CARD8       nOpts;
630     CARD16      sequenceNumber B16;
631     CARD32      length B32;
632     CARD32      optDataStart B32;
633     CARD32      pad0 B32;
634     CARD32      pad1 B32;
635     CARD32      pad2 B32;
636     CARD32      pad3 B32;
637     CARD32      pad4 B32;
638 } xLbxStartReply;
639 #define sz_xLbxStartReply       32
640 #define sz_xLbxStartReplyHdr    8
641
642 typedef struct _LbxQueryExtension {
643     CARD8       reqType;        /* always LbxReqCode */
644     CARD8       lbxReqType;     /* always X_LbxQueryExtension */
645     CARD16      length B16;
646     CARD32      nbytes B32;
647 } xLbxQueryExtensionReq;
648 #define sz_xLbxQueryExtensionReq        8
649
650 typedef struct _LbxQueryExtensionReply {
651     BYTE        type;                   /* X_Reply */
652     CARD8       numReqs;
653     CARD16      sequenceNumber B16;
654     CARD32      length B32;
655     BOOL        present;
656     CARD8       major_opcode;
657     CARD8       first_event;
658     CARD8       first_error;
659     CARD32      pad0 B32;
660     CARD32      pad1 B32;
661     CARD32      pad2 B32;
662     CARD32      pad3 B32;
663     CARD32      pad4 B32;
664
665     /* reply & event generating requests */
666 } xLbxQueryExtensionReply;
667 #define sz_xLbxQueryExtensionReply      32
668
669
670 typedef struct _LbxBeginLargeRequest {
671     CARD8       reqType;        /* always LbxReqCode */
672     CARD8       lbxReqType;     /* always X_LbxBeginLargeRequest */
673     CARD16      length B16;
674     CARD32      largeReqLength B32;
675 } xLbxBeginLargeRequestReq;
676 #define sz_BeginLargeRequestReq 8
677
678 typedef struct _LbxLargeRequestData {
679     CARD8       reqType;        /* always LbxReqCode */
680     CARD8       lbxReqType;     /* always X_LbxLargeRequestData */
681     CARD16      length B16;
682     /* followed by LISTofCARD8 data */
683 } xLbxLargeRequestDataReq;
684 #define sz_LargeRequestDataReq 4
685
686 typedef struct _LbxEndLargeRequest {
687     CARD8       reqType;        /* always LbxReqCode */
688     CARD8       lbxReqType;     /* always X_LbxEndLargeRequest */
689     CARD16      length B16;
690 } xLbxEndLargeRequestReq;
691 #define sz_EndLargeRequestReq 4
692
693
694
695 typedef struct _LbxSwitchEvent {
696     BYTE        type;           /* always eventBase + LbxEvent */
697     BYTE        lbxType;        /* LbxSwitchEvent */
698     CARD16      pad B16;
699     CARD32      client B32;
700 } xLbxSwitchEvent;
701 #define sz_xLbxSwitchEvent      8
702
703 typedef struct _LbxCloseEvent {
704     BYTE        type;           /* always eventBase + LbxEvent */
705     BYTE        lbxType;        /* LbxCloseEvent */
706     CARD16      sequenceNumber B16;
707     CARD32      client B32;
708     CARD32      pad1 B32;
709     CARD32      pad2 B32;
710     CARD32      pad3 B32;
711     CARD32      pad4 B32;
712     CARD32      pad5 B32;
713     CARD32      pad6 B32;
714 } xLbxCloseEvent;
715 #define sz_xLbxCloseEvent       32
716
717 typedef struct _LbxInvalidateTagEvent {
718     BYTE        type;           /* always eventBase + LbxEvent */
719     BYTE        lbxType;        /* LbxInvalidateTagEvent */
720     CARD16      sequenceNumber B16;
721     CARD32      tag B32;
722     CARD32      tagType B32;
723     CARD32      pad1 B32;
724     CARD32      pad2 B32;
725     CARD32      pad3 B32;
726     CARD32      pad4 B32;
727     CARD32      pad5 B32;
728 } xLbxInvalidateTagEvent;
729 #define sz_xLbxInvalidateTagEvent 32
730
731 typedef struct _LbxSendTagDataEvent {
732     BYTE        type;           /* always eventBase + LbxEvent */
733     BYTE        lbxType;        /* LbxSendTagDataEvent */
734     CARD16      sequenceNumber B16;
735     CARD32      tag B32;
736     CARD32      tagType B32;
737     CARD32      pad1 B32;
738     CARD32      pad2 B32;
739     CARD32      pad3 B32;
740     CARD32      pad4 B32;
741     CARD32      pad5 B32;
742 } xLbxSendTagDataEvent;
743 #define sz_xLbxSendTagDataEvent 32
744
745 typedef struct _LbxListenToOneEvent {
746     BYTE        type;           /* always eventBase + LbxEvent */
747     BYTE        lbxType;        /* LbxListenToOneEvent */
748     CARD16      sequenceNumber B16;
749     CARD32      client B32;
750     CARD32      pad1 B32;
751     CARD32      pad2 B32;
752     CARD32      pad3 B32;
753     CARD32      pad4 B32;
754     CARD32      pad5 B32;
755     CARD32      pad6 B32;
756 } xLbxListenToOneEvent;
757 #define sz_xLbxListenToOneEvent 32
758
759 typedef struct _LbxListenToAllEvent {
760     BYTE        type;           /* always eventBase + LbxEvent */
761     BYTE        lbxType;        /* LbxListenToAllEvent */
762     CARD16      sequenceNumber B16;
763     CARD32      pad1 B32;
764     CARD32      pad2 B32;
765     CARD32      pad3 B32;
766     CARD32      pad4 B32;
767     CARD32      pad5 B32;
768     CARD32      pad6 B32;
769     CARD32      pad7 B32;
770 } xLbxListenToAllEvent;
771 #define sz_xLbxListenToOneEvent 32
772
773 typedef struct _LbxReleaseCmapEvent {
774     BYTE        type;           /* always eventBase + LbxEvent */
775     BYTE        lbxType;        /* LbxReleaseCmapEvent */
776     CARD16      sequenceNumber B16;
777     Colormap    colormap B32;
778     CARD32      pad1 B32;
779     CARD32      pad2 B32;
780     CARD32      pad3 B32;
781     CARD32      pad4 B32;
782     CARD32      pad5 B32;
783     CARD32      pad6 B32;
784 } xLbxReleaseCmapEvent;
785 #define sz_xLbxReleaseCmapEvent 32
786
787
788 typedef struct _LbxFreeCellsEvent {
789     BYTE        type;           /* always eventBase + LbxEvent */
790     BYTE        lbxType;        /* LbxFreeCellsEvent */
791     CARD16      sequenceNumber B16;
792     Colormap    colormap B32;
793     CARD32      pixelStart B32;
794     CARD32      pixelEnd B32;
795     CARD32      pad1 B32;
796     CARD32      pad2 B32;
797     CARD32      pad3 B32;
798     CARD32      pad4 B32;
799 } xLbxFreeCellsEvent;
800 #define sz_xLbxFreeCellsEvent   32
801
802
803 /*
804  * squished X event sizes.  If these change, be sure to update lbxquish.c
805  * and unsquish.c appropriately
806  *
807  * lbxsz_* is the padded squished length
808  * lbxupsz_* is the unpadded squished length
809  */
810
811 #define   lbxsz_KeyButtonEvent          32
812 #define lbxupsz_KeyButtonEvent          31
813
814 #define   lbxsz_EnterLeaveEvent         32
815 #define lbxupsz_EnterLeaveEvent         32
816
817 #define   lbxsz_FocusEvent              12
818 #define lbxupsz_FocusEvent              9
819
820 #define   lbxsz_KeymapEvent             32
821 #define lbxupsz_KeymapEvent             32
822
823 #define   lbxsz_ExposeEvent             20
824 #define lbxupsz_ExposeEvent             18
825
826 #define   lbxsz_GfxExposeEvent          24
827 #define lbxupsz_GfxExposeEvent          21
828
829 #define   lbxsz_NoExposeEvent           12
830 #define lbxupsz_NoExposeEvent           11
831
832 #define   lbxsz_VisibilityEvent         12
833 #define lbxupsz_VisibilityEvent         9
834
835 #define   lbxsz_CreateNotifyEvent       24
836 #define lbxupsz_CreateNotifyEvent       23
837
838 #define   lbxsz_DestroyNotifyEvent      12
839 #define lbxupsz_DestroyNotifyEvent      12
840
841 #define   lbxsz_UnmapNotifyEvent        16
842 #define lbxupsz_UnmapNotifyEvent        13
843
844 #define   lbxsz_MapNotifyEvent          16
845 #define lbxupsz_MapNotifyEvent          13
846
847 #define   lbxsz_MapRequestEvent         12
848 #define lbxupsz_MapRequestEvent         12
849
850 #define   lbxsz_ReparentEvent           24
851 #define lbxupsz_ReparentEvent           21
852
853 #define   lbxsz_ConfigureNotifyEvent    28
854 #define lbxupsz_ConfigureNotifyEvent    27
855
856 #define   lbxsz_ConfigureRequestEvent   28
857 #define lbxupsz_ConfigureRequestEvent   28
858
859 #define   lbxsz_GravityEvent            16
860 #define lbxupsz_GravityEvent            16
861
862 #define   lbxsz_ResizeRequestEvent      12
863 #define lbxupsz_ResizeRequestEvent      12
864
865 #define   lbxsz_CirculateEvent          20
866 #define lbxupsz_CirculateEvent          17
867
868 #define   lbxsz_PropertyEvent           20
869 #define lbxupsz_PropertyEvent           17
870
871 #define   lbxsz_SelectionClearEvent     16
872 #define lbxupsz_SelectionClearEvent     16
873
874 #define   lbxsz_SelectionRequestEvent   28
875 #define lbxupsz_SelectionRequestEvent   28
876
877 #define   lbxsz_SelectionNotifyEvent    24
878 #define lbxupsz_SelectionNotifyEvent    24
879
880 #define   lbxsz_ColormapEvent           16
881 #define lbxupsz_ColormapEvent           14
882
883 #define   lbxsz_MappingNotifyEvent      8
884 #define lbxupsz_MappingNotifyEvent      7
885
886 #define   lbxsz_ClientMessageEvent      32
887 #define lbxupsz_ClientMessageEvent      32
888
889 #define lbxsz_UnknownEvent              32
890
891 #ifdef DEBUG
892
893 #define DBG_SWITCH      0x00000001
894 #define DBG_CLOSE       0x00000002
895 #define DBG_IO          0x00000004
896 #define DBG_READ_REQ    0x00000008
897 #define DBG_LEN         0x00000010
898 #define DBG_BLOCK       0x00000020
899 #define DBG_CLIENT      0x00000040
900 #define DBG_DELTA       0x00000080
901
902 extern int lbxDebug;
903
904 #define DBG(n,m)    if (lbxDebug & (n)) { fprintf m; } else
905 #else
906 #define DBG(n,m)
907 #endif
908
909 #endif  /* _LBXSTR_H_ */