gdiplus: Implemented GdipGetCustomLineCapStrokeJoin with basic test.

This commit is contained in:
Nikolay Sivov 2008-07-26 12:48:01 +04:00 committed by Alexandre Julliard
parent 92c440c633
commit 2848100e82
5 changed files with 48 additions and 1 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -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{

View File

@ -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);
}

View File

@ -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);