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