From 2848100e827ebf6004dd9148ed7cfe69df83fb9d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 26 Jul 2008 12:48:01 +0400 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index e8e18bc3806..429b1441eaf 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 b55b4b1dc69..5a1a7a7ab74 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 620f82269bc..aa03727be56 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 f05b61ef79c..c33ec6f7156 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 c82b69dc147..d9cebe89824 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);