Andrew Eikum : gdiplus: Implement GdipGetVisibleClipBounds.

Alexandre Julliard julliard at winehq.org
Thu Aug 13 10:41:27 CDT 2009


Module: wine
Branch: master
Commit: ef0ee6e556891f019fb655579d0c97a76a38d43c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ef0ee6e556891f019fb655579d0c97a76a38d43c

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Wed Aug 12 15:37:09 2009 -0500

gdiplus: Implement GdipGetVisibleClipBounds.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   67 +++++++++++++++++++++++++++++++++++++++------
 include/gdiplusflat.h     |    2 +
 3 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 8863c37..51c6d06 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -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)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 8f73ee9..0a8aa45 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -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);
@@ -4086,15 +4144,6 @@ GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics *graphics, GDIPCONST UINT
 }
 
 /*****************************************************************************
- * GdipGetVisibleClipBoundsI [GDIPLUS.@]
- */
-GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI(GpGraphics *graphics, GpRect *rect)
-{
-    FIXME("(%p %p): stub\n", graphics, rect);
-    return NotImplemented;
-}
-
-/*****************************************************************************
  * GdipDrawDriverString [GDIPLUS.@]
  */
 GpStatus WINGDIPAPI GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length,
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 71101ce..704be0a 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -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*);




More information about the wine-cvs mailing list