Evan Stade : gdiplus: Added GdipGetPenDashOffset/GdipSetPenDashOffset.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 9 08:23:14 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Wed Aug  8 19:42:03 2007 -0700

gdiplus: Added GdipGetPenDashOffset/GdipSetPenDashOffset.

---

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

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 4b507d9..0da04b0 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -357,7 +357,7 @@
 @ stdcall GdipGetPenDashArray(ptr ptr long)
 @ stub GdipGetPenDashCap197819
 @ stub GdipGetPenDashCount
-@ stub GdipGetPenDashOffset
+@ stdcall GdipGetPenDashOffset(ptr ptr)
 @ stdcall GdipGetPenDashStyle(ptr ptr)
 @ stub GdipGetPenEndCap
 @ stub GdipGetPenFillType
@@ -569,7 +569,7 @@
 @ stdcall GdipSetPenCustomStartCap(ptr ptr)
 @ stdcall GdipSetPenDashArray(ptr ptr long)
 @ stub GdipSetPenDashCap197819
-@ stub GdipSetPenDashOffset
+@ stdcall GdipSetPenDashOffset(ptr long)
 @ stdcall GdipSetPenDashStyle(ptr long)
 @ stdcall GdipSetPenEndCap(ptr long)
 @ stdcall GdipSetPenLineCap197819(ptr long long long)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 855d7ee..8555db7 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -68,6 +68,7 @@ struct GpPen{
     GpDashStyle dash;
     REAL *dashes;
     INT numdashes;
+    REAL offset;    /* dash offset */
     GpBrush *brush;
 };
 
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index 20a44bc..320f375 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -102,6 +102,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
     gp_pen->join = LineJoinMiter;
     gp_pen->miterlimit = 10.0;
     gp_pen->dash = DashStyleSolid;
+    gp_pen->offset = 0.0;
     GdipCreateSolidFill(color, (GpSolidFill **)(&gp_pen->brush));
 
     if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
@@ -161,6 +162,16 @@ GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
+{
+    if(!pen || !offset)
+        return InvalidParameter;
+
+    *offset = pen->offset;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
 {
     if(!pen || !dash)
@@ -258,6 +269,17 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
     return Ok;
 }
 
+/* FIXME: dash offset not used */
+GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
+{
+    if(!pen)
+        return InvalidParameter;
+
+    pen->offset = offset;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
 {
     if(!pen)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2320c7b..2a0a28e 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -33,12 +33,14 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
 GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen*,GpBrush**);
 GpStatus WINGDIPAPI GdipGetPenColor(GpPen*,ARGB*);
 GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen*,REAL*,INT);
+GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*);
 GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*);
 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);
 GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB);
 GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*);
 GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*);
 GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen*,GDIPCONST REAL*,INT);
+GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL);
 GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle);
 GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap);
 GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);




More information about the wine-cvs mailing list