1 /***********************************************************
2 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
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.
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
22 ******************************************************************/
35 * direct-mapped hash table, used by resource manager to store
36 * translation from client ids to server addresses.
40 #define MAX_REQUEST_LOG 100
43 extern CallbackListPtr ClientStateCallback
;
47 xConnSetupPrefix
*prefix
;
51 typedef void (*ReplySwapPtr
) (
52 ClientPtr
/* pClient */,
56 extern void ReplyNotSwappd (
57 ClientPtr
/* pClient */,
61 typedef enum {ClientStateInitial
,
62 ClientStateAuthenticating
,
66 ClientStateCheckingSecurity
,
67 ClientStateCheckedSecurity
} ClientState
;
70 typedef struct _saveSet
{
71 struct _Window
*windowPtr
;
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))
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)
91 typedef struct _Client
{
94 pointer requestBuffer
;
95 pointer osPrivate
; /* for OS layer, including scheduler */
97 ReplySwapPtr pSwapReplyFunc
;
102 int noClientException
; /* this client died or needs to be
104 DrawablePtr lastDrawable
;
105 Drawable lastDrawableID
;
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 */
116 ClientState clientState
;
117 DevUnion
*devPrivates
;
119 unsigned short xkbClientFlags
;
120 unsigned short mapNotifyMask
;
121 unsigned short newKeyboardNotifyMask
;
122 unsigned short vMajor
,vMinor
;
127 unsigned char requestLog
[MAX_REQUEST_LOG
];
130 unsigned long replyBytesRemaining
;
132 struct _AppGroupRec
* appgroup
;
134 struct _FontResolution
* (*fontResFunc
) ( /* no need for font.h */
135 ClientPtr
/* pClient */,
137 #ifdef SMART_SCHEDULE
139 long smart_start_tick
;
140 long smart_stop_tick
;
141 long smart_check_tick
;
145 #ifdef SMART_SCHEDULE
147 * Scheduling interface
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)
161 extern Bool
SmartScheduleInit(void);
165 /* This prototype is used pervasively in Xext, dix */
166 #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
168 typedef struct _WorkQueue
{
169 struct _WorkQueue
*next
;
171 ClientPtr
/* pClient */,
172 pointer
/* closure */
178 extern TimeStamp currentTime
;
179 extern TimeStamp lastDeviceEventTime
;
181 extern int CompareTimeStamps(
185 extern TimeStamp
ClientTimeToServerTime(CARD32
/*c*/);
187 typedef struct _CallbackRec
{
188 CallbackProcPtr proc
;
191 struct _CallbackRec
*next
;
192 } CallbackRec
, *CallbackPtr
;
194 typedef struct _CallbackList
{
195 CallbackFuncsRec funcs
;
204 extern int (* InitialVector
[3]) (ClientPtr
/*client*/);
206 extern int (* ProcVector
[256]) (ClientPtr
/*client*/);
208 extern int (* SwappedProcVector
[256]) (ClientPtr
/*client*/);
210 extern ReplySwapPtr ReplySwapVector
[256];
212 extern int ProcBadRequest(ClientPtr
/*client*/);
214 #endif /* DIXSTRUCT_H */