ReactOS  0.4.15-dev-321-g2d9b385
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 
22 typedef struct
23 {
40 
41 #include <pshpack2.h>
42 
43 typedef struct
44 {
49 } PWMFRect16;
50 
51 typedef struct
52 {
60 
61 #include <poppack.h>
62 
63 #define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001
64 
65 #ifdef __cplusplus
66 class MetafileHeader
67 {
68  public:
70  UINT Size;
71  UINT Version;
73  REAL DpiX;
74  REAL DpiY;
75  INT X;
76  INT Y;
77  INT Width;
78  INT Height;
79  union {
82  };
86 
87  public:
89  GetType() const
90  {
91  return Type;
92  }
93 
94  UINT
95  GetMetafileSize() const
96  {
97  return Size;
98  }
99 
100  UINT
101  GetVersion() const
102  {
103  return Version;
104  }
105 
106  UINT
107  GetEmfPlusFlags() const
108  {
109  return EmfPlusFlags;
110  }
111 
112  REAL
113  GetDpiX() const
114  {
115  return DpiX;
116  }
117 
118  REAL
119  GetDpiY() const
120  {
121  return DpiY;
122  }
123 
124  VOID
125  GetBounds(OUT Rect *r) const
126  {
127  r->X = X;
128  r->Y = Y;
129  r->Width = Width;
130  r->Height = Height;
131  }
132 
133  BOOL
134  IsWmf() const
135  {
136  return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfPlaceable));
137  }
138 
139  BOOL
140  IsWmfPlaceable() const
141  {
142  return (Type == MetafileTypeWmfPlaceable);
143  }
144 
145  BOOL
146  IsEmf() const
147  {
148  return (Type == MetafileTypeEmf);
149  }
150 
151  BOOL
152  IsEmfOrEmfPlus() const
153  {
154  return (Type >= MetafileTypeEmf);
155  }
156 
157  BOOL
158  IsEmfPlus() const
159  {
160  return (Type >= MetafileTypeEmfPlusOnly);
161  }
162 
163  BOOL
164  IsEmfPlusDual() const
165  {
166  return (Type == MetafileTypeEmfPlusDual);
167  }
168 
169  BOOL
170  IsEmfPlusOnly() const
171  {
172  return (Type == MetafileTypeEmfPlusOnly);
173  }
174 
175  BOOL
176  IsDisplay() const
177  {
178  return IsEmfPlus() && ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0);
179  }
180 
181  const METAHEADER *
182  GetWmfHeader() const
183  {
184  return IsWmf() ? &WmfHeader : NULL;
185  }
186 
187  const ENHMETAHEADER3 *
188  GetEmfHeader() const
189  {
190  return IsEmfOrEmfPlus() ? &EmfHeader : NULL;
191  }
192 };
193 #else /* end of c++ typedefs */
194 
195 typedef struct MetafileHeader
196 {
207  union {
210  } DUMMYUNIONNAME;
215 
216 #endif /* end of c typedefs */
217 
218 #endif /* _GDIPLUSMETAHEADER_H */
Type
Definition: Type.h:6
union MetafileHeader::@2890 DUMMYUNIONNAME
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
MetafileType Type
int32_t INT
Definition: typedefs.h:57
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
#define GDIP_EMFPLUSFLAGS_DISPLAY
ENHMETAHEADER3 EmfHeader
unsigned int UINT32
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
INT GetType(BOOL bLocal, LPOSVERSIONINFOEX osvi, LPSERVER_INFO_102 pBuf102)
Definition: gettype.c:129
unsigned int UINT
Definition: ndis.h:50
struct MetafileHeader MetafileHeader
#define OUT
Definition: typedefs.h:40
METAHEADER WmfHeader
float REAL
Definition: types.h:41
MetafileType
Definition: gdiplusenums.h:214
signed short INT16