Commit c47b1676 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipPathIterHasCurve with tests.

parent 70218092
......@@ -454,7 +454,7 @@
@ stdcall GdipPathIterEnumerate(ptr ptr ptr ptr long)
@ stdcall GdipPathIterGetCount(ptr ptr)
@ stub GdipPathIterGetSubpathCount
@ stub GdipPathIterHasCurve
@ stdcall GdipPathIterHasCurve(ptr ptr)
@ stub GdipPathIterIsValid
@ stub GdipPathIterNextMarker
@ stub GdipPathIterNextMarkerPath
......
......@@ -87,6 +87,24 @@ GpStatus WINGDIPAPI GdipPathIterCopyData(GpPathIterator* iterator,
return Ok;
}
GpStatus WINGDIPAPI GdipPathIterHasCurve(GpPathIterator* iterator, BOOL* hasCurve)
{
INT i;
if(!iterator)
return InvalidParameter;
*hasCurve = FALSE;
for(i = 0; i < iterator->pathdata.Count; i++)
if((iterator->pathdata.Types[i] & PathPointTypePathTypeMask) == PathPointTypeBezier){
*hasCurve = TRUE;
break;
}
return Ok;
}
GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator* iterator,
INT *resultCount, INT* startIndex, INT* endIndex, BOOL* isClosed)
{
......
......@@ -51,6 +51,45 @@ static void test_constructor_destructor(void)
GdipDeletePath(path);
}
static void test_hascurve(void)
{
GpPath *path;
GpPathIterator *iter;
GpStatus stat;
BOOL hasCurve;
GdipCreatePath(FillModeAlternate, &path);
GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
stat = GdipCreatePathIter(&iter, path);
expect(Ok, stat);
/* NULL args
BOOL out argument is local in wrapper class method,
so it always has not-NULL address */
stat = GdipPathIterHasCurve(NULL, &hasCurve);
expect(InvalidParameter, stat);
/* valid args */
stat = GdipPathIterHasCurve(iter, &hasCurve);
expect(Ok, stat);
expect(FALSE, hasCurve);
GdipDeletePathIter(iter);
GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
stat = GdipCreatePathIter(&iter, path);
expect(Ok, stat);
stat = GdipPathIterHasCurve(iter, &hasCurve);
expect(Ok, stat);
expect(TRUE, hasCurve);
GdipDeletePathIter(iter);
GdipDeletePath(path);
}
START_TEST(pathiterator)
{
struct GdiplusStartupInput gdiplusStartupInput;
......@@ -64,6 +103,7 @@ START_TEST(pathiterator)
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
test_constructor_destructor();
test_hascurve();
GdiplusShutdown(gdiplusToken);
}
......@@ -285,6 +285,7 @@ GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator*,INT*,INT*,INT*,BOOL*
GpStatus WINGDIPAPI GdipPathIterRewind(GpPathIterator*);
GpStatus WINGDIPAPI GdipPathIterGetCount(GpPathIterator*,INT*);
GpStatus WINGDIPAPI GdipPathIterEnumerate(GpPathIterator*,INT*,GpPointF*,BYTE*,INT);
GpStatus WINGDIPAPI GdipPathIterHasCurve(GpPathIterator*,BOOL*);
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap*,GpCustomLineCap**);
GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL,
......
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