ReactOS 0.4.15-dev-8127-g6338913
init.c
Go to the documentation of this file.
1/*
2 * Enhanced MetaFile driver initialisation functions
3 *
4 * Copyright 1999 Huw D M Davies
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include <assert.h>
22#include <stdarg.h>
23#include <string.h>
24
25#include "windef.h"
26#include "winbase.h"
27#include "wingdi.h"
28#include "winnls.h"
29#include "gdi_private.h"
31#include "wine/debug.h"
32
34
36
37static const struct gdi_dc_funcs emfdrv_driver =
38{
39 NULL, /* pAbortDoc */
40 EMFDRV_AbortPath, /* pAbortPath */
41 NULL, /* pAlphaBlend */
42 EMFDRV_AngleArc, /* pAngleArc */
43 EMFDRV_Arc, /* pArc */
44 EMFDRV_ArcTo, /* pArcTo */
45 EMFDRV_BeginPath, /* pBeginPath */
46 NULL, /* pBlendImage */
47 EMFDRV_Chord, /* pChord */
48 EMFDRV_CloseFigure, /* pCloseFigure */
49 NULL, /* pCreateCompatibleDC */
50 NULL, /* pCreateDC */
51 EMFDRV_DeleteDC, /* pDeleteDC */
52 EMFDRV_DeleteObject, /* pDeleteObject */
53 NULL, /* pDeviceCapabilities */
54 EMFDRV_Ellipse, /* pEllipse */
55 NULL, /* pEndDoc */
56 NULL, /* pEndPage */
57 EMFDRV_EndPath, /* pEndPath */
58 NULL, /* pEnumFonts */
59 NULL, /* pEnumICMProfiles */
60 EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
61 NULL, /* pExtDeviceMode */
62 NULL, /* pExtEscape */
63 EMFDRV_ExtFloodFill, /* pExtFloodFill */
64 EMFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
65 EMFDRV_ExtTextOut, /* pExtTextOut */
66 EMFDRV_FillPath, /* pFillPath */
67 EMFDRV_FillRgn, /* pFillRgn */
68 EMFDRV_FlattenPath, /* pFlattenPath */
69 NULL, /* pFontIsLinked */
70 EMFDRV_FrameRgn, /* pFrameRgn */
71 EMFDRV_GdiComment, /* pGdiComment */
72 NULL, /* pGetBoundsRect */
73 NULL, /* pGetCharABCWidths */
74 NULL, /* pGetCharABCWidthsI */
75 NULL, /* pGetCharWidth */
76 NULL, /* pGetCharWidthInfo */
77 EMFDRV_GetDeviceCaps, /* pGetDeviceCaps */
78 NULL, /* pGetDeviceGammaRamp */
79 NULL, /* pGetFontData */
80 NULL, /* pGetFontRealizationInfo */
81 NULL, /* pGetFontUnicodeRanges */
82 NULL, /* pGetGlyphIndices */
83 NULL, /* pGetGlyphOutline */
84 NULL, /* pGetICMProfile */
85 NULL, /* pGetImage */
86 NULL, /* pGetKerningPairs */
87 NULL, /* pGetNearestColor */
88 NULL, /* pGetOutlineTextMetrics */
89 NULL, /* pGetPixel */
90 NULL, /* pGetSystemPaletteEntries */
91 NULL, /* pGetTextCharsetInfo */
92 NULL, /* pGetTextExtentExPoint */
93 NULL, /* pGetTextExtentExPointI */
94 NULL, /* pGetTextFace */
95 NULL, /* pGetTextMetrics */
96 EMFDRV_GradientFill, /* pGradientFill */
97 EMFDRV_IntersectClipRect, /* pIntersectClipRect */
98 EMFDRV_InvertRgn, /* pInvertRgn */
99 EMFDRV_LineTo, /* pLineTo */
100 EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */
101 EMFDRV_MoveTo, /* pMoveTo */
102 EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */
103 EMFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */
104 EMFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
105 EMFDRV_PaintRgn, /* pPaintRgn */
106 EMFDRV_PatBlt, /* pPatBlt */
107 EMFDRV_Pie, /* pPie */
108 EMFDRV_PolyBezier, /* pPolyBezier */
109 EMFDRV_PolyBezierTo, /* pPolyBezierTo */
110 EMFDRV_PolyDraw, /* pPolyDraw */
111 EMFDRV_PolyPolygon, /* pPolyPolygon */
112 EMFDRV_PolyPolyline, /* pPolyPolyline */
113 EMFDRV_Polygon, /* pPolygon */
114 EMFDRV_Polyline, /* pPolyline */
115 EMFDRV_PolylineTo, /* pPolylineTo */
116 NULL, /* pPutImage */
117 NULL, /* pRealizeDefaultPalette */
118 NULL, /* pRealizePalette */
119 EMFDRV_Rectangle, /* pRectangle */
120 NULL, /* pResetDC */
121 EMFDRV_RestoreDC, /* pRestoreDC */
122 EMFDRV_RoundRect, /* pRoundRect */
123 EMFDRV_SaveDC, /* pSaveDC */
124 EMFDRV_ScaleViewportExtEx, /* pScaleViewportExtEx */
125 EMFDRV_ScaleWindowExtEx, /* pScaleWindowExtEx */
126 EMFDRV_SelectBitmap, /* pSelectBitmap */
127 EMFDRV_SelectBrush, /* pSelectBrush */
128 EMFDRV_SelectClipPath, /* pSelectClipPath */
129 EMFDRV_SelectFont, /* pSelectFont */
130 EMFDRV_SelectPalette, /* pSelectPalette */
131 EMFDRV_SelectPen, /* pSelectPen */
132 EMFDRV_SetArcDirection, /* pSetArcDirection */
133 EMFDRV_SetBkColor, /* pSetBkColor */
134 EMFDRV_SetBkMode, /* pSetBkMode */
135 NULL, /* pSetBoundsRect */
136 EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/
137 EMFDRV_SetDCPenColor, /* pSetDCPenColor*/
138 EMFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
139 NULL, /* pSetDeviceClipping */
140 NULL, /* pSetDeviceGammaRamp */
141 EMFDRV_SetLayout, /* pSetLayout */
142 EMFDRV_SetMapMode, /* pSetMapMode */
143 EMFDRV_SetMapperFlags, /* pSetMapperFlags */
144 EMFDRV_SetPixel, /* pSetPixel */
145 EMFDRV_SetPolyFillMode, /* pSetPolyFillMode */
146 EMFDRV_SetROP2, /* pSetROP2 */
147 NULL, /* pSetRelAbs */
148 EMFDRV_SetStretchBltMode, /* pSetStretchBltMode */
149 EMFDRV_SetTextAlign, /* pSetTextAlign */
150 NULL, /* pSetTextCharacterExtra */
151 EMFDRV_SetTextColor, /* pSetTextColor */
152 EMFDRV_SetTextJustification, /* pSetTextJustification */
153 EMFDRV_SetViewportExtEx, /* pSetViewportExtEx */
154 EMFDRV_SetViewportOrgEx, /* pSetViewportOrgEx */
155 EMFDRV_SetWindowExtEx, /* pSetWindowExtEx */
156 EMFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */
157 EMFDRV_SetWorldTransform, /* pSetWorldTransform */
158 NULL, /* pStartDoc */
159 NULL, /* pStartPage */
160 EMFDRV_StretchBlt, /* pStretchBlt */
161 EMFDRV_StretchDIBits, /* pStretchDIBits */
162 EMFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */
163 EMFDRV_StrokePath, /* pStrokePath */
164 NULL, /* pUnrealizePalette */
165 EMFDRV_WidenPath, /* pWidenPath */
166 NULL, /* wine_get_wgl_driver */
167 GDI_PRIORITY_GRAPHICS_DRV /* priority */
168};
169
170
171/**********************************************************************
172 * EMFDRV_DeleteDC
173 */
175{
176 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
177 UINT index;
178
179 HeapFree( GetProcessHeap(), 0, physDev->emh );
180 for(index = 0; index < physDev->handles_size; index++)
181 if(physDev->handles[index])
182 GDI_hdc_not_using_object(physDev->handles[index], dev->hdc);
183 HeapFree( GetProcessHeap(), 0, physDev->handles );
184 HeapFree( GetProcessHeap(), 0, physDev );
185 return TRUE;
186}
187
188
189/******************************************************************
190 * EMFDRV_WriteRecord
191 *
192 * Warning: this function can change the pointer to the metafile header.
193 */
195{
196 DWORD len;
197 DWORD bytes_written;
198 ENHMETAHEADER *emh;
199 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
200
201 TRACE("record %d, size %d %s\n",
202 emr->iType, emr->nSize, physDev->hFile ? "(to disk)" : "");
203
204 assert( !(emr->nSize & 3) );
205
206 physDev->emh->nBytes += emr->nSize;
207 physDev->emh->nRecords++;
208
209 if(physDev->hFile) {
210 if (!WriteFile(physDev->hFile, emr, emr->nSize, &bytes_written, NULL))
211 return FALSE;
212 } else {
213 DWORD nEmfSize = HeapSize(GetProcessHeap(), 0, physDev->emh);
214 len = physDev->emh->nBytes;
215 if (len > nEmfSize) {
216 nEmfSize += (nEmfSize / 2) + emr->nSize;
217 emh = HeapReAlloc(GetProcessHeap(), 0, physDev->emh, nEmfSize);
218 if (!emh) return FALSE;
219 physDev->emh = emh;
220 }
221 memcpy((CHAR *)physDev->emh + physDev->emh->nBytes - emr->nSize, emr,
222 emr->nSize);
223 }
224 return TRUE;
225}
226
227
228/******************************************************************
229 * EMFDRV_UpdateBBox
230 */
232{
233 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
234 RECTL *bounds = &physDev->emh->rclBounds;
235 RECTL vportRect = *rect;
236
237 LPtoDP( dev->hdc, (LPPOINT)&vportRect, 2 );
238
239 /* The coordinate systems may be mirrored
240 (LPtoDP handles points, not rectangles) */
241 if (vportRect.left > vportRect.right)
242 {
243 LONG temp = vportRect.right;
244 vportRect.right = vportRect.left;
245 vportRect.left = temp;
246 }
247 if (vportRect.top > vportRect.bottom)
248 {
249 LONG temp = vportRect.bottom;
250 vportRect.bottom = vportRect.top;
251 vportRect.top = temp;
252 }
253
254 if (bounds->left > bounds->right)
255 {
256 /* first bounding rectangle */
257 *bounds = vportRect;
258 }
259 else
260 {
261 bounds->left = min(bounds->left, vportRect.left);
262 bounds->top = min(bounds->top, vportRect.top);
263 bounds->right = max(bounds->right, vportRect.right);
264 bounds->bottom = max(bounds->bottom, vportRect.bottom);
265 }
266}
267
268/**********************************************************************
269 * CreateEnhMetaFileA (GDI32.@)
270 */
272 HDC hdc, /* [in] optional reference DC */
273 LPCSTR filename, /* [in] optional filename for disk metafiles */
274 const RECT *rect, /* [in] optional bounding rectangle */
275 LPCSTR description /* [in] optional description */
276 )
277{
280 HDC hReturnDC;
281 DWORD len1, len2, total;
282
283 if(filename)
284 {
286 filenameW = HeapAlloc( GetProcessHeap(), 0, total * sizeof(WCHAR) );
288 }
289 if(description) {
290 len1 = strlen(description);
291 len2 = strlen(description + len1 + 1);
292 total = MultiByteToWideChar( CP_ACP, 0, description, len1 + len2 + 3, NULL, 0 );
293 descriptionW = HeapAlloc( GetProcessHeap(), 0, total * sizeof(WCHAR) );
294 MultiByteToWideChar( CP_ACP, 0, description, len1 + len2 + 3, descriptionW, total );
295 }
296
298
301
302 return hReturnDC;
303}
304
305/**********************************************************************
306 * CreateEnhMetaFileW (GDI32.@)
307 */
309 HDC hdc, /* [in] optional reference DC */
310 LPCWSTR filename, /* [in] optional filename for disk metafiles */
311 const RECT* rect, /* [in] optional bounding rectangle */
312 LPCWSTR description /* [in] optional description */
313 )
314{
315 static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
316 HDC ret;
317 DC *dc;
318 EMFDRV_PDEVICE *physDev;
320 DWORD size = 0, length = 0;
321 DWORD bytes_written;
322
324
325 if (!(dc = alloc_dc_ptr( OBJ_ENHMETADC ))) return 0;
326
327 physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev));
328 if (!physDev) {
329 free_dc_ptr( dc );
330 return 0;
331 }
332 if(description) { /* App name\0Title\0\0 */
335 length += 3;
336 length *= 2;
337 }
338 size = sizeof(ENHMETAHEADER) + (length + 3) / 4 * 4;
339
340 if (!(physDev->emh = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size))) {
341 HeapFree( GetProcessHeap(), 0, physDev );
342 free_dc_ptr( dc );
343 return 0;
344 }
345
346 push_dc_driver( &dc->physDev, &physDev->dev, &emfdrv_driver );
347
348 physDev->handles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, HANDLE_LIST_INC * sizeof(physDev->handles[0]));
349 physDev->handles_size = HANDLE_LIST_INC;
350 physDev->cur_handles = 1;
351 physDev->hFile = 0;
352 physDev->dc_brush = 0;
353 physDev->dc_pen = 0;
354 physDev->screen_dc = 0;
355 physDev->restoring = 0;
356 physDev->path = FALSE;
357 if (hdc) /* if no ref, use current display */
358 physDev->ref_dc = hdc;
359 else
360 physDev->ref_dc = physDev->screen_dc = CreateDCW( displayW, NULL, NULL, NULL );
361
362 SetVirtualResolution(physDev->dev.hdc, 0, 0, 0, 0);
363
364 physDev->emh->iType = EMR_HEADER;
365 physDev->emh->nSize = size;
366
367 physDev->emh->rclBounds.left = physDev->emh->rclBounds.top = 0;
368 physDev->emh->rclBounds.right = physDev->emh->rclBounds.bottom = -1;
369
370 if(rect) {
371 physDev->emh->rclFrame.left = rect->left;
372 physDev->emh->rclFrame.top = rect->top;
373 physDev->emh->rclFrame.right = rect->right;
374 physDev->emh->rclFrame.bottom = rect->bottom;
375 } else { /* Set this to {0,0 - -1,-1} and update it at the end */
376 physDev->emh->rclFrame.left = physDev->emh->rclFrame.top = 0;
377 physDev->emh->rclFrame.right = physDev->emh->rclFrame.bottom = -1;
378 }
379
380 physDev->emh->dSignature = ENHMETA_SIGNATURE;
381 physDev->emh->nVersion = 0x10000;
382 physDev->emh->nBytes = physDev->emh->nSize;
383 physDev->emh->nRecords = 1;
384 physDev->emh->nHandles = 1;
385
386 physDev->emh->sReserved = 0; /* According to docs, this is reserved and must be 0 */
387 physDev->emh->nDescription = length / 2;
388
389 physDev->emh->offDescription = length ? sizeof(ENHMETAHEADER) : 0;
390
391 physDev->emh->nPalEntries = 0; /* I guess this should start at 0 */
392
393 /* Size in pixels */
394 physDev->emh->szlDevice.cx = GetDeviceCaps( physDev->ref_dc, HORZRES );
395 physDev->emh->szlDevice.cy = GetDeviceCaps( physDev->ref_dc, VERTRES );
396
397 /* Size in millimeters */
398 physDev->emh->szlMillimeters.cx = GetDeviceCaps( physDev->ref_dc, HORZSIZE );
399 physDev->emh->szlMillimeters.cy = GetDeviceCaps( physDev->ref_dc, VERTSIZE );
400
401 /* Size in micrometers */
402 physDev->emh->szlMicrometers.cx = physDev->emh->szlMillimeters.cx * 1000;
403 physDev->emh->szlMicrometers.cy = physDev->emh->szlMillimeters.cy * 1000;
404
405 memcpy((char *)physDev->emh + sizeof(ENHMETAHEADER), description, length);
406
407 if (filename) /* disk based metafile */
408 {
411 free_dc_ptr( dc );
412 return 0;
413 }
414 if (!WriteFile( hFile, physDev->emh, size, &bytes_written, NULL )) {
415 free_dc_ptr( dc );
417 return 0;
418 }
419 physDev->hFile = hFile;
420 }
421
422 TRACE("returning %p\n", physDev->dev.hdc);
423 ret = physDev->dev.hdc;
425
426 return ret;
427}
428
429/******************************************************************
430 * CloseEnhMetaFile (GDI32.@)
431 */
432HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
433{
434 HENHMETAFILE hmf;
435 EMFDRV_PDEVICE *physDev;
436 DC *dc;
437 EMREOF emr;
438 HANDLE hMapping = 0;
439
440 TRACE("(%p)\n", hdc );
441
442 if (!(dc = get_dc_ptr( hdc ))) return NULL;
444 {
446 return NULL;
447 }
448 if (dc->refcount != 1)
449 {
450 FIXME( "not deleting busy DC %p refcount %u\n", hdc, dc->refcount );
452 return NULL;
453 }
454 physDev = get_emf_physdev( find_dc_driver( dc, &emfdrv_driver ));
455
456 if(dc->saveLevel)
457 RestoreDC(hdc, 1);
458
459 if (physDev->dc_brush) DeleteObject( physDev->dc_brush );
460 if (physDev->dc_pen) DeleteObject( physDev->dc_pen );
461 if (physDev->screen_dc) DeleteDC( physDev->screen_dc );
462
463 emr.emr.iType = EMR_EOF;
464 emr.emr.nSize = sizeof(emr);
465 emr.nPalEntries = 0;
466 emr.offPalEntries = FIELD_OFFSET(EMREOF, nSizeLast);
467 emr.nSizeLast = emr.emr.nSize;
468 EMFDRV_WriteRecord( &physDev->dev, &emr.emr );
469
470 /* Update rclFrame if not initialized in CreateEnhMetaFile */
471 if(physDev->emh->rclFrame.left > physDev->emh->rclFrame.right) {
472 physDev->emh->rclFrame.left = physDev->emh->rclBounds.left *
473 physDev->emh->szlMillimeters.cx * 100 / physDev->emh->szlDevice.cx;
474 physDev->emh->rclFrame.top = physDev->emh->rclBounds.top *
475 physDev->emh->szlMillimeters.cy * 100 / physDev->emh->szlDevice.cy;
476 physDev->emh->rclFrame.right = physDev->emh->rclBounds.right *
477 physDev->emh->szlMillimeters.cx * 100 / physDev->emh->szlDevice.cx;
478 physDev->emh->rclFrame.bottom = physDev->emh->rclBounds.bottom *
479 physDev->emh->szlMillimeters.cy * 100 / physDev->emh->szlDevice.cy;
480 }
481
482 if (physDev->hFile) /* disk based metafile */
483 {
484 if (SetFilePointer(physDev->hFile, 0, NULL, FILE_BEGIN) != 0)
485 {
486 CloseHandle( physDev->hFile );
487 free_dc_ptr( dc );
488 return 0;
489 }
490
491 if (!WriteFile(physDev->hFile, physDev->emh, sizeof(*physDev->emh),
492 NULL, NULL))
493 {
494 CloseHandle( physDev->hFile );
495 free_dc_ptr( dc );
496 return 0;
497 }
498 HeapFree( GetProcessHeap(), 0, physDev->emh );
499 hMapping = CreateFileMappingA(physDev->hFile, NULL, PAGE_READONLY, 0,
500 0, NULL);
501 TRACE("hMapping = %p\n", hMapping );
502 physDev->emh = MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0);
503 TRACE("view = %p\n", physDev->emh );
504 CloseHandle( hMapping );
505 CloseHandle( physDev->hFile );
506 }
507
508 hmf = EMF_Create_HENHMETAFILE( physDev->emh, (physDev->hFile != 0) );
509 physDev->emh = NULL; /* So it won't be deleted */
510 free_dc_ptr( dc );
511 return hmf;
512}
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define FIXME(fmt,...)
Definition: debug.h:114
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define PAGE_READONLY
Definition: compat.h:138
#define FILE_BEGIN
Definition: compat.h:761
#define CP_ACP
Definition: compat.h:109
#define SetFilePointer
Definition: compat.h:743
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define GENERIC_READ
Definition: compat.h:135
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
#define MultiByteToWideChar
Definition: compat.h:110
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrlenW
Definition: compat.h:750
static const WCHAR descriptionW[]
Definition: error.c:32
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define assert(x)
Definition: debug.h:53
HBITMAP EMFDRV_SelectBitmap(WINEDC *dc, HBITMAP hbitmap)
Definition: emfdrv.c:426
BOOL EMFDRV_PatBlt(WINEDC *dc, INT left, INT top, INT width, INT height, DWORD rop)
Definition: emfdrv.c:402
BOOL EMFDRV_FrameRgn(WINEDC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height)
Definition: emfdrv.c:350
BOOL EMFDRV_PolyBezier(WINEDC *dc, const POINT *pts, DWORD count)
Definition: emfdrv.c:311
BOOL EMFDRV_InvertRgn(WINEDC *dc, HRGN hrgn)
Definition: emfdrv.c:356
BOOL EMFDRV_Ellipse(WINEDC *dc, INT left, INT top, INT right, INT bottom)
Definition: emfdrv.c:255
BOOL EMFDRV_StrokeAndFillPath(WINEDC *dc)
Definition: emfdrv.c:382
BOOL EMFDRV_Pie(WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: emfdrv.c:241
BOOL EMFDRV_Arc(WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: emfdrv.c:227
BOOL EMFDRV_ArcTo(WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: emfdrv.c:234
BOOL EMFDRV_Rectangle(WINEDC *dc, INT left, INT top, INT right, INT bottom)
Definition: emfdrv.c:275
BOOL EMFDRV_FillRgn(WINEDC *dc, HRGN hrgn, HBRUSH hbrush)
Definition: emfdrv.c:344
BOOL EMFDRV_LineTo(WINEDC *dc, INT x, INT y)
Definition: emfdrv.c:83
COLORREF EMFDRV_SetPixel(WINEDC *dc, INT x, INT y, COLORREF color)
Definition: emfdrv.c:295
BOOL EMFDRV_GradientFill(WINEDC *dc, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode)
Definition: emfdrv.c:369
BOOL EMFDRV_PolylineTo(WINEDC *dc, const POINT *pt, INT count)
Definition: emfdrv.c:305
BOOL EMFDRV_StrokePath(WINEDC *dc)
Definition: emfdrv.c:388
BOOL EMFDRV_PolyPolygon(WINEDC *dc, const POINT *pt, const INT *counts, UINT polys)
Definition: emfdrv.c:330
INT EMFDRV_StretchDIBits(WINEDC *dc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, INT x_src, INT y_src, INT width_src, INT height_src, const void *bits, BITMAPINFO *info, UINT wUsage, DWORD dwRop)
Definition: emfdrv.c:408
BOOL EMFDRV_PolyBezierTo(WINEDC *dc, const POINT *pts, DWORD count)
Definition: emfdrv.c:317
INT EMFDRV_SetDIBitsToDevice(WINEDC *dc, INT x_dst, INT y_dst, DWORD width, DWORD height, INT x_src, INT y_src, UINT startscan, UINT lines, const void *bits, BITMAPINFO *info, UINT usage)
Definition: emfdrv.c:417
BOOL EMFDRV_Chord(WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: emfdrv.c:248
BOOL EMFDRV_PolyDraw(WINEDC *dc, const POINT *pts, const BYTE *types, DWORD count)
Definition: emfdrv.c:337
BOOL EMFDRV_ExtTextOut(WINEDC *dc, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx)
Definition: emfdrv.c:362
BOOL EMFDRV_FillPath(WINEDC *dc)
Definition: emfdrv.c:376
BOOL EMFDRV_RoundRect(WINEDC *dc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height)
Definition: emfdrv.c:99
BOOL EMFDRV_PolyPolyline(WINEDC *dc, const POINT *pt, const DWORD *counts, UINT polys)
Definition: emfdrv.c:323
BOOL EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
Definition: graphics.c:173
BOOL EMFDRV_Polyline(PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
Definition: graphics.c:592
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
BOOL EMFDRV_DeleteObject(PHYSDEV dev, HGDIOBJ obj) DECLSPEC_HIDDEN
Definition: objects.c:77
HBRUSH EMFDRV_SelectBrush(PHYSDEV dev, HBRUSH hbrush, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
Definition: objects.c:205
COLORREF EMFDRV_SetDCPenColor(PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
Definition: objects.c:493
BOOL EMFDRV_PaintRgn(PHYSDEV dev, HRGN hrgn) DECLSPEC_HIDDEN
Definition: graphics.c:867
HPALETTE EMFDRV_SelectPalette(PHYSDEV dev, HPALETTE hPal, BOOL force) DECLSPEC_HIDDEN
Definition: objects.c:437
HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN handle, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
Definition: objects.c:369
BOOL EMFDRV_Polygon(PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
Definition: graphics.c:608
BOOL EMFDRV_AngleArc(PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep) DECLSPEC_HIDDEN
Definition: graphics.c:390
BOOL EMFDRV_GdiComment(PHYSDEV dev, UINT bytes, const BYTE *buffer) DECLSPEC_HIDDEN
Definition: objects.c:520
BOOL EMFDRV_ExtFloodFill(PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType) DECLSPEC_HIDDEN
Definition: graphics.c:747
HFONT EMFDRV_SelectFont(PHYSDEV dev, HFONT handle, UINT *aa_flags) DECLSPEC_HIDDEN
Definition: objects.c:284
COLORREF EMFDRV_SetDCBrushColor(PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
Definition: objects.c:467
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
Definition: filemap.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
size_t total
#define HANDLE_LIST_INC
Definition: gdi32p.h:74
#define GDI_PRIORITY_GRAPHICS_DRV
Definition: gdi_driver.h:205
BOOL WINAPI SetVirtualResolution(HDC hdc, DWORD horz_res, DWORD vert_res, DWORD horz_size, DWORD vert_size)
Definition: rosglue.c:278
void GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:182
void release_dc_ptr(DC *dc) DECLSPEC_HIDDEN
DC * alloc_dc_ptr(WORD magic) DECLSPEC_HIDDEN
Definition: rosglue.c:106
void free_dc_ptr(DC *dc) DECLSPEC_HIDDEN
DC * get_dc_ptr(HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:147
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR dc[]
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CREATE_ALWAYS
Definition: disk.h:72
HDC hdc
Definition: main.c:9
static const WCHAR filenameW[]
Definition: amstream.c:41
static HDC
Definition: imagelist.c:92
static const WCHAR displayW[]
Definition: icm.c:30
static const unsigned char enhmetafile[]
Definition: olepicture.c:149
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OBJ_ENHMETADC
Definition: objidl.idl:1420
long LONG
Definition: pedump.c:60
static calc_node_t temp
Definition: rpn_ieee.c:38
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
Definition: polytest.cpp:41
HGDIOBJ * handles
ENHMETAHEADER * emh
struct gdi_physdev dev
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
EMR emr
Definition: wingdi.h:1859
DWORD nSizeLast
Definition: wingdi.h:1862
DWORD offPalEntries
Definition: wingdi.h:1861
DWORD nPalEntries
Definition: wingdi.h:1860
DWORD iType
Definition: wingdi.h:1690
DWORD nSize
Definition: wingdi.h:1691
DWORD nRecords
Definition: wingdi.h:2327
RECTL rclFrame
Definition: wingdi.h:2323
SIZEL szlDevice
Definition: wingdi.h:2333
DWORD nDescription
Definition: wingdi.h:2330
DWORD dSignature
Definition: wingdi.h:2324
SIZEL szlMillimeters
Definition: wingdi.h:2334
DWORD nPalEntries
Definition: wingdi.h:2332
DWORD offDescription
Definition: wingdi.h:2331
RECTL rclBounds
Definition: wingdi.h:2322
DWORD nVersion
Definition: wingdi.h:2325
#define max(a, b)
Definition: svc.c:63
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
int ret
HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, DWORD filesize, BOOL on_disk)
Definition: enhmetafile.c:259
BOOL EMFDRV_StretchBlt(PHYSDEV devDst, struct bitblt_coords *dst, PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop)
Definition: bitblt.c:67
BOOL EMFDRV_OffsetWindowOrgEx(PHYSDEV dev, INT x, INT y, POINT *pt)
Definition: dc.c:389
BOOL EMFDRV_ModifyWorldTransform(PHYSDEV dev, const XFORM *xform, DWORD mode)
Definition: dc.c:358
BOOL EMFDRV_EndPath(PHYSDEV dev)
Definition: dc.c:457
INT EMFDRV_SaveDC(PHYSDEV dev)
Definition: dc.c:33
BOOL EMFDRV_AbortPath(PHYSDEV dev)
Definition: dc.c:417
BOOL EMFDRV_CloseFigure(PHYSDEV dev)
Definition: dc.c:446
BOOL EMFDRV_SetTextJustification(PHYSDEV dev, INT nBreakExtra, INT nBreakCount)
Definition: dc.c:81
INT EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection)
Definition: dc.c:154
COLORREF EMFDRV_SetBkColor(PHYSDEV dev, COLORREF color)
Definition: dc.c:100
INT EMFDRV_SetMapMode(PHYSDEV dev, INT mode)
Definition: dc.c:235
DWORD EMFDRV_SetLayout(PHYSDEV dev, DWORD layout)
Definition: dc.c:335
INT EMFDRV_IntersectClipRect(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
Definition: dc.c:179
UINT EMFDRV_SetTextAlign(PHYSDEV dev, UINT align)
Definition: dc.c:72
BOOL EMFDRV_SetViewportExtEx(PHYSDEV dev, INT cx, INT cy, SIZE *size)
Definition: dc.c:247
BOOL EMFDRV_FlattenPath(PHYSDEV dev)
Definition: dc.c:468
BOOL EMFDRV_SelectClipPath(PHYSDEV dev, INT iMode)
Definition: dc.c:478
BOOL EMFDRV_SetWindowExtEx(PHYSDEV dev, INT cx, INT cy, SIZE *size)
Definition: dc.c:261
INT EMFDRV_ExtSelectClipRgn(PHYSDEV dev, HRGN hrgn, INT mode)
Definition: dc.c:207
INT EMFDRV_SetPolyFillMode(PHYSDEV dev, INT mode)
Definition: dc.c:136
BOOL EMFDRV_SetWorldTransform(PHYSDEV dev, const XFORM *xform)
Definition: dc.c:345
BOOL EMFDRV_RestoreDC(PHYSDEV dev, INT level)
Definition: dc.c:48
BOOL EMFDRV_ScaleWindowExtEx(PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size)
Definition: dc.c:319
DWORD EMFDRV_SetMapperFlags(PHYSDEV dev, DWORD flags)
Definition: dc.c:406
INT EMFDRV_SetStretchBltMode(PHYSDEV dev, INT mode)
Definition: dc.c:145
INT EMFDRV_ExcludeClipRect(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
Definition: dc.c:164
BOOL EMFDRV_BeginPath(PHYSDEV dev)
Definition: dc.c:427
BOOL EMFDRV_ScaleViewportExtEx(PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size)
Definition: dc.c:303
BOOL EMFDRV_SetViewportOrgEx(PHYSDEV dev, INT x, INT y, POINT *pt)
Definition: dc.c:275
BOOL EMFDRV_OffsetViewportOrgEx(PHYSDEV dev, INT x, INT y, POINT *pt)
Definition: dc.c:372
BOOL EMFDRV_WidenPath(PHYSDEV dev)
Definition: dc.c:500
INT EMFDRV_SetBkMode(PHYSDEV dev, INT mode)
Definition: dc.c:91
INT EMFDRV_OffsetClipRgn(PHYSDEV dev, INT x, INT y)
Definition: dc.c:194
COLORREF EMFDRV_SetTextColor(PHYSDEV dev, COLORREF color)
Definition: dc.c:114
INT EMFDRV_SetROP2(PHYSDEV dev, INT rop)
Definition: dc.c:127
BOOL EMFDRV_SetWindowOrgEx(PHYSDEV dev, INT x, INT y, POINT *pt)
Definition: dc.c:289
INT EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap)
Definition: dc.c:510
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr)
Definition: init.c:194
HDC WINAPI CreateEnhMetaFileW(HDC hdc, LPCWSTR filename, const RECT *rect, LPCWSTR description)
Definition: init.c:308
static const struct gdi_dc_funcs emfdrv_driver
Definition: init.c:37
HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc)
Definition: init.c:432
HDC WINAPI CreateEnhMetaFileA(HDC hdc, LPCSTR filename, const RECT *rect, LPCSTR description)
Definition: init.c:271
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect)
Definition: init.c:231
static BOOL EMFDRV_DeleteDC(PHYSDEV dev)
Definition: init.c:174
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
#define WINAPI
Definition: msvc.h:6
const char * description
Definition: directx.c:2497
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define VERTSIZE
Definition: wingdi.h:715
BOOL WINAPI LPtoDP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
#define EMR_EOF
Definition: wingdi.h:88
#define HORZSIZE
Definition: wingdi.h:714
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
#define VERTRES
Definition: wingdi.h:717
#define ENHMETA_SIGNATURE
Definition: wingdi.h:204
struct tagENHMETAHEADER ENHMETAHEADER
BOOL WINAPI DeleteDC(_In_ HDC)
#define EMR_HEADER
Definition: wingdi.h:75
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175