deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/***********************************************************
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCopyright 1987, 1998 The Open Group
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncthe above copyright notice appear in all copies and that both that
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynccopyright notice and this permission notice appear in supporting
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdocumentation.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncThe above copyright notice and this permission notice shall be included in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncall copies or substantial portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncin this Software without prior written authorization from The Open Group.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync All Rights Reserved
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPermission to use, copy, modify, and distribute this software and its
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdocumentation for any purpose and without fee is hereby granted,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncprovided that the above copyright notice appear in all copies and that
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncboth that copyright notice and this permission notice appear in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncsupporting documentation, and that the name of Digital not be
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncused in advertising or publicity pertaining to distribution of the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncsoftware without specific, written prior permission.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync******************************************************************/
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync register type *stuff = (type *)client->requestBuffer
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* XXX if you are using this macro, you are probably not generating Match
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * errors where appropriate */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#else /* not XACE */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* XACE */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * We think that most hardware implementations of DBE will want
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * LookupID*(dbe_back_buffer_id) to return the window structure that the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * id is a back buffer for. Since both front and back buffers will
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * return the same structure, you need to be able to distinguish
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * somewhere what kind of buffer (front/back) was being asked for, so
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * that ddx can render to the right place. That's the problem that the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * following code solves. Note: we couldn't embed this in the LookupID*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * those functions by checking a one-element cache. That's why we're
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * mucking with VALIDATE_DRAWABLE_AND_GC.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * structure will have two additional bits defined, srcBuffer and
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * dstBuffer, and their values will be maintained via the macros
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below). If you also
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * DbeValidateBuffer will be called any time the bits change to give you
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * a chance to do some setup. See the DBE code for more details on this
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * function. We put in these levels of conditionality so that you can do
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * just what you need to do, and no more. If neither of these defines
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * be unchanged. dpw
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DbeValidateBuffer((WindowPtr)_pDraw, _drawID, _dstbuf);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#else /* want buffer bits, but don't need to call DbeValidateBuffer */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* NEED_DBE_BUF_VALIDATE */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#else /* don't want buffer bits in window */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* NEED_DBE_BUF_BITS */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define WriteReplyToClient(pClient, size, pReply) { \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); }
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define WriteSwappedDataToClient(pClient, size, pbuf) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _Client *ClientPtr; /* also in misc.h */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void UpdateCurrentTime(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void UpdateCurrentTimeIf(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void InitSelections(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void CloseDownRetainedResources(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned int /*majorCode*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned int /*minorCode*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*errorCode*/);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync char* /*reason*/);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*format*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*width*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*height*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ddxBeforeReset (void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char * /*dest*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char * /*source*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*length*/);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char * /*a*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char * /*b*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SecurityLookupWindow(rid, client, access_mode) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define SecurityLookupDrawable(rid, client, access_mode) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* XACE */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void NoopDDA(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /*mode*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*result*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* result */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void InitBlockAndWakeupHandlers(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ProcessWorkQueue(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ProcessWorkQueueZombies(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* ___CLIENTSIGNAL_DEFINED___ */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync char * /*string*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /*len*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void AtomError(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void FreeAllAtoms(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void InitAtoms(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* event */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ComputeFreezes(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* newState */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* mskidx */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* checkFirst */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* count */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* XKB */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /* mode */);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /* this_mode */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /* other_mode */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /* ownerEvents */,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void InitEvents(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void CloseDownEvents(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*count*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*count*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*count*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void WindowsRestructured(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void ResetClientPrivates(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int /*index*/,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned /*amount*/);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * callback manager stuff
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void InitCallbackManager(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ServerGrabCallback stuff
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * EventCallback stuff
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * DeviceEventCallback stuff
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SelectionCallback stuff
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int ffs(int i);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* DIX_H */