117ca54c3Smrg/*
217ca54c3Smrg * Copyright 1992 Network Computing Devices
317ca54c3Smrg *
417ca54c3Smrg * Permission to use, copy, modify, distribute, and sell this software and its
517ca54c3Smrg * documentation for any purpose is hereby granted without fee, provided that
617ca54c3Smrg * the above copyright notice appear in all copies and that both that
717ca54c3Smrg * copyright notice and this permission notice appear in supporting
817ca54c3Smrg * documentation, and that the name of NCD. not be used in advertising or
917ca54c3Smrg * publicity pertaining to distribution of the software without specific,
1017ca54c3Smrg * written prior permission.  NCD. makes no representations about the
1117ca54c3Smrg * suitability of this software for any purpose.  It is provided "as is"
1217ca54c3Smrg * without express or implied warranty.
1317ca54c3Smrg *
1417ca54c3Smrg * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
1517ca54c3Smrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
1617ca54c3Smrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1717ca54c3Smrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1817ca54c3Smrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1917ca54c3Smrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2017ca54c3Smrg *
2117ca54c3Smrg */
2217ca54c3Smrg
2317ca54c3Smrg#ifndef _LBXPROTO_H_
2417ca54c3Smrg#define _LBXPROTO_H_
2517ca54c3Smrg
2617ca54c3Smrg#include <X11/extensions/lbx.h>
2717ca54c3Smrg/*
2817ca54c3Smrg * NOTE:  any changes or additions to the opcodes needs to be reflected
2917ca54c3Smrg * in the lbxCacheable array in Xserver/lbx/lbxmain.c
3017ca54c3Smrg */
3117ca54c3Smrg
3217ca54c3Smrg#define X_LbxQueryVersion		0
3317ca54c3Smrg#define X_LbxStartProxy			1
3417ca54c3Smrg#define X_LbxStopProxy			2
3517ca54c3Smrg#define X_LbxSwitch			3
3617ca54c3Smrg#define X_LbxNewClient			4
3717ca54c3Smrg#define X_LbxCloseClient		5
3817ca54c3Smrg#define X_LbxModifySequence		6
3917ca54c3Smrg#define X_LbxAllowMotion		7
4017ca54c3Smrg#define X_LbxIncrementPixel		8
4117ca54c3Smrg#define X_LbxDelta			9
4217ca54c3Smrg#define	X_LbxGetModifierMapping		10
4317ca54c3Smrg#define	X_LbxInvalidateTag		12
4417ca54c3Smrg#define X_LbxPolyPoint			13
4517ca54c3Smrg#define X_LbxPolyLine			14
4617ca54c3Smrg#define X_LbxPolySegment		15
4717ca54c3Smrg#define X_LbxPolyRectangle		16
4817ca54c3Smrg#define X_LbxPolyArc			17
4917ca54c3Smrg#define X_LbxFillPoly			18
5017ca54c3Smrg#define X_LbxPolyFillRectangle		19
5117ca54c3Smrg#define X_LbxPolyFillArc		20
5217ca54c3Smrg#define	X_LbxGetKeyboardMapping		21
5317ca54c3Smrg#define	X_LbxQueryFont			22
5417ca54c3Smrg#define	X_LbxChangeProperty		23
5517ca54c3Smrg#define	X_LbxGetProperty		24
5617ca54c3Smrg#define	X_LbxTagData			25
5717ca54c3Smrg
5817ca54c3Smrg#define X_LbxCopyArea			26
5917ca54c3Smrg#define X_LbxCopyPlane			27
6017ca54c3Smrg#define X_LbxPolyText8			28
6117ca54c3Smrg#define X_LbxPolyText16			29
6217ca54c3Smrg#define X_LbxImageText8			30
6317ca54c3Smrg#define X_LbxImageText16		31
6417ca54c3Smrg
6517ca54c3Smrg#define X_LbxQueryExtension		32
6617ca54c3Smrg#define X_LbxPutImage			33
6717ca54c3Smrg#define X_LbxGetImage			34
6817ca54c3Smrg
6917ca54c3Smrg#define X_LbxBeginLargeRequest		35
7017ca54c3Smrg#define X_LbxLargeRequestData		36
7117ca54c3Smrg#define X_LbxEndLargeRequest		37
7217ca54c3Smrg
7317ca54c3Smrg#define X_LbxInternAtoms		38
7417ca54c3Smrg#define X_LbxGetWinAttrAndGeom		39
7517ca54c3Smrg
7617ca54c3Smrg#define X_LbxGrabCmap			40
7717ca54c3Smrg#define X_LbxReleaseCmap		41
7817ca54c3Smrg#define X_LbxAllocColor			42
7917ca54c3Smrg
8017ca54c3Smrg#define X_LbxSync			43
8117ca54c3Smrg
8217ca54c3Smrg/*
8317ca54c3Smrg * Redefine some basic types used by structures defined herein.  This removes
8417ca54c3Smrg * any possibility on 64-bit architectures of one entity viewing communicated
8517ca54c3Smrg * data as 32-bit quantities and another entity viewing the same data as 64-bit
8617ca54c3Smrg * quantities.
8717ca54c3Smrg */
8817ca54c3Smrg#define XID CARD32
8917ca54c3Smrg#define Atom CARD32
9017ca54c3Smrg#define Colormap CARD32
9117ca54c3Smrg#define Drawable CARD32
9217ca54c3Smrg#define VisualID CARD32
9317ca54c3Smrg#define Window CARD32
9417ca54c3Smrg
9517ca54c3Smrgtypedef struct {
9617ca54c3Smrg    BOOL	success;		/* TRUE */
9717ca54c3Smrg    BOOL	changeType;
98ea1d6981Smrg    CARD16	majorVersion,
99ea1d6981Smrg		minorVersion;
100ea1d6981Smrg    CARD16	length;			/* 1/4 additional bytes in setup info */
101ea1d6981Smrg    CARD32	tag;
10217ca54c3Smrg} xLbxConnSetupPrefix;
10317ca54c3Smrg
10417ca54c3Smrgtypedef struct _LbxQueryVersion {
10517ca54c3Smrg    CARD8	reqType;		/* always LbxReqCode */
10617ca54c3Smrg    CARD8	lbxReqType;		/* always X_LbxQueryVersion */
107ea1d6981Smrg    CARD16	length;
10817ca54c3Smrg} xLbxQueryVersionReq;
10917ca54c3Smrg#define sz_xLbxQueryVersionReq	4
11017ca54c3Smrg
11117ca54c3Smrgtypedef struct {
11217ca54c3Smrg    BYTE	type;			/* X_Reply */
11317ca54c3Smrg    CARD8	unused;
114ea1d6981Smrg    CARD16	sequenceNumber;
115ea1d6981Smrg    CARD32	length;
116ea1d6981Smrg    CARD16	majorVersion;		/* major version of LBX protocol */
117ea1d6981Smrg    CARD16	minorVersion;		/* minor version of LBX protocol */
118ea1d6981Smrg    CARD32	pad0;
119ea1d6981Smrg    CARD32	pad1;
120ea1d6981Smrg    CARD32	pad2;
121ea1d6981Smrg    CARD32	pad3;
122ea1d6981Smrg    CARD32	pad4;
12317ca54c3Smrg} xLbxQueryVersionReply;
12417ca54c3Smrg#define sz_xLbxQueryVersionReply	32
12517ca54c3Smrg
12617ca54c3Smrgtypedef struct _LbxStartProxy {
12717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
12817ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxStartProxy */
129ea1d6981Smrg    CARD16	length;
13017ca54c3Smrg} xLbxStartProxyReq;
13117ca54c3Smrg#define sz_xLbxStartProxyReq	    4
13217ca54c3Smrg
13317ca54c3Smrgtypedef struct _LbxStopProxy {
13417ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
13517ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxStopProxy */
136ea1d6981Smrg    CARD16	length;
13717ca54c3Smrg} xLbxStopProxyReq;
13817ca54c3Smrg#define sz_xLbxStopProxyReq	    4
13917ca54c3Smrg
14017ca54c3Smrgtypedef struct _LbxSwitch {
14117ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
14217ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxSwitch */
143ea1d6981Smrg    CARD16	length;
144ea1d6981Smrg    CARD32	client;		/* new client */
14517ca54c3Smrg} xLbxSwitchReq;
14617ca54c3Smrg#define sz_xLbxSwitchReq	8
14717ca54c3Smrg
14817ca54c3Smrgtypedef struct _LbxNewClient {
14917ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
15017ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxNewClient */
151ea1d6981Smrg    CARD16	length;
152ea1d6981Smrg    CARD32	client;		/* new client */
15317ca54c3Smrg} xLbxNewClientReq;
15417ca54c3Smrg#define sz_xLbxNewClientReq	8
15517ca54c3Smrg
15617ca54c3Smrgtypedef struct _LbxCloseClient {
15717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
15817ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxCloseClient */
159ea1d6981Smrg    CARD16	length;
160ea1d6981Smrg    CARD32	client;		/* new client */
16117ca54c3Smrg} xLbxCloseClientReq;
16217ca54c3Smrg#define sz_xLbxCloseClientReq	8
16317ca54c3Smrg
16417ca54c3Smrgtypedef struct _LbxModifySequence {
16517ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
16617ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxModifySequence */
167ea1d6981Smrg    CARD16	length;
168ea1d6981Smrg    CARD32	adjust;
16917ca54c3Smrg} xLbxModifySequenceReq;
17017ca54c3Smrg#define sz_xLbxModifySequenceReq    8
17117ca54c3Smrg
17217ca54c3Smrgtypedef struct _LbxAllowMotion {
17317ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
17417ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxAllowMotion */
175ea1d6981Smrg    CARD16	length;
176ea1d6981Smrg    CARD32	num;
17717ca54c3Smrg} xLbxAllowMotionReq;
17817ca54c3Smrg#define sz_xLbxAllowMotionReq    8
17917ca54c3Smrg
18017ca54c3Smrgtypedef struct {
18117ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
18217ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGrabCmap */
183ea1d6981Smrg    CARD16	length;
184ea1d6981Smrg    Colormap	cmap;
18517ca54c3Smrg} xLbxGrabCmapReq;
18617ca54c3Smrg#define sz_xLbxGrabCmapReq	8
18717ca54c3Smrg
18817ca54c3Smrg#define LBX_SMART_GRAB		0x80
18917ca54c3Smrg#define LBX_AUTO_RELEASE	0x40
19017ca54c3Smrg#define LBX_3CHANNELS		0x20
19117ca54c3Smrg#define LBX_2BYTE_PIXELS	0x10
19217ca54c3Smrg#define LBX_RGB_BITS_MASK	0x0f
19317ca54c3Smrg
19417ca54c3Smrg#define LBX_LIST_END		0
19517ca54c3Smrg#define LBX_PIXEL_PRIVATE	1
19617ca54c3Smrg#define LBX_PIXEL_SHARED	2
19717ca54c3Smrg#define LBX_PIXEL_RANGE_PRIVATE	3
19817ca54c3Smrg#define LBX_PIXEL_RANGE_SHARED	4
19917ca54c3Smrg#define LBX_NEXT_CHANNEL	5
20017ca54c3Smrg
20117ca54c3Smrgtypedef struct {
20217ca54c3Smrg    BYTE	type;			/* X_Reply */
20317ca54c3Smrg    CARD8	flags;
204ea1d6981Smrg    CARD16	sequenceNumber;
205ea1d6981Smrg    CARD32	length;
206ea1d6981Smrg    CARD32	pad0;
207ea1d6981Smrg    CARD32	pad1;
208ea1d6981Smrg    CARD32	pad2;
209ea1d6981Smrg    CARD32	pad3;
210ea1d6981Smrg    CARD32	pad4;
211ea1d6981Smrg    CARD32	pad5;
21217ca54c3Smrg} xLbxGrabCmapReply;
21317ca54c3Smrg#define sz_xLbxGrabCmapReply	32
21417ca54c3Smrg#define sz_xLbxGrabCmapReplyHdr	8
21517ca54c3Smrg
21617ca54c3Smrg
21717ca54c3Smrgtypedef struct {
21817ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
21917ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxReleaseCmap */
220ea1d6981Smrg    CARD16	length;
221ea1d6981Smrg    Colormap	cmap;
22217ca54c3Smrg} xLbxReleaseCmapReq;
22317ca54c3Smrg#define sz_xLbxReleaseCmapReq	8
22417ca54c3Smrg
22517ca54c3Smrgtypedef struct {
22617ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
22717ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxAllocColor */
228ea1d6981Smrg    CARD16	length;
229ea1d6981Smrg    Colormap	cmap;
230ea1d6981Smrg    CARD32	pixel;
231ea1d6981Smrg    CARD16	red, green, blue;
232ea1d6981Smrg    CARD16	pad;
23317ca54c3Smrg} xLbxAllocColorReq;
23417ca54c3Smrg#define sz_xLbxAllocColorReq	20
23517ca54c3Smrg
23617ca54c3Smrgtypedef struct _LbxIncrementPixel {
23717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
23817ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxIncrementPixel */
239ea1d6981Smrg    CARD16	length;
240ea1d6981Smrg    CARD32	cmap;
241ea1d6981Smrg    CARD32	pixel;
24217ca54c3Smrg} xLbxIncrementPixelReq;
24317ca54c3Smrg#define sz_xLbxIncrementPixelReq    12
24417ca54c3Smrg
24517ca54c3Smrgtypedef struct _LbxDelta {
24617ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
24717ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxDelta */
248ea1d6981Smrg    CARD16	length;
24917ca54c3Smrg    CARD8	diffs;		/* number of diffs */
25017ca54c3Smrg    CARD8	cindex;		/* cache index */
25117ca54c3Smrg				/* list of diffs follows */
25217ca54c3Smrg} xLbxDeltaReq;
25317ca54c3Smrg#define sz_xLbxDeltaReq    6
25417ca54c3Smrg
25517ca54c3Smrgtypedef struct _LbxGetModifierMapping {
25617ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
25717ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGetModifierMapping */
258ea1d6981Smrg    CARD16	length;
25917ca54c3Smrg} xLbxGetModifierMappingReq;
26017ca54c3Smrg#define	sz_xLbxGetModifierMappingReq	4
26117ca54c3Smrg
26217ca54c3Smrgtypedef struct {
26317ca54c3Smrg    BYTE	type;			/* X_Reply */
26417ca54c3Smrg    CARD8	keyspermod;
265ea1d6981Smrg    CARD16	sequenceNumber;
266ea1d6981Smrg    CARD32	length;
267ea1d6981Smrg    CARD32	tag;
268ea1d6981Smrg    CARD32	pad0;
269ea1d6981Smrg    CARD32	pad1;
270ea1d6981Smrg    CARD32	pad2;
271ea1d6981Smrg    CARD32	pad3;
272ea1d6981Smrg    CARD32	pad4;
27317ca54c3Smrg} xLbxGetModifierMappingReply;
27417ca54c3Smrg#define sz_xLbxGetModifierMappingReply	32
27517ca54c3Smrg
27617ca54c3Smrgtypedef struct _LbxGetKeyboardMapping {
27717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
27817ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGetKeyboardMapping */
279ea1d6981Smrg    CARD16	length;
28017ca54c3Smrg    KeyCode	firstKeyCode;
28117ca54c3Smrg    CARD8	count;
282ea1d6981Smrg    CARD16	pad1;
28317ca54c3Smrg} xLbxGetKeyboardMappingReq;
28417ca54c3Smrg#define	sz_xLbxGetKeyboardMappingReq	8
28517ca54c3Smrg
28617ca54c3Smrgtypedef struct {
28717ca54c3Smrg    BYTE	type;			/* X_Reply */
28817ca54c3Smrg    CARD8	keysperkeycode;
289ea1d6981Smrg    CARD16	sequenceNumber;
290ea1d6981Smrg    CARD32	length;
291ea1d6981Smrg    CARD32	tag;
292ea1d6981Smrg    CARD32	pad0;
293ea1d6981Smrg    CARD32	pad1;
294ea1d6981Smrg    CARD32	pad2;
295ea1d6981Smrg    CARD32	pad3;
296ea1d6981Smrg    CARD32	pad4;
29717ca54c3Smrg} xLbxGetKeyboardMappingReply;
29817ca54c3Smrg#define sz_xLbxGetKeyboardMappingReply	32
29917ca54c3Smrg
30017ca54c3Smrgtypedef struct _LbxQueryFont {
30117ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
30217ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxQueryFont */
303ea1d6981Smrg    CARD16	length;
304ea1d6981Smrg    CARD32	fid;
30517ca54c3Smrg} xLbxQueryFontReq;
30617ca54c3Smrg#define	sz_xLbxQueryFontReq	8
30717ca54c3Smrg
30817ca54c3Smrgtypedef struct _LbxInternAtoms {
30917ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
31017ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxInternAtoms */
311ea1d6981Smrg    CARD16	length;
312ea1d6981Smrg    CARD16	num;
31317ca54c3Smrg} xLbxInternAtomsReq;
31417ca54c3Smrg#define sz_xLbxInternAtomsReq	6
31517ca54c3Smrg
31617ca54c3Smrgtypedef struct {
31717ca54c3Smrg    BYTE	type;		/* X_Reply */
31817ca54c3Smrg    CARD8	unused;
319ea1d6981Smrg    CARD16	sequenceNumber;
320ea1d6981Smrg    CARD32	length;
321ea1d6981Smrg    CARD32	atomsStart;
322ea1d6981Smrg    CARD32	pad0;
323ea1d6981Smrg    CARD32	pad1;
324ea1d6981Smrg    CARD32	pad2;
325ea1d6981Smrg    CARD32	pad3;
326ea1d6981Smrg    CARD32	pad4;
32717ca54c3Smrg} xLbxInternAtomsReply;
32817ca54c3Smrg#define sz_xLbxInternAtomsReply		32
32917ca54c3Smrg#define sz_xLbxInternAtomsReplyHdr	8
33017ca54c3Smrg
33117ca54c3Smrg
33217ca54c3Smrgtypedef struct _LbxGetWinAttrAndGeom {
33317ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
33417ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGetWinAttrAndGeom */
335ea1d6981Smrg    CARD16	length;
336ea1d6981Smrg    CARD32	id;		/* window id */
33717ca54c3Smrg} xLbxGetWinAttrAndGeomReq;
33817ca54c3Smrg#define sz_xLbxGetWinAttrAndGeomReq 8
33917ca54c3Smrg
34017ca54c3Smrgtypedef struct {
34117ca54c3Smrg    BYTE type;  /* X_Reply */
34217ca54c3Smrg    CARD8 backingStore;
343ea1d6981Smrg    CARD16 sequenceNumber;
344ea1d6981Smrg    CARD32 length;		/* NOT 0; this is an extra-large reply */
345ea1d6981Smrg    VisualID visualID;
34617ca54c3Smrg#if defined(__cplusplus) || defined(c_plusplus)
347ea1d6981Smrg    CARD16 c_class;
34817ca54c3Smrg#else
349ea1d6981Smrg    CARD16 class;
35017ca54c3Smrg#endif
35117ca54c3Smrg    CARD8 bitGravity;
35217ca54c3Smrg    CARD8 winGravity;
353ea1d6981Smrg    CARD32 backingBitPlanes;
354ea1d6981Smrg    CARD32 backingPixel;
35517ca54c3Smrg    BOOL saveUnder;
35617ca54c3Smrg    BOOL mapInstalled;
35717ca54c3Smrg    CARD8 mapState;
35817ca54c3Smrg    BOOL override;
359ea1d6981Smrg    Colormap colormap;
360ea1d6981Smrg    CARD32 allEventMasks;
361ea1d6981Smrg    CARD32 yourEventMask;
362ea1d6981Smrg    CARD16 doNotPropagateMask;
363ea1d6981Smrg    CARD16 pad1;
364ea1d6981Smrg    Window root;
365ea1d6981Smrg    INT16 x, y;
366ea1d6981Smrg    CARD16 width, height;
367ea1d6981Smrg    CARD16 borderWidth;
36817ca54c3Smrg    CARD8 depth;
36917ca54c3Smrg    CARD8 pad2;
37017ca54c3Smrg} xLbxGetWinAttrAndGeomReply;
37117ca54c3Smrg#define sz_xLbxGetWinAttrAndGeomReply 60
37217ca54c3Smrg
37317ca54c3Smrg
37417ca54c3Smrgtypedef struct {
37517ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
37617ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxSync */
377ea1d6981Smrg    CARD16	length;
37817ca54c3Smrg} xLbxSyncReq;
37917ca54c3Smrg#define sz_xLbxSyncReq	4
38017ca54c3Smrg
38117ca54c3Smrgtypedef struct {
38217ca54c3Smrg    BYTE	type;			/* X_Reply */
38317ca54c3Smrg    CARD8	pad0;
384ea1d6981Smrg    CARD16	sequenceNumber;
385ea1d6981Smrg    CARD32	length;
386ea1d6981Smrg    CARD32	pad1;
387ea1d6981Smrg    CARD32	pad2;
388ea1d6981Smrg    CARD32	pad3;
389ea1d6981Smrg    CARD32	pad4;
390ea1d6981Smrg    CARD32	pad5;
391ea1d6981Smrg    CARD32	pad6;
39217ca54c3Smrg} xLbxSyncReply;
39317ca54c3Smrg#define sz_xLbxSyncReply 32
39417ca54c3Smrg
39517ca54c3Smrg
39617ca54c3Smrg/* an LBX squished charinfo packs the data in a CARD32 as follows */
39717ca54c3Smrg#define	LBX_WIDTH_SHIFT		26
39817ca54c3Smrg#define	LBX_LEFT_SHIFT		20
39917ca54c3Smrg#define	LBX_RIGHT_SHIFT		13
40017ca54c3Smrg#define	LBX_ASCENT_SHIFT	7
40117ca54c3Smrg#define	LBX_DESCENT_SHIFT	0
40217ca54c3Smrg
40317ca54c3Smrg#define	LBX_WIDTH_BITS		6
40417ca54c3Smrg#define	LBX_LEFT_BITS		6
40517ca54c3Smrg#define	LBX_RIGHT_BITS		7
40617ca54c3Smrg#define	LBX_ASCENT_BITS		6
40717ca54c3Smrg#define	LBX_DESCENT_BITS	7
40817ca54c3Smrg
40917ca54c3Smrg#define	LBX_WIDTH_MASK		0xfc000000
41017ca54c3Smrg#define	LBX_LEFT_MASK		0x03f00000
41117ca54c3Smrg#define	LBX_RIGHT_MASK		0x000fe000
41217ca54c3Smrg#define	LBX_ASCENT_MASK		0x00001f80
41317ca54c3Smrg#define	LBX_DESCENT_MASK	0x0000007f
41417ca54c3Smrg
41517ca54c3Smrg#define	LBX_MASK_BITS(val, n)	((unsigned int) ((val) & ((1 << (n)) - 1)))
41617ca54c3Smrg
41717ca54c3Smrgtypedef struct {
418ea1d6981Smrg    CARD32	metrics;
41917ca54c3Smrg} xLbxCharInfo;
42017ca54c3Smrg
42117ca54c3Smrg/* note that this is identical to xQueryFontReply except for missing
42217ca54c3Smrg * first 2 words
42317ca54c3Smrg */
42417ca54c3Smrgtypedef struct {
42517ca54c3Smrg    xCharInfo minBounds;
42617ca54c3Smrg/* XXX do we need to leave this gunk? */
42717ca54c3Smrg#ifndef WORD64
428ea1d6981Smrg    CARD32 walign1;
42917ca54c3Smrg#endif
43017ca54c3Smrg    xCharInfo maxBounds;
43117ca54c3Smrg#ifndef WORD64
432ea1d6981Smrg    CARD32 walign2;
43317ca54c3Smrg#endif
434ea1d6981Smrg    CARD16 minCharOrByte2, maxCharOrByte2;
435ea1d6981Smrg    CARD16 defaultChar;
436ea1d6981Smrg    CARD16 nFontProps;	/* followed by this many xFontProp structures */
43717ca54c3Smrg    CARD8 drawDirection;
43817ca54c3Smrg    CARD8 minByte1, maxByte1;
43917ca54c3Smrg    BOOL allCharsExist;
440ea1d6981Smrg    INT16 fontAscent, fontDescent;
441ea1d6981Smrg    CARD32 nCharInfos;	/* followed by this many xLbxCharInfo structures */
44217ca54c3Smrg} xLbxFontInfo;
44317ca54c3Smrg
44417ca54c3Smrgtypedef struct {
44517ca54c3Smrg    BYTE	type;			/* X_Reply */
44617ca54c3Smrg    CARD8	compression;
447ea1d6981Smrg    CARD16	sequenceNumber;
448ea1d6981Smrg    CARD32	length;
449ea1d6981Smrg    CARD32	tag;
450ea1d6981Smrg    CARD32	pad0;
451ea1d6981Smrg    CARD32	pad1;
452ea1d6981Smrg    CARD32	pad2;
453ea1d6981Smrg    CARD32	pad3;
454ea1d6981Smrg    CARD32	pad4;
45517ca54c3Smrg    /* X_QueryFont sticks much of the data in the base reply packet,
45617ca54c3Smrg     * but we hope that it won't be needed, (and it won't fit in 32 bytes
45717ca54c3Smrg     * with the tag anyways)
45817ca54c3Smrg     *
45917ca54c3Smrg     * if any additional data is needed, its sent in a xLbxFontInfo
46017ca54c3Smrg     */
46117ca54c3Smrg} xLbxQueryFontReply;
46217ca54c3Smrg#define sz_xLbxQueryFontReply	32
46317ca54c3Smrg
46417ca54c3Smrgtypedef struct _LbxChangeProperty {
46517ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
46617ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxChangeProperty */
467ea1d6981Smrg    CARD16	length;
468ea1d6981Smrg    Window	window;
469ea1d6981Smrg    Atom	property;
470ea1d6981Smrg    Atom	type;
47117ca54c3Smrg    CARD8	format;
47217ca54c3Smrg    CARD8	mode;
47317ca54c3Smrg    BYTE	pad[2];
474ea1d6981Smrg    CARD32	nUnits;
47517ca54c3Smrg} xLbxChangePropertyReq;
47617ca54c3Smrg#define	sz_xLbxChangePropertyReq	24
47717ca54c3Smrg
47817ca54c3Smrgtypedef struct {
47917ca54c3Smrg    BYTE	type;			/* X_Reply */
48017ca54c3Smrg    CARD8	pad;
481ea1d6981Smrg    CARD16	sequenceNumber;
482ea1d6981Smrg    CARD32	length;
483ea1d6981Smrg    CARD32	tag;
484ea1d6981Smrg    CARD32	pad0;
485ea1d6981Smrg    CARD32	pad1;
486ea1d6981Smrg    CARD32	pad2;
487ea1d6981Smrg    CARD32	pad3;
488ea1d6981Smrg    CARD32	pad4;
48917ca54c3Smrg} xLbxChangePropertyReply;
49017ca54c3Smrg#define sz_xLbxChangePropertyReply	32
49117ca54c3Smrg
49217ca54c3Smrgtypedef struct _LbxGetProperty {
49317ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
49417ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGetProperty */
495ea1d6981Smrg    CARD16	length;
496ea1d6981Smrg    Window	window;
497ea1d6981Smrg    Atom	property;
498ea1d6981Smrg    Atom	type;
49917ca54c3Smrg    CARD8	delete;
50017ca54c3Smrg    BYTE	pad[3];
501ea1d6981Smrg    CARD32	longOffset;
502ea1d6981Smrg    CARD32	longLength;
50317ca54c3Smrg} xLbxGetPropertyReq;
50417ca54c3Smrg#define	sz_xLbxGetPropertyReq	28
50517ca54c3Smrg
50617ca54c3Smrgtypedef struct {
50717ca54c3Smrg    BYTE	type;			/* X_Reply */
50817ca54c3Smrg    CARD8	format;
509ea1d6981Smrg    CARD16	sequenceNumber;
510ea1d6981Smrg    CARD32	length;
511ea1d6981Smrg    Atom	propertyType;
512ea1d6981Smrg    CARD32	bytesAfter;
513ea1d6981Smrg    CARD32	nItems;
514ea1d6981Smrg    CARD32	tag;
515ea1d6981Smrg    CARD32	pad1;
516ea1d6981Smrg    CARD32	pad2;
51717ca54c3Smrg} xLbxGetPropertyReply;
51817ca54c3Smrg#define sz_xLbxGetPropertyReply	32
51917ca54c3Smrg
52017ca54c3Smrgtypedef struct _LbxTagData {
52117ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
52217ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxTagData */
523ea1d6981Smrg    CARD16	length;
524ea1d6981Smrg    XID 	tag;
525ea1d6981Smrg    CARD32	real_length;
52617ca54c3Smrg    /* data */
52717ca54c3Smrg} xLbxTagDataReq;
52817ca54c3Smrg#define	sz_xLbxTagDataReq	12
52917ca54c3Smrg
53017ca54c3Smrgtypedef struct _LbxInvalidateTag {
53117ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
53217ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxInvalidateTag */
533ea1d6981Smrg    CARD16	length;
534ea1d6981Smrg    CARD32	tag;
53517ca54c3Smrg} xLbxInvalidateTagReq;
53617ca54c3Smrg#define	sz_xLbxInvalidateTagReq	8
53717ca54c3Smrg
53817ca54c3Smrgtypedef struct _LbxPutImage {
53917ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
54017ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxPutImage */
541ea1d6981Smrg    CARD16	length;
54217ca54c3Smrg    CARD8	compressionMethod;
54317ca54c3Smrg    CARD8	cacheEnts;
54417ca54c3Smrg    CARD8	bitPacked;
54517ca54c3Smrg    /* rest is variable */
54617ca54c3Smrg} xLbxPutImageReq;
54717ca54c3Smrg#define sz_xLbxPutImageReq	7
54817ca54c3Smrg
54917ca54c3Smrgtypedef struct {
55017ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
55117ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxGetImage */
552ea1d6981Smrg    CARD16	length;
553ea1d6981Smrg    Drawable	drawable;
554ea1d6981Smrg    INT16	x, y;
555ea1d6981Smrg    CARD16	width, height;
556ea1d6981Smrg    CARD32	planeMask;
55717ca54c3Smrg    CARD8	format;
55817ca54c3Smrg    CARD8	pad1;
559ea1d6981Smrg    CARD16	pad2;
56017ca54c3Smrg} xLbxGetImageReq;
56117ca54c3Smrg
56217ca54c3Smrg#define sz_xLbxGetImageReq 24
56317ca54c3Smrg
56417ca54c3Smrgtypedef struct {
56517ca54c3Smrg    BYTE type;			/* X_Reply */
56617ca54c3Smrg    CARD8 depth;
567ea1d6981Smrg    CARD16 sequenceNumber;
568ea1d6981Smrg    CARD32 lbxLength;
569ea1d6981Smrg    CARD32 xLength;
570ea1d6981Smrg    VisualID visual;
57117ca54c3Smrg    CARD8 compressionMethod;
57217ca54c3Smrg    CARD8 pad1;
573ea1d6981Smrg    CARD16 pad2;
574ea1d6981Smrg    CARD32 pad3;
575ea1d6981Smrg    CARD32 pad4;
576ea1d6981Smrg    CARD32 pad5;
57717ca54c3Smrg} xLbxGetImageReply;
57817ca54c3Smrg
57917ca54c3Smrg#define sz_xLbxGetImageReply 32
58017ca54c3Smrg
58117ca54c3Smrg/* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment,
58217ca54c3Smrg   LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */
58317ca54c3Smrg
58417ca54c3Smrg#define GFX_CACHE_SIZE  15
58517ca54c3Smrg
58617ca54c3Smrg#define GFXdCacheEnt(e)	    ((e) & 0xf)
58717ca54c3Smrg#define GFXgCacheEnt(e)	    (((e) >> 4) & 0xf)
58817ca54c3Smrg#define GFXCacheEnts(d,g)   (((d) & 0xf) | (((g) & 0xf) << 4))
58917ca54c3Smrg
59017ca54c3Smrg#define GFXCacheNone   0xf
59117ca54c3Smrg
59217ca54c3Smrgtypedef struct _LbxPolyPoint {
59317ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
59417ca54c3Smrg    CARD8	lbxReqType;
595ea1d6981Smrg    CARD16	length;
59617ca54c3Smrg    CARD8	cacheEnts;
59717ca54c3Smrg    CARD8	padBytes;
59817ca54c3Smrg} xLbxPolyPointReq;
59917ca54c3Smrg
60017ca54c3Smrg#define sz_xLbxPolyPointReq	6
60117ca54c3Smrg
60217ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolyLineReq;
60317ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolySegmentReq;
60417ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolyRectangleReq;
60517ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolyArcReq;
60617ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolyFillRectangleReq;
60717ca54c3Smrgtypedef xLbxPolyPointReq xLbxPolyFillArcReq;
60817ca54c3Smrg
60917ca54c3Smrg#define sz_xLbxPolyLineReq		sz_xLbxPolyPointReq
61017ca54c3Smrg#define sz_xLbxPolySegmentReq		sz_xLbxPolyPointReq
61117ca54c3Smrg#define sz_xLbxPolyRectangleReq		sz_xLbxPolyPointReq
61217ca54c3Smrg#define sz_xLbxPolyArcReq		sz_xLbxPolyPointReq
61317ca54c3Smrg#define sz_xLbxPolyFillRectangleReq	sz_xLbxPolyPointReq
61417ca54c3Smrg#define sz_xLbxPolyFillArc		sz_xLbxPolyPointReq
61517ca54c3Smrg
61617ca54c3Smrgtypedef struct _LbxFillPoly {
61717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
61817ca54c3Smrg    CARD8	lbxReqType;
619ea1d6981Smrg    CARD16	length;
62017ca54c3Smrg    CARD8	cacheEnts;
62117ca54c3Smrg    BYTE	shape;
62217ca54c3Smrg    CARD8	padBytes;
62317ca54c3Smrg} xLbxFillPolyReq;
62417ca54c3Smrg#define sz_xLbxFillPolyReq	7
62517ca54c3Smrg
62617ca54c3Smrgtypedef struct _LbxCopyArea {
62717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
62817ca54c3Smrg    CARD8	lbxReqType;
629ea1d6981Smrg    CARD16	length;
63017ca54c3Smrg    CARD8	srcCache;	/* source drawable */
63117ca54c3Smrg    CARD8	cacheEnts;	/* dest drawable and gc */
63217ca54c3Smrg    /* followed by encoded src x, src y, dst x, dst y, width, height */
63317ca54c3Smrg} xLbxCopyAreaReq;
63417ca54c3Smrg
63517ca54c3Smrg#define sz_xLbxCopyAreaReq  6
63617ca54c3Smrg
63717ca54c3Smrgtypedef struct _LbxCopyPlane {
63817ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
63917ca54c3Smrg    CARD8	lbxReqType;
640ea1d6981Smrg    CARD16	length;
641ea1d6981Smrg    CARD32	bitPlane;
64217ca54c3Smrg    CARD8	srcCache;	/* source drawable */
64317ca54c3Smrg    CARD8	cacheEnts;	/* dest drawable and gc */
64417ca54c3Smrg    /* followed by encoded src x, src y, dst x, dst y, width, height */
64517ca54c3Smrg} xLbxCopyPlaneReq;
64617ca54c3Smrg
64717ca54c3Smrg#define sz_xLbxCopyPlaneReq  10
64817ca54c3Smrg
64917ca54c3Smrgtypedef struct _LbxPolyText {
65017ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
65117ca54c3Smrg    CARD8	lbxReqType;
652ea1d6981Smrg    CARD16	length;
65317ca54c3Smrg    CARD8	cacheEnts;
65417ca54c3Smrg    /* followed by encoded src x, src y coordinates and text elts */
65517ca54c3Smrg} xLbxPolyTextReq;
65617ca54c3Smrg
65717ca54c3Smrg#define sz_xLbxPolyTextReq  5
65817ca54c3Smrg
65917ca54c3Smrgtypedef xLbxPolyTextReq xLbxPolyText8Req;
66017ca54c3Smrgtypedef xLbxPolyTextReq xLbxPolyText16Req;
66117ca54c3Smrg
66217ca54c3Smrg#define sz_xLbxPolyTextReq	5
66317ca54c3Smrg#define sz_xLbxPolyText8Req	5
66417ca54c3Smrg#define sz_xLbxPolyText16Req	5
66517ca54c3Smrg
66617ca54c3Smrgtypedef struct _LbxImageText {
66717ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
66817ca54c3Smrg    CARD8	lbxReqType;
669ea1d6981Smrg    CARD16	length;
67017ca54c3Smrg    CARD8	cacheEnts;
67117ca54c3Smrg    CARD8	nChars;
67217ca54c3Smrg    /* followed by encoded src x, src y coordinates and string */
67317ca54c3Smrg} xLbxImageTextReq;
67417ca54c3Smrg
67517ca54c3Smrgtypedef xLbxImageTextReq xLbxImageText8Req;
67617ca54c3Smrgtypedef xLbxImageTextReq xLbxImageText16Req;
67717ca54c3Smrg
67817ca54c3Smrg#define sz_xLbxImageTextReq	6
67917ca54c3Smrg#define sz_xLbxImageText8Req	6
68017ca54c3Smrg#define sz_xLbxImageText16Req	6
68117ca54c3Smrg
68217ca54c3Smrgtypedef struct {
68317ca54c3Smrg    CARD8       offset;
68417ca54c3Smrg    CARD8       diff;
68517ca54c3Smrg} xLbxDiffItem;
68617ca54c3Smrg#define sz_xLbxDiffItem    2
68717ca54c3Smrg
68817ca54c3Smrgtypedef struct {
68917ca54c3Smrg    BYTE	type;		/* X_Reply */
69017ca54c3Smrg    CARD8	nOpts;
691ea1d6981Smrg    CARD16	sequenceNumber;
692ea1d6981Smrg    CARD32	length;
693ea1d6981Smrg    CARD32	optDataStart;
694ea1d6981Smrg    CARD32	pad0;
695ea1d6981Smrg    CARD32	pad1;
696ea1d6981Smrg    CARD32	pad2;
697ea1d6981Smrg    CARD32	pad3;
698ea1d6981Smrg    CARD32	pad4;
69917ca54c3Smrg} xLbxStartReply;
70017ca54c3Smrg#define sz_xLbxStartReply	32
70117ca54c3Smrg#define sz_xLbxStartReplyHdr	8
70217ca54c3Smrg
70317ca54c3Smrgtypedef struct _LbxQueryExtension {
70417ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
70517ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxQueryExtension */
706ea1d6981Smrg    CARD16	length;
707ea1d6981Smrg    CARD32	nbytes;
70817ca54c3Smrg} xLbxQueryExtensionReq;
70917ca54c3Smrg#define	sz_xLbxQueryExtensionReq	8
71017ca54c3Smrg
71117ca54c3Smrgtypedef struct _LbxQueryExtensionReply {
71217ca54c3Smrg    BYTE	type;			/* X_Reply */
71317ca54c3Smrg    CARD8	numReqs;
714ea1d6981Smrg    CARD16	sequenceNumber;
715ea1d6981Smrg    CARD32	length;
71617ca54c3Smrg    BOOL	present;
71717ca54c3Smrg    CARD8	major_opcode;
71817ca54c3Smrg    CARD8	first_event;
71917ca54c3Smrg    CARD8	first_error;
720ea1d6981Smrg    CARD32	pad0;
721ea1d6981Smrg    CARD32	pad1;
722ea1d6981Smrg    CARD32	pad2;
723ea1d6981Smrg    CARD32	pad3;
724ea1d6981Smrg    CARD32	pad4;
72517ca54c3Smrg
72617ca54c3Smrg    /* reply & event generating requests */
72717ca54c3Smrg} xLbxQueryExtensionReply;
72817ca54c3Smrg#define sz_xLbxQueryExtensionReply	32
72917ca54c3Smrg
73017ca54c3Smrg
73117ca54c3Smrgtypedef struct _LbxBeginLargeRequest {
73217ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
73317ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxBeginLargeRequest */
734ea1d6981Smrg    CARD16	length;
735ea1d6981Smrg    CARD32	largeReqLength;
73617ca54c3Smrg} xLbxBeginLargeRequestReq;
73717ca54c3Smrg#define	sz_BeginLargeRequestReq 8
73817ca54c3Smrg
73917ca54c3Smrgtypedef struct _LbxLargeRequestData {
74017ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
74117ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxLargeRequestData */
742ea1d6981Smrg    CARD16	length;
74317ca54c3Smrg    /* followed by LISTofCARD8 data */
74417ca54c3Smrg} xLbxLargeRequestDataReq;
74517ca54c3Smrg#define	sz_LargeRequestDataReq 4
74617ca54c3Smrg
74717ca54c3Smrgtypedef struct _LbxEndLargeRequest {
74817ca54c3Smrg    CARD8	reqType;	/* always LbxReqCode */
74917ca54c3Smrg    CARD8	lbxReqType;	/* always X_LbxEndLargeRequest */
750ea1d6981Smrg    CARD16	length;
75117ca54c3Smrg} xLbxEndLargeRequestReq;
75217ca54c3Smrg#define	sz_EndLargeRequestReq 4
75317ca54c3Smrg
75417ca54c3Smrg
75517ca54c3Smrg
75617ca54c3Smrgtypedef struct _LbxSwitchEvent {
75717ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
75817ca54c3Smrg    BYTE	lbxType;	/* LbxSwitchEvent */
759ea1d6981Smrg    CARD16	pad;
760ea1d6981Smrg    CARD32	client;
76117ca54c3Smrg} xLbxSwitchEvent;
76217ca54c3Smrg#define sz_xLbxSwitchEvent	8
76317ca54c3Smrg
76417ca54c3Smrgtypedef struct _LbxCloseEvent {
76517ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
76617ca54c3Smrg    BYTE	lbxType;	/* LbxCloseEvent */
767ea1d6981Smrg    CARD16	sequenceNumber;
768ea1d6981Smrg    CARD32	client;
769ea1d6981Smrg    CARD32	pad1;
770ea1d6981Smrg    CARD32	pad2;
771ea1d6981Smrg    CARD32	pad3;
772ea1d6981Smrg    CARD32	pad4;
773ea1d6981Smrg    CARD32	pad5;
774ea1d6981Smrg    CARD32	pad6;
77517ca54c3Smrg} xLbxCloseEvent;
77617ca54c3Smrg#define sz_xLbxCloseEvent	32
77717ca54c3Smrg
77817ca54c3Smrgtypedef struct _LbxInvalidateTagEvent {
77917ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
78017ca54c3Smrg    BYTE	lbxType;	/* LbxInvalidateTagEvent */
781ea1d6981Smrg    CARD16	sequenceNumber;
782ea1d6981Smrg    CARD32	tag;
783ea1d6981Smrg    CARD32	tagType;
784ea1d6981Smrg    CARD32	pad1;
785ea1d6981Smrg    CARD32	pad2;
786ea1d6981Smrg    CARD32	pad3;
787ea1d6981Smrg    CARD32	pad4;
788ea1d6981Smrg    CARD32	pad5;
78917ca54c3Smrg} xLbxInvalidateTagEvent;
79017ca54c3Smrg#define sz_xLbxInvalidateTagEvent 32
79117ca54c3Smrg
79217ca54c3Smrgtypedef struct _LbxSendTagDataEvent {
79317ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
79417ca54c3Smrg    BYTE	lbxType;	/* LbxSendTagDataEvent */
795ea1d6981Smrg    CARD16	sequenceNumber;
796ea1d6981Smrg    CARD32	tag;
797ea1d6981Smrg    CARD32	tagType;
798ea1d6981Smrg    CARD32	pad1;
799ea1d6981Smrg    CARD32	pad2;
800ea1d6981Smrg    CARD32	pad3;
801ea1d6981Smrg    CARD32	pad4;
802ea1d6981Smrg    CARD32	pad5;
80317ca54c3Smrg} xLbxSendTagDataEvent;
80417ca54c3Smrg#define sz_xLbxSendTagDataEvent 32
80517ca54c3Smrg
80617ca54c3Smrgtypedef struct _LbxListenToOneEvent {
80717ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
80817ca54c3Smrg    BYTE	lbxType;	/* LbxListenToOneEvent */
809ea1d6981Smrg    CARD16	sequenceNumber;
810ea1d6981Smrg    CARD32	client;
811ea1d6981Smrg    CARD32	pad1;
812ea1d6981Smrg    CARD32	pad2;
813ea1d6981Smrg    CARD32	pad3;
814ea1d6981Smrg    CARD32	pad4;
815ea1d6981Smrg    CARD32	pad5;
816ea1d6981Smrg    CARD32	pad6;
81717ca54c3Smrg} xLbxListenToOneEvent;
81817ca54c3Smrg#define sz_xLbxListenToOneEvent 32
81917ca54c3Smrg
82017ca54c3Smrgtypedef struct _LbxListenToAllEvent {
82117ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
82217ca54c3Smrg    BYTE	lbxType;	/* LbxListenToAllEvent */
823ea1d6981Smrg    CARD16	sequenceNumber;
824ea1d6981Smrg    CARD32	pad1;
825ea1d6981Smrg    CARD32	pad2;
826ea1d6981Smrg    CARD32	pad3;
827ea1d6981Smrg    CARD32	pad4;
828ea1d6981Smrg    CARD32	pad5;
829ea1d6981Smrg    CARD32	pad6;
830ea1d6981Smrg    CARD32	pad7;
83117ca54c3Smrg} xLbxListenToAllEvent;
83217ca54c3Smrg#define sz_xLbxListenToOneEvent 32
83317ca54c3Smrg
83417ca54c3Smrgtypedef struct _LbxReleaseCmapEvent {
83517ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
83617ca54c3Smrg    BYTE	lbxType;	/* LbxReleaseCmapEvent */
837ea1d6981Smrg    CARD16	sequenceNumber;
838ea1d6981Smrg    Colormap	colormap;
839ea1d6981Smrg    CARD32	pad1;
840ea1d6981Smrg    CARD32	pad2;
841ea1d6981Smrg    CARD32	pad3;
842ea1d6981Smrg    CARD32	pad4;
843ea1d6981Smrg    CARD32	pad5;
844ea1d6981Smrg    CARD32	pad6;
84517ca54c3Smrg} xLbxReleaseCmapEvent;
84617ca54c3Smrg#define sz_xLbxReleaseCmapEvent	32
84717ca54c3Smrg
84817ca54c3Smrg
84917ca54c3Smrgtypedef struct _LbxFreeCellsEvent {
85017ca54c3Smrg    BYTE	type;		/* always eventBase + LbxEvent */
85117ca54c3Smrg    BYTE	lbxType;	/* LbxFreeCellsEvent */
852ea1d6981Smrg    CARD16	sequenceNumber;
853ea1d6981Smrg    Colormap	colormap;
854ea1d6981Smrg    CARD32	pixelStart;
855ea1d6981Smrg    CARD32	pixelEnd;
856ea1d6981Smrg    CARD32	pad1;
857ea1d6981Smrg    CARD32	pad2;
858ea1d6981Smrg    CARD32	pad3;
859ea1d6981Smrg    CARD32	pad4;
86017ca54c3Smrg} xLbxFreeCellsEvent;
86117ca54c3Smrg#define sz_xLbxFreeCellsEvent	32
86217ca54c3Smrg
86317ca54c3Smrg
86417ca54c3Smrg/*
86517ca54c3Smrg * squished X event sizes.  If these change, be sure to update lbxquish.c
86617ca54c3Smrg * and unsquish.c appropriately
86717ca54c3Smrg *
86817ca54c3Smrg * lbxsz_* is the padded squished length
86917ca54c3Smrg * lbxupsz_* is the unpadded squished length
87017ca54c3Smrg */
87117ca54c3Smrg
87217ca54c3Smrg#define	  lbxsz_KeyButtonEvent		32
87317ca54c3Smrg#define	lbxupsz_KeyButtonEvent		31
87417ca54c3Smrg
87517ca54c3Smrg#define	  lbxsz_EnterLeaveEvent		32
87617ca54c3Smrg#define	lbxupsz_EnterLeaveEvent		32
87717ca54c3Smrg
87817ca54c3Smrg#define	  lbxsz_FocusEvent		12
87917ca54c3Smrg#define	lbxupsz_FocusEvent		9
88017ca54c3Smrg
88117ca54c3Smrg#define	  lbxsz_KeymapEvent		32
88217ca54c3Smrg#define	lbxupsz_KeymapEvent		32
88317ca54c3Smrg
88417ca54c3Smrg#define	  lbxsz_ExposeEvent		20
88517ca54c3Smrg#define	lbxupsz_ExposeEvent		18
88617ca54c3Smrg
88717ca54c3Smrg#define	  lbxsz_GfxExposeEvent		24
88817ca54c3Smrg#define	lbxupsz_GfxExposeEvent		21
88917ca54c3Smrg
89017ca54c3Smrg#define	  lbxsz_NoExposeEvent		12
89117ca54c3Smrg#define	lbxupsz_NoExposeEvent		11
89217ca54c3Smrg
89317ca54c3Smrg#define	  lbxsz_VisibilityEvent		12
89417ca54c3Smrg#define	lbxupsz_VisibilityEvent		9
89517ca54c3Smrg
89617ca54c3Smrg#define	  lbxsz_CreateNotifyEvent	24
89717ca54c3Smrg#define	lbxupsz_CreateNotifyEvent	23
89817ca54c3Smrg
89917ca54c3Smrg#define	  lbxsz_DestroyNotifyEvent	12
90017ca54c3Smrg#define	lbxupsz_DestroyNotifyEvent	12
90117ca54c3Smrg
90217ca54c3Smrg#define	  lbxsz_UnmapNotifyEvent	16
90317ca54c3Smrg#define	lbxupsz_UnmapNotifyEvent	13
90417ca54c3Smrg
90517ca54c3Smrg#define	  lbxsz_MapNotifyEvent		16
90617ca54c3Smrg#define	lbxupsz_MapNotifyEvent		13
90717ca54c3Smrg
90817ca54c3Smrg#define	  lbxsz_MapRequestEvent		12
90917ca54c3Smrg#define	lbxupsz_MapRequestEvent		12
91017ca54c3Smrg
91117ca54c3Smrg#define	  lbxsz_ReparentEvent		24
91217ca54c3Smrg#define	lbxupsz_ReparentEvent		21
91317ca54c3Smrg
91417ca54c3Smrg#define	  lbxsz_ConfigureNotifyEvent	28
91517ca54c3Smrg#define	lbxupsz_ConfigureNotifyEvent	27
91617ca54c3Smrg
91717ca54c3Smrg#define	  lbxsz_ConfigureRequestEvent	28
91817ca54c3Smrg#define	lbxupsz_ConfigureRequestEvent	28
91917ca54c3Smrg
92017ca54c3Smrg#define	  lbxsz_GravityEvent		16
92117ca54c3Smrg#define	lbxupsz_GravityEvent		16
92217ca54c3Smrg
92317ca54c3Smrg#define	  lbxsz_ResizeRequestEvent	12
92417ca54c3Smrg#define	lbxupsz_ResizeRequestEvent	12
92517ca54c3Smrg
92617ca54c3Smrg#define	  lbxsz_CirculateEvent		20
92717ca54c3Smrg#define	lbxupsz_CirculateEvent		17
92817ca54c3Smrg
92917ca54c3Smrg#define	  lbxsz_PropertyEvent		20
93017ca54c3Smrg#define	lbxupsz_PropertyEvent		17
93117ca54c3Smrg
93217ca54c3Smrg#define	  lbxsz_SelectionClearEvent	16
93317ca54c3Smrg#define	lbxupsz_SelectionClearEvent	16
93417ca54c3Smrg
93517ca54c3Smrg#define	  lbxsz_SelectionRequestEvent	28
93617ca54c3Smrg#define	lbxupsz_SelectionRequestEvent	28
93717ca54c3Smrg
93817ca54c3Smrg#define	  lbxsz_SelectionNotifyEvent	24
93917ca54c3Smrg#define	lbxupsz_SelectionNotifyEvent	24
94017ca54c3Smrg
94117ca54c3Smrg#define	  lbxsz_ColormapEvent		16
94217ca54c3Smrg#define	lbxupsz_ColormapEvent		14
94317ca54c3Smrg
94417ca54c3Smrg#define	  lbxsz_MappingNotifyEvent	8
94517ca54c3Smrg#define	lbxupsz_MappingNotifyEvent	7
94617ca54c3Smrg
94717ca54c3Smrg#define	  lbxsz_ClientMessageEvent	32
94817ca54c3Smrg#define	lbxupsz_ClientMessageEvent	32
94917ca54c3Smrg
95017ca54c3Smrg#define	lbxsz_UnknownEvent		32
95117ca54c3Smrg
95217ca54c3Smrg#ifdef DEBUG
95317ca54c3Smrg
95417ca54c3Smrg#define DBG_SWITCH	0x00000001
95517ca54c3Smrg#define DBG_CLOSE	0x00000002
95617ca54c3Smrg#define DBG_IO		0x00000004
95717ca54c3Smrg#define DBG_READ_REQ	0x00000008
95817ca54c3Smrg#define DBG_LEN		0x00000010
95917ca54c3Smrg#define DBG_BLOCK	0x00000020
96017ca54c3Smrg#define DBG_CLIENT	0x00000040
96117ca54c3Smrg#define DBG_DELTA	0x00000080
96217ca54c3Smrg#endif
96317ca54c3Smrg/*
96417ca54c3Smrg * Cancel the previous redefinition of the basic types, thus restoring their
96517ca54c3Smrg * X.h definitions.
96617ca54c3Smrg */
96717ca54c3Smrg
96817ca54c3Smrg#undef XID
96917ca54c3Smrg#undef Atom
97017ca54c3Smrg#undef Colormap
97117ca54c3Smrg#undef Drawable
97217ca54c3Smrg#undef VisualID
97317ca54c3Smrg#undef Window
97417ca54c3Smrg
97517ca54c3Smrg#endif	/* _LBXPROTO_H_ */
976