ReactOS  0.4.9-dev-717-g6d91262
gdipluspen.h
Go to the documentation of this file.
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  {
36  pen = NULL;
37  status = DllExports::GdipCreatePen1(color.GetValue(),
38  width,
39  unit,
40  &pen);
41  }
42 
44  {
45  return NULL;
46  }
47 
49  {
50  PenAlignment penAlignment;
51  SetStatus(DllExports::GdipGetPenMode(pen, &penAlignment));
52  return penAlignment;
53  }
54 
56  {
57  return NULL;
58  }
59 
61  {
62  ARGB argb;
64  if (color)
65  color->SetValue(argb);
66  return status;
67  }
68 
70  {
71  return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count));
72  }
73 
75  {
76  INT count;
78  return count;
79  }
80 
82  {
83  return NotImplemented;
84  }
85 
87  {
88  return NotImplemented;
89  }
90 
92  {
93  DashCap dashCap;
95  return dashCap;
96  }
97 
99  {
100  REAL offset;
102  return offset;
103  }
104 
106  {
107  return SetStatus(DllExports::GdipGetPenDashArray(pen, dashArray, count));
108  }
109 
111  {
112  INT count;
114  return count;
115  }
116 
118  {
119  DashStyle dashStyle;
121  return dashStyle;
122  }
123 
125  {
126  LineCap endCap;
128  return endCap;
129  }
130 
132  {
133  return status;
134  }
135 
137  {
138  LineJoin lineJoin;
140  return lineJoin;
141  }
142 
144  {
145  REAL miterLimit;
147  return miterLimit;
148  }
149 
151  {
152  PenType type;
154  return type;
155  }
156 
158  {
159  LineCap startCap;
161  return startCap;
162  }
163 
165  {
166  return NotImplemented;
167  }
168 
170  {
171  REAL width;
173  return width;
174  }
175 
177  {
178  return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? matrix->matrix : NULL, order));
179  }
180 
182  {
184  }
185 
187  {
188  return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, order));
189  }
190 
192  {
193  return SetStatus(DllExports::GdipScalePenTransform(pen, sx, sy, order));
194  }
195 
197  {
198  return SetStatus(DllExports::GdipSetPenMode(pen, penAlignment));
199  }
200 
201  Status SetBrush(const Brush *brush)
202  {
203  return SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->brush : NULL));
204  }
205 
207  {
208  return SetStatus(DllExports::GdipSetPenColor(pen, color.GetValue()));
209  }
210 
211  Status SetCompoundArray(const REAL *compoundArray, INT count)
212  {
213  return SetStatus(DllExports::GdipSetPenCompoundArray(pen, compoundArray, count));
214  }
215 
217  {
218  return NotImplemented;
219  }
220 
222  {
223  return NotImplemented;
224  }
225 
227  {
229  }
230 
232  {
233  return SetStatus(DllExports::GdipSetPenDashOffset(pen, dashOffset));
234  }
235 
237  {
238  return SetStatus(DllExports::GdipSetPenDashArray(pen, dashArray, count));
239  }
240 
242  {
243  return SetStatus(DllExports::GdipSetPenDashStyle(pen, dashStyle));
244  }
245 
247  {
248  return SetStatus(DllExports::GdipSetPenEndCap(pen, endCap));
249  }
250 
251  Status SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)
252  {
253  return SetStatus(DllExports::GdipSetPenLineCap197819(pen, startCap, endCap, dashCap));
254  }
255 
257  {
258  return SetStatus(DllExports::GdipSetPenLineJoin(pen, lineJoin));
259  }
260 
262  {
263  return SetStatus(DllExports::GdipSetPenMiterLimit(pen, miterLimit));
264  }
265 
267  {
268  return SetStatus(DllExports::GdipSetPenStartCap(pen, startCap));
269  }
270 
272  {
273  return SetStatus(DllExports::GdipSetPenTransform(pen, matrix ? matrix->matrix : NULL));
274  }
275 
277  {
278  return SetStatus(DllExports::GdipSetPenWidth(pen, width));
279  }
280 
281 private:
283 
284 private:
285  mutable Status status;
286 
288  {
289  if (status == Ok)
290  return status;
291  this->status = status;
292  return status;
293  }
294 };
295 
296 #endif /* _GDIPLUSPEN_H */
GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit)
Definition: pen.c:372
Status RotateTransform(REAL angle, MatrixOrder order)
Definition: gdipluspen.h:186
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
Status SetWidth(REAL width)
Definition: gdipluspen.h:276
PenAlignment
Definition: gdiplusenums.h:152
Status SetDashPattern(const REAL *dashArray, INT count)
Definition: gdipluspen.h:236
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
Definition: pen.c:312
Unit
Definition: gdiplusenums.h:25
DashStyle GetDashStyle(VOID)
Definition: gdipluspen.h:117
Status SetLineJoin(LineJoin lineJoin)
Definition: gdipluspen.h:256
INT GetDashPatternCount(VOID)
Definition: gdipluspen.h:110
GLuint GLenum matrix
Definition: glext.h:9407
Status SetDashStyle(DashStyle dashStyle)
Definition: gdipluspen.h:241
GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
Definition: pen.c:533
GLintptr offset
Definition: glext.h:5920
GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count)
Definition: pen.c:288
DashCap
Definition: gdiplusenums.h:168
Status status
Definition: gdipluspen.h:285
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
Definition: pen.c:260
LineJoin
Definition: gdiplusenums.h:103
GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
Definition: pen.c:217
GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join)
Definition: pen.c:728
GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width)
Definition: pen.c:766
REAL GetDashOffset(VOID)
Definition: gdipluspen.h:98
GpMatrix * matrix
GLfloat angle
Definition: glext.h:10853
GpBrush * brush
Definition: gdiplusbrush.h:49
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipSetPenMode(GpPen *pen, GpPenAlignment mode)
Definition: pen.c:777
PenType GetPenType(VOID)
Definition: gdipluspen.h:150
GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen *pen, INT *count)
Definition: pen.c:546
PenAlignment GetAlignment(VOID)
Definition: gdipluspen.h:48
Status GetCompoundArray(REAL *compoundArray, INT count)
Definition: gdipluspen.h:69
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start, GpLineCap end, GpDashCap dash)
Definition: pen.c:706
GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
Definition: pen.c:300
Status GetDashPattern(REAL *dashArray, INT count)
Definition: gdipluspen.h:105
Status GetCustomEndCap(CustomLineCap *customCap)
Definition: gdipluspen.h:81
GLuint color
Definition: glext.h:6243
png_const_structrp png_const_inforp int * unit
Definition: png.h:2192
INT GetCompoundArrayCount(VOID)
Definition: gdipluspen.h:74
GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *mode)
Definition: pen.c:360
smooth NULL
Definition: ftsmooth.c:416
LineCap GetStartCap(VOID)
Definition: gdipluspen.h:157
Status SetDashCap(DashCap dashCap)
Definition: gdipluspen.h:226
Status SetDashOffset(REAL dashOffset)
Definition: gdipluspen.h:231
LineJoin GetLineJoin(VOID)
Definition: gdipluspen.h:136
Pen * Clone(VOID)
Definition: gdipluspen.h:43
MatrixOrder
Definition: gdiplusenums.h:185
REAL GetMiterLimit(VOID)
Definition: gdipluspen.h:143
GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width)
Definition: pen.c:408
GLfloat f
Definition: glext.h:7540
GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap)
Definition: pen.c:753
Status SetAlignment(PenAlignment penAlignment)
Definition: gdipluspen.h:196
GLint GLint GLsizei width
Definition: gl.h:1546
Status SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)
Definition: gdipluspen.h:251
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
Definition: pen.c:432
LineCap
Definition: gdiplusenums.h:59
LineCap GetEndCap(VOID)
Definition: gdipluspen.h:124
GLuint GLuint GLsizei count
Definition: gl.h:1545
Pen(const Color &color, REAL width=1.0f)
Definition: gdipluspen.h:33
Status SetStartCap(LineCap startCap)
Definition: gdipluspen.h:266
GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap)
Definition: pen.c:384
REAL GetWidth(VOID)
Definition: gdipluspen.h:169
GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit)
Definition: pen.c:741
Status SetColor(const Color &color)
Definition: gdipluspen.h:206
Status GetCustomStartCap(CustomLineCap *customCap)
Definition: gdipluspen.h:86
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
Definition: pen.c:691
Status SetStatus(Status status) const
Definition: gdipluspen.h:287
GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
Definition: pen.c:658
PenType
Definition: gdiplusenums.h:93
Status ResetTransform(VOID)
Definition: gdipluspen.h:181
GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen)
Definition: pen.c:420
Status SetMiterLimit(REAL miterLimit)
Definition: gdipluspen.h:261
Status
Definition: gdiplustypes.h:24
GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
Definition: pen.c:324
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
Definition: pen.c:522
Status SetCompoundArray(const REAL *compoundArray, INT count)
Definition: gdipluspen.h:211
Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order)
Definition: gdipluspen.h:191
DashStyle
Definition: gdiplusenums.h:175
GLsizei const GLfloat * dashArray
Definition: glext.h:11725
GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType *type)
Definition: pen.c:336
Status SetCustomEndCap(const CustomLineCap *customCap)
Definition: gdipluspen.h:216
GpPen * pen
Definition: gdipluspen.h:282
GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
Definition: pen.c:348
Pen(const Brush *brush, REAL width=1.0f)
Definition: gdipluspen.h:29
Status GetColor(Color *color)
Definition: gdipluspen.h:60
GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, INT count)
Definition: pen.c:605
Status SetBrush(const Brush *brush)
Definition: gdipluspen.h:201
GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap)
Definition: pen.c:645
GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap)
Definition: pen.c:276
Status SetEndCap(LineCap endCap)
Definition: gdipluspen.h:246
GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash, INT count)
Definition: pen.c:556
Status SetCustomStartCap(const CustomLineCap *customCap)
Definition: gdipluspen.h:221
Brush * GetBrush(VOID)
Definition: gdipluspen.h:55
float REAL
Definition: types.h:41
Status GetTransform(Matrix *matrix)
Definition: gdipluspen.h:164
Status GetLastStatus(VOID)
Definition: gdipluspen.h:131
Definition: gdipluspen.h:24
DashCap GetDashCap(VOID)
Definition: gdipluspen.h:91
GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, GpPen **pen)
Definition: pen.c:136
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
Definition: pen.c:670
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
Definition: pen.c:476
Status MultiplyTransform(Matrix *matrix, MatrixOrder order)
Definition: gdipluspen.h:176
Status SetTransform(const Matrix *matrix)
Definition: gdipluspen.h:271
Definition: ps.c:97
DWORD ARGB