xref: /reactos/win32ss/gdi/eng/inteng.h (revision 8a978a17)
1 #pragma once
2 
3 typedef ULONG HCLIP;
4 
5 #define ENUM_RECT_LIMIT 32
6 
7 typedef struct _RECT_ENUM
8 {
9   ULONG c;
10   RECTL arcl[ENUM_RECT_LIMIT];
11 } RECT_ENUM;
12 
13 typedef struct tagSPAN
14 {
15   LONG Y;
16   LONG X;
17   ULONG Width;
18 } SPAN, *PSPAN;
19 
20 enum _R3_ROPCODES
21 {
22     R3_OPINDEX_NOOP         = 0xAA,
23     R3_OPINDEX_BLACKNESS    = 0x00,
24     R3_OPINDEX_NOTSRCERASE  = 0x11,
25     R3_OPINDEX_NOTSRCCOPY   = 0x33,
26     R3_OPINDEX_SRCERASE     = 0x44,
27     R3_OPINDEX_DSTINVERT    = 0x55,
28     R3_OPINDEX_PATINVERT    = 0x5A,
29     R3_OPINDEX_SRCINVERT    = 0x66,
30     R3_OPINDEX_SRCAND       = 0x88,
31     R3_OPINDEX_MERGEPAINT   = 0xBB,
32     R3_OPINDEX_MERGECOPY    = 0xC0,
33     R3_OPINDEX_SRCCOPY      = 0xCC,
34     R3_OPINDEX_SRCPAINT     = 0xEE,
35     R3_OPINDEX_PATCOPY      = 0xF0,
36     R3_OPINDEX_PATPAINT     = 0xFB,
37     R3_OPINDEX_WHITENESS    = 0xFF
38 };
39 
40 #define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2))
41 
42 #define ROP4_FROM_INDEX(index) ((index) | ((index) << 8))
43 
44 #define ROP4_USES_DEST(Rop4)    ((((Rop4) & 0xAAAA) >> 1) != ((Rop4) & 0x5555))
45 #define ROP4_USES_SOURCE(Rop4)  ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333))
46 #define ROP4_USES_PATTERN(Rop4) ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F))
47 #define ROP4_USES_MASK(Rop4)    ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff))
48 
49 #define IS_VALID_ROP4(rop) (((rop) & 0xFFFF0000) == 0)
50 
51 #define ROP4_FGND(Rop4)    ((Rop4) & 0x00FF)
52 #define ROP4_BKGND(Rop4)    (((Rop4) & 0xFF00) >> 8)
53 
54 #define ROP4_NOOP (R3_OPINDEX_NOOP | (R3_OPINDEX_NOOP << 8))
55 #define ROP4_MASK (R3_OPINDEX_SRCCOPY | (R3_OPINDEX_NOOP << 8))
56 #define ROP4_MASKPAINT (R3_OPINDEX_PATCOPY | (R3_OPINDEX_NOOP << 8))
57 
58 /* Definitions of IntEngXxx functions */
59 
60 BOOL APIENTRY
61 IntEngLineTo(SURFOBJ *Surface,
62              CLIPOBJ *Clip,
63              BRUSHOBJ *Brush,
64              LONG x1,
65              LONG y1,
66              LONG x2,
67              LONG y2,
68              RECTL *RectBounds,
69              MIX mix);
70 
71 BOOL APIENTRY
72 IntEngBitBlt(SURFOBJ *DestObj,
73                SURFOBJ *SourceObj,
74                SURFOBJ *Mask,
75                CLIPOBJ *ClipRegion,
76                XLATEOBJ *ColorTranslation,
77                RECTL *DestRect,
78                POINTL *SourcePoint,
79                POINTL *MaskOrigin,
80                BRUSHOBJ *Brush,
81                POINTL *BrushOrigin,
82                ROP4 Rop4);
83 
84 BOOL APIENTRY
85 IntEngStretchBlt(SURFOBJ *DestObj,
86                  SURFOBJ *SourceObj,
87                  SURFOBJ *Mask,
88                  CLIPOBJ *ClipRegion,
89                  XLATEOBJ *ColorTranslation,
90                  COLORADJUSTMENT *pca,
91                  RECTL *DestRect,
92                  RECTL *SourceRect,
93                  POINTL *pMaskOrigin,
94                  BRUSHOBJ *Brush,
95                  POINTL *BrushOrigin,
96                  ULONG Mode);
97 
98 BOOL APIENTRY
99 IntEngGradientFill(SURFOBJ *psoDest,
100                    CLIPOBJ *pco,
101                    XLATEOBJ *pxlo,
102                    TRIVERTEX *pVertex,
103                    ULONG nVertex,
104                    PVOID pMesh,
105                    ULONG nMesh,
106                    RECTL *prclExtents,
107                    POINTL *pptlDitherOrg,
108                    ULONG ulMode);
109 
110 BOOL APIENTRY
111 IntEngPolyline(SURFOBJ *DestSurf,
112                CLIPOBJ *Clip,
113                BRUSHOBJ *Brush,
114                CONST LPPOINT  pt,
115                LONG dCount,
116                MIX mix);
117 
118 VOID FASTCALL
119 IntEngUpdateClipRegion(XCLIPOBJ* Clip,
120                        ULONG count,
121                        const RECTL* pRect,
122                        const RECTL* rcBounds);
123 
124 VOID FASTCALL
125 IntEngInitClipObj(XCLIPOBJ *Clip);
126 
127 VOID FASTCALL
128 IntEngFreeClipResources(XCLIPOBJ *Clip);
129 
130 
131 BOOL FASTCALL
132 IntEngTransparentBlt(SURFOBJ *Dest,
133                      SURFOBJ *Source,
134                      CLIPOBJ *Clip,
135                      XLATEOBJ *ColorTranslation,
136                      PRECTL DestRect,
137                      PRECTL SourceRect,
138                      ULONG iTransColor,
139                      ULONG Reserved);
140 
141 BOOL
142 APIENTRY
143 IntEngPaint(
144     _In_ SURFOBJ *pso,
145     _In_ CLIPOBJ *pco,
146     _In_ BRUSHOBJ *pbo,
147     _In_ POINTL *pptlBrushOrg,
148     _In_ __in_data_source(USER_MODE) MIX mix);
149 
150 BOOL
151 APIENTRY
152 IntEngAlphaBlend(
153     _Inout_ SURFOBJ *psoDest,
154     _In_ SURFOBJ *psoSource,
155     _In_opt_ CLIPOBJ *pco,
156     _In_opt_ XLATEOBJ *pxlo,
157     _In_ RECTL *prclDest,
158     _In_ RECTL *prclSrc,
159     _In_ BLENDOBJ *pBlendObj);
160 
161 BOOL APIENTRY
162 IntEngCopyBits(SURFOBJ *psoDest,
163 	    SURFOBJ *psoSource,
164 	    CLIPOBJ *pco,
165 	    XLATEOBJ *pxlo,
166 	    RECTL *prclDest,
167 	    POINTL *ptlSource);
168