gdiplus: Implement GdipGetVisibleClipBounds.

This commit is contained in:
Andrew Eikum 2009-08-12 15:37:09 -05:00 committed by Alexandre Julliard
parent fdf48f1d4d
commit ef0ee6e556
3 changed files with 61 additions and 10 deletions

View File

@ -400,7 +400,7 @@
@ stub GdipGetTextureImage
@ stdcall GdipGetTextureTransform(ptr ptr)
@ stdcall GdipGetTextureWrapMode(ptr ptr)
@ stub GdipGetVisibleClipBounds
@ stdcall GdipGetVisibleClipBounds(ptr ptr)
@ stdcall GdipGetVisibleClipBoundsI(ptr ptr)
@ stdcall GdipGetWorldTransform(ptr ptr)
@ stdcall GdipGraphicsClear(ptr long)

View File

@ -3124,6 +3124,64 @@ GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics,
return Ok;
}
GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect)
{
GpRegion *clip_rgn;
GpStatus stat;
GpRectF wnd_rect;
TRACE("(%p, %p)\n", graphics, rect);
if(!graphics || !rect)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
/* get window bounds */
if((stat = get_graphics_bounds(graphics, &wnd_rect)) != Ok)
return stat;
/* intersect window and graphics clipping regions */
if((stat = GdipCreateRegion(&clip_rgn)) != Ok)
return stat;
if((stat = GdipCombineRegionRect(clip_rgn, &wnd_rect, CombineModeIntersect)) != Ok)
goto cleanup;
if((stat = GdipCombineRegionRegion(clip_rgn, graphics->clip, CombineModeIntersect)) != Ok)
goto cleanup;
/* get bounds of the region */
stat = GdipGetRegionBounds(clip_rgn, graphics, rect);
cleanup:
GdipDeleteRegion(clip_rgn);
return stat;
}
GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI(GpGraphics *graphics, GpRect *rect)
{
GpRectF rectf;
GpStatus stat;
TRACE("(%p, %p)\n", graphics, rect);
if(!graphics || !rect)
return InvalidParameter;
if((stat = GdipGetVisibleClipBounds(graphics, &rectf)) == Ok)
{
rect->X = roundr(rectf.X);
rect->Y = roundr(rectf.Y);
rect->Width = roundr(rectf.Width);
rect->Height = roundr(rectf.Height);
}
return stat;
}
GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
{
TRACE("(%p, %p)\n", graphics, matrix);
@ -4085,15 +4143,6 @@ GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics *graphics, GDIPCONST UINT
return NotImplemented;
}
/*****************************************************************************
* GdipGetVisibleClipBoundsI [GDIPLUS.@]
*/
GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI(GpGraphics *graphics, GpRect *rect)
{
FIXME("(%p %p): stub\n", graphics, rect);
return NotImplemented;
}
/*****************************************************************************
* GdipDrawDriverString [GDIPLUS.@]
*/

View File

@ -227,6 +227,8 @@ GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics*,UINT*);
GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*);
GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*);
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB);
GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics*,GpRectF*);
GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI(GpGraphics*,GpRect*);
GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics*, BOOL*);
GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics*,REAL,REAL,BOOL*);
GpStatus WINGDIPAPI GdipIsVisiblePointI(GpGraphics*,INT,INT,BOOL*);