tizen 2.4 release
[framework/uifw/xorg/server/xorg-server.git] / hw / dmx / dmxpict.h
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 */
45 typedef 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 */
52 typedef struct _dmxGlyphPriv {
53     GlyphSet *glyphSets;  /**< Glyph Set IDs from back-end server */
54 } dmxGlyphPrivRec, *dmxGlyphPrivPtr;
55
56 extern void dmxInitRender(void);
57 extern void dmxResetRender(void);
58
59 extern Bool dmxPictureInit(ScreenPtr pScreen,
60                            PictFormatPtr formats, int nformats);
61
62 extern void dmxCreatePictureList(WindowPtr pWindow);
63 extern Bool dmxDestroyPictureList(WindowPtr pWindow);
64
65 extern int dmxCreatePicture(PicturePtr pPicture);
66 extern void dmxDestroyPicture(PicturePtr pPicture);
67 extern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
68                                 void *value, int n);
69 extern void dmxDestroyPictureClip(PicturePtr pPicture);
70 extern void dmxChangePicture(PicturePtr pPicture, Mask mask);
71 extern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
72 extern 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);
77 extern void dmxGlyphs(CARD8 op,
78                       PicturePtr pSrc, PicturePtr pDst,
79                       PictFormatPtr maskFormat,
80                       INT16 xSrc, INT16 ySrc,
81                       int nlists, GlyphListPtr lists, GlyphPtr * glyphs);
82 extern void dmxCompositeRects(CARD8 op,
83                               PicturePtr pDst,
84                               xRenderColor * color,
85                               int nRect, xRectangle *rects);
86 extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
87 extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
88 extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
89                              int ndef, xColorItem * pdef);
90 extern void dmxTrapezoids(CARD8 op,
91                           PicturePtr pSrc, PicturePtr pDst,
92                           PictFormatPtr maskFormat,
93                           INT16 xSrc, INT16 ySrc,
94                           int ntrap, xTrapezoid * traps);
95 extern void dmxTriangles(CARD8 op,
96                          PicturePtr pSrc, PicturePtr pDst,
97                          PictFormatPtr maskFormat,
98                          INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris);
99
100 extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
101 extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
102 extern int dmxBECreatePicture(PicturePtr pPicture);
103 extern 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 */