damageextint.h revision 4642e01f
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#define NEED_EVENTS
3105b261ecSmrg#include <X11/X.h>
3205b261ecSmrg#include <X11/Xproto.h>
3305b261ecSmrg#include "misc.h"
3405b261ecSmrg#include "os.h"
3505b261ecSmrg#include "dixstruct.h"
3605b261ecSmrg#include "extnsionst.h"
3705b261ecSmrg#include <X11/extensions/damageproto.h>
3805b261ecSmrg#include "windowstr.h"
3905b261ecSmrg#include "selection.h"
4005b261ecSmrg#include "scrnintstr.h"
4105b261ecSmrg#include "damageext.h"
4205b261ecSmrg#include "damage.h"
4305b261ecSmrg#include "xfixes.h"
4405b261ecSmrg
4505b261ecSmrgtypedef struct _DamageClient {
4605b261ecSmrg    CARD32	major_version;
4705b261ecSmrg    CARD32	minor_version;
4805b261ecSmrg    int		critical;
4905b261ecSmrg} DamageClientRec, *DamageClientPtr;
5005b261ecSmrg
514642e01fSmrg#define GetDamageClient(pClient) ((DamageClientPtr)dixLookupPrivate(&(pClient)->devPrivates, DamageClientPrivateKey))
5205b261ecSmrg
5305b261ecSmrgtypedef struct _DamageExt {
5405b261ecSmrg    DamagePtr		pDamage;
5505b261ecSmrg    DrawablePtr		pDrawable;
5605b261ecSmrg    DamageReportLevel	level;
5705b261ecSmrg    ClientPtr		pClient;
5805b261ecSmrg    XID			id;
5905b261ecSmrg} DamageExtRec, *DamageExtPtr;
6005b261ecSmrg
6105b261ecSmrg#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
6205b261ecSmrg    pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
6305b261ecSmrg    if (!pDamageExt) { \
6405b261ecSmrg	client->errorValue = rid; \
6505b261ecSmrg	return DamageErrorBase + BadDamage; \
6605b261ecSmrg    } \
6705b261ecSmrg}
6805b261ecSmrg
6905b261ecSmrgvoid
7005b261ecSmrgDamageExtSetCritical (ClientPtr pClient, Bool critical);
7105b261ecSmrg
7205b261ecSmrg#endif /* _DAMAGEEXTINT_H_ */
73