dmxpict.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
  3. *
  4. * All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining
  7. * a copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation on the rights to use, copy, modify, merge,
  10. * publish, distribute, sublicense, and/or sell copies of the Software,
  11. * and to permit persons to whom the Software is furnished to do so,
  12. * subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice (including the
  15. * next paragraph) shall be included in all copies or substantial
  16. * portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  19. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  21. * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
  22. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  23. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  24. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. * SOFTWARE.
  26. */
  27. /*
  28. * Authors:
  29. * Kevin E. Martin <kem@redhat.com>
  30. *
  31. */
  32. /** \file
  33. * This file provides access to the externally visible RENDER support
  34. * functions, global variables and macros for DMX.
  35. *
  36. * FIXME: Move function definitions for non-externally visible function
  37. * to .c file. */
  38. #ifndef DMXPICT_H
  39. #define DMXPICT_H
  40. /** Picture private structure */
  41. typedef struct _dmxPictPriv {
  42. Picture pict; /**< Picture ID from back-end server */
  43. Mask savedMask; /**< Mask of picture attributes saved for
  44. * lazy window creation. */
  45. } dmxPictPrivRec, *dmxPictPrivPtr;
  46. /** Glyph Set private structure */
  47. typedef struct _dmxGlyphPriv {
  48. GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
  49. } dmxGlyphPrivRec, *dmxGlyphPrivPtr;
  50. extern void dmxInitRender(void);
  51. extern void dmxResetRender(void);
  52. extern Bool dmxPictureInit(ScreenPtr pScreen,
  53. PictFormatPtr formats, int nformats);
  54. extern void dmxCreatePictureList(WindowPtr pWindow);
  55. extern Bool dmxDestroyPictureList(WindowPtr pWindow);
  56. extern int dmxCreatePicture(PicturePtr pPicture);
  57. extern void dmxDestroyPicture(PicturePtr pPicture);
  58. extern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
  59. void *value, int n);
  60. extern void dmxDestroyPictureClip(PicturePtr pPicture);
  61. extern void dmxChangePicture(PicturePtr pPicture, Mask mask);
  62. extern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
  63. extern void dmxComposite(CARD8 op,
  64. PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
  65. INT16 xSrc, INT16 ySrc,
  66. INT16 xMask, INT16 yMask,
  67. INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
  68. extern void dmxGlyphs(CARD8 op,
  69. PicturePtr pSrc, PicturePtr pDst,
  70. PictFormatPtr maskFormat,
  71. INT16 xSrc, INT16 ySrc,
  72. int nlists, GlyphListPtr lists, GlyphPtr * glyphs);
  73. extern void dmxCompositeRects(CARD8 op,
  74. PicturePtr pDst,
  75. xRenderColor * color,
  76. int nRect, xRectangle *rects);
  77. extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
  78. extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
  79. extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
  80. int ndef, xColorItem * pdef);
  81. extern void dmxTrapezoids(CARD8 op,
  82. PicturePtr pSrc, PicturePtr pDst,
  83. PictFormatPtr maskFormat,
  84. INT16 xSrc, INT16 ySrc,
  85. int ntrap, xTrapezoid * traps);
  86. extern void dmxTriangles(CARD8 op,
  87. PicturePtr pSrc, PicturePtr pDst,
  88. PictFormatPtr maskFormat,
  89. INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris);
  90. extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
  91. extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
  92. extern int dmxBECreatePicture(PicturePtr pPicture);
  93. extern Bool dmxBEFreePicture(PicturePtr pPicture);
  94. /** Get the picture private data given a picture pointer */
  95. #define DMX_GET_PICT_PRIV(_pPict) \
  96. (dmxPictPrivPtr)dixLookupPrivate(&(_pPict)->devPrivates, dmxPictPrivateKey)
  97. /** Set the glyphset private data given a glyphset pointer */
  98. #define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \
  99. GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateKey, (_pPriv))
  100. /** Get the glyphset private data given a glyphset pointer */
  101. #define DMX_GET_GLYPH_PRIV(_pGlyph) \
  102. (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey)
  103. #endif /* DMXPICT_H */