gdi32: Fix handling of the DC brush/pen in metafiles.
[wine.git] / dlls / gdi32 / enhmfdrv / enhmetafiledrv.h
blobeba753666124ed03771ece3ea2b42d9a3472ffd9
1 /*
2 * Enhanced MetaFile driver definitions
4 * Copyright 1999 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_ENHMETAFILEDRV_H
22 #define __WINE_ENHMETAFILEDRV_H
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "gdi_private.h"
31 /* Enhanced Metafile driver physical DC */
33 typedef struct
35 struct gdi_physdev dev;
36 HDC hdc;
37 ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */
38 UINT handles_size, cur_handles;
39 HGDIOBJ *handles;
40 HANDLE hFile; /* Handle for disk based MetaFile */
41 HBRUSH dc_brush;
42 HPEN dc_pen;
43 INT horzres, vertres;
44 INT horzsize, vertsize;
45 INT logpixelsx, logpixelsy;
46 INT bitspixel;
47 INT textcaps;
48 INT rastercaps;
49 INT technology;
50 INT planes;
51 INT numcolors;
52 INT restoring; /* RestoreDC counter */
53 } EMFDRV_PDEVICE;
56 extern BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr ) DECLSPEC_HIDDEN;
57 extern void EMFDRV_UpdateBBox( PHYSDEV dev, RECTL *rect ) DECLSPEC_HIDDEN;
58 extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN;
60 #define HANDLE_LIST_INC 20
62 /* Metafile driver functions */
63 extern BOOL CDECL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
64 extern BOOL CDECL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
65 INT bottom, INT xstart, INT ystart, INT xend,
66 INT yend ) DECLSPEC_HIDDEN;
67 extern BOOL CDECL EMFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
68 extern BOOL CDECL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst,
69 INT width, INT height, PHYSDEV devSrc,
70 INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN;
71 extern BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right,
72 INT bottom, INT xstart, INT ystart, INT xend,
73 INT yend ) DECLSPEC_HIDDEN;
74 extern BOOL CDECL EMFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
75 extern BOOL CDECL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;
76 extern BOOL CDECL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
77 INT right, INT bottom ) DECLSPEC_HIDDEN;
78 extern BOOL CDECL EMFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
79 extern INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
80 extern BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
81 extern INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
82 extern BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
83 UINT flags, const RECT *lprect, LPCWSTR str,
84 UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
85 extern BOOL CDECL EMFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
86 extern BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
87 extern BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
88 extern BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width,
89 INT height ) DECLSPEC_HIDDEN;
90 extern BOOL CDECL EMFDRV_GdiComment( PHYSDEV dev, UINT bytes, CONST BYTE *buffer ) DECLSPEC_HIDDEN;
91 extern INT CDECL EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap ) DECLSPEC_HIDDEN;
92 extern INT CDECL EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right,
93 INT bottom ) DECLSPEC_HIDDEN;
94 extern BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
95 extern BOOL CDECL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
96 extern BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode ) DECLSPEC_HIDDEN;
97 extern BOOL CDECL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
98 extern INT CDECL EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
99 extern BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
100 extern BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
101 extern BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
102 extern BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top,
103 INT width, INT height, DWORD rop ) DECLSPEC_HIDDEN;
104 extern BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right,
105 INT bottom, INT xstart, INT ystart, INT xend,
106 INT yend ) DECLSPEC_HIDDEN;
107 extern BOOL CDECL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt,
108 const INT* counts, UINT polys) DECLSPEC_HIDDEN;
109 extern BOOL CDECL EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt,
110 const DWORD* counts, DWORD polys) DECLSPEC_HIDDEN;
111 extern BOOL CDECL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
112 extern BOOL CDECL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN;
113 extern BOOL CDECL EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top,
114 INT right, INT bottom) DECLSPEC_HIDDEN;
115 extern BOOL CDECL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN;
116 extern BOOL CDECL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top,
117 INT right, INT bottom, INT ell_width,
118 INT ell_height ) DECLSPEC_HIDDEN;
119 extern INT CDECL EMFDRV_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN;
120 extern BOOL CDECL EMFDRV_ScaleViewportExtEx( PHYSDEV dev, INT xNum, INT xDenom,
121 INT yNum, INT yDenom, SIZE *size ) DECLSPEC_HIDDEN;
122 extern BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom,
123 INT yNum, INT yDenom, SIZE *size ) DECLSPEC_HIDDEN;
124 extern HBITMAP CDECL EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN;
125 extern HBRUSH CDECL EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN;
126 extern BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN;
127 extern HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont ) DECLSPEC_HIDDEN;
128 extern HPEN CDECL EMFDRV_SelectPen( PHYSDEV dev, HPEN handle ) DECLSPEC_HIDDEN;
129 extern HPALETTE CDECL EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) DECLSPEC_HIDDEN;
130 extern INT CDECL EMFDRV_SetArcDirection( PHYSDEV dev, INT arcDirection ) DECLSPEC_HIDDEN;
131 extern COLORREF CDECL EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
132 extern INT CDECL EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
133 extern COLORREF CDECL EMFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
134 extern COLORREF CDECL EMFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
135 extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest,
136 DWORD cx, DWORD cy, INT xSrc,
137 INT ySrc, UINT startscan, UINT lines,
138 LPCVOID bits, const BITMAPINFO *info,
139 UINT coloruse ) DECLSPEC_HIDDEN;
140 extern INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
141 extern DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
142 extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
143 extern INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
144 extern INT CDECL EMFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN;
145 extern INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
146 extern UINT CDECL EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) DECLSPEC_HIDDEN;
147 extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
148 extern BOOL CDECL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra,
149 INT nBreakCount ) DECLSPEC_HIDDEN;
150 extern BOOL CDECL EMFDRV_SetViewportExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN;
151 extern BOOL CDECL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
152 extern BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN;
153 extern BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
154 extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN;
155 extern BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst,
156 INT widthDst, INT heightDst,
157 PHYSDEV devSrc, INT xSrc, INT ySrc,
158 INT widthSrc, INT heightSrc, DWORD rop ) DECLSPEC_HIDDEN;
159 extern INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
160 INT heightDst, INT xSrc, INT ySrc,
161 INT widthSrc, INT heightSrc,
162 const void *bits, const BITMAPINFO *info,
163 UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN;
164 extern BOOL CDECL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
165 extern BOOL CDECL EMFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
166 extern BOOL CDECL EMFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
169 #endif /* __WINE_METAFILEDRV_H */