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 "client.h"
|
---|
28 | #include "dix.h"
|
---|
29 | #include "resource.h"
|
---|
30 | #include "cursor.h"
|
---|
31 | #include "gc.h"
|
---|
32 | #include "pixmap.h"
|
---|
33 | #include "privates.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 | extern _X_EXPORT CallbackListPtr ClientStateCallback;
|
---|
42 |
|
---|
43 | typedef struct {
|
---|
44 | ClientPtr client;
|
---|
45 | xConnSetupPrefix *prefix;
|
---|
46 | xConnSetup *setup;
|
---|
47 | } NewClientInfoRec;
|
---|
48 |
|
---|
49 | typedef void (*ReplySwapPtr) (
|
---|
50 | ClientPtr /* pClient */,
|
---|
51 | int /* size */,
|
---|
52 | void * /* pbuf */);
|
---|
53 |
|
---|
54 | extern _X_EXPORT void ReplyNotSwappd (
|
---|
55 | ClientPtr /* pClient */,
|
---|
56 | int /* size */,
|
---|
57 | void * /* pbuf */) _X_NORETURN;
|
---|
58 |
|
---|
59 | typedef enum {ClientStateInitial,
|
---|
60 | /* 1 is unused now, was ClientStateAuthenticating */
|
---|
61 | ClientStateRunning = 2,
|
---|
62 | ClientStateRetained,
|
---|
63 | ClientStateGone
|
---|
64 | } ClientState;
|
---|
65 |
|
---|
66 | #ifdef XFIXES
|
---|
67 | typedef struct _saveSet {
|
---|
68 | struct _Window *windowPtr;
|
---|
69 | Bool toRoot;
|
---|
70 | Bool map;
|
---|
71 | } SaveSetElt;
|
---|
72 | #define SaveSetWindow(ss) ((ss).windowPtr)
|
---|
73 | #define SaveSetToRoot(ss) ((ss).toRoot)
|
---|
74 | #define SaveSetShouldMap(ss) ((ss).map)
|
---|
75 | #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
|
---|
76 | #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
|
---|
77 | #define SaveSetAssignMap(ss,m) ((ss).map = (m))
|
---|
78 | #else
|
---|
79 | typedef struct _Window *SaveSetElt;
|
---|
80 | #define SaveSetWindow(ss) (ss)
|
---|
81 | #define SaveSetToRoot(ss) FALSE
|
---|
82 | #define SaveSetShouldMap(ss) TRUE
|
---|
83 | #define SaveSetAssignWindow(ss,w) ((ss) = (w))
|
---|
84 | #define SaveSetAssignToRoot(ss,tr)
|
---|
85 | #define SaveSetAssignMap(ss,m)
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | typedef struct _Client {
|
---|
89 | int index;
|
---|
90 | Mask clientAsMask;
|
---|
91 | pointer requestBuffer;
|
---|
92 | pointer osPrivate; /* for OS layer, including scheduler */
|
---|
93 | Bool swapped;
|
---|
94 | ReplySwapPtr pSwapReplyFunc;
|
---|
95 | XID errorValue;
|
---|
96 | int sequence;
|
---|
97 | int closeDownMode;
|
---|
98 | int clientGone;
|
---|
99 | int noClientException; /* this client died or needs to be
|
---|
100 | * killed */
|
---|
101 | int ignoreCount; /* count for Attend/IgnoreClient */
|
---|
102 | SaveSetElt *saveSet;
|
---|
103 | int numSaved;
|
---|
104 | int (**requestVector) (
|
---|
105 | ClientPtr /* pClient */);
|
---|
106 | CARD32 req_len; /* length of current request */
|
---|
107 | Bool big_requests; /* supports large requests */
|
---|
108 | int priority;
|
---|
109 | ClientState clientState;
|
---|
110 | PrivateRec *devPrivates;
|
---|
111 | unsigned short xkbClientFlags;
|
---|
112 | unsigned short mapNotifyMask;
|
---|
113 | unsigned short newKeyboardNotifyMask;
|
---|
114 | unsigned short vMajor,vMinor;
|
---|
115 | KeyCode minKC,maxKC;
|
---|
116 |
|
---|
117 | unsigned long replyBytesRemaining;
|
---|
118 | int smart_priority;
|
---|
119 | long smart_start_tick;
|
---|
120 | long smart_stop_tick;
|
---|
121 | long smart_check_tick;
|
---|
122 |
|
---|
123 | DeviceIntPtr clientPtr;
|
---|
124 | ClientIdPtr clientIds;
|
---|
125 | unsigned short majorOp, minorOp;
|
---|
126 | } ClientRec;
|
---|
127 |
|
---|
128 | /*
|
---|
129 | * Scheduling interface
|
---|
130 | */
|
---|
131 | extern _X_EXPORT long SmartScheduleTime;
|
---|
132 | extern _X_EXPORT long SmartScheduleInterval;
|
---|
133 | extern _X_EXPORT long SmartScheduleSlice;
|
---|
134 | extern _X_EXPORT long SmartScheduleMaxSlice;
|
---|
135 | extern _X_EXPORT Bool SmartScheduleDisable;
|
---|
136 | extern _X_EXPORT void SmartScheduleStartTimer(void);
|
---|
137 | extern _X_EXPORT void SmartScheduleStopTimer(void);
|
---|
138 | #define SMART_MAX_PRIORITY (20)
|
---|
139 | #define SMART_MIN_PRIORITY (-20)
|
---|
140 |
|
---|
141 | extern _X_EXPORT void SmartScheduleInit(void);
|
---|
142 |
|
---|
143 |
|
---|
144 | /* This prototype is used pervasively in Xext, dix */
|
---|
145 | #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
|
---|
146 |
|
---|
147 | typedef struct _WorkQueue {
|
---|
148 | struct _WorkQueue *next;
|
---|
149 | Bool (*function) (
|
---|
150 | ClientPtr /* pClient */,
|
---|
151 | pointer /* closure */
|
---|
152 | );
|
---|
153 | ClientPtr client;
|
---|
154 | pointer closure;
|
---|
155 | } WorkQueueRec;
|
---|
156 |
|
---|
157 | extern _X_EXPORT TimeStamp currentTime;
|
---|
158 | extern _X_EXPORT TimeStamp lastDeviceEventTime;
|
---|
159 |
|
---|
160 | extern _X_EXPORT int CompareTimeStamps(
|
---|
161 | TimeStamp /*a*/,
|
---|
162 | TimeStamp /*b*/);
|
---|
163 |
|
---|
164 | extern _X_EXPORT TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
|
---|
165 |
|
---|
166 | typedef struct _CallbackRec {
|
---|
167 | CallbackProcPtr proc;
|
---|
168 | pointer data;
|
---|
169 | Bool deleted;
|
---|
170 | struct _CallbackRec *next;
|
---|
171 | } CallbackRec, *CallbackPtr;
|
---|
172 |
|
---|
173 | typedef struct _CallbackList {
|
---|
174 | int inCallback;
|
---|
175 | Bool deleted;
|
---|
176 | int numDeleted;
|
---|
177 | CallbackPtr list;
|
---|
178 | } CallbackListRec;
|
---|
179 |
|
---|
180 | /* proc vectors */
|
---|
181 |
|
---|
182 | extern _X_EXPORT int (* InitialVector[3]) (ClientPtr /*client*/);
|
---|
183 |
|
---|
184 | extern _X_EXPORT int (* ProcVector[256]) (ClientPtr /*client*/);
|
---|
185 |
|
---|
186 | extern _X_EXPORT int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
---|
187 |
|
---|
188 | extern _X_EXPORT ReplySwapPtr ReplySwapVector[256];
|
---|
189 |
|
---|
190 | extern _X_EXPORT int ProcBadRequest(ClientPtr /*client*/);
|
---|
191 |
|
---|
192 | #endif /* DIXSTRUCT_H */
|
---|