Nikolay Sivov : gdiplus: Implemented GdipDrawRectanglesI.

Alexandre Julliard julliard at winehq.org
Thu Apr 24 15:56:50 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Thu Apr 24 20:48:08 2008 +0400

gdiplus: Implemented GdipDrawRectanglesI.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 0ac4314..2e747ce 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -197,7 +197,7 @@
 @ stdcall GdipDrawRectangle(ptr ptr long long long long)
 @ stdcall GdipDrawRectangleI(ptr ptr long long long long)
 @ stdcall GdipDrawRectangles(ptr ptr ptr long)
-@ stub GdipDrawRectanglesI
+@ stdcall GdipDrawRectanglesI(ptr ptr ptr long)
 @ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
 @ stub GdipEmfToWmfBits
 @ stub GdipEndContainer
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 691cefc..238712a 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1392,6 +1392,33 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen,
+    GDIPCONST GpRect* rects, INT count)
+{
+    GpRectF *rectsF;
+    GpStatus ret;
+    INT i;
+
+    if(!rects || count<=0)
+        return InvalidParameter;
+
+    rectsF = GdipAlloc(sizeof(GpRectF) * count);
+    if(!rectsF)
+        return OutOfMemory;
+
+    for(i = 0;i < count;i++){
+        rectsF[i].X      = (REAL)rects[i].X;
+        rectsF[i].Y      = (REAL)rects[i].Y;
+        rectsF[i].Width  = (REAL)rects[i].Width;
+        rectsF[i].Height = (REAL)rects[i].Height;
+    }
+
+    ret = GdipDrawRectangles(graphics, pen, rectsF, count);
+    GdipFree(rectsF);
+
+    return ret;
+}
+
 GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string,
     INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect,
     GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush)




More information about the wine-cvs mailing list