Commit 2848100e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipGetCustomLineCapStrokeJoin with basic test.

parent 92c440c6
......@@ -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)
{
......
......@@ -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)
......
......@@ -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{
......
......@@ -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);
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment