Browse Source

revert big, unreviewed, broken changes from r104029/30/31

svn path=/trunk/mcs/; revision=104043
Sebastien Pouliot 17 years ago
parent
commit
233f3615b3
31 changed files with 1586 additions and 1593 deletions
  1. 0 6
      mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
  2. 508 509
      mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs
  3. 6 6
      mcs/class/System.Drawing/System.Drawing.Drawing2D/HatchBrush.cs
  4. 0 11
      mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog
  5. 39 38
      mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs
  6. 25 30
      mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameter.cs
  7. 40 38
      mcs/class/System.Drawing/System.Drawing.Imaging/ImageAttributes.cs
  8. 33 28
      mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs
  9. 22 22
      mcs/class/System.Drawing/System.Drawing/Bitmap.cs
  10. 0 36
      mcs/class/System.Drawing/System.Drawing/ChangeLog
  11. 6 7
      mcs/class/System.Drawing/System.Drawing/CharacterRange.cs
  12. 21 19
      mcs/class/System.Drawing/System.Drawing/Color.cs
  13. 45 49
      mcs/class/System.Drawing/System.Drawing/Font.cs
  14. 22 17
      mcs/class/System.Drawing/System.Drawing/FontFamily.cs
  15. 185 179
      mcs/class/System.Drawing/System.Drawing/Graphics.cs
  16. 11 11
      mcs/class/System.Drawing/System.Drawing/Icon.cs
  17. 21 19
      mcs/class/System.Drawing/System.Drawing/IconConverter.cs
  18. 86 80
      mcs/class/System.Drawing/System.Drawing/Image.cs
  19. 12 12
      mcs/class/System.Drawing/System.Drawing/ImageAnimator.cs
  20. 25 23
      mcs/class/System.Drawing/System.Drawing/ImageConverter.cs
  21. 23 20
      mcs/class/System.Drawing/System.Drawing/ImageFormatConverter.cs
  22. 13 13
      mcs/class/System.Drawing/System.Drawing/Point.cs
  23. 7 7
      mcs/class/System.Drawing/System.Drawing/PointF.cs
  24. 43 41
      mcs/class/System.Drawing/System.Drawing/Rectangle.cs
  25. 53 51
      mcs/class/System.Drawing/System.Drawing/RectangleF.cs
  26. 199 194
      mcs/class/System.Drawing/System.Drawing/Region.cs
  27. 17 14
      mcs/class/System.Drawing/System.Drawing/Size.cs
  28. 15 14
      mcs/class/System.Drawing/System.Drawing/SizeF.cs
  29. 79 69
      mcs/class/System.Drawing/System.Drawing/StringFormat.cs
  30. 24 24
      mcs/class/System.Drawing/System.Drawing/SystemFonts.cs
  31. 6 6
      mcs/class/System.Drawing/System.Drawing/TextureBrush.cs

+ 0 - 6
mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog

@@ -1,9 +1,3 @@
-2008-05-25  Gert Driesen  <[email protected]>
-
-	* GraphicsPath.cs: Changed argument names to match MS. Changed spaces
-	to tabs, and removed extra tabs.
-	* HatchBrush.cs: Changed argument names to match MS.
-
 2007-11-13  Atsushi Enomoto  <[email protected]>
 
 	* GraphicsPath.cs : AddBeziers(Point[]) arg is "params" in 2.0.

+ 508 - 509
mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs

@@ -50,14 +50,14 @@ namespace System.Drawing.Drawing2D
 
 		public GraphicsPath ()
 		{
-			Status status = GDIPlus.GdipCreatePath (FillMode.Alternate, out nativePath);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCreatePath (FillMode.Alternate, out nativePath);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public GraphicsPath (FillMode fillMode)
 		{
-			Status status = GDIPlus.GdipCreatePath (fillMode, out nativePath);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCreatePath (fillMode, out nativePath);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public GraphicsPath (Point[] pts, byte[] types)
@@ -92,27 +92,27 @@ namespace System.Drawing.Drawing2D
 			GDIPlus.CheckStatus (status);
 		}
 	
-		public object Clone ()
-		{
-			IntPtr clone;
-
-			Status status = GDIPlus.GdipClonePath (nativePath, out clone);
-			GDIPlus.CheckStatus (status);
-
-			return new GraphicsPath (clone);
-		}
-
-		public void Dispose ()
-		{
-			Dispose (true);
-			System.GC.SuppressFinalize (this);
-		}
-
-		~GraphicsPath ()
-		{
-			Dispose (false);
-		}
-
+                public object Clone ()
+                {
+                        IntPtr clone;
+
+                        Status status = GDIPlus.GdipClonePath (nativePath, out clone);
+                        GDIPlus.CheckStatus (status);                      	
+
+                        return new GraphicsPath (clone);
+                }
+
+                public void Dispose ()
+                {
+                        Dispose (true);
+                        System.GC.SuppressFinalize (this);
+                }
+
+                ~GraphicsPath ()
+                {
+                        Dispose (false);
+                }
+                
 		void Dispose (bool disposing)
 		{
 			Status status;
@@ -177,7 +177,7 @@ namespace System.Drawing.Drawing2D
 
 				PointF [] points = new PointF [count];
 				status = GDIPlus.GdipGetPathPoints (nativePath, points, count); 
-				GDIPlus.CheckStatus (status);
+				GDIPlus.CheckStatus (status);		      	
 
 				return points;
 			}
@@ -218,150 +218,149 @@ namespace System.Drawing.Drawing2D
 			}
 		}
 
-		//
-		// AddArc
-		//
-		public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddBezier
-		//
-		public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
-		{
-			Status status = GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,
-					pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
-
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
-		{
-			Status status = GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,
-					pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
-
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
-		{
-			Status status = GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
-		{
-			Status status = GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddBeziers
-		//
+                //
+                // AddArc
+                //
+                public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
+                {
+                        Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
+                {
+                        Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
+                {
+                        Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
+                {
+                        Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddBezier
+                //
+                public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
+                {
+                        Status status = GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,
+                                        pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
+                                        
+			GDIPlus.CheckStatus (status);                      		                                      
+                }
+
+                public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
+                {
+                        Status status = GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,
+                                        pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
+                                        
+			GDIPlus.CheckStatus (status);                      	                                       
+                }
+
+                public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
+                {
+                        Status status = GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
+                {
+                        Status status = GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddBeziers
+                //
 #if NET_2_0
-		public void AddBeziers (params Point [] points)
+                public void AddBeziers (params Point [] pts)
 #else
-		public void AddBeziers (Point [] points)
+                public void AddBeziers (Point [] pts)
 #endif
-		{
-			if (points == null)
-				throw new ArgumentNullException ("points");
-			Status status = GDIPlus.GdipAddPathBeziersI (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddBeziers (PointF [] points)
-		{
-			if (points == null)
-				throw new ArgumentNullException ("points");
-			Status status = GDIPlus.GdipAddPathBeziers (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddEllipse
-		//
-		public void AddEllipse (RectangleF rect)
-		{
-			Status status = GDIPlus.GdipAddPathEllipse (nativePath,
-				rect.X, rect.Y, rect.Width, rect.Height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddEllipse (float x, float y, float width, float height)
-		{
-			Status status = GDIPlus.GdipAddPathEllipse (nativePath, x, y, width, height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddEllipse (Rectangle rect)
-		{
-			Status status = GDIPlus.GdipAddPathEllipseI (nativePath,
-				rect.X, rect.Y, rect.Width, rect.Height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddEllipse (int x, int y, int width, int height)
-		{
-			Status status = GDIPlus.GdipAddPathEllipseI (nativePath, x, y, width, height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddLine
-		//
-		public void AddLine (Point pt1, Point pt2)
-		{
-			Status status = GDIPlus.GdipAddPathLineI (nativePath,
-				pt1.X, pt1.Y, pt2.X, pt2.Y);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddLine (PointF pt1, PointF pt2)
-		{
-			Status status = GDIPlus.GdipAddPathLine (nativePath,
-				pt1.X, pt1.Y, pt2.X, pt2.Y);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddLine (int x1, int y1, int x2, int y2)
-		{
-			Status status = GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddLine (float x1, float y1, float x2, float y2)
-		{
-			Status status = GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,
-					y2);
-
-			GDIPlus.CheckStatus (status);
-		}
+                {
+			if (pts == null)
+				throw new ArgumentNullException ("pts");
+                        Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		//
-		// AddLines
-		//
+                public void AddBeziers (PointF [] pts)
+                {
+			if (pts == null)
+				throw new ArgumentNullException ("pts");
+                        Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddEllipse
+                //
+                public void AddEllipse (RectangleF r)
+                {
+                        Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+                public void AddEllipse (float x, float y, float width, float height)
+                {
+                        Status status = GDIPlus.GdipAddPathEllipse (nativePath, x, y, width, height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddEllipse (Rectangle r)
+                {
+                        Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+                public void AddEllipse (int x, int y, int width, int height)
+                {
+                        Status status = GDIPlus.GdipAddPathEllipseI (nativePath, x, y, width, height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+
+                //
+                // AddLine
+                //
+                public void AddLine (Point a, Point b)
+                {
+                        Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddLine (PointF a, PointF b)
+                {
+                        Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
+                                        b.Y);
+                                        
+			GDIPlus.CheckStatus (status);                      	                                       
+                }
+
+                public void AddLine (int x1, int y1, int x2, int y2)
+                {
+                        Status status = GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddLine (float x1, float y1, float x2, float y2)
+                {
+                        Status status = GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,
+                                        y2);                
+                                        
+			GDIPlus.CheckStatus (status);                      	                                       
+                }
+
+                //
+                // AddLines
+                //
 		public void AddLines (Point[] points)
 		{
 			if (points == null)
@@ -370,7 +369,7 @@ namespace System.Drawing.Drawing2D
 				throw new ArgumentException ("points");
 
 			Status status = GDIPlus.GdipAddPathLine2I (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);                      	
 		}
 
 		public void AddLines (PointF[] points)
@@ -381,234 +380,234 @@ namespace System.Drawing.Drawing2D
 				throw new ArgumentException ("points");
 
 			Status status = GDIPlus.GdipAddPathLine2 (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddPie
-		//
-		public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathPie (
-				nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathPieI (nativePath, x, y, width, height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
-		{
-			Status status = GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddPolygon
-		//
-		public void AddPolygon (Point [] points)
-		{
+			GDIPlus.CheckStatus (status);                      	
+		}
+        
+                //
+                // AddPie
+                //
+                public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
+                {
+                        Status status = GDIPlus.GdipAddPathPie (
+                                nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
+                {
+                        Status status = GDIPlus.GdipAddPathPieI (nativePath, x, y, width, height, startAngle, sweepAngle);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
+                {
+                        Status status = GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);                
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddPolygon
+                //
+                public void AddPolygon (Point [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddPolygon (PointF [] points)
-		{
+                public void AddPolygon (PointF [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddRectangle
-		//
-		public void AddRectangle (Rectangle rect)
-		{
-			Status status = GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddRectangle (RectangleF rect)
-		{
-			Status status = GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
-			GDIPlus.CheckStatus (status);
-		}
-
-		//
-		// AddRectangles
-		//
-		public void AddRectangles (Rectangle [] rects)
-		{
+                        Status status = GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddRectangle
+                //
+                public void AddRectangle (Rectangle rect)
+                {
+                        Status status = GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void AddRectangle (RectangleF rect)
+                {
+                        Status status = GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                //
+                // AddRectangles
+                //
+                public void AddRectangles (Rectangle [] rects)
+                {
 			if (rects == null)
 				throw new ArgumentNullException ("rects");
 			if (rects.Length == 0)
 				throw new ArgumentException ("rects");
 
-			Status status = GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddRectangles (RectangleF [] rects)
-		{
+                public void AddRectangles (RectangleF [] rects)
+                {
 			if (rects == null)
 				throw new ArgumentNullException ("rects");
 			if (rects.Length == 0)
 				throw new ArgumentException ("rects");
 
-			Status status = GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		//
-		// AddPath
-		//
-		public void AddPath (GraphicsPath addingPath, bool connect)
-		{
+                //
+                // AddPath
+                //
+                public void AddPath (GraphicsPath addingPath, bool connect)
+                {
 			if (addingPath == null)
 				throw new ArgumentNullException ("addingPath");
 
-			Status status = GDIPlus.GdipAddPathPath (nativePath, addingPath.nativePath, connect);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathPath (nativePath, addingPath.nativePath, connect);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public PointF GetLastPoint ()
-		{
-			PointF pt;
-			Status status = GDIPlus.GdipGetPathLastPoint (nativePath, out pt);
-			GDIPlus.CheckStatus (status);
+                public PointF GetLastPoint ()
+                {
+                        PointF pt;
+                        Status status = GDIPlus.GdipGetPathLastPoint (nativePath, out pt);
+                        GDIPlus.CheckStatus (status);                      	
 
-			return pt;
-		}
+                        return pt;
+                }
 
-		//
-		// AddClosedCurve
-		//
-		public void AddClosedCurve (Point [] points)
-		{
+                //
+                // AddClosedCurve
+                //
+                public void AddClosedCurve (Point [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddClosedCurve (PointF [] points)
-		{
+                public void AddClosedCurve (PointF [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddClosedCurve (Point [] points, float tension)
-		{
+                public void AddClosedCurve (Point [] points, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddClosedCurve (PointF [] points, float tension)
-		{
+                public void AddClosedCurve (PointF [] points, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		//
-		// AddCurve
-		//
-		public void AddCurve (Point [] points)
-		{
+                //
+                // AddCurve
+                //
+                public void AddCurve (Point [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddCurve (PointF [] points)
-		{
+                        Status status = GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+                public void AddCurve (PointF [] points)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddCurve (Point [] points, float tension)
-		{
+                        Status status = GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+                public void AddCurve (Point [] points, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddCurve (PointF [] points, float tension)
-		{
+                        Status status = GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
+                public void AddCurve (PointF [] points, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
+                        GDIPlus.CheckStatus (status);                      	
+                }
 
-		public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
-		{
+                public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
-					offset, numberOfSegments, tension);
-
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
-		{
+                        Status status = GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
+                                        offset, numberOfSegments, tension);
+                                        
+			GDIPlus.CheckStatus (status);                      	                                       
+                }
+                
+                public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
+                {
 			if (points == null)
 				throw new ArgumentNullException ("points");
 
-			Status status = GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
-					offset, numberOfSegments, tension);
-
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void Reset ()
-		{
-			Status status = GDIPlus.GdipResetPath (nativePath);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void Reverse ()
-		{
-			Status status = GDIPlus.GdipReversePath (nativePath);
-			GDIPlus.CheckStatus (status);
-		}
-
-		public void Transform (Matrix matrix)
-		{
+                        Status status = GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
+                                        offset, numberOfSegments, tension);
+                                        
+			GDIPlus.CheckStatus (status);                      	                                       
+                }
+                        
+                public void Reset ()
+                {
+                        Status status = GDIPlus.GdipResetPath (nativePath);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void Reverse ()
+                {
+                        Status status = GDIPlus.GdipReversePath (nativePath);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+
+                public void Transform (Matrix matrix)
+                {
 			if (matrix == null)
 				throw new ArgumentNullException ("matrix");
 
-			Status status = GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);
-			GDIPlus.CheckStatus (status);
-		}
-
+                        Status status = GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);
+                        GDIPlus.CheckStatus (status);                      	
+                }
+                
 		[MonoTODO ("The StringFormat parameter is ignored when using libgdiplus.")]
 		public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
 		{
@@ -620,12 +619,12 @@ namespace System.Drawing.Drawing2D
 
 		[MonoTODO ("The StringFormat parameter is ignored when using libgdiplus.")]
 		public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
-		{
+  		{
 			RectangleF layout = new RectangleF ();
 			layout.X = origin.X;
 			layout.Y = origin.Y;
 			AddString (s, family, style, emSize, layout, format);
-		}
+                }
 
 		[MonoTODO ("The layoutRect and StringFormat parameters are ignored when using libgdiplus.")]
 		public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
@@ -640,7 +639,7 @@ namespace System.Drawing.Drawing2D
 		}
 
 		[MonoTODO ("The layoutRect and StringFormat parameters are ignored when using libgdiplus.")]
-		public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
+  		public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
 		{
 			if (family == null)
 				throw new ArgumentException ("family");
@@ -651,253 +650,253 @@ namespace System.Drawing.Drawing2D
 			GDIPlus.CheckStatus (status);
 		}
 
-		public void ClearMarkers ()
+		public void ClearMarkers()               
 		{
-			Status s = GDIPlus.GdipClearPathMarkers (nativePath);
+                	Status s = GDIPlus.GdipClearPathMarkers (nativePath);
 
-			GDIPlus.CheckStatus (s);
-		}
-
-		public void CloseAllFigures ()
+                        GDIPlus.CheckStatus (s);
+                }
+                
+		public void CloseAllFigures()
 		{
-			Status s = GDIPlus.GdipClosePathFigures (nativePath);
+                	Status s = GDIPlus.GdipClosePathFigures (nativePath);
 
-			GDIPlus.CheckStatus (s);
-		}
-
-		public void CloseFigure ()
+                        GDIPlus.CheckStatus (s);
+                }  	
+                
+		public void CloseFigure()
 		{
-			Status s = GDIPlus.GdipClosePathFigure (nativePath);
+                	Status s = GDIPlus.GdipClosePathFigure (nativePath);
 
-			GDIPlus.CheckStatus (s);
-		}
-
-		public void Flatten ()
-		{
-			Flatten (null, FlatnessDefault);
-		}
+                        GDIPlus.CheckStatus (s);
+                } 
 
+                public void Flatten ()
+                {
+                	Flatten (null, FlatnessDefault); 
+                }  	
+  
 		public void Flatten (Matrix matrix)
 		{
-			Flatten (matrix, FlatnessDefault);
-		}
+                	Flatten (matrix, FlatnessDefault);
+                }
 		
 		public void Flatten (Matrix matrix, float flatness)
 		{
-			IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
-			Status status = GDIPlus.GdipFlattenPath (nativePath, m, flatness);
+                        IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
+                	Status status = GDIPlus.GdipFlattenPath (nativePath, m, flatness);
 
-			GDIPlus.CheckStatus (status);
-		}
+                        GDIPlus.CheckStatus (status);
+                }  		
+                
+                public RectangleF GetBounds ()
+                {
+                	return GetBounds (null, null);
+                }  		
 
-		public RectangleF GetBounds ()
-		{
-			return GetBounds (null, null);
-		}
+                public RectangleF GetBounds (Matrix matrix)
+                {
+                	return GetBounds (matrix, null);
+                }
 
-		public RectangleF GetBounds (Matrix matrix)
-		{
-			return GetBounds (matrix, null);
-		}
+                public RectangleF GetBounds (Matrix matrix, Pen pen)
+                {
+                        RectangleF retval;
+                        IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
+                        IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
+                        
+                        Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
 
-		public RectangleF GetBounds (Matrix matrix, Pen pen)
-		{
-			RectangleF retval;
-			IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
-			IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
-
-			Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
-
-			GDIPlus.CheckStatus (s);
+                        GDIPlus.CheckStatus (s);
 
-			return retval;
-		}
+                        return retval;
+                }
 
 		public bool IsOutlineVisible (Point point, Pen pen)
 		{
-			return IsOutlineVisible (point.X, point.Y, pen, null);
-		}
-
+                        return IsOutlineVisible (point.X, point.Y, pen, null);
+                }  		
+		
 		public bool IsOutlineVisible (PointF point, Pen pen)
 		{
-			return IsOutlineVisible (point.X, point.Y, pen, null);
-		}
-
+                	return IsOutlineVisible (point.X, point.Y, pen, null);
+                } 
+		
 		public bool IsOutlineVisible (int x, int y, Pen pen)
 		{
-			return IsOutlineVisible (x, y, pen, null);
-		}
+                        return IsOutlineVisible (x, y, pen, null);
+                }
 
 		public bool IsOutlineVisible (float x, float y, Pen pen)
 		{
-			return IsOutlineVisible (x, y, pen, null);
-		}
-
+                	return IsOutlineVisible (x, y, pen, null);
+                }  		
+		
 		public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
 		{
-			return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
-		}
-
+                	return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
+                }  		
+		
 		public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
 		{
-			return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
-		}
-
+                	return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
+                }  		
+				
 		public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
 
-			bool result;
-			IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
+                        bool result;
+                        IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
+                        
+                	Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, pen.nativeObject, g, out result);
+                        GDIPlus.CheckStatus (s);
 
-			Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, pen.nativeObject, g, out result);
-			GDIPlus.CheckStatus (s);
-
-			return result;
-		}
+                        return result;
+                }  		
 
 		public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
 
-			bool result;
-			IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
-
-			Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, pen.nativeObject, g, out result);
-			GDIPlus.CheckStatus (s);
-
-			return result;
-		}
-
-		public bool IsVisible (Point point)
-		{
-			return IsVisible (point.X, point.Y, null);
-		}
-
-		public bool IsVisible (PointF point)
-		{
-			return IsVisible (point.X, point.Y, null);
-		}
-
-		public bool IsVisible (int x, int y)
-		{
-			return IsVisible (x, y, null);
-		}
-
-		public bool IsVisible (float x, float y)
-		{
-			return IsVisible (x, y, null);
-		}
-
-		public bool IsVisible (Point pt, Graphics graphics)
-		{
-			return IsVisible (pt.X, pt.Y, graphics);
-		}
-
-		public bool IsVisible (PointF pt, Graphics graphics)
-		{
-			return IsVisible (pt.X, pt.Y, graphics);
-		}
-
-		public bool IsVisible (int x, int y, Graphics graphics)
-		{
-			bool retval;
-
-			IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
-
-			Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
-
-			GDIPlus.CheckStatus (s);
-
-			return retval;
-		}
-
-		public bool IsVisible (float x, float y, Graphics graphics)
-		{
-			bool retval;
-
-			IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
-
-			Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
-
-			GDIPlus.CheckStatus (s);
-
-			return retval;
-		}
-
-		public void SetMarkers ()
-		{
-			Status s = GDIPlus.GdipSetPathMarker (nativePath);
-
-			GDIPlus.CheckStatus (s);
-		}
-
-		public void StartFigure()
-		{
-			Status s = GDIPlus.GdipStartPathFigure (nativePath);
-
-			GDIPlus.CheckStatus (s);
-		}
-
+                        bool result;
+                        IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
+                        
+                	Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, pen.nativeObject, g, out result);
+                        GDIPlus.CheckStatus (s);
+
+                        return result;
+                }  		
+                
+                public bool IsVisible (Point point)
+                {
+                	return IsVisible (point.X, point.Y, null);
+                }  		
+                
+                public bool IsVisible (PointF point)
+                {
+                	return IsVisible (point.X, point.Y, null);
+                }  		
+                
+                public bool IsVisible (int x, int y)
+                {
+                	return IsVisible (x, y, null);
+                }
+
+                public bool IsVisible (float x, float y)
+                {
+                	return IsVisible (x, y, null);
+                }  		                
+                
+                public bool IsVisible (Point pt, Graphics graphics)
+                {
+                	return IsVisible (pt.X, pt.Y, graphics);
+                }  		
+                
+                public bool IsVisible (PointF pt, Graphics graphics)
+                {
+                	return IsVisible (pt.X, pt.Y, graphics);
+                }  		
+                                
+                public bool IsVisible (int x, int y, Graphics graphics)
+                {
+                        bool retval;
+
+                	IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
+
+                        Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
+
+                        GDIPlus.CheckStatus (s);
+
+                        return retval;
+                }  		
+                
+                public bool IsVisible (float x, float y, Graphics graphics)
+                {
+                        bool retval;
+
+                	IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
+
+                        Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
+
+                        GDIPlus.CheckStatus (s);
+
+                        return retval;
+                }  		
+                
+                public void SetMarkers ()
+                {
+                	Status s = GDIPlus.GdipSetPathMarker (nativePath);
+
+                        GDIPlus.CheckStatus (s);
+                }
+                
+                public void StartFigure()
+                {
+                	Status s = GDIPlus.GdipStartPathFigure (nativePath);
+
+                        GDIPlus.CheckStatus (s);
+                }  		
+                
 		[MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
-		public void Warp (PointF[] destPoints, RectangleF srcRect)
-		{
-			Warp (destPoints, srcRect, null, WarpMode.Perspective, FlatnessDefault);
-		}
+                public void Warp (PointF[] destPoints, RectangleF srcRect)
+                {
+                	Warp (destPoints, srcRect, null, WarpMode.Perspective, FlatnessDefault);
+                }  		
 
 		[MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
 		public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
 		{
-			Warp (destPoints, srcRect, matrix, WarpMode.Perspective, FlatnessDefault);
-		}
+                	Warp (destPoints, srcRect, matrix, WarpMode.Perspective, FlatnessDefault);
+                }  		
 
 		[MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
 		public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
 		{
-			Warp (destPoints, srcRect, matrix, warpMode, FlatnessDefault);
-		}
+                	Warp (destPoints, srcRect, matrix, warpMode, FlatnessDefault);
+                }  		
 
 		[MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
-		public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
+		public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix,  WarpMode warpMode, float flatness)
 		{
 			if (destPoints == null)
 				throw new ArgumentNullException ("destPoints");
 
-			IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
-
-			Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
-				srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
+                	IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
 
-			GDIPlus.CheckStatus (s);
-		}
+                        Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
+                                        srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
 
+                        GDIPlus.CheckStatus (s);
+                }
+                
 		[MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
-		public void Widen (Pen pen)
+                public void Widen (Pen pen)
 		{
-			Widen (pen, null, FlatnessDefault);
-		}
-
+                	Widen (pen, null, FlatnessDefault);
+                }  		
+                
 		[MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
 		public void Widen (Pen pen, Matrix matrix)
-		{
-			Widen (pen, matrix, FlatnessDefault);
-		}
-
+		{	
+                	Widen (pen, matrix, FlatnessDefault);
+                }  		
+                
 		[MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
 		public void Widen (Pen pen, Matrix matrix, float flatness)
-		{
+                {
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
 #if NET_2_0
 			if (PointCount == 0)
 				return;
 #endif
-			IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
+                	IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
 
 			Status s = GDIPlus.GdipWidenPath (nativePath, pen.nativeObject, m, flatness);
 			GDIPlus.CheckStatus (s);
-		}
-	}
+                } 
+        }
 }

+ 6 - 6
mcs/class/System.Drawing/System.Drawing.Drawing2D/HatchBrush.cs

@@ -40,20 +40,19 @@ namespace System.Drawing.Drawing2D
 	/// </summary>
 	public sealed class HatchBrush : Brush 
 	{
+
 		internal HatchBrush (IntPtr ptr) : base (ptr)
 		{
 		}
 
-		public HatchBrush (HatchStyle hatchstyle, Color foreColor)
-			: this (hatchstyle, foreColor, Color.Black)
+		public HatchBrush (HatchStyle hatchStyle, Color foreColor)
+					: this (hatchStyle, foreColor, Color.Black)
 		{
 		}
 
-		public HatchBrush (HatchStyle hatchstyle, Color foreColor, Color backColor)
+		public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
 		{
-			Status status = GDIPlus.GdipCreateHatchBrush (hatchstyle,
-				foreColor.ToArgb (), backColor.ToArgb (),
-				out nativeObject);
+			Status status = GDIPlus.GdipCreateHatchBrush (hatchStyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -93,5 +92,6 @@ namespace System.Drawing.Drawing2D
 			HatchBrush clone = new HatchBrush (clonePtr);
 			return clone;
 		}
+
 	}
 }

+ 0 - 11
mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog

@@ -1,14 +1,3 @@
-2008-05-25  Gert Driesen  <[email protected]>
-
-	* ColorMatrix.cs: Changed argument names to match MS. Changed spaces
-	to tabs, and removed extra tabs.
-	* EncoderParameter.cs: Changed argument names to match MS. Changed
-	spaces to tabs, and removed extra tabs.
-	* ImageAttributes.cs: Changed argument names to match MS. Changed
-	spaces to tabs, and removed extra tabs.
-	* Metafile.cs: Changed argument names to match MS. Changes spaces to
-	tabs, and removed extra tabs. Fixed typo in MonoLimitation text.
-
 2008-05-14  Sebastien Pouliot  <[email protected]>
 
 	* EncoderParameters.cs: Don't downcast an IntPtr to an Int32.

+ 39 - 38
mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs

@@ -80,38 +80,38 @@ namespace System.Drawing.Imaging
 		}
 
 		[CLSCompliant(false)]
-		public ColorMatrix (float [] [] newColorMatrix)
-		{
-			color00 = newColorMatrix [0][0];
-			color01 = newColorMatrix [0][1];
-			color02 = newColorMatrix [0][2];
-			color03 = newColorMatrix [0][3];
-			color04 = newColorMatrix [0][4];
-			color10 = newColorMatrix [1][0];
-			color11 = newColorMatrix [1][1];
-			color12 = newColorMatrix [1][2];
-			color13 = newColorMatrix [1][3];
-			color14 = newColorMatrix [1][4];
-			color20 = newColorMatrix [2][0];
-			color21 = newColorMatrix [2][1];
-			color22 = newColorMatrix [2][2];
-			color23 = newColorMatrix [2][3];
-			color24 = newColorMatrix [2][4];
-			color30 = newColorMatrix [3][0];
-			color31 = newColorMatrix [3][1];
-			color32 = newColorMatrix [3][2];
-			color33 = newColorMatrix [3][3];
-			color34 = newColorMatrix [3][4];
-			color40 = newColorMatrix [4][0];
-			color41 = newColorMatrix [4][1];
-			color42 = newColorMatrix [4][2];
-			color43 = newColorMatrix [4][3];
-			color44 = newColorMatrix [4][4];
+		public ColorMatrix (float[][] matrix)
+		{			
+			color00 = matrix [0][0];
+			color01 = matrix [0][1];
+			color02 = matrix [0][2];
+			color03 = matrix [0][3];
+			color04 = matrix [0][4];
+			color10 = matrix [1][0];
+			color11 = matrix [1][1];
+			color12 = matrix [1][2];
+			color13 = matrix [1][3];
+			color14 = matrix [1][4];
+			color20 = matrix [2][0];
+			color21 = matrix [2][1];
+			color22 = matrix [2][2];
+			color23 = matrix [2][3];
+			color24 = matrix [2][4];
+			color30 = matrix [3][0];
+			color31 = matrix [3][1];
+			color32 = matrix [3][2];
+			color33 = matrix [3][3];
+			color34 = matrix [3][4];
+			color40 = matrix [4][0];
+			color41 = matrix [4][1];
+			color42 = matrix [4][2];
+			color43 = matrix [4][3];
+			color44 = matrix [4][4];						
 		}
 
 		// properties
 		public float this[int row, int column] {
-			get {
+			get {  
 				switch (row) {
 				case 0:	{
 					switch (column) {
@@ -131,7 +131,7 @@ namespace System.Drawing.Imaging
 					case 2: return color12;
 					case 3: return color13;
 					case 4: return color14;
-					default: break;
+					default: break;						
 					}
 					break;
 				}
@@ -142,7 +142,7 @@ namespace System.Drawing.Imaging
 					case 2: return color22;
 					case 3: return color23;
 					case 4: return color24;
-					default: break;
+					default: break;						
 					}
 					break;
 				}
@@ -153,7 +153,7 @@ namespace System.Drawing.Imaging
 					case 2: return color32;
 					case 3: return color33;
 					case 4: return color34;
-					default: break;
+					default: break;		
 					}
 					break;
 				}
@@ -164,7 +164,7 @@ namespace System.Drawing.Imaging
 					case 2: return color42;
 					case 3: return color43;
 					case 4: return color44;
-					default: break;
+					default: break;							
 					}
 					break;
 				}
@@ -174,7 +174,8 @@ namespace System.Drawing.Imaging
 			
 				throw new IndexOutOfRangeException ("Index was outside the bounds of the array");
 			}
-			set {
+			
+			set {  
 				switch (row) {
 				case 0:	{
 					switch (column) {
@@ -194,7 +195,7 @@ namespace System.Drawing.Imaging
 					case 2: color12 = value; return;
 					case 3: color13 = value; return;
 					case 4: color14 = value; return;
-					default: break;
+					default: break;						
 					}
 					break;
 				}
@@ -205,7 +206,7 @@ namespace System.Drawing.Imaging
 					case 2: color22 = value; return;
 					case 3: color23 = value; return;
 					case 4: color24 = value; return;
-					default: break;
+					default: break;						
 					}
 					break;
 				}
@@ -216,7 +217,7 @@ namespace System.Drawing.Imaging
 					case 2: color32 = value; return;
 					case 3: color33 = value; return;
 					case 4: color34 = value; return;
-					default: break;
+					default: break;		
 					}
 					break;
 				}
@@ -227,7 +228,7 @@ namespace System.Drawing.Imaging
 					case 2: color42 = value; return;
 					case 3: color43 = value; return;
 					case 4: color44 = value; return;
-					default: break;
+					default: break;							
 					}
 					break;
 				}
@@ -236,7 +237,7 @@ namespace System.Drawing.Imaging
 				}
 			
 				throw new IndexOutOfRangeException ("Index was outside the bounds of the array");
-			}
+			}			
 		}
 
 

+ 25 - 30
mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameter.cs

@@ -36,11 +36,11 @@ using System.Text;
 
 using System.Runtime.InteropServices;
 
-namespace System.Drawing.Imaging
-{
+namespace System.Drawing.Imaging {
+
 	[StructLayout(LayoutKind.Sequential)]
-	public sealed class EncoderParameter : IDisposable
-	{
+	public sealed class EncoderParameter : IDisposable {
+
 		private Encoder encoder;
 		private int valuesCount;
 		private EncoderParameterValueType type;
@@ -146,13 +146,13 @@ namespace System.Drawing.Imaging
 			Marshal.Copy (value, 0, this.valuePtr, valuesCount);
 		}
 
-		public EncoderParameter (Encoder encoder, int numerator, int demoninator)
+		public EncoderParameter (Encoder encoder, int numerator, int denominator)
 		{
 			this.encoder = encoder;
 			this.valuesCount = 1;
 			this.type = EncoderParameterValueType.ValueTypeRational;
 			this.valuePtr = Marshal.AllocHGlobal (8);
-			int [] valuearray = { numerator, demoninator };
+			int [] valuearray = { numerator, denominator };
 			Marshal.Copy (valuearray, 0, this.valuePtr, valuearray.Length);
 		}
 
@@ -198,25 +198,25 @@ namespace System.Drawing.Imaging
 			}
 		}
 
-		public EncoderParameter (Encoder encoder, int NumberOfValues, int Type, int Value)
+		public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
 		{
 			this.encoder = encoder;
-			this.valuePtr = (IntPtr) Value;
-			this.valuesCount = NumberOfValues;
-			this.type = (EncoderParameterValueType) Type;
+			this.valuePtr = (IntPtr) value;
+			this.valuesCount = numberOfValues;
+			this.type = (EncoderParameterValueType) type;
 		}
 
-		public EncoderParameter (Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2)
+		public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
 		{
 			this.encoder = encoder;
 			this.valuesCount = 1;
 			this.type = EncoderParameterValueType.ValueTypeRationalRange;
 			this.valuePtr = Marshal.AllocHGlobal (4 * 4);
-			int [] valuearray = { numerator1, demoninator1, numerator2, demoninator2 };
+			int [] valuearray = { numerator1, denominator1, numerator2, denominator2 };
 			Marshal.Copy (valuearray, 0, this.valuePtr, 4);
 		}
 
-		public EncoderParameter (Encoder encoder, int [] numerator1, int [] denominator1, int [] numerator2, int [] denominator2)
+		public EncoderParameter (Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2)
 		{
 			if (numerator1.Length != denominator1.Length ||
 			    numerator2.Length != denominator2.Length ||
@@ -230,10 +230,10 @@ namespace System.Drawing.Imaging
 			this.valuePtr = Marshal.AllocHGlobal (4 * valuesCount * 4);
 			IntPtr dest = this.valuePtr;
 			for (int i = 0; i < valuesCount; i++) {
-				Marshal.WriteInt32 (dest, i * 4, numerator1 [i]);
-				Marshal.WriteInt32 (dest, (i + 1) * 4, denominator1 [i]);
-				Marshal.WriteInt32 (dest, (i + 2) * 4, numerator2 [i]);
-				Marshal.WriteInt32 (dest, (i + 3) * 4, denominator2 [i]);
+				Marshal.WriteInt32 (dest, i * 4, numerator1[i]);
+				Marshal.WriteInt32 (dest, (i + 1) * 4, denominator1[i]);
+				Marshal.WriteInt32 (dest, (i + 2) * 4, numerator2[i]);
+				Marshal.WriteInt32 (dest, (i + 3) * 4, denominator2[i]);
 			}
 		}
 
@@ -241,6 +241,7 @@ namespace System.Drawing.Imaging
 			get {
 				return encoder;
 			}
+
 			set {
 				encoder = value;
 			}
@@ -264,32 +265,27 @@ namespace System.Drawing.Imaging
 			}
 		}
 
-		void Dispose (bool disposing)
-		{
+		void Dispose (bool disposing) {
 			if (valuePtr != IntPtr.Zero) {
 				Marshal.FreeHGlobal (valuePtr);
 				valuePtr = IntPtr.Zero;
 			}
 		}
 
-		public void Dispose ()
-		{
-			Dispose (true);
+		public void Dispose () {
+			Dispose (true);		
 			GC.SuppressFinalize(this);
 		}
 
-		~EncoderParameter ()
-		{
+		~EncoderParameter () {
 			Dispose (false);
 		}
 
-		internal static int NativeSize ()
-		{
+		internal static int NativeSize () {
 			return Marshal.SizeOf (typeof(GdipEncoderParameter));
 		}
 
-		internal void ToNativePtr (IntPtr epPtr)
-		{
+		internal void ToNativePtr (IntPtr epPtr) {
 			GdipEncoderParameter ep = new GdipEncoderParameter ();
 			ep.guid = this.encoder.Guid;
 			ep.numberOfValues = (uint) this.valuesCount;
@@ -298,8 +294,7 @@ namespace System.Drawing.Imaging
 			Marshal.StructureToPtr (ep, epPtr, false);
 		}
 
-		internal static EncoderParameter FromNativePtr (IntPtr epPtr)
-		{
+		internal static EncoderParameter FromNativePtr (IntPtr epPtr) {
 			GdipEncoderParameter ep;
 			ep = (GdipEncoderParameter) Marshal.PtrToStructure (epPtr, typeof(GdipEncoderParameter));
 

+ 40 - 38
mcs/class/System.Drawing/System.Drawing.Imaging/ImageAttributes.cs

@@ -33,11 +33,11 @@
 using System.Drawing.Drawing2D;
 using System.Runtime.InteropServices;
 
-namespace System.Drawing.Imaging
-{
+namespace System.Drawing.Imaging {
+
 	[StructLayout(LayoutKind.Sequential)]
-	public sealed class ImageAttributes : ICloneable, IDisposable
-	{
+	public sealed class ImageAttributes : ICloneable, IDisposable {
+		
 		private IntPtr nativeImageAttr;
 		
 		internal IntPtr NativeObject {
@@ -63,7 +63,7 @@ namespace System.Drawing.Imaging
 		}
 
 		//Clears the color keys for all GDI+ objects
-		public void ClearColorKey ()
+		public void ClearColorKey () 
 		{
 			ClearColorKey (ColorAdjustType.Default);
 		}
@@ -160,24 +160,25 @@ namespace System.Drawing.Imaging
 			SetColorKey (colorLow, colorHigh, ColorAdjustType.Default);
 		}
 
-		public void SetColorMatrix (ColorMatrix newColorMatrix)
+		public void SetColorMatrix (ColorMatrix colorMatrix)
 		{
-			SetColorMatrix (newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
+			SetColorMatrix (colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
 		}
 
-		public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag flags)
+		public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag)
 		{
-			SetColorMatrix (newColorMatrix, flags, ColorAdjustType.Default);
+			SetColorMatrix (colorMatrix, colorMatrixFlag, ColorAdjustType.Default);
 		}
 
-		public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
+		public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag, ColorAdjustType colorAdjustType)
 		{
-			IntPtr cm = ColorMatrix.Alloc (newColorMatrix);
+			IntPtr cm = ColorMatrix.Alloc (colorMatrix);
 			try {
-				Status status = GDIPlus.GdipSetImageAttributesColorMatrix (nativeImageAttr,
-					type, true, cm, IntPtr.Zero, mode);
+				Status status = GDIPlus.GdipSetImageAttributesColorMatrix (nativeImageAttr, 
+					colorAdjustType, true, cm, IntPtr.Zero, colorMatrixFlag);
 				GDIPlus.CheckStatus (status);
-			} finally {
+			}
+			finally {
 				ColorMatrix.Free (cm);
 			}
 		}
@@ -213,31 +214,32 @@ namespace System.Drawing.Imaging
 			IntPtr colorPalette;
 
 			Status status = GDIPlus.GdipGetImageAttributesAdjustedPalette (nativeImageAttr, out colorPalette, type);
-			palette.setFromGDIPalette (colorPalette);
+    			palette.setFromGDIPalette (colorPalette);
 			GDIPlus.CheckStatus (status);
 		}
 
 		public void SetBrushRemapTable (ColorMap[] map)
 		{
-			GdiColorMap gdiclr = new GdiColorMap ();
+			GdiColorMap gdiclr = new GdiColorMap ();						
 			IntPtr clrmap, lpPointer;
-			int mapsize = Marshal.SizeOf (gdiclr);
-			int size = mapsize * map.Length;
-			clrmap = lpPointer = Marshal.AllocHGlobal (size);
+			int mapsize = Marshal.SizeOf (gdiclr); 
+			int size =  mapsize * map.Length;			
+			clrmap = lpPointer =  Marshal.AllocHGlobal (size);	
 			try {
 				for (int i=0; i < map.Length; i++) {
 					gdiclr.from = map[i].OldColor.ToArgb();
 					gdiclr.to = map[i].NewColor.ToArgb();
 				
 					Marshal.StructureToPtr (gdiclr, lpPointer, false);
-					lpPointer = (IntPtr) (lpPointer.ToInt64() + mapsize);
+					lpPointer = (IntPtr) (lpPointer.ToInt64() + mapsize);						
 				}
 			
 				Status status = GDIPlus.GdipSetImageAttributesRemapTable (nativeImageAttr, 
 					ColorAdjustType.Brush, true, (uint) map.Length, clrmap);
 				GDIPlus.CheckStatus (status);
-			} finally {
-				Marshal.FreeHGlobal (clrmap);
+			}
+			finally {		
+				Marshal.FreeHGlobal (clrmap);   
 			}
 		}
 
@@ -281,24 +283,23 @@ namespace System.Drawing.Imaging
 				ColorMatrix.Free (cm);
 			}
 			GDIPlus.CheckStatus (status);
-		}
+		}		
 
 		public void SetGamma (float gamma)
 		{
 			SetGamma (gamma, ColorAdjustType.Default);
 		}
 
-		public void SetGamma (float gamma, ColorAdjustType type)
+		public void SetGamma (float gamma, ColorAdjustType coloradjust)
 		{
-			Status status = GDIPlus.GdipSetImageAttributesGamma (
-				nativeImageAttr, type, true, gamma);
-			GDIPlus.CheckStatus (status);
-		}
+			Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, coloradjust, true, gamma);
+			GDIPlus.CheckStatus (status);						
+		}	
 		
 		public void SetNoOp ()
 		{
-			SetNoOp (ColorAdjustType.Default);
-		}
+			SetNoOp (ColorAdjustType.Default);						
+		}			
 		
 		public void SetNoOp (ColorAdjustType type)
 		{
@@ -340,27 +341,28 @@ namespace System.Drawing.Imaging
 
 		public void SetRemapTable (ColorMap[] map, ColorAdjustType type)
 		{
-			GdiColorMap gdiclr = new GdiColorMap ();
+			GdiColorMap gdiclr = new GdiColorMap ();						
 			IntPtr clrmap, lpPointer;
-			int mapsize = Marshal.SizeOf (gdiclr);
-			int size = mapsize * map.Length;
-			clrmap = lpPointer = Marshal.AllocHGlobal (size);
+			int mapsize = Marshal.SizeOf (gdiclr); 
+			int size =  mapsize * map.Length;			
+			clrmap = lpPointer =  Marshal.AllocHGlobal (size);	
 			try {
 				for (int i=0; i < map.Length; i++) {
 					gdiclr.from = map[i].OldColor.ToArgb();
 					gdiclr.to = map[i].NewColor.ToArgb();
 				
 					Marshal.StructureToPtr (gdiclr, lpPointer, false);
-					lpPointer = (IntPtr) (lpPointer.ToInt64() + mapsize);
+					lpPointer = (IntPtr) (lpPointer.ToInt64() + mapsize);						
 				}
 			
 				Status status = GDIPlus.GdipSetImageAttributesRemapTable (nativeImageAttr, 
 					type, true, (uint) map.Length, clrmap);
 				GDIPlus.CheckStatus (status);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (clrmap);
 			}
-		}
+		}		
 
 		[MonoTODO ("Not supported by libgdiplus")]
 		public void SetThreshold (float threshold)
@@ -388,7 +390,7 @@ namespace System.Drawing.Imaging
 		public void SetWrapMode (WrapMode mode, Color color, bool clamp)
 		{
 			Status status = GDIPlus.GdipSetImageAttributesWrapMode (nativeImageAttr, mode, color.ToArgb (), clamp);
-			GDIPlus.CheckStatus (status);
+    			GDIPlus.CheckStatus (status);
 		}
 	}
 }

+ 33 - 28
mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs

@@ -34,16 +34,16 @@ using System.Reflection;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace System.Drawing.Imaging
-{
+namespace System.Drawing.Imaging {
+
 	[MonoTODO ("Metafiles, both WMF and EMF formats, are only partially supported.")]
 	[Serializable]
 #if ONLY_1_1
 	[ComVisible (false)]
 #endif
 	[Editor ("System.Drawing.Design.MetafileEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
-	public sealed class Metafile : Image
-	{
+	public sealed class Metafile : Image {
+
 		// constructors
 
 		internal Metafile (IntPtr ptr)
@@ -51,7 +51,7 @@ namespace System.Drawing.Imaging
 			nativeObject = ptr;
 		}
 
-		public Metafile (Stream stream)
+		public Metafile (Stream stream) 
 		{
 			if (stream == null)
 				throw new ArgumentException ("stream");
@@ -69,7 +69,7 @@ namespace System.Drawing.Imaging
 			GDIPlus.CheckStatus (status);
 		}
 
-		public Metafile (string filename)
+		public Metafile (string filename) 
 		{
 			if (filename == null)
 				throw new ArgumentNullException ("filename");
@@ -82,7 +82,7 @@ namespace System.Drawing.Imaging
 			GDIPlus.CheckStatus (status);
 		}
 
-		public Metafile (IntPtr henhmetafile, bool deleteEmf)
+		public Metafile (IntPtr henhmetafile, bool deleteEmf) 
 		{
 			Status status = GDIPlus.GdipCreateMetafileFromEmf (henhmetafile, deleteEmf, out nativeObject);
 			GDIPlus.CheckStatus (status);
@@ -103,7 +103,7 @@ namespace System.Drawing.Imaging
 		{
 		}
 
-		public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
+		public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader) 
 		{
 			Status status = GDIPlus.GdipCreateMetafileFromEmf (hmetafile, false, out nativeObject);
 			GDIPlus.CheckStatus (status);
@@ -135,7 +135,7 @@ namespace System.Drawing.Imaging
 		{
 		}
 
-		public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader, bool deleteWmf)
+		public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader, bool deleteWmf) 
 		{
 			Status status = GDIPlus.GdipCreateMetafileFromEmf (hmetafile, deleteWmf, out nativeObject);
 			GDIPlus.CheckStatus (status);
@@ -212,10 +212,10 @@ namespace System.Drawing.Imaging
 		}
 
 		public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
-			string desc)
+			string description)
 		{
 			Status status = GDIPlus.GdipRecordMetafileI (referenceHdc, type, ref frameRect, frameUnit,
-				desc, out nativeObject);
+				description, out nativeObject);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -253,13 +253,13 @@ namespace System.Drawing.Imaging
 		}
 		
 		public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, 
-			string desc) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
-			desc)
+			string description) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
+			description) 
 		{
 		}
 		
 		public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, 
-			EmfType type, string description)
+			EmfType type, string description) 
 		{
 			if (stream == null)
 				throw new NullReferenceException ("stream");
@@ -280,7 +280,7 @@ namespace System.Drawing.Imaging
 		}
 
 		public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, 
-			EmfType type, string description)
+			EmfType type, string description) 
 		{
 			if (stream == null)
 				throw new NullReferenceException ("stream");
@@ -323,7 +323,7 @@ namespace System.Drawing.Imaging
 			return nativeObject;
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
 		public MetafileHeader GetMetafileHeader ()
 		{
 			IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
@@ -331,12 +331,13 @@ namespace System.Drawing.Imaging
 				Status status = GDIPlus.GdipGetMetafileHeaderFromMetafile (nativeObject, header);
 				GDIPlus.CheckStatus (status);
 				return new MetafileHeader (header);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (header);
 			}
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
 		public static MetafileHeader GetMetafileHeader (IntPtr henhmetafile)
 		{
 			IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
@@ -344,12 +345,13 @@ namespace System.Drawing.Imaging
 				Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (henhmetafile, header);
 				GDIPlus.CheckStatus (status);
 				return new MetafileHeader (header);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (header);
 			}
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
 		public static MetafileHeader GetMetafileHeader (Stream stream)
 		{
 			if (stream == null)
@@ -371,12 +373,13 @@ namespace System.Drawing.Imaging
 				}
 				GDIPlus.CheckStatus (status);
 				return new MetafileHeader (header);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (header);
 			}
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
 		public static MetafileHeader GetMetafileHeader (string fileName)
 		{
 			if (fileName == null)
@@ -387,25 +390,27 @@ namespace System.Drawing.Imaging
 				Status status = GDIPlus.GdipGetMetafileHeaderFromFile (fileName, header);
 				GDIPlus.CheckStatus (status);
 				return new MetafileHeader (header);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (header);
 			}
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
-		public static MetafileHeader GetMetafileHeader (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
+		public static MetafileHeader GetMetafileHeader (IntPtr henhmetafile, WmfPlaceableFileHeader wmfHeader)
 		{
 			IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
 			try {
-				Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (hmetafile, header);
+				Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (henhmetafile, header);
 				GDIPlus.CheckStatus (status);
 				return new MetafileHeader (header);
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (header);
 			}
 		}
 
-		[MonoLimitation ("Metafiles are only partially supported by libgdiplus.")]
+		[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
 		public void PlayRecord (EmfPlusRecordType recordType, int flags, int dataSize, byte[] data)
 		{
 			Status status = GDIPlus.GdipPlayMetafileRecord (nativeObject, recordType, flags, dataSize, data);

+ 22 - 22
mcs/class/System.Drawing/System.Drawing/Bitmap.cs

@@ -69,15 +69,15 @@ namespace System.Drawing
 		}
 
 		public Bitmap (int width, int height, Graphics g)
-		{
+		{		
 			IntPtr bmp;
 			Status s = GDIPlus.GdipCreateBitmapFromGraphics (width, height, g.nativeObject, out bmp);
 			GDIPlus.CheckStatus (s);
-			nativeObject = bmp;
+			nativeObject = bmp;						
 		}
 
 		public Bitmap (int width, int height, PixelFormat format)
-		{
+		{	
 			IntPtr bmp;
 			Status s = GDIPlus.GdipCreateBitmapFromScan0 (width, height, 0, format, IntPtr.Zero, out bmp);
 			GDIPlus.CheckStatus (s);
@@ -136,12 +136,12 @@ namespace System.Drawing
 		}
 
 		public Bitmap (int width, int height, int stride, PixelFormat format, IntPtr scan0)
-		{
+		{		
 			IntPtr bmp;
-
+				
 			Status status = GDIPlus.GdipCreateBitmapFromScan0 (width, height, stride, format, scan0, out bmp);
-			GDIPlus.CheckStatus (status);
-			nativeObject = bmp;
+			GDIPlus.CheckStatus (status);	
+			nativeObject = bmp;						 								
 		}
 
 		private Bitmap (SerializationInfo info, StreamingContext context)
@@ -153,12 +153,12 @@ namespace System.Drawing
 		// methods
 		public Color GetPixel (int x, int y) {
 			
-			int argb;
-
+			int argb;				
+			
 			Status s = GDIPlus.GdipBitmapGetPixel(nativeObject, x, y, out argb);
 			GDIPlus.CheckStatus (s);
 
-			return Color.FromArgb(argb);
+			return Color.FromArgb(argb);		
 		}
 
 		public void SetPixel (int x, int y, Color color)
@@ -180,17 +180,17 @@ namespace System.Drawing
 		}
 
 		public Bitmap Clone (Rectangle rect, PixelFormat format)
-		{
-			IntPtr bmp;
+		{				
+			IntPtr bmp;			
 			Status status = GDIPlus.GdipCloneBitmapAreaI (rect.X, rect.Y, rect.Width, rect.Height,
 				format, nativeObject, out bmp);
 			GDIPlus.CheckStatus (status);
 			return new Bitmap (bmp);
-		}
+       		}
 		
 		public Bitmap Clone (RectangleF rect, PixelFormat format)
 		{
-			IntPtr bmp;
+			IntPtr bmp;			
 			Status status = GDIPlus.GdipCloneBitmapArea (rect.X, rect.Y, rect.Width, rect.Height,
 				format, nativeObject, out bmp);
 			GDIPlus.CheckStatus (status);
@@ -199,7 +199,7 @@ namespace System.Drawing
 
 		public static Bitmap FromHicon (IntPtr hicon)
 		{	
-			IntPtr bitmap;
+			IntPtr bitmap;	
 			Status status = GDIPlus.GdipCreateBitmapFromHICON (hicon, out bitmap);
 			GDIPlus.CheckStatus (status);
 			return new Bitmap (bitmap);
@@ -207,7 +207,7 @@ namespace System.Drawing
 
 		public static Bitmap FromResource (IntPtr hinstance, string bitmapName)	//TODO: Untested
 		{
-			IntPtr bitmap;
+			IntPtr bitmap;	
 			Status status = GDIPlus.GdipCreateBitmapFromResource (hinstance, bitmapName, out bitmap);
 			GDIPlus.CheckStatus (status);
 			return new Bitmap (bitmap);
@@ -241,7 +241,7 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipCreateHICONFromBitmap (nativeObject, out HandleIcon);
 			GDIPlus.CheckStatus (status);
 
-			return  HandleIcon;
+			return  HandleIcon;			
 		}
 
 		public BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format)
@@ -264,12 +264,12 @@ namespace System.Drawing
 
 		public void MakeTransparent ()
 		{
-			Color clr = GetPixel(0,0);
+			Color clr = GetPixel(0,0);			
 			MakeTransparent (clr);
 		}
 
 		public void MakeTransparent (Color transparentColor)
-		{
+		{							
 			// We have to draw always over a 32-bitmap surface that supports alpha channel
 			Bitmap	bmp = new Bitmap(Width, Height, PixelFormat.Format32bppArgb);
 			Graphics gr = Graphics.FromImage(bmp);
@@ -278,7 +278,7 @@ namespace System.Drawing
 			
 			imageAttr.SetColorKey(transparentColor,	transparentColor);
 
-			gr.DrawImage (this, destRect, 0, 0, Width, Height, GraphicsUnit.Pixel, imageAttr);
+			gr.DrawImage (this, destRect, 0, 0, Width, Height, GraphicsUnit.Pixel, imageAttr);					
 			
 			IntPtr oldBmp = nativeObject;
 			nativeObject = bmp.nativeObject;
@@ -295,9 +295,9 @@ namespace System.Drawing
 			GDIPlus.CheckStatus (status);
 		}
 
-		public void UnlockBits (BitmapData bitmapdata)
+		public void UnlockBits (BitmapData bitmap_data)
 		{
-			Status status = GDIPlus.GdipBitmapUnlockBits (nativeObject, bitmapdata);
+			Status status = GDIPlus.GdipBitmapUnlockBits (nativeObject, bitmap_data);
 			GDIPlus.CheckStatus (status);
 		}
 	}

+ 0 - 36
mcs/class/System.Drawing/System.Drawing/ChangeLog

@@ -1,39 +1,3 @@
-2008-05-25  Gert Driesen  <[email protected]>
-
-	* Bitmap.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* CharacterRange.cs: Changed argument names to match MS. 
-	* Color.cs: Changed argument names to match MS.
-	* Font.cs: Changed argument names to match MS. Code formatting.
-	* FontFamily.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* Graphics.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* Image.cs: Changed argument names to match MS. Changed spaces to tabs
-	and removed extra tabs. Code formatting.
-	* Icon.cs: Changed argument names to match MS. Changes spaces to tabs,
-	and removed extra tabs.
-	* IconConverter.cs: Changed argument names to match MS.
-	* ImageAnimator.cs: Code formatting. Changed argument names to match
-	MS.
-	* ImageConverter.cs: Changed argument names to match MS. Avoid double
-	cast in ConvertTo. Changed spaces to tabs, and removed extra tabs.
-	* ImageFormatConverter.cs: Changed argument names to match MS.
-	* Point.cs: Changed argument names to match MS.
-	* PointF.cs: Changed argument names to match MS.
-	* Rectangle.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* RectangleF.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* Region.cs: Changed argument names to match MS. Changed spaces to
-	tabs, and removed extra tabs.
-	* Size.cs: Changed argument names to match MS.
-	* SizeF.cs: Changed argument names to match MS.
-	* StringFormat.cs: Changed argument names to match MS. Changed spaces
-	to tabs, and removed extra tabs.
-	* SystemFonts.cs: Changed argument names to match MS. Code formatting.
-	* TextureBrush.cs: Changed argument names to match MS.
-
 2008-05-19  Sebastien Pouliot  <[email protected]>
 
 	* CharacterRange.cs,

+ 6 - 7
mcs/class/System.Drawing/System.Drawing/CharacterRange.cs

@@ -37,10 +37,10 @@ namespace System.Drawing
 		private int first;
 		private int length;
 
-		public CharacterRange (int First, int Length)
+		public CharacterRange (int first, int length)
 		{
-			this.first = First;
-			this.length = Length;
+			this.first = first;
+			this.length = length;
 		}
 
 		public int First {
@@ -60,14 +60,13 @@ namespace System.Drawing
 				length = value;
 			}
 		}
-
 #if NET_2_0
-		public override bool Equals (Object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is CharacterRange))
+			if (!(o is CharacterRange))
 				return false;
 
-			CharacterRange cr = (CharacterRange) obj;
+			CharacterRange cr = (CharacterRange) o;
 			return this == cr;
 		}
 

+ 21 - 19
mcs/class/System.Drawing/System.Drawing/Color.cs

@@ -164,25 +164,27 @@ namespace System.Drawing
 			return FromArgb ((argb >> 24) & 0x0FF, (argb >> 16) & 0x0FF, (argb >> 8) & 0x0FF, argb & 0x0FF);
 		}
 
-		public static Color FromKnownColor (KnownColor color)
+		public static Color FromKnownColor (KnownColor c)
 		{
-			return KnownColors.FromKnownColor (color);
+			return KnownColors.FromKnownColor (c);
 		}
 
-		public static Color FromName (string name)
+		public static Color FromName (string colorName)
 		{
 			try {
-				KnownColor kc = (KnownColor) Enum.Parse (typeof (KnownColor), name, true);
+				KnownColor kc = (KnownColor) Enum.Parse (typeof (KnownColor), colorName, true);
 				return KnownColors.FromKnownColor (kc);
-			} catch {
-				// This is what it returns!
+			}
+			catch {
+				// This is what it returns! 	 
 				Color d = FromArgb (0, 0, 0, 0);
-				d.name = name;
+				d.name = colorName;
 				d.state |= (short) ColorType.Named;
 				return d;
 			}
 		}
 
+	
 		// -----------------------
 		// Public Shared Members
 		// -----------------------
@@ -207,20 +209,20 @@ namespace System.Drawing
 		///	of the two Colors.
 		/// </remarks>
 
-		public static bool operator == (Color left, Color right)
+		public static bool operator == (Color colorA, Color colorB)
 		{
-			if (left.value != right.value)
+			if (colorA.value != colorB.value)
 				return false;
-			if (left.IsNamedColor != right.IsNamedColor)
+			if (colorA.IsNamedColor != colorB.IsNamedColor)
 				return false;
-			if (left.IsSystemColor != right.IsSystemColor)
+			if (colorA.IsSystemColor != colorB.IsSystemColor)
 				return false;
-			if (left.IsEmpty != right.IsEmpty)
+			if (colorA.IsEmpty != colorB.IsEmpty)
 				return false;
-			if (left.IsNamedColor) {
+			if (colorA.IsNamedColor) {
 				// then both are named (see previous check) and so we need to compare them
 				// but otherwise we don't as it kills performance (Name calls String.Format)
-				if (left.Name != right.Name)
+				if (colorA.Name != colorB.Name)
 					return false;
 			}
 			return true;
@@ -236,9 +238,9 @@ namespace System.Drawing
 		///	of the two colors.
 		/// </remarks>
 
-		public static bool operator != (Color left, Color right)
+		public static bool operator != (Color colorA, Color colorB)
 		{
-			return ! (left == right);
+			return ! (colorA == colorB);
 		}
 		
 		public float GetBrightness ()
@@ -412,11 +414,11 @@ namespace System.Drawing
 		///	Checks equivalence of this Color and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is Color))
+			if (! (o is Color))
 				return false;
-			Color c = (Color) obj;
+			Color c = (Color) o;
 			return this == c;
 		}
 

+ 45 - 49
mcs/class/System.Drawing/System.Drawing/Font.cs

@@ -58,16 +58,17 @@ namespace System.Drawing
 			if (familyName == null)
 				throw new ArgumentNullException ("familyName");
 #endif
-			FontFamily family;
+                        FontFamily family;
 			// NOTE: If family name is null, empty or invalid,
 			// MS creates Microsoft Sans Serif font.
 			try {
 				family = new FontFamily (familyName);
-			} catch (Exception) {
+			}
+			catch (Exception){
 				family = FontFamily.GenericSansSerif;
 			}
 
-			setProperties (family, emSize, style, unit, charSet, isVertical);
+			setProperties (family, emSize, style, unit, charSet, isVertical);           
 			Status status = GDIPlus.GdipCreateFont (family.NativeObject, emSize,  style, unit, out fontObject);
 			
 			if (status == Status.FontStyleNotFound)
@@ -76,7 +77,7 @@ namespace System.Drawing
 			GDIPlus.CheckStatus (status);
 		}
 
-		private Font (SerializationInfo info, StreamingContext context)
+       		private Font (SerializationInfo info, StreamingContext context)
 		{
 			string		name;
 			float		size;
@@ -91,12 +92,12 @@ namespace System.Drawing
 			CreateFont(name, size, style, unit, DefaultCharSet, false);
 		}
 
-		void ISerializable.GetObjectData(SerializationInfo si, StreamingContext context)
+		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 		{
-			si.AddValue ("Name", Name);
-			si.AddValue ("Size", Size);
-			si.AddValue ("Style", Style);
-			si.AddValue ("Unit", Unit);
+			info.AddValue("Name", Name);
+			info.AddValue("Size", Size);
+			info.AddValue("Style", Style);
+			info.AddValue("Unit", Unit);
 		}
 
 		~Font()
@@ -172,7 +173,7 @@ namespace System.Drawing
 		internal void setProperties (FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)
 		{
 			_name = family.Name;
-			_fontFamily = family;
+			_fontFamily = family;			
 			_size = emSize;
 
 			// MS throws ArgumentException, if unit is set to GraphicsUnit.Display
@@ -185,29 +186,29 @@ namespace System.Drawing
 						
 			_bold = _italic = _strikeout = _underline = false;
 
-			if ((style & FontStyle.Bold) == FontStyle.Bold)
-				_bold = true;
-
-			if ((style & FontStyle.Italic) == FontStyle.Italic)
-				_italic = true;
+                        if ((style & FontStyle.Bold) == FontStyle.Bold)
+                                _bold = true;
+				
+                        if ((style & FontStyle.Italic) == FontStyle.Italic)
+                               _italic = true;
 
-			if ((style & FontStyle.Strikeout) == FontStyle.Strikeout)
-				_strikeout = true;
+                        if ((style & FontStyle.Strikeout) == FontStyle.Strikeout)
+                                _strikeout = true;
 
-			if ((style & FontStyle.Underline) == FontStyle.Underline)
-				_underline = true;
+                        if ((style & FontStyle.Underline) == FontStyle.Underline)
+                                _underline = true;                  
 		}
 
-		public static Font FromHfont (IntPtr hfont)
+		public static Font FromHfont (IntPtr Hfont)
 		{
 			IntPtr			newObject;
-			IntPtr			hdc;
+			IntPtr			hdc;			
 			FontStyle		newStyle = FontStyle.Regular;
 			float			newSize;
 			LOGFONT			lf = new LOGFONT ();
 
 			// Sanity. Should we throw an exception?
-			if (hfont == IntPtr.Zero) {
+			if (Hfont == IntPtr.Zero) {
 				Font result = new Font ("Arial", (float)10.0, FontStyle.Regular);
 				return(result);
 			}
@@ -215,7 +216,7 @@ namespace System.Drawing
 			if (GDIPlus.RunningOnUnix ()) {
 				// If we're on Unix we use our private gdiplus API to avoid Wine 
 				// dependencies in S.D
-				Status s = GDIPlus.GdipCreateFontFromHfont (hfont, out newObject, ref lf);
+				Status s = GDIPlus.GdipCreateFontFromHfont (Hfont, out newObject, ref lf);
 				GDIPlus.CheckStatus (s);
 			} else {
 
@@ -228,7 +229,8 @@ namespace System.Drawing
 				hdc = GDIPlus.GetDC (IntPtr.Zero);
 				try {
 					return FromLogFont (lf, hdc);
-				} finally {
+				}
+				finally {
 					GDIPlus.ReleaseDC (IntPtr.Zero, hdc);
 				}
 			}
@@ -277,11 +279,12 @@ namespace System.Drawing
 
 		internal Font (IntPtr newFontObject, string familyName, FontStyle style, float size)
 		{
-			FontFamily fontFamily;
+			FontFamily fontFamily;			
 			
 			try {
 				fontFamily = new FontFamily (familyName);
-			} catch (Exception) {
+			}
+			catch (Exception){
 				fontFamily = FontFamily.GenericSansSerif;
 			}
 			
@@ -289,15 +292,13 @@ namespace System.Drawing
 			fontObject = newFontObject;
 		}
 
-		public Font (Font prototype, FontStyle newStyle)
+		public Font (Font original, FontStyle style)
 		{
 			Status status;
-			setProperties (prototype.FontFamily, prototype.Size, newStyle,
-				prototype.Unit, prototype.GdiCharSet, prototype.GdiVerticalFont);
-
-			status = GDIPlus.GdipCreateFont (_fontFamily.NativeObject,
-				Size, Style, Unit, out fontObject);
-			GDIPlus.CheckStatus (status);
+			setProperties (original.FontFamily, original.Size, style, original.Unit, original.GdiCharSet, original.GdiVerticalFont);
+				
+			status = GDIPlus.GdipCreateFont (_fontFamily.NativeObject,	Size,  Style,   Unit,  out fontObject);
+			GDIPlus.CheckStatus (status);			
 		}
 
 		public Font (FontFamily family, float emSize,  GraphicsUnit unit)
@@ -325,22 +326,20 @@ namespace System.Drawing
 		{
 		}
 
-		public Font (FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet)
-			: this (family, emSize, style, unit, gdiCharSet, false)
+		public Font (FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
+			: this (family, emSize, style, unit, charSet, false)
 		{
 		}
 
 		public Font (FontFamily family, float emSize, FontStyle style,
-				GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
+				GraphicsUnit unit, byte charSet, bool isVertical)
 		{
 			if (family == null)
 				throw new ArgumentNullException ("family");
 
 			Status status;
-			setProperties (family, emSize, style, unit, gdiCharSet,
-				gdiVerticalFont);
-			status = GDIPlus.GdipCreateFont (family.NativeObject,
-				emSize, style, unit, out fontObject);
+			setProperties (family, emSize, style, unit, charSet, isVertical);		
+			status = GDIPlus.GdipCreateFont (family.NativeObject, emSize,  style,   unit,  out fontObject);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -359,18 +358,16 @@ namespace System.Drawing
 		{
 		}
 
-		public Font (string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet)
-			: this (familyName, emSize, style, unit, gdiCharSet, false)
+		public Font (string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
+			: this (familyName, emSize, style, unit, charSet, false)
 		{
 		}
 
 		public Font (string familyName, float emSize, FontStyle style,
-				GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
+				GraphicsUnit unit, byte charSet, bool isVertical)
 		{
-			CreateFont (familyName, emSize, style, unit, gdiCharSet,
-				gdiVerticalFont);
+			CreateFont(familyName, emSize, style, unit, charSet, isVertical);
 		}
-
 #if NET_2_0
 		internal Font (string familyName, float emSize, string systemName)
 			: this (familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, DefaultCharSet, false)
@@ -378,13 +375,12 @@ namespace System.Drawing
 			systemFontName = systemName;
 		}
 #endif
-
 		public object Clone ()
 		{
 			return new Font (this, Style);
 		}
 
-		internal IntPtr NativeObject {
+		internal IntPtr NativeObject {            
 			get {
 				return fontObject;
 			}
@@ -467,7 +463,7 @@ namespace System.Drawing
 		
 		public float Size {
 			get {
-				return _size;
+				return _size;			
 			}
 		}
 

+ 22 - 17
mcs/class/System.Drawing/System.Drawing/FontFamily.cs

@@ -37,17 +37,18 @@ namespace System.Drawing {
 
 	public sealed class FontFamily : MarshalByRefObject, IDisposable 
 	{
+		
 		static private FontFamily genericMonospace;
 		static private FontFamily genericSansSerif;
 		static private FontFamily genericSerif;
 		private string name;
 		private IntPtr nativeFontFamily = IntPtr.Zero;
-
+				
 		internal FontFamily(IntPtr fntfamily)
 		{
-			nativeFontFamily = fntfamily;
+			nativeFontFamily = fntfamily;		
 		}
-
+		
 		internal void refreshName()
 		{
 			StringBuilder sb;
@@ -66,8 +67,10 @@ namespace System.Drawing {
 			Dispose ();
 		}
 
-		internal IntPtr NativeObject {
-			get {
+		internal IntPtr NativeObject
+		{            
+			get	
+			{
 				return nativeFontFamily;
 			}
 		}
@@ -83,21 +86,21 @@ namespace System.Drawing {
 					status = GDIPlus.GdipGetGenericFontFamilySerif (out nativeFontFamily);
 					break;
 				case GenericFontFamilies.Monospace:
-				default:	// Undocumented default
+				default:	// Undocumented default 
 					status = GDIPlus.GdipGetGenericFontFamilyMonospace (out nativeFontFamily);
 					break;
 			}
 			GDIPlus.CheckStatus (status);
 		}
 		
-		public FontFamily(string name) : this (name, null)
-		{
+		public FontFamily(string familyName) : this (familyName, null)
+		{			
 		}
 		
-		public FontFamily (string name, FontCollection fontCollection)
+		public FontFamily (string familyName, FontCollection collection) 
 		{
-			IntPtr handle = (fontCollection == null) ? IntPtr.Zero : fontCollection.nativeFontCollection;
-			Status status = GDIPlus.GdipCreateFontFamilyFromName (name, handle, out nativeFontFamily);
+			IntPtr handle = (collection == null) ? IntPtr.Zero : collection.nativeFontCollection;
+			Status status = GDIPlus.GdipCreateFontFamilyFromName (familyName, handle, out nativeFontFamily);
 			GDIPlus.CheckStatus (status);
 		}
 		
@@ -154,7 +157,7 @@ namespace System.Drawing {
 		{
 			short outProperty;
 			Status status = GDIPlus.GdipGetLineSpacing (nativeFontFamily, (int)style, out outProperty);
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);	
 
 			return (int) outProperty;
 		}
@@ -178,7 +181,7 @@ namespace System.Drawing {
 				// check the status code (throw) at the last step
 				GDIPlus.CheckStatus (status);
 			}
-		}
+		}		
 		
 		public override bool Equals (object obj)
 		{
@@ -191,12 +194,13 @@ namespace System.Drawing {
 		
 		public override int GetHashCode ()
 		{
-			return Name.GetHashCode ();
+			return Name.GetHashCode ();			
 		}
-
+			
+			
 		public static FontFamily[] Families {
 			get { return new InstalledFontCollection ().Families; }
-		}
+		}		
 		
 		public static FontFamily[] GetFamilies (Graphics graphics)
 		{
@@ -204,7 +208,7 @@ namespace System.Drawing {
 				throw new ArgumentNullException ("graphics");
 
 			InstalledFontCollection fntcol = new InstalledFontCollection ();
-			return fntcol.Families;
+			return fntcol.Families;			
 		}
 		
 		[MonoLimitation ("The language parameter is ignored. We always return the name using the default system language.")]
@@ -219,3 +223,4 @@ namespace System.Drawing {
 		}
 	}
 }
+

+ 185 - 179
mcs/class/System.Drawing/System.Drawing/Graphics.cs

@@ -41,7 +41,7 @@ using System.Text;
 namespace System.Drawing
 {
 #if !NET_2_0
-	[ComVisible(false)]
+	[ComVisible(false)]  
 #endif
 	public sealed class Graphics : MarshalByRefObject, IDisposable
 #if NET_2_0
@@ -76,8 +76,8 @@ namespace System.Drawing
 
 		~Graphics ()
 		{
-			Dispose ();
-		}
+			Dispose ();			
+		}		
 
 		static internal float systemDpiX {
 			get {
@@ -124,12 +124,12 @@ namespace System.Drawing
 			uint state;
 			Status status;
 			status = GDIPlus.GdipBeginContainer2 (nativeObject, out state);
-			GDIPlus.CheckStatus (status);
+        		GDIPlus.CheckStatus (status);
 
-			return new GraphicsContainer(state);
+                        return new GraphicsContainer(state);
 		}
 
-		[MonoTODO ("The rectangles and unit parameters aren't supported in libgdiplus")]
+		[MonoTODO ("The rectangles and unit parameters aren't supported in libgdiplus")]		
 		public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
 		{
 			uint state;
@@ -140,7 +140,7 @@ namespace System.Drawing
 			return new GraphicsContainer (state);
 		}
 
-		[MonoTODO ("The rectangles and unit parameters aren't supported in libgdiplus")]
+		[MonoTODO ("The rectangles and unit parameters aren't supported in libgdiplus")]		
 		public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
 		{
 			uint state;
@@ -158,13 +158,12 @@ namespace System.Drawing
  			status = GDIPlus.GdipGraphicsClear (nativeObject, color.ToArgb ());
  			GDIPlus.CheckStatus (status);
 		}
-
-#if NET_2_0
+#if NET_2_0		
 		[MonoLimitation ("Works on Win32 and on X11 (but not on Cocoa and Quartz)")]
 		public void CopyFromScreen (Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize)
 		{
 			CopyFromScreen (upperLeftSource.X, upperLeftSource.Y, upperLeftDestination.X, upperLeftDestination.Y,
-				blockRegionSize, CopyPixelOperation.SourceCopy);
+				blockRegionSize, CopyPixelOperation.SourceCopy);				
 		}
 
 		[MonoLimitation ("Works on Win32 and (for CopyPixelOperation.SourceCopy only) on X11 but not on Cocoa and Quartz")]
@@ -205,7 +204,7 @@ namespace System.Drawing
 				blockRegionSize.Height, srcDC, sourceX, sourceY, (int) copyPixelOperation);
 
 			GDIPlus.ReleaseDC (IntPtr.Zero, srcDC);
-			ReleaseHdc (dstDC);
+			ReleaseHdc (dstDC);			
 		}
 		
 		private void CopyFromScreenMac (int sourceX, int sourceY, int destinationX, int destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
@@ -222,11 +221,11 @@ namespace System.Drawing
 				throw new NotImplementedException ("Operation not implemented under X11");
 		
 			if (GDIPlus.Display == IntPtr.Zero) {
-				GDIPlus.Display = GDIPlus.XOpenDisplay (IntPtr.Zero);
+				GDIPlus.Display = GDIPlus.XOpenDisplay (IntPtr.Zero);					
 			}
 
 			window = GDIPlus.XRootWindow (GDIPlus.Display, 0);
-			defvisual = GDIPlus.XDefaultVisual (GDIPlus.Display, 0);
+			defvisual = GDIPlus.XDefaultVisual (GDIPlus.Display, 0);				
 			XVisualInfo visual = new XVisualInfo ();
 
 			/* Get XVisualInfo for this visual */
@@ -261,7 +260,7 @@ namespace System.Drawing
 							throw new NotImplementedException (text);
 					}
 						
-					bmp.SetPixel (x, y, Color.FromArgb (255, red, green, blue));
+					bmp.SetPixel (x, y, Color.FromArgb (255, red, green, blue));							 
 				}
 			}
 
@@ -284,22 +283,25 @@ namespace System.Drawing
 				status = GDIPlus.GdipDeleteGraphics (nativeObject);
 				nativeObject = IntPtr.Zero;
 				GDIPlus.CheckStatus (status);
-				disposed = true;
+				disposed = true;				
 			}
 
 			GC.SuppressFinalize(this);
 		}
 
+		
 		public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
 		{
 			DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
 		}
 
+		
 		public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
 		{
 			DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
 		}
 
+		
 		public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
 		{
 			Status status;
@@ -307,14 +309,14 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			
 			status = GDIPlus.GdipDrawArc (nativeObject, pen.nativeObject,
-				x, y, width, height, startAngle, sweepAngle);
+                                        x, y, width, height, startAngle, sweepAngle);
 			GDIPlus.CheckStatus (status);
 		}
 
 		// Microsoft documentation states that the signature for this member should be
 		// public void DrawArc( Pen pen,  int x,  int y,  int width,  int height,   int startAngle,
-		// int sweepAngle. However, GdipDrawArcI uses also float for the startAngle and sweepAngle params
-		public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
+   		// int sweepAngle. However, GdipDrawArcI uses also float for the startAngle and sweepAngle params
+   		public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
 		{
 			Status status;
 			if (pen == null)
@@ -363,24 +365,24 @@ namespace System.Drawing
 			if (points == null)
 				throw new ArgumentNullException ("points");
 			
-			int length = points.Length;
+                        int length = points.Length;
 			Status status;
 
-			if (length < 4)
-				return;
+                        if (length < 4)
+                                return;
 
 			for (int i = 0; i < length - 1; i += 3) {
-				Point p1 = points [i];
-				Point p2 = points [i + 1];
-				Point p3 = points [i + 2];
-				Point p4 = points [i + 3];
+                                Point p1 = points [i];
+                                Point p2 = points [i + 1];
+                                Point p3 = points [i + 2];
+                                Point p4 = points [i + 3];
 
-				status = GDIPlus.GdipDrawBezier (nativeObject, 
+                                status = GDIPlus.GdipDrawBezier (nativeObject, 
 							pen.nativeObject,
-							p1.X, p1.Y, p2.X, p2.Y, 
-							p3.X, p3.Y, p4.X, p4.Y);
+                                                        p1.X, p1.Y, p2.X, p2.Y, 
+                                                        p3.X, p3.Y, p4.X, p4.Y);
 				GDIPlus.CheckStatus (status);
-			}
+                        }
 		}
 
 		public void DrawBeziers (Pen pen, PointF [] points)
@@ -393,21 +395,21 @@ namespace System.Drawing
 			int length = points.Length;
 			Status status;
 
-			if (length < 4)
-				return;
+                        if (length < 4)
+                                return;
 
 			for (int i = 0; i < length - 1; i += 3) {
-				PointF p1 = points [i];
-				PointF p2 = points [i + 1];
-				PointF p3 = points [i + 2];
-				PointF p4 = points [i + 3];
+                                PointF p1 = points [i];
+                                PointF p2 = points [i + 1];
+                                PointF p3 = points [i + 2];
+                                PointF p4 = points [i + 3];
 
-				status = GDIPlus.GdipDrawBezier (nativeObject, 
+                                status = GDIPlus.GdipDrawBezier (nativeObject, 
 							pen.nativeObject,
-							p1.X, p1.Y, p2.X, p2.Y, 
-							p3.X, p3.Y, p4.X, p4.Y);
+                                                        p1.X, p1.Y, p2.X, p2.Y, 
+                                                        p3.X, p3.Y, p4.X, p4.Y);
 				GDIPlus.CheckStatus (status);
-			}
+                        }
 		}
 
 		
@@ -481,7 +483,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length);
 			GDIPlus.CheckStatus (status);
@@ -493,7 +495,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
 			GDIPlus.CheckStatus (status);
@@ -505,7 +507,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);		
 			GDIPlus.CheckStatus (status);
@@ -517,7 +519,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
 							points, points.Length, offset,
@@ -531,7 +533,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject,
 							points, points.Length, offset,
@@ -545,7 +547,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pen");
 			if (points == null)
 				throw new ArgumentNullException ("points");
-
+			
 			Status status;
 			status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
 							points, points.Length, offset,
@@ -557,7 +559,7 @@ namespace System.Drawing
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
-
+			
 			DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
 		}
 
@@ -613,7 +615,7 @@ namespace System.Drawing
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
-
+			
 			Status status = GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, rect.X, rect.Y, rect.Width, rect.Height);
 			GDIPlus.CheckStatus (status);
 		}
@@ -622,7 +624,7 @@ namespace System.Drawing
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
-
+			
 			Status status = GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, point.X, point.Y);
 			GDIPlus.CheckStatus (status);
 		}
@@ -633,7 +635,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("image");
 			if (destPoints == null)
 				throw new ArgumentNullException ("destPoints");
-
+			
 			Status status = GDIPlus.GdipDrawImagePointsI (nativeObject, image.NativeObject, destPoints, destPoints.Length);
 			GDIPlus.CheckStatus (status);
 		}
@@ -690,7 +692,7 @@ namespace System.Drawing
 		}
 		
 		public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
-		{
+		{			
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
@@ -746,8 +748,8 @@ namespace System.Drawing
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
-			Status status = GDIPlus.GdipDrawImageRect(nativeObject,
-				image.NativeObject, x, y, width, height);
+			Status status = GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, x, y,
+                           width, height);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -766,7 +768,7 @@ namespace System.Drawing
 		}
 
 		public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
-		{
+		{			
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImagePointRectI(nativeObject, image.NativeObject, x, y, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
@@ -782,7 +784,7 @@ namespace System.Drawing
 		}
 
 		public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
-		{
+		{			
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImagePointRect (nativeObject, image.nativeObject, x, y, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
@@ -835,10 +837,10 @@ namespace System.Drawing
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
-				destRect.X, destRect.Y, destRect.Width, destRect.Height,
-				srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
-				null, IntPtr.Zero);
-			GDIPlus.CheckStatus (status); 
+                                destRect.X, destRect.Y, destRect.Width, destRect.Height,
+                       		srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
+                       		null, IntPtr.Zero);
+			GDIPlus.CheckStatus (status); 					
 		}
 		
 		public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
@@ -855,9 +857,9 @@ namespace System.Drawing
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
-				destRect.X, destRect.Y, destRect.Width, destRect.Height,
-				srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
-				null, IntPtr.Zero);
+                                destRect.X, destRect.Y, destRect.Width, destRect.Height,
+                       		srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
+                       		null, IntPtr.Zero);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -866,18 +868,18 @@ namespace System.Drawing
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
-				destRect.X, destRect.Y, destRect.Width, destRect.Height,
-				srcX, srcY, srcWidth, srcHeight, srcUnit,
+                                destRect.X, destRect.Y, destRect.Width, destRect.Height,
+                       		srcX, srcY, srcWidth, srcHeight, srcUnit,
 				imageAttrs != null ? imageAttrs.NativeObject : IntPtr.Zero, null, IntPtr.Zero);
 			GDIPlus.CheckStatus (status);
 		}
 		
 		public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
-		{
+		{			
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject, 
-					destRect.X, destRect.Y, destRect.Width, 
+                                        destRect.X, destRect.Y, destRect.Width, 
 					destRect.Height, srcX, srcY, srcWidth, srcHeight,
 					srcUnit, imageAttr != null ? imageAttr.NativeObject : IntPtr.Zero, null, IntPtr.Zero);
 			GDIPlus.CheckStatus (status);
@@ -888,46 +890,46 @@ namespace System.Drawing
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject, 
-					destRect.X, destRect.Y, destRect.Width, 
+                                        destRect.X, destRect.Y, destRect.Width, 
 					destRect.Height, srcX, srcY, srcWidth, srcHeight,
 					srcUnit, imageAttr != null ? imageAttr.NativeObject : IntPtr.Zero, callback,
 					IntPtr.Zero);
 			GDIPlus.CheckStatus (status);
 		}
 		
-		public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback)
+		public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
-					destRect.X, destRect.Y, destRect.Width, 
+                                        destRect.X, destRect.Y, destRect.Width, 
 					destRect.Height, srcX, srcY, srcWidth, srcHeight,
-					srcUnit, imageAttrs != null ? imageAttrs.NativeObject : IntPtr.Zero, 
+					srcUnit, imageAttr != null ? imageAttr.NativeObject : IntPtr.Zero, 
 					callback, IntPtr.Zero);
 			GDIPlus.CheckStatus (status);
 		}
 
-		public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
+		public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
 			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
 				destRect.X, destRect.Y, destRect.Width, destRect.Height,
 				srcX, srcY, srcWidth, srcHeight, srcUnit, 
-				imageAttrs != null ? imageAttrs.NativeObject : IntPtr.Zero, callback, callbackData);
+				imageAttr != null ? imageAttr.NativeObject : IntPtr.Zero, callback, callbackData);
 			GDIPlus.CheckStatus (status);
 		}
 
-		public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
+		public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
 		{
 			if (image == null)
 				throw new ArgumentNullException ("image");
-			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
-				destRect.X, destRect.Y, destRect.Width, destRect.Height,
+			Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
+                       		destRect.X, destRect.Y, destRect.Width, destRect.Height,
 				srcX, srcY, srcWidth, srcHeight, srcUnit,
-				imageAttrs != null ? imageAttrs.NativeObject : IntPtr.Zero, callback, callbackData);
+				imageAttr != null ? imageAttr.NativeObject : IntPtr.Zero, callback, callbackData);
 			GDIPlus.CheckStatus (status);
-		}
+		}		
 		
 		public void DrawImageUnscaled (Image image, Point point)
 		{
@@ -972,7 +974,7 @@ namespace System.Drawing
 			int width = (image.Width > rect.Width) ? rect.Width : image.Width;
 			int height = (image.Height > rect.Height) ? rect.Height : image.Height;
 
-			DrawImageUnscaled (image, rect.X, rect.Y, width, height);
+			DrawImageUnscaled (image, rect.X, rect.Y, width, height);			
 		}
 #endif
 
@@ -980,8 +982,8 @@ namespace System.Drawing
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
-			Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject,
-				pt1.X, pt1.Y, pt2.X, pt2.Y);
+                        Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject,
+		                                pt1.X, pt1.Y, pt2.X, pt2.Y);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -989,8 +991,8 @@ namespace System.Drawing
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
-			Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject,
-				pt1.X, pt1.Y, pt2.X, pt2.Y);
+                        Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject,
+		                                pt1.X, pt1.Y, pt2.X, pt2.Y);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -1064,8 +1066,8 @@ namespace System.Drawing
 		
 		// Microsoft documentation states that the signature for this member should be
 		// public void DrawPie(Pen pen, int x,  int y,  int width,   int height,   int startAngle
-		// int sweepAngle. However, GdipDrawPieI uses also float for the startAngle and sweepAngle params
-		public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
+   		// int sweepAngle. However, GdipDrawPieI uses also float for the startAngle and sweepAngle params
+   		public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
 		{
 			if (pen == null)
 				throw new ArgumentNullException ("pen");
@@ -1494,7 +1496,7 @@ namespace System.Drawing
 		{
 			if (brush == null)
 				throw new ArgumentNullException ("brush");
-			Status status = GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
+                        Status status = GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
 			GDIPlus.CheckStatus (status);
 		}
 
@@ -1584,14 +1586,14 @@ namespace System.Drawing
 		{
 			if (brush == null)
 				throw new ArgumentNullException ("brush");
-			FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
+                        FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
 		}
 
 		public void FillRectangle (Brush brush, Rectangle rect)
 		{
 			if (brush == null)
 				throw new ArgumentNullException ("brush");
-			FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
+                        FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
 		}
 
 		public void FillRectangle (Brush brush, int x, int y, int width, int height)
@@ -1643,7 +1645,7 @@ namespace System.Drawing
 				throw new ArgumentNullException ("region");
 			
 			Status status = GDIPlus.GdipFillRegion (nativeObject, brush.NativeObject, region.NativeObject);                  
-			GDIPlus.CheckStatus(status);
+                        GDIPlus.CheckStatus(status);
 		}
 
 		
@@ -1660,12 +1662,12 @@ namespace System.Drawing
 			}
 
 			Status status = GDIPlus.GdipFlush (nativeObject, intention);
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);                    
 			if (GDIPlus.UseCarbonDrawable && context.ctx != IntPtr.Zero)
 				Carbon.CGContextSynchronize (context.ctx);
 		}
 
-		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		[EditorBrowsable (EditorBrowsableState.Advanced)]		
 		public static Graphics FromHdc (IntPtr hdc)
 		{
 			IntPtr graphics;
@@ -1689,7 +1691,7 @@ namespace System.Drawing
 			return null;
 		}
 
-		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		[EditorBrowsable (EditorBrowsableState.Advanced)]		
 		public static Graphics FromHwnd (IntPtr hwnd)
 		{
 			IntPtr graphics;
@@ -1743,12 +1745,12 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
 			GDIPlus.CheckStatus (status);
 			Graphics result = new Graphics (graphics);
-
+				
 			if (GDIPlus.RunningOnUnix ()) {
 				Rectangle rect  = new Rectangle (0,0, image.Width, image.Height);
 				GDIPlus.GdipSetVisibleClip_linux (result.NativeObject, ref rect);
 			}
-
+				
 			return result;
 		}
 
@@ -1802,7 +1804,7 @@ namespace System.Drawing
 		}
 
 		public void IntersectClip (Rectangle rect)
-		{
+		{			
 			Status status = GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
 			GDIPlus.CheckStatus (status);
 		}
@@ -1814,7 +1816,7 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipIsVisiblePointI (nativeObject, point.X, point.Y, out isVisible);
 			GDIPlus.CheckStatus (status);
 
-			return isVisible;
+                        return isVisible;
 		}
 
 		
@@ -1825,7 +1827,7 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipIsVisibleRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
 			GDIPlus.CheckStatus (status);
 
-			return isVisible;
+                        return isVisible;
 		}
 
 		public bool IsVisible (PointF point)
@@ -1835,7 +1837,7 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipIsVisiblePoint (nativeObject, point.X, point.Y, out isVisible);
 			GDIPlus.CheckStatus (status);
 
-			return isVisible;
+                        return isVisible;
 		}
 		
 		public bool IsVisible (Rectangle rect)
@@ -1845,7 +1847,7 @@ namespace System.Drawing
 			Status status = GDIPlus.GdipIsVisibleRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
 			GDIPlus.CheckStatus (status);
 
-			return isVisible;
+                        return isVisible;
 		}
 		
 		public bool IsVisible (float x, float y)
@@ -1895,9 +1897,9 @@ namespace System.Drawing
 			
 			Status status = GDIPlus.GdipMeasureCharacterRanges (nativeObject, text, text.Length,
 				font.NativeObject, ref layoutRect, stringFormat.NativeObject, regcount, out native_regions[0]); 
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);				
 
-			return regions;
+			return regions;							
 		}
 
 		private unsafe SizeF GdipMeasureString (IntPtr graphics, string text, Font font, ref RectangleF layoutRect,
@@ -1930,7 +1932,7 @@ namespace System.Drawing
 		}
 
 		public SizeF MeasureString (string text, Font font, int width)
-		{
+		{				
 			RectangleF rect = new RectangleF (0, 0, width, Int32.MaxValue);
 			return GdipMeasureString (nativeObject, text, font, ref rect, IntPtr.Zero);
 		}
@@ -1958,7 +1960,7 @@ namespace System.Drawing
 
 		public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, 
 			out int charactersFitted, out int linesFilled)
-		{
+		{	
 			charactersFitted = 0;
 			linesFilled = 0;
 
@@ -2042,7 +2044,7 @@ namespace System.Drawing
 		}
 
 		public void Restore (GraphicsState gstate)
-		{
+		{			
 			// the possible NRE thrown by gstate.nativeState match MS behaviour
 			Status status = GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState);
 			GDIPlus.CheckStatus (status);
@@ -2060,7 +2062,7 @@ namespace System.Drawing
 		}
 
 		public GraphicsState Save ()
-		{
+		{						
 			uint saveState;
 			Status status = GDIPlus.GdipSaveGraphics (nativeObject, out saveState);
 			GDIPlus.CheckStatus (status);
@@ -2077,14 +2079,14 @@ namespace System.Drawing
 
 		public void ScaleTransform (float sx, float sy, MatrixOrder order)
 		{
-			Status status = GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
+                        Status status = GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
 			GDIPlus.CheckStatus (status);
 		}
 
 		
 		public void SetClip (RectangleF rect)
 		{
-			SetClip (rect, CombineMode.Replace);
+                        SetClip (rect, CombineMode.Replace);
 		}
 
 		
@@ -2110,7 +2112,7 @@ namespace System.Drawing
 		{
 			if (g == null)
 				throw new ArgumentNullException ("g");
-
+			
 			Status status = GDIPlus.GdipSetClipGraphics (nativeObject, g.NativeObject, combineMode);
 			GDIPlus.CheckStatus (status);
 		}
@@ -2154,8 +2156,8 @@ namespace System.Drawing
 				throw new ArgumentNullException ("pts");
 
 			IntPtr ptrPt =  GDIPlus.FromPointToUnManagedMemory (pts);
-
-			Status status = GDIPlus.GdipTransformPoints (nativeObject, destSpace, srcSpace,  ptrPt, pts.Length);
+            
+                        Status status = GDIPlus.GdipTransformPoints (nativeObject, destSpace, srcSpace,  ptrPt, pts.Length);
 			GDIPlus.CheckStatus (status);
 			
 			GDIPlus.FromUnManagedMemoryToPoint (ptrPt, pts);
@@ -2163,12 +2165,12 @@ namespace System.Drawing
 
 
 		public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
-		{
+		{						
 			if (pts == null)
 				throw new ArgumentNullException ("pts");
-			IntPtr ptrPt =  GDIPlus.FromPointToUnManagedMemoryI (pts);
-
-			Status status = GDIPlus.GdipTransformPointsI (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
+                        IntPtr ptrPt =  GDIPlus.FromPointToUnManagedMemoryI (pts);
+            
+                        Status status = GDIPlus.GdipTransformPointsI (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
 			GDIPlus.CheckStatus (status);
 			
 			GDIPlus.FromUnManagedMemoryToPointI (ptrPt, pts);
@@ -2195,7 +2197,7 @@ namespace System.Drawing
 
 		
 		public void TranslateTransform (float dx, float dy, MatrixOrder order)
-		{
+		{			
 			Status status = GDIPlus.GdipTranslateWorldTransform (nativeObject, dx, dy, order);
 			GDIPlus.CheckStatus (status);
 		}
@@ -2205,7 +2207,7 @@ namespace System.Drawing
 				Region reg = new Region();
 				Status status = GDIPlus.GdipGetClip (nativeObject, reg.NativeObject);
 				GDIPlus.CheckStatus (status);
-				return reg;
+				return reg;				
 			}
 			set {
 				SetClip (value, CombineMode.Replace);
@@ -2214,8 +2216,8 @@ namespace System.Drawing
 
 		public RectangleF ClipBounds {
 			get {
-				RectangleF rect = new RectangleF ();
-				Status status = GDIPlus.GdipGetClipBounds (nativeObject, out rect);
+                                RectangleF rect = new RectangleF ();
+                                Status status = GDIPlus.GdipGetClipBounds (nativeObject, out rect);
 				GDIPlus.CheckStatus (status);
 				return rect;
 			}
@@ -2223,14 +2225,14 @@ namespace System.Drawing
 
 		public CompositingMode CompositingMode {
 			get {
-				CompositingMode mode;
-				Status status = GDIPlus.GdipGetCompositingMode (nativeObject, out mode);
+                                CompositingMode mode;
+                                Status status = GDIPlus.GdipGetCompositingMode (nativeObject, out mode);
 				GDIPlus.CheckStatus (status);
 
 				return mode;
 			}
 			set {
-				Status status = GDIPlus.GdipSetCompositingMode (nativeObject, value);
+                                Status status = GDIPlus.GdipSetCompositingMode (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 
@@ -2238,95 +2240,95 @@ namespace System.Drawing
 
 		public CompositingQuality CompositingQuality {
 			get {
-				CompositingQuality quality;
+                                CompositingQuality quality;
 
-				Status status = GDIPlus.GdipGetCompositingQuality (nativeObject, out quality);
+                                Status status = GDIPlus.GdipGetCompositingQuality (nativeObject, out quality);
 				GDIPlus.CheckStatus (status);
-				return quality;
+        			return quality;
 			}
 			set {
-				Status status = GDIPlus.GdipSetCompositingQuality (nativeObject, value);
+                                Status status = GDIPlus.GdipSetCompositingQuality (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public float DpiX {
 			get {
-				float x;
+                                float x;
 
-				Status status = GDIPlus.GdipGetDpiX (nativeObject, out x);
+       				Status status = GDIPlus.GdipGetDpiX (nativeObject, out x);
 				GDIPlus.CheckStatus (status);
-				return x;
+        			return x;
 			}
 		}
 
 		public float DpiY {
 			get {
-				float y;
+                                float y;
 
-				Status status = GDIPlus.GdipGetDpiY (nativeObject, out y);
+       				Status status = GDIPlus.GdipGetDpiY (nativeObject, out y);
 				GDIPlus.CheckStatus (status);
-				return y;
+        			return y;
 			}
 		}
 
 		public InterpolationMode InterpolationMode {
-			get {
-				InterpolationMode imode = InterpolationMode.Invalid;
-				Status status = GDIPlus.GdipGetInterpolationMode (nativeObject, out imode);
+			get {				
+                                InterpolationMode imode = InterpolationMode.Invalid;
+        			Status status = GDIPlus.GdipGetInterpolationMode (nativeObject, out imode);
 				GDIPlus.CheckStatus (status);
-				return imode;
+        			return imode;
 			}
 			set {
-				Status status = GDIPlus.GdipSetInterpolationMode (nativeObject, value);
+                                Status status = GDIPlus.GdipSetInterpolationMode (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public bool IsClipEmpty {
 			get {
-				bool isEmpty = false;
+                                bool isEmpty = false;
 
-				Status status = GDIPlus.GdipIsClipEmpty (nativeObject, out isEmpty);
+        			Status status = GDIPlus.GdipIsClipEmpty (nativeObject, out isEmpty);
 				GDIPlus.CheckStatus (status);
-				return isEmpty;
+        			return isEmpty;
 			}
 		}
 
 		public bool IsVisibleClipEmpty {
 			get {
-				bool isEmpty = false;
+                                bool isEmpty = false;
 
-				Status status = GDIPlus.GdipIsVisibleClipEmpty (nativeObject, out isEmpty);
+        			Status status = GDIPlus.GdipIsVisibleClipEmpty (nativeObject, out isEmpty);
 				GDIPlus.CheckStatus (status);
-				return isEmpty;
+        			return isEmpty;
 			}
 		}
 
 		public float PageScale {
 			get {
-				float scale;
+                                float scale;
 
-				Status status = GDIPlus.GdipGetPageScale (nativeObject, out scale);
+        			Status status = GDIPlus.GdipGetPageScale (nativeObject, out scale);
 				GDIPlus.CheckStatus (status);
-				return scale;
+        			return scale;
 			}
 			set {
-				Status status = GDIPlus.GdipSetPageScale (nativeObject, value);
+                                Status status = GDIPlus.GdipSetPageScale (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public GraphicsUnit PageUnit {
 			get {
-				GraphicsUnit unit;
-
-				Status status = GDIPlus.GdipGetPageUnit (nativeObject, out unit);
+                                GraphicsUnit unit;
+                                
+                                Status status = GDIPlus.GdipGetPageUnit (nativeObject, out unit);
 				GDIPlus.CheckStatus (status);
-				return unit;
+        			return unit;
 			}
 			set {
-				Status status = GDIPlus.GdipSetPageUnit (nativeObject, value);
+                                Status status = GDIPlus.GdipSetPageUnit (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
@@ -2334,97 +2336,101 @@ namespace System.Drawing
 		[MonoTODO ("This property does not do anything when used with libgdiplus.")]
 		public PixelOffsetMode PixelOffsetMode {
 			get {
-				PixelOffsetMode pixelOffset = PixelOffsetMode.Invalid;
-
-				Status status = GDIPlus.GdipGetPixelOffsetMode (nativeObject, out pixelOffset);
+			        PixelOffsetMode pixelOffset = PixelOffsetMode.Invalid;
+                                
+                                Status status = GDIPlus.GdipGetPixelOffsetMode (nativeObject, out pixelOffset);
 				GDIPlus.CheckStatus (status);
-				return pixelOffset;
+        			return pixelOffset;
 			}
 			set {
-				Status status = GDIPlus.GdipSetPixelOffsetMode (nativeObject, value); 
+                                Status status = GDIPlus.GdipSetPixelOffsetMode (nativeObject, value); 
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public Point RenderingOrigin {
 			get {
-				int x, y;
+                                int x, y;
 				Status status = GDIPlus.GdipGetRenderingOrigin (nativeObject, out x, out y);
 				GDIPlus.CheckStatus (status);
-				return new Point (x, y);
+                                return new Point (x, y);
 			}
+
 			set {
-				Status status = GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
+                                Status status = GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public SmoothingMode SmoothingMode {
 			get {
-				SmoothingMode mode = SmoothingMode.Invalid;
+                                SmoothingMode mode = SmoothingMode.Invalid;
 
 				Status status = GDIPlus.GdipGetSmoothingMode (nativeObject, out mode);
 				GDIPlus.CheckStatus (status);
-				return mode;
+                                return mode;
 			}
+
 			set {
-				Status status = GDIPlus.GdipSetSmoothingMode (nativeObject, value);
+                                Status status = GDIPlus.GdipSetSmoothingMode (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		[MonoTODO ("This property does not do anything when used with libgdiplus.")]
 		public int TextContrast {
-			get {
-				int contrast;
-
-				Status status = GDIPlus.GdipGetTextContrast (nativeObject, out contrast);
+			get {	
+                                int contrast;
+					
+                                Status status = GDIPlus.GdipGetTextContrast (nativeObject, out contrast);
 				GDIPlus.CheckStatus (status);
-				return contrast;
+                                return contrast;
 			}
-			set {
-				Status status = GDIPlus.GdipSetTextContrast (nativeObject, value);
+
+                        set {
+                                Status status = GDIPlus.GdipSetTextContrast (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public TextRenderingHint TextRenderingHint {
 			get {
-				TextRenderingHint hint;
+                                TextRenderingHint hint;
 
-				Status status = GDIPlus.GdipGetTextRenderingHint (nativeObject, out hint);
+                                Status status = GDIPlus.GdipGetTextRenderingHint (nativeObject, out hint);
 				GDIPlus.CheckStatus (status);
-				return hint;
+                                return hint;        
 			}
+
 			set {
-				Status status = GDIPlus.GdipSetTextRenderingHint (nativeObject, value);
+                                Status status = GDIPlus.GdipSetTextRenderingHint (nativeObject, value);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public Matrix Transform {
 			get {
-				Matrix matrix = new Matrix ();
-				Status status = GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
+                                Matrix matrix = new Matrix ();
+                                Status status = GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
 				GDIPlus.CheckStatus (status);
-				return matrix;
+                                return matrix;
 			}
 			set {
 				if (value == null)
 					throw new ArgumentNullException ("value");
 				
-				Status status = GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
+                                Status status = GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
 				GDIPlus.CheckStatus (status);
 			}
 		}
 
 		public RectangleF VisibleClipBounds {
 			get {
-				RectangleF rect;
-
-				Status status = GDIPlus.GdipGetVisibleClipBounds (nativeObject, out rect);
+                                RectangleF rect;
+					
+                                Status status = GDIPlus.GdipGetVisibleClipBounds (nativeObject, out rect);
 				GDIPlus.CheckStatus (status);
-				return rect;
+                                return rect;
 			}
 		}
 

+ 11 - 11
mcs/class/System.Drawing/System.Drawing/Icon.cs

@@ -41,9 +41,9 @@ using System.Security.Permissions;
 namespace System.Drawing
 {
 #if !NET_2_0
-	[ComVisible (false)]
+	[ComVisible (false)] 
 #endif 
-	[Serializable]
+	[Serializable]	
 	[Editor ("System.Drawing.Design.IconEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
 	[TypeConverter(typeof(IconConverter))]
 	public sealed class Icon : MarshalByRefObject, ISerializable, ICloneable, IDisposable
@@ -89,7 +89,7 @@ namespace System.Drawing
 			internal uint []		iconColors;	//colors table
 			internal byte []		iconXOR;	// bits for XOR mask
 			internal byte []		iconAND;	//bits for AND mask
-		};
+		};	
 
 		private Size iconSize;
 		private IntPtr handle = IntPtr.Zero;
@@ -227,7 +227,7 @@ namespace System.Drawing
 				dataStream.Seek (0, SeekOrigin.Begin);
 				InitFromStreamWithSize (dataStream, width, height);
 			}
-		}
+                }
 
 		internal Icon (string resourceName, bool undisposable)
 		{
@@ -241,12 +241,12 @@ namespace System.Drawing
 			this.undisposable = true;
 		}
 
-		void ISerializable.GetObjectData(SerializationInfo si, StreamingContext context)
+		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 		{
 			MemoryStream ms = new MemoryStream ();
 			Save (ms);
-			si.AddValue ("IconSize", this.Size, typeof (Size));
-			si.AddValue ("IconData", ms.ToArray ());
+			info.AddValue ("IconSize", this.Size, typeof (Size));
+			info.AddValue ("IconData", ms.ToArray ());
 		}
 
 #if NET_2_0
@@ -278,7 +278,7 @@ namespace System.Drawing
 				throw new FileNotFoundException (Locale.GetText ("Couldn't find specified file."), filePath);
 
 			return SystemIcons.WinLogo;
-		}
+		}	
 #endif
 
 		public void Dispose ()
@@ -583,7 +583,7 @@ namespace System.Drawing
 		public override string ToString ()
 		{
 			//is this correct, this is what returned by .Net
-			return "<Icon>";
+			return "<Icon>";			
 		}
 
 		[Browsable (false)]
@@ -630,7 +630,7 @@ namespace System.Drawing
 		{
 			Dispose ();
 		}
-
+			
 		private void InitFromStreamWithSize (Stream stream, int width, int height)
 		{
 			//read the icon header
@@ -794,7 +794,7 @@ Console.WriteLine ("\tbih.biClrImportant: {0}", bih.biClrImportant);
 				
 				imageData [j] = iidata;
 				bihReader.Close();
-			}
+			}			
 
 			reader.Close();
 		}

+ 21 - 19
mcs/class/System.Drawing/System.Drawing/IconConverter.cs

@@ -37,54 +37,56 @@ using System.ComponentModel;
 using System.Globalization;
 using System.IO;
 
-namespace System.Drawing
-{
+namespace System.Drawing {
+	/// <summary>
+	/// Summary description for IconConverter.
+	/// </summary>
 	public class IconConverter : ExpandableObjectConverter
 	{
 		public IconConverter()
 		{
 		}
 
-		public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+		public override bool CanConvertFrom (ITypeDescriptorContext context, Type srcType)
 		{
-			if (sourceType == typeof (Byte []))
+			if (srcType == typeof (System.Byte[]))
 				return true;
 			else
 				return false;
 		}
 
-		public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+		public override bool CanConvertTo (ITypeDescriptorContext context, Type destType)
 		{
-			if ((destinationType == typeof (Byte [])) || (destinationType == typeof (String)))
+			if ((destType == typeof (System.Byte[])) || (destType == typeof (System.String)))
 				return true;
 			else
 				return false;
 		}
 		
-		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object val)
 		{
-			byte [] bytes = value as byte [];
+			byte [] bytes = val as byte [];
 			if (bytes == null)
-				return base.ConvertFrom (context, culture, value);
-
+				return base.ConvertFrom (context, culture, val);
+			
 			MemoryStream ms = new MemoryStream (bytes);
-
-			return new Icon (ms);
+			
+			return new Icon (ms);				
 		}
 
-		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object val, Type destType )
 		{
-			if ((value is Icon) && (destinationType == typeof (string)))
-				return value.ToString ();
-			else if (value == null && destinationType == typeof (string))
+			if ((val is Icon) && (destType == typeof (string)))
+				return val.ToString ();
+			else if (val == null && destType == typeof (string))
 				return "(none)";
-			else if (CanConvertTo (null, destinationType)) {
+			else if (CanConvertTo (null, destType)) {
 				//came here means destType is byte array ;
 				MemoryStream ms = new MemoryStream ();
-				((Icon) value).Save (ms);
+				((Icon)val).Save (ms);
 				return ms.GetBuffer ();
 			}else
-				return new NotSupportedException ("IconConverter can not convert from " + value.GetType ());
+				return new NotSupportedException ("IconConverter can not convert from " + val.GetType ());				
 		}
 	}
 }

+ 86 - 80
mcs/class/System.Drawing/System.Drawing/Image.cs

@@ -47,7 +47,7 @@ namespace System.Drawing
 [Editor ("System.Drawing.Design.ImageEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
 [TypeConverter (typeof(ImageConverter))]
 [ImmutableObject (true)]
-public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISerializable
+public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISerializable 
 {
 	public delegate bool GetThumbnailImageAbort();
 	private object tag;
@@ -60,7 +60,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	
 	// constructor
 	internal  Image()
-	{
+	{	
 	}
 	
 	internal Image (SerializationInfo info, StreamingContext context)
@@ -81,7 +81,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	}
 
 	// FIXME - find out how metafiles (another decoder-only codec) are handled
-	void ISerializable.GetObjectData (SerializationInfo si, StreamingContext context)
+	void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
 	{
 		using (MemoryStream ms = new MemoryStream ()) {
 			// Icon is a decoder-only codec
@@ -90,17 +90,17 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			} else {
 				Save (ms, RawFormat);
 			}
-			si.AddValue ("Data", ms.ToArray ());
+			info.AddValue ("Data", ms.ToArray ());
 		}
 	}
-
+    
 	// public methods
 	// static
 	public static Image FromFile(string filename)
 	{
 		return FromFile (filename, false);
 	}
-
+	
 	public static Image FromFile(string filename, bool useEmbeddedColorManagement)
 	{
 		IntPtr imagePtr;
@@ -124,7 +124,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	}
 
 	public static Bitmap FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
-	{
+	{		
 		IntPtr imagePtr;
 		Status st;
 
@@ -141,15 +141,15 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		return LoadFromStream (stream, false);
 	}
 
-	[MonoLimitation ("useEmbeddedColorManagement isn't supported.")]
-	public static Image FromStream (Stream stream, bool useEmbeddedColorManagement)
+	[MonoLimitation ("useECM isn't supported.")]	
+	public static Image FromStream (Stream stream, bool useECM)
 	{
 		return LoadFromStream (stream, false);
 	}
 
 	// See http://support.microsoft.com/default.aspx?scid=kb;en-us;831419 for performance discussion	
-	[MonoLimitation ("useEmbeddedColorManagement and validateImageData aren't supported.")]
-	public static Image FromStream (Stream stream, bool useEmbeddedColorManagement, bool validateImageData)
+	[MonoLimitation ("useECM and validateImageData aren't supported.")]	
+	public static Image FromStream (Stream stream, bool useECM, bool validateImageData)
 	{
 		return LoadFromStream (stream, false);
 	}
@@ -301,28 +301,28 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 
 	// non-static	
 	public RectangleF GetBounds (ref GraphicsUnit pageUnit)
-	{
-		RectangleF source;
+	{	
+		RectangleF source;			
 		
 		Status status = GDIPlus.GdipGetImageBounds (nativeObject, out source, ref pageUnit);
-		GDIPlus.CheckStatus (status);
+		GDIPlus.CheckStatus (status);		
 		
 		return source;
 	}
 	
-	public EncoderParameters GetEncoderParameterList(Guid encoder)
+	public EncoderParameters GetEncoderParameterList(Guid format)
 	{
 		Status status;
 		uint sz;
 
-		status = GDIPlus.GdipGetEncoderParameterListSize (nativeObject, ref encoder, out sz);
+		status = GDIPlus.GdipGetEncoderParameterListSize (nativeObject, ref format, out sz);
 		GDIPlus.CheckStatus (status);
 
 		IntPtr rawEPList = Marshal.AllocHGlobal ((int) sz);
 		EncoderParameters eps;
 
 		try {
-			status = GDIPlus.GdipGetEncoderParameterList (nativeObject, ref encoder, sz, rawEPList);
+			status = GDIPlus.GdipGetEncoderParameterList (nativeObject, ref format, sz, rawEPList);
 			eps = EncoderParameters.FromNativePtr (rawEPList);
 			GDIPlus.CheckStatus (status);
 		}
@@ -361,10 +361,11 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		try {
 			status = GDIPlus.GdipGetPropertyItem (nativeObject, propid, propSize, property);
 			GDIPlus.CheckStatus (status);
-			gdipProperty = (GdipPropertyItem) Marshal.PtrToStructure (property,
-								typeof (GdipPropertyItem));
+			gdipProperty = (GdipPropertyItem) Marshal.PtrToStructure (property, 
+								typeof (GdipPropertyItem));						
 			GdipPropertyItem.MarshalTo (gdipProperty, item);
-		} finally {
+		}
+		finally {
 			Marshal.FreeHGlobal (property);
 		}
 		return item;
@@ -391,20 +392,20 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	
 	
 	public void RemovePropertyItem (int propid)
-	{
+	{		
 		Status status = GDIPlus.GdipRemovePropertyItem (nativeObject, propid);
-		GDIPlus.CheckStatus (status);
-	}
+		GDIPlus.CheckStatus (status);					
+	}	
 	
 	public void RotateFlip (RotateFlipType rotateFlipType)
-	{
+	{			
 		Status status = GDIPlus.GdipImageRotateFlip (nativeObject, rotateFlipType);
-		GDIPlus.CheckStatus (status);
+		GDIPlus.CheckStatus (status);				
 	}
 
 	internal ImageCodecInfo findEncoderForFormat (ImageFormat format)
 	{
-		ImageCodecInfo[] encoders = ImageCodecInfo.GetImageEncoders();
+		ImageCodecInfo[] encoders = ImageCodecInfo.GetImageEncoders();			
 		ImageCodecInfo encoder = null;
 		
 		if (format.Guid.Equals (ImageFormat.MemoryBmp.Guid))
@@ -415,7 +416,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			if (encoders[i].FormatID.Equals (format.Guid)) {
 				encoder = encoders[i];
 				break;
-			}
+			}			
 		}
 
 		return encoder;
@@ -491,10 +492,10 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			if (nativeEncoderParams != IntPtr.Zero)
 				Marshal.FreeHGlobal (nativeEncoderParams);
 		}
-
-		GDIPlus.CheckStatus (st);
+		
+		GDIPlus.CheckStatus (st);		
 	}
-
+	
 	public void SaveAdd (EncoderParameters encoderParams)
 	{
 		Status st;
@@ -504,7 +505,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		Marshal.FreeHGlobal (nativeEncoderParams);
 		GDIPlus.CheckStatus (st);
 	}
-
+		
 	public void SaveAdd (Image image, EncoderParameters encoderParams)
 	{
 		Status st;
@@ -514,15 +515,15 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		Marshal.FreeHGlobal (nativeEncoderParams);
 		GDIPlus.CheckStatus (st);
 	}
-
+		
 	public int SelectActiveFrame(FrameDimension dimension, int frameIndex)
 	{
-		Guid guid = dimension.Guid;
+		Guid guid = dimension.Guid;		
 		Status st = GDIPlus.GdipImageSelectActiveFrame (nativeObject, ref guid, frameIndex);
 		
-		GDIPlus.CheckStatus (st);
-
-		return frameIndex;
+		GDIPlus.CheckStatus (st);			
+		
+		return frameIndex;		
 	}
 
 	public void SetPropertyItem(PropertyItem propitem)
@@ -544,9 +545,9 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		get {
 			int flags;
 			
-			Status status = GDIPlus.GdipGetImageFlags (nativeObject, out flags);
-			GDIPlus.CheckStatus (status);
-			return flags;
+			Status status = GDIPlus.GdipGetImageFlags (nativeObject, out flags);			
+			GDIPlus.CheckStatus (status);						
+			return flags;			
 		}
 	}
 	
@@ -558,7 +559,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			GDIPlus.CheckStatus (status);
 			Guid [] guid = new Guid [found];
 			status = GDIPlus.GdipImageGetFrameDimensionsList (nativeObject, guid, found);
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);  
 			return guid;
 		}
 	}
@@ -568,11 +569,11 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 	public int Height {
 		get {
-			uint height;
-			Status status = GDIPlus.GdipGetImageHeight (nativeObject, out height);
-			GDIPlus.CheckStatus (status);
-
-			return (int) height;
+			uint height;			
+			Status status = GDIPlus.GdipGetImageHeight (nativeObject, out height);		
+			GDIPlus.CheckStatus (status);			
+			
+			return (int)height;
 		}
 	}
 	
@@ -581,15 +582,15 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			float resolution;
 			
 			Status status = GDIPlus.GdipGetImageHorizontalResolution (nativeObject, out resolution);			
-			GDIPlus.CheckStatus (status);
-
+			GDIPlus.CheckStatus (status);			
+			
 			return resolution;
 		}
 	}
 	
 	[Browsable (false)]
 	public ColorPalette Palette {
-		get {
+		get {							
 			return retrieveGDIPalette();
 		}
 		set {
@@ -610,7 +611,9 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			GDIPlus.CheckStatus (st);
 			ret.setFromGDIPalette (palette_data);
 			return ret;
-		} finally {
+		}
+
+		finally {
 			Marshal.FreeHGlobal (palette_data);
 		}
 	}
@@ -628,7 +631,9 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		try {
 			Status st = GDIPlus.GdipSetImagePalette (nativeObject, palette_data);
 			GDIPlus.CheckStatus (st);
-		} finally {
+		}
+
+		finally {
 			Marshal.FreeHGlobal(palette_data);
 		}
 	}
@@ -637,21 +642,21 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	public SizeF PhysicalDimension {
 		get {
 			float width,  height;
-			Status status = GDIPlus.GdipGetImageDimension (nativeObject, out width, out height);
-			GDIPlus.CheckStatus (status);
-
+			Status status = GDIPlus.GdipGetImageDimension (nativeObject, out width, out height);		
+			GDIPlus.CheckStatus (status);			
+			
 			return new SizeF (width, height);
 		}
 	}
 	
 	public PixelFormat PixelFormat {
-		get {
-			PixelFormat pixFormat;
-			Status status = GDIPlus.GdipGetImagePixelFormat (nativeObject, out pixFormat);
-			GDIPlus.CheckStatus (status);
-
+		get {			
+			PixelFormat pixFormat;				
+			Status status = GDIPlus.GdipGetImagePixelFormat (nativeObject, out pixFormat);		
+			GDIPlus.CheckStatus (status);			
+			
 			return pixFormat;
-		}
+		}		
 	}
 	
 	[Browsable (false)]
@@ -660,14 +665,14 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			uint propNumbers;
 			
 			Status status = GDIPlus.GdipGetPropertyCount (nativeObject, 
-									out propNumbers);
+									out propNumbers);			
 			GDIPlus.CheckStatus (status);
 			
 			int [] idList = new int [propNumbers];
 			status = GDIPlus.GdipGetPropertyIdList (nativeObject, 
 								propNumbers, idList);
 			GDIPlus.CheckStatus (status);
-
+			
 			return idList;
 		}
 	}
@@ -687,8 +692,8 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			items =  new PropertyItem [propNums];
 			
 			if (propNums == 0)
-				return items;
-
+				return items;			
+					
 			/* Get PropertyItem list*/
 			properties = Marshal.AllocHGlobal (propsSize * propNums);
 			try {
@@ -696,16 +701,17 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 								propNums, properties);
 				GDIPlus.CheckStatus (status);
 
-				propSize = Marshal.SizeOf (gdipProperty);
+				propSize = Marshal.SizeOf (gdipProperty);			
 				propPtr = properties;
 			
 				for (int i = 0; i < propNums; i++, propPtr = new IntPtr (propPtr.ToInt64 () + propSize)) {
 					gdipProperty = (GdipPropertyItem) Marshal.PtrToStructure 
-						(propPtr, typeof (GdipPropertyItem));
+						(propPtr, typeof (GdipPropertyItem));						
 					items [i] = new PropertyItem ();
-					GdipPropertyItem.MarshalTo (gdipProperty, items [i]);
+					GdipPropertyItem.MarshalTo (gdipProperty, items [i]);								
 				}
-			} finally {
+			}
+			finally {
 				Marshal.FreeHGlobal (properties);
 			}
 			return items;
@@ -716,9 +722,9 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		get {
 			Guid guid;
 			Status st = GDIPlus.GdipGetImageRawFormat (nativeObject, out guid);
-
+			
 			GDIPlus.CheckStatus (st);
-			return new ImageFormat (guid);
+			return new ImageFormat (guid);			
 		}
 	}
 	
@@ -730,8 +736,8 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 
 #if NET_2_0
 	[DefaultValue (null)]
-	[LocalizableAttribute(false)]
-	[BindableAttribute(true)]
+	[LocalizableAttribute(false)] 
+	[BindableAttribute(true)] 	
 	[TypeConverter (typeof (StringConverter))]
 	public object Tag { 
 		get { return tag; }
@@ -741,7 +747,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	public float VerticalResolution {
 		get {
 			float resolution;
-
+			
 			Status status = GDIPlus.GdipGetImageVerticalResolution (nativeObject, out resolution);
 			GDIPlus.CheckStatus (status);
 
@@ -754,10 +760,10 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 	[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 	public int Width {
 		get {
-			uint width;
-			Status status = GDIPlus.GdipGetImageWidth (nativeObject, out width);
-			GDIPlus.CheckStatus (status);
-
+			uint width;			
+			Status status = GDIPlus.GdipGetImageWidth (nativeObject, out width);		
+			GDIPlus.CheckStatus (status);			
+			
 			return (int)width;
 		}
 	}
@@ -766,7 +772,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 		get{
 			return nativeObject;
 		}
-		set {
+		set	{
 			nativeObject = value;
 		}
 	}
@@ -793,15 +799,15 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
 			}
 			// ... set nativeObject to null before (possibly) throwing an exception
 			nativeObject = IntPtr.Zero;
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);		
 		}
 	}
 	
 	public object Clone ()
 	{
 		IntPtr newimage = IntPtr.Zero;
-		Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);
-		GDIPlus.CheckStatus (status);
+		Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);			
+		GDIPlus.CheckStatus (status);			
 
 		if (this is Bitmap)
 			return new Bitmap (newimage);

+ 12 - 12
mcs/class/System.Drawing/System.Drawing/ImageAnimator.cs

@@ -33,10 +33,10 @@ using System.Collections;
 using System.Drawing.Imaging;
 using System.Threading;
 
-namespace System.Drawing
-{
-	class AnimateEventArgs : EventArgs
-	{
+namespace System.Drawing {
+
+	class AnimateEventArgs : EventArgs {
+
 		private int frameCount;
 		private int activeFrame;
 		private Thread thread;
@@ -45,7 +45,7 @@ namespace System.Drawing
 		{
 			frameCount = image.GetFrameCount (FrameDimension.Time);
 		}
-
+      
 		public Thread RunThread {
 			get { return thread; }
 			set { thread = value; }
@@ -62,15 +62,15 @@ namespace System.Drawing
 		}
 	}
 
-	public sealed class ImageAnimator
-	{
+	public sealed class ImageAnimator {
+
 		static Hashtable ht = Hashtable.Synchronized (new Hashtable ());
 
 		private ImageAnimator ()
 		{
 		}
 
-		public static void Animate (Image image, EventHandler onFrameChangedHandler)
+		public static void Animate (Image image, EventHandler onFrameChangeHandler)
 		{
 			// must be non-null and contain animation time frames
 			if (!CanAnimate (image))
@@ -90,7 +90,7 @@ namespace System.Drawing
 			}
 
 			AnimateEventArgs aea = new AnimateEventArgs (image);
-			WorkerThread wt = new WorkerThread (onFrameChangedHandler, aea, delay);
+			WorkerThread wt = new WorkerThread (onFrameChangeHandler, aea, delay);
 			Thread thread = new Thread (new ThreadStart (wt.LoopHandler));
 			thread.IsBackground = true;
 			aea.RunThread = thread;
@@ -115,7 +115,7 @@ namespace System.Drawing
 			return false;
 		}
 
-		public static void StopAnimate (Image image, EventHandler onFrameChangedHandler)
+		public static void StopAnimate (Image image, EventHandler onFrameChangeHandler)
 		{
 			if (image == null)
 				return;
@@ -151,8 +151,8 @@ namespace System.Drawing
 		}
 	}
 
-	class WorkerThread
-	{
+	class WorkerThread {
+
 		private EventHandler frameChangeHandler;
 		private AnimateEventArgs animateEventArgs;
 		private int[] delay;

+ 25 - 23
mcs/class/System.Drawing/System.Drawing/ImageConverter.cs

@@ -39,68 +39,70 @@ using System.Drawing.Imaging;
 
 namespace System.Drawing
 {
+	/// <summary>
+	/// Summary description for ImageConverter.
+	/// </summary>
 	public class ImageConverter : TypeConverter
-	{
+	{		
 		public ImageConverter ()
 		{
 		}
 		
-		public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+		public override bool CanConvertFrom (ITypeDescriptorContext context, Type srcType)
 		{
-			if (sourceType == typeof (System.Byte []))
+			if (srcType == typeof (System.Byte[]))
 				return true;
 			else
-				return false;
+				return false; 
 		}
 
-		public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+		public override bool CanConvertTo (ITypeDescriptorContext context, Type destType)
 		{
-			if ((destinationType == typeof (System.Byte [])) || (destinationType == typeof (System.String)))
+			if ((destType == typeof (System.Byte[])) || (destType == typeof (System.String)))
 				return true;
 			else
 				return false;
 		}
 		
-		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object val)
 		{
-			byte [] bytes = value as byte [];
+			byte [] bytes = val as byte [];
 			if (bytes == null)
-				return base.ConvertFrom (context, culture, value);
+				return base.ConvertFrom (context, culture, val);
 			
 			MemoryStream ms = new MemoryStream (bytes);
 			
-			return Image.FromStream (ms);
+			return Image.FromStream (ms);	
 		}
 
-		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object val, Type destType)
 		{
-			if (value == null)
+			if (val == null)
 				return "(none)";
 
-			Image image = value as Image;
-			if (image != null) {
-				if (destinationType == typeof (string)) {
-					return value.ToString ();
-				} else if (CanConvertTo (null, destinationType)) {
+			if (val is System.Drawing.Image) {
+				if (destType == typeof (string)) {
+					return val.ToString ();
+				} else if (CanConvertTo (null, destType)) {
 					//came here means destType is byte array ;
 					MemoryStream ms = new MemoryStream ();
-					image.Save (ms, image.RawFormat);
+					((Image)val).Save (ms, ((Image)val).RawFormat);
 					return ms.GetBuffer ();
 				}
 			}
 
-			string msg = Locale.GetText ("ImageConverter can not convert from type '{0}'.", value.GetType ());
+			string msg = Locale.GetText ("ImageConverter can not convert from type '{0}'.", val.GetType ());
 			throw new NotSupportedException (msg);
 		}
 
-		public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value, Attribute [] attributes)
+		public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object val, Attribute[] attribs)
 		{
-			return TypeDescriptor.GetProperties (typeof (Image), attributes);
+			return TypeDescriptor.GetProperties (typeof (Image), attribs);
 		}
 
-		public override bool GetPropertiesSupported (ITypeDescriptorContext context)
+		public override bool GetPropertiesSupported (ITypeDescriptorContext context )
 		{
-			return true;
+			return true; 
 		}
 	}
 }

+ 23 - 20
mcs/class/System.Drawing/System.Drawing/ImageFormatConverter.cs

@@ -40,38 +40,41 @@ using System.Reflection;
 
 namespace System.Drawing
 {
+	/// <summary>
+	/// Summary description for ImageFormatConverter.
+	/// </summary>
 	public class ImageFormatConverter : TypeConverter
 	{
 		public ImageFormatConverter ()
 		{
 		}
 
-		public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+		public override bool CanConvertFrom (ITypeDescriptorContext context, Type srcType)
 		{
-			if (sourceType == typeof (string))
+			if (srcType == typeof (string))
 				return true;
-
-			return base.CanConvertFrom (context, sourceType);
+				
+			return base.CanConvertFrom (context, srcType);
 		}
 
-		public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+		public override bool CanConvertTo (ITypeDescriptorContext context, Type destType)
 		{
-			if (destinationType == typeof (string))
+			if (destType == typeof (string))
 				return true;
-
-			if (destinationType == typeof (InstanceDescriptor))
+				
+			if (destType == typeof (InstanceDescriptor))
 				return true;
 
-			return base.CanConvertTo (context, destinationType);
+			return base.CanConvertTo (context, destType);
 		}
 		
-		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object val)
 		{
 			// we must be able to convert from short names and long names
-			string strFormat = (value as string);
+			string strFormat = (val as string);
 			if (strFormat == null) {
 				// case #1, this is not a string
-				return base.ConvertFrom (context, culture, value);
+				return base.ConvertFrom (context, culture, val);
 			} else if (strFormat [0] == '[') {
 				// case #2, this is probably a long format (guid)
 				if (strFormat.Equals (ImageFormat.Bmp.ToString ()))
@@ -118,13 +121,13 @@ namespace System.Drawing
 					return ImageFormat.Wmf;
 			}
 			// last case, this is an unknown string
-			return base.ConvertFrom (context, culture, value);
+			return base.ConvertFrom (context, culture, val);
 		}
 
-		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object val, Type destType )
 		{
-			if (value is ImageFormat) {
-				ImageFormat c = (ImageFormat) value;
+			if (val is ImageFormat) {
+				ImageFormat c = (ImageFormat) val;
 				string prop = null;
 				if (c.Guid.Equals (ImageFormat.Bmp.Guid))
 					prop = "Bmp";
@@ -147,9 +150,9 @@ namespace System.Drawing
 				else if (c.Guid.Equals (ImageFormat.Wmf.Guid))
 					prop = "Wmf";
 
-				if (destinationType == typeof (string)) {
+				if (destType == typeof (string)) {
 					return prop != null ? prop : c.ToString ();
-				} else if (destinationType == typeof (InstanceDescriptor)) {
+				} else if (destType == typeof (InstanceDescriptor)) {
 					if (prop != null){
 						return new InstanceDescriptor (typeof (ImageFormat).GetProperty (prop), null);
 					} else {
@@ -158,8 +161,8 @@ namespace System.Drawing
 					}
 				}
 			}
-
-			return base.ConvertTo (context, culture, value, destinationType);
+			
+			return base.ConvertTo (context, culture, val, destType);
 		}
 
 		public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)

+ 13 - 13
mcs/class/System.Drawing/System.Drawing/Point.cs

@@ -38,7 +38,7 @@ using System.ComponentModel;
 
 namespace System.Drawing
 {
-	[Serializable]
+	[Serializable]	
 	[ComVisible (true)]
 	[TypeConverter (typeof (PointConverter))]
 	public struct Point
@@ -146,9 +146,9 @@ namespace System.Drawing
 		///	of the two points.
 		/// </remarks>
 
-		public static bool operator == (Point left, Point right)
+		public static bool operator == (Point pt_a, Point pt_b)
 		{
-			return ((left.X == right.X) && (left.Y == right.Y));
+			return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
 		}
 		
 		/// <summary>
@@ -161,9 +161,9 @@ namespace System.Drawing
 		///	of the two points.
 		/// </remarks>
 
-		public static bool operator != (Point left, Point right)
+		public static bool operator != (Point pt_a, Point pt_b)
 		{
-			return ((left.X != right.X) || (left.Y != right.Y));
+			return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
 		}
 		
 		/// <summary>
@@ -189,9 +189,9 @@ namespace System.Drawing
 		///	Point. Requires explicit cast.
 		/// </remarks>
 
-		public static explicit operator Size (Point p)
+		public static explicit operator Size (Point pt)
 		{
-			return new Size (p.X, p.Y);
+			return new Size (pt.X, pt.Y);
 		}
 
 		/// <summary>
@@ -203,9 +203,9 @@ namespace System.Drawing
 		///	Point. No explicit cast is required.
 		/// </remarks>
 
-		public static implicit operator PointF (Point p)
+		public static implicit operator PointF (Point pt)
 		{
-			return new PointF (p.X, p.Y);
+			return new PointF (pt.X, pt.Y);
 		}
 
 
@@ -318,12 +318,12 @@ namespace System.Drawing
 		///	Checks equivalence of this Point and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is Point))
+			if (!(o is Point))
 				return false;
 
-			return (this == (Point) obj);
+			return (this == (Point) o);
 		}
 
 		/// <summary>
@@ -366,7 +366,6 @@ namespace System.Drawing
 			return string.Format ("{{X={0},Y={1}}}", x.ToString (CultureInfo.InvariantCulture), 
 				y.ToString (CultureInfo.InvariantCulture));
 		}
-
 #if NET_2_0
 		public static Point Add (Point pt, Size sz)
 		{
@@ -383,5 +382,6 @@ namespace System.Drawing
 			return new Point (pt.X - sz.Width, pt.Y - sz.Height);
 		}
 #endif
+
 	}
 }

+ 7 - 7
mcs/class/System.Drawing/System.Drawing/PointF.cs

@@ -85,9 +85,9 @@ namespace System.Drawing
 		///	of the two points.
 		/// </remarks>
 
-		public static bool operator == (PointF left, PointF right)
+		public static bool operator == (PointF pt_a, PointF pt_b)
 		{
-			return ((left.X == right.X) && (left.Y == right.Y));
+			return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
 		}
 		
 		/// <summary>
@@ -100,9 +100,9 @@ namespace System.Drawing
 		///	of the two points.
 		/// </remarks>
 
-		public static bool operator != (PointF left, PointF right)
+		public static bool operator != (PointF pt_a, PointF pt_b)
 		{
-			return ((left.X != right.X) || (left.Y != right.Y));
+			return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
 		}
 		
 		/// <summary>
@@ -204,12 +204,12 @@ namespace System.Drawing
 		///	Checks equivalence of this PointF and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is PointF))
+			if (!(o is PointF))
 				return false;
 
-			return (this == (PointF) obj);
+			return (this == (PointF) o);
 		}
 
 		/// <summary>

+ 43 - 41
mcs/class/System.Drawing/System.Drawing/Rectangle.cs

@@ -138,12 +138,12 @@ namespace System.Drawing
 		///	Inflates the Rectangle by a specified Size.
 		/// </remarks>
 		
-		public void Inflate (Size size)
+		public void Inflate (Size sz)
 		{
-			x -= size.Width;
-			y -= size.Height;
-			Width += size.Width * 2;
-			Height += size.Height * 2;
+			x -= sz.Width;
+			y -= sz.Height;
+			Width += sz.Width * 2;
+			Height += sz.Height * 2;
 		}
 
 		/// <summary>
@@ -155,18 +155,18 @@ namespace System.Drawing
 		///	Rectangles. Returns null if there is no	intersection.
 		/// </remarks>
 		
-		public static Rectangle Intersect (Rectangle a, Rectangle b)
+		public static Rectangle Intersect (Rectangle r1, Rectangle r2)
 		{
 			// MS.NET returns a non-empty rectangle if the two rectangles
 			// touch each other
-			if (!a.IntersectsWithInclusive (b))
+			if (!r1.IntersectsWithInclusive (r2))
 				return Empty;
 
 			return Rectangle.FromLTRB (
-				Math.Max (a.Left, b.Left),
-				Math.Max (a.Top, b.Top),
-				Math.Min (a.Right, b.Right),
-				Math.Min (a.Bottom, b.Bottom));
+				Math.Max (r1.Left, r2.Left),
+				Math.Max (r1.Top, r2.Top),
+				Math.Min (r1.Right, r2.Right),
+				Math.Min (r1.Bottom, r2.Bottom));
 		}
 
 		/// <summary>
@@ -178,9 +178,9 @@ namespace System.Drawing
 		///	and another Rectangle.
 		/// </remarks>
 		
-		public void Intersect (Rectangle rect)
+		public void Intersect (Rectangle r)
 		{
-			this = Rectangle.Intersect (this, rect);
+			this = Rectangle.Intersect (this, r);
 		}
 
 		/// <summary>
@@ -238,12 +238,12 @@ namespace System.Drawing
 		///	Rectangles.
 		/// </remarks>
 		
-		public static Rectangle Union (Rectangle a, Rectangle b)
+		public static Rectangle Union (Rectangle r1, Rectangle r2)
 		{
-			return FromLTRB (Math.Min (a.Left, b.Left),
-					 Math.Min (a.Top, b.Top),
-					 Math.Max (a.Right, b.Right),
-					 Math.Max (a.Bottom, b.Bottom));
+			return FromLTRB (Math.Min (r1.Left, r2.Left),
+					 Math.Min (r1.Top, r2.Top),
+					 Math.Max (r1.Right, r2.Right),
+					 Math.Max (r1.Bottom, r2.Bottom));
 		}
 
 		/// <summary>
@@ -256,10 +256,10 @@ namespace System.Drawing
 		///	properties of the two Rectangles.
 		/// </remarks>
 
-		public static bool operator == (Rectangle left, Rectangle right)
+		public static bool operator == (Rectangle r1, Rectangle r2)
 		{
-			return ((left.Location == right.Location) &&
-				(left.Size == right.Size));
+			return ((r1.Location == r2.Location) && 
+				(r1.Size == r2.Size));
 		}
 		
 		/// <summary>
@@ -272,10 +272,10 @@ namespace System.Drawing
 		///	properties of the two Rectangles.
 		/// </remarks>
 
-		public static bool operator != (Rectangle left, Rectangle right)
+		public static bool operator != (Rectangle r1, Rectangle r2)
 		{
-			return ((left.Location != right.Location) ||
-				(left.Size != right.Size));
+			return ((r1.Location != r2.Location) || 
+				(r1.Size != r2.Size));
 		}
 		
 
@@ -291,12 +291,12 @@ namespace System.Drawing
 		///	Creates a Rectangle from Point and Size values.
 		/// </remarks>
 		
-		public Rectangle (Point location, Size size)
+		public Rectangle (Point loc, Size sz)
 		{
-			x = location.X;
-			y = location.Y;
-			width = size.Width;
-			height = size.Height;
+			x = loc.X;
+			y = loc.Y;
+			width = sz.Width;
+			height = sz.Height;
 		}
 
 		/// <summary>
@@ -316,6 +316,8 @@ namespace System.Drawing
 			this.height = height;
 		}
 
+
+
 		/// <summary>
 		///	Bottom Property
 		/// </summary>
@@ -549,12 +551,12 @@ namespace System.Drawing
 		///	Checks equivalence of this Rectangle and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is Rectangle))
+			if (!(o is Rectangle))
 				return false;
 
-			return (this == (Rectangle) obj);
+			return (this == (Rectangle) o);
 		}
 
 		/// <summary>
@@ -578,10 +580,10 @@ namespace System.Drawing
 		///	Checks if a Rectangle intersects with this one.
 		/// </remarks>
 		
-		public bool IntersectsWith (Rectangle rect)
+		public bool IntersectsWith (Rectangle r)
 		{
-			return !((Left >= rect.Right) || (Right <= rect.Left) ||
-			    (Top >= rect.Bottom) || (Bottom <= rect.Top));
+			return !((Left >= r.Right) || (Right <= r.Left) ||
+			    (Top >= r.Bottom) || (Bottom <= r.Top));
 		}
 
 		private bool IntersectsWithInclusive (Rectangle r)
@@ -598,10 +600,10 @@ namespace System.Drawing
 		///	Moves the Rectangle a specified distance.
 		/// </remarks>
 
-		public void Offset (int x, int y)
+		public void Offset (int dx, int dy)
 		{
-			x += x;
-			y += y;
+			x += dx;
+			y += dy;
 		}
 		
 		/// <summary>
@@ -612,10 +614,10 @@ namespace System.Drawing
 		///	Moves the Rectangle a specified distance.
 		/// </remarks>
 
-		public void Offset (Point pos)
+		public void Offset (Point pt)
 		{
-			x += pos.X;
-			y += pos.Y;
+			x += pt.X;
+			y += pt.Y;
 		}
 		
 		/// <summary>

+ 53 - 51
mcs/class/System.Drawing/System.Drawing/RectangleF.cs

@@ -35,7 +35,7 @@ namespace System.Drawing
 	[Serializable]
 	public struct RectangleF
 	{
-		private float x, y, width, height;
+                private float x, y, width, height;
 
 		/// <summary>
 		///	Empty Shared Field
@@ -79,10 +79,10 @@ namespace System.Drawing
 		///	RectangleF by the specified coordinate values.
 		/// </remarks>
 		
-		public static RectangleF Inflate (RectangleF rect, 
+		public static RectangleF Inflate (RectangleF r, 
 						  float x, float y)
 		{
-			RectangleF ir = new RectangleF (rect.X, rect.Y, rect.Width, rect.Height);
+			RectangleF ir = new RectangleF (r.X, r.Y, r.Width, r.Height);
 			ir.Inflate (x, y);
 			return ir;
 		}
@@ -95,9 +95,9 @@ namespace System.Drawing
 		///	Inflates the RectangleF by a specified width and height.
 		/// </remarks>
 		
-		public void Inflate (float x, float y)
+		public void Inflate (float width, float height)
 		{
-			Inflate (new SizeF (x, y));
+			Inflate (new SizeF (width, height));
 		}
 
 		/// <summary>
@@ -108,12 +108,12 @@ namespace System.Drawing
 		///	Inflates the RectangleF by a specified Size.
 		/// </remarks>
 		
-		public void Inflate (SizeF size)
+		public void Inflate (SizeF sz)
 		{
-			x -= size.Width;
-			y -= size.Height;
-			width += size.Width * 2;
-			height += size.Height * 2;
+                        x -= sz.Width;
+                        y -= sz.Height;
+                        width += sz.Width * 2;
+                        height += sz.Height * 2;                        
 		}
 
 		/// <summary>
@@ -125,17 +125,17 @@ namespace System.Drawing
 		///	RectangleFs. Returns null if there is no intersection.
 		/// </remarks>
 		
-		public static RectangleF Intersect (RectangleF a, 
-						    RectangleF b)
+		public static RectangleF Intersect (RectangleF r1, 
+						    RectangleF r2)
 		{
-			if (!a.IntersectsWith (b)) 
+			if (!r1.IntersectsWith (r2)) 
 				return Empty;
 
 			return FromLTRB (
-				Math.Max (a.Left, b.Left),
-				Math.Max (a.Top, b.Top),
-				Math.Min (a.Right, b.Right),
-				Math.Min (a.Bottom, b.Bottom));
+				Math.Max (r1.Left, r2.Left),
+				Math.Max (r1.Top, r2.Top),
+				Math.Min (r1.Right, r2.Right),
+				Math.Min (r1.Bottom, r2.Bottom));
 		}
 
 		/// <summary>
@@ -147,9 +147,9 @@ namespace System.Drawing
 		///	and another RectangleF.
 		/// </remarks>
 		
-		public void Intersect (RectangleF rect)
+		public void Intersect (RectangleF r)
 		{
-			this = RectangleF.Intersect (this, rect);
+			this = RectangleF.Intersect (this, r);
 		}
 
 		/// <summary>
@@ -161,12 +161,12 @@ namespace System.Drawing
 		///	RectangleFs.
 		/// </remarks>
 		
-		public static RectangleF Union (RectangleF a, RectangleF b)
+		public static RectangleF Union (RectangleF r1, RectangleF r2)
 		{
-			return FromLTRB (Math.Min (a.Left, b.Left),
-					 Math.Min (a.Top, b.Top),
-					 Math.Max (a.Right, b.Right),
-					 Math.Max (a.Bottom, b.Bottom));
+			return FromLTRB (Math.Min (r1.Left, r2.Left),
+					 Math.Min (r1.Top, r2.Top),
+					 Math.Max (r1.Right, r2.Right),
+					 Math.Max (r1.Bottom, r2.Bottom));
 		}
 
 		/// <summary>
@@ -179,10 +179,10 @@ namespace System.Drawing
 		///	properties of the two RectangleFs.
 		/// </remarks>
 
-		public static bool operator == (RectangleF left, RectangleF right)
+		public static bool operator == (RectangleF r1, RectangleF r2)
 		{
-			return (left.X == right.X) && (left.Y == right.Y) &&
-				(left.Width == right.Width) && (left.Height == right.Height);
+			return (r1.X == r2.X) && (r1.Y == r2.Y) &&
+                                (r1.Width == r2.Width) && (r1.Height == r2.Height);
 		}
 		
 		/// <summary>
@@ -195,10 +195,10 @@ namespace System.Drawing
 		///	properties of the two RectangleFs.
 		/// </remarks>
 
-		public static bool operator != (RectangleF left, RectangleF right)
+		public static bool operator != (RectangleF r1, RectangleF r2)
 		{
-			return (left.X != right.X) || (left.Y != right.Y) ||
-				(left.Width != right.Width) || (left.Height != right.Height);
+			return (r1.X != r2.X) || (r1.Y != r2.Y) ||
+                                (r1.Width != r2.Width) || (r1.Height != r2.Height);
 		}
 		
 		/// <summary>
@@ -227,12 +227,12 @@ namespace System.Drawing
 		///	Creates a RectangleF from PointF and SizeF values.
 		/// </remarks>
 		
-		public RectangleF (PointF location, SizeF size)
+		public RectangleF (PointF loc, SizeF sz)
 		{
-			x = location.X;
-			y = location.Y;
-			width = size.Width;
-			height = size.Height;
+			x = loc.X;
+                        y = loc.Y;
+                        width = sz.Width;
+                        height = sz.Height;
 		}
 
 		/// <summary>
@@ -247,11 +247,12 @@ namespace System.Drawing
 		public RectangleF (float x, float y, float width, float height)
 		{
 			this.x = x;
-			this.y = y;
-			this.width = width;
-			this.height = height;
+                        this.y = y;
+                        this.width = width;
+                        this.height = height;
 		}
 
+
 #if TARGET_JVM
 		internal RectangleF (java.awt.geom.RectangularShape r2d) {
 			this.x = (float) r2d.getX ();
@@ -340,7 +341,7 @@ namespace System.Drawing
 			}
 			set {
 				x = value.X;
-				y = value.Y;
+                                y = value.Y;
 			}
 		}
 
@@ -375,7 +376,7 @@ namespace System.Drawing
 			}
 			set {
 				width = value.Width;
-				height = value.Height;
+                                height = value.Height;
 			}
 		}
 
@@ -495,12 +496,12 @@ namespace System.Drawing
 		///	Checks equivalence of this RectangleF and an object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is RectangleF))
+			if (!(o is RectangleF))
 				return false;
 
-			return (this == (RectangleF) obj);
+			return (this == (RectangleF) o);
 		}
 
 		/// <summary>
@@ -524,10 +525,10 @@ namespace System.Drawing
 		///	Checks if a RectangleF intersects with this one.
 		/// </remarks>
 
-		public bool IntersectsWith (RectangleF rect)
+		public bool IntersectsWith (RectangleF r)
 		{
-			return !((Left >= rect.Right) || (Right <= rect.Left) ||
-			    (Top >= rect.Bottom) || (Bottom <= rect.Top));
+			return !((Left >= r.Right) || (Right <= r.Left) ||
+			    (Top >= r.Bottom) || (Bottom <= r.Top));
 		}
 
 		/// <summary>
@@ -538,10 +539,10 @@ namespace System.Drawing
 		///	Moves the RectangleF a specified distance.
 		/// </remarks>
 
-		public void Offset (float x, float y)
+		public void Offset (float dx, float dy)
 		{
-			X += x;
-			Y += y;
+			X += dx;
+			Y += dy;
 		}
 		
 		/// <summary>
@@ -552,9 +553,9 @@ namespace System.Drawing
 		///	Moves the RectangleF a specified distance.
 		/// </remarks>
 
-		public void Offset (PointF pos)
+		public void Offset (PointF pt)
 		{
-			Offset (pos.X, pos.Y);
+			Offset(pt.X, pt.Y);
 		}
 		
 		/// <summary>
@@ -570,5 +571,6 @@ namespace System.Drawing
 			return String.Format ("{{X={0},Y={1},Width={2},Height={3}}}",
 						 x, y, width, height);
 		}
+
 	}
 }

+ 199 - 194
mcs/class/System.Drawing/System.Drawing/Region.cs

@@ -39,19 +39,19 @@ namespace System.Drawing
 #endif
 	public sealed class Region : MarshalByRefObject, IDisposable
 	{
-		private IntPtr nativeRegion = IntPtr.Zero;
-
+                private IntPtr nativeRegion = IntPtr.Zero;
+                
 		public Region()
 		{
 			Status status = GDIPlus.GdipCreateRegion (out nativeRegion);
 			GDIPlus.CheckStatus (status);
 		}
 
-		internal Region(IntPtr native)
+                internal Region(IntPtr native)
 		{
-			nativeRegion = native;
-		}
-
+                        nativeRegion = native; 
+                }
+                
 		public Region (GraphicsPath path)
 		{
 			if (path == null)
@@ -60,7 +60,7 @@ namespace System.Drawing
 			GDIPlus.CheckStatus (status);
 		}
 
-		public Region (Rectangle rect)
+		public Region (Rectangle rect)                
 		{
 			Status status = GDIPlus.GdipCreateRegionRectI (ref rect, out nativeRegion);
 			GDIPlus.CheckStatus (status);
@@ -83,7 +83,7 @@ namespace System.Drawing
 			GDIPlus.CheckStatus (status);
 		}
 		
-		//
+		//                                                                                                     
 		// Union
 		//
 
@@ -92,60 +92,60 @@ namespace System.Drawing
 			if (path == null)
 				throw new ArgumentNullException ("path");
 			Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Union);
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);                        
 		}
 
 
 		public void Union (Rectangle rect)
-		{
-			Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Union);
-			GDIPlus.CheckStatus (status);
+		{                                    
+                        Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Union);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Union (RectangleF rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Union);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Union);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Union (Region region)
 		{
 			if (region == null)
 				throw new ArgumentNullException ("region");
-			Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Union);
-			GDIPlus.CheckStatus (status);
-		}
+                        Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Union);
+                        GDIPlus.CheckStatus (status);
+		}                                                                                         
 
 		
 		//
 		// Intersect
 		//
 		public void Intersect (GraphicsPath path)
-		{
+                {
 			if (path == null)
 				throw new ArgumentNullException ("path");
-			Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Intersect);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Intersect);
+                        GDIPlus.CheckStatus (status);  
 		}
 
 		public void Intersect (Rectangle rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Intersect);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Intersect);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Intersect (RectangleF rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Intersect);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Intersect);
+                        GDIPlus.CheckStatus (status);
 		}
 
-		public void Intersect (Region region)
+                public void Intersect (Region region)
 		{
 			if (region == null)
 				throw new ArgumentNullException ("region");
-			Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Intersect);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Intersect);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		//
@@ -155,28 +155,28 @@ namespace System.Drawing
 		{
 			if (path == null)
 				throw new ArgumentNullException ("path");
-			Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Complement);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Complement);
+                        GDIPlus.CheckStatus (status);  
 		}
 
 		public void Complement (Rectangle rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Complement);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Complement);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Complement (RectangleF rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Complement);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Complement);
+                        GDIPlus.CheckStatus (status);
 		}
 
-		public void Complement (Region region)
+                public void Complement (Region region)
 		{
 			if (region == null)
 				throw new ArgumentNullException ("region");
-			Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Complement);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Complement);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		//
@@ -186,28 +186,28 @@ namespace System.Drawing
 		{
 			if (path == null)
 				throw new ArgumentNullException ("path");
-			Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Exclude);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Exclude);
+                        GDIPlus.CheckStatus (status);                                                   
 		}
 
 		public void Exclude (Rectangle rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Exclude);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Exclude);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Exclude (RectangleF rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Exclude);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Exclude);
+                        GDIPlus.CheckStatus (status);
 		}
 
-		public void Exclude (Region region)
+                public void Exclude (Region region)
 		{
 			if (region == null)
 				throw new ArgumentNullException ("region");
-			Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Exclude);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Exclude);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		//
@@ -217,59 +217,59 @@ namespace System.Drawing
 		{
 			if (path == null)
 				throw new ArgumentNullException ("path");
-			Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Xor);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Xor);
+                        GDIPlus.CheckStatus (status);  
 		}
 
 		public void Xor (Rectangle rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Xor);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRectI (nativeRegion, ref rect, CombineMode.Xor);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		public void Xor (RectangleF rect)
 		{
-			Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Xor);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRect (nativeRegion, ref rect, CombineMode.Xor);
+                        GDIPlus.CheckStatus (status);
 		}
 
-		public void Xor (Region region)
+                public void Xor (Region region)
 		{
 			if (region == null)
 				throw new ArgumentNullException ("region");
-			Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Xor);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipCombineRegionRegion (nativeRegion, region.NativeObject, CombineMode.Xor);
+                        GDIPlus.CheckStatus (status); 
 		}
 
 		//
 		// GetBounds
 		//
-		public RectangleF GetBounds (Graphics g)
+		public RectangleF GetBounds (Graphics graphics)
 		{
-			if (g == null)
-				throw new ArgumentNullException ("g");
+			if (graphics == null)
+				throw new ArgumentNullException ("graphics");
 
-			RectangleF rect = new Rectangle();
+                        RectangleF rect = new Rectangle();
+                        
+                        Status status = GDIPlus.GdipGetRegionBounds (nativeRegion, graphics.NativeObject, ref rect);
+                        GDIPlus.CheckStatus (status);
 
-			Status status = GDIPlus.GdipGetRegionBounds (nativeRegion, g.NativeObject, ref rect);
-			GDIPlus.CheckStatus (status);
-
-			return rect;
-		}
+                        return rect;
+                }
 
 		//
 		// Translate
 		//
 		public void Translate (int dx, int dy)
 		{
-			Status status = GDIPlus.GdipTranslateRegionI (nativeRegion, dx, dy);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipTranslateRegionI (nativeRegion, dx, dy);
+                        GDIPlus.CheckStatus (status);   
 		}
 
 		public void Translate (float dx, float dy)
 		{
-			Status status = GDIPlus.GdipTranslateRegion (nativeRegion, dx, dy);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipTranslateRegion (nativeRegion, dx, dy);
+                        GDIPlus.CheckStatus (status);
 		}
 
 		//
@@ -278,124 +278,124 @@ namespace System.Drawing
 		public bool IsVisible (int x, int y, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
-
-			Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, x, y, ptr, out result);
-			GDIPlus.CheckStatus (status);
+                        bool result;
+                        
+		    	Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, x, y, ptr, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (int x, int y, int width, int height)
 		{
-			bool result;
+		        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, x, y,
-				width, height, IntPtr.Zero, out result);
+                        Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, x, y,
+                                width, height, IntPtr.Zero, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (int x, int y, int width, int height, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
+		        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, x, y,
-				width, height, ptr, out result);
+                        Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, x, y,
+                                width, height, ptr, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (Point point)
 		{
-			bool result;
-
-			Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, point.X, point.Y,
-				IntPtr.Zero, out result);
+		        bool result;
 
-			GDIPlus.CheckStatus (status);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, point.X, point.Y,
+                                IntPtr.Zero, out result);
+                                
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (PointF point)
 		{
-			bool result;
+		       bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, point.X, point.Y,
-				IntPtr.Zero, out result);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, point.X, point.Y,
+                                IntPtr.Zero, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (Point point, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
+                        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, point.X, point.Y,
-				ptr, out result);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPointI (nativeRegion, point.X, point.Y,
+                                ptr, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;                                                      
 		}
 
 		public bool IsVisible (PointF point, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
+		        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, point.X, point.Y,
-				ptr, out result);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, point.X, point.Y,
+                                ptr, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (Rectangle rect)
 		{
-			bool result;
+		        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, rect.X, rect.Y,
-				rect.Width, rect.Height, IntPtr.Zero, out result);
+                        Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, rect.X, rect.Y,
+                                rect.Width, rect.Height, IntPtr.Zero, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (RectangleF rect)
 		{
-			bool result;
+                        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, rect.X, rect.Y,
-				rect.Width, rect.Height, IntPtr.Zero, out result);
+                        Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, rect.X, rect.Y,
+                                rect.Width, rect.Height, IntPtr.Zero, out result);
 
-			GDIPlus.CheckStatus (status);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (Rectangle rect, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
-
-			Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, rect.X, rect.Y,
-				rect.Width, rect.Height, ptr, out result);
+		        bool result;
 
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipIsVisibleRegionRectI (nativeRegion, rect.X, rect.Y,
+                                rect.Width, rect.Height, ptr, out result);
+                        
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (RectangleF rect, Graphics g)
@@ -403,56 +403,57 @@ namespace System.Drawing
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
 			bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, rect.X, rect.Y,
-				rect.Width, rect.Height, ptr, out result);
+                        Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, rect.X, rect.Y,
+                                rect.Width, rect.Height, ptr, out result);
+                                
+                        GDIPlus.CheckStatus (status);
 
-			GDIPlus.CheckStatus (status);
-
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (float x, float y)
 		{
-			bool result;
+                        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, x, y, IntPtr.Zero, out result);
-			GDIPlus.CheckStatus (status);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, x, y, IntPtr.Zero, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (float x, float y, Graphics g)
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
+		        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, x, y, ptr, out result);
-			GDIPlus.CheckStatus (status);
+		    	Status status = GDIPlus.GdipIsVisibleRegionPoint (nativeRegion, x, y, ptr, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (float x, float y, float width, float height)
 		{
-			bool result;
+		        bool result;
+                        
+                        Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, x, y, width, height, IntPtr.Zero, out result);
+                        GDIPlus.CheckStatus (status);
 
-			Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, x, y, width, height, IntPtr.Zero, out result);
-			GDIPlus.CheckStatus (status);
-
-			return result;
+                        return result;
 		}
 
 		public bool IsVisible (float x, float y, float width, float height, Graphics g) 
 		{
 			IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
-			bool result;
+                        bool result;
 
-			Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, x, y, width, height, ptr, out result);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipIsVisibleRegionRect (nativeRegion, x, y, width, height, ptr, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;
 		}
 
+
 		//
 		// Miscellaneous
 		//
@@ -462,12 +463,12 @@ namespace System.Drawing
 			if (g == null)
 				throw new ArgumentNullException ("g");
 
-			bool result;
+                        bool result;               
 
-			Status status = GDIPlus.GdipIsEmptyRegion (nativeRegion, g.NativeObject, out result);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipIsEmptyRegion (nativeRegion, g.NativeObject, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;                        
 		}
 
 		public bool IsInfinite(Graphics g)
@@ -475,26 +476,26 @@ namespace System.Drawing
 			if (g == null)
 				throw new ArgumentNullException ("g");
 
-			bool result;
+                        bool result;
 
-			Status status = GDIPlus.GdipIsInfiniteRegion (nativeRegion, g.NativeObject, out result);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipIsInfiniteRegion (nativeRegion, g.NativeObject, out result);
+                        GDIPlus.CheckStatus (status);
 
-			return result;
+                        return result;  
 		}
 
 		public void MakeEmpty()
 		{
-			Status status = GDIPlus.GdipSetEmpty (nativeRegion);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipSetEmpty (nativeRegion);
+                        GDIPlus.CheckStatus (status);               
 		}
 
 		public void MakeInfinite()
 		{
-			Status status = GDIPlus.GdipSetInfinite (nativeRegion);
-			GDIPlus.CheckStatus (status);
+                        Status status = GDIPlus.GdipSetInfinite (nativeRegion);
+                        GDIPlus.CheckStatus (status);                      
 		}
-
+		
 		public bool Equals(Region region, Graphics g)
 		{
 			if (region == null)
@@ -505,13 +506,13 @@ namespace System.Drawing
 			bool result;
 			
 			Status status = GDIPlus.GdipIsEqualRegion (nativeRegion, region.NativeObject,
-				g.NativeObject, out result);
-
-			GDIPlus.CheckStatus (status);
-
-			return result;
+                           g.NativeObject, out result);                                   
+                           
+                        GDIPlus.CheckStatus (status);                      
+                        
+			return result;			
 		}
-
+		
 		[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
 		public static Region FromHrgn (IntPtr hrgn)
 		{
@@ -524,7 +525,8 @@ namespace System.Drawing
 
 			return new Region (handle);
 		}
-
+		
+		
 		public IntPtr GetHrgn (Graphics g)
 		{
 			// Our WindowsForms implementation uses null to avoid
@@ -543,25 +545,27 @@ namespace System.Drawing
 			GDIPlus.CheckStatus (status);
 			return handle;
 		}
-
+		
+		
 		public RegionData GetRegionData()
 		{
-			int size, filled;
+			int size, filled;			
 			
-			Status status = GDIPlus.GdipGetRegionDataSize (nativeRegion, out size);
-			GDIPlus.CheckStatus (status);
-
-			byte[] buff = new byte [size];
-
+			Status status = GDIPlus.GdipGetRegionDataSize (nativeRegion, out size);                  
+                        GDIPlus.CheckStatus (status);                      
+                        
+                        byte[] buff = new byte [size];			
+                        
 			status = GDIPlus.GdipGetRegionData (nativeRegion, buff, size, out filled);
-			GDIPlus.CheckStatus (status);
+			GDIPlus.CheckStatus (status);                      
 			
 			RegionData rgndata = new RegionData();
 			rgndata.Data = buff;
 			
 			return rgndata;
 		}
-
+		
+		
 		public RectangleF[] GetRegionScans(Matrix matrix)
 		{
 			if (matrix == null)
@@ -569,25 +573,26 @@ namespace System.Drawing
 
 			int cnt;
 			
-			Status status = GDIPlus.GdipGetRegionScansCount (nativeRegion, out cnt, matrix.NativeObject);
-			GDIPlus.CheckStatus (status);
-
-			if (cnt == 0)
-				return new RectangleF[0];
-
-			RectangleF[] rects = new RectangleF [cnt];
-			int size = Marshal.SizeOf (rects[0]);
-
-			IntPtr dest = Marshal.AllocHGlobal (size * cnt);
+			Status status = GDIPlus.GdipGetRegionScansCount (nativeRegion, out cnt, matrix.NativeObject);                  
+                        GDIPlus.CheckStatus (status);                                 
+                        
+                        if (cnt == 0)
+                        	return new RectangleF[0];
+                                                
+                        RectangleF[] rects = new RectangleF [cnt];					
+                        int size = Marshal.SizeOf (rects[0]);                  
+                        
+                        IntPtr dest = Marshal.AllocHGlobal (size * cnt);			
 			try {
 				status = GDIPlus.GdipGetRegionScans (nativeRegion, dest, out cnt, matrix.NativeObject);
 				GDIPlus.CheckStatus (status);
-			} finally {
+			}
+			finally {
 				// note: Marshal.FreeHGlobal is called from GDIPlus.FromUnManagedMemoryToRectangles
 				GDIPlus.FromUnManagedMemoryToRectangles (dest, rects);
 			}
-			return rects;
-		}
+			return rects;			
+		}		
 
 		public void Transform(Matrix matrix)
 		{
@@ -595,17 +600,17 @@ namespace System.Drawing
 				throw new ArgumentNullException ("matrix");
 
 			Status status = GDIPlus.GdipTransformRegion (nativeRegion, matrix.NativeObject);
-			GDIPlus.CheckStatus (status);
-		}
-
+			GDIPlus.CheckStatus (status);                      				
+		}		
+		
 		public Region Clone()
 		{
 			IntPtr cloned;
-
+				
 			Status status = GDIPlus.GdipCloneRegion (nativeRegion, out cloned);
 			GDIPlus.CheckStatus (status);
-
-			return new Region (cloned);
+				
+			return new Region (cloned); 
 		}
 
 		public void Dispose ()
@@ -627,19 +632,19 @@ namespace System.Drawing
 			DisposeHandle ();
 		}
 
-		internal IntPtr NativeObject {
-			get {
+                internal IntPtr NativeObject
+                {
+			get{
 				return nativeRegion;
 			}
-			set {
+			set	{
 				nativeRegion = value;
 			}
 		}
-
 #if NET_2_0
 		// why is this a instance method ? and not static ?
 		[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
-		public void ReleaseHrgn (IntPtr regionHandle)
+		public void ReleaseHrgn (IntPtr regionHandle)		
 		{
 			if (regionHandle == IntPtr.Zero) 
 				throw new ArgumentNullException ("regionHandle");

+ 17 - 14
mcs/class/System.Drawing/System.Drawing/Size.cs

@@ -42,7 +42,8 @@ namespace System.Drawing
 	[ComVisible (true)]
 	[TypeConverter (typeof (SizeConverter))]
 	public struct Size
-	{
+	{ 
+		
 		// Private Height and width fields.
 		private int width, height;
 
@@ -144,10 +145,10 @@ namespace System.Drawing
 		///	properties of the two Sizes.
 		/// </remarks>
 
-		public static bool operator == (Size sz1, Size sz2)
+		public static bool operator == (Size sz_a, Size sz_b)
 		{
-			return ((sz1.Width == sz2.Width) &&
-				(sz1.Height == sz2.Height));
+			return ((sz_a.Width == sz_b.Width) && 
+				(sz_a.Height == sz_b.Height));
 		}
 		
 		/// <summary>
@@ -160,10 +161,10 @@ namespace System.Drawing
 		///	properties of the two Sizes.
 		/// </remarks>
 
-		public static bool operator != (Size sz1, Size sz2)
+		public static bool operator != (Size sz_a, Size sz_b)
 		{
-			return ((sz1.Width != sz2.Width) ||
-				(sz1.Height != sz2.Height));
+			return ((sz_a.Width != sz_b.Width) || 
+				(sz_a.Height != sz_b.Height));
 		}
 		
 		/// <summary>
@@ -189,9 +190,9 @@ namespace System.Drawing
 		///	Size. Requires explicit cast.
 		/// </remarks>
 
-		public static explicit operator Point (Size size)
+		public static explicit operator Point (Size sz)
 		{
-			return new Point (size.Width, size.Height);
+			return new Point (sz.Width, sz.Height);
 		}
 
 		/// <summary>
@@ -203,11 +204,12 @@ namespace System.Drawing
 		///	Size. No explicit cast is required.
 		/// </remarks>
 
-		public static implicit operator SizeF (Size p)
+		public static implicit operator SizeF (Size sz)
 		{
-			return new SizeF (p.Width, p.Height);
+			return new SizeF (sz.Width, sz.Height);
 		}
 
+
 		// -----------------------
 		// Public Constructors
 		// -----------------------
@@ -301,12 +303,12 @@ namespace System.Drawing
 		///	Checks equivalence of this Size and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is Size))
+			if (!(o is Size))
 				return false;
 
-			return (this == (Size) obj);
+			return (this == (Size) o);
 		}
 
 		/// <summary>
@@ -349,5 +351,6 @@ namespace System.Drawing
 					 sz1.Height - sz2.Height);
 		}
 #endif
+
 	}
 }

+ 15 - 14
mcs/class/System.Drawing/System.Drawing/SizeF.cs

@@ -86,10 +86,10 @@ namespace System.Drawing
 		///	properties of the two Sizes.
 		/// </remarks>
 
-		public static bool operator == (SizeF sz1, SizeF sz2)
+		public static bool operator == (SizeF sz_a, SizeF sz_b)
 		{
-			return ((sz1.Width == sz2.Width) &&
-				(sz1.Height == sz2.Height));
+			return ((sz_a.Width == sz_b.Width) && 
+				(sz_a.Height == sz_b.Height));
 		}
 		
 		/// <summary>
@@ -102,10 +102,10 @@ namespace System.Drawing
 		///	properties of the two Sizes.
 		/// </remarks>
 
-		public static bool operator != (SizeF sz1, SizeF sz2)
+		public static bool operator != (SizeF sz_a, SizeF sz_b)
 		{
-			return ((sz1.Width != sz2.Width) ||
-				(sz1.Height != sz2.Height));
+			return ((sz_a.Width != sz_b.Width) || 
+				(sz_a.Height != sz_b.Height));
 		}
 		
 		/// <summary>
@@ -131,11 +131,12 @@ namespace System.Drawing
 		///	SizeF. Requires explicit cast.
 		/// </remarks>
 
-		public static explicit operator PointF (SizeF size)
+		public static explicit operator PointF (SizeF sz)
 		{
-			return new PointF (size.Width, size.Height);
+			return new PointF (sz.Width, sz.Height);
 		}
 
+
 		// -----------------------
 		// Public Constructors
 		// -----------------------
@@ -162,10 +163,10 @@ namespace System.Drawing
 		///	Creates a SizeF from an existing SizeF value.
 		/// </remarks>
 		
-		public SizeF (SizeF size)
+		public SizeF (SizeF sz)
 		{
-			width = size.Width;
-			height = size.Height;
+			width = sz.Width;
+			height = sz.Height;
 		}
 
 		/// <summary>
@@ -243,12 +244,12 @@ namespace System.Drawing
 		///	Checks equivalence of this SizeF and another object.
 		/// </remarks>
 		
-		public override bool Equals (object obj)
+		public override bool Equals (object o)
 		{
-			if (!(obj is SizeF))
+			if (!(o is SizeF))
 				return false;
 
-			return (this == (SizeF) obj);
+			return (this == (SizeF) o);
 		}
 
 		/// <summary>

+ 79 - 69
mcs/class/System.Drawing/System.Drawing/StringFormat.cs

@@ -32,29 +32,29 @@
 using System.ComponentModel;
 using System.Drawing.Text;
 
-namespace System.Drawing
-{
+namespace System.Drawing {
+
 	public sealed class StringFormat : MarshalByRefObject, IDisposable, ICloneable
 	{
 		private static StringFormat genericDefault;
 		private IntPtr nativeStrFmt = IntPtr.Zero;
-		private int language = GDIPlus.LANG_NEUTRAL;
-
+                private int language = GDIPlus.LANG_NEUTRAL;
+				
 		public StringFormat() : this (0, GDIPlus.LANG_NEUTRAL)
+		{					   
+		}		
+		
+		public StringFormat(StringFormatFlags options, int lang)
 		{
-		}
-
-		public StringFormat(StringFormatFlags options, int language)
-		{
-			Status status = GDIPlus.GdipCreateStringFormat (options, language, out nativeStrFmt);
+			Status status = GDIPlus.GdipCreateStringFormat (options, lang, out nativeStrFmt);        			
 			GDIPlus.CheckStatus (status);
 		}
-
+		
 		internal StringFormat(IntPtr native)
 		{
 			nativeStrFmt = native;
 		}
-
+		
 		~StringFormat ()
 		{	
 			Dispose (false);
@@ -75,29 +75,30 @@ namespace System.Drawing
 			}
 		}
 
-		public StringFormat (StringFormat format)
+		public StringFormat (StringFormat source)
 		{
-			if (format == null)
-				throw new ArgumentNullException ("format");
+			if (source == null)
+				throw new ArgumentNullException ("source");
 
-			Status status = GDIPlus.GdipCloneStringFormat (format.NativeObject, out nativeStrFmt);
+			Status status = GDIPlus.GdipCloneStringFormat (source.NativeObject, out nativeStrFmt);
 			GDIPlus.CheckStatus (status);
 		}
 
-		public StringFormat (StringFormatFlags options)
+		public StringFormat (StringFormatFlags flags)
 		{
-			Status status = GDIPlus.GdipCreateStringFormat (options, GDIPlus.LANG_NEUTRAL, out nativeStrFmt);
-			GDIPlus.CheckStatus (status);
+			Status status = GDIPlus.GdipCreateStringFormat (flags, GDIPlus.LANG_NEUTRAL, out nativeStrFmt);
+			GDIPlus.CheckStatus (status);			
 		}
-
+		
 		public StringAlignment Alignment {
 			get {
-				StringAlignment align;
+                                StringAlignment align;
 				Status status = GDIPlus.GdipGetStringFormatAlign (nativeStrFmt, out align);
 				GDIPlus.CheckStatus (status);
 
-				return align;
+        			return align;
 			}
+
 			set {
 				if ((value < StringAlignment.Near) || (value > StringAlignment.Far))
 					throw new InvalidEnumArgumentException ("Alignment");
@@ -113,25 +114,27 @@ namespace System.Drawing
 				Status status = GDIPlus.GdipGetStringFormatLineAlign (nativeStrFmt, out align);
 				GDIPlus.CheckStatus (status);
 
-				return align;
+                                return align;
 			}
+
 			set {
 				if ((value < StringAlignment.Near) || (value > StringAlignment.Far))
 					throw new InvalidEnumArgumentException ("Alignment");
 
 				Status status = GDIPlus.GdipSetStringFormatLineAlign (nativeStrFmt, value);
 				GDIPlus.CheckStatus (status);
-			}
+        		}
 		}
 
 		public StringFormatFlags FormatFlags {
-			get {
+			get {				
 				StringFormatFlags flags;
 				Status status = GDIPlus.GdipGetStringFormatFlags (nativeStrFmt, out flags);
 				GDIPlus.CheckStatus (status);
 
-				return flags;
+        			return flags;			
 			}
+
 			set {
 				Status status = GDIPlus.GdipSetStringFormatFlags (nativeStrFmt, value);
 				GDIPlus.CheckStatus (status);
@@ -139,13 +142,14 @@ namespace System.Drawing
 		}
 
 		public HotkeyPrefix HotkeyPrefix {
-			get {
+			get {				
 				HotkeyPrefix hotkeyPrefix;
 				Status status = GDIPlus.GdipGetStringFormatHotkeyPrefix (nativeStrFmt, out hotkeyPrefix);
 				GDIPlus.CheckStatus (status);
 
-				return hotkeyPrefix;
+               			return hotkeyPrefix;
 			}
+
 			set {
 				if ((value < HotkeyPrefix.None) || (value > HotkeyPrefix.Hide))
 					throw new InvalidEnumArgumentException ("HotkeyPrefix");
@@ -155,13 +159,15 @@ namespace System.Drawing
 			}
 		}
 
+
 		public StringTrimming Trimming {
 			get {
 				StringTrimming trimming;
 				Status status = GDIPlus.GdipGetStringFormatTrimming (nativeStrFmt, out trimming);
 				GDIPlus.CheckStatus (status);
-				return trimming;
+        			return trimming;
 			}
+
 			set {
 				if ((value < StringTrimming.None) || (value > StringTrimming.EllipsisPath))
 					throw new InvalidEnumArgumentException ("Trimming");
@@ -181,17 +187,19 @@ namespace System.Drawing
 				return new StringFormat (ptr);
 			}
 		}
-
+		
+		
 		public int DigitSubstitutionLanguage {
 			get{
 				return language;
 			}
 		}
 
+		
 		public static StringFormat GenericTypographic {
 			get {
 				IntPtr ptr;
-
+						
 				Status status = GDIPlus.GdipStringFormatGetGenericTypographic (out ptr);
 				GDIPlus.CheckStatus (status);
 	
@@ -199,42 +207,43 @@ namespace System.Drawing
 			}
 		}
 
-		public StringDigitSubstitute  DigitSubstitutionMethod  {
+                public StringDigitSubstitute  DigitSubstitutionMethod  {
 			get {
-				StringDigitSubstitute substitute;
-
-				Status status = GDIPlus.GdipGetStringFormatDigitSubstitution(nativeStrFmt, language, out substitute);
+                                StringDigitSubstitute substitute;
+                                
+                                Status status = GDIPlus.GdipGetStringFormatDigitSubstitution(nativeStrFmt, language, out substitute);
 				GDIPlus.CheckStatus (status);
 
-				return substitute;
+                                return substitute;     
 			}
 		}
 
-		public void SetMeasurableCharacterRanges (CharacterRange [] ranges)
-		{
-			Status status = GDIPlus.GdipSetStringFormatMeasurableCharacterRanges (nativeStrFmt,
-				ranges.Length, ranges);
 
+      		public void SetMeasurableCharacterRanges (CharacterRange [] range)
+		{					
+			Status status = GDIPlus.GdipSetStringFormatMeasurableCharacterRanges (nativeStrFmt, 
+				range.Length,	range);
+				
 			GDIPlus.CheckStatus (status);
 		}
-
+		
 		internal int GetMeasurableCharacterRangeCount () 
 		{
-			int cnt;
+			int cnt;		
 			Status status = GDIPlus.GdipGetStringFormatMeasurableCharacterRangeCount (nativeStrFmt, out cnt);
-
-			GDIPlus.CheckStatus (status);
-			return cnt;
-		}
-
+				
+			GDIPlus.CheckStatus (status);			
+			return cnt;			
+		}			
+			
 		public object Clone()
 		{
 			IntPtr native;
-
+				
 			Status status = GDIPlus.GdipCloneStringFormat (nativeStrFmt, out native);
 			GDIPlus.CheckStatus (status);
 	
-			return new StringFormat (native);
+			return new StringFormat (native);			
 		}
 
 		public override string ToString()
@@ -243,43 +252,44 @@ namespace System.Drawing
 		}
 		
 		internal IntPtr NativeObject
-		{
+                {            
 			get{
 				return nativeStrFmt;
 			}
-			set {
+			set	{
 				nativeStrFmt = value;
 			}
 		}
 
-		public void SetTabStops(float firstTabOffset, float[] tabStops)
-		{
+                public void SetTabStops(float firstTabOffset, float[] tabStops)
+                {
 			Status status = GDIPlus.GdipSetStringFormatTabStops(nativeStrFmt, firstTabOffset, tabStops.Length, tabStops);
 			GDIPlus.CheckStatus (status);
-		}
+                }
 
-		public void SetDigitSubstitution(int language,  StringDigitSubstitute substitute)
-		{
+                public void SetDigitSubstitution(int language,  StringDigitSubstitute substitute)
+                {
 			Status status = GDIPlus.GdipSetStringFormatDigitSubstitution(nativeStrFmt, this.language, substitute);
 			GDIPlus.CheckStatus (status);
-		}
-
-		public float[] GetTabStops(out float firstTabOffset)
-		{
-			int count = 0;
-			firstTabOffset = 0;
-
-			Status status = GDIPlus.GdipGetStringFormatTabStopCount(nativeStrFmt, out count);
+                }
+
+                public float[] GetTabStops(out float firstTabOffset)
+                {
+                        int count = 0;
+                        firstTabOffset = 0;
+                        
+                        Status status = GDIPlus.GdipGetStringFormatTabStopCount(nativeStrFmt, out count);
 			GDIPlus.CheckStatus (status);
 
-			float[] tabStops = new float[count];
-
-			if (count != 0) {
-				status = GDIPlus.GdipGetStringFormatTabStops(nativeStrFmt, count, out firstTabOffset, tabStops);
+                        float[] tabStops = new float[count];                        
+                        
+                        if (count != 0) {                        
+                        	status = GDIPlus.GdipGetStringFormatTabStops(nativeStrFmt, count, out firstTabOffset, tabStops);
 				GDIPlus.CheckStatus (status);
 			}
+                        	
+                        return tabStops;                        
+                }
 
-			return tabStops;
-		}
 	}
 }

+ 24 - 24
mcs/class/System.Drawing/System.Drawing/SystemFonts.cs

@@ -27,10 +27,10 @@
 
 #if NET_2_0
 
-namespace System.Drawing
-{
-	public sealed class SystemFonts
-	{
+namespace System.Drawing {
+
+	public sealed class SystemFonts {
+		
 		static SystemFonts ()
 		{
 		}
@@ -39,66 +39,66 @@ namespace System.Drawing
 		{
 		}
 
-		public static Font GetFontByName (string systemFontName)
+		public static Font GetFontByName (string name)
 		{
-			if (systemFontName == "CaptionFont")
+			if (name == "CaptionFont")
 				return CaptionFont;
 
-			if (systemFontName == "DefaultFont")
+			if (name == "DefaultFont")
 				return DefaultFont;
 
-			if (systemFontName == "DialogFont")
-				return DialogFont;
+			if (name == "DialogFont")
+				return DialogFont;	
 
-			if (systemFontName == "IconTitleFont")
+			if (name == "IconTitleFont")
 				return IconTitleFont;
 
-			if (systemFontName == "MenuFont")
+			if (name == "MenuFont")
 				return MenuFont;
 
-			if (systemFontName == "MessageBoxFont")
+			if (name == "MessageBoxFont")
 				return MessageBoxFont;
 
-			if (systemFontName == "SmallCaptionFont")
+			if (name == "SmallCaptionFont")
 				return SmallCaptionFont;
 
-			if (systemFontName == "StatusFont")
-				return StatusFont;
+			if (name == "StatusFont")
+				return StatusFont;			
 			
 			return null;
 		}
 
-		public static Font CaptionFont {
+		public static Font CaptionFont { 
 			get { return new Font ("Microsoft Sans Serif", 11, "CaptionFont"); }
 		}
 
-		public static Font DefaultFont {
+		public static Font DefaultFont  { 
 			get { return new Font ("Microsoft Sans Serif", 8.25f, "DefaultFont"); }
 		}
 
-		public static Font DialogFont  {
+		public static Font DialogFont  { 
 			get { return new Font ("Tahoma", 8, "DialogFont"); }
 		}
 
-		public static Font IconTitleFont {
+		public static Font IconTitleFont  { 
 			get { return new Font ("Microsoft Sans Serif", 11, "IconTitleFont"); }
 		}
 
-		public static Font MenuFont {
+		public static Font MenuFont  { 
 			get { return new Font ("Microsoft Sans Serif", 11, "MenuFont"); }
 		}
 
-		public static Font MessageBoxFont {
+		public static Font MessageBoxFont  { 
 			get { return new Font ("Microsoft Sans Serif", 11, "MessageBoxFont"); }
 		}
 
-		public static Font SmallCaptionFont {
+		public static Font SmallCaptionFont  { 
 			get { return new Font ("Microsoft Sans Serif", 11, "SmallCaptionFont"); }
 		}
 
-		public static Font StatusFont {
+		public static Font StatusFont  { 
 			get { return new Font ("Microsoft Sans Serif", 11, "StatusFont"); }
-		}
+		}	      
 	}
 }
 

+ 6 - 6
mcs/class/System.Drawing/System.Drawing/TextureBrush.cs

@@ -33,17 +33,17 @@ using System.ComponentModel;
 using System.Drawing.Drawing2D;
 using System.Drawing.Imaging;
 
-namespace System.Drawing
-{
-	public sealed class TextureBrush : Brush
-	{
+namespace System.Drawing {
+
+	public sealed class TextureBrush : Brush {
+
 		internal TextureBrush (IntPtr ptr) :
 			base (ptr)
 		{
 		}
 
-		public TextureBrush (Image bitmap) :
-			this (bitmap, WrapMode.Tile)
+		public TextureBrush (Image image) :
+			this (image, WrapMode.Tile)
 		{
 		}