1 /* $XConsortium: lbxdeltastr.h /main/7 1996/12/15 21:24:04 rws $ */
2 /*
3  * Copyright 1993 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 LBX_DELTA_STRUCT_H
25 #define LBX_DELTA_STRUCT_H
26 
27 #define MIN_CACHEABLE_LEN		8
28 
29 #define DELTA_CACHEABLE(pcache, len)	\
30 	((len) > MIN_CACHEABLE_LEN && (len) <= (pcache)->maxDeltasize)
31 
32 /*
33  * An entry in the delta compactor cache
34  */
35 typedef struct _LBXDeltaElem {
36     int			length;
37     unsigned char	*buf;
38 } LBXDeltaElemRec, *LBXDeltaElemPtr;
39 
40 
41 /*
42  * Delta compactor cache
43  */
44 typedef struct _LBXDeltas {
45     unsigned short	nDeltas;
46     unsigned short	maxDeltasize;
47     LBXDeltaElemPtr	deltas;
48     unsigned short	nextDelta;
49     unsigned short	activeDeltas;	/* only needed for outgoing */
50 } LBXDeltasRec, *LBXDeltasPtr;
51 
52 
53 /*
54  * Motion delta cache
55  */
56 
57 typedef struct {
58     BYTE swapped;
59     BYTE detail;
60     CARD16 sequenceNumber B16;
61     Time time B32;
62     Window root B32, event B32, child B32;
63     INT16 rootX B16, rootY B16, eventX B16, eventY B16;
64     KeyButMask state B16;
65     BOOL sameScreen;
66 } lbxMotionCache;
67 
68 
69 /*
70  * Motion delta events
71  */
72 
73 typedef struct {
74     BYTE type;		/* always eventBase + LbxQuickMotionDeltaEvent */
75     CARD8 deltaTime;
76     INT8 deltaX;
77     INT8 deltaY;
78 } lbxQuickMotionDeltaEvent;
79 #define sz_lbxQuickMotionDeltaEvent 4
80 
81 typedef struct {
82     BYTE type;		/* always eventBase + LbxEvent */
83     BYTE lbxType;	/* LbxMotionDeltaEvent */
84     INT8 deltaX;
85     INT8 deltaY;
86     CARD16 deltaTime B16;
87     CARD16 deltaSequence B16;
88 } lbxMotionDeltaEvent;
89 #define sz_lbxMotionDeltaEvent 8
90 
91 #endif /* LBX_DELTA_STRUCT_H */
92