1 | /* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.18 2003/01/12 02:44:27 dawes Exp $ */
|
---|
2 | /***********************************************************
|
---|
3 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
4 |
|
---|
5 | All Rights Reserved
|
---|
6 |
|
---|
7 | Permission to use, copy, modify, and distribute this software and its
|
---|
8 | documentation for any purpose and without fee is hereby granted,
|
---|
9 | provided that the above copyright notice appear in all copies and that
|
---|
10 | both that copyright notice and this permission notice appear in
|
---|
11 | supporting documentation, and that the name of Digital not be
|
---|
12 | used in advertising or publicity pertaining to distribution of the
|
---|
13 | software without specific, written prior permission.
|
---|
14 |
|
---|
15 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
16 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
17 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
18 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
19 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
20 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
21 | SOFTWARE.
|
---|
22 |
|
---|
23 | ******************************************************************/
|
---|
24 | /* $Xorg: dixstruct.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */
|
---|
25 |
|
---|
26 | #ifndef DIXSTRUCT_H
|
---|
27 | #define DIXSTRUCT_H
|
---|
28 |
|
---|
29 | #include "dix.h"
|
---|
30 | #include "resource.h"
|
---|
31 | #include "cursor.h"
|
---|
32 | #include "gc.h"
|
---|
33 | #include "pixmap.h"
|
---|
34 | #include <X11/Xmd.h>
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * direct-mapped hash table, used by resource manager to store
|
---|
38 | * translation from client ids to server addresses.
|
---|
39 | */
|
---|
40 |
|
---|
41 | #ifdef DEBUG
|
---|
42 | #define MAX_REQUEST_LOG 100
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | extern CallbackListPtr ClientStateCallback;
|
---|
46 |
|
---|
47 | typedef struct {
|
---|
48 | ClientPtr client;
|
---|
49 | xConnSetupPrefix *prefix;
|
---|
50 | xConnSetup *setup;
|
---|
51 | } NewClientInfoRec;
|
---|
52 |
|
---|
53 | typedef void (*ReplySwapPtr) (
|
---|
54 | #if NeedNestedPrototypes
|
---|
55 | ClientPtr /* pClient */,
|
---|
56 | int /* size */,
|
---|
57 | void * /* pbuf */
|
---|
58 | #endif
|
---|
59 | );
|
---|
60 |
|
---|
61 | extern void ReplyNotSwappd (
|
---|
62 | #if NeedNestedPrototypes
|
---|
63 | ClientPtr /* pClient */,
|
---|
64 | int /* size */,
|
---|
65 | void * /* pbuf */
|
---|
66 | #endif
|
---|
67 | );
|
---|
68 |
|
---|
69 | typedef enum {ClientStateInitial,
|
---|
70 | ClientStateAuthenticating,
|
---|
71 | ClientStateRunning,
|
---|
72 | ClientStateRetained,
|
---|
73 | ClientStateGone,
|
---|
74 | ClientStateCheckingSecurity,
|
---|
75 | ClientStateCheckedSecurity} ClientState;
|
---|
76 |
|
---|
77 | typedef struct _Client {
|
---|
78 | int index;
|
---|
79 | Mask clientAsMask;
|
---|
80 | pointer requestBuffer;
|
---|
81 | pointer osPrivate; /* for OS layer, including scheduler */
|
---|
82 | Bool swapped;
|
---|
83 | ReplySwapPtr pSwapReplyFunc;
|
---|
84 | XID errorValue;
|
---|
85 | int sequence;
|
---|
86 | int closeDownMode;
|
---|
87 | int clientGone;
|
---|
88 | int noClientException; /* this client died or needs to be
|
---|
89 | * killed */
|
---|
90 | DrawablePtr lastDrawable;
|
---|
91 | Drawable lastDrawableID;
|
---|
92 | GCPtr lastGC;
|
---|
93 | GContext lastGCID;
|
---|
94 | pointer *saveSet;
|
---|
95 | int numSaved;
|
---|
96 | pointer screenPrivate[MAXSCREENS];
|
---|
97 | int (**requestVector) (
|
---|
98 | #if NeedNestedPrototypes
|
---|
99 | ClientPtr /* pClient */
|
---|
100 | #endif
|
---|
101 | );
|
---|
102 | CARD32 req_len; /* length of current request */
|
---|
103 | Bool big_requests; /* supports large requests */
|
---|
104 | int priority;
|
---|
105 | ClientState clientState;
|
---|
106 | DevUnion *devPrivates;
|
---|
107 | #ifdef XKB
|
---|
108 | unsigned short xkbClientFlags;
|
---|
109 | unsigned short mapNotifyMask;
|
---|
110 | unsigned short newKeyboardNotifyMask;
|
---|
111 | unsigned short vMajor,vMinor;
|
---|
112 | KeyCode minKC,maxKC;
|
---|
113 | #endif
|
---|
114 |
|
---|
115 | #ifdef DEBUG
|
---|
116 | unsigned char requestLog[MAX_REQUEST_LOG];
|
---|
117 | int requestLogIndex;
|
---|
118 | #endif
|
---|
119 | #ifdef LBX
|
---|
120 | int (*readRequest)(
|
---|
121 | #if NeedNestedPrototypes
|
---|
122 | ClientPtr /*client*/
|
---|
123 | #endif
|
---|
124 | );
|
---|
125 | #endif
|
---|
126 | unsigned long replyBytesRemaining;
|
---|
127 | #ifdef XCSECURITY
|
---|
128 | XID authId;
|
---|
129 | unsigned int trustLevel;
|
---|
130 | pointer (* CheckAccess)(
|
---|
131 | #if NeedNestedPrototypes
|
---|
132 | ClientPtr /*pClient*/,
|
---|
133 | XID /*id*/,
|
---|
134 | RESTYPE /*classes*/,
|
---|
135 | Mask /*access_mode*/,
|
---|
136 | pointer /*resourceval*/
|
---|
137 | #endif
|
---|
138 | );
|
---|
139 | #endif
|
---|
140 | #ifdef XAPPGROUP
|
---|
141 | struct _AppGroupRec* appgroup;
|
---|
142 | #endif
|
---|
143 | struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
|
---|
144 | #if NeedNestedPrototypes
|
---|
145 | ClientPtr /* pClient */,
|
---|
146 | int * /* num */
|
---|
147 | #endif
|
---|
148 | );
|
---|
149 | #ifdef SMART_SCHEDULE
|
---|
150 | int smart_priority;
|
---|
151 | long smart_start_tick;
|
---|
152 | long smart_stop_tick;
|
---|
153 | long smart_check_tick;
|
---|
154 | #endif
|
---|
155 | } ClientRec;
|
---|
156 |
|
---|
157 | #ifdef SMART_SCHEDULE
|
---|
158 | /*
|
---|
159 | * Scheduling interface
|
---|
160 | */
|
---|
161 | extern long SmartScheduleTime;
|
---|
162 | extern long SmartScheduleInterval;
|
---|
163 | extern long SmartScheduleSlice;
|
---|
164 | extern long SmartScheduleMaxSlice;
|
---|
165 | extern unsigned long SmartScheduleIdleCount;
|
---|
166 | extern Bool SmartScheduleDisable;
|
---|
167 | extern Bool SmartScheduleIdle;
|
---|
168 | extern Bool SmartScheduleTimerStopped;
|
---|
169 | extern Bool SmartScheduleStartTimer(void);
|
---|
170 | #define SMART_MAX_PRIORITY 20
|
---|
171 | #define SMART_MIN_PRIORITY -20
|
---|
172 |
|
---|
173 | extern Bool SmartScheduleInit(
|
---|
174 | #ifdef NeedFunctionPrototypes
|
---|
175 | void
|
---|
176 | #endif
|
---|
177 | );
|
---|
178 |
|
---|
179 | #endif
|
---|
180 |
|
---|
181 | /* This prototype is used pervasively in Xext, dix */
|
---|
182 | #if NeedFunctionPrototypes
|
---|
183 | #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
|
---|
184 | #else
|
---|
185 | #define DISPATCH_PROC(func) int func(/* ClientPtr client */)
|
---|
186 | #endif
|
---|
187 |
|
---|
188 | typedef struct _WorkQueue {
|
---|
189 | struct _WorkQueue *next;
|
---|
190 | Bool (*function) (
|
---|
191 | #if NeedNestedPrototypes
|
---|
192 | ClientPtr /* pClient */,
|
---|
193 | pointer /* closure */
|
---|
194 | #endif
|
---|
195 | );
|
---|
196 | ClientPtr client;
|
---|
197 | pointer closure;
|
---|
198 | } WorkQueueRec;
|
---|
199 |
|
---|
200 | extern TimeStamp currentTime;
|
---|
201 | extern TimeStamp lastDeviceEventTime;
|
---|
202 |
|
---|
203 | extern int CompareTimeStamps(
|
---|
204 | #if NeedFunctionPrototypes
|
---|
205 | TimeStamp /*a*/,
|
---|
206 | TimeStamp /*b*/
|
---|
207 | #endif
|
---|
208 | );
|
---|
209 |
|
---|
210 | extern TimeStamp ClientTimeToServerTime(
|
---|
211 | #if NeedFunctionPrototypes
|
---|
212 | CARD32 /*c*/
|
---|
213 | #endif
|
---|
214 | );
|
---|
215 |
|
---|
216 | typedef struct _CallbackRec {
|
---|
217 | CallbackProcPtr proc;
|
---|
218 | pointer data;
|
---|
219 | Bool deleted;
|
---|
220 | struct _CallbackRec *next;
|
---|
221 | } CallbackRec, *CallbackPtr;
|
---|
222 |
|
---|
223 | typedef struct _CallbackList {
|
---|
224 | CallbackFuncsRec funcs;
|
---|
225 | int inCallback;
|
---|
226 | Bool deleted;
|
---|
227 | int numDeleted;
|
---|
228 | CallbackPtr list;
|
---|
229 | } CallbackListRec;
|
---|
230 |
|
---|
231 | /* proc vectors */
|
---|
232 |
|
---|
233 | extern int (* InitialVector[3]) (
|
---|
234 | #if NeedNestedPrototypes
|
---|
235 | ClientPtr /*client*/
|
---|
236 | #endif
|
---|
237 | );
|
---|
238 |
|
---|
239 | extern int (* ProcVector[256]) (
|
---|
240 | #if NeedNestedPrototypes
|
---|
241 | ClientPtr /*client*/
|
---|
242 | #endif
|
---|
243 | );
|
---|
244 |
|
---|
245 | extern int (* SwappedProcVector[256]) (
|
---|
246 | #if NeedNestedPrototypes
|
---|
247 | ClientPtr /*client*/
|
---|
248 | #endif
|
---|
249 | );
|
---|
250 |
|
---|
251 | #ifdef K5AUTH
|
---|
252 | extern int (*k5_Vector[256])() =
|
---|
253 | #if NeedNestedPrototypes
|
---|
254 | ClientPtr /*client*/
|
---|
255 | #endif
|
---|
256 | );
|
---|
257 | #endif
|
---|
258 |
|
---|
259 | extern ReplySwapPtr ReplySwapVector[256];
|
---|
260 |
|
---|
261 | extern int ProcBadRequest(
|
---|
262 | #if NeedFunctionPrototypes
|
---|
263 | ClientPtr /*client*/
|
---|
264 | #endif
|
---|
265 | );
|
---|
266 |
|
---|
267 | #endif /* DIXSTRUCT_H */
|
---|