gdiplus: Implemented GdipSetClipRect/GdipSetClipRectI.

This commit is contained in:
Nikolay Sivov 2008-09-25 10:41:15 +04:00 committed by Alexandre Julliard
parent 31847cf30b
commit 8d9c4867ae
4 changed files with 30 additions and 8 deletions

View file

@ -509,7 +509,7 @@
@ stub GdipSetClipGraphics
@ stub GdipSetClipHrgn
@ stub GdipSetClipPath
@ stub GdipSetClipRect
@ stdcall GdipSetClipRect(ptr long long long long long)
@ stdcall GdipSetClipRectI(ptr long long long long long)
@ stdcall GdipSetClipRegion(ptr ptr long)
@ stdcall GdipSetCompositingMode(ptr long)

View file

@ -2948,11 +2948,13 @@ GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx,
return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order);
}
GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
INT width, INT height,
CombineMode combineMode)
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
REAL width, REAL height,
CombineMode mode)
{
static int calls;
GpRectF rect;
TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %d)\n", graphics, x, y, width, height, mode);
if(!graphics)
return InvalidParameter;
@ -2960,10 +2962,27 @@ GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
if(graphics->busy)
return ObjectBusy;
if(!(calls++))
FIXME("not implemented\n");
rect.X = x;
rect.Y = y;
rect.Width = width;
rect.Height = height;
return NotImplemented;
return GdipCombineRegionRect(graphics->clip, &rect, mode);
}
GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
INT width, INT height,
CombineMode mode)
{
TRACE("(%p, %d, %d, %d, %d, %d)\n", graphics, x, y, width, height, mode);
if(!graphics)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
return GdipSetClipRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, mode);
}
GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,

View file

@ -706,6 +706,8 @@ static void test_Get_Release_DC(void)
expect(ObjectBusy, status); status = Ok;
status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRegion(graphics, clip, CombineModeReplace);

View file

@ -533,6 +533,7 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *, INT, INT);
GpStatus WINGDIPAPI GdipFlush(GpGraphics*, GpFlushIntention);
GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile*,UINT);
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics*,REAL,REAL,REAL,REAL,CombineMode);
GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics*,INT,INT,INT,INT,CombineMode);
GpStatus WINGDIPAPI GdipFillRegion(GpGraphics*,GpBrush*,GpRegion*);