ReactOS 0.4.16-dev-122-g325d74c
pen.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "objbase.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"
Include dependency graph for pen.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (gdiplus)
 
static DWORD gdip_to_gdi_dash (GpDashStyle dash)
 
static DWORD gdip_to_gdi_join (GpLineJoin join)
 
static GpPenType bt_to_pt (GpBrushType bt)
 
GpStatus WINGDIPAPI GdipClonePen (GpPen *pen, GpPen **clonepen)
 
GpStatus WINGDIPAPI GdipCreatePen1 (ARGB color, REAL width, GpUnit unit, GpPen **pen)
 
GpStatus WINGDIPAPI GdipCreatePen2 (GpBrush *brush, REAL width, GpUnit unit, GpPen **pen)
 
GpStatus WINGDIPAPI GdipDeletePen (GpPen *pen)
 
GpStatus WINGDIPAPI GdipGetPenBrushFill (GpPen *pen, GpBrush **brush)
 
GpStatus WINGDIPAPI GdipGetPenColor (GpPen *pen, ARGB *argb)
 
GpStatus WINGDIPAPI GdipGetPenCustomEndCap (GpPen *pen, GpCustomLineCap **customCap)
 
GpStatus WINGDIPAPI GdipGetPenCustomStartCap (GpPen *pen, GpCustomLineCap **customCap)
 
GpStatus WINGDIPAPI GdipGetPenDashArray (GpPen *pen, REAL *dash, INT count)
 
GpStatus WINGDIPAPI GdipGetPenDashCap197819 (GpPen *pen, GpDashCap *dashCap)
 
GpStatus WINGDIPAPI GdipGetPenDashCount (GpPen *pen, INT *count)
 
GpStatus WINGDIPAPI GdipGetPenDashOffset (GpPen *pen, REAL *offset)
 
GpStatus WINGDIPAPI GdipGetPenDashStyle (GpPen *pen, GpDashStyle *dash)
 
GpStatus WINGDIPAPI GdipGetPenEndCap (GpPen *pen, GpLineCap *endCap)
 
GpStatus WINGDIPAPI GdipGetPenFillType (GpPen *pen, GpPenType *type)
 
GpStatus WINGDIPAPI GdipGetPenLineJoin (GpPen *pen, GpLineJoin *lineJoin)
 
GpStatus WINGDIPAPI GdipGetPenMode (GpPen *pen, GpPenAlignment *mode)
 
GpStatus WINGDIPAPI GdipGetPenMiterLimit (GpPen *pen, REAL *miterLimit)
 
GpStatus WINGDIPAPI GdipGetPenStartCap (GpPen *pen, GpLineCap *startCap)
 
GpStatus WINGDIPAPI GdipGetPenUnit (GpPen *pen, GpUnit *unit)
 
GpStatus WINGDIPAPI GdipGetPenWidth (GpPen *pen, REAL *width)
 
GpStatus WINGDIPAPI GdipResetPenTransform (GpPen *pen)
 
GpStatus WINGDIPAPI GdipSetPenTransform (GpPen *pen, GpMatrix *matrix)
 
GpStatus WINGDIPAPI GdipGetPenTransform (GpPen *pen, GpMatrix *matrix)
 
GpStatus WINGDIPAPI GdipTranslatePenTransform (GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
 
GpStatus WINGDIPAPI GdipScalePenTransform (GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
 
GpStatus WINGDIPAPI GdipRotatePenTransform (GpPen *pen, REAL angle, GpMatrixOrder order)
 
GpStatus WINGDIPAPI GdipMultiplyPenTransform (GpPen *pen, GDIPCONST GpMatrix *matrix, GpMatrixOrder order)
 
GpStatus WINGDIPAPI GdipSetPenBrushFill (GpPen *pen, GpBrush *brush)
 
GpStatus WINGDIPAPI GdipSetPenColor (GpPen *pen, ARGB argb)
 
GpStatus WINGDIPAPI GdipGetPenCompoundCount (GpPen *pen, INT *count)
 
GpStatus WINGDIPAPI GdipSetPenCompoundArray (GpPen *pen, GDIPCONST REAL *dash, INT count)
 
GpStatus WINGDIPAPI GdipSetPenCustomEndCap (GpPen *pen, GpCustomLineCap *customCap)
 
GpStatus WINGDIPAPI GdipSetPenCustomStartCap (GpPen *pen, GpCustomLineCap *customCap)
 
GpStatus WINGDIPAPI GdipSetPenDashArray (GpPen *pen, GDIPCONST REAL *dash, INT count)
 
GpStatus WINGDIPAPI GdipSetPenDashCap197819 (GpPen *pen, GpDashCap dashCap)
 
GpStatus WINGDIPAPI GdipSetPenDashOffset (GpPen *pen, REAL offset)
 
GpStatus WINGDIPAPI GdipSetPenDashStyle (GpPen *pen, GpDashStyle dash)
 
GpStatus WINGDIPAPI GdipSetPenEndCap (GpPen *pen, GpLineCap cap)
 
GpStatus WINGDIPAPI GdipSetPenLineCap197819 (GpPen *pen, GpLineCap start, GpLineCap end, GpDashCap dash)
 
GpStatus WINGDIPAPI GdipSetPenLineJoin (GpPen *pen, GpLineJoin join)
 
GpStatus WINGDIPAPI GdipSetPenMiterLimit (GpPen *pen, REAL limit)
 
GpStatus WINGDIPAPI GdipSetPenStartCap (GpPen *pen, GpLineCap cap)
 
GpStatus WINGDIPAPI GdipSetPenWidth (GpPen *pen, REAL width)
 
GpStatus WINGDIPAPI GdipSetPenMode (GpPen *pen, GpPenAlignment mode)
 

Function Documentation

◆ bt_to_pt()

static GpPenType bt_to_pt ( GpBrushType  bt)
static

Definition at line 70 of file pen.c.

71{
72 switch(bt){
74 return PenTypeSolidColor;
76 return PenTypeHatchFill;
78 return PenTypeTextureFill;
83 default:
84 return PenTypeUnknown;
85 }
86}
@ PenTypeSolidColor
Definition: gdiplusenums.h:96
@ PenTypePathGradient
Definition: gdiplusenums.h:99
@ PenTypeLinearGradient
Definition: gdiplusenums.h:100
@ PenTypeUnknown
Definition: gdiplusenums.h:101
@ PenTypeTextureFill
Definition: gdiplusenums.h:98
@ PenTypeHatchFill
Definition: gdiplusenums.h:97
@ BrushTypeHatchFill
Definition: gdiplusenums.h:39
@ BrushTypeLinearGradient
Definition: gdiplusenums.h:42
@ BrushTypeTextureFill
Definition: gdiplusenums.h:40
@ BrushTypeSolidColor
Definition: gdiplusenums.h:38
@ BrushTypePathGradient
Definition: gdiplusenums.h:41

Referenced by GdipGetPenFillType().

◆ gdip_to_gdi_dash()

static DWORD gdip_to_gdi_dash ( GpDashStyle  dash)
static

Definition at line 33 of file pen.c.

34{
35 switch(dash){
36 case DashStyleSolid:
37 return PS_SOLID;
38 case DashStyleDash:
39 return PS_DASH;
40 case DashStyleDot:
41 return PS_DOT;
43 return PS_DASHDOT;
45 return PS_DASHDOTDOT;
46 case DashStyleCustom:
47 return PS_USERSTYLE;
48 default:
49 ERR("Not a member of GpDashStyle enumeration\n");
50 return 0;
51 }
52}
#define ERR(fmt,...)
Definition: precomp.h:57
@ DashStyleSolid
Definition: gdiplusenums.h:178
@ DashStyleDot
Definition: gdiplusenums.h:180
@ DashStyleDashDot
Definition: gdiplusenums.h:181
@ DashStyleCustom
Definition: gdiplusenums.h:183
@ DashStyleDash
Definition: gdiplusenums.h:179
@ DashStyleDashDotDot
Definition: gdiplusenums.h:182
#define PS_DASH
Definition: wingdi.h:587
#define PS_DOT
Definition: wingdi.h:588
#define PS_USERSTYLE
Definition: wingdi.h:592
#define PS_SOLID
Definition: wingdi.h:586
#define PS_DASHDOT
Definition: wingdi.h:589
#define PS_DASHDOTDOT
Definition: wingdi.h:590

Referenced by GdipSetPenDashStyle().

◆ gdip_to_gdi_join()

static DWORD gdip_to_gdi_join ( GpLineJoin  join)
static

Definition at line 54 of file pen.c.

55{
56 switch(join){
57 case LineJoinRound:
58 return PS_JOIN_ROUND;
59 case LineJoinBevel:
60 return PS_JOIN_BEVEL;
61 case LineJoinMiter:
63 return PS_JOIN_MITER;
64 default:
65 ERR("Not a member of GpLineJoin enumeration\n");
66 return 0;
67 }
68}
@ LineJoinMiter
Definition: gdiplusenums.h:106
@ LineJoinMiterClipped
Definition: gdiplusenums.h:109
@ LineJoinBevel
Definition: gdiplusenums.h:107
@ LineJoinRound
Definition: gdiplusenums.h:108
LOCAL int join(int *aux, int a, int b)
Definition: match.c:560
#define PS_JOIN_BEVEL
Definition: wingdi.h:597
#define PS_JOIN_ROUND
Definition: wingdi.h:599
#define PS_JOIN_MITER
Definition: wingdi.h:598

Referenced by GdipSetPenLineJoin().

◆ GdipClonePen()

GpStatus WINGDIPAPI GdipClonePen ( GpPen pen,
GpPen **  clonepen 
)

Definition at line 88 of file pen.c.

89{
91
92 TRACE("(%p, %p)\n", pen, clonepen);
93
94 if(!pen || !clonepen)
95 return InvalidParameter;
96
97 *clonepen = heap_alloc_zero(sizeof(GpPen));
98 if(!*clonepen) return OutOfMemory;
99
100 **clonepen = *pen;
101
102 (*clonepen)->customstart = NULL;
103 (*clonepen)->customend = NULL;
104 (*clonepen)->brush = NULL;
105 (*clonepen)->dashes = NULL;
106
107 stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
108
109 if (stat == Ok && pen->customstart)
110 stat = GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
111
112 if (stat == Ok && pen->customend)
113 stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
114
115 if (stat == Ok && pen->dashes)
116 {
117 (*clonepen)->dashes = heap_alloc_zero(pen->numdashes * sizeof(REAL));
118 if ((*clonepen)->dashes)
119 memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
120 else
122 }
123
124 if (stat != Ok)
125 {
126 GdipDeletePen(*clonepen);
127 *clonepen = NULL;
128 return stat;
129 }
130
131 TRACE("<-- %p\n", *clonepen);
132
133 return Ok;
134}
#define stat
Definition: acwin.h:99
#define NULL
Definition: types.h:112
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
Definition: brush.c:70
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap *from, GpCustomLineCap **to)
Definition: customlinecap.c:34
GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
Definition: pen.c:192
Status
Definition: gdiplustypes.h:25
@ Ok
Definition: gdiplustypes.h:26
@ InvalidParameter
Definition: gdiplustypes.h:28
@ OutOfMemory
Definition: gdiplustypes.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define TRACE(s)
Definition: solgame.cpp:4
INT numdashes
REAL * dashes
GpCustomLineCap * customend
GpBrush * brush
GpCustomLineCap * customstart
Definition: stat.h:55

◆ GdipCreatePen1()

GpStatus WINGDIPAPI GdipCreatePen1 ( ARGB  color,
REAL  width,
GpUnit  unit,
GpPen **  pen 
)

Definition at line 136 of file pen.c.

138{
139 GpBrush *brush;
141
142 TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);
143
145 status = GdipCreatePen2(brush, width, unit, pen);
146 GdipDeleteBrush(brush);
147 return status;
148}
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
Definition: brush.c:994
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
Definition: brush.c:757
GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, GpPen **pen)
Definition: pen.c:150
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint color
Definition: glext.h:6243
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
Definition: ps.c:97

Referenced by test_brushfill(), test_compoundarray(), test_constructor_destructor(), test_customcap(), test_dasharray(), test_drawpath(), test_emfonly(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), test_GdipDrawLineI(), test_GdipDrawLinesI(), test_Get_Release_DC(), test_pen_thickness(), test_penfilltype(), test_startup(), test_transform(), test_widen(), and test_worldbounds().

◆ GdipCreatePen2()

GpStatus WINGDIPAPI GdipCreatePen2 ( GpBrush brush,
REAL  width,
GpUnit  unit,
GpPen **  pen 
)

Definition at line 150 of file pen.c.

152{
153 GpPen *gp_pen;
154 GpBrush *clone_brush;
155
156 TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
157
158 if(!pen || !brush)
159 return InvalidParameter;
160
161 gp_pen = heap_alloc_zero(sizeof(GpPen));
162 if(!gp_pen) return OutOfMemory;
163
164 gp_pen->style = GP_DEFAULT_PENSTYLE;
165 gp_pen->width = width;
166 gp_pen->unit = unit;
167 gp_pen->endcap = LineCapFlat;
168 gp_pen->join = LineJoinMiter;
169 gp_pen->miterlimit = 10.0;
170 gp_pen->dash = DashStyleSolid;
171 gp_pen->offset = 0.0;
172 gp_pen->customstart = NULL;
173 gp_pen->customend = NULL;
174 GdipSetMatrixElements(&gp_pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
175
176 if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
177 FIXME("UnitWorld, UnitPixel only supported units\n");
178 heap_free(gp_pen);
179 return NotImplemented;
180 }
181
182 GdipCloneBrush(brush, &clone_brush);
183 gp_pen->brush = clone_brush;
184
185 *pen = gp_pen;
186
187 TRACE("<-- %p\n", *pen);
188
189 return Ok;
190}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define FIXME(fmt,...)
Definition: precomp.h:53
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
Definition: matrix.c:316
#define GP_DEFAULT_PENSTYLE
@ LineCapFlat
Definition: gdiplusenums.h:61
@ UnitWorld
Definition: gdiplusenums.h:27
@ UnitPixel
Definition: gdiplusenums.h:29
@ NotImplemented
Definition: gdiplustypes.h:32
GpDashStyle dash
GpMatrix transform
REAL offset
REAL miterlimit
GpLineCap endcap
UINT style
GpLineJoin join
GpUnit unit
REAL width

Referenced by GdipCreatePen1(), METAFILE_PlaybackObject(), test_constructor_destructor2(), and test_penfilltype().

◆ GdipDeletePen()

◆ GdipGetPenBrushFill()

GpStatus WINGDIPAPI GdipGetPenBrushFill ( GpPen pen,
GpBrush **  brush 
)

Definition at line 207 of file pen.c.

208{
209 TRACE("(%p, %p)\n", pen, brush);
210
211 if(!pen || !brush)
212 return InvalidParameter;
213
214 return GdipCloneBrush(pen->brush, brush);
215}

Referenced by test_brushfill().

◆ GdipGetPenColor()

GpStatus WINGDIPAPI GdipGetPenColor ( GpPen pen,
ARGB argb 
)

Definition at line 217 of file pen.c.

218{
219 TRACE("(%p, %p)\n", pen, argb);
220
221 if(!pen || !argb)
222 return InvalidParameter;
223
224 if(pen->brush->bt != BrushTypeSolidColor)
225 return NotImplemented;
226
227 return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
228}
GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
Definition: brush.c:1273
GpBrushType bt

Referenced by test_brushfill().

◆ GdipGetPenCompoundCount()

GpStatus WINGDIPAPI GdipGetPenCompoundCount ( GpPen pen,
INT count 
)

Definition at line 526 of file pen.c.

527{
528 FIXME("(%p, %p): stub\n", pen, count);
529
530 if (!pen || !count)
531 return InvalidParameter;
532
533 return NotImplemented;
534}
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by test_compoundarray().

◆ GdipGetPenCustomEndCap()

GpStatus WINGDIPAPI GdipGetPenCustomEndCap ( GpPen pen,
GpCustomLineCap **  customCap 
)

Definition at line 230 of file pen.c.

231{
232 TRACE("(%p, %p)\n", pen, customCap);
233
234 if(!pen || !customCap)
235 return InvalidParameter;
236
237 if(!pen->customend){
238 *customCap = NULL;
239 return Ok;
240 }
241
242 return GdipCloneCustomLineCap(pen->customend, customCap);
243}

Referenced by test_customcap().

◆ GdipGetPenCustomStartCap()

GpStatus WINGDIPAPI GdipGetPenCustomStartCap ( GpPen pen,
GpCustomLineCap **  customCap 
)

Definition at line 245 of file pen.c.

246{
247 TRACE("(%p, %p)\n", pen, customCap);
248
249 if(!pen || !customCap)
250 return InvalidParameter;
251
252 if(!pen->customstart){
253 *customCap = NULL;
254 return Ok;
255 }
256
257 return GdipCloneCustomLineCap(pen->customstart, customCap);
258}

Referenced by test_customcap().

◆ GdipGetPenDashArray()

GpStatus WINGDIPAPI GdipGetPenDashArray ( GpPen pen,
REAL dash,
INT  count 
)

Definition at line 260 of file pen.c.

261{
262 TRACE("(%p, %p, %d)\n", pen, dash, count);
263
264 if(!pen || !dash || count > pen->numdashes)
265 return InvalidParameter;
266
267 /* note: if you pass a negative value for count, it crashes native gdiplus. */
268 if(count < 0)
269 return GenericError;
270
271 memcpy(dash, pen->dashes, count * sizeof(REAL));
272
273 return Ok;
274}
@ GenericError
Definition: gdiplustypes.h:27

Referenced by test_dasharray().

◆ GdipGetPenDashCap197819()

GpStatus WINGDIPAPI GdipGetPenDashCap197819 ( GpPen pen,
GpDashCap dashCap 
)

Definition at line 276 of file pen.c.

277{
278 TRACE("(%p, %p)\n", pen, dashCap);
279
280 if(!pen || !dashCap)
281 return InvalidParameter;
282
283 *dashCap = pen->dashcap;
284
285 return Ok;
286}
GpDashCap dashcap

◆ GdipGetPenDashCount()

GpStatus WINGDIPAPI GdipGetPenDashCount ( GpPen pen,
INT count 
)

Definition at line 288 of file pen.c.

289{
290 TRACE("(%p, %p)\n", pen, count);
291
292 if(!pen || !count)
293 return InvalidParameter;
294
295 *count = pen->numdashes;
296
297 return Ok;
298}

◆ GdipGetPenDashOffset()

GpStatus WINGDIPAPI GdipGetPenDashOffset ( GpPen pen,
REAL offset 
)

Definition at line 300 of file pen.c.

301{
302 TRACE("(%p, %p)\n", pen, offset);
303
304 if(!pen || !offset)
305 return InvalidParameter;
306
307 *offset = pen->offset;
308
309 return Ok;
310}
GLintptr offset
Definition: glext.h:5920

◆ GdipGetPenDashStyle()

GpStatus WINGDIPAPI GdipGetPenDashStyle ( GpPen pen,
GpDashStyle dash 
)

Definition at line 312 of file pen.c.

313{
314 TRACE("(%p, %p)\n", pen, dash);
315
316 if(!pen || !dash)
317 return InvalidParameter;
318
319 *dash = pen->dash;
320
321 return Ok;
322}

Referenced by test_dasharray().

◆ GdipGetPenEndCap()

GpStatus WINGDIPAPI GdipGetPenEndCap ( GpPen pen,
GpLineCap endCap 
)

Definition at line 324 of file pen.c.

325{
326 TRACE("(%p, %p)\n", pen, endCap);
327
328 if(!pen || !endCap)
329 return InvalidParameter;
330
331 *endCap = pen->endcap;
332
333 return Ok;
334}

◆ GdipGetPenFillType()

GpStatus WINGDIPAPI GdipGetPenFillType ( GpPen pen,
GpPenType type 
)

Definition at line 336 of file pen.c.

337{
338 TRACE("(%p, %p)\n", pen, type);
339
340 if(!pen || !type)
341 return InvalidParameter;
342
343 *type = bt_to_pt(pen->brush->bt);
344
345 return Ok;
346}
static GpPenType bt_to_pt(GpBrushType bt)
Definition: pen.c:70
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by test_penfilltype().

◆ GdipGetPenLineJoin()

GpStatus WINGDIPAPI GdipGetPenLineJoin ( GpPen pen,
GpLineJoin lineJoin 
)

Definition at line 348 of file pen.c.

349{
350 TRACE("(%p, %p)\n", pen, lineJoin);
351
352 if(!pen || !lineJoin)
353 return InvalidParameter;
354
355 *lineJoin = pen->join;
356
357 return Ok;
358}

◆ GdipGetPenMiterLimit()

GpStatus WINGDIPAPI GdipGetPenMiterLimit ( GpPen pen,
REAL miterLimit 
)

Definition at line 372 of file pen.c.

373{
374 TRACE("(%p, %p)\n", pen, miterLimit);
375
376 if(!pen || !miterLimit)
377 return InvalidParameter;
378
379 *miterLimit = pen->miterlimit;
380
381 return Ok;
382}

◆ GdipGetPenMode()

GpStatus WINGDIPAPI GdipGetPenMode ( GpPen pen,
GpPenAlignment mode 
)

Definition at line 360 of file pen.c.

361{
362 TRACE("(%p, %p)\n", pen, mode);
363
364 if(!pen || !mode)
365 return InvalidParameter;
366
367 *mode = pen->align;
368
369 return Ok;
370}
GLenum mode
Definition: glext.h:6217
GpPenAlignment align

◆ GdipGetPenStartCap()

GpStatus WINGDIPAPI GdipGetPenStartCap ( GpPen pen,
GpLineCap startCap 
)

Definition at line 384 of file pen.c.

385{
386 TRACE("(%p, %p)\n", pen, startCap);
387
388 if(!pen || !startCap)
389 return InvalidParameter;
390
391 *startCap = pen->startcap;
392
393 return Ok;
394}
GpLineCap startcap

◆ GdipGetPenTransform()

GpStatus WINGDIPAPI GdipGetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 449 of file pen.c.

450{
451 TRACE("(%p,%p)\n", pen, matrix);
452
453 if(!pen || !matrix)
454 return InvalidParameter;
455
456 *matrix = pen->transform;
457
458 return Ok;
459}
GLuint GLenum matrix
Definition: glext.h:9407

Referenced by get_pen_transform(), and test_transform().

◆ GdipGetPenUnit()

GpStatus WINGDIPAPI GdipGetPenUnit ( GpPen pen,
GpUnit unit 
)

Definition at line 396 of file pen.c.

397{
398 TRACE("(%p, %p)\n", pen, unit);
399
400 if(!pen || !unit)
401 return InvalidParameter;
402
403 *unit = pen->unit;
404
405 return Ok;
406}

◆ GdipGetPenWidth()

GpStatus WINGDIPAPI GdipGetPenWidth ( GpPen pen,
REAL width 
)

Definition at line 408 of file pen.c.

409{
410 TRACE("(%p, %p)\n", pen, width);
411
412 if(!pen || !width)
413 return InvalidParameter;
414
415 *width = pen->width;
416
417 return Ok;
418}

◆ GdipMultiplyPenTransform()

GpStatus WINGDIPAPI GdipMultiplyPenTransform ( GpPen pen,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 491 of file pen.c.

493{
494 TRACE("(%p,%p,%u)\n", pen, matrix, order);
495
496 if(!pen)
497 return InvalidParameter;
498
500}
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
Definition: matrix.c:240
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

Referenced by test_transform().

◆ GdipResetPenTransform()

GpStatus WINGDIPAPI GdipResetPenTransform ( GpPen pen)

Definition at line 420 of file pen.c.

421{
422 TRACE("(%p)\n", pen);
423
424 if(!pen)
425 return InvalidParameter;
426
427 GdipSetMatrixElements(&pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
428
429 return Ok;
430}

Referenced by test_transform().

◆ GdipRotatePenTransform()

GpStatus WINGDIPAPI GdipRotatePenTransform ( GpPen pen,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 481 of file pen.c.

482{
483 TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
484
485 if(!pen)
486 return InvalidParameter;
487
488 return GdipRotateMatrix(&pen->transform, angle, order);
489}
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
Definition: matrix.c:258
GLfloat angle
Definition: glext.h:10853

Referenced by test_transform().

◆ GdipScalePenTransform()

GpStatus WINGDIPAPI GdipScalePenTransform ( GpPen pen,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 471 of file pen.c.

472{
473 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order);
474
475 if(!pen)
476 return InvalidParameter;
477
478 return GdipScaleMatrix(&pen->transform, sx, sy, order);
479}
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:289

Referenced by test_transform().

◆ GdipSetPenBrushFill()

GpStatus WINGDIPAPI GdipSetPenBrushFill ( GpPen pen,
GpBrush brush 
)

Definition at line 502 of file pen.c.

503{
504 TRACE("(%p, %p)\n", pen, brush);
505
506 if(!pen || !brush)
507 return InvalidParameter;
508
510 return GdipCloneBrush(brush, &pen->brush);
511}

Referenced by test_brushfill().

◆ GdipSetPenColor()

GpStatus WINGDIPAPI GdipSetPenColor ( GpPen pen,
ARGB  argb 
)

Definition at line 513 of file pen.c.

514{
515 TRACE("(%p, %x)\n", pen, argb);
516
517 if(!pen)
518 return InvalidParameter;
519
520 if(pen->brush->bt != BrushTypeSolidColor)
521 return NotImplemented;
522
523 return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
524}
GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
Definition: brush.c:1925

◆ GdipSetPenCompoundArray()

GpStatus WINGDIPAPI GdipSetPenCompoundArray ( GpPen pen,
GDIPCONST REAL dash,
INT  count 
)

Definition at line 536 of file pen.c.

538{
539 FIXME("(%p, %p, %i): stub\n", pen, dash, count);
540
541 if (!pen || !dash || count < 2 || count%2 == 1)
542 return InvalidParameter;
543
544 return NotImplemented;
545}

Referenced by test_compoundarray().

◆ GdipSetPenCustomEndCap()

GpStatus WINGDIPAPI GdipSetPenCustomEndCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 547 of file pen.c.

548{
551
552 TRACE("(%p, %p)\n", pen, customCap);
553
554 /* native crashes on pen == NULL, customCap != NULL */
555 if(!customCap) return InvalidParameter;
556
557 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
559 pen->endcap = LineCapCustom;
560 pen->customend = cap;
561 }
562
563 return ret;
564}
@ LineCapCustom
Definition: gdiplusenums.h:72
GLenum cap
Definition: glext.h:9639
#define cap
Definition: glfuncs.h:226
int ret

Referenced by test_customcap().

◆ GdipSetPenCustomStartCap()

GpStatus WINGDIPAPI GdipSetPenCustomStartCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 566 of file pen.c.

567{
570
571 TRACE("(%p, %p)\n", pen, customCap);
572
573 /* native crashes on pen == NULL, customCap != NULL */
574 if(!customCap) return InvalidParameter;
575
576 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
578 pen->startcap = LineCapCustom;
579 pen->customstart = cap;
580 }
581
582 return ret;
583}

Referenced by test_customcap().

◆ GdipSetPenDashArray()

GpStatus WINGDIPAPI GdipSetPenDashArray ( GpPen pen,
GDIPCONST REAL dash,
INT  count 
)

Definition at line 585 of file pen.c.

587{
588 INT i;
589 REAL sum = 0;
590
591 TRACE("(%p, %p, %d)\n", pen, dash, count);
592
593 if(!pen || !dash)
594 return InvalidParameter;
595
596 if(count <= 0)
597 return OutOfMemory;
598
599 for(i = 0; i < count; i++){
600 sum += dash[i];
601 if(dash[i] < 0.0)
602 return InvalidParameter;
603 }
604
605 if(sum == 0.0 && count)
606 return InvalidParameter;
607
608 heap_free(pen->dashes);
609 pen->dashes = NULL;
610
611 if(count > 0)
612 pen->dashes = heap_alloc_zero(count * sizeof(REAL));
613 if(!pen->dashes){
614 pen->numdashes = 0;
615 return OutOfMemory;
616 }
617
619 memcpy(pen->dashes, dash, count * sizeof(REAL));
620 pen->numdashes = count;
621
622 return Ok;
623}
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
Definition: pen.c:650
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
int32_t INT
Definition: typedefs.h:58

Referenced by test_dasharray().

◆ GdipSetPenDashCap197819()

GpStatus WINGDIPAPI GdipSetPenDashCap197819 ( GpPen pen,
GpDashCap  dashCap 
)

Definition at line 625 of file pen.c.

626{
627 TRACE("(%p, %d)\n", pen, dashCap);
628
629 if(!pen)
630 return InvalidParameter;
631
632 pen->dashcap = dashCap;
633
634 return Ok;
635}

◆ GdipSetPenDashOffset()

GpStatus WINGDIPAPI GdipSetPenDashOffset ( GpPen pen,
REAL  offset 
)

Definition at line 638 of file pen.c.

639{
640 TRACE("(%p, %.2f)\n", pen, offset);
641
642 if(!pen)
643 return InvalidParameter;
644
645 pen->offset = offset;
646
647 return Ok;
648}

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenDashStyle()

GpStatus WINGDIPAPI GdipSetPenDashStyle ( GpPen pen,
GpDashStyle  dash 
)

Definition at line 650 of file pen.c.

651{
652 TRACE("(%p, %d)\n", pen, dash);
653
654 if(!pen)
655 return InvalidParameter;
656
657 if(dash != DashStyleCustom){
658 heap_free(pen->dashes);
659 pen->dashes = NULL;
660 pen->numdashes = 0;
661 }
662
663 pen->dash = dash;
666 pen->style |= gdip_to_gdi_dash(dash);
667
668 return Ok;
669}
static DWORD gdip_to_gdi_dash(GpDashStyle dash)
Definition: pen.c:33
#define PS_NULL
Definition: wingdi.h:591
#define PS_ALTERNATE
Definition: wingdi.h:585
#define PS_INSIDEFRAME
Definition: wingdi.h:593

Referenced by GdipSetPenDashArray(), METAFILE_PlaybackObject(), test_dasharray(), and test_widen().

◆ GdipSetPenEndCap()

GpStatus WINGDIPAPI GdipSetPenEndCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 671 of file pen.c.

672{
673 TRACE("(%p, %d)\n", pen, cap);
674
675 if(!pen) return InvalidParameter;
676
677 /* The old custom cap gets deleted even if the new style is LineCapCustom. */
679 pen->customend = NULL;
680 pen->endcap = cap;
681
682 return Ok;
683}

Referenced by METAFILE_PlaybackObject(), and test_worldbounds().

◆ GdipSetPenLineCap197819()

GpStatus WINGDIPAPI GdipSetPenLineCap197819 ( GpPen pen,
GpLineCap  start,
GpLineCap  end,
GpDashCap  dash 
)

Definition at line 686 of file pen.c.

688{
689 TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);
690
691 if(!pen)
692 return InvalidParameter;
693
696 pen->customend = NULL;
697 pen->customstart = NULL;
698
699 pen->startcap = start;
700 pen->endcap = end;
701 pen->dashcap = dash;
702
703 return Ok;
704}
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545

◆ GdipSetPenLineJoin()

GpStatus WINGDIPAPI GdipSetPenLineJoin ( GpPen pen,
GpLineJoin  join 
)

Definition at line 708 of file pen.c.

709{
710 TRACE("(%p, %d)\n", pen, join);
711
712 if(!pen) return InvalidParameter;
713
714 pen->join = join;
716 pen->style |= gdip_to_gdi_join(join);
717
718 return Ok;
719}
static DWORD gdip_to_gdi_join(GpLineJoin join)
Definition: pen.c:54

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenMiterLimit()

GpStatus WINGDIPAPI GdipSetPenMiterLimit ( GpPen pen,
REAL  limit 
)

Definition at line 721 of file pen.c.

722{
723 TRACE("(%p, %.2f)\n", pen, limit);
724
725 if(!pen)
726 return InvalidParameter;
727
728 pen->miterlimit = limit;
729
730 return Ok;
731}
GLint limit
Definition: glext.h:10326

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenMode()

GpStatus WINGDIPAPI GdipSetPenMode ( GpPen pen,
GpPenAlignment  mode 
)

Definition at line 757 of file pen.c.

758{
759 TRACE("(%p, %d)\n", pen, mode);
760
761 if(!pen) return InvalidParameter;
762
763 pen->align = mode;
764
765 return Ok;
766}

◆ GdipSetPenStartCap()

GpStatus WINGDIPAPI GdipSetPenStartCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 733 of file pen.c.

734{
735 TRACE("(%p, %d)\n", pen, cap);
736
737 if(!pen) return InvalidParameter;
738
740 pen->customstart = NULL;
741 pen->startcap = cap;
742
743 return Ok;
744}

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenTransform()

GpStatus WINGDIPAPI GdipSetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 432 of file pen.c.

433{
434 static int calls;
435
436 TRACE("(%p,%p)\n", pen, matrix);
437
438 if(!pen || !matrix)
439 return InvalidParameter;
440
441 if(!(calls++))
442 FIXME("(%p,%p) Semi-stub\n", pen, matrix);
443
444 pen->transform = *matrix;
445
446 return Ok;
447}

Referenced by test_transform().

◆ GdipSetPenWidth()

GpStatus WINGDIPAPI GdipSetPenWidth ( GpPen pen,
REAL  width 
)

Definition at line 746 of file pen.c.

747{
748 TRACE("(%p, %.2f)\n", pen, width);
749
750 if(!pen) return InvalidParameter;
751
752 pen->width = width;
753
754 return Ok;
755}

◆ GdipTranslatePenTransform()

GpStatus WINGDIPAPI GdipTranslatePenTransform ( GpPen pen,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 461 of file pen.c.

462{
463 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
464
465 if(!pen)
466 return InvalidParameter;
467
468 return GdipTranslateMatrix(&pen->transform, dx, dy, order);
469}
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
Definition: matrix.c:418
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97

Referenced by test_transform().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( gdiplus  )