105b261ecSmrg/*
205b261ecSmrg * Copyright © 2002 Keith Packard
305b261ecSmrg *
405b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
505b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
605b261ecSmrg * the above copyright notice appear in all copies and that both that
705b261ecSmrg * copyright notice and this permission notice appear in supporting
805b261ecSmrg * documentation, and that the name of Keith Packard not be used in
905b261ecSmrg * advertising or publicity pertaining to distribution of the software without
1005b261ecSmrg * specific, written prior permission.  Keith Packard makes no
1105b261ecSmrg * representations about the suitability of this software for any purpose.  It
1205b261ecSmrg * is provided "as is" without express or implied warranty.
1305b261ecSmrg *
1405b261ecSmrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1505b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1605b261ecSmrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1705b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1805b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1905b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2005b261ecSmrg * PERFORMANCE OF THIS SOFTWARE.
2105b261ecSmrg */
2205b261ecSmrg
2305b261ecSmrg#ifdef HAVE_DIX_CONFIG_H
2405b261ecSmrg#include <dix-config.h>
2505b261ecSmrg#endif
2605b261ecSmrg
2705b261ecSmrg#ifndef _DAMAGEEXTINT_H_
2805b261ecSmrg#define _DAMAGEEXTINT_H_
2905b261ecSmrg
3005b261ecSmrg#include <X11/X.h>
3105b261ecSmrg#include <X11/Xproto.h>
3205b261ecSmrg#include "misc.h"
3305b261ecSmrg#include "os.h"
3405b261ecSmrg#include "dixstruct.h"
3505b261ecSmrg#include "extnsionst.h"
3605b261ecSmrg#include <X11/extensions/damageproto.h>
3705b261ecSmrg#include "windowstr.h"
3805b261ecSmrg#include "selection.h"
3905b261ecSmrg#include "scrnintstr.h"
4035c4bbdfSmrg#include "damage.h"
4105b261ecSmrg#include "xfixes.h"
4205b261ecSmrg
4305b261ecSmrgtypedef struct _DamageClient {
4435c4bbdfSmrg    CARD32 major_version;
4535c4bbdfSmrg    CARD32 minor_version;
4635c4bbdfSmrg    int critical;
4705b261ecSmrg} DamageClientRec, *DamageClientPtr;
4805b261ecSmrg
494642e01fSmrg#define GetDamageClient(pClient) ((DamageClientPtr)dixLookupPrivate(&(pClient)->devPrivates, DamageClientPrivateKey))
5005b261ecSmrg
5105b261ecSmrgtypedef struct _DamageExt {
5235c4bbdfSmrg    DamagePtr pDamage;
5335c4bbdfSmrg    DrawablePtr pDrawable;
5435c4bbdfSmrg    DamageReportLevel level;
5535c4bbdfSmrg    ClientPtr pClient;
5635c4bbdfSmrg    XID id;
5735c4bbdfSmrg    XID drawable;
5805b261ecSmrg} DamageExtRec, *DamageExtPtr;
5905b261ecSmrg
6005b261ecSmrg#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
6135c4bbdfSmrg    int rc = dixLookupResourceByType((void **)&(pDamageExt), rid, \
626747b715Smrg                                     DamageExtType, client, mode); \
636747b715Smrg    if (rc != Success) \
646747b715Smrg        return rc; \
6505b261ecSmrg}
6605b261ecSmrg
6705b261ecSmrgvoid
6835c4bbdfSmrg DamageExtSetCritical(ClientPtr pClient, Bool critical);
6905b261ecSmrg
7035c4bbdfSmrgvoid PanoramiXDamageInit(void);
7135c4bbdfSmrgvoid PanoramiXDamageReset(void);
7235c4bbdfSmrg
7335c4bbdfSmrg#endif                          /* _DAMAGEEXTINT_H_ */
74