Evan Stade : gdiplus: Added GdipClonePen.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 18 06:57:30 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Tue Jul 17 19:30:50 2007 -0700

gdiplus: Added GdipClonePen.

---

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

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index cc64b98..ee1a576 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -51,7 +51,7 @@
 @ stub GdipCloneImageAttributes
 @ stub GdipCloneMatrix
 @ stub GdipClonePath
-@ stub GdipClonePen
+@ stdcall GdipClonePen(ptr ptr)
 @ stub GdipCloneRegion
 @ stub GdipCloneStringFormat
 @ stdcall GdipClosePathFigure(ptr)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index 53559bd..a2cbff5 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -65,6 +65,28 @@ static DWORD gdip_to_gdi_join(GpLineJoin join)
     }
 }
 
+GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
+{
+    LOGBRUSH lb;
+
+    if(!pen || !clonepen)
+        return InvalidParameter;
+
+    *clonepen = GdipAlloc(sizeof(GpPen));
+    if(!*clonepen)  return OutOfMemory;
+
+    memcpy(*clonepen, pen, sizeof(GpPen));
+
+    lb.lbStyle = BS_SOLID;
+    lb.lbColor = (*clonepen)->color;
+    lb.lbHatch = 0;
+
+    (*clonepen)->gdipen = ExtCreatePen((*clonepen)->style,
+                                       roundr((*clonepen)->width), &lb, 0, NULL);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit,
     GpPen **pen)
 {
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index fb760f0..8388f95 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -27,6 +27,7 @@
 extern "C" {
 #endif
 
+GpStatus WINGDIPAPI GdipClonePen(GpPen*,GpPen**);
 GpStatus WINGDIPAPI GdipCreatePen1(ARGB,REAL,GpUnit,GpPen**);
 GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
 GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle);




More information about the wine-cvs mailing list