1 /* $XConsortium: lbxstr.h /main/27 1996/12/15 21:24:11 rws $ */
3 * Copyright 1992 Network Computing Devices
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.
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.
31 #define LBX_MAJOR_VERSION 1
32 #define LBX_MINOR_VERSION 0
35 BOOL success; /* TRUE */
37 CARD16 majorVersion B16,
39 CARD16 length B16; /* 1/4 additional bytes in setup info */
41 } xLbxConnSetupPrefix;
43 typedef struct _LbxQueryVersion {
44 CARD8 reqType; /* always LbxReqCode */
45 CARD8 lbxReqType; /* always X_LbxQueryVersion */
47 } xLbxQueryVersionReq;
48 #define sz_xLbxQueryVersionReq 4
51 BYTE type; /* X_Reply */
53 CARD16 sequenceNumber B16;
55 CARD16 majorVersion B16; /* major version of LBX protocol */
56 CARD16 minorVersion B16; /* minor version of LBX protocol */
62 } xLbxQueryVersionReply;
63 #define sz_xLbxQueryVersionReply 32
65 typedef struct _LbxStartProxy {
66 CARD8 reqType; /* always LbxReqCode */
67 CARD8 lbxReqType; /* always X_LbxStartProxy */
70 #define sz_xLbxStartProxyReq 4
72 typedef struct _LbxStopProxy {
73 CARD8 reqType; /* always LbxReqCode */
74 CARD8 lbxReqType; /* always X_LbxStopProxy */
77 #define sz_xLbxStopProxyReq 4
79 typedef struct _LbxSwitch {
80 CARD8 reqType; /* always LbxReqCode */
81 CARD8 lbxReqType; /* always X_LbxSwitch */
83 CARD32 client B32; /* new client */
85 #define sz_xLbxSwitchReq 8
87 typedef struct _LbxNewClient {
88 CARD8 reqType; /* always LbxReqCode */
89 CARD8 lbxReqType; /* always X_LbxNewClient */
91 CARD32 client B32; /* new client */
93 #define sz_xLbxNewClientReq 8
95 typedef struct _LbxCloseClient {
96 CARD8 reqType; /* always LbxReqCode */
97 CARD8 lbxReqType; /* always X_LbxCloseClient */
99 CARD32 client B32; /* new client */
100 } xLbxCloseClientReq;
101 #define sz_xLbxCloseClientReq 8
103 typedef struct _LbxModifySequence {
104 CARD8 reqType; /* always LbxReqCode */
105 CARD8 lbxReqType; /* always X_LbxModifySequence */
108 } xLbxModifySequenceReq;
109 #define sz_xLbxModifySequenceReq 8
111 typedef struct _LbxAllowMotion {
112 CARD8 reqType; /* always LbxReqCode */
113 CARD8 lbxReqType; /* always X_LbxAllowMotion */
116 } xLbxAllowMotionReq;
117 #define sz_xLbxAllowMotionReq 8
120 CARD8 reqType; /* always LbxReqCode */
121 CARD8 lbxReqType; /* always X_LbxGrabCmap */
125 #define sz_xLbxGrabCmapReq 8
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
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
141 BYTE type; /* X_Reply */
143 CARD16 sequenceNumber B16;
152 #define sz_xLbxGrabCmapReply 32
153 #define sz_xLbxGrabCmapReplyHdr 8
157 CARD8 reqType; /* always LbxReqCode */
158 CARD8 lbxReqType; /* always X_LbxReleaseCmap */
161 } xLbxReleaseCmapReq;
162 #define sz_xLbxReleaseCmapReq 8
165 CARD8 reqType; /* always LbxReqCode */
166 CARD8 lbxReqType; /* always X_LbxAllocColor */
170 CARD16 red B16, green B16, blue B16;
173 #define sz_xLbxAllocColorReq 20
175 typedef struct _LbxIncrementPixel {
176 CARD8 reqType; /* always LbxReqCode */
177 CARD8 lbxReqType; /* always X_LbxIncrementPixel */
181 } xLbxIncrementPixelReq;
182 #define sz_xLbxIncrementPixelReq 12
184 typedef struct _LbxDelta {
185 CARD8 reqType; /* always LbxReqCode */
186 CARD8 lbxReqType; /* always X_LbxDelta */
188 CARD8 diffs; /* number of diffs */
189 CARD8 cindex; /* cache index */
190 /* list of diffs follows */
192 #define sz_xLbxDeltaReq 6
194 typedef struct _LbxGetModifierMapping {
195 CARD8 reqType; /* always LbxReqCode */
196 CARD8 lbxReqType; /* always X_LbxGetModifierMapping */
198 } xLbxGetModifierMappingReq;
199 #define sz_xLbxGetModifierMappingReq 4
202 BYTE type; /* X_Reply */
204 CARD16 sequenceNumber B16;
212 } xLbxGetModifierMappingReply;
213 #define sz_xLbxGetModifierMappingReply 32
215 typedef struct _LbxGetKeyboardMapping {
216 CARD8 reqType; /* always LbxReqCode */
217 CARD8 lbxReqType; /* always X_LbxGetKeyboardMapping */
219 KeyCode firstKeyCode;
222 } xLbxGetKeyboardMappingReq;
223 #define sz_xLbxGetKeyboardMappingReq 8
226 BYTE type; /* X_Reply */
227 CARD8 keysperkeycode;
228 CARD16 sequenceNumber B16;
236 } xLbxGetKeyboardMappingReply;
237 #define sz_xLbxGetKeyboardMappingReply 32
239 typedef struct _LbxQueryFont {
240 CARD8 reqType; /* always LbxReqCode */
241 CARD8 lbxReqType; /* always X_LbxQueryFont */
245 #define sz_xLbxQueryFontReq 8
247 typedef struct _LbxInternAtoms {
248 CARD8 reqType; /* always LbxReqCode */
249 CARD8 lbxReqType; /* always X_LbxInternAtoms */
252 } xLbxInternAtomsReq;
253 #define sz_xLbxInternAtomsReq 6
256 BYTE type; /* X_Reply */
258 CARD16 sequenceNumber B16;
260 CARD32 atomsStart B32;
266 } xLbxInternAtomsReply;
267 #define sz_xLbxInternAtomsReply 32
268 #define sz_xLbxInternAtomsReplyHdr 8
271 typedef struct _LbxGetWinAttrAndGeom {
272 CARD8 reqType; /* always LbxReqCode */
273 CARD8 lbxReqType; /* always X_LbxGetWinAttrAndGeom */
275 CARD32 id B32; /* window id */
276 } xLbxGetWinAttrAndGeomReq;
277 #define sz_xLbxGetWinAttrAndGeomReq 8
280 BYTE type; /* X_Reply */
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)
292 CARD32 backingBitPlanes B32;
293 CARD32 backingPixel B32;
298 Colormap colormap B32;
299 CARD32 allEventMasks B32;
300 CARD32 yourEventMask B32;
301 CARD16 doNotPropagateMask B16;
305 CARD16 width B16, height B16;
306 CARD16 borderWidth B16;
309 } xLbxGetWinAttrAndGeomReply;
310 #define sz_xLbxGetWinAttrAndGeomReply 60
314 CARD8 reqType; /* always LbxReqCode */
315 CARD8 lbxReqType; /* always X_LbxSync */
318 #define sz_xLbxSyncReq 4
321 BYTE type; /* X_Reply */
323 CARD16 sequenceNumber B16;
332 #define sz_xLbxSyncReply 32
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
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
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
354 #define LBX_MASK_BITS(val, n) ((unsigned int) ((val) & ((1 << (n)) - 1)))
360 /* note that this is identical to xQueryFontReply except for missing
365 /* XXX do we need to leave this gunk? */
373 CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
374 CARD16 defaultChar B16;
375 CARD16 nFontProps B16; /* followed by this many xFontProp structures */
377 CARD8 minByte1, maxByte1;
379 INT16 fontAscent B16, fontDescent B16;
380 CARD32 nCharInfos B32; /* followed by this many xLbxCharInfo structures */
384 BYTE type; /* X_Reply */
386 CARD16 sequenceNumber B16;
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)
398 * if any additional data is needed, its sent in a xLbxFontInfo
400 } xLbxQueryFontReply;
401 #define sz_xLbxQueryFontReply 32
403 typedef struct _LbxChangeProperty {
404 CARD8 reqType; /* always LbxReqCode */
405 CARD8 lbxReqType; /* always X_LbxChangeProperty */
414 } xLbxChangePropertyReq;
415 #define sz_xLbxChangePropertyReq 24
418 BYTE type; /* X_Reply */
420 CARD16 sequenceNumber B16;
428 } xLbxChangePropertyReply;
429 #define sz_xLbxChangePropertyReply 32
431 typedef struct _LbxGetProperty {
432 CARD8 reqType; /* always LbxReqCode */
433 CARD8 lbxReqType; /* always X_LbxGetProperty */
440 CARD32 longOffset B32;
441 CARD32 longLength B32;
442 } xLbxGetPropertyReq;
443 #define sz_xLbxGetPropertyReq 28
446 BYTE type; /* X_Reply */
448 CARD16 sequenceNumber B16;
450 Atom propertyType B32;
451 CARD32 bytesAfter B32;
456 } xLbxGetPropertyReply;
457 #define sz_xLbxGetPropertyReply 32
459 typedef struct _LbxTagData {
460 CARD8 reqType; /* always LbxReqCode */
461 CARD8 lbxReqType; /* always X_LbxTagData */
464 CARD32 real_length B32;
467 #define sz_xLbxTagDataReq 12
469 typedef struct _LbxInvalidateTag {
470 CARD8 reqType; /* always LbxReqCode */
471 CARD8 lbxReqType; /* always X_LbxInvalidateTag */
474 } xLbxInvalidateTagReq;
475 #define sz_xLbxInvalidateTagReq 8
477 typedef struct _LbxPutImage {
478 CARD8 reqType; /* always LbxReqCode */
479 CARD8 lbxReqType; /* always X_LbxPutImage */
481 CARD8 compressionMethod;
484 /* rest is variable */
486 #define sz_xLbxPutImageReq 7
489 CARD8 reqType; /* always LbxReqCode */
490 CARD8 lbxReqType; /* always X_LbxGetImage */
492 Drawable drawable B32;
494 CARD16 width B16, height B16;
495 CARD32 planeMask B32;
501 #define sz_xLbxGetImageReq 24
504 BYTE type; /* X_Reply */
506 CARD16 sequenceNumber B16;
507 CARD32 lbxLength B32;
510 CARD8 compressionMethod;
518 #define sz_xLbxGetImageReply 32
520 /* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment,
521 LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */
523 #define GFX_CACHE_SIZE 15
525 #define GFXdCacheEnt(e) ((e) & 0xf)
526 #define GFXgCacheEnt(e) (((e) >> 4) & 0xf)
527 #define GFXCacheEnts(d,g) (((d) & 0xf) | (((g) & 0xf) << 4))
529 #define GFXCacheNone 0xf
531 typedef struct _LbxPolyPoint {
532 CARD8 reqType; /* always LbxReqCode */
539 #define sz_xLbxPolyPointReq 6
541 typedef xLbxPolyPointReq xLbxPolyLineReq;
542 typedef xLbxPolyPointReq xLbxPolySegmentReq;
543 typedef xLbxPolyPointReq xLbxPolyRectangleReq;
544 typedef xLbxPolyPointReq xLbxPolyArcReq;
545 typedef xLbxPolyPointReq xLbxPolyFillRectangleReq;
546 typedef xLbxPolyPointReq xLbxPolyFillArcReq;
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
555 typedef struct _LbxFillPoly {
556 CARD8 reqType; /* always LbxReqCode */
563 #define sz_xLbxFillPolyReq 7
565 typedef struct _LbxCopyArea {
566 CARD8 reqType; /* always LbxReqCode */
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 */
574 #define sz_xLbxCopyAreaReq 6
576 typedef struct _LbxCopyPlane {
577 CARD8 reqType; /* always LbxReqCode */
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 */
586 #define sz_xLbxCopyPlaneReq 10
588 typedef struct _LbxPolyText {
589 CARD8 reqType; /* always LbxReqCode */
593 /* followed by encoded src x, src y coordinates and text elts */
596 #define sz_xLbxPolyTextReq 5
598 typedef xLbxPolyTextReq xLbxPolyText8Req;
599 typedef xLbxPolyTextReq xLbxPolyText16Req;
601 #define sz_xLbxPolyTextReq 5
602 #define sz_xLbxPolyText8Req 5
603 #define sz_xLbxPolyText16Req 5
605 typedef struct _LbxImageText {
606 CARD8 reqType; /* always LbxReqCode */
611 /* followed by encoded src x, src y coordinates and string */
614 typedef xLbxImageTextReq xLbxImageText8Req;
615 typedef xLbxImageTextReq xLbxImageText16Req;
617 #define sz_xLbxImageTextReq 6
618 #define sz_xLbxImageText8Req 6
619 #define sz_xLbxImageText16Req 6
625 #define sz_xLbxDiffItem 2
628 BYTE type; /* X_Reply */
630 CARD16 sequenceNumber B16;
632 CARD32 optDataStart B32;
639 #define sz_xLbxStartReply 32
640 #define sz_xLbxStartReplyHdr 8
642 typedef struct _LbxQueryExtension {
643 CARD8 reqType; /* always LbxReqCode */
644 CARD8 lbxReqType; /* always X_LbxQueryExtension */
647 } xLbxQueryExtensionReq;
648 #define sz_xLbxQueryExtensionReq 8
650 typedef struct _LbxQueryExtensionReply {
651 BYTE type; /* X_Reply */
653 CARD16 sequenceNumber B16;
665 /* reply & event generating requests */
666 } xLbxQueryExtensionReply;
667 #define sz_xLbxQueryExtensionReply 32
670 typedef struct _LbxBeginLargeRequest {
671 CARD8 reqType; /* always LbxReqCode */
672 CARD8 lbxReqType; /* always X_LbxBeginLargeRequest */
674 CARD32 largeReqLength B32;
675 } xLbxBeginLargeRequestReq;
676 #define sz_BeginLargeRequestReq 8
678 typedef struct _LbxLargeRequestData {
679 CARD8 reqType; /* always LbxReqCode */
680 CARD8 lbxReqType; /* always X_LbxLargeRequestData */
682 /* followed by LISTofCARD8 data */
683 } xLbxLargeRequestDataReq;
684 #define sz_LargeRequestDataReq 4
686 typedef struct _LbxEndLargeRequest {
687 CARD8 reqType; /* always LbxReqCode */
688 CARD8 lbxReqType; /* always X_LbxEndLargeRequest */
690 } xLbxEndLargeRequestReq;
691 #define sz_EndLargeRequestReq 4
695 typedef struct _LbxSwitchEvent {
696 BYTE type; /* always eventBase + LbxEvent */
697 BYTE lbxType; /* LbxSwitchEvent */
701 #define sz_xLbxSwitchEvent 8
703 typedef struct _LbxCloseEvent {
704 BYTE type; /* always eventBase + LbxEvent */
705 BYTE lbxType; /* LbxCloseEvent */
706 CARD16 sequenceNumber B16;
715 #define sz_xLbxCloseEvent 32
717 typedef struct _LbxInvalidateTagEvent {
718 BYTE type; /* always eventBase + LbxEvent */
719 BYTE lbxType; /* LbxInvalidateTagEvent */
720 CARD16 sequenceNumber B16;
728 } xLbxInvalidateTagEvent;
729 #define sz_xLbxInvalidateTagEvent 32
731 typedef struct _LbxSendTagDataEvent {
732 BYTE type; /* always eventBase + LbxEvent */
733 BYTE lbxType; /* LbxSendTagDataEvent */
734 CARD16 sequenceNumber B16;
742 } xLbxSendTagDataEvent;
743 #define sz_xLbxSendTagDataEvent 32
745 typedef struct _LbxListenToOneEvent {
746 BYTE type; /* always eventBase + LbxEvent */
747 BYTE lbxType; /* LbxListenToOneEvent */
748 CARD16 sequenceNumber B16;
756 } xLbxListenToOneEvent;
757 #define sz_xLbxListenToOneEvent 32
759 typedef struct _LbxListenToAllEvent {
760 BYTE type; /* always eventBase + LbxEvent */
761 BYTE lbxType; /* LbxListenToAllEvent */
762 CARD16 sequenceNumber B16;
770 } xLbxListenToAllEvent;
771 #define sz_xLbxListenToOneEvent 32
773 typedef struct _LbxReleaseCmapEvent {
774 BYTE type; /* always eventBase + LbxEvent */
775 BYTE lbxType; /* LbxReleaseCmapEvent */
776 CARD16 sequenceNumber B16;
777 Colormap colormap B32;
784 } xLbxReleaseCmapEvent;
785 #define sz_xLbxReleaseCmapEvent 32
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;
799 } xLbxFreeCellsEvent;
800 #define sz_xLbxFreeCellsEvent 32
804 * squished X event sizes. If these change, be sure to update lbxquish.c
805 * and unsquish.c appropriately
807 * lbxsz_* is the padded squished length
808 * lbxupsz_* is the unpadded squished length
811 #define lbxsz_KeyButtonEvent 32
812 #define lbxupsz_KeyButtonEvent 31
814 #define lbxsz_EnterLeaveEvent 32
815 #define lbxupsz_EnterLeaveEvent 32
817 #define lbxsz_FocusEvent 12
818 #define lbxupsz_FocusEvent 9
820 #define lbxsz_KeymapEvent 32
821 #define lbxupsz_KeymapEvent 32
823 #define lbxsz_ExposeEvent 20
824 #define lbxupsz_ExposeEvent 18
826 #define lbxsz_GfxExposeEvent 24
827 #define lbxupsz_GfxExposeEvent 21
829 #define lbxsz_NoExposeEvent 12
830 #define lbxupsz_NoExposeEvent 11
832 #define lbxsz_VisibilityEvent 12
833 #define lbxupsz_VisibilityEvent 9
835 #define lbxsz_CreateNotifyEvent 24
836 #define lbxupsz_CreateNotifyEvent 23
838 #define lbxsz_DestroyNotifyEvent 12
839 #define lbxupsz_DestroyNotifyEvent 12
841 #define lbxsz_UnmapNotifyEvent 16
842 #define lbxupsz_UnmapNotifyEvent 13
844 #define lbxsz_MapNotifyEvent 16
845 #define lbxupsz_MapNotifyEvent 13
847 #define lbxsz_MapRequestEvent 12
848 #define lbxupsz_MapRequestEvent 12
850 #define lbxsz_ReparentEvent 24
851 #define lbxupsz_ReparentEvent 21
853 #define lbxsz_ConfigureNotifyEvent 28
854 #define lbxupsz_ConfigureNotifyEvent 27
856 #define lbxsz_ConfigureRequestEvent 28
857 #define lbxupsz_ConfigureRequestEvent 28
859 #define lbxsz_GravityEvent 16
860 #define lbxupsz_GravityEvent 16
862 #define lbxsz_ResizeRequestEvent 12
863 #define lbxupsz_ResizeRequestEvent 12
865 #define lbxsz_CirculateEvent 20
866 #define lbxupsz_CirculateEvent 17
868 #define lbxsz_PropertyEvent 20
869 #define lbxupsz_PropertyEvent 17
871 #define lbxsz_SelectionClearEvent 16
872 #define lbxupsz_SelectionClearEvent 16
874 #define lbxsz_SelectionRequestEvent 28
875 #define lbxupsz_SelectionRequestEvent 28
877 #define lbxsz_SelectionNotifyEvent 24
878 #define lbxupsz_SelectionNotifyEvent 24
880 #define lbxsz_ColormapEvent 16
881 #define lbxupsz_ColormapEvent 14
883 #define lbxsz_MappingNotifyEvent 8
884 #define lbxupsz_MappingNotifyEvent 7
886 #define lbxsz_ClientMessageEvent 32
887 #define lbxupsz_ClientMessageEvent 32
889 #define lbxsz_UnknownEvent 32
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
904 #define DBG(n,m) if (lbxDebug & (n)) { fprintf m; } else
909 #endif /* _LBXSTR_H_ */