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