Nikolay Sivov : gdiplus: Implement GdipAddPathLine2I.

Alexandre Julliard julliard at winehq.org
Thu Apr 17 07:38:45 CDT 2008


Module: wine
Branch: master
Commit: 8360caabfa9dc7e45719c5331d7f339a7cc763af
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8360caabfa9dc7e45719c5331d7f339a7cc763af

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Apr 16 21:47:19 2008 +0400

gdiplus: Implement GdipAddPathLine2I.

---

 dlls/gdiplus/gdiplus.spec   |    2 +-
 dlls/gdiplus/graphicspath.c |   24 ++++++++++++++++++++++++
 include/gdiplusflat.h       |    1 +
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 5c5e0a8..4ccd213 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -17,7 +17,7 @@
 @ stdcall GdipAddPathEllipse(ptr long long long long)
 @ stub GdipAddPathEllipseI
 @ stdcall GdipAddPathLine2(ptr ptr long)
-@ stub GdipAddPathLine2I
+@ stdcall GdipAddPathLine2I(ptr ptr long)
 @ stub GdipAddPathLine
 @ stdcall GdipAddPathLineI(ptr long long long long)
 @ stdcall GdipAddPathPath(ptr ptr long)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index adeaa89..5d5e5fc 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -217,6 +217,30 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
+{
+    GpPointF *pointsF;
+    INT i;
+    GpStatus stat;
+
+    if(count <= 0)
+        return InvalidParameter;
+
+    pointsF = GdipAlloc(sizeof(GpPointF) * count);
+    if(!pointsF)    return OutOfMemory;
+
+    for(i = 0;i < count; i++){
+        pointsF[i].X = (REAL)points[i].X;
+        pointsF[i].Y = (REAL)points[i].Y;
+    }
+
+    stat = GdipAddPathLine2(path, pointsF, count);
+
+    GdipFree(pointsF);
+
+    return stat;
+}
+
 GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2)
 {
     INT old_count;
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index f615e5b..bc97ef4 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -188,6 +188,7 @@ GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath*,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath*,INT,INT,INT,INT);
 GpStatus WINGDIPAPI GdipAddPathLine(GpPath*,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
+GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath*,GDIPCONST GpPoint*,INT);
 GpStatus WINGDIPAPI GdipAddPathLineI(GpPath*,INT,INT,INT,INT);
 GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL);
 GpStatus WINGDIPAPI GdipClonePath(GpPath*,GpPath**);




More information about the wine-cvs mailing list