Module: wine Branch: master Commit: 8f865f42ee368604b8e5e57ee305b5b19a85d62f URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f865f42ee368604b8e5e57ee3...
Author: Evan Stade estade@gmail.com Date: Thu Jul 19 18:22:43 2007 -0700
gdiplus: Added custom line cap setters.
---
dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/pen.c | 43 ++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + 4 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 1d8e424..755a70d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -544,8 +544,8 @@ @ stub GdipSetPenBrushFill @ stub GdipSetPenColor @ stub GdipSetPenCompoundArray -@ stub GdipSetPenCustomEndCap -@ stub GdipSetPenCustomStartCap +@ stdcall GdipSetPenCustomEndCap(ptr ptr) +@ stdcall GdipSetPenCustomStartCap(ptr ptr) @ stub GdipSetPenDashArray @ stub GdipSetPenDashCap197819 @ stub GdipSetPenDashOffset diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 5350a19..206d86c 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -49,6 +49,8 @@ struct GpPen{ GpLineCap endcap; GpLineCap startcap; GpDashCap dashcap; + GpCustomLineCap *customstart; + GpCustomLineCap *customend; GpLineJoin join; REAL miterlimit; GpDashStyle dash; diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 52ee8e2..9601f8c 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -130,6 +130,9 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen) { if(!pen) return InvalidParameter; DeleteObject(pen->gdipen); + + GdipDeleteCustomLineCap(pen->customstart); + GdipDeleteCustomLineCap(pen->customend); GdipFree(pen);
return Ok; @@ -145,6 +148,38 @@ GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash) return Ok; }
+GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap) +{ + GpCustomLineCap * cap; + GpStatus ret; + + if(!pen || !customCap) return InvalidParameter; + + if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){ + GdipDeleteCustomLineCap(pen->customend); + pen->endcap = LineCapCustom; + pen->customend = cap; + } + + return ret; +} + +GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap) +{ + GpCustomLineCap * cap; + GpStatus ret; + + if(!pen || !customCap) return InvalidParameter; + + if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){ + GdipDeleteCustomLineCap(pen->customstart); + pen->startcap = LineCapCustom; + pen->customstart = cap; + } + + return ret; +} + GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash) { LOGBRUSH lb; @@ -171,6 +206,9 @@ GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap) { if(!pen) return InvalidParameter;
+ /* The old custom cap gets deleted even if the new style is LineCapCustom. */ + GdipDeleteCustomLineCap(pen->customend); + pen->customend = NULL; pen->endcap = cap;
return Ok; @@ -183,6 +221,11 @@ GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start, if(!pen) return InvalidParameter;
+ GdipDeleteCustomLineCap(pen->customend); + GdipDeleteCustomLineCap(pen->customstart); + pen->customend = NULL; + pen->customstart = NULL; + pen->startcap = start; pen->endcap = end; pen->dashcap = dash; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 901e03b..365e81a 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -31,6 +31,8 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen*,GpPen**); GpStatus WINGDIPAPI GdipCreatePen1(ARGB,REAL,GpUnit,GpPen**); GpStatus WINGDIPAPI GdipDeletePen(GpPen*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); +GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*); +GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);