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