[7/8] gdiplus: added GdipAddPathPath

Evan Stade estade at gmail.com
Thu Jul 12 21:43:15 CDT 2007


Hi,

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

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 1f23225..273a9ee 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -20,7 +20,7 @@
 @ stub GdipAddPathLine2I
 @ stub GdipAddPathLine
 @ stub GdipAddPathLineI
-@ stub GdipAddPathPath
+@ stdcall GdipAddPathPath(ptr ptr long)
 @ stub GdipAddPathPie
 @ stub GdipAddPathPieI
 @ stub GdipAddPathPolygon
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index df6c6d6..2fabd49 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -123,6 +123,35 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpP
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
+    BOOL connect)
+{
+    INT old_count, count;
+
+    if(!path || !addingPath)
+        return InvalidParameter;
+
+    old_count = path->pathdata.Count;
+    count = addingPath->pathdata.Count;
+
+    if(!lengthen_path(path, count))
+        return OutOfMemory;
+
+    memcpy(&path->pathdata.Points[old_count], addingPath->pathdata.Points,
+           count * sizeof(GpPointF));
+    memcpy(&path->pathdata.Types[old_count], addingPath->pathdata.Types, count);
+
+    if(path->newfigure || !connect)
+        path->pathdata.Types[old_count] = PathPointTypeStart;
+    else
+        path->pathdata.Types[old_count] = PathPointTypeLine;
+
+    path->newfigure = FALSE;
+    path->pathdata.Count += count;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipClosePathFigure(GpPath* path)
 {
     if(!path)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 787d01c..07f52e9 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -52,6 +52,7 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBr
 
 GpStatus WINGDIPAPI GdipAddPathArc(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
+GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL);
 GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);
 GpStatus WINGDIPAPI GdipClosePathFigures(GpPath*);
 GpStatus WINGDIPAPI GdipCreatePath(GpFillMode,GpPath**);
-- 
1.4.1


More information about the wine-patches mailing list