45e9809aff7304721fddb95654901b32195c9c7avboxsync/***********************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync All Rights Reserved
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, and distribute this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose and without fee is hereby granted,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncprovided that the above copyright notice appear in all copies and that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncboth that copyright notice and this permission notice appear in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsupporting documentation, and that the name of Digital not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or publicity pertaining to distribution of the
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsoftware without specific, written prior permission.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
45e9809aff7304721fddb95654901b32195c9c7avboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45e9809aff7304721fddb95654901b32195c9c7avboxsyncSOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync******************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef DIXSTRUCT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DIXSTRUCT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "dix.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "resource.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "cursor.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "gc.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "pixmap.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "privates.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xmd.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * direct-mapped hash table, used by resource manager to store
45e9809aff7304721fddb95654901b32195c9c7avboxsync * translation from client ids to server addresses.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT CallbackListPtr ClientStateCallback;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr client;
45e9809aff7304721fddb95654901b32195c9c7avboxsync xConnSetupPrefix *prefix;
45e9809aff7304721fddb95654901b32195c9c7avboxsync xConnSetup *setup;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} NewClientInfoRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*ReplySwapPtr) (
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /* pClient */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /* size */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync void * /* pbuf */);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void ReplyNotSwappd (
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /* pClient */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /* size */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync void * /* pbuf */);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef enum {ClientStateInitial,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateAuthenticating,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateRunning,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateRetained,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateGone,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateCheckingSecurity,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientStateCheckedSecurity} ClientState;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XFIXES
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _saveSet {
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _Window *windowPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool toRoot;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool map;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} SaveSetElt;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetWindow(ss) ((ss).windowPtr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetToRoot(ss) ((ss).toRoot)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetShouldMap(ss) ((ss).map)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignMap(ss,m) ((ss).map = (m))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _Window *SaveSetElt;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetWindow(ss) (ss)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetToRoot(ss) FALSE
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetShouldMap(ss) TRUE
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignWindow(ss,w) ((ss) = (w))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignToRoot(ss,tr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SaveSetAssignMap(ss,m)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* The unused_ members are ABI spacing. Please reuse them. */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _Client {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int index;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask clientAsMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer requestBuffer;
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer osPrivate; /* for OS layer, including scheduler */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool swapped;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ReplySwapPtr pSwapReplyFunc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID errorValue;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int sequence;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int closeDownMode;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int clientGone;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int noClientException; /* this client died or needs to be
45e9809aff7304721fddb95654901b32195c9c7avboxsync * killed */
45e9809aff7304721fddb95654901b32195c9c7avboxsync SaveSetElt *saveSet;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int numSaved;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *unused_screenPrivate[16];
45e9809aff7304721fddb95654901b32195c9c7avboxsync int (**requestVector) (
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /* pClient */);
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 req_len; /* length of current request */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool big_requests; /* supports large requests */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int priority;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientState clientState;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PrivateRec *devPrivates;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short xkbClientFlags;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short mapNotifyMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short newKeyboardNotifyMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short vMajor,vMinor;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyCode minKC,maxKC;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long replyBytesRemaining;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *unused_appgroup;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *unused_fontResFunc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int smart_priority;
45e9809aff7304721fddb95654901b32195c9c7avboxsync long smart_start_tick;
45e9809aff7304721fddb95654901b32195c9c7avboxsync long smart_stop_tick;
45e9809aff7304721fddb95654901b32195c9c7avboxsync long smart_check_tick;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr clientPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} ClientRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Scheduling interface
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT long SmartScheduleTime;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT long SmartScheduleInterval;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT long SmartScheduleSlice;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT long SmartScheduleMaxSlice;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool SmartScheduleDisable;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void SmartScheduleStartTimer(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void SmartScheduleStopTimer(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SMART_MAX_PRIORITY (20)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SMART_MIN_PRIORITY (-20)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool SmartScheduleInit(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* This prototype is used pervasively in Xext, dix */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _WorkQueue {
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _WorkQueue *next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool (*function) (
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /* pClient */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer /* closure */
45e9809aff7304721fddb95654901b32195c9c7avboxsync);
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr client;
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer closure;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} WorkQueueRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT TimeStamp currentTime;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT TimeStamp lastDeviceEventTime;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int CompareTimeStamps(
45e9809aff7304721fddb95654901b32195c9c7avboxsync TimeStamp /*a*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync TimeStamp /*b*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _CallbackRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync CallbackProcPtr proc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer data;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool deleted;
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _CallbackRec *next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} CallbackRec, *CallbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _CallbackList {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int inCallback;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool deleted;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int numDeleted;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CallbackPtr list;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} CallbackListRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* proc vectors */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int (* InitialVector[3]) (ClientPtr /*client*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int (* ProcVector[256]) (ClientPtr /*client*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int (* SwappedProcVector[256]) (ClientPtr /*client*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT ReplySwapPtr ReplySwapVector[256];
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int ProcBadRequest(ClientPtr /*client*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* DIXSTRUCT_H */