Module: wine Branch: master Commit: 7e1917852968c61f964d055fa1c69df55ab222d9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7e1917852968c61f964d055fa1...
Author: Evan Stade estade@gmail.com Date: Mon Jul 16 19:45:19 2007 -0700
gdiplus: Added GdipAddPathBeziers.
---
dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphicspath.c | 27 +++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 81e5940..cc64b98 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -2,7 +2,7 @@ @ stub GdipAddPathArcI @ stub GdipAddPathBezier @ stub GdipAddPathBezierI -@ stub GdipAddPathBeziers +@ stdcall GdipAddPathBeziers(ptr ptr long) @ stub GdipAddPathBeziersI @ stub GdipAddPathClosedCurve2 @ stub GdipAddPathClosedCurve2I diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 5b0e502..d059482 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -94,6 +94,33 @@ GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2, return Ok; }
+GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, + INT count) +{ + INT i, old_count; + + if(!path || !points || ((count - 1) % 3)) + return InvalidParameter; + + if(!lengthen_path(path, count)) + return OutOfMemory; + + old_count = path->pathdata.Count; + + for(i = 0; i < count; i++){ + path->pathdata.Points[old_count + i].X = points[i].X; + path->pathdata.Points[old_count + i].Y = points[i].Y; + path->pathdata.Types[old_count + i] = PathPointTypeBezier; + } + + path->pathdata.Types[old_count] = + (path->newfigure ? PathPointTypeStart : PathPointTypeLine); + path->newfigure = FALSE; + path->pathdata.Count += count; + + return Ok; +} + GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 35a6058..fb760f0 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -65,6 +65,7 @@ GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
GpStatus WINGDIPAPI GdipAddPathArc(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL); +GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL); GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);