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 "privates.h"
|
---|
33 | #include <X11/Xmd.h>
|
---|
34 |
|
---|
35 | /*
|
---|
36 | * direct-mapped hash table, used by resource manager to store
|
---|
37 | * translation from client ids to server addresses.
|
---|
38 | */
|
---|
39 |
|
---|
40 | #ifdef DEBUG
|
---|
41 | #define MAX_REQUEST_LOG 100
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | extern CallbackListPtr ClientStateCallback;
|
---|
45 |
|
---|
46 | typedef struct {
|
---|
47 | ClientPtr client;
|
---|
48 | xConnSetupPrefix *prefix;
|
---|
49 | xConnSetup *setup;
|
---|
50 | } NewClientInfoRec;
|
---|
51 |
|
---|
52 | typedef void (*ReplySwapPtr) (
|
---|
53 | ClientPtr /* pClient */,
|
---|
54 | int /* size */,
|
---|
55 | void * /* pbuf */);
|
---|
56 |
|
---|
57 | extern void ReplyNotSwappd (
|
---|
58 | ClientPtr /* pClient */,
|
---|
59 | int /* size */,
|
---|
60 | void * /* pbuf */);
|
---|
61 |
|
---|
62 | typedef enum {ClientStateInitial,
|
---|
63 | ClientStateAuthenticating,
|
---|
64 | ClientStateRunning,
|
---|
65 | ClientStateRetained,
|
---|
66 | ClientStateGone,
|
---|
67 | ClientStateCheckingSecurity,
|
---|
68 | ClientStateCheckedSecurity} ClientState;
|
---|
69 |
|
---|
70 | #ifdef XFIXES
|
---|
71 | typedef struct _saveSet {
|
---|
72 | struct _Window *windowPtr;
|
---|
73 | Bool toRoot;
|
---|
74 | Bool remap;
|
---|
75 | } SaveSetElt;
|
---|
76 | #define SaveSetWindow(ss) ((ss).windowPtr)
|
---|
77 | #define SaveSetToRoot(ss) ((ss).toRoot)
|
---|
78 | #define SaveSetRemap(ss) ((ss).remap)
|
---|
79 | #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
|
---|
80 | #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
|
---|
81 | #define SaveSetAssignRemap(ss,rm) ((ss).remap = (rm))
|
---|
82 | #else
|
---|
83 | typedef struct _Window *SaveSetElt;
|
---|
84 | #define SaveSetWindow(ss) (ss)
|
---|
85 | #define SaveSetToRoot(ss) FALSE
|
---|
86 | #define SaveSetRemap(ss) TRUE
|
---|
87 | #define SaveSetAssignWindow(ss,w) ((ss) = (w))
|
---|
88 | #define SaveSetAssignToRoot(ss,tr)
|
---|
89 | #define SaveSetAssignRemap(ss,rm)
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | typedef struct _Client {
|
---|
93 | int index;
|
---|
94 | Mask clientAsMask;
|
---|
95 | pointer requestBuffer;
|
---|
96 | pointer osPrivate; /* for OS layer, including scheduler */
|
---|
97 | Bool swapped;
|
---|
98 | ReplySwapPtr pSwapReplyFunc;
|
---|
99 | XID errorValue;
|
---|
100 | int sequence;
|
---|
101 | int closeDownMode;
|
---|
102 | int clientGone;
|
---|
103 | int noClientException; /* this client died or needs to be
|
---|
104 | * killed */
|
---|
105 | SaveSetElt *saveSet;
|
---|
106 | int numSaved;
|
---|
107 | pointer screenPrivate[MAXSCREENS];
|
---|
108 | int (**requestVector) (
|
---|
109 | ClientPtr /* pClient */);
|
---|
110 | CARD32 req_len; /* length of current request */
|
---|
111 | Bool big_requests; /* supports large requests */
|
---|
112 | int priority;
|
---|
113 | ClientState clientState;
|
---|
114 | PrivateRec *devPrivates;
|
---|
115 | #ifdef XKB
|
---|
116 | unsigned short xkbClientFlags;
|
---|
117 | unsigned short mapNotifyMask;
|
---|
118 | unsigned short newKeyboardNotifyMask;
|
---|
119 | unsigned short vMajor,vMinor;
|
---|
120 | KeyCode minKC,maxKC;
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | #ifdef DEBUG
|
---|
124 | unsigned char requestLog[MAX_REQUEST_LOG];
|
---|
125 | int requestLogIndex;
|
---|
126 | #endif
|
---|
127 | unsigned long replyBytesRemaining;
|
---|
128 | #ifdef XAPPGROUP
|
---|
129 | struct _AppGroupRec* appgroup;
|
---|
130 | #endif
|
---|
131 | struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
|
---|
132 | ClientPtr /* pClient */,
|
---|
133 | int * /* num */);
|
---|
134 | #ifdef SMART_SCHEDULE
|
---|
135 | int smart_priority;
|
---|
136 | long smart_start_tick;
|
---|
137 | long smart_stop_tick;
|
---|
138 | long smart_check_tick;
|
---|
139 | #endif
|
---|
140 | } ClientRec;
|
---|
141 |
|
---|
142 | #ifdef SMART_SCHEDULE
|
---|
143 | /*
|
---|
144 | * Scheduling interface
|
---|
145 | */
|
---|
146 | extern long SmartScheduleTime;
|
---|
147 | extern long SmartScheduleInterval;
|
---|
148 | extern long SmartScheduleSlice;
|
---|
149 | extern long SmartScheduleMaxSlice;
|
---|
150 | extern Bool SmartScheduleDisable;
|
---|
151 | extern void SmartScheduleStartTimer(void);
|
---|
152 | extern void SmartScheduleStopTimer(void);
|
---|
153 | #define SMART_MAX_PRIORITY (20)
|
---|
154 | #define SMART_MIN_PRIORITY (-20)
|
---|
155 |
|
---|
156 | extern Bool SmartScheduleInit(void);
|
---|
157 |
|
---|
158 | #endif
|
---|
159 |
|
---|
160 | /* This prototype is used pervasively in Xext, dix */
|
---|
161 | #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
|
---|
162 |
|
---|
163 | typedef struct _WorkQueue {
|
---|
164 | struct _WorkQueue *next;
|
---|
165 | Bool (*function) (
|
---|
166 | ClientPtr /* pClient */,
|
---|
167 | pointer /* closure */
|
---|
168 | );
|
---|
169 | ClientPtr client;
|
---|
170 | pointer closure;
|
---|
171 | } WorkQueueRec;
|
---|
172 |
|
---|
173 | extern TimeStamp currentTime;
|
---|
174 | extern TimeStamp lastDeviceEventTime;
|
---|
175 |
|
---|
176 | extern int CompareTimeStamps(
|
---|
177 | TimeStamp /*a*/,
|
---|
178 | TimeStamp /*b*/);
|
---|
179 |
|
---|
180 | extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
|
---|
181 |
|
---|
182 | typedef struct _CallbackRec {
|
---|
183 | CallbackProcPtr proc;
|
---|
184 | pointer data;
|
---|
185 | Bool deleted;
|
---|
186 | struct _CallbackRec *next;
|
---|
187 | } CallbackRec, *CallbackPtr;
|
---|
188 |
|
---|
189 | typedef struct _CallbackList {
|
---|
190 | int inCallback;
|
---|
191 | Bool deleted;
|
---|
192 | int numDeleted;
|
---|
193 | CallbackPtr list;
|
---|
194 | } CallbackListRec;
|
---|
195 |
|
---|
196 | /* proc vectors */
|
---|
197 |
|
---|
198 | extern int (* InitialVector[3]) (ClientPtr /*client*/);
|
---|
199 |
|
---|
200 | extern int (* ProcVector[256]) (ClientPtr /*client*/);
|
---|
201 |
|
---|
202 | extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
---|
203 |
|
---|
204 | extern ReplySwapPtr ReplySwapVector[256];
|
---|
205 |
|
---|
206 | extern int ProcBadRequest(ClientPtr /*client*/);
|
---|
207 |
|
---|
208 | #endif /* DIXSTRUCT_H */
|
---|