deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* $XFree86$ */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * All Rights Reserved.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * a copy of this software and associated documentation files (the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * "Software"), to deal in the Software without restriction, including
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * without limitation on the rights to use, copy, modify, merge,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and to permit persons to whom the Software is furnished to do so,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice (including the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * next paragraph) shall be included in all copies or substantial
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Authors:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Kevin E. Martin <kem@redhat.com>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** \file
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This file provides access to the externally visible RENDER support
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * functions, global variables and macros for DMX.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FIXME: Move function definitions for non-externally visible function
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * to .c file. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef DMXPICT_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMXPICT_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Picture private structure */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _dmxPictPriv {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Picture pict; /**< Picture ID from back-end server */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Mask savedMask; /**< Mask of picture attributes saved for
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * lazy window creation. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} dmxPictPrivRec, *dmxPictPrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Glyph Set private structure */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _dmxGlyphPriv {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} dmxGlyphPrivRec, *dmxGlyphPrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxInitRender(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxResetRender(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxPictureInit(ScreenPtr pScreen,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr formats, int nformats);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxCreatePictureList(WindowPtr pWindow);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxDestroyPictureList(WindowPtr pWindow);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxCreatePicture(PicturePtr pPicture);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxDestroyPicture(PicturePtr pPicture);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pointer value, int n);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxDestroyPictureClip(PicturePtr pPicture);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxChangePicture(PicturePtr pPicture, Mask mask);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxComposite(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xMask, INT16 yMask,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xDst, INT16 yDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD16 width, CARD16 height);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxGlyphs(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr maskFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int nlists, GlyphListPtr lists, GlyphPtr *glyphs);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxCompositeRects(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync xRenderColor *color,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int nRect, xRectangle *rects);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int ndef, xColorItem *pdef);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxTrapezoids(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr maskFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int ntrap, xTrapezoid *traps);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxTriangles(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr maskFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int ntri, xTriangle *tris);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxTriStrip(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr maskFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int npoint, xPointFixed *points);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxTriFan(CARD8 op,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PicturePtr pSrc, PicturePtr pDst,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PictFormatPtr maskFormat,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync INT16 xSrc, INT16 ySrc,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int npoint, xPointFixed *points);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxBECreatePicture(PicturePtr pPicture);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxBEFreePicture(PicturePtr pPicture);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxPictPrivateIndex; /**< Index for picture private data */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxGlyphSetPrivateIndex; /**< Index for glyphset private data */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Get the picture private data given a picture pointer */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_GET_PICT_PRIV(_pPict) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (dmxPictPrivPtr)(_pPict)->devPrivates[dmxPictPrivateIndex].ptr
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Set the glyphset private data given a glyphset pointer */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateIndex, (_pPriv))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Get the glyphset private data given a glyphset pointer */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_GET_GLYPH_PRIV(_pGlyph) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateIndex)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* DMXPICT_H */