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 PenAlignment penAlignment
;
51 SetStatus(DllExports::GdipGetPenMode(pen
, &penAlignment
));
60 Status
GetColor(Color
*color
)
63 Status status
= SetStatus(DllExports::GdipGetPenColor(pen
, &argb
));
65 color
->SetValue(argb
);
69 Status
GetCompoundArray(REAL
*compoundArray
, INT count
)
71 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count));
74 INT
GetCompoundArrayCount(VOID
)
77 SetStatus(DllExports::GdipGetPenCompoundCount(pen
, &count
));
81 Status
GetCustomEndCap(CustomLineCap
*customCap
)
83 return NotImplemented
;
86 Status
GetCustomStartCap(CustomLineCap
*customCap
)
88 return NotImplemented
;
91 DashCap
GetDashCap(VOID
)
94 SetStatus(DllExports::GdipGetPenDashCap197819(pen
, &dashCap
));
98 REAL
GetDashOffset(VOID
)
101 SetStatus(DllExports::GdipGetPenDashOffset(pen
, &offset
));
105 Status
GetDashPattern(REAL
*dashArray
, INT count
)
107 return SetStatus(DllExports::GdipGetPenDashArray(pen
, dashArray
, count
));
110 INT
GetDashPatternCount(VOID
)
113 SetStatus(DllExports::GdipGetPenDashCount(pen
, &count
));
117 DashStyle
GetDashStyle(VOID
)
120 SetStatus(DllExports::GdipGetPenDashStyle(pen
, &dashStyle
));
124 LineCap
GetEndCap(VOID
)
127 SetStatus(DllExports::GdipGetPenEndCap(pen
, &endCap
));
131 Status
GetLastStatus(VOID
)
136 LineJoin
GetLineJoin(VOID
)
139 SetStatus(DllExports::GdipGetPenLineJoin(pen
, &lineJoin
));
143 REAL
GetMiterLimit(VOID
)
146 SetStatus(DllExports::GdipGetPenMiterLimit(pen
, &miterLimit
));
150 PenType
GetPenType(VOID
)
153 SetStatus(DllExports::GdipGetPenFillType(pen
, &type
));
157 LineCap
GetStartCap(VOID
)
160 SetStatus(DllExports::GdipGetPenStartCap(pen
, &startCap
));
164 Status
GetTransform(Matrix
*matrix
)
166 return NotImplemented
;
172 SetStatus(DllExports::GdipGetPenWidth(pen
, &width
));
176 Status
MultiplyTransform(Matrix
*matrix
, MatrixOrder order
)
178 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? matrix->matrix : NULL, order));
181 Status
ResetTransform(VOID
)
183 return SetStatus(DllExports::GdipResetPenTransform(pen
));
186 Status
RotateTransform(REAL angle
, MatrixOrder order
)
188 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, order));
191 Status
ScaleTransform(REAL sx
, REAL sy
, MatrixOrder order
)
193 return SetStatus(DllExports::GdipScalePenTransform(pen
, sx
, sy
, order
));
196 Status
SetAlignment(PenAlignment penAlignment
)
198 return SetStatus(DllExports::GdipSetPenMode(pen
, penAlignment
));
201 Status
SetBrush(const Brush
*brush
)
203 return SetStatus(DllExports::GdipSetPenBrushFill(pen
, brush
? brush
->brush
: NULL
));
206 Status
SetColor(const Color
&color
)
208 return SetStatus(DllExports::GdipSetPenColor(pen
, color
.GetValue()));
211 Status
SetCompoundArray(const REAL
*compoundArray
, INT count
)
213 return SetStatus(DllExports::GdipSetPenCompoundArray(pen
, compoundArray
, count
));
216 Status
SetCustomEndCap(const CustomLineCap
*customCap
)
218 return NotImplemented
;
221 Status
SetCustomStartCap(const CustomLineCap
*customCap
)
223 return NotImplemented
;
226 Status
SetDashCap(DashCap dashCap
)
228 return SetStatus(DllExports::GdipSetPenDashCap197819(pen
, dashCap
));
231 Status
SetDashOffset(REAL dashOffset
)
233 return SetStatus(DllExports::GdipSetPenDashOffset(pen
, dashOffset
));
236 Status
SetDashPattern(const REAL
*dashArray
, INT count
)
238 return SetStatus(DllExports::GdipSetPenDashArray(pen
, dashArray
, count
));
241 Status
SetDashStyle(DashStyle dashStyle
)
243 return SetStatus(DllExports::GdipSetPenDashStyle(pen
, dashStyle
));
246 Status
SetEndCap(LineCap endCap
)
248 return SetStatus(DllExports::GdipSetPenEndCap(pen
, endCap
));
251 Status
SetLineCap(LineCap startCap
, LineCap endCap
, DashCap dashCap
)
253 return SetStatus(DllExports::GdipSetPenLineCap197819(pen
, startCap
, endCap
, dashCap
));
256 Status
SetLineJoin(LineJoin lineJoin
)
258 return SetStatus(DllExports::GdipSetPenLineJoin(pen
, lineJoin
));
261 Status
SetMiterLimit(REAL miterLimit
)
263 return SetStatus(DllExports::GdipSetPenMiterLimit(pen
, miterLimit
));
266 Status
SetStartCap(LineCap startCap
)
268 return SetStatus(DllExports::GdipSetPenStartCap(pen
, startCap
));
271 Status
SetTransform(const Matrix
*matrix
)
273 return SetStatus(DllExports::GdipSetPenTransform(pen
, matrix
? matrix
->matrix
: NULL
));
276 Status
SetWidth(REAL width
)
278 return SetStatus(DllExports::GdipSetPenWidth(pen
, width
));
285 mutable Status status
;
287 Status
SetStatus(Status status
) const
291 this->status
= status
;
296 #endif /* _GDIPLUSPEN_H */