6 * This file is part of the w32api package.
8 * THIS SOFTWARE IS NOT COPYRIGHTED
10 * This source code is offered for use in the public domain. You may
11 * use, modify or distribute it freely.
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.
24 class Pen
: public GdiplusBase
26 friend class Graphics
;
29 Pen(const Brush
*brush
, REAL width
= 1.0f
)
33 Pen(const Color
&color
, REAL width
= 1.0f
)
35 Unit unit
= UnitWorld
;
37 status
= DllExports::GdipCreatePen1(color
.GetValue(),
48 PenAlignment
GetAlignment(VOID
)
50 return PenAlignmentCenter
;
58 Status
GetColor(Color
*color
)
61 Status status
= SetStatus(DllExports::GdipGetPenColor(pen
, &argb
));
63 color
->SetValue(argb
);
67 Status
GetCompoundArray(REAL
*compoundArray
, INT count
)
69 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count));
72 INT
GetCompoundArrayCount(VOID
)
75 SetStatus(DllExports::GdipGetPenCompoundCount(pen
, &count
));
79 Status
GetCustomEndCap(CustomLineCap
*customCap
)
81 return NotImplemented
;
84 Status
GetCustomStartCap(CustomLineCap
*customCap
)
86 return NotImplemented
;
89 DashCap
GetDashCap(VOID
)
94 REAL
GetDashOffset(VOID
)
97 SetStatus(DllExports::GdipGetPenDashOffset(pen
, &offset
));
101 Status
GetDashPattern(REAL
*dashArray
, INT count
)
103 return SetStatus(DllExports::GdipGetPenDashArray(pen
, dashArray
, count
));
106 INT
GetDashPatternCount(VOID
)
109 SetStatus(DllExports::GdipGetPenDashCount(pen
, &count
));
113 DashStyle
GetDashStyle(VOID
)
115 return DashStyleSolid
;
118 LineCap
GetEndCap(VOID
)
123 Status
GetLastStatus(VOID
)
125 return NotImplemented
;
128 LineJoin
GetLineJoin(VOID
)
130 return LineJoinMiter
;
133 REAL
GetMiterLimit(VOID
)
136 SetStatus(DllExports::GdipGetPenMiterLimit(pen
, &miterLimit
));
140 PenType
GetPenType(VOID
)
142 return PenTypeSolidColor
;
145 LineCap
GetStartCap(VOID
)
150 Status
GetTransform(Matrix
*matrix
)
152 return NotImplemented
;
158 SetStatus(DllExports::GdipGetPenWidth(pen
, &width
));
162 Status
MultiplyTransform(Matrix
*matrix
, MatrixOrder order
)
164 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? matrix->matrix : NULL, order));
167 Status
ResetTransform(VOID
)
169 return SetStatus(DllExports::GdipResetPenTransform(pen
));
172 Status
RotateTransform(REAL angle
, MatrixOrder order
)
174 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, order));
177 Status
ScaleTransform(REAL sx
, REAL sy
, MatrixOrder order
)
179 return SetStatus(DllExports::GdipScalePenTransform(pen
, sx
, sy
, order
));
182 Status
SetAlignment(PenAlignment penAlignment
)
184 return SetStatus(DllExports::GdipSetPenMode(pen
, penAlignment
));
187 Status
SetBrush(const Brush
*brush
)
189 return NotImplemented
; // FIXME: Brush unimplemented SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->brush : NULL));
192 Status
SetColor(const Color
&color
)
194 return SetStatus(DllExports::GdipSetPenColor(pen
, color
.GetValue()));
197 Status
SetCompoundArray(const REAL
*compoundArray
, INT count
)
199 return SetStatus(DllExports::GdipSetPenCompoundArray(pen
, compoundArray
, count
));
202 Status
SetCustomEndCap(const CustomLineCap
*customCap
)
204 return NotImplemented
;
207 Status
SetCustomStartCap(const CustomLineCap
*customCap
)
209 return NotImplemented
;
212 Status
SetDashCap(DashCap dashCap
)
214 return SetStatus(DllExports::GdipSetPenDashCap197819(pen
, dashCap
));
217 Status
SetDashOffset(REAL dashOffset
)
219 return SetStatus(DllExports::GdipSetPenDashOffset(pen
, dashOffset
));
222 Status
SetDashPattern(const REAL
*dashArray
, INT count
)
224 return SetStatus(DllExports::GdipSetPenDashArray(pen
, dashArray
, count
));
227 Status
SetDashStyle(DashStyle dashStyle
)
229 return SetStatus(DllExports::GdipSetPenDashStyle(pen
, dashStyle
));
232 Status
SetEndCap(LineCap endCap
)
234 return NotImplemented
;
237 Status
SetLineCap(LineCap startCap
, LineCap endCap
, DashCap dashCap
)
239 return NotImplemented
;
242 Status
SetLineJoin(LineJoin lineJoin
)
244 return NotImplemented
;
247 Status
SetMiterLimit(REAL miterLimit
)
249 return SetStatus(DllExports::GdipSetPenMiterLimit(pen
, miterLimit
));
252 Status
SetStartCap(LineCap startCap
)
254 return NotImplemented
;
257 Status
SetTransform(const Matrix
*matrix
)
259 return SetStatus(DllExports::GdipSetPenTransform(pen
, matrix
? matrix
->matrix
: NULL
));
262 Status
SetWidth(REAL width
)
264 return SetStatus(DllExports::GdipSetPenWidth(pen
, width
));
271 mutable Status status
;
273 Status
SetStatus(Status status
) const
277 this->status
= status
;
282 #endif /* _GDIPLUSPEN_H */