ReactOS 0.4.16-dev-340-g0540c21
Pen Class Reference

#include <gdipluspen.h>

Inheritance diagram for Pen:
Collaboration diagram for Pen:

Public Member Functions

 Pen (const Brush *brush, REAL width=1.0f)
 
 Pen (const Color &color, REAL width=1.0f)
 
 ~Pen ()
 
PenClone ()
 
PenAlignment GetAlignment ()
 
BrushGetBrush ()
 
Status GetColor (Color *color)
 
Status GetCompoundArray (REAL *compoundArray, INT count)
 
INT GetCompoundArrayCount ()
 
Status GetCustomEndCap (CustomLineCap *customCap)
 
Status GetCustomStartCap (CustomLineCap *customCap)
 
DashCap GetDashCap ()
 
REAL GetDashOffset ()
 
Status GetDashPattern (REAL *dashArray, INT count)
 
INT GetDashPatternCount ()
 
DashStyle GetDashStyle ()
 
LineCap GetEndCap ()
 
Status GetLastStatus () const
 
LineJoin GetLineJoin ()
 
REAL GetMiterLimit ()
 
PenType GetPenType ()
 
LineCap GetStartCap ()
 
Status GetTransform (Matrix *matrix)
 
REAL GetWidth ()
 
Status MultiplyTransform (Matrix *matrix, MatrixOrder order=MatrixOrderPrepend)
 
Status ResetTransform ()
 
Status RotateTransform (REAL angle, MatrixOrder order=MatrixOrderPrepend)
 
Status ScaleTransform (REAL sx, REAL sy, MatrixOrder order=MatrixOrderPrepend)
 
Status SetAlignment (PenAlignment penAlignment)
 
Status SetBrush (const Brush *brush)
 
Status SetColor (const Color &color)
 
Status SetCompoundArray (const REAL *compoundArray, INT count)
 
Status SetCustomEndCap (const CustomLineCap *customCap)
 
Status SetCustomStartCap (const CustomLineCap *customCap)
 
Status SetDashCap (DashCap dashCap)
 
Status SetDashOffset (REAL dashOffset)
 
Status SetDashPattern (const REAL *dashArray, INT count)
 
Status SetDashStyle (DashStyle dashStyle)
 
Status SetEndCap (LineCap endCap)
 
Status SetLineCap (LineCap startCap, LineCap endCap, DashCap dashCap)
 
Status SetLineJoin (LineJoin lineJoin)
 
Status SetMiterLimit (REAL miterLimit)
 
Status SetStartCap (LineCap startCap)
 
Status SetTransform (const Matrix *matrix)
 
Status SetWidth (REAL width)
 
Status TranslateTransform (REAL dx, REAL dy, MatrixOrder order=MatrixOrderPrepend)
 
- Public Member Functions inherited from GdiplusBase
void operator delete (void *in_pVoid)
 
void operator delete[] (void *in_pVoid)
 
voidoperator new (size_t in_size)
 
voidoperator new[] (size_t in_size)
 

Protected Member Functions

Status SetStatus (Status status) const
 
 Pen (GpPen *pen, Status status)
 
VOID SetNativePen (GpPen *pen)
 

Protected Attributes

GpPennativePen
 
Status lastStatus
 

Private Member Functions

 Pen (const Pen &)
 
Penoperator= (const Pen &)
 

Friends

class Graphics
 
class GraphicsPath
 
GpPen *& getNat (const Pen *pen)
 

Detailed Description

Definition at line 22 of file gdipluspen.h.

Constructor & Destructor Documentation

◆ Pen() [1/4]

Pen::Pen ( const Brush brush,
REAL  width = 1.0f 
)
inline

Definition at line 28 of file gdipluspen.h.

29 {
30 lastStatus = DllExports::GdipCreatePen2(getNat(brush), width, UnitWorld, &nativePen);
31 }
Status lastStatus
Definition: gdipluspen.h:360
GpPen * nativePen
Definition: gdipluspen.h:359
friend GpPen *& getNat(const Pen *pen)
Definition: gdipluspen.h:388
#define NULL
Definition: types.h:112
@ UnitWorld
Definition: gdiplusenums.h:27
GLint GLint GLsizei width
Definition: gl.h:1546

◆ Pen() [2/4]

Pen::Pen ( const Color color,
REAL  width = 1.0f 
)
inline

Definition at line 33 of file gdipluspen.h.

34 {
35 lastStatus = DllExports::GdipCreatePen1(color.GetValue(), width, UnitWorld, &nativePen);
36 }
GLuint color
Definition: glext.h:6243

◆ ~Pen()

Pen::~Pen ( )
inline

Definition at line 38 of file gdipluspen.h.

39 {
40 DllExports::GdipDeletePen(nativePen);
41 }

◆ Pen() [3/4]

Pen::Pen ( GpPen pen,
Status  status 
)
inlineprotected

Definition at line 370 of file gdipluspen.h.

371 {
372 }
Definition: ps.c:97

◆ Pen() [4/4]

Pen::Pen ( const Pen )
private

Member Function Documentation

◆ Clone()

Pen * Pen::Clone ( )
inline

Definition at line 44 of file gdipluspen.h.

45 {
46 GpPen *clonePen = NULL;
47 SetStatus(DllExports::GdipClonePen(nativePen, &clonePen));
48 if (lastStatus != Ok)
49 return NULL;
50 Pen *newPen = new Pen(clonePen, lastStatus);
51 if (!newPen)
52 DllExports::GdipDeletePen(clonePen);
53 return newPen;
54 }
Definition: gdipluspen.h:23
Status SetStatus(Status status) const
Definition: gdipluspen.h:363
@ Ok
Definition: gdiplustypes.h:26

◆ GetAlignment()

PenAlignment Pen::GetAlignment ( )
inline

Definition at line 57 of file gdipluspen.h.

58 {
59 PenAlignment penAlignment;
60 SetStatus(DllExports::GdipGetPenMode(nativePen, &penAlignment));
61 return penAlignment;
62 }
PenAlignment
Definition: gdiplusenums.h:154

◆ GetBrush()

Brush * Pen::GetBrush ( )
inline

Definition at line 65 of file gdipluspen.h.

66 {
67 // FIXME
68 return NULL;
69 }

◆ GetColor()

Status Pen::GetColor ( Color color)
inline

Definition at line 72 of file gdipluspen.h.

73 {
74 if (!color)
76
77 ARGB argb;
78 SetStatus(DllExports::GdipGetPenColor(nativePen, &argb));
79 color->SetValue(argb);
80 return lastStatus;
81 }
DWORD ARGB
@ InvalidParameter
Definition: gdiplustypes.h:28

◆ GetCompoundArray()

Status Pen::GetCompoundArray ( REAL compoundArray,
INT  count 
)
inline

Definition at line 84 of file gdipluspen.h.

85 {
86 if (!compoundArray || count <= 0)
88#if 1
90#else
91 return SetStatus(DllExports::GdipGetPenCompoundArray(nativePen, compoundArray, count));
92#endif
93 }
@ NotImplemented
Definition: gdiplustypes.h:32
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ GetCompoundArrayCount()

INT Pen::GetCompoundArrayCount ( )
inline

Definition at line 96 of file gdipluspen.h.

97 {
98 INT count = 0;
99 SetStatus(DllExports::GdipGetPenCompoundCount(nativePen, &count));
100 return count;
101 }
int32_t INT
Definition: typedefs.h:58

◆ GetCustomEndCap()

Status Pen::GetCustomEndCap ( CustomLineCap customCap)
inline

Definition at line 104 of file gdipluspen.h.

105 {
106 if (!customCap)
108
109 return SetStatus(DllExports::GdipGetPenCustomEndCap(nativePen, &getNat(customCap)));
110 }

◆ GetCustomStartCap()

Status Pen::GetCustomStartCap ( CustomLineCap customCap)
inline

Definition at line 113 of file gdipluspen.h.

114 {
115 if (!customCap)
117
118 return SetStatus(DllExports::GdipGetPenCustomStartCap(nativePen, &getNat(customCap)));
119 }

◆ GetDashCap()

DashCap Pen::GetDashCap ( )
inline

Definition at line 122 of file gdipluspen.h.

123 {
124 DashCap dashCap;
125 SetStatus(DllExports::GdipGetPenDashCap197819(nativePen, &dashCap));
126 return dashCap;
127 }
DashCap
Definition: gdiplusenums.h:170

◆ GetDashOffset()

REAL Pen::GetDashOffset ( )
inline

Definition at line 130 of file gdipluspen.h.

131 {
132 REAL offset;
133 SetStatus(DllExports::GdipGetPenDashOffset(nativePen, &offset));
134 return offset;
135 }
float REAL
Definition: types.h:41
GLintptr offset
Definition: glext.h:5920

◆ GetDashPattern()

Status Pen::GetDashPattern ( REAL dashArray,
INT  count 
)
inline

Definition at line 138 of file gdipluspen.h.

139 {
140 if (dashArray == NULL || count <= 0)
142
143 return SetStatus(DllExports::GdipGetPenDashArray(nativePen, dashArray, count));
144 }
GLsizei const GLfloat * dashArray
Definition: glext.h:11725

◆ GetDashPatternCount()

INT Pen::GetDashPatternCount ( )
inline

Definition at line 147 of file gdipluspen.h.

148 {
149 INT count = 0;
150 SetStatus(DllExports::GdipGetPenDashCount(nativePen, &count));
151 return count;
152 }

◆ GetDashStyle()

DashStyle Pen::GetDashStyle ( )
inline

Definition at line 155 of file gdipluspen.h.

156 {
157 DashStyle dashStyle;
158 SetStatus(DllExports::GdipGetPenDashStyle(nativePen, &dashStyle));
159 return dashStyle;
160 }
DashStyle
Definition: gdiplusenums.h:177

◆ GetEndCap()

LineCap Pen::GetEndCap ( )
inline

Definition at line 163 of file gdipluspen.h.

164 {
165 LineCap endCap;
166 SetStatus(DllExports::GdipGetPenEndCap(nativePen, &endCap));
167 return endCap;
168 }
LineCap
Definition: gdiplusenums.h:60

◆ GetLastStatus()

Status Pen::GetLastStatus ( ) const
inline

Definition at line 171 of file gdipluspen.h.

172 {
173 return lastStatus;
174 }

◆ GetLineJoin()

LineJoin Pen::GetLineJoin ( )
inline

Definition at line 177 of file gdipluspen.h.

178 {
179 LineJoin lineJoin;
180 SetStatus(DllExports::GdipGetPenLineJoin(nativePen, &lineJoin));
181 return lineJoin;
182 }
LineJoin
Definition: gdiplusenums.h:105

◆ GetMiterLimit()

REAL Pen::GetMiterLimit ( )
inline

Definition at line 185 of file gdipluspen.h.

186 {
187 REAL miterLimit;
188 SetStatus(DllExports::GdipGetPenMiterLimit(nativePen, &miterLimit));
189 return miterLimit;
190 }

◆ GetPenType()

PenType Pen::GetPenType ( )
inline

Definition at line 193 of file gdipluspen.h.

194 {
196 SetStatus(DllExports::GdipGetPenFillType(nativePen, &type));
197 return type;
198 }
PenType
Definition: gdiplusenums.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ GetStartCap()

LineCap Pen::GetStartCap ( )
inline

Definition at line 201 of file gdipluspen.h.

202 {
203 LineCap startCap;
204 SetStatus(DllExports::GdipGetPenStartCap(nativePen, &startCap));
205 return startCap;
206 }

◆ GetTransform()

Status Pen::GetTransform ( Matrix matrix)
inline

Definition at line 209 of file gdipluspen.h.

210 {
211 return SetStatus(DllExports::GdipGetPenTransform(nativePen, getNat(matrix)));
212 }
GLuint GLenum matrix
Definition: glext.h:9407

◆ GetWidth()

REAL Pen::GetWidth ( )
inline

Definition at line 215 of file gdipluspen.h.

216 {
217 REAL width;
218 SetStatus(DllExports::GdipGetPenWidth(nativePen, &width));
219 return width;
220 }

◆ MultiplyTransform()

Status Pen::MultiplyTransform ( Matrix matrix,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 223 of file gdipluspen.h.

224 {
225 return SetStatus(DllExports::GdipMultiplyPenTransform(nativePen, getNat(matrix), order));
226 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

◆ operator=()

Pen & Pen::operator= ( const Pen )
private

◆ ResetTransform()

Status Pen::ResetTransform ( )
inline

Definition at line 229 of file gdipluspen.h.

230 {
231 return SetStatus(DllExports::GdipResetPenTransform(nativePen));
232 }

◆ RotateTransform()

Status Pen::RotateTransform ( REAL  angle,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 235 of file gdipluspen.h.

236 {
237 return SetStatus(DllExports::GdipRotatePenTransform(nativePen, angle, order));
238 }
GLfloat angle
Definition: glext.h:10853

◆ ScaleTransform()

Status Pen::ScaleTransform ( REAL  sx,
REAL  sy,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 241 of file gdipluspen.h.

242 {
243 return SetStatus(DllExports::GdipScalePenTransform(nativePen, sx, sy, order));
244 }

◆ SetAlignment()

Status Pen::SetAlignment ( PenAlignment  penAlignment)
inline

Definition at line 247 of file gdipluspen.h.

248 {
249 return SetStatus(DllExports::GdipSetPenMode(nativePen, penAlignment));
250 }

◆ SetBrush()

Status Pen::SetBrush ( const Brush brush)
inline

Definition at line 253 of file gdipluspen.h.

254 {
255 GpBrush *theBrush = brush ? getNat(brush) : NULL;
256 return SetStatus(DllExports::GdipSetPenBrushFill(nativePen, theBrush));
257 }

◆ SetColor()

Status Pen::SetColor ( const Color color)
inline

Definition at line 260 of file gdipluspen.h.

261 {
262 return SetStatus(DllExports::GdipSetPenColor(nativePen, color.GetValue()));
263 }

◆ SetCompoundArray()

Status Pen::SetCompoundArray ( const REAL compoundArray,
INT  count 
)
inline

Definition at line 266 of file gdipluspen.h.

267 {
268 return SetStatus(DllExports::GdipSetPenCompoundArray(nativePen, compoundArray, count));
269 }

◆ SetCustomEndCap()

Status Pen::SetCustomEndCap ( const CustomLineCap customCap)
inline

Definition at line 272 of file gdipluspen.h.

273 {
274 GpCustomLineCap *cap = customCap ? getNat(customCap) : NULL;
275 return SetStatus(DllExports::GdipSetPenCustomEndCap(nativePen, cap));
276 }
GLenum cap
Definition: glext.h:9639

◆ SetCustomStartCap()

Status Pen::SetCustomStartCap ( const CustomLineCap customCap)
inline

Definition at line 279 of file gdipluspen.h.

280 {
281 GpCustomLineCap *cap = customCap ? getNat(customCap) : NULL;
282 return SetStatus(DllExports::GdipSetPenCustomStartCap(nativePen, cap));
283 }

◆ SetDashCap()

Status Pen::SetDashCap ( DashCap  dashCap)
inline

Definition at line 286 of file gdipluspen.h.

287 {
288 return SetStatus(DllExports::GdipSetPenDashCap197819(nativePen, dashCap));
289 }

◆ SetDashOffset()

Status Pen::SetDashOffset ( REAL  dashOffset)
inline

Definition at line 292 of file gdipluspen.h.

293 {
294 return SetStatus(DllExports::GdipSetPenDashOffset(nativePen, dashOffset));
295 }

◆ SetDashPattern()

Status Pen::SetDashPattern ( const REAL dashArray,
INT  count 
)
inline

Definition at line 298 of file gdipluspen.h.

299 {
300 return SetStatus(DllExports::GdipSetPenDashArray(nativePen, dashArray, count));
301 }

◆ SetDashStyle()

Status Pen::SetDashStyle ( DashStyle  dashStyle)
inline

Definition at line 304 of file gdipluspen.h.

305 {
306 return SetStatus(DllExports::GdipSetPenDashStyle(nativePen, dashStyle));
307 }

◆ SetEndCap()

Status Pen::SetEndCap ( LineCap  endCap)
inline

Definition at line 310 of file gdipluspen.h.

311 {
312 return SetStatus(DllExports::GdipSetPenEndCap(nativePen, endCap));
313 }

◆ SetLineCap()

Status Pen::SetLineCap ( LineCap  startCap,
LineCap  endCap,
DashCap  dashCap 
)
inline

Definition at line 316 of file gdipluspen.h.

317 {
318 return SetStatus(DllExports::GdipSetPenLineCap197819(nativePen, startCap, endCap, dashCap));
319 }

◆ SetLineJoin()

Status Pen::SetLineJoin ( LineJoin  lineJoin)
inline

Definition at line 322 of file gdipluspen.h.

323 {
324 return SetStatus(DllExports::GdipSetPenLineJoin(nativePen, lineJoin));
325 }

◆ SetMiterLimit()

Status Pen::SetMiterLimit ( REAL  miterLimit)
inline

Definition at line 328 of file gdipluspen.h.

329 {
330 return SetStatus(DllExports::GdipSetPenMiterLimit(nativePen, miterLimit));
331 }

◆ SetNativePen()

VOID Pen::SetNativePen ( GpPen pen)
inlineprotected

Definition at line 375 of file gdipluspen.h.

376 {
377 nativePen = pen;
378 }

◆ SetStartCap()

Status Pen::SetStartCap ( LineCap  startCap)
inline

Definition at line 334 of file gdipluspen.h.

335 {
336 return SetStatus(DllExports::GdipSetPenStartCap(nativePen, startCap));
337 }

◆ SetStatus()

◆ SetTransform()

Status Pen::SetTransform ( const Matrix matrix)
inline

Definition at line 340 of file gdipluspen.h.

341 {
343 return SetStatus(DllExports::GdipSetPenTransform(nativePen, mat));
344 }
static const MAT2 mat
Definition: font.c:66

◆ SetWidth()

Status Pen::SetWidth ( REAL  width)
inline

Definition at line 347 of file gdipluspen.h.

348 {
349 return SetStatus(DllExports::GdipSetPenWidth(nativePen, width));
350 }

◆ TranslateTransform()

Status Pen::TranslateTransform ( REAL  dx,
REAL  dy,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 353 of file gdipluspen.h.

354 {
355 return SetStatus(DllExports::GdipTranslatePenTransform(nativePen, dx, dy, order));
356 }
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97

Friends And Related Function Documentation

◆ getNat

GpPen *& getNat ( const Pen pen)
friend

Definition at line 388 of file gdipluspen.h.

389 {
390 return const_cast<Pen *>(pen)->nativePen;
391 }

Referenced by GetCustomEndCap(), GetCustomStartCap(), GetTransform(), MultiplyTransform(), Pen(), SetBrush(), SetCustomEndCap(), SetCustomStartCap(), and SetTransform().

◆ Graphics

friend class Graphics
friend

Definition at line 25 of file gdipluspen.h.

◆ GraphicsPath

friend class GraphicsPath
friend

Definition at line 26 of file gdipluspen.h.

Member Data Documentation

◆ lastStatus

Status Pen::lastStatus
mutableprotected

Definition at line 360 of file gdipluspen.h.

Referenced by Clone(), GetColor(), GetLastStatus(), Pen(), and SetStatus().

◆ nativePen


The documentation for this class was generated from the following file: