1706f2543Smrg/*
2706f2543Smrg * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
3706f2543Smrg *
4706f2543Smrg * All Rights Reserved.
5706f2543Smrg *
6706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining
7706f2543Smrg * a copy of this software and associated documentation files (the
8706f2543Smrg * "Software"), to deal in the Software without restriction, including
9706f2543Smrg * without limitation on the rights to use, copy, modify, merge,
10706f2543Smrg * publish, distribute, sublicense, and/or sell copies of the Software,
11706f2543Smrg * and to permit persons to whom the Software is furnished to do so,
12706f2543Smrg * subject to the following conditions:
13706f2543Smrg *
14706f2543Smrg * The above copyright notice and this permission notice (including the
15706f2543Smrg * next paragraph) shall be included in all copies or substantial
16706f2543Smrg * portions of the Software.
17706f2543Smrg *
18706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19706f2543Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20706f2543Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21706f2543Smrg * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22706f2543Smrg * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23706f2543Smrg * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24706f2543Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25706f2543Smrg * SOFTWARE.
26706f2543Smrg */
27706f2543Smrg
28706f2543Smrg/*
29706f2543Smrg * Authors:
30706f2543Smrg *   Kevin E. Martin <kem@redhat.com>
31706f2543Smrg *
32706f2543Smrg */
33706f2543Smrg
34706f2543Smrg/** \file
35706f2543Smrg *  This file provides access to the externally visible RENDER support
36706f2543Smrg *  functions, global variables and macros for DMX.
37706f2543Smrg *
38706f2543Smrg *  FIXME: Move function definitions for non-externally visible function
39706f2543Smrg *  to .c file. */
40706f2543Smrg
41706f2543Smrg#ifndef DMXPICT_H
42706f2543Smrg#define DMXPICT_H
43706f2543Smrg
44706f2543Smrg/** Picture private structure */
45706f2543Smrgtypedef struct _dmxPictPriv {
46706f2543Smrg    Picture  pict;		/**< Picture ID from back-end server */
47706f2543Smrg    Mask     savedMask;         /**< Mask of picture attributes saved for
48706f2543Smrg				 *   lazy window creation. */
49706f2543Smrg} dmxPictPrivRec, *dmxPictPrivPtr;
50706f2543Smrg
51706f2543Smrg
52706f2543Smrg/** Glyph Set private structure */
53706f2543Smrgtypedef struct _dmxGlyphPriv {
54706f2543Smrg    GlyphSet  *glyphSets; /**< Glyph Set IDs from back-end server */
55706f2543Smrg} dmxGlyphPrivRec, *dmxGlyphPrivPtr;
56706f2543Smrg
57706f2543Smrg
58706f2543Smrgextern void dmxInitRender(void);
59706f2543Smrgextern void dmxResetRender(void);
60706f2543Smrg
61706f2543Smrgextern Bool dmxPictureInit(ScreenPtr pScreen,
62706f2543Smrg			   PictFormatPtr formats, int nformats);
63706f2543Smrg
64706f2543Smrgextern void dmxCreatePictureList(WindowPtr pWindow);
65706f2543Smrgextern Bool dmxDestroyPictureList(WindowPtr pWindow);
66706f2543Smrg
67706f2543Smrgextern int dmxCreatePicture(PicturePtr pPicture);
68706f2543Smrgextern void dmxDestroyPicture(PicturePtr pPicture);
69706f2543Smrgextern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
70706f2543Smrg				pointer value, int n);
71706f2543Smrgextern void dmxDestroyPictureClip(PicturePtr pPicture);
72706f2543Smrgextern void dmxChangePicture(PicturePtr pPicture, Mask mask);
73706f2543Smrgextern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
74706f2543Smrgextern void dmxComposite(CARD8 op,
75706f2543Smrg			 PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
76706f2543Smrg			 INT16 xSrc, INT16 ySrc,
77706f2543Smrg			 INT16 xMask, INT16 yMask,
78706f2543Smrg			 INT16 xDst, INT16 yDst,
79706f2543Smrg			 CARD16 width, CARD16 height);
80706f2543Smrgextern void dmxGlyphs(CARD8 op,
81706f2543Smrg		      PicturePtr pSrc, PicturePtr pDst,
82706f2543Smrg		      PictFormatPtr maskFormat,
83706f2543Smrg		      INT16 xSrc, INT16 ySrc,
84706f2543Smrg		      int nlists, GlyphListPtr lists, GlyphPtr *glyphs);
85706f2543Smrgextern void dmxCompositeRects(CARD8 op,
86706f2543Smrg			      PicturePtr pDst,
87706f2543Smrg			      xRenderColor *color,
88706f2543Smrg			      int nRect, xRectangle *rects);
89706f2543Smrgextern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
90706f2543Smrgextern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
91706f2543Smrgextern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
92706f2543Smrg			     int ndef, xColorItem *pdef);
93706f2543Smrgextern void dmxTrapezoids(CARD8 op,
94706f2543Smrg			  PicturePtr pSrc, PicturePtr pDst,
95706f2543Smrg			  PictFormatPtr maskFormat,
96706f2543Smrg			  INT16 xSrc, INT16 ySrc,
97706f2543Smrg			  int ntrap, xTrapezoid *traps);
98706f2543Smrgextern void dmxTriangles(CARD8 op,
99706f2543Smrg			 PicturePtr pSrc, PicturePtr pDst,
100706f2543Smrg			 PictFormatPtr maskFormat,
101706f2543Smrg			 INT16 xSrc, INT16 ySrc,
102706f2543Smrg			 int ntri, xTriangle *tris);
103706f2543Smrgextern void dmxTriStrip(CARD8 op,
104706f2543Smrg			PicturePtr pSrc, PicturePtr pDst,
105706f2543Smrg			PictFormatPtr maskFormat,
106706f2543Smrg			INT16 xSrc, INT16 ySrc,
107706f2543Smrg			int npoint, xPointFixed *points);
108706f2543Smrgextern void dmxTriFan(CARD8 op,
109706f2543Smrg		      PicturePtr pSrc, PicturePtr pDst,
110706f2543Smrg		      PictFormatPtr maskFormat,
111706f2543Smrg		      INT16 xSrc, INT16 ySrc,
112706f2543Smrg		      int npoint, xPointFixed *points);
113706f2543Smrg
114706f2543Smrgextern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
115706f2543Smrgextern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
116706f2543Smrgextern int dmxBECreatePicture(PicturePtr pPicture);
117706f2543Smrgextern Bool dmxBEFreePicture(PicturePtr pPicture);
118706f2543Smrg
119706f2543Smrg/** Get the picture private data given a picture pointer */
120706f2543Smrg#define DMX_GET_PICT_PRIV(_pPict)					\
121706f2543Smrg    (dmxPictPrivPtr)dixLookupPrivate(&(_pPict)->devPrivates, dmxPictPrivateKey)
122706f2543Smrg
123706f2543Smrg/** Set the glyphset private data given a glyphset pointer */
124706f2543Smrg#define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv)				\
125706f2543Smrg    GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateKey, (_pPriv))
126706f2543Smrg/** Get the glyphset private data given a glyphset pointer */
127706f2543Smrg#define DMX_GET_GLYPH_PRIV(_pGlyph)					\
128706f2543Smrg    (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey)
129706f2543Smrg
130706f2543Smrg#endif /* DMXPICT_H */
131