Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
More work to get the test MainSoft suite running
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Apr 19, 2012
1 parent 29710e9 commit a21fd31
Show file tree
Hide file tree
Showing 11 changed files with 774 additions and 10 deletions.
62 changes: 61 additions & 1 deletion System.Drawing.Drawing2D/GraphicsPath.cs
Expand Up @@ -453,7 +453,47 @@ public void AddLine (PointF pt1, PointF pt2)
Append (pt1.X, pt1.Y, PathPointType.Line, true); Append (pt1.X, pt1.Y, PathPointType.Line, true);
Append (pt2.X, pt2.Y, PathPointType.Line, false); Append (pt2.X, pt2.Y, PathPointType.Line, false);
} }


public void AddLines (Point [] points)
{
if (points == null)
throw new ArgumentNullException ("points");
if (points.Length == 0)
throw new ArgumentException ("points");

/* only the first point can be compressed (i.e. removed if identical to previous) */
for (int i = 0, count = points.Length; i < count; i++)
Append (points [i].X, points [i].Y, PathPointType.Line, (i == 0));
}

public void AddLines (PointF [] points)
{
if (points == null)
throw new ArgumentNullException ("points");
if (points.Length == 0)
throw new ArgumentException ("points");

/* only the first point can be compressed (i.e. removed if identical to previous) */
for (int i = 0, count = points.Length; i < count; i++)
Append (points [i].X, points [i].Y, PathPointType.Line, (i == 0));
}

public void AddRectangle (Rectangle rect)
{
Append (rect.X, rect.Y, PathPointType.Start, false);
Append (rect.Right, rect.Y, PathPointType.Start, false);
Append (rect.Right, rect.Bottom, PathPointType.Start, false);
Append (rect.X, rect.Y, PathPointType.Start, false);
}

public void AddRectangle (RectangleF rect)
{
Append (rect.X, rect.Y, PathPointType.Start, false);
Append (rect.Right, rect.Y, PathPointType.Start, false);
Append (rect.Right, rect.Bottom, PathPointType.Start, false);
Append (rect.X, rect.Y, PathPointType.Start, false);
}

public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle) public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
{ {
float sin_alpha, cos_alpha; float sin_alpha, cos_alpha;
Expand Down Expand Up @@ -500,6 +540,26 @@ public void AddPie(int x, int y, int width, int height, float startAngle, float
{ {
AddPie (x, y, width, height, startAngle, sweepAngle); AddPie (x, y, width, height, startAngle, sweepAngle);
} }

public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
{
AppendArcs (rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
}

public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
{
AppendArcs (rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
}

public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
{
AppendArcs (x, y, width, height, start_angle, sweep_angle);
}

public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
{
AppendArcs (x, y, width, height, start_angle, sweep_angle);
}


internal static PointF [] OpenCurveTangents (int terms, PointF [] points, int count, float tension) internal static PointF [] OpenCurveTangents (int terms, PointF [] points, int count, float tension)
{ {
Expand Down
9 changes: 9 additions & 0 deletions System.Drawing.Drawing2D/GraphicsState.cs
@@ -0,0 +1,9 @@
using System;

namespace System.Drawing.Drawing2D
{
public class GraphicsState {

}
}

22 changes: 22 additions & 0 deletions System.Drawing.Imaging/ImageAttributes.cs
@@ -0,0 +1,22 @@
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;

namespace System.Drawing.Imaging {

[StructLayout(LayoutKind.Sequential)]
public sealed class ImageAttributes : ICloneable, IDisposable {
#region ICloneable implementation
public object Clone ()
{
throw new NotImplementedException ();
}
#endregion

#region IDisposable implementation
public void Dispose ()
{
throw new NotImplementedException ();
}
#endregion
}
}
1 change: 1 addition & 0 deletions System.Drawing/Bitmap.cs
Expand Up @@ -138,5 +138,6 @@ public void UnlockBits (BitmapData data)
{ {
throw new NotImplementedException (); throw new NotImplementedException ();
} }

} }
} }
97 changes: 97 additions & 0 deletions System.Drawing/Font.cs
@@ -0,0 +1,97 @@
using System;
using System.Runtime.Serialization;

namespace System.Drawing
{

public sealed class Font : MarshalByRefObject, ISerializable, ICloneable, IDisposable {
const byte DefaultCharSet = 1;

public Font (FontFamily family, float emSize, GraphicsUnit unit)
: this (family, emSize, FontStyle.Regular, unit, DefaultCharSet, false)
{
}

public Font (string familyName, float emSize, GraphicsUnit unit)
: this (new FontFamily (familyName), emSize, FontStyle.Regular, unit, DefaultCharSet, false)
{
}

public Font (FontFamily family, float emSize)
: this (family, emSize, FontStyle.Regular, GraphicsUnit.Point, DefaultCharSet, false)
{
}

public Font (FontFamily family, float emSize, FontStyle style)
: this (family, emSize, style, GraphicsUnit.Point, DefaultCharSet, false)
{
}

public Font (FontFamily family, float emSize, FontStyle style, GraphicsUnit unit)
: this (family, emSize, style, unit, DefaultCharSet, false)
{
}

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 gdiCharSet, bool gdiVerticalFont)
{
if (family == null)
throw new ArgumentNullException ("family");

throw new NotImplementedException ();
}

public Font (string familyName, float emSize)
: this (familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, DefaultCharSet, false)
{
}

public Font (string familyName, float emSize, FontStyle style)
: this (familyName, emSize, style, GraphicsUnit.Point, DefaultCharSet, false)
{
}

public Font (string familyName, float emSize, FontStyle style, GraphicsUnit unit)
: this (familyName, emSize, style, unit, DefaultCharSet, false)
{
}

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 gdiCharSet, bool gdiVerticalFont )
{
throw new NotImplementedException ();
}

#region ISerializable implementation
public void GetObjectData (SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException ();
}
#endregion

#region ICloneable implementation
public object Clone ()
{
throw new NotImplementedException ();
}
#endregion

#region IDisposable implementation
public void Dispose ()
{
throw new NotImplementedException ();
}
#endregion
}
}

0 comments on commit a21fd31

Please sign in to comment.