wintrust: Implement SPC PE image decoding.
[wine] / include / 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 typedef BOOL (CALLBACK * ImageAbort)(VOID *);
25 typedef ImageAbort DrawImageAbort;
26
27 enum Status{
28     Ok                          = 0,
29     GenericError                = 1,
30     InvalidParameter            = 2,
31     OutOfMemory                 = 3,
32     ObjectBusy                  = 4,
33     InsufficientBuffer          = 5,
34     NotImplemented              = 6,
35     Win32Error                  = 7,
36     WrongState                  = 8,
37     Aborted                     = 9,
38     FileNotFound                = 10,
39     ValueOverflow               = 11,
40     AccessDenied                = 12,
41     UnknownImageFormat          = 13,
42     FontFamilyNotFound          = 14,
43     FontStyleNotFound           = 15,
44     NotTrueTypeFont             = 16,
45     UnsupportedGdiplusVersion   = 17,
46     GdiplusNotInitialized       = 18,
47     PropertyNotFound            = 19,
48     PropertyNotSupported        = 20
49 };
50
51 #ifdef __cplusplus
52
53 class Point
54 {
55 public:
56    Point()
57    {
58        X = Y = 0;
59    }
60
61    Point(IN const Point &pt)
62    {
63        X = pt.X;
64        Y = pt.Y;
65    }
66
67    /* FIXME: missing constructor that takes a Size */
68
69    Point(IN INT x, IN INT y)
70    {
71        X = x;
72        Y = y;
73    }
74
75    Point operator+(IN const Point& pt) const
76    {
77        return Point(X + pt.X, Y + pt.Y);
78    }
79
80    Point operator-(IN const Point& pt) const
81    {
82        return Point(X - pt.X, Y - pt.Y);
83    }
84
85    BOOL Equals(IN const Point& pt)
86    {
87        return (X == pt.X) && (Y == pt.Y);
88    }
89
90 public:
91     INT X;
92     INT Y;
93 };
94
95 class PointF
96 {
97 public:
98    PointF()
99    {
100        X = Y = 0.0f;
101    }
102
103    PointF(IN const PointF &pt)
104    {
105        X = pt.X;
106        Y = pt.Y;
107    }
108
109    /* FIXME: missing constructor that takes a SizeF */
110
111    PointF(IN REAL x, IN REAL y)
112    {
113        X = x;
114        Y = y;
115    }
116
117    PointF operator+(IN const PointF& pt) const
118    {
119        return PointF(X + pt.X, Y + pt.Y);
120    }
121
122    PointF operator-(IN const PointF& pt) const
123    {
124        return PointF(X - pt.X, Y - pt.Y);
125    }
126
127    BOOL Equals(IN const PointF& pt)
128    {
129        return (X == pt.X) && (Y == pt.Y);
130    }
131
132 public:
133     REAL X;
134     REAL Y;
135 };
136
137 class PathData
138 {
139 public:
140     PathData()
141     {
142         Count = 0;
143         Points = NULL;
144         Types = NULL;
145     }
146
147     ~PathData()
148     {
149         if (Points != NULL)
150         {
151             delete Points;
152         }
153
154         if (Types != NULL)
155         {
156             delete Types;
157         }
158     }
159
160 private:
161     PathData(const PathData &);
162     PathData& operator=(const PathData &);
163
164 public:
165     INT Count;
166     PointF* Points;
167     BYTE* Types;
168 };
169
170 /* FIXME: missing the methods. */
171 class RectF
172 {
173 public:
174     REAL X;
175     REAL Y;
176     REAL Width;
177     REAL Height;
178 };
179
180 class Rect
181 {
182 public:
183     INT X;
184     INT Y;
185     INT Width;
186     INT Height;
187 };
188
189 #else /* end of c++ typedefs */
190
191 typedef struct Point
192 {
193     INT X;
194     INT Y;
195 } Point;
196
197 typedef struct PointF
198 {
199     REAL X;
200     REAL Y;
201 } PointF;
202
203 typedef struct PathData
204 {
205     INT Count;
206     PointF* Points;
207     BYTE* Types;
208 } PathData;
209
210 typedef struct RectF
211 {
212     REAL X;
213     REAL Y;
214     REAL Width;
215     REAL Height;
216 } RectF;
217
218 typedef struct Rect
219 {
220     INT X;
221     INT Y;
222     INT Width;
223     INT Height;
224 } Rect;
225
226 typedef enum Status Status;
227
228 #endif /* end of c typedefs */
229
230 #endif