gdiplus: Added custom line cap setters.
This commit is contained in:
parent
628237f334
commit
8f865f42ee
|
@ -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
|
||||
|
|
|
@ -49,6 +49,8 @@ struct GpPen{
|
|||
GpLineCap endcap;
|
||||
GpLineCap startcap;
|
||||
GpDashCap dashcap;
|
||||
GpCustomLineCap *customstart;
|
||||
GpCustomLineCap *customend;
|
||||
GpLineJoin join;
|
||||
REAL miterlimit;
|
||||
GpDashStyle dash;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue