[6/16] gdiplus: added GdipCloneCustomLineCap [try2]

Evan Stade estade at gmail.com
Thu Jul 19 20:22:38 CDT 2007


Hi,

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

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c
index 2a0cfb2..76e2c1d 100644
--- a/dlls/gdiplus/customlinecap.c
+++ b/dlls/gdiplus/customlinecap.c
@@ -24,6 +24,34 @@ #include "winbase.h"
 #include "gdiplus.h"
 #include "gdiplus_private.h"
 
+GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from,
+    GpCustomLineCap** to)
+{
+    if(!from || !to)
+        return InvalidParameter;
+
+    *to = GdipAlloc(sizeof(GpCustomLineCap));
+    if(!*to)   return OutOfMemory;
+
+    memcpy(*to, from, sizeof(GpCustomLineCap));
+
+    (*to)->pathdata.Points = GdipAlloc(from->pathdata.Count * sizeof(PointF));
+    (*to)->pathdata.Types = GdipAlloc(from->pathdata.Count);
+
+    if((!(*to)->pathdata.Types  || !(*to)->pathdata.Points) && (*to)->pathdata.Count){
+        GdipFree((*to)->pathdata.Points);
+        GdipFree((*to)->pathdata.Types);
+        GdipFree(*to);
+        return OutOfMemory;
+    }
+
+    memcpy((*to)->pathdata.Points, from->pathdata.Points, from->pathdata.Count
+           * sizeof(PointF));
+    memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath,
     GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap)
 {
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index d80784e..1d8e424 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -44,7 +44,7 @@
 @ stub GdipCloneBitmapArea
 @ stub GdipCloneBitmapAreaI
 @ stub GdipCloneBrush
-@ stub GdipCloneCustomLineCap
+@ stdcall GdipCloneCustomLineCap(ptr ptr)
 @ stub GdipCloneFont
 @ stub GdipCloneFontFamily
 @ stub GdipCloneImage
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 136f469..901e03b 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -101,6 +101,7 @@ GpStatus WINGDIPAPI GdipPathIterCopyData
 GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator*,INT*,INT*,INT*,BOOL*);
 GpStatus WINGDIPAPI GdipPathIterRewind(GpPathIterator*);
 
+GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap*,GpCustomLineCap**);
 GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL,
     GpCustomLineCap**);
 GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);
-- 
1.4.1


More information about the wine-patches mailing list