45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 2003 Keith Packard
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
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 Keith Packard not be used in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * advertising or publicity pertaining to distribution of the software without
45e9809aff7304721fddb95654901b32195c9c7avboxsync * specific, written prior permission. Keith Packard 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 *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
45e9809aff7304721fddb95654901b32195c9c7avboxsync * EVENT SHALL KEITH PACKARD 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 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef HAVE_DIX_CONFIG_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <dix-config.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _DAMAGESTR_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _DAMAGESTR_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "damage.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "gcstruct.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef RENDER
45e9809aff7304721fddb95654901b32195c9c7avboxsync# include "picturestr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _damage {
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamagePtr pNext;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamagePtr pNextWin;
45e9809aff7304721fddb95654901b32195c9c7avboxsync RegionRec damage;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageReportLevel damageLevel;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool isInternal;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *closure;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool isWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DrawablePtr pDrawable;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageReportFunc damageReport;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageDestroyFunc damageDestroy;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool reportAfter;
45e9809aff7304721fddb95654901b32195c9c7avboxsync RegionRec pendingDamage;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DamageRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _damageScrPriv {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int internalLevel;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync /*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * For DDXen which don't provide GetScreenPixmap, this provides
45e9809aff7304721fddb95654901b32195c9c7avboxsync * a place to hook damage for windows on the screen
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamagePtr pScreenDamage;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync PaintWindowBackgroundProcPtr PaintWindowBackground;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PaintWindowBorderProcPtr PaintWindowBorder;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CopyWindowProcPtr CopyWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CloseScreenProcPtr CloseScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CreateGCProcPtr CreateGC;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DestroyPixmapProcPtr DestroyPixmap;
45e9809aff7304721fddb95654901b32195c9c7avboxsync SetWindowPixmapProcPtr SetWindowPixmap;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DestroyWindowProcPtr DestroyWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef RENDER
45e9809aff7304721fddb95654901b32195c9c7avboxsync CompositeProcPtr Composite;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphsProcPtr Glyphs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync BSFuncRec BackingStoreFuncs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DamageScrPrivRec, *DamageScrPrivPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _damageGCPriv {
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCOps *ops;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCFuncs *funcs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DamageGCPrivRec, *DamageGCPrivPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* XXX should move these into damage.c, damageScrPrivateIndex is static */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageGetScrPriv(pScr) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageScrPriv(pScr) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageScrPrivPtr pScrPriv = damageGetScrPriv(pScr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageGetPixPriv(pPix) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((DamagePtr) (pPix)->devPrivates[damagePixPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damgeSetPixPriv(pPix,v) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((pPix)->devPrivates[damagePixPrivateIndex].ptr = (pointer ) (v))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damagePixPriv(pPix) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamagePtr pDamage = damageGetPixPriv(pPix)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageGetGCPriv(pGC) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((DamageGCPrivPtr) (pGC)->devPrivates[damageGCPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageGCPriv(pGC) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageGCPrivPtr pGCPriv = damageGetGCPriv(pGC)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageGetWinPriv(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((DamagePtr) (pWin)->devPrivates[damageWinPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define damageSetWinPriv(pWin,d) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((pWin)->devPrivates[damageWinPrivateIndex].ptr = (d))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _DAMAGESTR_H_ */