gdiplus: GdipGetPathLastPoint implementation.

oldstable
Nikolay Sivov 2008-06-29 13:02:20 +04:00 committed by Alexandre Julliard
parent c40c08b3d3
commit 5863eabdfa
4 changed files with 42 additions and 1 deletions

View File

@ -342,7 +342,7 @@
@ stdcall GdipGetPathGradientSurroundColorsWithCount(ptr ptr ptr)
@ stub GdipGetPathGradientTransform
@ stub GdipGetPathGradientWrapMode
@ stub GdipGetPathLastPoint
@ stdcall GdipGetPathLastPoint(ptr ptr)
@ stdcall GdipGetPathPoints(ptr ptr long)
@ stdcall GdipGetPathPointsI(ptr ptr long)
@ stdcall GdipGetPathTypes(ptr ptr long)

View File

@ -551,6 +551,20 @@ GpStatus WINGDIPAPI GdipGetPathFillMode(GpPath *path, GpFillMode *fillmode)
return Ok;
}
GpStatus WINGDIPAPI GdipGetPathLastPoint(GpPath* path, GpPointF* lastPoint)
{
INT count;
if(!path || !lastPoint)
return InvalidParameter;
count = path->pathdata.Count;
if(count > 0)
*lastPoint = path->pathdata.Points[count-1];
return Ok;
}
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF* points, INT count)
{
if(!path)

View File

@ -671,6 +671,31 @@ static void test_rect(void)
GdipDeletePath(path);
}
static void test_lastpoint(void)
{
GpStatus status;
GpPath *path;
GpPointF ptf;
GdipCreatePath(FillModeAlternate, &path);
status = GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
expect(Ok, status);
/* invalid args */
status = GdipGetPathLastPoint(NULL, &ptf);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(path, NULL);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(NULL, NULL);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(path, &ptf);
expect(Ok, status);
expect(TRUE, (ptf.X == 5.0) && (ptf.Y == 55.0));
GdipDeletePath(path);
}
START_TEST(graphicspath)
{
struct GdiplusStartupInput gdiplusStartupInput;
@ -693,6 +718,7 @@ START_TEST(graphicspath)
test_linei();
test_rect();
test_polygon();
test_lastpoint();
GdiplusShutdown(gdiplusToken);
}

View File

@ -238,6 +238,7 @@ GpStatus WINGDIPAPI GdipCreatePath2I(GDIPCONST GpPoint*,GDIPCONST BYTE*,INT,GpFi
GpStatus WINGDIPAPI GdipDeletePath(GpPath*);
GpStatus WINGDIPAPI GdipGetPathData(GpPath*,GpPathData*);
GpStatus WINGDIPAPI GdipGetPathFillMode(GpPath*,GpFillMode*);
GpStatus WINGDIPAPI GdipGetPathLastPoint(GpPath*,GpPointF*);
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath*,GpPointF*,INT);
GpStatus WINGDIPAPI GdipGetPathPointsI(GpPath*,GpPoint*,INT);
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath*,BYTE*,INT);