Evan Stade : gdiplus: Added GdipClonePath.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 2 06:23:08 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Wed Aug  1 17:55:44 2007 -0700

gdiplus: Added GdipClonePath.

---

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

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 1b96a3b..81ff0ae 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -55,7 +55,7 @@
 @ stub GdipCloneImage
 @ stub GdipCloneImageAttributes
 @ stdcall GdipCloneMatrix(ptr ptr)
-@ stub GdipClonePath
+@ stdcall GdipClonePath(ptr ptr)
 @ stdcall GdipClonePen(ptr ptr)
 @ stub GdipCloneRegion
 @ stub GdipCloneStringFormat
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 82f5838..b11d918 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -212,6 +212,32 @@ GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone)
+{
+    if(!path || !clone)
+        return InvalidParameter;
+
+    *clone = GdipAlloc(sizeof(GpPath));
+    if(!*clone) return OutOfMemory;
+
+    memcpy(*clone, path, sizeof(GpPath));
+
+    (*clone)->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF));
+    (*clone)->pathdata.Types = GdipAlloc(path->datalen);
+    if(!(*clone)->pathdata.Points || !(*clone)->pathdata.Types){
+        GdipFree(*clone);
+        GdipFree((*clone)->pathdata.Points);
+        GdipFree((*clone)->pathdata.Types);
+        return OutOfMemory;
+    }
+
+    memcpy((*clone)->pathdata.Points, path->pathdata.Points,
+           path->datalen * sizeof(PointF));
+    memcpy((*clone)->pathdata.Types, path->pathdata.Types, path->datalen);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipClosePathFigure(GpPath* path)
 {
     if(!path)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 90c7e45..045c17b 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -97,6 +97,7 @@ GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath*,GDIPCONST GpPointF*,INT);
 GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath*,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
 GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL);
+GpStatus WINGDIPAPI GdipClonePath(GpPath*,GpPath**);
 GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);
 GpStatus WINGDIPAPI GdipClosePathFigures(GpPath*);
 GpStatus WINGDIPAPI GdipCreatePath(GpFillMode,GpPath**);




More information about the wine-cvs mailing list