2 * @file gdiplusmetaheader.h
3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 /* Created by Markus Koenig <markus@stber-koenig.de> */
25 #ifndef __GDIPLUS_METAHEADER_H
26 #define __GDIPLUS_METAHEADER_H
27 #pragma GCC system_header
31 * GDI+ metafile header structure
35 * FIXME: is 1 the correct value for GDIP_EMFPLUSFLAGS_DISPLAY? This number
36 * has been determined by calling Metafile::GetMetafileHeader() on a EMF+
37 * metafile which was recorded on a display device context (SampleMetafile.emf).
40 const UINT GDIP_EMFPLUSFLAGS_DISPLAY = 1;
42 #define GDIP_EMFPLUSFLAGS_DISPLAY ((UINT) 1)
45 typedef struct tagENHMETAHEADER3 {
61 } ENHMETAHEADER3,*LPENHMETAHEADER3;
63 typedef struct PWMFRect16 {
70 typedef struct WmfPlaceableFileHeader {
73 PWMFRect16 BoundingBox;
77 } WmfPlaceableFileHeader;
79 typedef struct MetafileHeader {
92 ENHMETAHEADER3 EmfHeader;
94 INT EmfPlusHeaderSize;
100 void GetBounds(Rect *rect) const
107 rect->Height = Height;
118 const ENHMETAHEADER3* GetEmfHeader() const
120 if (Type == MetafileTypeEmf
121 || Type == MetafileTypeEmfPlusOnly
122 || Type == MetafileTypeEmfPlusDual)
131 UINT GetEmfPlusFlags() const
135 UINT GetMetafileSize() const
139 MetafileType GetType() const
143 UINT GetVersion() const
147 const METAHEADER* GetWmfHeader() const
149 if (Type == MetafileTypeWmf || Type == MetafileTypeWmfPlaceable)
158 BOOL IsDisplay() const
160 return EmfPlusFlags == GDIP_EMFPLUSFLAGS_DISPLAY;
164 return Type == MetafileTypeEmf;
166 BOOL IsEmfOrEmfPlus() const
168 return Type == MetafileTypeEmf
169 || Type == MetafileTypeEmfPlusOnly
170 || Type == MetafileTypeEmfPlusDual;
172 BOOL IsEmfPlus() const
174 return Type == MetafileTypeEmfPlusOnly
175 || Type == MetafileTypeEmfPlusDual;
177 BOOL IsEmfPlusDual() const
179 return Type == MetafileTypeEmfPlusDual;
181 BOOL IsEmfPlusOnly() const
183 return Type == MetafileTypeEmfPlusOnly;
187 return Type == MetafileTypeWmf
188 || Type == MetafileTypeWmfPlaceable;
190 BOOL IsWmfPlaceable() const
192 return Type == MetafileTypeWmfPlaceable;
197 #endif /* __GDIPLUS_METAHEADER_H */