gdiplus: Implemented GdipResetClip with tests.

This commit is contained in:
Nikolay Sivov 2008-08-28 17:34:22 +04:00 committed by Alexandre Julliard
parent 698e872751
commit ff88d4e18e
4 changed files with 46 additions and 1 deletions

View File

@ -474,7 +474,7 @@
@ stub GdipRecordMetafileStreamI @ stub GdipRecordMetafileStreamI
@ stdcall GdipReleaseDC(ptr ptr) @ stdcall GdipReleaseDC(ptr ptr)
@ stdcall GdipRemovePropertyItem(ptr long) @ stdcall GdipRemovePropertyItem(ptr long)
@ stub GdipResetClip @ stdcall GdipResetClip(ptr)
@ stub GdipResetImageAttributes @ stub GdipResetImageAttributes
@ stub GdipResetLineTransform @ stub GdipResetLineTransform
@ stub GdipResetPageTransform @ stub GdipResetPageTransform

View File

@ -2514,6 +2514,17 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipResetClip(GpGraphics *graphics)
{
if(!graphics)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
return GdipSetInfinite(graphics->clip);
}
GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics) GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
{ {
if(!graphics) if(!graphics)

View File

@ -674,6 +674,8 @@ static void test_Get_Release_DC(void)
expect(ObjectBusy, status); status = Ok; expect(ObjectBusy, status); status = Ok;
/* GdipMeasureCharacterRanges */ /* GdipMeasureCharacterRanges */
/* GdipMeasureString */ /* GdipMeasureString */
status = GdipResetClip(graphics);
expect(ObjectBusy, status); status = Ok;
status = GdipResetWorldTransform(graphics); status = GdipResetWorldTransform(graphics);
expect(ObjectBusy, status); status = Ok; expect(ObjectBusy, status); status = Ok;
/* GdipRestoreGraphics */ /* GdipRestoreGraphics */
@ -805,6 +807,37 @@ static void test_get_set_clip(void)
expect(Ok, status); expect(Ok, status);
expect(TRUE, res); expect(TRUE, res);
/* remains infinite after reset */
res = FALSE;
status = GdipResetClip(graphics);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
status = GdipIsInfiniteRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
/* set to empty and then reset to infinite */
status = GdipSetEmpty(clip);
expect(Ok, status);
status = GdipSetClipRegion(graphics, clip, CombineModeReplace);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
res = FALSE;
status = GdipIsEmptyRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
status = GdipResetClip(graphics);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
res = FALSE;
status = GdipIsInfiniteRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
GdipDeleteRegion(clip); GdipDeleteRegion(clip);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);

View File

@ -157,6 +157,7 @@ GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics*,GpBrush*,GDIPCONST GpRect*,I
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*); GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*);
GpStatus WINGDIPAPI GdipGetClip(GpGraphics*,GpRegion*); GpStatus WINGDIPAPI GdipGetClip(GpGraphics*,GpRegion*);
GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics*,GpRegion*,CombineMode); GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics*,GpRegion*,CombineMode);
GpStatus WINGDIPAPI GdipResetClip(GpGraphics*);
GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*); GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*);
GpStatus WINGDIPAPI GdipGetImageDimension(GpImage*,REAL*,REAL*); GpStatus WINGDIPAPI GdipGetImageDimension(GpImage*,REAL*,REAL*);