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 map;
|
---|
75 | } SaveSetElt;
|
---|
76 | #define SaveSetWindow(ss) ((ss).windowPtr)
|
---|
77 | #define SaveSetToRoot(ss) ((ss).toRoot)
|
---|
78 | #define SaveSetShouldMap(ss) ((ss).map)
|
---|
79 | #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
|
---|
80 | #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
|
---|
81 | #define SaveSetAssignMap(ss,m) ((ss).map = (m))
|
---|
82 | #else
|
---|
83 | typedef struct _Window *SaveSetElt;
|
---|
84 | #define SaveSetWindow(ss) (ss)
|
---|
85 | #define SaveSetToRoot(ss) FALSE
|
---|
86 | #define SaveSetShouldMap(ss) TRUE
|
---|
87 | #define SaveSetAssignWindow(ss,w) ((ss) = (w))
|
---|
88 | #define SaveSetAssignToRoot(ss,tr)
|
---|
89 | #define SaveSetAssignMap(ss,m)
|
---|
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 | void *appgroup; /* Can't remove, ABI */
|
---|
129 | struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
|
---|
130 | ClientPtr /* pClient */,
|
---|
131 | int * /* num */);
|
---|
132 | int smart_priority;
|
---|
133 | long smart_start_tick;
|
---|
134 | long smart_stop_tick;
|
---|
135 | long smart_check_tick;
|
---|
136 |
|
---|
137 | DeviceIntPtr clientPtr;
|
---|
138 | } ClientRec;
|
---|
139 |
|
---|
140 | /*
|
---|
141 | * Scheduling interface
|
---|
142 | */
|
---|
143 | extern long SmartScheduleTime;
|
---|
144 | extern long SmartScheduleInterval;
|
---|
145 | extern long SmartScheduleSlice;
|
---|
146 | extern long SmartScheduleMaxSlice;
|
---|
147 | extern Bool SmartScheduleDisable;
|
---|
148 | extern void SmartScheduleStartTimer(void);
|
---|
149 | extern void SmartScheduleStopTimer(void);
|
---|
150 | #define SMART_MAX_PRIORITY (20)
|
---|
151 | #define SMART_MIN_PRIORITY (-20)
|
---|
152 |
|
---|
153 | extern Bool SmartScheduleInit(void);
|
---|
154 |
|
---|
155 |
|
---|
156 | /* This prototype is used pervasively in Xext, dix */
|
---|
157 | #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
|
---|
158 |
|
---|
159 | typedef struct _WorkQueue {
|
---|
160 | struct _WorkQueue *next;
|
---|
161 | Bool (*function) (
|
---|
162 | ClientPtr /* pClient */,
|
---|
163 | pointer /* closure */
|
---|
164 | );
|
---|
165 | ClientPtr client;
|
---|
166 | pointer closure;
|
---|
167 | } WorkQueueRec;
|
---|
168 |
|
---|
169 | extern TimeStamp currentTime;
|
---|
170 | extern TimeStamp lastDeviceEventTime;
|
---|
171 |
|
---|
172 | extern int CompareTimeStamps(
|
---|
173 | TimeStamp /*a*/,
|
---|
174 | TimeStamp /*b*/);
|
---|
175 |
|
---|
176 | extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
|
---|
177 |
|
---|
178 | typedef struct _CallbackRec {
|
---|
179 | CallbackProcPtr proc;
|
---|
180 | pointer data;
|
---|
181 | Bool deleted;
|
---|
182 | struct _CallbackRec *next;
|
---|
183 | } CallbackRec, *CallbackPtr;
|
---|
184 |
|
---|
185 | typedef struct _CallbackList {
|
---|
186 | int inCallback;
|
---|
187 | Bool deleted;
|
---|
188 | int numDeleted;
|
---|
189 | CallbackPtr list;
|
---|
190 | } CallbackListRec;
|
---|
191 |
|
---|
192 | /* proc vectors */
|
---|
193 |
|
---|
194 | extern int (* InitialVector[3]) (ClientPtr /*client*/);
|
---|
195 |
|
---|
196 | extern int (* ProcVector[256]) (ClientPtr /*client*/);
|
---|
197 |
|
---|
198 | extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
---|
199 |
|
---|
200 | extern ReplySwapPtr ReplySwapVector[256];
|
---|
201 |
|
---|
202 | extern int ProcBadRequest(ClientPtr /*client*/);
|
---|
203 |
|
---|
204 | #endif /* DIXSTRUCT_H */
|
---|