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