2 * Enhanced MetaFile driver dc value functions
4 * Copyright 1999 Huw D M Davies
7 #include "enhmetafiledrv.h"
8 #include "debugtools.h"
10 DEFAULT_DEBUG_CHANNEL(enhmetafile
)
12 INT
EMFDRV_SaveDC( DC
*dc
)
15 emr
.emr
.iType
= EMR_SAVEDC
;
16 emr
.emr
.nSize
= sizeof(emr
);
17 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
20 BOOL
EMFDRV_RestoreDC( DC
*dc
, INT level
)
23 emr
.emr
.iType
= EMR_RESTOREDC
;
24 emr
.emr
.nSize
= sizeof(emr
);
25 emr
.iRelative
= level
;
26 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
29 UINT
EMFDRV_SetTextAlign( DC
*dc
, UINT align
)
32 emr
.emr
.iType
= EMR_SETTEXTALIGN
;
33 emr
.emr
.nSize
= sizeof(emr
);
35 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
38 INT
EMFDRV_SetBkMode( DC
*dc
, INT mode
)
41 emr
.emr
.iType
= EMR_SETBKMODE
;
42 emr
.emr
.nSize
= sizeof(emr
);
44 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
47 INT
EMFDRV_SetROP2( DC
*dc
, INT rop
)
50 emr
.emr
.iType
= EMR_SETROP2
;
51 emr
.emr
.nSize
= sizeof(emr
);
53 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
56 INT
EMFDRV_SetPolyFillMode( DC
*dc
, INT mode
)
58 EMRSETPOLYFILLMODE emr
;
59 emr
.emr
.iType
= EMR_SETPOLYFILLMODE
;
60 emr
.emr
.nSize
= sizeof(emr
);
62 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
65 INT
EMFDRV_SetStretchBltMode( DC
*dc
, INT mode
)
67 EMRSETSTRETCHBLTMODE emr
;
68 emr
.emr
.iType
= EMR_SETSTRETCHBLTMODE
;
69 emr
.emr
.nSize
= sizeof(emr
);
71 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
74 INT
EMFDRV_SetMapMode( DC
*dc
, INT mode
)
77 emr
.emr
.iType
= EMR_SETMAPMODE
;
78 emr
.emr
.nSize
= sizeof(emr
);
80 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
83 INT
EMFDRV_ExcludeClipRect( DC
*dc
, INT left
, INT top
, INT right
, INT bottom
)
85 EMREXCLUDECLIPRECT emr
;
86 emr
.emr
.iType
= EMR_EXCLUDECLIPRECT
;
87 emr
.emr
.nSize
= sizeof(emr
);
88 emr
.rclClip
.left
= left
;
89 emr
.rclClip
.top
= top
;
90 emr
.rclClip
.right
= right
;
91 emr
.rclClip
.bottom
= bottom
;
92 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
95 INT
EMFDRV_IntersectClipRect( DC
*dc
, INT left
, INT top
, INT right
, INT bottom
)
97 EMRINTERSECTCLIPRECT emr
;
98 emr
.emr
.iType
= EMR_INTERSECTCLIPRECT
;
99 emr
.emr
.nSize
= sizeof(emr
);
100 emr
.rclClip
.left
= left
;
101 emr
.rclClip
.top
= top
;
102 emr
.rclClip
.right
= right
;
103 emr
.rclClip
.bottom
= bottom
;
104 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
107 INT
EMFDRV_OffsetClipRgn( DC
*dc
, INT x
, INT y
)
109 EMROFFSETCLIPRGN emr
;
110 emr
.emr
.iType
= EMR_OFFSETCLIPRGN
;
111 emr
.emr
.nSize
= sizeof(emr
);
114 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
117 DWORD
EMFDRV_SetMapperFlags( DC
*dc
, DWORD flags
)
119 EMRSETMAPPERFLAGS emr
;
121 emr
.emr
.iType
= EMR_SETMAPPERFLAGS
;
122 emr
.emr
.nSize
= sizeof(emr
);
125 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
128 BOOL
EMFDRV_AbortPath( DC
*dc
)
132 emr
.emr
.iType
= EMR_ABORTPATH
;
133 emr
.emr
.nSize
= sizeof(emr
);
135 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
138 BOOL
EMFDRV_BeginPath( DC
*dc
)
142 emr
.emr
.iType
= EMR_BEGINPATH
;
143 emr
.emr
.nSize
= sizeof(emr
);
145 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
148 BOOL
EMFDRV_CloseFigure( DC
*dc
)
152 emr
.emr
.iType
= EMR_CLOSEFIGURE
;
153 emr
.emr
.nSize
= sizeof(emr
);
155 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
158 BOOL
EMFDRV_EndPath( DC
*dc
)
162 emr
.emr
.iType
= EMR_ENDPATH
;
163 emr
.emr
.nSize
= sizeof(emr
);
165 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
168 BOOL
EMFDRV_FillPath( DC
*dc
)
172 emr
.emr
.iType
= EMR_FILLPATH
;
173 emr
.emr
.nSize
= sizeof(emr
);
175 emr
.rclBounds
.left
= 0;
176 emr
.rclBounds
.top
= 0;
177 emr
.rclBounds
.right
= 0;
178 emr
.rclBounds
.bottom
= 0;
179 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
182 BOOL
EMFDRV_FlattenPath( DC
*dc
)
186 emr
.emr
.iType
= EMR_FLATTENPATH
;
187 emr
.emr
.nSize
= sizeof(emr
);
189 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
192 BOOL
EMFDRV_SelectClipPath( DC
*dc
, INT iMode
)
194 EMRSELECTCLIPPATH emr
;
196 emr
.emr
.iType
= EMR_SELECTCLIPPATH
;
197 emr
.emr
.nSize
= sizeof(emr
);
200 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
203 BOOL
EMFDRV_StrokeAndFillPath( DC
*dc
)
205 EMRSTROKEANDFILLPATH emr
;
207 emr
.emr
.iType
= EMR_STROKEANDFILLPATH
;
208 emr
.emr
.nSize
= sizeof(emr
);
210 emr
.rclBounds
.left
= 0;
211 emr
.rclBounds
.top
= 0;
212 emr
.rclBounds
.right
= 0;
213 emr
.rclBounds
.bottom
= 0;
214 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
217 BOOL
EMFDRV_StrokePath( DC
*dc
)
221 emr
.emr
.iType
= EMR_STROKEPATH
;
222 emr
.emr
.nSize
= sizeof(emr
);
224 emr
.rclBounds
.left
= 0;
225 emr
.rclBounds
.top
= 0;
226 emr
.rclBounds
.right
= 0;
227 emr
.rclBounds
.bottom
= 0;
228 return EMFDRV_WriteRecord( dc
, &emr
.emr
);
231 BOOL
EMFDRV_WidenPath( DC
*dc
)
235 emr
.emr
.iType
= EMR_WIDENPATH
;
236 emr
.emr
.nSize
= sizeof(emr
);
238 return EMFDRV_WriteRecord( dc
, &emr
.emr
);