[PSDK][GDIPLUS]
[reactos.git] / reactos / sdk / include / psdk / gdiplustypes.h
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,
26 GenericError = 1,
27 InvalidParameter = 2,
28 OutOfMemory = 3,
29 ObjectBusy = 4,
30 InsufficientBuffer = 5,
31 NotImplemented = 6,
32 Win32Error = 7,
33 WrongState = 8,
34 Aborted = 9,
35 FileNotFound = 10,
36 ValueOverflow = 11,
37 AccessDenied = 12,
38 UnknownImageFormat = 13,
39 FontFamilyNotFound = 14,
40 FontStyleNotFound = 15,
41 NotTrueTypeFont = 16,
42 UnsupportedGdiplusVersion = 17,
43 GdiplusNotInitialized = 18,
44 PropertyNotFound = 19,
45 PropertyNotSupported = 20,
46 ProfileNotFound = 21
47 };
48
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 typedef BOOL (CALLBACK * ImageAbort)(VOID *);
55 typedef ImageAbort DrawImageAbort;
56 typedef ImageAbort GetThumbnailImageAbort;
57 typedef struct GdiplusAbort GdiplusAbort;
58
59 typedef BOOL (CALLBACK * EnumerateMetafileProc)(EmfPlusRecordType,UINT,UINT,const BYTE*,VOID*);
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:
208 CharacterRange()
209 {
210 First = Length = 0;
211 }
212
213 CharacterRange(INT first, INT length)
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 {
242 INT X;
243 INT Y;
244 } Point;
245
246 typedef struct PointF
247 {
248 REAL X;
249 REAL Y;
250 } PointF;
251
252 typedef struct PathData
253 {
254 INT Count;
255 PointF* Points;
256 BYTE* Types;
257 } PathData;
258
259 typedef struct RectF
260 {
261 REAL X;
262 REAL Y;
263 REAL Width;
264 REAL Height;
265 } RectF;
266
267 typedef struct Rect
268 {
269 INT X;
270 INT Y;
271 INT Width;
272 INT Height;
273 } Rect;
274
275 typedef struct CharacterRange
276 {
277 INT First;
278 INT Length;
279 } CharacterRange;
280
281 typedef enum Status Status;
282
283 #endif /* end of c typedefs */
284
285 #endif