Nikolay Sivov : gdiplus: Implemented GdipGetCustomLineCapStrokeJoin with basic test.

Alexandre Julliard julliard at winehq.org
Mon Jul 28 08:06:56 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Sat Jul 26 12:48:01 2008 +0400

gdiplus: Implemented GdipGetCustomLineCapStrokeJoin with basic test.

---

 dlls/gdiplus/customlinecap.c       |   12 ++++++++++++
 dlls/gdiplus/gdiplus.spec          |    2 +-
 dlls/gdiplus/gdiplus_private.h     |    1 +
 dlls/gdiplus/tests/customlinecap.c |   33 +++++++++++++++++++++++++++++++++
 include/gdiplusflat.h              |    1 +
 5 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c
index e8e18bc..429b144 100644
--- a/dlls/gdiplus/customlinecap.c
+++ b/dlls/gdiplus/customlinecap.c
@@ -100,6 +100,7 @@ GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath
 
     (*customCap)->inset = baseInset;
     (*customCap)->cap = baseCap;
+    (*customCap)->join = LineJoinMiter;
 
     return Ok;
 }
@@ -116,6 +117,17 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap *customCap)
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap* customCap,
+    GpLineJoin* lineJoin)
+{
+    if(!customCap || !lineJoin)
+        return InvalidParameter;
+
+    *lineJoin = customCap->join;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* custom,
     GpLineCap start, GpLineCap end)
 {
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index b55b4b1..5a1a7a7 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -252,7 +252,7 @@
 @ stdcall GdipGetCustomLineCapBaseCap(ptr ptr)
 @ stdcall GdipGetCustomLineCapBaseInset(ptr ptr)
 @ stub GdipGetCustomLineCapStrokeCaps
-@ stub GdipGetCustomLineCapStrokeJoin
+@ stdcall GdipGetCustomLineCapStrokeJoin(ptr ptr)
 @ stub GdipGetCustomLineCapType
 @ stub GdipGetCustomLineCapWidthScale
 @ stdcall GdipGetDC(ptr ptr)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 620f822..aa03727 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -149,6 +149,7 @@ struct GpCustomLineCap{
     BOOL fill;      /* TRUE for fill, FALSE for stroke */
     GpLineCap cap;  /* as far as I can tell, this value is ignored */
     REAL inset;     /* how much to adjust the end of the line */
+    GpLineJoin join;
 };
 
 struct GpImage{
diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c
index f05b61e..c33ec6f 100644
--- a/dlls/gdiplus/tests/customlinecap.c
+++ b/dlls/gdiplus/tests/customlinecap.c
@@ -65,6 +65,38 @@ static void test_constructor_destructor(void)
     GdipDeletePath(path);
 }
 
+static void test_linejoin(void)
+{
+    GpCustomLineCap *custom;
+    GpPath *path;
+    GpLineJoin join;
+    GpStatus stat;
+
+    stat = GdipCreatePath(FillModeAlternate, &path);
+    expect(Ok, stat);
+    stat = GdipAddPathRectangle(path, 5.0, 5.0, 10.0, 10.0);
+    expect(Ok, stat);
+
+    stat = GdipCreateCustomLineCap(NULL, path, LineCapFlat, 0.0, &custom);
+    expect(Ok, stat);
+
+    /* NULL args */
+    stat = GdipGetCustomLineCapStrokeJoin(NULL, NULL);
+    expect(InvalidParameter, stat);
+    stat = GdipGetCustomLineCapStrokeJoin(custom, NULL);
+    expect(InvalidParameter, stat);
+    stat = GdipGetCustomLineCapStrokeJoin(NULL, &join);
+    expect(InvalidParameter, stat);
+
+    /* LineJoinMiter is default */
+    stat = GdipGetCustomLineCapStrokeJoin(custom, &join);
+    expect(Ok, stat);
+    expect(LineJoinMiter, join);
+
+    GdipDeleteCustomLineCap(custom);
+    GdipDeletePath(path);
+}
+
 START_TEST(customlinecap)
 {
     struct GdiplusStartupInput gdiplusStartupInput;
@@ -78,6 +110,7 @@ START_TEST(customlinecap)
     GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
 
     test_constructor_destructor();
+    test_linejoin();
 
     GdiplusShutdown(gdiplusToken);
 }
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index c82b69d..d9cebe8 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -326,6 +326,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);
 GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap*,GpLineCap,
     GpLineCap);
 GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap*,GpLineCap*);
+GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap*,GpLineJoin*);
 
 GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*);
 GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap*,INT,INT,ARGB);




More information about the wine-cvs mailing list