45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 2004 Eric Anholt
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation, and that the name of Eric Anholt not be used in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * advertising or publicity pertaining to distribution of the software without
45e9809aff7304721fddb95654901b32195c9c7avboxsync * specific, written prior permission. Eric Anholt makes no
45e9809aff7304721fddb95654901b32195c9c7avboxsync * representations about the suitability of this software for any purpose. It
45e9809aff7304721fddb95654901b32195c9c7avboxsync * is provided "as is" without express or implied warranty.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
45e9809aff7304721fddb95654901b32195c9c7avboxsync * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * PERFORMANCE OF THIS SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * One of these structures is allocated per GC that gets used with a window with
45e9809aff7304721fddb95654901b32195c9c7avboxsync * backing pixmap.
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures
45e9809aff7304721fddb95654901b32195c9c7avboxsync * set FALSE and the clientClip set to
45e9809aff7304721fddb95654901b32195c9c7avboxsync * clip output to the valid regions of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * backing pixmap. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long serialNumber; /* clientClip computed time */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long stateChanges; /* changes in parent gc since last copy */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define getCwGC(pGC) ((cwGCPtr)dixLookupPrivate(&(pGC)->devPrivates, cwGCKey))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define setCwGC(pGC,p) dixSetPrivate(&(pGC)->devPrivates, cwGCKey, p)
45e9809aff7304721fddb95654901b32195c9c7avboxsync * One of these structures is allocated per Picture that gets used with a
45e9809aff7304721fddb95654901b32195c9c7avboxsync * window with a backing pixmap
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define getCwPicture(pPicture) (pPicture->pDrawable ? \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (cwPicturePtr)dixLookupPrivate(&(pPicture)->devPrivates, cwPictureKey) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define setCwPicture(pPicture,p) dixSetPrivate(&(pPicture)->devPrivates, cwPictureKey, p)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define cwWindowPrivate(pWin) dixLookupPrivate(&(pWin)->devPrivates, cwWindowKey)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define getCwPixmap(pWindow) ((PixmapPtr) cwWindowPrivate(pWindow))
45e9809aff7304721fddb95654901b32195c9c7avboxsync dixSetPrivate(&(pWindow)->devPrivates, cwWindowKey, pPixmap)
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync * screen func wrappers
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define getCwScreen(pScreen) ((cwScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, cwScreenKey))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define setCwScreen(pScreen,p) dixSetPrivate(&(pScreen)->devPrivates, cwScreenKey, p)
45e9809aff7304721fddb95654901b32195c9c7avboxsync (x) = (x) + dst_off_x; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (y) = (y) + dst_off_y; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (x) = (x) + src_off_x; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (y) = (y) + src_off_y; \