From b5d7af5438072f886735f85eff7663a864def089 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Wed, 8 Aug 2007 19:42:03 -0700 Subject: [PATCH] gdiplus: Added GdipGetPenDashOffset/GdipSetPenDashOffset. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/pen.c | 22 ++++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 4b507d92068..0da04b01212 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -357,7 +357,7 @@ @ stdcall GdipGetPenDashArray(ptr ptr long) @ stub GdipGetPenDashCap197819 @ stub GdipGetPenDashCount -@ stub GdipGetPenDashOffset +@ stdcall GdipGetPenDashOffset(ptr ptr) @ stdcall GdipGetPenDashStyle(ptr ptr) @ stub GdipGetPenEndCap @ stub GdipGetPenFillType @@ -569,7 +569,7 @@ @ stdcall GdipSetPenCustomStartCap(ptr ptr) @ stdcall GdipSetPenDashArray(ptr ptr long) @ stub GdipSetPenDashCap197819 -@ stub GdipSetPenDashOffset +@ stdcall GdipSetPenDashOffset(ptr long) @ stdcall GdipSetPenDashStyle(ptr long) @ stdcall GdipSetPenEndCap(ptr long) @ stdcall GdipSetPenLineCap197819(ptr long long long) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 855d7eeaa7f..8555db73878 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -68,6 +68,7 @@ struct GpPen{ GpDashStyle dash; REAL *dashes; INT numdashes; + REAL offset; /* dash offset */ GpBrush *brush; }; diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 20a44bc9529..320f375b9af 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -102,6 +102,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, gp_pen->join = LineJoinMiter; gp_pen->miterlimit = 10.0; gp_pen->dash = DashStyleSolid; + gp_pen->offset = 0.0; GdipCreateSolidFill(color, (GpSolidFill **)(&gp_pen->brush)); if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { @@ -161,6 +162,16 @@ GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count) return Ok; } +GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset) +{ + if(!pen || !offset) + return InvalidParameter; + + *offset = pen->offset; + + return Ok; +} + GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash) { if(!pen || !dash) @@ -258,6 +269,17 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, return Ok; } +/* FIXME: dash offset not used */ +GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset) +{ + if(!pen) + return InvalidParameter; + + pen->offset = offset; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash) { if(!pen) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 2320c7bc89b..2a0a28edf1d 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -33,12 +33,14 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen*); GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen*,GpBrush**); GpStatus WINGDIPAPI GdipGetPenColor(GpPen*,ARGB*); GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen*,REAL*,INT); +GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*); GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB); GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen*,GDIPCONST REAL*,INT); +GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);