mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
gdiplus: Added GdipSetPenDashArray/GdipGetPenDashArray.
This commit is contained in:
parent
a4f238a117
commit
51bd0af43e
4 changed files with 50 additions and 2 deletions
|
@ -338,7 +338,7 @@
|
||||||
@ stub GdipGetPenCompoundCount
|
@ stub GdipGetPenCompoundCount
|
||||||
@ stub GdipGetPenCustomEndCap
|
@ stub GdipGetPenCustomEndCap
|
||||||
@ stub GdipGetPenCustomStartCap
|
@ stub GdipGetPenCustomStartCap
|
||||||
@ stub GdipGetPenDashArray
|
@ stdcall GdipGetPenDashArray(ptr ptr long)
|
||||||
@ stub GdipGetPenDashCap197819
|
@ stub GdipGetPenDashCap197819
|
||||||
@ stub GdipGetPenDashCount
|
@ stub GdipGetPenDashCount
|
||||||
@ stub GdipGetPenDashOffset
|
@ stub GdipGetPenDashOffset
|
||||||
|
@ -546,7 +546,7 @@
|
||||||
@ stub GdipSetPenCompoundArray
|
@ stub GdipSetPenCompoundArray
|
||||||
@ stdcall GdipSetPenCustomEndCap(ptr ptr)
|
@ stdcall GdipSetPenCustomEndCap(ptr ptr)
|
||||||
@ stdcall GdipSetPenCustomStartCap(ptr ptr)
|
@ stdcall GdipSetPenCustomStartCap(ptr ptr)
|
||||||
@ stub GdipSetPenDashArray
|
@ stdcall GdipSetPenDashArray(ptr ptr long)
|
||||||
@ stub GdipSetPenDashCap197819
|
@ stub GdipSetPenDashCap197819
|
||||||
@ stub GdipSetPenDashOffset
|
@ stub GdipSetPenDashOffset
|
||||||
@ stdcall GdipSetPenDashStyle(ptr long)
|
@ stdcall GdipSetPenDashStyle(ptr long)
|
||||||
|
|
|
@ -54,6 +54,8 @@ struct GpPen{
|
||||||
GpLineJoin join;
|
GpLineJoin join;
|
||||||
REAL miterlimit;
|
REAL miterlimit;
|
||||||
GpDashStyle dash;
|
GpDashStyle dash;
|
||||||
|
REAL *dashes;
|
||||||
|
INT numdashes;
|
||||||
GpBrush *brush;
|
GpBrush *brush;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
|
||||||
GdipDeleteBrush(pen->brush);
|
GdipDeleteBrush(pen->brush);
|
||||||
GdipDeleteCustomLineCap(pen->customstart);
|
GdipDeleteCustomLineCap(pen->customstart);
|
||||||
GdipDeleteCustomLineCap(pen->customend);
|
GdipDeleteCustomLineCap(pen->customend);
|
||||||
|
GdipFree(pen->dashes);
|
||||||
GdipFree(pen);
|
GdipFree(pen);
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
|
@ -147,6 +148,20 @@ GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
|
||||||
return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
|
return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
|
||||||
|
{
|
||||||
|
if(!pen || !dash || count > pen->numdashes)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
/* note: if you pass a negative value for count, it crashes native gdiplus. */
|
||||||
|
if(count < 0)
|
||||||
|
return GenericError;
|
||||||
|
|
||||||
|
memcpy(dash, pen->dashes, count * sizeof(REAL));
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
|
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
|
||||||
{
|
{
|
||||||
if(!pen || !dash)
|
if(!pen || !dash)
|
||||||
|
@ -209,11 +224,40 @@ GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* custom
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
if(!pen || !dash)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
GdipFree(pen->dashes);
|
||||||
|
pen->dashes = NULL;
|
||||||
|
|
||||||
|
if(count > 0)
|
||||||
|
pen->dashes = GdipAlloc(count * sizeof(REAL));
|
||||||
|
if(!pen->dashes){
|
||||||
|
pen->numdashes = 0;
|
||||||
|
return OutOfMemory;
|
||||||
|
}
|
||||||
|
|
||||||
|
pen->dash = DashStyleCustom;
|
||||||
|
memcpy(pen->dashes, dash, count * sizeof(REAL));
|
||||||
|
pen->numdashes = count;
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
|
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
|
||||||
{
|
{
|
||||||
if(!pen)
|
if(!pen)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
|
if(dash != DashStyleCustom){
|
||||||
|
GdipFree(pen->dashes);
|
||||||
|
pen->dashes = NULL;
|
||||||
|
pen->numdashes = 0;
|
||||||
|
}
|
||||||
|
|
||||||
pen->dash = dash;
|
pen->dash = dash;
|
||||||
pen->style &= ~(PS_ALTERNATE | PS_SOLID | PS_DASH | PS_DOT | PS_DASHDOT |
|
pen->style &= ~(PS_ALTERNATE | PS_SOLID | PS_DASH | PS_DOT | PS_DASHDOT |
|
||||||
PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME);
|
PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME);
|
||||||
|
|
|
@ -32,11 +32,13 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB,REAL,GpUnit,GpPen**);
|
||||||
GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
|
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 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 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);
|
||||||
|
|
Loading…
Reference in a new issue