[3/9] gdiplus: added GdipClonePath
Evan Stade
estade at gmail.com
Wed Aug 1 19:55:44 CDT 2007
Hi,
dlls/gdiplus/gdiplus.spec | 2 +-
dlls/gdiplus/graphicspath.c | 26 ++++++++++++++++++++++++++
include/gdiplusflat.h | 1 +
3 files changed, 28 insertions(+), 1 deletions(-)
--
Evan Stade
-------------- next part --------------
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(GpPa
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(G
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**);
--
1.4.1
More information about the wine-patches
mailing list