#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _DAMAGESTR_H_
#define _DAMAGESTR_H_
#include "damage.h"
#include "gcstruct.h"
#include "privates.h"
#ifdef RENDER
# include "picturestr.h"
#endif
typedef struct _damage {
DamagePtr pNext;
DamagePtr pNextWin;
RegionRec damage;
DamageReportLevel damageLevel;
Bool isInternal;
void *closure;
Bool isWindow;
DrawablePtr pDrawable;
DamageReportFunc damageReport;
DamageReportFunc damageReportPostRendering;
DamageDestroyFunc damageDestroy;
DamageMarkerFunc damageMarker;
Bool reportAfter;
RegionRec pendingDamage;
RegionRec backupDamage;
} DamageRec;
typedef struct _damageScrPriv {
int internalLevel;
DamagePtr pScreenDamage;
CopyWindowProcPtr CopyWindow;
CloseScreenProcPtr CloseScreen;
CreateGCProcPtr CreateGC;
DestroyPixmapProcPtr DestroyPixmap;
SetWindowPixmapProcPtr SetWindowPixmap;
DestroyWindowProcPtr DestroyWindow;
#ifdef RENDER
CompositeProcPtr Composite;
GlyphsProcPtr Glyphs;
AddTrapsProcPtr AddTraps;
#endif
} DamageScrPrivRec, *DamageScrPrivPtr;
typedef struct _damageGCPriv {
GCOps *ops;
GCFuncs *funcs;
} DamageGCPrivRec, *DamageGCPrivPtr;
#define damageGetScrPriv(pScr) ((DamageScrPrivPtr) \
dixLookupPrivate(&(pScr)->devPrivates, damageScrPrivateKey))
#define damageScrPriv(pScr) \
DamageScrPrivPtr pScrPriv = damageGetScrPriv(pScr)
#define damageGetPixPriv(pPix) \
dixLookupPrivate(&(pPix)->devPrivates, damagePixPrivateKey)
#define damgeSetPixPriv(pPix,v) \
dixSetPrivate(&(pPix)->devPrivates, damagePixPrivateKey, v)
#define damagePixPriv(pPix) \
DamagePtr pDamage = damageGetPixPriv(pPix)
#define damageGetGCPriv(pGC) \
dixLookupPrivate(&(pGC)->devPrivates, damageGCPrivateKey)
#define damageGCPriv(pGC) \
DamageGCPrivPtr pGCPriv = damageGetGCPriv(pGC)
#define damageGetWinPriv(pWin) \
((DamagePtr)dixLookupPrivate(&(pWin)->devPrivates, damageWinPrivateKey))
#define damageSetWinPriv(pWin,d) \
dixSetPrivate(&(pWin)->devPrivates, damageWinPrivateKey, d)
#endif