gdiplus: Added GdipGetPenDashOffset/GdipSetPenDashOffset.

This commit is contained in:
Evan Stade 2007-08-08 19:42:03 -07:00 committed by Alexandre Julliard
parent ff2e63d41e
commit b5d7af5438
4 changed files with 27 additions and 2 deletions

View File

@ -357,7 +357,7 @@
@ stdcall GdipGetPenDashArray(ptr ptr long) @ stdcall GdipGetPenDashArray(ptr ptr long)
@ stub GdipGetPenDashCap197819 @ stub GdipGetPenDashCap197819
@ stub GdipGetPenDashCount @ stub GdipGetPenDashCount
@ stub GdipGetPenDashOffset @ stdcall GdipGetPenDashOffset(ptr ptr)
@ stdcall GdipGetPenDashStyle(ptr ptr) @ stdcall GdipGetPenDashStyle(ptr ptr)
@ stub GdipGetPenEndCap @ stub GdipGetPenEndCap
@ stub GdipGetPenFillType @ stub GdipGetPenFillType
@ -569,7 +569,7 @@
@ stdcall GdipSetPenCustomStartCap(ptr ptr) @ stdcall GdipSetPenCustomStartCap(ptr ptr)
@ stdcall GdipSetPenDashArray(ptr ptr long) @ stdcall GdipSetPenDashArray(ptr ptr long)
@ stub GdipSetPenDashCap197819 @ stub GdipSetPenDashCap197819
@ stub GdipSetPenDashOffset @ stdcall GdipSetPenDashOffset(ptr long)
@ stdcall GdipSetPenDashStyle(ptr long) @ stdcall GdipSetPenDashStyle(ptr long)
@ stdcall GdipSetPenEndCap(ptr long) @ stdcall GdipSetPenEndCap(ptr long)
@ stdcall GdipSetPenLineCap197819(ptr long long long) @ stdcall GdipSetPenLineCap197819(ptr long long long)

View File

@ -68,6 +68,7 @@ struct GpPen{
GpDashStyle dash; GpDashStyle dash;
REAL *dashes; REAL *dashes;
INT numdashes; INT numdashes;
REAL offset; /* dash offset */
GpBrush *brush; GpBrush *brush;
}; };

View File

@ -102,6 +102,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
gp_pen->join = LineJoinMiter; gp_pen->join = LineJoinMiter;
gp_pen->miterlimit = 10.0; gp_pen->miterlimit = 10.0;
gp_pen->dash = DashStyleSolid; gp_pen->dash = DashStyleSolid;
gp_pen->offset = 0.0;
GdipCreateSolidFill(color, (GpSolidFill **)(&gp_pen->brush)); GdipCreateSolidFill(color, (GpSolidFill **)(&gp_pen->brush));
if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
@ -161,6 +162,16 @@ GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
return Ok; 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) GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
{ {
if(!pen || !dash) if(!pen || !dash)
@ -258,6 +269,17 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
return Ok; 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) GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
{ {
if(!pen) if(!pen)

View File

@ -33,12 +33,14 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen*,GpBrush**); GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen*,GpBrush**);
GpStatus WINGDIPAPI GdipGetPenColor(GpPen*,ARGB*); GpStatus WINGDIPAPI GdipGetPenColor(GpPen*,ARGB*);
GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen*,REAL*,INT); GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen*,REAL*,INT);
GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*);
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*);
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*); GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);
GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB); GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB);
GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*);
GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*);
GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen*,GDIPCONST REAL*,INT); GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen*,GDIPCONST REAL*,INT);
GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL);
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle);
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap);
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);