a8b2e0612a0a01d2a56d49f006368b7ea52ded05
[reactos.git] / reactos / sdk / include / psdk / gdipluspen.h
1 /*
2 * GdiPlusPen.h
3 *
4 * Windows GDI+
5 *
6 * This file is part of the w32api package.
7 *
8 * THIS SOFTWARE IS NOT COPYRIGHTED
9 *
10 * This source code is offered for use in the public domain. You may
11 * use, modify or distribute it freely.
12 *
13 * This code is distributed in the hope that it will be useful but
14 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15 * DISCLAIMED. This includes but is not limited to warranties of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 */
18
19 #ifndef _GDIPLUSPEN_H
20 #define _GDIPLUSPEN_H
21
22 class CustomLineCap;
23
24 class Pen : public GdiplusBase
25 {
26 friend class Graphics;
27
28 public:
29 Pen(const Brush *brush, REAL width = 1.0f)
30 {
31 }
32
33 Pen(const Color &color, REAL width = 1.0f)
34 {
35 Unit unit = UnitWorld;
36 pen = NULL;
37 status = DllExports::GdipCreatePen1(color.GetValue(),
38 width,
39 unit,
40 &pen);
41 }
42
43 Pen *Clone(VOID)
44 {
45 return NULL;
46 }
47
48 PenAlignment GetAlignment(VOID)
49 {
50 return PenAlignmentCenter;
51 }
52
53 Brush *GetBrush(VOID)
54 {
55 return NULL;
56 }
57
58 Status GetColor(Color *color)
59 {
60 ARGB argb;
61 Status status = SetStatus(DllExports::GdipGetPenColor(pen, &argb));
62 if (color)
63 color->SetValue(argb);
64 return status;
65 }
66
67 Status GetCompoundArray(REAL *compoundArray, INT count)
68 {
69 return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count));
70 }
71
72 INT GetCompoundArrayCount(VOID)
73 {
74 INT count;
75 SetStatus(DllExports::GdipGetPenCompoundCount(pen, &count));
76 return count;
77 }
78
79 Status GetCustomEndCap(CustomLineCap *customCap)
80 {
81 return NotImplemented;
82 }
83
84 Status GetCustomStartCap(CustomLineCap *customCap)
85 {
86 return NotImplemented;
87 }
88
89 DashCap GetDashCap(VOID)
90 {
91 return DashCapFlat;
92 }
93
94 REAL GetDashOffset(VOID)
95 {
96 REAL offset;
97 SetStatus(DllExports::GdipGetPenDashOffset(pen, &offset));
98 return offset;
99 }
100
101 Status GetDashPattern(REAL *dashArray, INT count)
102 {
103 return SetStatus(DllExports::GdipGetPenDashArray(pen, dashArray, count));
104 }
105
106 INT GetDashPatternCount(VOID)
107 {
108 INT count;
109 SetStatus(DllExports::GdipGetPenDashCount(pen, &count));
110 return count;
111 }
112
113 DashStyle GetDashStyle(VOID)
114 {
115 return DashStyleSolid;
116 }
117
118 LineCap GetEndCap(VOID)
119 {
120 return LineCapFlat;
121 }
122
123 Status GetLastStatus(VOID)
124 {
125 return NotImplemented;
126 }
127
128 LineJoin GetLineJoin(VOID)
129 {
130 return LineJoinMiter;
131 }
132
133 REAL GetMiterLimit(VOID)
134 {
135 REAL miterLimit;
136 SetStatus(DllExports::GdipGetPenMiterLimit(pen, &miterLimit));
137 return miterLimit;
138 }
139
140 PenType GetPenType(VOID)
141 {
142 return PenTypeSolidColor;
143 }
144
145 LineCap GetStartCap(VOID)
146 {
147 return LineCapFlat;
148 }
149
150 Status GetTransform(Matrix *matrix)
151 {
152 return NotImplemented;
153 }
154
155 REAL GetWidth(VOID)
156 {
157 REAL width;
158 SetStatus(DllExports::GdipGetPenWidth(pen, &width));
159 return width;
160 }
161
162 Status MultiplyTransform(Matrix *matrix, MatrixOrder order)
163 {
164 return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? matrix->matrix : NULL, order));
165 }
166
167 Status ResetTransform(VOID)
168 {
169 return SetStatus(DllExports::GdipResetPenTransform(pen));
170 }
171
172 Status RotateTransform(REAL angle, MatrixOrder order)
173 {
174 return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, order));
175 }
176
177 Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order)
178 {
179 return SetStatus(DllExports::GdipScalePenTransform(pen, sx, sy, order));
180 }
181
182 Status SetAlignment(PenAlignment penAlignment)
183 {
184 return SetStatus(DllExports::GdipSetPenMode(pen, penAlignment));
185 }
186
187 Status SetBrush(const Brush *brush)
188 {
189 return NotImplemented; // FIXME: Brush unimplemented SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->brush : NULL));
190 }
191
192 Status SetColor(const Color &color)
193 {
194 return SetStatus(DllExports::GdipSetPenColor(pen, color.GetValue()));
195 }
196
197 Status SetCompoundArray(const REAL *compoundArray, INT count)
198 {
199 return SetStatus(DllExports::GdipSetPenCompoundArray(pen, compoundArray, count));
200 }
201
202 Status SetCustomEndCap(const CustomLineCap *customCap)
203 {
204 return NotImplemented;
205 }
206
207 Status SetCustomStartCap(const CustomLineCap *customCap)
208 {
209 return NotImplemented;
210 }
211
212 Status SetDashCap(DashCap dashCap)
213 {
214 return SetStatus(DllExports::GdipSetPenDashCap197819(pen, dashCap));
215 }
216
217 Status SetDashOffset(REAL dashOffset)
218 {
219 return SetStatus(DllExports::GdipSetPenDashOffset(pen, dashOffset));
220 }
221
222 Status SetDashPattern(const REAL *dashArray, INT count)
223 {
224 return SetStatus(DllExports::GdipSetPenDashArray(pen, dashArray, count));
225 }
226
227 Status SetDashStyle(DashStyle dashStyle)
228 {
229 return SetStatus(DllExports::GdipSetPenDashStyle(pen, dashStyle));
230 }
231
232 Status SetEndCap(LineCap endCap)
233 {
234 return NotImplemented;
235 }
236
237 Status SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)
238 {
239 return NotImplemented;
240 }
241
242 Status SetLineJoin(LineJoin lineJoin)
243 {
244 return NotImplemented;
245 }
246
247 Status SetMiterLimit(REAL miterLimit)
248 {
249 return SetStatus(DllExports::GdipSetPenMiterLimit(pen, miterLimit));
250 }
251
252 Status SetStartCap(LineCap startCap)
253 {
254 return NotImplemented;
255 }
256
257 Status SetTransform(const Matrix *matrix)
258 {
259 return SetStatus(DllExports::GdipSetPenTransform(pen, matrix ? matrix->matrix : NULL));
260 }
261
262 Status SetWidth(REAL width)
263 {
264 return SetStatus(DllExports::GdipSetPenWidth(pen, width));
265 }
266
267 private:
268 GpPen *pen;
269
270 private:
271 mutable Status status;
272
273 Status SetStatus(Status status) const
274 {
275 if (status == Ok)
276 return status;
277 this->status = status;
278 return status;
279 }
280 };
281
282 #endif /* _GDIPLUSPEN_H */