2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _GDIPLUSMETAHEADER_H
20 #define _GDIPLUSMETAHEADER_H
55 PWMFRect16 BoundingBox;
59 } WmfPlaceableFileHeader;
63 #define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001
82 ENHMETAHEADER3 EmfHeader;
84 INT EmfPlusHeaderSize;
89 MetafileType GetType() const { return Type; }
91 UINT GetMetafileSize() const { return Size; }
93 UINT GetVersion() const { return Version; }
95 UINT GetEmfPlusFlags() const { return EmfPlusFlags; }
97 REAL GetDpiX() const { return DpiX; }
99 REAL GetDpiY() const { return DpiY; }
101 VOID GetBounds (OUT Rect *r) const
111 return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfPlaceable));
114 BOOL IsWmfPlaceable() const { return (Type == MetafileTypeWmfPlaceable); }
116 BOOL IsEmf() const { return (Type == MetafileTypeEmf); }
118 BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); }
120 BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); }
122 BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); }
124 BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); }
126 BOOL IsDisplay() const
128 return IsEmfPlus() && ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0);
131 const METAHEADER * GetWmfHeader() const
133 return IsWmf() ? &WmfHeader : NULL;
136 const ENHMETAHEADER3 * GetEmfHeader() const
138 return IsEmfOrEmfPlus() ? &EmfHeader : NULL;
141 #else /* end of c++ typedefs */
143 typedef struct MetafileHeader
157 METAHEADER WmfHeader;
158 ENHMETAHEADER3 EmfHeader;
160 INT EmfPlusHeaderSize;
165 #endif /* end of c typedefs */
167 #endif /* _GDIPLUSMETAHEADER_H */