117ca54c3Smrg/* 217ca54c3Smrg * Copyright © 2003 Keith Packard 317ca54c3Smrg * Copyright © 2007 Eric Anholt 417ca54c3Smrg * 517ca54c3Smrg * Permission to use, copy, modify, distribute, and sell this software and its 617ca54c3Smrg * documentation for any purpose is hereby granted without fee, provided that 717ca54c3Smrg * the above copyright notice appear in all copies and that both that 817ca54c3Smrg * copyright notice and this permission notice appear in supporting 917ca54c3Smrg * documentation, and that the name of Keith Packard not be used in 1017ca54c3Smrg * advertising or publicity pertaining to distribution of the software without 1117ca54c3Smrg * specific, written prior permission. Keith Packard makes no 1217ca54c3Smrg * representations about the suitability of this software for any purpose. It 1317ca54c3Smrg * is provided "as is" without express or implied warranty. 1417ca54c3Smrg * 1517ca54c3Smrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 1617ca54c3Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 1717ca54c3Smrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 1817ca54c3Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 1917ca54c3Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 2017ca54c3Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 2117ca54c3Smrg * PERFORMANCE OF THIS SOFTWARE. 2217ca54c3Smrg */ 2317ca54c3Smrg 2417ca54c3Smrg#ifndef _DAMAGEPROTO_H_ 2517ca54c3Smrg#define _DAMAGEPROTO_H_ 2617ca54c3Smrg 2717ca54c3Smrg#include <X11/Xmd.h> 2817ca54c3Smrg#include <X11/extensions/xfixesproto.h> 2917ca54c3Smrg#include <X11/extensions/damagewire.h> 3017ca54c3Smrg 3117ca54c3Smrg#define Window CARD32 3217ca54c3Smrg#define Drawable CARD32 3317ca54c3Smrg#define Font CARD32 3417ca54c3Smrg#define Pixmap CARD32 3517ca54c3Smrg#define Cursor CARD32 3617ca54c3Smrg#define Colormap CARD32 3717ca54c3Smrg#define GContext CARD32 3817ca54c3Smrg#define Atom CARD32 3917ca54c3Smrg#define VisualID CARD32 4017ca54c3Smrg#define Time CARD32 4117ca54c3Smrg#define KeyCode CARD8 4217ca54c3Smrg#define KeySym CARD32 4317ca54c3Smrg#define Picture CARD32 4417ca54c3Smrg#define Region CARD32 4517ca54c3Smrg#define Damage CARD32 4617ca54c3Smrg 4717ca54c3Smrg/************** Version 0 ******************/ 4817ca54c3Smrg 4917ca54c3Smrgtypedef struct { 5017ca54c3Smrg CARD8 reqType; 5117ca54c3Smrg CARD8 damageReqType; 52ea1d6981Smrg CARD16 length; 5317ca54c3Smrg} xDamageReq; 5417ca54c3Smrg 55ea1d6981Smrg/* 5617ca54c3Smrg * requests and replies 5717ca54c3Smrg */ 5817ca54c3Smrg 5917ca54c3Smrgtypedef struct { 6017ca54c3Smrg CARD8 reqType; 6117ca54c3Smrg CARD8 damageReqType; 62ea1d6981Smrg CARD16 length; 63ea1d6981Smrg CARD32 majorVersion; 64ea1d6981Smrg CARD32 minorVersion; 6517ca54c3Smrg} xDamageQueryVersionReq; 6617ca54c3Smrg 6717ca54c3Smrg#define sz_xDamageQueryVersionReq 12 6817ca54c3Smrg 6917ca54c3Smrgtypedef struct { 7017ca54c3Smrg BYTE type; /* X_Reply */ 7117ca54c3Smrg BYTE pad1; 72ea1d6981Smrg CARD16 sequenceNumber; 73ea1d6981Smrg CARD32 length; 74ea1d6981Smrg CARD32 majorVersion; 75ea1d6981Smrg CARD32 minorVersion; 76ea1d6981Smrg CARD32 pad2; 77ea1d6981Smrg CARD32 pad3; 78ea1d6981Smrg CARD32 pad4; 79ea1d6981Smrg CARD32 pad5; 8017ca54c3Smrg} xDamageQueryVersionReply; 8117ca54c3Smrg 8217ca54c3Smrg#define sz_xDamageQueryVersionReply 32 8317ca54c3Smrg 8417ca54c3Smrgtypedef struct { 8517ca54c3Smrg CARD8 reqType; 8617ca54c3Smrg CARD8 damageReqType; 87ea1d6981Smrg CARD16 length; 88ea1d6981Smrg Damage damage; 89ea1d6981Smrg Drawable drawable; 9017ca54c3Smrg CARD8 level; 9117ca54c3Smrg CARD8 pad1; 92ea1d6981Smrg CARD16 pad2; 9317ca54c3Smrg} xDamageCreateReq; 9417ca54c3Smrg 9517ca54c3Smrg#define sz_xDamageCreateReq 16 9617ca54c3Smrg 9717ca54c3Smrgtypedef struct { 9817ca54c3Smrg CARD8 reqType; 9917ca54c3Smrg CARD8 damageReqType; 100ea1d6981Smrg CARD16 length; 101ea1d6981Smrg Damage damage; 10217ca54c3Smrg} xDamageDestroyReq; 10317ca54c3Smrg 10417ca54c3Smrg#define sz_xDamageDestroyReq 8 10517ca54c3Smrg 10617ca54c3Smrgtypedef struct { 10717ca54c3Smrg CARD8 reqType; 10817ca54c3Smrg CARD8 damageReqType; 109ea1d6981Smrg CARD16 length; 110ea1d6981Smrg Damage damage; 111ea1d6981Smrg Region repair; 112ea1d6981Smrg Region parts; 11317ca54c3Smrg} xDamageSubtractReq; 11417ca54c3Smrg 11517ca54c3Smrg#define sz_xDamageSubtractReq 16 11617ca54c3Smrg 11717ca54c3Smrgtypedef struct { 11817ca54c3Smrg CARD8 reqType; 11917ca54c3Smrg CARD8 damageReqType; 120ea1d6981Smrg CARD16 length; 121ea1d6981Smrg Drawable drawable; 122ea1d6981Smrg Region region; 12317ca54c3Smrg} xDamageAddReq; 12417ca54c3Smrg 12517ca54c3Smrg#define sz_xDamageAddReq 12 12617ca54c3Smrg 12717ca54c3Smrg/* Events */ 12817ca54c3Smrg 12917ca54c3Smrg#define DamageNotifyMore 0x80 13017ca54c3Smrg 13117ca54c3Smrgtypedef struct { 13217ca54c3Smrg CARD8 type; 13317ca54c3Smrg CARD8 level; 134ea1d6981Smrg CARD16 sequenceNumber; 135ea1d6981Smrg Drawable drawable; 136ea1d6981Smrg Damage damage; 137ea1d6981Smrg Time timestamp; 13817ca54c3Smrg xRectangle area; 13917ca54c3Smrg xRectangle geometry; 14017ca54c3Smrg} xDamageNotifyEvent; 14117ca54c3Smrg 14217ca54c3Smrg#undef Damage 14317ca54c3Smrg#undef Region 14417ca54c3Smrg#undef Picture 14517ca54c3Smrg#undef Window 14617ca54c3Smrg#undef Drawable 14717ca54c3Smrg#undef Font 14817ca54c3Smrg#undef Pixmap 14917ca54c3Smrg#undef Cursor 15017ca54c3Smrg#undef Colormap 15117ca54c3Smrg#undef GContext 15217ca54c3Smrg#undef Atom 15317ca54c3Smrg#undef VisualID 15417ca54c3Smrg#undef Time 15517ca54c3Smrg#undef KeyCode 15617ca54c3Smrg#undef KeySym 15717ca54c3Smrg 15817ca54c3Smrg#endif /* _DAMAGEPROTO_H_ */ 159