ReactOS  r76032
gdiplustypes.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 _GDIPLUSTYPES_H
20 #define _GDIPLUSTYPES_H
21 
22 typedef float REAL;
23 
24 enum Status{
25  Ok = 0,
34  Aborted = 9,
47 };
48 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 typedef BOOL (CALLBACK * ImageAbort)(VOID *);
57 typedef struct GdiplusAbort GdiplusAbort;
58 
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 
66 #ifdef __cplusplus
67 
68 class Point
69 {
70 public:
71  Point()
72  {
73  X = Y = 0;
74  }
75 
76  Point(IN const Point &pt)
77  {
78  X = pt.X;
79  Y = pt.Y;
80  }
81 
82  /* FIXME: missing constructor that takes a Size */
83 
84  Point(IN INT x, IN INT y)
85  {
86  X = x;
87  Y = y;
88  }
89 
90  Point operator+(IN const Point& pt) const
91  {
92  return Point(X + pt.X, Y + pt.Y);
93  }
94 
95  Point operator-(IN const Point& pt) const
96  {
97  return Point(X - pt.X, Y - pt.Y);
98  }
99 
100  BOOL Equals(IN const Point& pt)
101  {
102  return (X == pt.X) && (Y == pt.Y);
103  }
104 
105 public:
106  INT X;
107  INT Y;
108 };
109 
110 class PointF
111 {
112 public:
113  PointF()
114  {
115  X = Y = 0.0f;
116  }
117 
118  PointF(IN const PointF &pt)
119  {
120  X = pt.X;
121  Y = pt.Y;
122  }
123 
124  /* FIXME: missing constructor that takes a SizeF */
125 
126  PointF(IN REAL x, IN REAL y)
127  {
128  X = x;
129  Y = y;
130  }
131 
132  PointF operator+(IN const PointF& pt) const
133  {
134  return PointF(X + pt.X, Y + pt.Y);
135  }
136 
137  PointF operator-(IN const PointF& pt) const
138  {
139  return PointF(X - pt.X, Y - pt.Y);
140  }
141 
142  BOOL Equals(IN const PointF& pt)
143  {
144  return (X == pt.X) && (Y == pt.Y);
145  }
146 
147 public:
148  REAL X;
149  REAL Y;
150 };
151 
152 class PathData
153 {
154 public:
155  PathData()
156  {
157  Count = 0;
158  Points = NULL;
159  Types = NULL;
160  }
161 
162  ~PathData()
163  {
164  if (Points != NULL)
165  {
166  delete Points;
167  }
168 
169  if (Types != NULL)
170  {
171  delete Types;
172  }
173  }
174 
175 private:
176  PathData(const PathData &);
177  PathData& operator=(const PathData &);
178 
179 public:
180  INT Count;
181  PointF* Points;
182  BYTE* Types;
183 };
184 
185 /* FIXME: missing the methods. */
186 class RectF
187 {
188 public:
189  REAL X;
190  REAL Y;
191  REAL Width;
192  REAL Height;
193 };
194 
195 /* FIXME: missing the methods. */
196 class Rect
197 {
198 public:
199  INT X;
200  INT Y;
201  INT Width;
202  INT Height;
203 };
204 
205 class CharacterRange
206 {
207 public:
209  {
210  First = Length = 0;
211  }
212 
214  {
215  First = first;
216  Length = length;
217  }
218 
219  CharacterRange& operator=(const CharacterRange& rhs)
220  {
221  First = rhs.First;
222  Length = rhs.Length;
223  return *this;
224  }
225 public:
226  INT First;
227  INT Length;
228 };
229 
230 /* FIXME: missing the methods. */
231 class SizeF
232 {
233 public:
234  REAL Width;
235  REAL Height;
236 };
237 
238 #else /* end of c++ typedefs */
239 
240 typedef struct Point
241 {
244 } Point;
245 
246 typedef struct PointF
247 {
250 } PointF;
251 
252 typedef struct PathData
253 {
257 } PathData;
258 
259 typedef struct RectF
260 {
265 } RectF;
266 
267 typedef struct Rect
268 {
273 } Rect;
274 
275 typedef struct CharacterRange
276 {
280 
281 typedef enum Status Status;
282 
283 #endif /* end of c typedefs */
284 
285 #endif
#define IN
Definition: typedefs.h:38
BYTE * Types
Definition: gdiplustypes.h:256
complex< _Tp > _STLP_CALL operator-(const complex< _Tp > &__z)
Definition: _complex.h:622
#define pt(x, y)
Definition: drawing.c:79
INT Width
Definition: gdiplustypes.h:271
const GLint * first
Definition: glext.h:5794
struct GdiplusAbort GdiplusAbort
Definition: gdiplustypes.h:57
#define CALLBACK
Definition: compat.h:27
struct RectF RectF
int32_t INT
Definition: typedefs.h:56
EmfPlusRecordType
Definition: gdiplusenums.h:452
X(int i_=0)
INT X
Definition: gdiplustypes.h:269
smooth NULL
Definition: ftsmooth.c:557
REAL Height
Definition: gdiplustypes.h:264
struct PointF PointF
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
REAL X
Definition: gdiplustypes.h:261
REAL Y
Definition: gdiplustypes.h:249
CHString WINAPI operator+(WCHAR ch, const CHString &string)
Definition: chstring.cpp:1337
struct Point Point
VOID UINTN Length
Definition: acefiex.h:744
BOOL(CALLBACK * EnumerateMetafileProc)(EmfPlusRecordType, UINT, UINT, const BYTE *, VOID *)
Definition: gdiplustypes.h:59
REAL X
Definition: gdiplustypes.h:248
struct PathData PathData
float REAL
Definition: gdiplustypes.h:22
unsigned char BYTE
Definition: ntddk_ex.h:96
Status
Definition: gdiplustypes.h:24
REAL Width
Definition: gdiplustypes.h:263
ImageAbort GetThumbnailImageAbort
Definition: gdiplustypes.h:56
ImageAbort DrawImageAbort
Definition: gdiplustypes.h:55
PointF * Points
Definition: gdiplustypes.h:255
INT Height
Definition: gdiplustypes.h:272
INT Y
Definition: gdiplustypes.h:270
float REAL
Definition: types.h:41
#define UINT
Definition: msvc.h:27
REAL Y
Definition: gdiplustypes.h:262
INT INT y
Definition: msvc.h:62
#define BOOL
Definition: msvc.h:23
BOOL(CALLBACK * ImageAbort)(VOID *)
Definition: gdiplustypes.h:54
struct Rect Rect
struct CharacterRange CharacterRange
INT x
Definition: msvc.h:62