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