ReactOS 0.4.17-dev-243-g1369312
gdiplusmetaheader.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007 Google (Evan Stade)
3 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef _GDIPLUSMETAHEADER_H
20#define _GDIPLUSMETAHEADER_H
21
22typedef struct
23{
40
41#include <pshpack2.h>
42
43typedef struct
44{
50
51typedef struct
52{
60
61#include <poppack.h>
62
63#define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001
64
65#ifdef __cplusplus
67{
68public:
70 UINT Size;
73 REAL DpiX;
74 REAL DpiY;
75 INT X;
76 INT Y;
77 INT Width;
78 INT Height;
79 union
80 {
83 };
87
88public:
89 MetafileType GetType() const { return Type; }
90
91 UINT GetMetafileSize() const { return Size; }
92
93 UINT GetVersion() const { return Version; }
94
95 UINT GetEmfPlusFlags() const { return EmfPlusFlags; }
96
97 REAL GetDpiX() const { return DpiX; }
98
99 REAL GetDpiY() const { return DpiY; }
100
101 VOID GetBounds (OUT Rect *r) const
102 {
103 r->X = X;
104 r->Y = Y;
105 r->Width = Width;
106 r->Height = Height;
107 }
108
109 BOOL IsWmf() const
110 {
112 }
113
114 BOOL IsWmfPlaceable() const { return (Type == MetafileTypeWmfPlaceable); }
115
116 BOOL IsEmf() const { return (Type == MetafileTypeEmf); }
117
118 BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); }
119
120 BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); }
121
122 BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); }
123
124 BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); }
125
126 BOOL IsDisplay() const
127 {
128 return IsEmfPlus() && ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0);
129 }
130
131 const METAHEADER * GetWmfHeader() const
132 {
133 return IsWmf() ? &WmfHeader : NULL;
134 }
135
136 const ENHMETAHEADER3 * GetEmfHeader() const
137 {
138 return IsEmfOrEmfPlus() ? &EmfHeader : NULL;
139 }
140};
141#else /* end of c++ typedefs */
142
143typedef struct MetafileHeader
144{
155 union
156 {
164
165#endif /* end of c typedefs */
166
167#endif /* _GDIPLUSMETAHEADER_H */
Type
Definition: Type.h:7
short INT16
Definition: actypes.h:130
#define NULL
Definition: types.h:112
float REAL
Definition: types.h:41
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
MetafileType
Definition: gdiplusenums.h:213
@ MetafileTypeEmfPlusOnly
Definition: gdiplusenums.h:218
@ MetafileTypeWmf
Definition: gdiplusenums.h:215
@ MetafileTypeWmfPlaceable
Definition: gdiplusenums.h:216
@ MetafileTypeEmf
Definition: gdiplusenums.h:217
@ MetafileTypeEmfPlusDual
Definition: gdiplusenums.h:219
#define GDIP_EMFPLUSFLAGS_DISPLAY
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
unsigned int UINT
Definition: ndis.h:50
MetafileType Type
ENHMETAHEADER3 EmfHeader
union MetafileHeader::@3225 DUMMYUNIONNAME
METAHEADER WmfHeader
int32_t INT
Definition: typedefs.h:58
uint32_t UINT32
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define GetType(This)
Definition: conio.h:54