damageextint.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright © 2002 Keith Packard
  3. *
  4. * Permission to use, copy, modify, distribute, and sell this software and its
  5. * documentation for any purpose is hereby granted without fee, provided that
  6. * the above copyright notice appear in all copies and that both that
  7. * copyright notice and this permission notice appear in supporting
  8. * documentation, and that the name of Keith Packard not be used in
  9. * advertising or publicity pertaining to distribution of the software without
  10. * specific, written prior permission. Keith Packard makes no
  11. * representations about the suitability of this software for any purpose. It
  12. * is provided "as is" without express or implied warranty.
  13. *
  14. * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  16. * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. #ifdef HAVE_DIX_CONFIG_H
  23. #include <dix-config.h>
  24. #endif
  25. #ifndef _DAMAGEEXTINT_H_
  26. #define _DAMAGEEXTINT_H_
  27. #include <X11/X.h>
  28. #include <X11/Xproto.h>
  29. #include "misc.h"
  30. #include "os.h"
  31. #include "dixstruct.h"
  32. #include "extnsionst.h"
  33. #include <X11/extensions/damageproto.h>
  34. #include "windowstr.h"
  35. #include "selection.h"
  36. #include "scrnintstr.h"
  37. #include "damageext.h"
  38. #include "damage.h"
  39. #include "xfixes.h"
  40. extern unsigned char DamageReqCode;
  41. extern int DamageEventBase;
  42. extern int DamageErrorBase;
  43. extern int DamageClientPrivateIndex;
  44. extern RESTYPE DamageExtType;
  45. extern RESTYPE DamageExtWinType;
  46. typedef struct _DamageClient {
  47. CARD32 major_version;
  48. CARD32 minor_version;
  49. int critical;
  50. } DamageClientRec, *DamageClientPtr;
  51. #define GetDamageClient(pClient) ((DamageClientPtr) (pClient)->devPrivates[DamageClientPrivateIndex].ptr)
  52. typedef struct _DamageExt {
  53. DamagePtr pDamage;
  54. DrawablePtr pDrawable;
  55. DamageReportLevel level;
  56. ClientPtr pClient;
  57. XID id;
  58. XID drawable;
  59. } DamageExtRec, *DamageExtPtr;
  60. extern int (*ProcDamageVector[ /*XDamageNumberRequests */ ]) (ClientPtr);
  61. extern int (*SProcDamageVector[ /*XDamageNumberRequests */ ]) (ClientPtr);
  62. #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
  63. pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
  64. if (!pDamageExt) { \
  65. client->errorValue = rid; \
  66. return DamageErrorBase + BadDamage; \
  67. } \
  68. }
  69. void
  70. SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to);
  71. void
  72. DamageExtSetCritical(ClientPtr pClient, Bool critical);
  73. #endif /* _DAMAGEEXTINT_H_ */