Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / dmx / dmxpict.h
CommitLineData
a09e091a
JB
1/*
2 * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
3 *
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation on the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
28/*
29 * Authors:
30 * Kevin E. Martin <kem@redhat.com>
31 *
32 */
33
34/** \file
35 * This file provides access to the externally visible RENDER support
36 * functions, global variables and macros for DMX.
37 *
38 * FIXME: Move function definitions for non-externally visible function
39 * to .c file. */
40
41#ifndef DMXPICT_H
42#define DMXPICT_H
43
44/** Picture private structure */
45typedef struct _dmxPictPriv {
46 Picture pict; /**< Picture ID from back-end server */
47 Mask savedMask; /**< Mask of picture attributes saved for
48 * lazy window creation. */
49} dmxPictPrivRec, *dmxPictPrivPtr;
50
51/** Glyph Set private structure */
52typedef struct _dmxGlyphPriv {
53 GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
54} dmxGlyphPrivRec, *dmxGlyphPrivPtr;
55
56extern void dmxInitRender(void);
57extern void dmxResetRender(void);
58
59extern Bool dmxPictureInit(ScreenPtr pScreen,
60 PictFormatPtr formats, int nformats);
61
62extern void dmxCreatePictureList(WindowPtr pWindow);
63extern Bool dmxDestroyPictureList(WindowPtr pWindow);
64
65extern int dmxCreatePicture(PicturePtr pPicture);
66extern void dmxDestroyPicture(PicturePtr pPicture);
67extern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
68 pointer value, int n);
69extern void dmxDestroyPictureClip(PicturePtr pPicture);
70extern void dmxChangePicture(PicturePtr pPicture, Mask mask);
71extern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
72extern void dmxComposite(CARD8 op,
73 PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
74 INT16 xSrc, INT16 ySrc,
75 INT16 xMask, INT16 yMask,
76 INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
77extern void dmxGlyphs(CARD8 op,
78 PicturePtr pSrc, PicturePtr pDst,
79 PictFormatPtr maskFormat,
80 INT16 xSrc, INT16 ySrc,
81 int nlists, GlyphListPtr lists, GlyphPtr * glyphs);
82extern void dmxCompositeRects(CARD8 op,
83 PicturePtr pDst,
84 xRenderColor * color,
85 int nRect, xRectangle *rects);
86extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
87extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
88extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
89 int ndef, xColorItem * pdef);
90extern void dmxTrapezoids(CARD8 op,
91 PicturePtr pSrc, PicturePtr pDst,
92 PictFormatPtr maskFormat,
93 INT16 xSrc, INT16 ySrc,
94 int ntrap, xTrapezoid * traps);
95extern void dmxTriangles(CARD8 op,
96 PicturePtr pSrc, PicturePtr pDst,
97 PictFormatPtr maskFormat,
98 INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris);
99
100extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
101extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
102extern int dmxBECreatePicture(PicturePtr pPicture);
103extern Bool dmxBEFreePicture(PicturePtr pPicture);
104
105/** Get the picture private data given a picture pointer */
106#define DMX_GET_PICT_PRIV(_pPict) \
107 (dmxPictPrivPtr)dixLookupPrivate(&(_pPict)->devPrivates, dmxPictPrivateKey)
108
109/** Set the glyphset private data given a glyphset pointer */
110#define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \
111 GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateKey, (_pPriv))
112/** Get the glyphset private data given a glyphset pointer */
113#define DMX_GET_GLYPH_PRIV(_pGlyph) \
114 (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey)
115
116#endif /* DMXPICT_H */