[8/10] gdiplus: added GdipFillPolygonI

Evan Stade estade at gmail.com
Mon Jul 23 22:24:35 CDT 2007


Hi,

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   20 +++++++++++++++++++
 include/gdiplusflat.h     |    2 ++
 include/gdiplusgpstubs.h  |    1 +
 include/gdiplustypes.h    |   48 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 72 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index c2880e8..e59516c 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -214,7 +214,7 @@
 @ stub GdipFillPolygon2
 @ stub GdipFillPolygon2I
 @ stub GdipFillPolygon
-@ stub GdipFillPolygonI
+@ stdcall GdipFillPolygonI(ptr ptr ptr long long)
 @ stub GdipFillRectangle
 @ stub GdipFillRectangleI
 @ stub GdipFillRectangles
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 93b2079..64ac4fe 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -974,6 +974,26 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphi
         width, height, startAngle, sweepAngle);
 }
 
+GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush,
+    GDIPCONST GpPoint *points, INT count, GpFillMode fillMode)
+{
+    INT save_state;
+
+    if(!graphics || !brush || !points || !count)
+        return InvalidParameter;
+
+    save_state = SaveDC(graphics->hdc);
+    EndPath(graphics->hdc);
+    SelectObject(graphics->hdc, brush->gdibrush);
+    SelectObject(graphics->hdc, GetStockObject(NULL_PEN));
+    SetPolyFillMode(graphics->hdc, (fillMode == FillModeAlternate ? ALTERNATE
+                                                                  : WINDING));
+    Polygon(graphics->hdc, (GDIPCONST POINT*) points, count);
+
+    RestoreDC(graphics->hdc, save_state);
+    return Ok;
+}
+
 /* FIXME: Compositing quality is not used anywhere except the getter/setter. */
 GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics *graphics,
     CompositingQuality *quality)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 446cb98..706aa27 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -58,6 +58,8 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphi
 GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT);
 GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*);
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);
+GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT,
+    GpFillMode);
 GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
 GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*);
 GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*);
diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h
index 0e431c5..70da065 100644
--- a/include/gdiplusgpstubs.h
+++ b/include/gdiplusgpstubs.h
@@ -55,5 +55,6 @@ typedef LineJoin GpLineJoin;
 typedef DashCap GpDashCap;
 typedef DashStyle GpDashStyle;
 typedef MatrixOrder GpMatrixOrder;
+typedef Point GpPoint;
 
 #endif
diff --git a/include/gdiplustypes.h b/include/gdiplustypes.h
index 9404376..426ab7a 100644
--- a/include/gdiplustypes.h
+++ b/include/gdiplustypes.h
@@ -47,6 +47,48 @@ enum Status{
 
 #ifdef __cplusplus
 
+class Point
+{
+public:
+   Point()
+   {
+       X = Y = 0;
+   }
+
+   Point(IN const Point &pt)
+   {
+       X = pt.X;
+       Y = pt.Y;
+   }
+
+   /* FIXME: missing constructor that takes a Size */
+
+   Point(IN INT x, IN INT y)
+   {
+       X = x;
+       Y = y;
+   }
+
+   Point operator+(IN const Point& pt) const
+   {
+       return Point(X + pt.X, Y + pt.Y);
+   }
+
+   Point operator-(IN const Point& pt) const
+   {
+       return Point(X - pt.X, Y - pt.Y);
+   }
+
+   BOOL Equals(IN const Point& pt)
+   {
+       return (X == pt.X) && (Y == pt.Y);
+   }
+
+public:
+    INT X;
+    INT Y;
+};
+
 class PointF
 {
 public:
@@ -134,6 +176,12 @@ public:
 
 #else /* end of c++ typedefs */
 
+typedef struct Point
+{
+    INT X;
+    INT Y;
+} Point;
+
 typedef struct PointF
 {
     REAL X;
-- 
1.4.1


More information about the wine-patches mailing list