45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 2002 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 _DAMAGEEXTINT_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _DAMAGEEXTINT_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/X.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xproto.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "misc.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "os.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "dixstruct.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "extnsionst.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/extensions/damageproto.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "windowstr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "selection.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "scrnintstr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "damageext.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "damage.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "xfixes.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DamageClient {
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 major_version;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 minor_version;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int critical;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DamageClientRec, *DamageClientPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GetDamageClient(pClient) ((DamageClientPtr)dixLookupPrivate(&(pClient)->devPrivates, DamageClientPrivateKey))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DamageExt {
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamagePtr pDamage;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DrawablePtr pDrawable;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageReportLevel level;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr pClient;
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DamageExtRec, *DamageExtPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync int rc = dixLookupResourceByType((pointer *)&(pDamageExt), rid, \
45e9809aff7304721fddb95654901b32195c9c7avboxsync DamageExtType, client, mode); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (rc != Success) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync return (rc == BadValue) ? DamageErrorBase + BadDamage : rc; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync}
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDamageExtSetCritical (ClientPtr pClient, Bool critical);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _DAMAGEEXTINT_H_ */