1 | /* $Xorg: lbxserve.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
|
---|
2 | /*
|
---|
3 |
|
---|
4 | Copyright 1996, 1998 The Open Group
|
---|
5 |
|
---|
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
|
---|
10 | documentation.
|
---|
11 |
|
---|
12 | The above copyright notice and this permission notice shall be included in
|
---|
13 | all copies or substantial portions of the Software.
|
---|
14 |
|
---|
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.
|
---|
21 |
|
---|
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.
|
---|
25 |
|
---|
26 | */
|
---|
27 | /*
|
---|
28 | * Copyright 1992 Network Computing Devices
|
---|
29 | *
|
---|
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.
|
---|
39 | *
|
---|
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.
|
---|
46 | *
|
---|
47 | */
|
---|
48 | /* $XFree86: xc/programs/Xserver/lbx/lbxserve.h,v 1.4 2001/08/01 00:44:58 tsi Exp $ */
|
---|
49 |
|
---|
50 | #ifdef HAVE_DIX_CONFIG_H
|
---|
51 | #include <dix-config.h>
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | #ifndef _LBXSERVE_H_
|
---|
55 |
|
---|
56 | #include "colormap.h"
|
---|
57 | #include "property.h"
|
---|
58 |
|
---|
59 | #define _LBXSERVE_H_
|
---|
60 | #define _XLBX_SERVER_
|
---|
61 | #include <X11/extensions/lbxstr.h>
|
---|
62 | #include <X11/extensions/lbxdeltastr.h>
|
---|
63 | #include <X11/extensions/lbxopts.h>
|
---|
64 |
|
---|
65 | #define MAX_LBX_CLIENTS MAXCLIENTS
|
---|
66 | #define MAX_NUM_PROXIES (MAXCLIENTS >> 1)
|
---|
67 |
|
---|
68 | typedef struct _LbxClient *LbxClientPtr;
|
---|
69 | typedef struct _LbxProxy *LbxProxyPtr;
|
---|
70 |
|
---|
71 | typedef struct _LbxClient {
|
---|
72 | CARD32 id;
|
---|
73 | ClientPtr client;
|
---|
74 | LbxProxyPtr proxy;
|
---|
75 | Bool ignored;
|
---|
76 | Bool input_blocked;
|
---|
77 | int reqs_pending;
|
---|
78 | long bytes_in_reply;
|
---|
79 | long bytes_remaining;
|
---|
80 | Drawable drawableCache[GFX_CACHE_SIZE];
|
---|
81 | GContext gcontextCache[GFX_CACHE_SIZE];
|
---|
82 | pointer gfx_buffer; /* tmp buffer for unpacking gfx requests */
|
---|
83 | unsigned long gb_size;
|
---|
84 | } LbxClientRec;
|
---|
85 |
|
---|
86 | typedef struct _connectionOutput *OSBufPtr;
|
---|
87 |
|
---|
88 | typedef struct _LbxProxy {
|
---|
89 | LbxProxyPtr next;
|
---|
90 | /* this array is indexed by lbx proxy index */
|
---|
91 | LbxClientPtr lbxClients[MAX_LBX_CLIENTS];
|
---|
92 | LbxClientPtr curRecv,
|
---|
93 | curDix;
|
---|
94 | int fd;
|
---|
95 | int pid; /* proxy ID */
|
---|
96 | int uid;
|
---|
97 | int numClients;
|
---|
98 | int maxIndex;
|
---|
99 | Bool aborted;
|
---|
100 | int grabClient;
|
---|
101 | pointer compHandle;
|
---|
102 | Bool dosquishing;
|
---|
103 | Bool useTags;
|
---|
104 | LBXDeltasRec indeltas;
|
---|
105 | LBXDeltasRec outdeltas;
|
---|
106 | char *iDeltaBuf;
|
---|
107 | char *replyBuf;
|
---|
108 | char *oDeltaBuf;
|
---|
109 | OSBufPtr ofirst;
|
---|
110 | OSBufPtr olast;
|
---|
111 | CARD32 cur_send_id;
|
---|
112 |
|
---|
113 | LbxStreamOpts streamOpts;
|
---|
114 |
|
---|
115 | int numBitmapCompMethods;
|
---|
116 | unsigned char *bitmapCompMethods; /* array of indices */
|
---|
117 | int numPixmapCompMethods;
|
---|
118 | unsigned char *pixmapCompMethods; /* array of indices */
|
---|
119 | int **pixmapCompDepths; /* depths supported from each method */
|
---|
120 |
|
---|
121 | struct _ColormapRec *grabbedCmaps; /* chained via lbx private */
|
---|
122 | int motion_allowed_events;
|
---|
123 | lbxMotionCache motionCache;
|
---|
124 | } LbxProxyRec;
|
---|
125 |
|
---|
126 | /* This array is indexed by server client index, not lbx proxy index */
|
---|
127 |
|
---|
128 | extern LbxClientPtr lbxClients[MAXCLIENTS];
|
---|
129 |
|
---|
130 | #define LbxClient(client) (lbxClients[(client)->index])
|
---|
131 | #define LbxProxy(client) (LbxClient(client)->proxy)
|
---|
132 | #define LbxMaybeProxy(client) (LbxClient(client) ? LbxProxy(client) : 0)
|
---|
133 | #define LbxProxyID(client) (LbxProxy(client)->pid)
|
---|
134 | #define LbxProxyClient(proxy) ((proxy)->lbxClients[0]->client)
|
---|
135 |
|
---|
136 | extern int LbxEventCode;
|
---|
137 |
|
---|
138 |
|
---|
139 | /* os/connection.c */
|
---|
140 | extern ClientPtr AllocLbxClientConnection ( ClientPtr client,
|
---|
141 | LbxProxyPtr proxy );
|
---|
142 | extern void LbxProxyConnection ( ClientPtr client, LbxProxyPtr proxy );
|
---|
143 |
|
---|
144 | /* os/libxio.c */
|
---|
145 | extern int UncompressedWriteToClient ( ClientPtr who, int count, char *buf );
|
---|
146 | extern void LbxForceOutput ( LbxProxyPtr proxy );
|
---|
147 | extern void SwitchClientInput ( ClientPtr client, Bool pending );
|
---|
148 | extern int PrepareLargeReqBuffer ( ClientPtr client );
|
---|
149 | extern Bool AppendFakeRequest ( ClientPtr client, char *data, int count );
|
---|
150 | extern void LbxFreeOsBuffers ( LbxProxyPtr proxy );
|
---|
151 | extern Bool AllocateLargeReqBuffer ( ClientPtr client, int size );
|
---|
152 | extern Bool AddToLargeReqBuffer ( ClientPtr client, char *data, int size );
|
---|
153 | extern void LbxPrimeInput ( ClientPtr client, LbxProxyPtr proxy );
|
---|
154 |
|
---|
155 | /* lbxcmap.c */
|
---|
156 | extern int LbxCmapInit ( void );
|
---|
157 | extern Bool LbxCheckColorRequest ( ClientPtr client, ColormapPtr pmap,
|
---|
158 | xReq *req );
|
---|
159 | extern int LbxCheckCmapGrabbed ( ColormapPtr pmap );
|
---|
160 | extern void LbxDisableSmartGrab ( ColormapPtr pmap );
|
---|
161 | extern void LbxBeginFreeCellsEvent ( ColormapPtr pmap );
|
---|
162 | extern void LbxAddFreeCellToEvent ( ColormapPtr pmap, Pixel pixel );
|
---|
163 | extern void LbxEndFreeCellsEvent ( ColormapPtr pmap );
|
---|
164 | extern void LbxSortPixelList ( Pixel *pixels, int count );
|
---|
165 | extern int ProcLbxGrabCmap ( ClientPtr client );
|
---|
166 | extern void LbxReleaseCmap ( ColormapPtr pmap, Bool smart );
|
---|
167 | extern int ProcLbxReleaseCmap ( ClientPtr client );
|
---|
168 | extern int ProcLbxAllocColor ( ClientPtr client );
|
---|
169 | extern int ProcLbxIncrementPixel ( ClientPtr client );
|
---|
170 |
|
---|
171 | /* lbxdix.h */
|
---|
172 | extern void LbxDixInit ( void );
|
---|
173 | extern void LbxResetTags ( void );
|
---|
174 | extern int LbxSendConnSetup ( ClientPtr client, char *reason );
|
---|
175 | extern int LbxGetModifierMapping ( ClientPtr client );
|
---|
176 | extern int LbxGetKeyboardMapping ( ClientPtr client );
|
---|
177 | extern int LbxQueryFont ( ClientPtr client );
|
---|
178 | extern int LbxTagData ( ClientPtr client, XID tag, unsigned long len,
|
---|
179 | pointer data );
|
---|
180 | extern int LbxInvalidateTag ( ClientPtr client, XID tag );
|
---|
181 | extern void LbxAllowMotion ( ClientPtr client, int num );
|
---|
182 | extern void LbxFlushModifierMapTag ( void );
|
---|
183 | extern void LbxFlushKeyboardMapTag ( void );
|
---|
184 | extern void LbxFreeFontTag ( FontPtr pfont );
|
---|
185 | extern void LbxSendInvalidateTag ( ClientPtr client, XID tag, int tagtype );
|
---|
186 | extern Bool LbxFlushQTag ( XID tag );
|
---|
187 | extern void ProcessQTagZombies ( void );
|
---|
188 | extern void LbxQueryTagData ( ClientPtr client, int owner_pid, XID tag,
|
---|
189 | int tagtype );
|
---|
190 |
|
---|
191 | /* lbxexts.c */
|
---|
192 | extern Bool LbxAddExtension ( char *name, int opcode, int ev_base,
|
---|
193 | int err_base );
|
---|
194 | extern Bool LbxAddExtensionAlias ( int idx, char *alias );
|
---|
195 | extern void LbxDeclareExtensionSecurity ( char *extname, Bool secure );
|
---|
196 | extern Bool LbxRegisterExtensionGenerationMasks ( int idx, int num_reqs,
|
---|
197 | char *rep_mask,
|
---|
198 | char *ev_mask );
|
---|
199 | extern int LbxQueryExtension ( ClientPtr client, char *ename, int nlen );
|
---|
200 | extern void LbxCloseDownExtensions ( void );
|
---|
201 | extern void LbxSetReqMask ( CARD8 *mask, int req, Bool on );
|
---|
202 |
|
---|
203 | /* lbxgfx.c */
|
---|
204 | extern int LbxDecodePoly( ClientPtr client, CARD8 xreqtype,
|
---|
205 | int (*decode_rtn)(char *, char *, short *) );
|
---|
206 | extern int LbxDecodeFillPoly ( ClientPtr client );
|
---|
207 | extern int LbxDecodeCopyArea ( ClientPtr client );
|
---|
208 | extern int LbxDecodeCopyPlane ( ClientPtr client );
|
---|
209 | extern int LbxDecodePolyText ( ClientPtr client );
|
---|
210 | extern int LbxDecodeImageText ( ClientPtr client );
|
---|
211 | extern int LbxDecodePutImage ( ClientPtr client );
|
---|
212 | extern int LbxDecodeGetImage ( ClientPtr client );
|
---|
213 | extern int LbxDecodePoints ( char *in, char *inend, short *out );
|
---|
214 | extern int LbxDecodeSegment ( char *in, char *inend, short *out );
|
---|
215 | extern int LbxDecodeRectangle ( char *in, char *inend, short *out );
|
---|
216 | extern int LbxDecodeArc ( char *in, char *inend, short *out );
|
---|
217 |
|
---|
218 | /* lbxmain.c */
|
---|
219 | extern LbxProxyPtr LbxPidToProxy ( int pid );
|
---|
220 | extern void LbxReencodeOutput ( ClientPtr client, char *pbuf, int *pcount,
|
---|
221 | char *cbuf, int *ccount );
|
---|
222 | extern void LbxExtensionInit ( void );
|
---|
223 | extern void LbxCloseClient ( ClientPtr client );
|
---|
224 | extern void LbxSetForBlock ( LbxClientPtr lbxClient );
|
---|
225 | extern int ProcLbxDispatch ( ClientPtr client );
|
---|
226 | extern int ProcLbxSwitch ( ClientPtr client );
|
---|
227 | extern int ProcLbxQueryVersion ( ClientPtr client );
|
---|
228 | extern int ProcLbxStartProxy ( ClientPtr client );
|
---|
229 | extern int ProcLbxStopProxy ( ClientPtr client );
|
---|
230 | extern int ProcLbxBeginLargeRequest ( ClientPtr client );
|
---|
231 | extern int ProcLbxLargeRequestData ( ClientPtr client );
|
---|
232 | extern int ProcLbxEndLargeRequest ( ClientPtr client );
|
---|
233 | extern int ProcLbxInternAtoms ( ClientPtr client );
|
---|
234 | extern int ProcLbxGetWinAttrAndGeom ( ClientPtr client );
|
---|
235 | extern int ProcLbxNewClient ( ClientPtr client );
|
---|
236 | extern int ProcLbxEstablishConnection ( ClientPtr client );
|
---|
237 | extern int ProcLbxCloseClient ( ClientPtr client );
|
---|
238 | extern int ProcLbxModifySequence ( ClientPtr client );
|
---|
239 | extern int ProcLbxAllowMotion ( ClientPtr client );
|
---|
240 | extern int ProcLbxGetModifierMapping ( ClientPtr client );
|
---|
241 | extern int ProcLbxGetKeyboardMapping ( ClientPtr client );
|
---|
242 | extern int ProcLbxQueryFont ( ClientPtr client );
|
---|
243 | extern int ProcLbxChangeProperty ( ClientPtr client );
|
---|
244 | extern int ProcLbxGetProperty ( ClientPtr client );
|
---|
245 | extern int ProcLbxTagData ( ClientPtr client );
|
---|
246 | extern int ProcLbxInvalidateTag ( ClientPtr client );
|
---|
247 | extern int ProcLbxPolyPoint ( ClientPtr client );
|
---|
248 | extern int ProcLbxPolyLine ( ClientPtr client );
|
---|
249 | extern int ProcLbxPolySegment ( ClientPtr client );
|
---|
250 | extern int ProcLbxPolyRectangle ( ClientPtr client );
|
---|
251 | extern int ProcLbxPolyArc ( ClientPtr client );
|
---|
252 | extern int ProcLbxFillPoly ( ClientPtr client );
|
---|
253 | extern int ProcLbxPolyFillRectangle ( ClientPtr client );
|
---|
254 | extern int ProcLbxPolyFillArc ( ClientPtr client );
|
---|
255 | extern int ProcLbxCopyArea ( ClientPtr client );
|
---|
256 | extern int ProcLbxCopyPlane ( ClientPtr client );
|
---|
257 | extern int ProcLbxPolyText ( ClientPtr client );
|
---|
258 | extern int ProcLbxImageText ( ClientPtr client );
|
---|
259 | extern int ProcLbxQueryExtension ( ClientPtr client );
|
---|
260 | extern int ProcLbxPutImage ( ClientPtr client );
|
---|
261 | extern int ProcLbxGetImage ( ClientPtr client );
|
---|
262 | extern int ProcLbxSync ( ClientPtr client );
|
---|
263 |
|
---|
264 | /* lbxprop.c */
|
---|
265 | extern int LbxChangeProperty ( ClientPtr client );
|
---|
266 | extern int LbxGetProperty ( ClientPtr client );
|
---|
267 | extern void LbxStallPropRequest ( ClientPtr client, PropertyPtr pProp );
|
---|
268 | extern int LbxChangeWindowProperty ( ClientPtr client, WindowPtr pWin,
|
---|
269 | Atom property, Atom type, int format,
|
---|
270 | int mode, unsigned long len,
|
---|
271 | Bool have_data, pointer value,
|
---|
272 | Bool sendevent, XID *tag );
|
---|
273 | /* lbxsquish.c */
|
---|
274 | extern int LbxSquishEvent ( char *buf );
|
---|
275 |
|
---|
276 | /* lbwswap.c */
|
---|
277 | extern int SProcLbxDispatch( ClientPtr client );
|
---|
278 | extern int SProcLbxSwitch ( ClientPtr client );
|
---|
279 | extern int SProcLbxBeginLargeRequest ( ClientPtr client );
|
---|
280 | extern int SProcLbxLargeRequestData ( ClientPtr client );
|
---|
281 | extern int SProcLbxEndLargeRequest ( ClientPtr client );
|
---|
282 | extern void LbxWriteSConnSetupPrefix ( ClientPtr pClient,
|
---|
283 | xLbxConnSetupPrefix *pcsp );
|
---|
284 | extern void LbxSwapFontInfo ( xLbxFontInfo *pr, Bool compressed );
|
---|
285 |
|
---|
286 | /* lbxzerorep.c */
|
---|
287 | extern void ZeroReplyPadBytes ( char *buf, int reqType );
|
---|
288 |
|
---|
289 | #endif /* _LBXSERVE_H_ */
|
---|