1 | /* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.19tsi 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 | ClientPtr /* pClient */,
|
---|
55 | int /* size */,
|
---|
56 | void * /* pbuf */);
|
---|
57 |
|
---|
58 | extern void ReplyNotSwappd (
|
---|
59 | ClientPtr /* pClient */,
|
---|
60 | int /* size */,
|
---|
61 | void * /* pbuf */);
|
---|
62 |
|
---|
63 | typedef enum {ClientStateInitial,
|
---|
64 | ClientStateAuthenticating,
|
---|
65 | ClientStateRunning,
|
---|
66 | ClientStateRetained,
|
---|
67 | ClientStateGone,
|
---|
68 | ClientStateCheckingSecurity,
|
---|
69 | ClientStateCheckedSecurity} ClientState;
|
---|
70 |
|
---|
71 | #ifdef XFIXES
|
---|
72 | typedef struct _saveSet {
|
---|
73 | struct _Window *windowPtr;
|
---|
74 | Bool toRoot;
|
---|
75 | Bool remap;
|
---|
76 | } SaveSetElt;
|
---|
77 | #define SaveSetWindow(ss) ((ss).windowPtr)
|
---|
78 | #define SaveSetToRoot(ss) ((ss).toRoot)
|
---|
79 | #define SaveSetRemap(ss) ((ss).remap)
|
---|
80 | #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
|
---|
81 | #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
|
---|
82 | #define SaveSetAssignRemap(ss,rm) ((ss).remap = (rm))
|
---|
83 | #else
|
---|
84 | typedef struct _Window *SaveSetElt;
|
---|
85 | #define SaveSetWindow(ss) (ss)
|
---|
86 | #define SaveSetToRoot(ss) FALSE
|
---|
87 | #define SaveSetRemap(ss) TRUE
|
---|
88 | #define SaveSetAssignWindow(ss,w) ((ss) = (w))
|
---|
89 | #define SaveSetAssignToRoot(ss,tr)
|
---|
90 | #define SaveSetAssignRemap(ss,rm)
|
---|
91 | #endif
|
---|
92 |
|
---|
93 | typedef struct _Client {
|
---|
94 | int index;
|
---|
95 | Mask clientAsMask;
|
---|
96 | pointer requestBuffer;
|
---|
97 | pointer osPrivate; /* for OS layer, including scheduler */
|
---|
98 | Bool swapped;
|
---|
99 | ReplySwapPtr pSwapReplyFunc;
|
---|
100 | XID errorValue;
|
---|
101 | int sequence;
|
---|
102 | int closeDownMode;
|
---|
103 | int clientGone;
|
---|
104 | int noClientException; /* this client died or needs to be
|
---|
105 | * killed */
|
---|
106 | DrawablePtr lastDrawable;
|
---|
107 | Drawable lastDrawableID;
|
---|
108 | GCPtr lastGC;
|
---|
109 | GContext lastGCID;
|
---|
110 | SaveSetElt *saveSet;
|
---|
111 | int numSaved;
|
---|
112 | pointer screenPrivate[MAXSCREENS];
|
---|
113 | int (**requestVector) (
|
---|
114 | ClientPtr /* pClient */);
|
---|
115 | CARD32 req_len; /* length of current request */
|
---|
116 | Bool big_requests; /* supports large requests */
|
---|
117 | int priority;
|
---|
118 | ClientState clientState;
|
---|
119 | DevUnion *devPrivates;
|
---|
120 | #ifdef XKB
|
---|
121 | unsigned short xkbClientFlags;
|
---|
122 | unsigned short mapNotifyMask;
|
---|
123 | unsigned short newKeyboardNotifyMask;
|
---|
124 | unsigned short vMajor,vMinor;
|
---|
125 | KeyCode minKC,maxKC;
|
---|
126 | #endif
|
---|
127 |
|
---|
128 | #ifdef DEBUG
|
---|
129 | unsigned char requestLog[MAX_REQUEST_LOG];
|
---|
130 | int requestLogIndex;
|
---|
131 | #endif
|
---|
132 | #ifdef LBX
|
---|
133 | int (*readRequest)(ClientPtr /*client*/);
|
---|
134 | #endif
|
---|
135 | unsigned long replyBytesRemaining;
|
---|
136 | #ifdef XCSECURITY
|
---|
137 | XID authId;
|
---|
138 | unsigned int trustLevel;
|
---|
139 | pointer (* CheckAccess)(
|
---|
140 | ClientPtr /*pClient*/,
|
---|
141 | XID /*id*/,
|
---|
142 | RESTYPE /*classes*/,
|
---|
143 | Mask /*access_mode*/,
|
---|
144 | pointer /*resourceval*/);
|
---|
145 | #endif
|
---|
146 | #ifdef XAPPGROUP
|
---|
147 | struct _AppGroupRec* appgroup;
|
---|
148 | #endif
|
---|
149 | struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
|
---|
150 | ClientPtr /* pClient */,
|
---|
151 | int * /* num */);
|
---|
152 | #ifdef SMART_SCHEDULE
|
---|
153 | int smart_priority;
|
---|
154 | long smart_start_tick;
|
---|
155 | long smart_stop_tick;
|
---|
156 | long smart_check_tick;
|
---|
157 | #endif
|
---|
158 | } ClientRec;
|
---|
159 |
|
---|
160 | #ifdef SMART_SCHEDULE
|
---|
161 | /*
|
---|
162 | * Scheduling interface
|
---|
163 | */
|
---|
164 | extern long SmartScheduleTime;
|
---|
165 | extern long SmartScheduleInterval;
|
---|
166 | extern long SmartScheduleSlice;
|
---|
167 | extern long SmartScheduleMaxSlice;
|
---|
168 | extern unsigned long SmartScheduleIdleCount;
|
---|
169 | extern Bool SmartScheduleDisable;
|
---|
170 | extern Bool SmartScheduleIdle;
|
---|
171 | extern Bool SmartScheduleTimerStopped;
|
---|
172 | extern Bool SmartScheduleStartTimer(void);
|
---|
173 | #define SMART_MAX_PRIORITY (20)
|
---|
174 | #define SMART_MIN_PRIORITY (-20)
|
---|
175 |
|
---|
176 | extern Bool SmartScheduleInit(void);
|
---|
177 |
|
---|
178 | #endif
|
---|
179 |
|
---|
180 | /* This prototype is used pervasively in Xext, dix */
|
---|
181 | #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
|
---|
182 |
|
---|
183 | typedef struct _WorkQueue {
|
---|
184 | struct _WorkQueue *next;
|
---|
185 | Bool (*function) (
|
---|
186 | ClientPtr /* pClient */,
|
---|
187 | pointer /* closure */
|
---|
188 | );
|
---|
189 | ClientPtr client;
|
---|
190 | pointer closure;
|
---|
191 | } WorkQueueRec;
|
---|
192 |
|
---|
193 | extern TimeStamp currentTime;
|
---|
194 | extern TimeStamp lastDeviceEventTime;
|
---|
195 |
|
---|
196 | extern int CompareTimeStamps(
|
---|
197 | TimeStamp /*a*/,
|
---|
198 | TimeStamp /*b*/);
|
---|
199 |
|
---|
200 | extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
|
---|
201 |
|
---|
202 | typedef struct _CallbackRec {
|
---|
203 | CallbackProcPtr proc;
|
---|
204 | pointer data;
|
---|
205 | Bool deleted;
|
---|
206 | struct _CallbackRec *next;
|
---|
207 | } CallbackRec, *CallbackPtr;
|
---|
208 |
|
---|
209 | typedef struct _CallbackList {
|
---|
210 | CallbackFuncsRec funcs;
|
---|
211 | int inCallback;
|
---|
212 | Bool deleted;
|
---|
213 | int numDeleted;
|
---|
214 | CallbackPtr list;
|
---|
215 | } CallbackListRec;
|
---|
216 |
|
---|
217 | /* proc vectors */
|
---|
218 |
|
---|
219 | extern int (* InitialVector[3]) (ClientPtr /*client*/);
|
---|
220 |
|
---|
221 | extern int (* ProcVector[256]) (ClientPtr /*client*/);
|
---|
222 |
|
---|
223 | extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
---|
224 |
|
---|
225 | #ifdef K5AUTH
|
---|
226 | extern int (*k5_Vector[256])(ClientPtr /*client*/);
|
---|
227 | #endif
|
---|
228 |
|
---|
229 | extern ReplySwapPtr ReplySwapVector[256];
|
---|
230 |
|
---|
231 | extern int ProcBadRequest(ClientPtr /*client*/);
|
---|
232 |
|
---|
233 | #endif /* DIXSTRUCT_H */
|
---|