2 * gdiplusmetaheader.h
\r
4 * GDI+ metafile header structure
\r
6 * This file is part of the w32api package.
\r
9 * Created by Markus Koenig <markus@stber-koenig.de>
\r
11 * THIS SOFTWARE IS NOT COPYRIGHTED
\r
13 * This source code is offered for use in the public domain. You may
\r
14 * use, modify or distribute it freely.
\r
16 * This code is distributed in the hope that it will be useful but
\r
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
\r
18 * DISCLAIMED. This includes but is not limited to warranties of
\r
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
23 #ifndef __GDIPLUS_METAHEADER_H
\r
24 #define __GDIPLUS_METAHEADER_H
\r
26 #pragma GCC system_header
\r
31 * FIXME: is 1 the correct value for GDIP_EMFPLUSFLAGS_DISPLAY? This number
\r
32 * has been determined by calling Metafile::GetMetafileHeader() on a EMF+
\r
33 * metafile which was recorded on a display device context (SampleMetafile.emf).
\r
36 const UINT GDIP_EMFPLUSFLAGS_DISPLAY = 1;
\r
38 #define GDIP_EMFPLUSFLAGS_DISPLAY ((UINT) 1)
\r
41 typedef struct tagENHMETAHEADER3 {
\r
53 DWORD offDescription;
\r
56 SIZEL szlMillimeters;
\r
57 } ENHMETAHEADER3,*LPENHMETAHEADER3;
\r
59 typedef struct PWMFRect16 {
\r
66 typedef struct WmfPlaceableFileHeader {
\r
69 PWMFRect16 BoundingBox;
\r
73 } WmfPlaceableFileHeader;
\r
75 typedef struct MetafileHeader {
\r
86 __extension__ union {
\r
87 METAHEADER WmfHeader;
\r
88 ENHMETAHEADER3 EmfHeader;
\r
90 INT EmfPlusHeaderSize;
\r
96 void GetBounds(Rect *rect) const
\r
102 rect->Width = Width;
\r
103 rect->Height = Height;
\r
106 REAL GetDpiX() const
\r
110 REAL GetDpiY() const
\r
114 const ENHMETAHEADER3* GetEmfHeader() const
\r
116 if (Type == MetafileTypeEmf
\r
117 || Type == MetafileTypeEmfPlusOnly
\r
118 || Type == MetafileTypeEmfPlusDual)
\r
127 UINT GetEmfPlusFlags() const
\r
129 return EmfPlusFlags;
\r
131 UINT GetMetafileSize() const
\r
135 MetafileType GetType() const
\r
139 UINT GetVersion() const
\r
143 const METAHEADER* GetWmfHeader() const
\r
145 if (Type == MetafileTypeWmf || Type == MetafileTypeWmfPlaceable)
\r
154 BOOL IsDisplay() const
\r
156 return EmfPlusFlags == GDIP_EMFPLUSFLAGS_DISPLAY;
\r
160 return Type == MetafileTypeEmf;
\r
162 BOOL IsEmfOrEmfPlus() const
\r
164 return Type == MetafileTypeEmf
\r
165 || Type == MetafileTypeEmfPlusOnly
\r
166 || Type == MetafileTypeEmfPlusDual;
\r
168 BOOL IsEmfPlus() const
\r
170 return Type == MetafileTypeEmfPlusOnly
\r
171 || Type == MetafileTypeEmfPlusDual;
\r
173 BOOL IsEmfPlusDual() const
\r
175 return Type == MetafileTypeEmfPlusDual;
\r
177 BOOL IsEmfPlusOnly() const
\r
179 return Type == MetafileTypeEmfPlusOnly;
\r
183 return Type == MetafileTypeWmf
\r
184 || Type == MetafileTypeWmfPlaceable;
\r
186 BOOL IsWmfPlaceable() const
\r
188 return Type == MetafileTypeWmfPlaceable;
\r
193 #endif /* __GDIPLUS_METAHEADER_H */
\r