1
/* $Xorg: lbxserve.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
4
Copyright 1996, 1998 The Open Group
6
Permission to use, copy, modify, distribute, and sell this software and its
7
documentation for any purpose is hereby granted without fee, provided that
8
the above copyright notice appear in all copies and that both that
9
copyright notice and this permission notice appear in supporting
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
Except as contained in this notice, the name of The Open Group shall not be
23
used in advertising or otherwise to promote the sale, use or other dealings
24
in this Software without prior written authorization from The Open Group.
28
* Copyright 1992 Network Computing Devices
30
* Permission to use, copy, modify, distribute, and sell this software and its
31
* documentation for any purpose is hereby granted without fee, provided that
32
* the above copyright notice appear in all copies and that both that
33
* copyright notice and this permission notice appear in supporting
34
* documentation, and that the name of NCD. not be used in advertising or
35
* publicity pertaining to distribution of the software without specific,
36
* written prior permission. NCD. makes no representations about the
37
* suitability of this software for any purpose. It is provided "as is"
38
* without express or implied warranty.
40
* NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
41
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
42
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
43
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
44
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
45
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
48
/* $XFree86: xc/programs/Xserver/lbx/lbxserve.h,v 1.5 2001/12/14 20:00:00 dawes Exp $ */
58
#include "lbxdeltastr.h"
61
#define MAX_LBX_CLIENTS MAXCLIENTS
62
#define MAX_NUM_PROXIES (MAXCLIENTS >> 1)
64
typedef struct _LbxClient *LbxClientPtr;
65
typedef struct _LbxProxy *LbxProxyPtr;
67
typedef struct _LbxClient {
76
Drawable drawableCache[GFX_CACHE_SIZE];
77
GContext gcontextCache[GFX_CACHE_SIZE];
78
pointer gfx_buffer; /* tmp buffer for unpacking gfx requests */
79
unsigned long gb_size;
82
typedef struct _connectionOutput *OSBufPtr;
84
typedef struct _LbxProxy {
86
/* this array is indexed by lbx proxy index */
87
LbxClientPtr lbxClients[MAX_LBX_CLIENTS];
91
int pid; /* proxy ID */
100
LBXDeltasRec indeltas;
101
LBXDeltasRec outdeltas;
109
LbxStreamOpts streamOpts;
111
int numBitmapCompMethods;
112
unsigned char *bitmapCompMethods; /* array of indices */
113
int numPixmapCompMethods;
114
unsigned char *pixmapCompMethods; /* array of indices */
115
int **pixmapCompDepths; /* depths supported from each method */
117
struct _ColormapRec *grabbedCmaps; /* chained via lbx private */
118
int motion_allowed_events;
119
lbxMotionCache motionCache;
122
/* This array is indexed by server client index, not lbx proxy index */
124
extern LbxClientPtr lbxClients[MAXCLIENTS];
126
#define LbxClient(client) (lbxClients[(client)->index])
127
#define LbxProxy(client) (LbxClient(client)->proxy)
128
#define LbxMaybeProxy(client) (LbxClient(client) ? LbxProxy(client) : 0)
129
#define LbxProxyID(client) (LbxProxy(client)->pid)
130
#define LbxProxyClient(proxy) ((proxy)->lbxClients[0]->client)
132
extern int LbxEventCode;
135
/* os/connection.c */
136
extern ClientPtr AllocLbxClientConnection ( ClientPtr client,
138
extern void LbxProxyConnection ( ClientPtr client, LbxProxyPtr proxy );
141
extern int UncompressedWriteToClient ( ClientPtr who, int count, char *buf );
142
extern void LbxForceOutput ( LbxProxyPtr proxy );
143
extern void SwitchClientInput ( ClientPtr client, Bool pending );
144
extern int PrepareLargeReqBuffer ( ClientPtr client );
145
extern Bool AppendFakeRequest ( ClientPtr client, char *data, int count );
146
extern void LbxFreeOsBuffers ( LbxProxyPtr proxy );
147
extern Bool AllocateLargeReqBuffer ( ClientPtr client, int size );
148
extern Bool AddToLargeReqBuffer ( ClientPtr client, char *data, int size );
149
extern void LbxPrimeInput ( ClientPtr client, LbxProxyPtr proxy );
152
extern int LbxCmapInit ( void );
153
extern Bool LbxCheckColorRequest ( ClientPtr client, ColormapPtr pmap,
155
extern int LbxCheckCmapGrabbed ( ColormapPtr pmap );
156
extern void LbxDisableSmartGrab ( ColormapPtr pmap );
157
extern void LbxBeginFreeCellsEvent ( ColormapPtr pmap );
158
extern void LbxAddFreeCellToEvent ( ColormapPtr pmap, Pixel pixel );
159
extern void LbxEndFreeCellsEvent ( ColormapPtr pmap );
160
extern void LbxSortPixelList ( Pixel *pixels, int count );
161
extern int ProcLbxGrabCmap ( ClientPtr client );
162
extern void LbxReleaseCmap ( ColormapPtr pmap, Bool smart );
163
extern int ProcLbxReleaseCmap ( ClientPtr client );
164
extern int ProcLbxAllocColor ( ClientPtr client );
165
extern int ProcLbxIncrementPixel ( ClientPtr client );
168
extern void LbxDixInit ( void );
169
extern void LbxResetTags ( void );
170
extern int LbxSendConnSetup ( ClientPtr client, char *reason );
171
extern int LbxGetModifierMapping ( ClientPtr client );
172
extern int LbxGetKeyboardMapping ( ClientPtr client );
173
extern int LbxQueryFont ( ClientPtr client );
174
extern int LbxTagData ( ClientPtr client, XID tag, unsigned long len,
176
extern int LbxInvalidateTag ( ClientPtr client, XID tag );
177
extern void LbxAllowMotion ( ClientPtr client, int num );
178
extern void LbxFlushModifierMapTag ( void );
179
extern void LbxFlushKeyboardMapTag ( void );
180
extern void LbxFreeFontTag ( FontPtr pfont );
181
extern void LbxSendInvalidateTag ( ClientPtr client, XID tag, int tagtype );
182
extern Bool LbxFlushQTag ( XID tag );
183
extern void ProcessQTagZombies ( void );
184
extern void LbxQueryTagData ( ClientPtr client, int owner_pid, XID tag,
188
extern Bool LbxAddExtension ( char *name, int opcode, int ev_base,
190
extern Bool LbxAddExtensionAlias ( int idx, char *alias );
191
extern void LbxDeclareExtensionSecurity ( char *extname, Bool secure );
192
extern Bool LbxRegisterExtensionGenerationMasks ( int idx, int num_reqs,
195
extern int LbxQueryExtension ( ClientPtr client, char *ename, int nlen );
196
extern void LbxCloseDownExtensions ( void );
197
extern void LbxSetReqMask ( CARD8 *mask, int req, Bool on );
200
extern int LbxDecodePoly( ClientPtr client, CARD8 xreqtype,
201
int (*decode_rtn)(char *, char *, short *) );
202
extern int LbxDecodeFillPoly ( ClientPtr client );
203
extern int LbxDecodeCopyArea ( ClientPtr client );
204
extern int LbxDecodeCopyPlane ( ClientPtr client );
205
extern int LbxDecodePolyText ( ClientPtr client );
206
extern int LbxDecodeImageText ( ClientPtr client );
207
extern int LbxDecodePutImage ( ClientPtr client );
208
extern int LbxDecodeGetImage ( ClientPtr client );
209
extern int LbxDecodePoints ( char *in, char *inend, short *out );
210
extern int LbxDecodeSegment ( char *in, char *inend, short *out );
211
extern int LbxDecodeRectangle ( char *in, char *inend, short *out );
212
extern int LbxDecodeArc ( char *in, char *inend, short *out );
215
extern LbxProxyPtr LbxPidToProxy ( int pid );
216
extern void LbxReencodeOutput ( ClientPtr client, char *pbuf, int *pcount,
217
char *cbuf, int *ccount );
218
extern void LbxExtensionInit ( void );
219
extern void LbxCloseClient ( ClientPtr client );
220
extern void LbxSetForBlock ( LbxClientPtr lbxClient );
221
extern int ProcLbxDispatch ( ClientPtr client );
222
extern int ProcLbxSwitch ( ClientPtr client );
223
extern int ProcLbxQueryVersion ( ClientPtr client );
224
extern int ProcLbxStartProxy ( ClientPtr client );
225
extern int ProcLbxStopProxy ( ClientPtr client );
226
extern int ProcLbxBeginLargeRequest ( ClientPtr client );
227
extern int ProcLbxLargeRequestData ( ClientPtr client );
228
extern int ProcLbxEndLargeRequest ( ClientPtr client );
229
extern int ProcLbxInternAtoms ( ClientPtr client );
230
extern int ProcLbxGetWinAttrAndGeom ( ClientPtr client );
231
extern int ProcLbxNewClient ( ClientPtr client );
232
extern int ProcLbxEstablishConnection ( ClientPtr client );
233
extern int ProcLbxCloseClient ( ClientPtr client );
234
extern int ProcLbxModifySequence ( ClientPtr client );
235
extern int ProcLbxAllowMotion ( ClientPtr client );
236
extern int ProcLbxGetModifierMapping ( ClientPtr client );
237
extern int ProcLbxGetKeyboardMapping ( ClientPtr client );
238
extern int ProcLbxQueryFont ( ClientPtr client );
239
extern int ProcLbxChangeProperty ( ClientPtr client );
240
extern int ProcLbxGetProperty ( ClientPtr client );
241
extern int ProcLbxTagData ( ClientPtr client );
242
extern int ProcLbxInvalidateTag ( ClientPtr client );
243
extern int ProcLbxPolyPoint ( ClientPtr client );
244
extern int ProcLbxPolyLine ( ClientPtr client );
245
extern int ProcLbxPolySegment ( ClientPtr client );
246
extern int ProcLbxPolyRectangle ( ClientPtr client );
247
extern int ProcLbxPolyArc ( ClientPtr client );
248
extern int ProcLbxFillPoly ( ClientPtr client );
249
extern int ProcLbxPolyFillRectangle ( ClientPtr client );
250
extern int ProcLbxPolyFillArc ( ClientPtr client );
251
extern int ProcLbxCopyArea ( ClientPtr client );
252
extern int ProcLbxCopyPlane ( ClientPtr client );
253
extern int ProcLbxPolyText ( ClientPtr client );
254
extern int ProcLbxImageText ( ClientPtr client );
255
extern int ProcLbxQueryExtension ( ClientPtr client );
256
extern int ProcLbxPutImage ( ClientPtr client );
257
extern int ProcLbxGetImage ( ClientPtr client );
258
extern int ProcLbxSync ( ClientPtr client );
261
extern int LbxChangeProperty ( ClientPtr client );
262
extern int LbxGetProperty ( ClientPtr client );
263
extern void LbxStallPropRequest ( ClientPtr client, PropertyPtr pProp );
264
extern int LbxChangeWindowProperty ( ClientPtr client, WindowPtr pWin,
265
Atom property, Atom type, int format,
266
int mode, unsigned long len,
267
Bool have_data, pointer value,
268
Bool sendevent, XID *tag );
270
extern int LbxSquishEvent ( char *buf );
273
extern int SProcLbxDispatch( ClientPtr client );
274
extern int SProcLbxSwitch ( ClientPtr client );
275
extern int SProcLbxBeginLargeRequest ( ClientPtr client );
276
extern int SProcLbxLargeRequestData ( ClientPtr client );
277
extern int SProcLbxEndLargeRequest ( ClientPtr client );
278
extern void LbxWriteSConnSetupPrefix ( ClientPtr pClient,
279
xLbxConnSetupPrefix *pcsp );
280
extern void LbxSwapFontInfo ( xLbxFontInfo *pr, Bool compressed );
283
extern void ZeroReplyPadBytes ( char *buf, int reqType );
285
#endif /* _LBXSERVE_H_ */