I've been busy with school and also with preparing for the upcoming
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Tue, 20 Jan 2004 04:44:52 +0000 (04:44 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Tue, 20 Jan 2004 04:44:52 +0000 (04:44 -0000)
release, so I haven't been spending a lot of time on
GraphicsPath. Rather than letting my changes go stale, I'll commit
them now while they are still in a compilable state.

* GraphicsPath.cs: Implemented. Still needs testing, though.
Particular the PathPoints property, I ran into a P/Invoke problem,
I need to first fix that before I can go on with the rest of the testing.

* gdipFunctions.cs: Import functions for GraphicsPath.

* graphics-path.c (GdipGetPathPoints): Fixed.
(GdipCreatePath): Remember to initialize the arrays instead of
just setting them to NULL.
(GdipGetPathTypes, GdipGetPathPoints): Fix signature.

* Makefile (local_sources): Add graphics-path.c to the build.

* Matrix.cs (Matrix): Removed reference to GpRect/GpRectF.

* Bitmap.cs (LockBits):
* Graphics.cs (DrawString): Removed reference to GpRectF.

* gdipStructs.cs (GpRectF, GpRect, GpPointF, GpPoint):
Removed. Didn't know that structs are laid out sequentially by
default. We don't need these anymore.

svn path=/trunk/mcs/; revision=22282

14 files changed:
mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs
mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs
mcs/class/System.Drawing/System.Drawing/Bitmap.cs
mcs/class/System.Drawing/System.Drawing/ChangeLog
mcs/class/System.Drawing/System.Drawing/Graphics.cs
mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
mcs/class/System.Drawing/System.Drawing/gdipStructs.cs
mcs/class/System.Drawing/gdiplus/ChangeLog
mcs/class/System.Drawing/gdiplus/Makefile
mcs/class/System.Drawing/gdiplus/gdip.h
mcs/class/System.Drawing/gdiplus/graphics-path.c
mcs/class/System.Drawing/gdiplus/graphics-path.h
mcs/class/System.Drawing/gdiplus/matrix.c

index a123cabbe33d141812c7c11f5d710d94633fad87..d09c96ff9cdfd67f6f2b2b64ca12316d9362c30d 100644 (file)
@@ -1,9 +1,19 @@
+2004-01-19  Duncan Mak  <duncan@ximian.com>
+
+       * GraphicsPath.cs: Implemented. Still needs testing, though.
+       Particular the PathPoints property, I ran into a P/Invoke problem,
+       I need to first fix that before I can go on with the rest of the testing.
+
 2004-01-13  Ravindra  <rkumar@novell.com>
 
        * Matrix.cs: Made the Matrix(IntPtr) constructor internal.
        Because default access is private, that makes it unusable
        by other classes.
 
+2004-01-11  Duncan Mak  <duncan@ximian.com>
+
+       * Matrix.cs (Matrix): Removed reference to GpRect/GpRectF.
+
 2004-01-10  Ravindra  <rkumar@novell.com>
 
        * All Enums: Made serializable.
index 96d28c4679417c3bb79711fa9d978ab3aff36fda..0da3ed22f5b67fa99e021c97b354104e8278fb50 100644 (file)
@@ -3,10 +3,12 @@
 //\r
 // Authors:\r
 //\r
-//   Miguel de Icaza (miguel@ximian.com)\r
+//   Miguel de Icaza (miguel@ximian.com)v\r
+//   Duncan Mak (duncan@ximian.com)\r
 //\r
-// (C) 2003 Ximian, Inc\r
+// (C) 2004 Novell, Inc\r
 //\r
+\r
 using System;\r
 using System.Drawing;\r
 using System.Runtime.InteropServices;\r
@@ -14,73 +16,298 @@ using System.Runtime.InteropServices;
 namespace System.Drawing.Drawing2D\r
 {\r
 \r
-public sealed class GraphicsPath : MarshalByRefObject, ICloneable, IDisposable {\r
+        public sealed class GraphicsPath : MarshalByRefObject, ICloneable, IDisposable {\r
 \r
-       public GraphicsPath ()\r
-       {\r
-       }\r
-       \r
-       public object Clone ()\r
-       {\r
-               throw new NotImplementedException ();\r
-       }\r
-\r
-       public void Dispose ()\r
-       {\r
-               Dispose (true);\r
-               System.GC.SuppressFinalize (this);\r
-       }\r
-\r
-       ~GraphicsPath ()\r
-       {\r
-               Dispose (false);\r
-       }\r
+                internal IntPtr nativePath;\r
+\r
+                GraphicsPath (IntPtr ptr)\r
+                {\r
+                        nativePath = ptr;\r
+                }\r
+\r
+                public GraphicsPath ()\r
+                {\r
+                        GDIPlus.GdipCreatePath (FillMode.Alternate, out nativePath);\r
+                }\r
        \r
-       void Dispose (bool disposing)\r
-       {\r
+                public object Clone ()\r
+                {\r
+                        IntPtr clone;\r
+\r
+                        GDIPlus.GdipClonePath (nativePath, out clone);\r
+\r
+                        return new GraphicsPath (clone);\r
+                }\r
+\r
+                public void Dispose ()\r
+                {\r
+                        Dispose (true);\r
+                        System.GC.SuppressFinalize (this);\r
+                }\r
+\r
+                ~GraphicsPath ()\r
+                {\r
+                        Dispose (false);\r
+                }\r
+                \r
+                void Dispose (bool disposing)\r
+                {\r
                \r
-       }\r
-\r
-       //\r
-       // AddArc\r
-       //\r
-       public void AddArc (Rectangle rect, float start_angle, float sweep_angle)\r
-       {\r
-       }\r
-\r
-       public void AddArc (RectangleF rect, float start_angle, float sweep_angle)\r
-       {\r
-       }\r
-\r
-       public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)\r
-       {\r
-       }\r
-\r
-       public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)\r
-       {\r
-       }\r
-\r
-       //\r
-       // AddLine\r
-       //\r
-       public void AddLine (Point a, Point b)\r
-       {\r
-       }\r
-\r
-       public void AddLine (PointF a, PointF b)\r
-       {\r
-       }\r
-\r
-       public void AddLine (int x1, int y1, int x2, int y2)\r
-       {\r
-       }\r
-\r
-       public void AddLine (float x1, float y1, float x2, float y2)\r
-       {\r
-       }\r
+                }\r
 \r
-       \r
-       \r
-}\r
 \r
+                public FillMode FillMode {\r
+                        get {\r
+\r
+                                FillMode mode;\r
+                                GDIPlus.GdipGetPathFillMode (nativePath, out mode);\r
+                                return mode;\r
+                        }\r
+\r
+                        set {\r
+                                GDIPlus.GdipSetPathFillMode (nativePath, value);\r
+                        }\r
+                }\r
+\r
+                public PathData PathData {\r
+\r
+                        get {\r
+                                IntPtr tmp;\r
+                                GDIPlus.GdipGetPathData (nativePath, out tmp);\r
+\r
+                                throw new Exception ();\r
+                        }\r
+                }\r
+\r
+                public PointF [] PathPoints {\r
+\r
+                        get {\r
+                                int count;\r
+                        \r
+                                GDIPlus.GdipGetPointCount (nativePath, out count);\r
+\r
+                                PointF [] points = new PointF [count];\r
+\r
+                                GDIPlus.GdipGetPathPoints (nativePath, points, count); \r
+\r
+                                return points;\r
+                        }\r
+                }\r
+\r
+                public byte [] PathTypes {\r
+\r
+                        get {\r
+                                int count;\r
+                                GDIPlus.GdipGetPointCount (nativePath, out count);\r
+\r
+                                byte [] types = new byte [count];\r
+                                GDIPlus.GdipGetPathTypes (nativePath, types, count);\r
+\r
+                                return types;\r
+                        }\r
+                }\r
+\r
+                public int PathCount {\r
+\r
+                        get {\r
+                                int count;\r
+\r
+                                GDIPlus.GdipGetPointCount (nativePath, out count);\r
+\r
+                                return count;\r
+                        }\r
+                }\r
+        \r
+                //\r
+                // AddArc\r
+                //\r
+                public void AddArc (Rectangle rect, float start_angle, float sweep_angle)\r
+                {\r
+                        GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);\r
+                }\r
+\r
+                public void AddArc (RectangleF rect, float start_angle, float sweep_angle)\r
+                {\r
+                        GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);\r
+                }\r
+\r
+                public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)\r
+                {\r
+                        GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);                \r
+                }\r
+\r
+                public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)\r
+                {\r
+                        GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);\r
+                }\r
+\r
+                //\r
+                // AddBezier\r
+                //\r
+                public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)\r
+                {\r
+                        GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,\r
+                                        pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);\r
+                }\r
+\r
+                public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)\r
+                {\r
+                        GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,\r
+                                        pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);\r
+                }\r
+\r
+                public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\r
+                {\r
+                        GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);\r
+                }\r
+\r
+                public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)\r
+                {\r
+                        GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);\r
+                }\r
+\r
+                //\r
+                // AddBeziers\r
+                //\r
+                public void AddBeziers (Point [] pts)\r
+                {\r
+                        GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);\r
+                }\r
+\r
+                public void AddBeziers (PointF [] pts)\r
+                {\r
+                        GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);\r
+                }\r
+\r
+                //\r
+                // AddLine\r
+                //\r
+                public void AddLine (Point a, Point b)\r
+                {\r
+                        GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);\r
+                }\r
+\r
+                public void AddLine (PointF a, PointF b)\r
+                {\r
+                        GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,\r
+                                        b.Y);\r
+                }\r
+\r
+                public void AddLine (int x1, int y1, int x2, int y2)\r
+                {\r
+                        GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);\r
+                }\r
+\r
+                public void AddLine (float x1, float y1, float x2, float y2)\r
+                {\r
+                        GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,\r
+                                        y2);                \r
+                }\r
+\r
+                //\r
+                // AddLines\r
+                //\r
+                public void AddLines (Point [] points)\r
+                {\r
+                        int length = points.Length;\r
+\r
+                        for (int i = 0; i < length - 2; i += 2) {\r
+                                int j = i + 1;\r
+                                GDIPlus.GdipAddPathLineI (nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);\r
+                        }\r
+                }\r
+\r
+                public void AddLines (PointF [] points)\r
+                {\r
+                        int length = points.Length;\r
+\r
+                        for (int i = 0; i < length - 2; i += 2) {\r
+                                int j = i + 1;\r
+                                GDIPlus.GdipAddPathLine (nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);\r
+                        }\r
+                }\r
+        \r
+                //\r
+                // AddPie\r
+                //\r
+                public void AddPie (Rectangle rect, float startAngle, float sweepAngle)\r
+                {\r
+                        GDIPlus.GdipAddPathPie (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);\r
+                }\r
+\r
+                public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)\r
+                {\r
+                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, sweepAngle, sweepAngle);\r
+                }\r
+\r
+                public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)\r
+                {\r
+                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, sweepAngle, sweepAngle);                \r
+                }\r
+\r
+                //\r
+                // AddPolygon\r
+                //\r
+                public void AddPolygon (Point [] points)\r
+                {\r
+\r
+                        GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);\r
+                }\r
+\r
+                public void AddPolygon (PointF [] points)\r
+                {\r
+                        GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);\r
+                }\r
+\r
+                //\r
+                // AddRectangle\r
+                //\r
+                public void AddRectangle (Rectangle rect)\r
+                {\r
+                        GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);\r
+                }\r
+\r
+                public void AddRectangle (RectangleF rect)\r
+                {\r
+                        GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);\r
+                }\r
+\r
+                //\r
+                // AddRectangles\r
+                //\r
+                public void AddRectangles (Rectangle [] rects)\r
+                {\r
+                        GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);\r
+                }\r
+\r
+                public void AddRectangles (RectangleF [] rects)\r
+                {\r
+                        GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);\r
+                }\r
+\r
+                public PointF GetLastPoint ()\r
+                {\r
+                        PointF pt;\r
+                        GDIPlus.GdipGetPathLastPoint (nativePath, out pt);\r
+\r
+                        return pt;\r
+                }\r
+\r
+                public void Reset ()\r
+                {\r
+                        GDIPlus.GdipResetPath (nativePath);\r
+                }\r
+\r
+                public void Reverse ()\r
+                {\r
+                        GDIPlus.GdipReversePath (nativePath);\r
+                }\r
+\r
+                public void Transform (Matrix matrix)\r
+                {\r
+                        GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);\r
+                }\r
+        }\r
 }\r
+\r
+\r
index dfd28afc0db0c4b69093f9d36bb5080c1617c8c6..0721def01246038057e50220d42d5d0c9918a792 100644 (file)
@@ -15,7 +15,7 @@ using System.Runtime.InteropServices;
 \r
 namespace System.Drawing.Drawing2D\r
 {\r
-        public  sealed class Matrix : MarshalByRefObject, IDisposable\r
+        public sealed class Matrix : MarshalByRefObject, IDisposable\r
         {\r
                 internal IntPtr nativeMatrix;\r
                 \r
@@ -32,16 +32,12 @@ namespace System.Drawing.Drawing2D
         \r
                 public Matrix (Rectangle rect , Point[] plgpts)\r
                 {\r
-                        GpRect rectangle = new GpRect (rect);\r
-\r
-                        GDIPlus.GdipCreateMatrix3I (rectangle, plgpts, out nativeMatrix);\r
+                        GDIPlus.GdipCreateMatrix3I (rect, plgpts, out nativeMatrix);\r
                 }\r
         \r
                 public Matrix (RectangleF rect , PointF[] pa)\r
                 {\r
-                        GpRectF rectangle = new GpRectF (rect);\r
-\r
-                        GDIPlus.GdipCreateMatrix3 (rectangle, pa, out nativeMatrix);\r
+                        GDIPlus.GdipCreateMatrix3 (rect, pa, out nativeMatrix);\r
                 }\r
 \r
                 public Matrix (float m11, float m12, float m21, float m22, float dx, float dy)\r
@@ -52,12 +48,11 @@ namespace System.Drawing.Drawing2D
                 // properties\r
                 public float[] Elements {\r
                         get {\r
-                                IntPtr tmp = Marshal.AllocHGlobal (8 * 6);\r
+                                IntPtr tmp = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (float)) * 6);\r
+                                float [] retval = new float [6];\r
 \r
                                 Status s = GDIPlus.GdipGetMatrixElements (nativeMatrix, tmp);\r
 \r
-                                float [] retval = new float [6];\r
-\r
                                 Marshal.Copy (tmp, retval, 0, 6);\r
 \r
                                 Marshal.FreeHGlobal (tmp);\r
index b41271a71f43c14405e2996e7012a148b4096017..fc5bfc25bfe19e50de361130adc132659dd9d079 100755 (executable)
@@ -195,7 +195,6 @@ namespace System.Drawing {
                {
                        Console.WriteLine("Bitmap.LockBits");
                        
-                       GpRect rc = new GpRect (rect);                  
                        BitmapData result = new BitmapData();
 
                        if (nativeObject == (IntPtr) 0)
@@ -204,7 +203,7 @@ namespace System.Drawing {
                        IntPtr lfBuffer = Marshal.AllocHGlobal(Marshal.SizeOf(result));
                Marshal.StructureToPtr(result, lfBuffer, false);                                                
                
-                       Status status = GDIPlus.GdipBitmapLockBits (nativeObject, ref rc, flags, format,  lfBuffer);
+                       Status status = GDIPlus.GdipBitmapLockBits (nativeObject, ref rect, flags, format,  lfBuffer);
                        
                        result = (BitmapData) Marshal.PtrToStructure(lfBuffer,  typeof(BitmapData));                                                                                    
                        Marshal.FreeHGlobal (lfBuffer);
index 0941df8c3d375a59145e17bafed99c593aecd62f..1938445cf36bbdf84d5bd722d3b21616d78fb394 100644 (file)
@@ -1,3 +1,7 @@
+2004-01-19  Duncan Mak  <duncan@ximian.com>
+
+       * gdipFunctions.cs: Import functions for GraphicsPath.
+
 2004-01-14  Ravindra <rkumar@novell.com>
                                                                                 
         * SolidBrush.cs: Made SolidBrush to initialize its color
@@ -5,6 +9,17 @@
                                                                                 
         * gdipFunctions.cs: Added call to GdipGetSolidFillColor GDI+ API.
 
+2004-01-11  Duncan Mak  <duncan@ximian.com>
+
+       * Bitmap.cs (LockBits): 
+       * Graphics.cs (DrawString): Removed reference to GpRectF.
+
+2004-01-09  Duncan Mak  <duncan@ximian.com>
+
+       * gdipStructs.cs (GpRectF, GpRect, GpPointF, GpPoint):
+       Removed. Didn't know that structs are laid out sequentially by
+       default. We don't need these anymore.
+
 2004-01-12 Ben Maurer  <bmaurer@users.sourceforge.net>
 
        * Color.cs: Keep KnownColors in an array so that we avoid ht lookup.
index 4601a159c9275faf543b87b17c7348e9289b0a47..1c0fafcebb314bad9664163a2ecebece7bcb13a6 100755 (executable)
@@ -569,51 +569,34 @@ namespace System.Drawing
                [MonoTODO("Ignores the font")]
                public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
                {
-                       GpRectF rf = new GpRectF (layoutRectangle);
-                       
-                       GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref rf, IntPtr.Zero, brush.nativeObject);
+                       GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
                }
 
                [MonoTODO("This ignores the font")]
                public void DrawString (string s, Font font, Brush brush, PointF point)
                {
-                       GpRectF rc = new GpRectF ();
-                       rc.left = point.X;
-                       rc.top = point.Y;
-                       rc.right = 0;
-                       rc.bottom = 0;
+                       RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
                        GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref rc, IntPtr.Zero, brush.nativeObject);
                }
 
                [MonoTODO ("This ignores the font and format")]
                public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
                {
-                       GpRectF rc = new GpRectF ();
-                       rc.left = point.X;
-                       rc.top = point.Y;
-                       rc.right = 0;
-                       rc.bottom = 0;
+                       RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
                        GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref rc, IntPtr.Zero, brush.nativeObject);
                }
 
                [MonoTODO ("This ignores the font and the format")]
                public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
                {
-                       GpRectF rect = new GpRectF (layoutRectangle);
-                       
-                       GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref rect, IntPtr.Zero, brush.nativeObject);
-                       
+                       GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
                }
 
                [MonoTODO("This ignores the font")]
                public void DrawString (string s, Font font, Brush brush, float x, float y)
                {
                        Console.WriteLine("DrawString!");
-                       GpRectF rc = new GpRectF ();
-                       rc.left = x;
-                       rc.top = y;
-                       rc.right = 0;
-                       rc.bottom = 0;
+                       RectangleF rc = new RectangleF (x, y, 0, 0);
                        
                        Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, 
                                ref rc, IntPtr.Zero, brush.nativeObject);
index 6bcf3cf1000a4aae101a6e95d45289721a0888e0..47422bbd7b051898ba01bc3412119352b8ae9004 100644 (file)
@@ -117,7 +117,7 @@ namespace System.Drawing {
                 [DllImport("gdiplus.dll")]
                static internal extern Status GdipFillRectangle (IntPtr graphics, IntPtr brush, float x1, float y1, float x2, float y2);
                [DllImport("gdiplus.dll")]
-               static internal extern Status GdipDrawString (IntPtr graphics, string text, int len, IntPtr font, ref GpRectF rc, IntPtr format, IntPtr brush);
+               static internal extern Status GdipDrawString (IntPtr graphics, string text, int len, IntPtr font, ref RectangleF rc, IntPtr format, IntPtr brush);
                [DllImport("gdiplus.dll")]
                static internal extern Status GdipGetDC (IntPtr graphics, out int hdc);
                [DllImport("gdiplus.dll")]
@@ -234,7 +234,7 @@ namespace System.Drawing {
                internal static extern Status GdipCreateBitmapFromGraphics (int width, int height, IntPtr target, out int bitmap);
 
                [DllImport("gdiplus.dll")]
-               internal static extern Status GdipBitmapLockBits (IntPtr bmp, ref GpRect rc, ImageLockMode flags, PixelFormat format, [In, Out] IntPtr bmpData);
+               internal static extern Status GdipBitmapLockBits (IntPtr bmp, ref Rectangle rc, ImageLockMode flags, PixelFormat format, [In, Out] IntPtr bmpData);
                
                // This an internal GDIPlus Cairo function, not part GDIPlus interface
                //[DllImport("gdiplus.dll")]
@@ -263,9 +263,9 @@ namespace System.Drawing {
                 [DllImport ("gdiplus.dll")]
                 internal static extern Status GdipCreateMatrix2 (float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix);
                 [DllImport ("gdiplus.dll")]
-                internal static extern Status GdipCreateMatrix3 (GpRectF rect, PointF[] dstplg, out IntPtr matrix);
+                internal static extern Status GdipCreateMatrix3 (RectangleF rect, PointF[] dstplg, out IntPtr matrix);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipCreateMatrix3I (GpRect rect, Point[] dstplg, out IntPtr matrix);
+                internal static extern Status GdipCreateMatrix3I (Rectangle rect, Point[] dstplg, out IntPtr matrix);
                 [DllImport ("gdiplus.dll")]
                 internal static extern Status GdipDeleteMatrix (IntPtr matrix);
 
@@ -311,7 +311,7 @@ namespace System.Drawing {
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipCreatePath2 (PointF points, byte [] types, int count, FillMode brushMode, out IntPtr path);
                 [DllImport ("gdiplus.dll")]
-                internal static extern Status GdipClonePath (IntPtr path, out GraphicsPath clonePath);
+                internal static extern Status GdipClonePath (IntPtr path, out IntPtr clonePath);
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipDeletePath (IntPtr path);
                 [DllImport ("gdiplus.dll")]                
@@ -319,107 +319,72 @@ namespace System.Drawing {
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipGetPointCount (IntPtr path, out int count);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathTypes (IntPtr path, out IntPtr types, out int count);
+                internal static extern Status GdipGetPathTypes (IntPtr path, byte [] types, int count);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathPoints (IntPtr path, out IntPtr points, out int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathPointsI (IntPtr path, out IntPtr points, out int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathFillMode (IntPtr path, out FillMode mode);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipSetPathFillMode (IntPtr path, FillMode mode);
+                internal static extern Status GdipGetPathPoints (IntPtr path, PointF [] points, int count);
                 [DllImport ("gdiplus.dll")]                
+                internal static extern Status GdipGetPathPointsI (IntPtr path, Point [] points, int count);
+                [DllImport ("gdiplus.dll")]                                
+                internal static extern Status GdipGetPathFillMode (IntPtr path, out FillMode fillMode);
+                [DllImport ("gdiplus.dll")]                                                
+                internal static extern Status GdipSetPathFillMode (IntPtr path, FillMode fillMode);
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipGetPathData (IntPtr path, out IntPtr pathData);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipStartPathFigure (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipClosePathFigure (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status ClosePathFigures (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
+                internal static extern Status GdipClosePathFigures (IntPtr path);
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipSetPathMarker (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipClearPathMarkers (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipReversePath (IntPtr path);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathLastPoint (IntPtr path, out IntPtr lastPoint);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddLine (IntPtr path, float x1, float y1, float x2, float y2);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathLine2 (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
+                internal static extern Status GdipGetPathLastPoint (IntPtr path, out PointF lastPoint);
+                [DllImport ("gdiplus.dll")]                                                
+                internal static extern Status GdipAddPathLine (IntPtr path, float x1, float y1, float x2, float y2);
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipAddPathArc (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathBezier (IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathBeziers (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurve (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurve2 (IntPtr path, IntPtr points, int count, float tension);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurve3 (IntPtr path, IntPtr points, int count, int offset, int numberOfSegments, float tension);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathClosedCurve (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathClosedCurve2 (IntPtr path, IntPtr points, int count, float tension);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathBeziers (IntPtr path, PointF [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurve (IntPtr path, PointF [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathRectangle (IntPtr path, float x, float y, float width, float height);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathRectangles (IntPtr path, IntPtr rects, int count);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathRectangles (IntPtr path, RectangleF [] rects, int count);
+                [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathEllipse (IntPtr path, float x, float y, float width, float height);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathPie (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathPolygon (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathPath (IntPtr path, GraphicsPath addingPath, bool connect);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathPolygon (IntPtr path, PointF [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathPath (IntPtr path, IntPtr addingPath, bool connect);
+                [DllImport ("gdiplus.dll")]
                 internal static extern Status GdipAddPathLineI (IntPtr path, int x1, int y1, int x2, int y2);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathLine2I (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
+                [DllImport ("gdiplus.dll")]                                                
                 internal static extern Status GdipAddPathArcI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
+                
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipAddPathBezierI (IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
-
-                               [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathBeziersI (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurveI (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurve2I (IntPtr path, IntPtr points, int count, float tension);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathCurve3I (IntPtr path, IntPtr points, int count, int offset, int numberOfSegments, float tension);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathClosedCurveI (IntPtr path, IntPtr points, int count);
+                [DllImport ("gdiplus.dll")]
+                internal static extern Status GdipAddPathBeziersI (IntPtr path, Point [] points, int count);
+                                
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathClosedCurve2I (IntPtr path, IntPtr points, int count, float tension);
+                internal static extern Status GdipAddPathPolygonI (IntPtr path, Point [] points, int count);
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipAddPathRectangleI (IntPtr path, int x, int y, int width, int height);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathRectanglesI (IntPtr path, IntPtr rects, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathEllipseI (IntPtr path, int x, int y, int width, int height);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathPieI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipAddPathPolygonI (IntPtr path, IntPtr points, int count);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipFlattenPath (IntPtr path, IntPtr matrix, float flatness);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipWindingModeOutline (IntPtr path, IntPtr matrix, float flatness);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipWidenPath (IntPtr nativePath, IntPtr pen, IntPtr matrix, float flatness);
-                [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipWarpPath (IntPtr nativePath, IntPtr matrix, IntPtr points, int count,  float src, float srcy, float srcwidth, float srcheight, WarpMode warpMode, float flatness);
-                [DllImport ("gdiplus.dll")]                
+                internal static extern Status GdipAddPathRectanglesI (IntPtr path, Rectangle [] rects, int count);
+                [DllImport ("gdiplus.dll")]
                 internal static extern Status GdipTransformPath (IntPtr path, IntPtr matrix);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipGetPathWorldBounds (IntPtr path, IntPtr bounds, IntPtr matrix, IntPtr pen);
-                [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipGetPathWorldBoundsI (IntPtr path, IntPtr bounds, IntPtr matrix, IntPtr pen);
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipIsVisiblePathPoint (IntPtr path, float x, float y, IntPtr graphics, out bool result);
@@ -428,7 +393,8 @@ namespace System.Drawing {
                 [DllImport ("gdiplus.dll")]                
                 internal static extern Status GdipIsOutlineVisiblePathPoint (IntPtr path, float x, float y, IntPtr graphics, out bool result);
                 [DllImport ("gdiplus.dll")]                
-                internal static extern Status GdipIsOutlineVisiblePathPointI (IntPtr path, int x, int y, IntPtr graphics, out bool result); 
+                internal static extern Status GdipIsOutlineVisiblePathPointI (IntPtr path, int x, int y, IntPtr graphics, out bool result);
+                
 #endregion      
        }               
 }               
index e06ec6040ea67fb73ca12d2e0e01bda5cf233518..2ada6a1daee29d8db71eba7581f2c17fe800cb07 100644 (file)
@@ -15,10 +15,10 @@ namespace System.Drawing {
        [StructLayout(LayoutKind.Sequential)]
        internal struct GdiplusStartupInput
        {
-       uint            GdiplusVersion;
-       IntPtr          DebugEventCallback;
-       int             SuppressBackgroundThread;
-       int             SuppressExternalCodecs;
+                uint           GdiplusVersion;
+                IntPtr                 DebugEventCallback;
+                int             SuppressBackgroundThread;
+                int            SuppressExternalCodecs;
     
        internal static GdiplusStartupInput MakeGdiplusStartupInput ()
        {
@@ -30,14 +30,14 @@ namespace System.Drawing {
                return result;
        }
        
-    }
+        }
     
        [StructLayout(LayoutKind.Sequential)]
        internal struct GdiplusStartupOutput
        {
-           internal IntPtr     NotificationHook;
-       internal IntPtr         NotificationUnhook;
-       
+                internal IntPtr        NotificationHook;
+                internal IntPtr                NotificationUnhook;
+                
        internal static GdiplusStartupOutput MakeGdiplusStartupOutput ()
        {
                GdiplusStartupOutput result = new GdiplusStartupOutput ();
@@ -45,41 +45,5 @@ namespace System.Drawing {
                return result;
        }
        }
-       
-       [StructLayout(LayoutKind.Sequential)]
-       internal struct GpRect
-       {
-               internal int left;
-               internal int top;
-               internal int right;
-               internal int bottom;
-
-                internal GpRect (Rectangle r)
-                {
-                       left = r.Left;
-                       top = r.Top;
-                       right = r.Right;
-                       bottom = r.Bottom;
-                }
-       }
-
-       [StructLayout(LayoutKind.Sequential)]
-       internal struct GpRectF
-       {
-               internal float left;
-               internal float top;
-               internal float right;
-               internal float bottom;
-
-               internal GpRectF (RectangleF r)
-               {
-                       left = r.Left;
-                       top = r.Top;
-                       right = r.Right;
-                       bottom = r.Bottom;
-               }
-       }
-       
-       
 }
 
index ebf50a88123d210046067f81e3b9f91a81694a79..a1775ff0f869c2b65bb1369f996dad0c9f4567b7 100644 (file)
@@ -1,3 +1,17 @@
+2004-01-19  Duncan Mak  <duncan@ximian.com>
+
+       * graphics-path.c (GdipGetPathPoints): Fixed.
+       (GdipCreatePath): Remember to   initialize the arrays instead of
+       just setting them to NULL.
+       (GdipGetPathTypes, GdipGetPathPoints): Fix signature.
+
+       * Makefile (local_sources): Add graphics-path.c to the build.
+
+2004-01-13  Duncan Mak  <duncan@ximian.com>
+
+       * matrix.c (GdipCreateMatrix): Use gdip_get_status instead of just
+       returning Ok;
+
 2004-01-13  Bernie Solomon  <bernard@ugsolutions.com>
 
        * graphics-path.c (append): fix struct initialization
@@ -15,7 +29,6 @@
        * graphics.c            restore position in GRAPHICS_STATE stack 
        * matrix.c              order of matrices in GdipMultiplyMatrix changed 
        * pen.c                 initialization of fields, protection in GdipDeletePen function added
-                       
 
 2003-12-25  Duncan Mak  <duncan@ximian.com>
 
index 62328c753c895de0822625d1097e8f48290f923d..889c7fca0b122ac464137feb68f47d368af7077b 100644 (file)
@@ -21,6 +21,7 @@ local_objs = bitmap.o \
        brush.o \
        general.o \
        graphics.o \
+       graphics-path.o \
        image.o \
        matrix.o \
        pen.o \
index 93a3b2389973eb9b339e958bde38b87034466260..2b56e42927174817b119d6f1755ae850447df8a7 100644 (file)
@@ -428,6 +428,9 @@ GpStatus GdipIsMatrixInvertible (GpMatrix *matrix, int *result);
 GpStatus GdipIsMatrixIdentity (GpMatrix *matrix, int *result);
 GpStatus GdipIsMatrixEqual (GpMatrix *matrix, GpMatrix *matrix2, int *result);
 
+/* Path*/
+#include "graphics-path.h"
+
 /* Memory */
 void *GdipAlloc (int size);
 void GdipFree (void *ptr);
index 5c331b9db593e81d02423041b96616ae04fe8bc5..011792ae7ca65d47a2b0812c6400f403b4fb61ac 100644 (file)
@@ -49,21 +49,6 @@ array_to_g_byte_array (const byte *types, int count)
         return p;
 }
 
-static GpPoint *
-float_to_int (const GpPointF *pts, int count)
-{
-        GpPoint *p = (GpPoint *) GdipAlloc (sizeof (GpPoint) * count);
-        GpPointF *tmp = (GpPointF *) pts;
-        int i;
-        
-        for (i = 0; i < count; i++, p++, tmp++) {
-                p->X = (int) tmp->X;
-                p->Y = (int) tmp->Y;
-        }
-        
-        return p;
-}
-
 static GpPointF *
 int_to_float (const GpPoint *pts, int count)
 {
@@ -86,16 +71,16 @@ append (GpPath *path, float x, float y, GpPathPointType type)
         GpPointF pt;
         pt.X = x;
         pt.Y = y;
+
         g_array_append_val (path->points, pt);
         g_byte_array_append (path->types, &t, 1);
+        path->count++;
 }
 
 static void
 append_point (GpPath *path, GpPointF pt, GpPathPointType type)
 {
-        byte t = (byte) type;
-        g_array_append_val (path->points, pt);
-        g_byte_array_append (path->types, &t, 1);
+        append (path, pt.X, pt.Y, type);
 }
 
 static void
@@ -112,8 +97,8 @@ GdipCreatePath (GpFillMode brushMode, GpPath **path)
         *path = (GpPath *) GdipAlloc (sizeof (GpPath));
 
         (*path)->fill_mode = brushMode;
-        (*path)->points = NULL;
-        (*path)->types = NULL;
+        (*path)->points = g_array_new (FALSE, FALSE, sizeof (GpPointF));
+        (*path)->types = g_byte_array_new ();
         (*path)->count = 0;
 
         return Ok;
@@ -180,33 +165,41 @@ GdipGetPointCount (GpPath *path, int *count)
 }
 
 GpStatus
-GdipGetPathTypes (GpPath *path, byte *types, int *count)
+GdipGetPathTypes (GpPath *path, byte *types, int count)
 {
-        *count = path->count;
-        types = g_byte_array_to_array (path->types);
+        int i;
+        
+        for (i = 0; i < count; i++)
+                types [i] = path->types->data [i];
         
         return Ok;
 }
 
 GpStatus
-GdipGetPathPoints (GpPath *path, GpPointF *points, int *count)
+GdipGetPathPoints (GpPath *path, GpPointF *points, int count)
 {
-        *count = path->count;
-        points = g_array_to_array (path->points);
-        
+        int i;
+
+        for (i = 0; i < count; i++) {
+               GpPointF point = g_array_index (path->points, GpPointF, i);
+                points [i].X = point.X;
+                points [i].Y = point.Y;
+       }
+
         return Ok;
 }
 
 GpStatus
-GdipGetPathPointsI (GpPath *path, GpPoint *points, int *count)
+GdipGetPathPointsI (GpPath *path, GpPoint *points, int count)
 {
-        *count = path->count;
-        PointF *tmp = g_array_to_array (path->points);
+        int i;
 
-        points = float_to_int (tmp, path->count);
+        for (i = 0; i < count; i++) {
+                GpPoint point = g_array_index (path->points, GpPoint, i);
+                points [i].X = (int) point.X;
+                points [i].Y = (int) point.Y; 
+        }
 
-        GdipFree (tmp);
-        
         return Ok;
 }
 
@@ -355,8 +348,8 @@ GdipAddPathArc (GpPath *path, float x, float y,
 
 GpStatus
 GdipAddPathBezier (GpPath *path, 
-        float x1, float y1, float x2, float y2, 
-        float x3, float y3, float x4, float y4)
+                   float x1, float y1, float x2, float y2, 
+                   float x3, float y3, float x4, float y4)
 {
         append (path, x1, y1, PathPointTypeStart);
         append_bezier (path, x2, y2, x3, y3, x4, y4);
@@ -541,11 +534,13 @@ GdipAddPathPath (GpPath *path, GpPath *addingPath, bool connect)
         return NotImplemented;
 }
 
-/* XXX: This one is really hard. They really translate a string into bezier points and what not */
+/* XXX: This one is really hard. They really translate a string into
+bezier points and what not */
 /*
  * GpStatus 
  * GdipAddString (GpPath *path, const char *string, int length, 
- *                const GpFontFamily *family, int style, float emSize, const GpRectF *layoutRect,
+ *                const GpFontFamily *family, int style, float emSize,
+const GpRectF *layoutRect,
  *                const GpStringFormat *format)
  * { 
  *         return NotImplemented; 
@@ -555,7 +550,8 @@ GdipAddPathPath (GpPath *path, GpPath *addingPath, bool connect)
 /*
  * GpStatus
  * GdipAddString (GpPath *path, const char *string, int length,
- *                const GpFontFamily *family, int style, float emSize, const GpRect *layoutRect,
+ *                const GpFontFamily *family, int style, float emSize,
+const GpRect *layoutRect,
  *                const GpStringFormat *format)
  * {
  *          return NotImplemented;
@@ -624,7 +620,7 @@ GdipAddPathCurve2I (GpPath *path, const GpPoint *points, int count, float tensio
 }
 
 GpStatus
-GdipAddPathCurve3I (GpPath *path, const GpPoint *points, 
+GdipAddPathCurve3I (GpPath *path, const GpPoint *points,
                     int count, int offset, int numberOfSegments, float tension)
 {
         return NotImplemented;
@@ -707,7 +703,8 @@ GdipWidenPath (GpPath *nativePath, GpPen *pen, GpMatrix *matrix, float flatness)
 
 GpStatus 
 GdipWarpPath (GpPath *nativePath, GpMatrix *matrix, const GpPointF *points, int count, 
-                float src, float srcy, float srcwidth, float srcheight, WarpMode warpMode, float flatness)
+              float src, float srcy, float srcwidth, float srcheight,
+              WarpMode warpMode, float flatness)
 {
         return NotImplemented;
 }
@@ -762,3 +759,5 @@ GdipIsOutlineVisiblePathPointI (GpPath *path, int x, int y, GpGraphics *graphics
 {
         return NotImplemented;
 }
+
+
index ebd079d59503075247f80c62a38890ef2b05d19d..1df677fb1fef1e656a15f63b29806fae4427c775 100644 (file)
@@ -19,9 +19,9 @@ GpStatus GdipClonePath (GpPath *path, GpPath **clonePath);
 GpStatus GdipDeletePath (GpPath *path);
 GpStatus GdipResetPath (GpPath *path);
 GpStatus GdipGetPointCount (GpPath *path, int *count);
-GpStatus GdipGetPathTypes (GpPath *path, byte *types, int *count);
-GpStatus GdipGetPathPoints (GpPath *path, GpPointF *points, int *count);
-GpStatus GdipGetPathPointsI (GpPath *path, GpPoint *points, int *count);
+GpStatus GdipGetPathTypes (GpPath *path, byte *types, int count);
+GpStatus GdipGetPathPoints (GpPath *path, GpPointF *points, int count);
+GpStatus GdipGetPathPointsI (GpPath *path, GpPoint *points, int count);
 GpStatus GdipGetPathFillMode (GpPath *path, GpFillMode *fillmode);
 GpStatus GdipSetPathFillMode (GpPath *path, GpFillMode fillmode);
 GpStatus GdipGetPathData (GpPath *path, GpPathData *pathData);
index 8eb8d364ae64eea1869d0aa0431095722f9cafb4..1947629130883d826a4a67af221243e5acf18e74 100644 (file)
@@ -14,8 +14,9 @@ GpStatus
 GdipCreateMatrix (GpMatrix **matrix)
 {
         *matrix = cairo_matrix_create ();
-        cairo_matrix_set_affine (*matrix, 1, 0, 0, 1, 0, 0);
-        return Ok;
+
+        return gdip_get_status (
+                cairo_matrix_set_affine (*matrix, 1, 0, 0, 1, 0, 0));
 }
 
 GpStatus
@@ -291,7 +292,7 @@ GdipIsMatrixInvertible (GpMatrix *matrix, int *result)
         return Ok;
 }
 
-static int
+static bool
 matrix_equals (GpMatrix *x, GpMatrix *y)
 {
         double ax, bx, cx, dx, ex, fx;
@@ -302,9 +303,9 @@ matrix_equals (GpMatrix *x, GpMatrix *y)
 
         if ((ax != ay) || (bx != by) || (cx != cy) ||
             (dx != dy) || (ex != ey) || (fx != fy))
-                return 0;
+                return FALSE;
 
-        return 1;
+        return TRUE;
 }
 
 GpStatus