dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing .cvsignore,NONE,1.1 B


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing .cvsignore,NONE,1.1 Bitmap.cs,NONE,1.1 Brush.cs,NONE,1.1 Brushes.cs,NONE,1.1 CharacterRange.cs,NONE,1.1 Color.cs,NONE,1.1 ColorConverter.cs,NONE,1.1 ColorTranslator.cs,NONE,1.1 ContentAlignment.cs,NONE,1.1 Font.cs,NONE,1.1 FontConverter.cs,NONE,1.1 FontFamily.cs,NONE,1.1 FontStyle.cs,NONE,1.1 Graphics.cs,NONE,1.1 GraphicsUnit.cs,NONE,1.1 Icon.cs,NONE,1.1 Image.cs,NONE,1.1 KnownColor.cs,NONE,1.1 Makefile.am,NONE,1.1 Pen.cs,NONE,1.1 Point.cs,NONE,1.1 PointF.cs,NONE,1.1 Rectangle.cs,NONE,1.1 RectangleF.cs,NONE,1.1 Region.cs,NONE,1.1 RotateFlipType.cs,NONE,1.1 S.cs,NONE,1.1 Size.cs,NONE,1.1 SizeF.cs,NONE,1.1 SolidBrush.cs,NONE,1.1 StringAlignment.cs,NONE,1.1 StringDigitSubstitute.cs,NONE,1.1 StringFormat.cs,NONE,1.1 StringFormatFlags.cs,NONE,1.1 StringTrimming.cs,NONE,1.1 StringUnit.cs,NONE,1.1 System.Drawing.build,NONE,1.1 SystemBrushes.cs,NONE,1.1 SystemColors.cs,NONE,1.1 TODOAttribute.cs,NONE,1.1
Date: Sat, 07 Jun 2003 18:41:00 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing
In directory subversions:/tmp/cvs-serv12618/System.Drawing

Added Files:
        .cvsignore Bitmap.cs Brush.cs Brushes.cs CharacterRange.cs 
        Color.cs ColorConverter.cs ColorTranslator.cs 
        ContentAlignment.cs Font.cs FontConverter.cs FontFamily.cs 
        FontStyle.cs Graphics.cs GraphicsUnit.cs Icon.cs Image.cs 
        KnownColor.cs Makefile.am Pen.cs Point.cs PointF.cs 
        Rectangle.cs RectangleF.cs Region.cs RotateFlipType.cs S.cs 
        Size.cs SizeF.cs SolidBrush.cs StringAlignment.cs 
        StringDigitSubstitute.cs StringFormat.cs StringFormatFlags.cs 
        StringTrimming.cs StringUnit.cs System.Drawing.build 
        SystemBrushes.cs SystemColors.cs TODOAttribute.cs 
Log Message:


Add the "System.Drawing" and "System.Drawing.Xsharp" assemblies.


--- NEW FILE ---
Makefile
Makefile.in
.deps
*.dll

--- NEW FILE ---
/*
 * Bitmap.cs - Implementation of the "System.Drawing.Bitmap" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Drawing.Imaging;
using System.Drawing.Design;
using System.ComponentModel;

[Serializable]
[ComVisible(true)]
[Editor("System.Drawing.Design.BitmapEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
public sealed class Bitmap : Image
{
        // Constructors.
        [TODO]
        public Bitmap(Image original)
                        {
                                // TODO
                        }
        [TODO]
        public Bitmap(Image original, Size newSize)
                        {
                                // TODO
                        }
        public Bitmap(Stream stream) : this(stream, false) {}
        [TODO]
        public Bitmap(Stream stream, bool useIcm)
                        {
                                // TODO
                        }
        public Bitmap(String filename) : this(filename, false) {}
        [TODO]
        public Bitmap(String filename, bool useIcm)
                        {
                                // TODO
                        }
        public Bitmap(int width, int height)
                        : this(width, height, PixelFormat.Format32bppArgb) {}
        [TODO]
        public Bitmap(int width, int height, PixelFormat format)
                        {
                                // TODO
                        }
        [TODO]
        public Bitmap(int width, int height, Graphics g)
                        {
                                // TODO
                        }
        [TODO]
        public Bitmap(Type type, String resource)
                        {
                                // TODO
                        }
        [TODO]
        public Bitmap(Image original, int width, int height)
                        {
                                // TODO
                        }
        [TODO]
        public Bitmap(int width, int height, int stride,
                                  PixelFormat format, IntPtr scan0)
                        {
                                // TODO
                        }
        internal Bitmap(SerializationInfo info, StreamingContext context)
                        : base(info, context) {}

        // Clone this bitmap and transform it into a new pixel format
        [TODO]
        public Bitmap Clone(Rectangle rect, PixelFormat format)
                        {
                                // TODO
                                return null;
                        }
        [TODO]
        public Bitmap Clone(RectangleF rect, PixelFormat format)
                        {
                                // TODO
                                return null;
                        }

        // Create a bitmap from a native icon handle.
        [TODO]
        public static Bitmap FromHicon(IntPtr hicon)
                        {
                                // TODO
                                return null;
                        }

        // Create a bitmap from a Windows resource name.
        [TODO]
        public static Bitmap FromResource(IntPtr hinstance, String bitmapName)
                        {
                                // TODO
                                return null;
                        }

        // Convert this bitmap into a native bitmap handle.
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public IntPtr GetHbitmap()
                        {
                                return GetHbitmap(Color.LightGray);
                        }
        [TODO]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public IntPtr GetHbitmap(Color background)
                        {
                                // TODO
                                return IntPtr.Zero;
                        }

        // Convert this bitmap into a native icon handle.
        [TODO]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public IntPtr GetHicon()
                        {
                                // TODO
                                return IntPtr.Zero;
                        }

        // Get the color of a specific pixel.
        [TODO]
        public Color GetPixel(int x, int y)
                        {
                                // TODO
                                return Color.Empty;
                        }

        // Lock a region of this bitmap.
        [TODO]
        public BitmapData LockBits(Rectangle rect, ImageLockMode flags,
                                                           PixelFormat format)
                        {
                                // TODO
                                return null;
                        }

        // Make a particular color transparent within this bitmap.
        public void MakeTransparent()
                        {
                                MakeTransparent(Color.LightGray);
                        }
        [TODO]
        public void MakeTransparent(Color transparentColor)
                        {
                                // TODO
                        }

        // Set a pixel within this bitmap.
        [TODO]
        public void SetPixel(int x, int y, Color color)
                        {
                                // TODO
                        }

        // Set the resolution for this bitmap.
        public void SetResolution(float dpiX, float dpiY)
                        {
                                horizontalResolution = dpiX;
                                verticalResolution = dpiY;
                        }

        // Unlock the bits within this bitmap.
        [TODO]
        public void UnlockBits(BitmapData bitmapData)
                        {
                                // TODO
                        }

}; // class Bitmap

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Brush.cs - Implementation of the "System.Drawing.Brush" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Drawing.Toolkit;

public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable
{
        // Internal state.
        private IToolkit toolkit;
        private IToolkitBrush toolkitBrush;

        // Constructor.
        internal Brush()
                        {
                                toolkit = null;
                                toolkitBrush = null;
                        }

        // Destructor.
        ~Brush()
                        {
                                Dispose(false);
                        }

        // Clone this brush.
        public abstract Object Clone();

        // Dispose of this brush.
        public void Dispose()
                        {
                                Dispose(true);
                                GC.SuppressFinalize(this);
                        }
        protected virtual void Dispose(bool disposing)
                        {
                                lock(this)
                                {
                                        if(toolkitBrush != null)
                                        {
                                                toolkitBrush.Dispose();
                                                toolkitBrush = null;
                                        }
                                }
                        }

        // Mark this brush as modified, and flush all previous brush 
information.
        // Used when a subclass modifies a brush's properties.
        internal void Modified()
                        {
                                lock(this)
                                {
                                        if(toolkitBrush != null)
                                        {
                                                toolkitBrush.Dispose();
                                                toolkitBrush = null;
                                        }
                                        toolkit = null;
                                }
                        }

        // Get the toolkit version of this brush for a specific toolkit.
        internal IToolkitBrush GetBrush(IToolkit toolkit)
                        {
                                lock(this)
                                {
                                        if(this.toolkitBrush == null)
                                        {
                                                // We don't yet have a toolkit 
brush yet.
                                                this.toolkitBrush = 
CreateBrush(toolkit);
                                                this.toolkit = toolkit;
                                                return this.toolkitBrush;
                                        }
                                        else if(this.toolkit == toolkit)
                                        {
                                                // Same toolkit - return the 
cached brush information.
                                                return this.toolkitBrush;
                                        }
                                        else
                                        {
                                                // We have a brush for another 
toolkit,
                                                // so dispose it and create for 
this toolkit.
                                                // We null out "toolkitBrush" 
before calling
                                                // "CreateBrush()" just in case 
an exception
                                                // is thrown while creating the 
toolkit brush.
                                                this.toolkitBrush.Dispose();
                                                this.toolkitBrush = null;
                                                this.toolkitBrush = 
CreateBrush(toolkit);
                                                this.toolkit = toolkit;
                                                return this.toolkitBrush;
                                        }
                                }
                        }

        // Create this brush for a specific toolkit.  Inner part of 
"GetBrush()".
        internal virtual IToolkitBrush CreateBrush(IToolkit toolkit)
                        {
                                // Normally overridden in subclasses.
                                throw new InvalidOperationException();
                        }

}; // class Brush

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Brushes.cs - Implementation of the "System.Drawing.Brushes" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
[...981 lines suppressed...]
                                }
                        }
        public static Brush Yellow
                        {
                                get
                                {
                                        return new SolidBrush(Color.Yellow);
                                }
                        }
        public static Brush YellowGreen
                        {
                                get
                                {
                                        return new 
SolidBrush(Color.YellowGreen);
                                }
                        }

}; // class Brushes

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * CharacterRange.cs - Implementation of the
 *                      "System.Drawing.CharacterRange" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public struct CharacterRange
{
        // Internal state.
        private int first;
        private int length;

        // Constructor.
        public CharacterRange(int First, int Length)
                        {
                                first = First;
                                length = Length;
                        }

        // Get or set the properties.
        public int First
                        {
                                get
                                {
                                        return first;
                                }
                                set
                                {
                                        first = value;
                                }
                        }
        public int Length
                        {
                                get
                                {
                                        return length;
                                }
                                set
                                {
                                        length = value;
                                }
                        }

}; // struct CharacterRange
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Color.cs - Implementation of the "System.Drawing.Color" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
[...1601 lines suppressed...]
                                }
                        }
        public static Color Yellow
                        {
                                get
                                {
                                        return new Color(KnownColor.Yellow);
                                }
                        }
        public static Color YellowGreen
                        {
                                get
                                {
                                        return new 
Color(KnownColor.YellowGreen);
                                }
                        }

}; // struct Color
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * ColorConverter.cs - Implementation of the
 *                      "System.Drawing.Printing.ColorConverter" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.ComponentModel;
using System.Globalization;
using System.Collections;

public class ColorConverter : TypeConverter
{
        // Constructor.
        public ColorConverter() {}

        // Determine if we can convert from a given type to "Color".
        public override bool CanConvertFrom
                                (ITypeDescriptorContext context, Type 
sourceType)
                        {
                                if(sourceType == typeof(String))
                                {
                                        return true;
                                }
                                else
                                {
                                        return base.CanConvertFrom(context, 
sourceType);
                                }
                        }

        // Determine if we can convert to a given type from "Color".
        [TODO]
        public override bool CanConvertTo
                                (ITypeDescriptorContext context, Type 
destinationType)
                        {
                                // TODO
                                return base.CanConvertTo(context, 
destinationType);
                        }

        // Convert from a source type to "Color".
        [TODO]
        public override Object ConvertFrom
                                (ITypeDescriptorContext context,
                                 CultureInfo culture, Object value)
                        {
                                // TODO
                                return null;
                        }

        // Convert from "Color" to a destination type.
        [TODO]
        public override Object ConvertTo
                                (ITypeDescriptorContext context,
                                 CultureInfo culture, Object value,
                                 Type destinationType)
                        {
                                // TODO
                                return null;
                        }

        // Return a collection of standard values for this data type.
        [TODO]
        public override TypeConverter.StandardValuesCollection GetStandardValues
                                (ITypeDescriptorContext context)
                        {
                                // TODO
                                return null;
                        }

        // Determine if "GetStandardValues" is supported.
        public override bool GetStandardValuesSupported
                                (ITypeDescriptorContext context)
                        {
                                return true;
                        }

}; // class ColorConverter

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * ColorTranslator.cs - Implementation of the
 *                      "System.Drawing.Printing.ColorTranslator" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public sealed class ColorTranslator
{
        // Convert OLE system color indicators into KnownColor values.
        private static readonly KnownColor[] oleKnownColors = {
                                KnownColor.ScrollBar,
                                KnownColor.Desktop,
                                KnownColor.ActiveCaption,
                                KnownColor.InactiveCaption,
                                KnownColor.Menu,
                                KnownColor.Window,
                                KnownColor.WindowFrame,
                                KnownColor.MenuText,
                                KnownColor.WindowText,
                                KnownColor.ActiveCaptionText,
                                KnownColor.ActiveBorder,
                                KnownColor.InactiveBorder,
                                KnownColor.AppWorkspace,
                                KnownColor.Highlight,
                                KnownColor.HighlightText,
                                KnownColor.Control,
                                KnownColor.ControlDark,
                                KnownColor.GrayText,
                                KnownColor.ControlText,
                                KnownColor.InactiveCaptionText,
                                KnownColor.ControlLightLight,
                                KnownColor.ControlDarkDark,
                                KnownColor.ControlLight,
                                KnownColor.InfoText,
                                KnownColor.Info,
                        };

        // Convert KnownColor values into OLE system color indicators.
        private static readonly uint[] oleSystemColors = {
                                0x8000000a, 0x80000002, 0x80000009, 0x8000000c,
                                0x8000000f, 0x80000010, 0x80000015, 0x80000016,
                                0x80000014, 0x80000012, 0x80000001, 0x80000011,
                                0x8000000d, 0x8000000e, 0x8000000d, 0x8000000b,
                                0x80000003, 0x80000013, 0x80000018, 0x80000017,
                                0x80000004, 0x80000007, 0x80000000, 0x80000005,
                                0x80000006, 0x80000008
                        };

        // This class cannot be instantiated.
        private ColorTranslator() {}

        // Transform a HTML color name into a "Color" value.
        [TODO]
        public static Color FromHtml(String htmlColor)
                        {
                                // TODO
                                return Color.Empty;
                        }

        // Transform an OLE color value into a "Color" value.
        public static Color FromOle(int oleColor)
                        {
                                return FromWin32(oleColor);
                        }

        // Transform a Win32 color value into a "Color" value.
        // This also understands system color indicators, for compatibility.
        public static Color FromWin32(int win32Color)
                        {
                                if((win32Color & (int)0xFF000000) != 
(int)0x80000000)
                                {
                                        return Color.FromArgb(win32Color & 0xFF,
                                                                              
(win32Color >> 8) & 0xFF,
                                                                              
(win32Color >> 16) & 0xFF);
                                }
                                else
                                {
                                        int sysColor = ((win32Color >> 24) & 
0xFF);
                                        if(sysColor >= 0 && sysColor < 
oleKnownColors.Length)
                                        {
                                                return new 
Color(oleKnownColors[sysColor]);
                                        }
                                        else
                                        {
                                                return Color.Empty;
                                        }
                                }
                        }

        // Convert a "Color" value into a HTML color name.
        [TODO]
        public static String ToHtml(Color color)
                        {
                                // TODO
                                return null;
                        }

        // Convert a "Color" value into an OLE color value.
        public static int ToOle(Color color)
                        {
                                if(color.IsKnownColor)
                                {
                                        int value = (int)(color.ToKnownColor());
                                        if(value >= 1 && value <= 
oleSystemColors.Length)
                                        {
                                                return 
(int)(oleSystemColors[value - 1]);
                                        }
                                }
                                return ToWin32(color);
                        }

        // Convert a "Color" value into a Win32 color value.
        // This does not support system color indicators, for compatibility.
        public static int ToWin32(Color color)
                        {
                                return (color.R | (color.G << 8) | (color.B << 
16));
                        }

}; // class ColorTranslator

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * ContentAlignment.cs - Implementation of the
 *                      "System.Drawing.ContentAlignment" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.ComponentModel;
using System.Drawing.Design;

#if CONFIG_COMPONENT_MODEL
[Editor("System.Drawing.Design.ContentAlignmentEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
#endif
public enum ContentAlignment
{
        TopLeft                 = 0x0001,
        TopCenter               = 0x0002,
        TopRight                = 0x0004,
        MiddleLeft              = 0x0010,
        MiddleCenter    = 0x0020,
        MiddleRight             = 0x0040,
        BottomLeft              = 0x0100,
        BottomCenter    = 0x0200,
        BottomRight             = 0x0400

}; // enum ContentAlignment

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Font.cs - Implementation of the "System.Drawing.Font" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Drawing.Toolkit;
using System.ComponentModel;
using System.Drawing.Design;

#if CONFIG_COMPONENT_MODEL
[Editor("System.Drawing.Design.FontEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
[TypeConverter(typeof(FontConverter))]
#endif
[Serializable]
[ComVisible(true)]
public sealed class Font : MarshalByRefObject, ISerializable,
                                                   ICloneable, IDisposable
{
        // Internal state.
        private IToolkit toolkit;
        private IToolkitFont toolkitFont;
        private FontFamily fontFamily;
        private FontStyle fontStyle;
        private byte gdiCharSet;
        private bool gdiVerticalFont;
        private float size;
        private GraphicsUnit unit;

        // Constructors.
        public Font(Font prototype, FontStyle newStyle)
                        : this(prototype.FontFamily, prototype.Size, newStyle,
                                   prototype.Unit, prototype.GdiCharSet,
                                   prototype.GdiVerticalFont) {}
        public Font(FontFamily family, float emSize)
                        : this(family, emSize, FontStyle.Regular,
                               GraphicsUnit.Point, 1, false) {}
        public Font(FontFamily family, float emSize, FontStyle style)
                        : this(family, emSize, style, GraphicsUnit.Point, 1, 
false) {}
        public Font(FontFamily family, float emSize, GraphicsUnit unit)
                        : this(family, emSize, FontStyle.Regular, unit, 1, 
false) {}
        public Font(FontFamily family, float emSize, FontStyle style,
                                GraphicsUnit unit)
                        : this(family, emSize, style, unit, 1, false) {}
        public Font(FontFamily family, float emSize, FontStyle style,
                                GraphicsUnit unit, byte gdiCharSet)
                        : this(family, emSize, style, unit, gdiCharSet, false) 
{}
        public Font(String familyName, float emSize)
                        : this(new FontFamily(familyName), emSize,
                               FontStyle.Regular, GraphicsUnit.Point, 1, false) 
{}
        public Font(String familyName, float emSize, FontStyle style)
                        : this(new FontFamily(familyName), emSize,
                               style, GraphicsUnit.Point, 1, false) {}
        public Font(String familyName, float emSize, GraphicsUnit unit)
                        : this(new FontFamily(familyName), emSize,
                               FontStyle.Regular, unit, 1, false) {}
        public Font(String familyName, float emSize, FontStyle style,
                                GraphicsUnit unit)
                        : this(new FontFamily(familyName), emSize,
                               style, unit, 1, false) {}
        public Font(String familyName, float emSize, FontStyle style,
                                GraphicsUnit unit, byte gdiCharSet)
                        : this(new FontFamily(familyName), emSize,
                               style, unit, gdiCharSet, false) {}
        public Font(String familyName, float emSize, FontStyle style,
                                GraphicsUnit unit, byte gdiCharSet, bool 
gdiVerticalFont)
                        : this(new FontFamily(familyName), emSize,
                               style, unit, gdiCharSet, gdiVerticalFont) {}
        public Font(FontFamily family, float emSize, FontStyle style,
                                GraphicsUnit unit, byte gdiCharSet, bool 
gdiVerticalFont)
                        {
                                if(family == null)
                                {
                                        throw new 
ArgumentNullException("family");
                                }
                                this.fontFamily = family;
                                this.size = emSize;
                                this.fontStyle = style;
                                this.unit = unit;
                                this.gdiCharSet = gdiCharSet;
                                this.gdiVerticalFont = gdiVerticalFont;
                        }
        internal Font(SerializationInfo info, StreamingContext context)
                        {
                                if(info == null)
                                {
                                        throw new ArgumentNullException("info");
                                }
                                fontFamily = new 
FontFamily(info.GetString("Name"));
                                size = info.GetSingle("Size");
                                fontStyle = (FontStyle)info.GetValue
                                        ("Style", typeof(FontStyle));
                                unit = (GraphicsUnit)info.GetValue
                                        ("Unit", typeof(GraphicsUnit));
                                gdiCharSet = 1;
                                gdiVerticalFont = false;
                        }

        // Destructor.
        ~Font()
                        {
                                Dispose();
                        }

        // Font properties.
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public bool Bold
                        {
                                get
                                {
                                        return ((fontStyle & FontStyle.Bold) != 
0);
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        [Browsable(false)]
#endif
        public FontFamily FontFamily
                        {
                                get
                                {
                                        return fontFamily;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public byte GdiCharSet
                        {
                                get
                                {
                                        return gdiCharSet;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public bool GdiVerticalFont
                        {
                                get
                                {
                                        return gdiVerticalFont;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        [Browsable(false)]
#endif
        public int Height
                        {
                                get
                                {
                                        // TODO: convert "Size" into the 
expected value.
                                        return 0;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public bool Italic
                        {
                                get
                                {
                                        return ((fontStyle & FontStyle.Italic) 
!= 0);
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [Editor("System.Drawing.Design.FontNameEditor, System.Drawing.Design",
                        typeof(UITypeEditor))]
        [TypeConverter(typeof(FontConverter.FontNameConverter))]
#endif
        public String Name
                        {
                                get
                                {
                                        // TODO: get from fontFamily object.
                                        return null;
                                }
                        }
        public float Size
                        {
                                get
                                {
                                        return size;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        [Browsable(false)]
#endif
        public float SizeInPoints
                        {
                                get
                                {
                                        // TODO: convert "Size" into the 
expected value.
                                        return 0.0f;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public bool Strikeout
                        {
                                get
                                {
                                        return ((fontStyle & 
FontStyle.Strikeout) != 0);
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        [Browsable(false)]
#endif
        public FontStyle Style
                        {
                                get
                                {
                                        return fontStyle;
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#endif
        public bool Underline
                        {
                                get
                                {
                                        return ((fontStyle & 
FontStyle.Underline) != 0);
                                }
                        }
#if CONFIG_COMPONENT_MODEL
        [TypeConverter(typeof(FontConverter.FontUnitConverter))]
#endif
        public GraphicsUnit Unit
                        {
                                get
                                {
                                        return unit;
                                }
                        }

        // Clone this object.
        public Object Clone()
                        {
                                lock(this)
                                {
                                        Font font = (Font)(MemberwiseClone());
                                        font.toolkit = null;
                                        font.toolkitFont = null;
                                        return font;
                                }
                        }

        // Dispose of this object.
        public void Dispose()
                        {
                                lock(this)
                                {
                                        if(toolkitFont != null)
                                        {
                                                toolkitFont.Dispose();
                                                toolkitFont = null;
                                        }
                                        toolkit = null;
                                }
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object obj)
                        {
                                Font other = (obj as Font);
                                if(other != null)
                                {
                                        return (other.Name == Name &&
                                                        other.Size == Size &&
                                                        other.Style == Style &&
                                                        other.GdiCharSet == 
GdiCharSet &&
                                                        other.GdiVerticalFont 
== GdiVerticalFont);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return Name.GetHashCode() + (((int)size) << 4) +
                                       (int)fontStyle;
                        }

        // Extract the active font from a native device context.
        [TODO]
        public static Font FromHdc(IntPtr hdc)
                        {
                                // TODO
                                return null;
                        }

        // Convert a native font handle into a font object.
        [TODO]
        public static Font FromHfont(IntPtr hfont)
                        {
                                // TODO
                                return null;
                        }

        // Convert a native logical font descriptor into a font object.
        public static Font FromLogFont(Object lf)
                        {
                                return FromLogFont(lf, IntPtr.Zero);
                        }
        [TODO]
        public static Font FromLogFont(Object lf, IntPtr hdc)
                        {
                                // TODO
                                return null;
                        }

        // Get the height of this font.
        [TODO]
        public float GetHeight()
                        {
                                // TODO
                                return 0.0f;
                        }
        [TODO]
        public float GetHeight(Graphics graphics)
                        {
                                // TODO
                                return 0.0f;
                        }
        [TODO]
        public float GetHeight(float dpi)
                        {
                                // TODO
                                return 0.0f;
                        }

        // Convert this object into a native font handle.
        [TODO]
        public IntPtr ToHfont()
                        {
                                // TODO
                                return IntPtr.Zero;
                        }

        // Fill in a native font information structure with info about this 
font.
        public void ToLogFont(Object lf)
                        {
                                ToLogFont(lf, null);
                        }
        [TODO]
        public void ToLogFont(Object lf, Graphics graphics)
                        {
                                // TODO
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                StringBuilder builder = new StringBuilder();
                                builder.Append("[Font: Name=");
                                builder.Append(Name);
                                builder.Append(" Size=");
                                builder.Append(Size);
                                builder.Append(" Units=");
                                builder.Append((int)Unit);
                                builder.Append(" GdiCharSet=");
                                builder.Append(GdiCharSet);
                                builder.Append(" GdiVerticalFont=");
                                builder.Append(GdiVerticalFont);
                                builder.Append("]");
                                return builder.ToString();
                        }

        // Get the serialization information for this object.
        void ISerializable.GetObjectData(SerializationInfo info,
                                                                         
StreamingContext context)
                        {
                                if(info == null)
                                {
                                        throw new ArgumentNullException("info");
                                }
                                info.AddValue("Name", Name);
                                info.AddValue("Size", Size);
                                info.AddValue("Style", Style);
                                info.AddValue("Unit", Unit);
                        }

        // Get the toolkit version of this font for a specific toolkit.
        internal IToolkitFont GetFont(IToolkit toolkit)
                        {
                                lock(this)
                                {
                                        if(this.toolkitFont == null)
                                        {
                                                // We don't yet have a toolkit 
font yet.
                                                this.toolkitFont = 
toolkit.CreateFont(this);
                                                this.toolkit = toolkit;
                                                return this.toolkitFont;
                                        }
                                        else if(this.toolkit == toolkit)
                                        {
                                                // Same toolkit - return the 
cached pen information.
                                                return this.toolkitFont;
                                        }
                                        else
                                        {
                                                // We have a font object for 
another toolkit,
                                                // so dispose it and create for 
this toolkit.
                                                // We null out "toolkitFont" 
before calling
                                                // "CreateFont()" just in case 
an exception
                                                // is thrown while creating the 
toolkit font.
                                                this.toolkitFont.Dispose();
                                                this.toolkitFont = null;
                                                this.toolkitFont = 
toolkit.CreateFont(this);
                                                this.toolkit = toolkit;
                                                return this.toolkitFont;
                                        }
                                }
                        }

}; // class Font

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * FontConverter.cs - Implementation of the
 *                      "System.Drawing.Printing.FontConverter" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.ComponentModel;
using System.Globalization;
using System.Collections;

public class FontConverter : TypeConverter
{
        // Constructor.
        public FontConverter() {}

        // Determine if we can convert from a given type to "Font".
        public override bool CanConvertFrom
                                (ITypeDescriptorContext context, Type 
sourceType)
                        {
                                if(sourceType == typeof(String))
                                {
                                        return true;
                                }
                                else
                                {
                                        return base.CanConvertFrom(context, 
sourceType);
                                }
                        }

        // Determine if we can convert to a given type from "Font".
        [TODO]
        public override bool CanConvertTo
                                (ITypeDescriptorContext context, Type 
destinationType)
                        {
                                // TODO
                                return base.CanConvertTo(context, 
destinationType);
                        }

        // Convert from a source type to "Font".
        [TODO]
        public override Object ConvertFrom
                                (ITypeDescriptorContext context,
                                 CultureInfo culture, Object value)
                        {
                                // TODO
                                return null;
                        }

        // Convert from "Font" to a destination type.
        [TODO]
        public override Object ConvertTo
                                (ITypeDescriptorContext context,
                                 CultureInfo culture, Object value,
                                 Type destinationType)
                        {
                                // TODO
                                return null;
                        }

        // Create an object instance given a set of property values.
        [TODO]
        public override Object CreateInstance
                                (ITypeDescriptorContext context, IDictionary 
propertyValues)
                        {
                                // TODO
                                return null;
                        }

        // Determine if "CreateInstance" is supported.
        public override bool GetCreateInstanceSupported
                                (ITypeDescriptorContext context)
                        {
                                return true;
                        }

        // Retrieve a set of properties for this type.
        [TODO]
        public override PropertyDescriptorCollection GetProperties
                                (ITypeDescriptorContext context,
                                 Object value, Attribute[] attributes)
                        {
                                // TODO
                                return null;
                        }

        // Determine if "GetProperties" is supported.
        public override bool GetPropertiesSupported
                                (ITypeDescriptorContext context)
                        {
                                return true;
                        }

        // Type converter for font units.
        [TODO]
        public class FontUnitConverter
        {
                // TODO

        }; // class FontUnitConverter

        // Type converter for font names.
        [TODO]
        public class FontNameConverter
        {
                // TODO

        }; // class FontNameConverter

}; // class FontConverter

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * FontFamily.cs - Implementation of the "System.Drawing.FontFamily" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Drawing.Text;

public sealed class FontFamily : MarshalByRefObject, IDisposable
{
        // Internal state.
        private GenericFontFamilies genericFamily;
        private String name;
        private FontCollection fontCollection;

        // Constructors.
        public FontFamily(GenericFontFamilies genericFamily)
                        {
                                this.genericFamily = genericFamily;
                                this.fontCollection = null;
                                switch(genericFamily)
                                {
                                        case GenericFontFamilies.Serif:
                                        default:
                                        {
                                                this.name = "Times New Roman";
                                        }
                                        break;

                                        case GenericFontFamilies.SansSerif:
                                        {
                                                this.name = "Arial";
                                        }
                                        break;

                                        case GenericFontFamilies.Monospace:
                                        {
                                                this.name = "Courier New";
                                        }
                                        break;
                                }
                        }
        public FontFamily(String name) : this(name, null) {}
        public FontFamily(String name, FontCollection fontCollection)
                        {
                                if(name == null)
                                {
                                        throw new ArgumentNullException("name");
                                }
                                this.name = name;
                                this.fontCollection = fontCollection;

                                // Intuit the generic family based on common 
font names.
                                if(String.Compare(name, "Times", true) == 0 ||
                                   String.Compare(name, "Times New Roman", 
true) == 0)
                                {
                                        this.genericFamily = 
GenericFontFamilies.Serif;
                                }
                                else if(String.Compare(name, "Helvetica", true) 
== 0 ||
                                        String.Compare(name, "Helv", true) == 0 
||
                                        String.Compare
                                                        (name, "Microsoft Sans 
Serif", true) == 0 ||
                                        String.Compare(name, "Arial", true) == 
0 ||
                                        String.Compare(name, 0, "Arial ", 0, 6, 
true) == 0)
                                {
                                        this.genericFamily = 
GenericFontFamilies.SansSerif;
                                }
                                else if(String.Compare(name, "Courier", true) 
== 0 ||
                                        String.Compare(name, "Courier New", 
true) == 0)
                                {
                                        this.genericFamily = 
GenericFontFamilies.Monospace;
                                }
                                else
                                {
                                        this.genericFamily = 
GenericFontFamilies.Serif;
                                }
                        }

        // Destructor.
        ~FontFamily()
                        {
                                // Nothing to do here in this implementation.
                        }

        // Get a list of all font families on this system.
        public static FontFamily[] Families
                        {
                                get
                                {
                                        return GetFamilies(null);
                                }
                        }

        // Get a generic monospace object.
        public static FontFamily GenericMonospace
                        {
                                get
                                {
                                        return new 
FontFamily(GenericFontFamilies.Monospace);
                                }
                        }

        // Get a generic sans-serif object.
        public static FontFamily GenericSansSerif
                        {
                                get
                                {
                                        return new 
FontFamily(GenericFontFamilies.SansSerif);
                                }
                        }

        // Get a generic serif object.
        public static FontFamily GenericSerif
                        {
                                get
                                {
                                        return new 
FontFamily(GenericFontFamilies.Serif);
                                }
                        }

        // Get the name of this font family.
        public String Name
                        {
                                get
                                {
                                        return name;
                                }
                        }

        // Dispose of this object.
        public void Dispose()
                        {
                                // Nothing to do here in this implementation.
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object obj)
                        {
                                FontFamily other = (obj as FontFamily);
                                if(other != null)
                                {
                                        return (other.Name == Name);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get the cell ascent for a particular style.
        [TODO]
        public int GetCellAscent(FontStyle style)
                        {
                                // TODO
                                return 0;
                        }

        // Get the cell descent for a particular style.
        [TODO]
        public int GetCellDescent(FontStyle style)
                        {
                                // TODO
                                return 0;
                        }

        // Get the em height for a particular style.
        [TODO]
        public int GetEmHeight(FontStyle style)
                        {
                                // TODO
                                return 0;
                        }

        // Get a list of all font families with a specified graphics context.
        [TODO]
        public static FontFamily[] GetFamilies(Graphics graphics)
                        {
                                // TODO
                                return null;
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return Name.GetHashCode();
                        }

        // Get the line spacing for a particular style.
        [TODO]
        public int GetLineSpacing(FontStyle style)
                        {
                                // TODO
                                return 0;
                        }

        // Get the name of this font in a specified language.
        public String GetName(int language)
                        {
                                // We don't support language identifiers.
                                return Name;
                        }

        // Determine if a particular font style is available.
        public bool IsStyleAvailable(FontStyle style)
                        {
                                // We assume that all styles are available and 
that it is
                                // up to the toolkit handlers to emulate 
unknown styles.
                                return true;
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "[FontFamily: Name=" + Name + "]";
                        }

}; // class FontFamily

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * FontStyle.cs - Implementation of the
 *                      "System.Drawing.FontStyle" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

[Flags]
public enum FontStyle
{
        Regular         = 0x0000,
        Bold            = 0x0001,
        Italic          = 0x0002,
        Underline       = 0x0004,
        Strikeout       = 0x0008

}; // enum FontStyle

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Graphics.cs - Implementation of the "System.Drawing.Graphics" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
[...2558 lines suppressed...]
                                {
                                        throw new 
ArgumentNullException("brush");
                                }
                                if(graphics == null)
                                {
                                        throw new 
ObjectDisposedException("graphics");
                                }
                                IToolkitBrush tbrush = 
brush.GetBrush(graphics.Toolkit);
                                tbrush.Select(graphics);
                        }

        // Update the clipping region within the IToolkitGraphics object.
        private void UpdateClip()
                        {
                                // TODO
                        }

}; // class Graphics

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * GraphicsUnit.cs - Implementation of the
 *                      "System.Drawing.GraphicsUnit" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum GraphicsUnit
{
        World           = 0,
        Display         = 1,
        Pixel           = 2,
        Point           = 3,
        Inch            = 4,
        Document        = 5,
        Millimeter      = 6

}; // enum GraphicsUnit

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Icon.cs - Implementation of the "System.Drawing.Icon" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Drawing.Imaging;

[TODO]
public class Icon : Image
{
        // TODO

}; // class Icon

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Image.cs - Implementation of the "System.Drawing.Image" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Drawing.Imaging;

[Serializable]
[ComVisible(true)]
public abstract class Image
        : MarshalByRefObject, ISerializable, ICloneable, IDisposable
{
        // Internal state.
        internal int flags;
        internal Guid[] frameDimensionsList;
        internal int height;
        internal float horizontalResolution;
        internal ColorPalette palette;
        internal PixelFormat pixelFormat;
        internal int[] propertyIdList;
        internal PropertyItem[] propertyItems;
        internal ImageFormat rawFormat;
        internal float verticalResolution;
        internal int width;

        // Constructors.
        [TODO]
        internal Image()
                        {
                                // TODO
                        }
        [TODO]
        internal Image(SerializationInfo info, StreamingContext context)
                        {
                                // TODO
                        }

        // Destructor.
        ~Image()
                        {
                                Dispose(false);
                        }

        // Get this object's properties.
        public int Flags
                        {
                                get
                                {
                                        return flags;
                                }
                        }
        public Guid[] FrameDimensionsList
                        {
                                get
                                {
                                        return frameDimensionsList;
                                }
                        }
        public int Height
                        {
                                get
                                {
                                        return height;
                                }
                        }
        public float HorizontalResolution
                        {
                                get
                                {
                                        return horizontalResolution;
                                }
                        }
        public ColorPalette Palette
                        {
                                get
                                {
                                        return palette;
                                }
                                set
                                {
                                        palette = value;
                                }
                        }
        public SizeF PhysicalDimension
                        {
                                get
                                {
                                        return new SizeF(width, height);
                                }
                        }
        public PixelFormat PixelFormat
                        {
                                get
                                {
                                        return pixelFormat;
                                }
                        }
        public int[] PropertyIdList
                        {
                                get
                                {
                                        if(propertyIdList == null)
                                        {
                                                propertyIdList = new int [0];
                                        }
                                        return propertyIdList;
                                }
                        }
        public PropertyItem[] PropertyItems
                        {
                                get
                                {
                                        if(propertyItems == null)
                                        {
                                                propertyItems = new 
PropertyItem [0];
                                        }
                                        return propertyItems;
                                }
                        }
        public ImageFormat RawFormat
                        {
                                get
                                {
                                        return rawFormat;
                                }
                        }
        public Size Size
                        {
                                get
                                {
                                        return new Size(width, height);
                                }
                        }
        public float VerticalResolution
                        {
                                get
                                {
                                        return verticalResolution;
                                }
                        }
        public int Width
                        {
                                get
                                {
                                        return width;
                                }
                        }

        // Make a copy of this object.
        public virtual Object Clone()
                        {
                                // TODO
                                return null;
                        }

        // Dispose of this object.
        public void Dispose()
                        {
                                Dispose(true);
                                GC.SuppressFinalize(this);
                        }
        protected virtual void Dispose(bool disposing)
                        {
                                // TODO
                        }

        // Load an image from a file.
        public static Image FromFile(String filename)
                        {
                                return FromFile(filename, false);
                        }
        [TODO]
        public static Image FromFile
                                (String filename, bool 
useEmbeddedColorManagement)
                        {
                                // TODO
                                return null;
                        }

        // Convert a HBITMAP object into an image.
        public static Image FromHbitmap(IntPtr hbitmap)
                        {
                                return FromHbitmap(hbitmap, IntPtr.Zero);
                        }
        [TODO]
        public static Image FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
                        {
                                // TODO
                                return null;
                        }

        // Load an image from a particular stream.
        public static Image FromStream(Stream stream)
                        {
                                return FromStream(stream, false);
                        }
        [TODO]
        public static Image FromStream
                                (Stream stream, bool useEmbeddedColorManagement)
                        {
                                // TODO
                                return null;
                        }

        // Get a bounding rectangle for this image.
        [TODO]
        public RectangleF GetBounds(ref GraphicsUnit pageUnit)
                        {
                                // TODO
                                return RectangleF.Empty;
                        }

        // Get parameter information for a specific encoder.
        [TODO]
        public EncoderParameters GetEncoderParameterList(Guid encoder)
                        {
                                // TODO
                                return null;
                        }

        // Get the number of frames in a specific dimension.
        [TODO]
        public int GetFrameCount(FrameDimension dimension)
                        {
                                // TODO
                                return 1;
                        }

        // Get the number of bits per pixel in a specific format.
        public static int GetPixelFormatSize(PixelFormat pixfmt)
                        {
                                switch(pixfmt)
                                {
                                        case PixelFormat.Format1bppIndexed:     
        return 1;
                                        case PixelFormat.Format4bppIndexed:     
        return 4;
                                        case PixelFormat.Format8bppIndexed:     
        return 8;
                                        case PixelFormat.Format16bppRgb555:
                                        case PixelFormat.Format16bppRgb565:
                                        case PixelFormat.Format16bppArgb1555:
                                        case PixelFormat.Format16bppGrayScale:  
return 16;
                                        case PixelFormat.Format24bppRgb:        
        return 24;
                                        case PixelFormat.Format32bppRgb:
                                        case PixelFormat.Format32bppPArgb:
                                        case PixelFormat.Format32bppArgb:       
        return 32;
                                        case PixelFormat.Format48bppRgb:        
        return 48;
                                        case PixelFormat.Format64bppPArgb:
                                        case PixelFormat.Format64bppArgb:       
        return 64;
                                }
                                return 0;
                        }

        // Get a specific property item
        [TODO]
        public PropertyItem GetPropertyItem(int propid)
                        {
                                // TODO
                                return null;
                        }

        // Get a thumbnail version of this image.
        [TODO]
        public Image GetThumbnailImage(int thumbWidth, int thumbHeight,
                                                           
GetThumbnailImageAbort callback,
                                                           IntPtr callbackData)
                        {
                                // TODO
                                return null;
                        }

        // Delegate for aborting "GetThumbnailImage" prematurely.
        public delegate bool GetThumbnailImageAbort();

        // Check for specific kinds of pixel formats.
        public static bool IsAlphaPixelFormat(PixelFormat pixfmt)
                        {
                                return ((pixfmt & PixelFormat.Alpha) != 0);
                        }
        public static bool IsCanonicalPixelFormat(PixelFormat pixfmt)
                        {
                                return ((pixfmt & PixelFormat.Canonical) != 0);
                        }
        public static bool IsExtendedPixelFormat(PixelFormat pixfmt)
                        {
                                return ((pixfmt & PixelFormat.Extended) != 0);
                        }

        // Remove a specific property.
        [TODO]
        public void RemoveProperty(int propid)
                        {
                                // TODO
                        }

        // Rotate and/or flip this image.
        [TODO]
        public void RotateFlip(RotateFlipType rotateFlipType)
                        {
                                // TODO
                        }

        // Save this image to a file.
        public void Save(String filename)
                        {
                                Save(filename, RawFormat);
                        }
        [TODO]
        public void Save(String filename, ImageFormat format)
                        {
                                // TODO
                        }
        [TODO]
        public void Save(String filename, ImageCodecInfo encoder,
                                         EncoderParameters encoderParameters)
                        {
                                // TODO
                        }

        // Save this image to a stream.
        [TODO]
        public void Save(Stream stream, ImageFormat format)
                        {
                                // TODO
                        }
        [TODO]
        public void Save(Stream stream, ImageCodecInfo encoder,
                                         EncoderParameters encoderParameters)
                        {
                                // TODO
                        }

        // Add a frame to the previously saved image file.
        [TODO]
        public void SaveAdd(EncoderParameters encoderParamers)
                        {
                                // TODO
                        }
        [TODO]
        public void SaveAdd(Image image, EncoderParameters encoderParamers)
                        {
                                // TODO
                        }

        // Select a new frame and make it the active one.
        [TODO]
        public int SelectActiveFrame(FrameDimension dimension, int frameIndex)
                        {
                                // TODO
                                return frameIndex;
                        }

        // Set a property on this image.
        [TODO]
        public void SetPropertyItem(PropertyItem propitem)
                        {
                                // TODO
                        }

        // Implement the ISerializable interface.
        [TODO]
        void ISerializable.GetObjectData(SerializationInfo info,
                                                                         
StreamingContext context)
                        {
                                // TODO
                        }

}; // class Image

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * KnownColor.cs - Implementation of the
 *                      "System.Drawing.KnownColor" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum KnownColor
{
        // Special colors.
        ActiveBorder                    = 1,
        ActiveCaption                   = 2,
        ActiveCaptionText               = 3,
        AppWorkspace                    = 4,
        Control                                 = 5,
        ControlDark                             = 6,
        ControlDarkDark                 = 7,
        ControlLight                    = 8,
        ControlLightLight               = 9,
        ControlText                             = 10,
        Desktop                                 = 11,
        GrayText                                = 12,
        Highlight                               = 13,
        HighlightText                   = 14,
        HotTrack                                = 15,
        InactiveBorder                  = 16,
        InactiveCaption                 = 17,
        InactiveCaptionText             = 18,
        Info                                    = 19,
        InfoText                                = 20,
        Menu                                    = 21,
        MenuText                                = 22,
        ScrollBar                               = 23,
        Window                                  = 24,
        WindowFrame                             = 25,
        WindowText                              = 26,

        // Specific colors.
        Transparent                             = 27,
        AliceBlue                               = 28,
        AntiqueWhite                    = 29,
        Aqua                                    = 30,
        Aquamarine                              = 31,
        Azure                                   = 32,
        Beige                                   = 33,
        Bisque                                  = 34,
        Black                                   = 35,
        BlanchedAlmond                  = 36,
        Blue                                    = 37,
        BlueViolet                              = 38,
        Brown                                   = 39,
        BurlyWood                               = 40,
        CadetBlue                               = 41,
        Chartreuse                              = 42,
        Chocolate                               = 43,
        Coral                                   = 44,
        CornflowerBlue                  = 45,
        Cornsilk                                = 46,
        Crimson                                 = 47,
        Cyan                                    = 48,
        DarkBlue                                = 49,
        DarkCyan                                = 50,
        DarkGoldenrod                   = 51,
        DarkGray                                = 52,
        DarkGreen                               = 53,
        DarkKhaki                               = 54,
        DarkMagenta                             = 55,
        DarkOliveGreen                  = 56,
        DarkOrange                              = 57,
        DarkOrchid                              = 58,
        DarkRed                                 = 59,
        DarkSalmon                              = 60,
        DarkSeaGreen                    = 61,
        DarkSlateBlue                   = 62,
        DarkSlateGray                   = 63,
        DarkTurquoise                   = 64,
        DarkViolet                              = 65,
        DeepPink                                = 66,
        DeepSkyBlue                             = 67,
        DimGray                                 = 68,
        DodgerBlue                              = 69,
        Firebrick                               = 70,
        FloralWhite                             = 71,
        ForestGreen                             = 72,
        Fuchsia                                 = 73,
        Gainsboro                               = 74,
        GhostWhite                              = 75,
        Gold                                    = 76,
        Goldenrod                               = 77,
        Gray                                    = 78,
        Green                                   = 79,
        GreenYellow                             = 80,
        Honeydew                                = 81,
        HotPink                                 = 82,
        IndianRed                               = 83,
        Indigo                                  = 84,
        Ivory                                   = 85,
        Khaki                                   = 86,
        Lavender                                = 87,
        LavenderBlush                   = 88,
        LawnGreen                               = 89,
        LemonChiffon                    = 90,
        LightBlue                               = 91,
        LightCoral                              = 92,
        LightCyan                               = 93,
        LightGoldenrodYellow    = 94,
        LightGray                               = 95,
        LightGreen                              = 96,
        LightPink                               = 97,
        LightSalmon                             = 98,
        LightSeaGreen                   = 99,
        LightSkyBlue                    = 100,
        LightSlateGray                  = 101,
        LightSteelBlue                  = 102,
        LightYellow                             = 103,
        Lime                                    = 104,
        LimeGreen                               = 105,
        Linen                                   = 106,
        Magenta                                 = 107,
        Maroon                                  = 108,
        MediumAquamarine                = 109,
        MediumBlue                              = 110,
        MediumOrchid                    = 111,
        MediumPurple                    = 112,
        MediumSeaGreen                  = 113,
        MediumSlateBlue                 = 114,
        MediumSpringGreen               = 115,
        MediumTurquoise                 = 116,
        MediumVioletRed                 = 117,
        MidnightBlue                    = 118,
        MintCream                               = 119,
        MistyRose                               = 120,
        Moccasin                                = 121,
        NavajoWhite                             = 122,
        Navy                                    = 123,
        OldLace                                 = 124,
        Olive                                   = 125,
        OliveDrab                               = 126,
        Orange                                  = 127,
        OrangeRed                               = 128,
        Orchid                                  = 129,
        PaleGoldenrod                   = 130,
        PaleGreen                               = 131,
        PaleTurquoise                   = 132,
        PaleVioletRed                   = 133,
        PapayaWhip                              = 134,
        PeachPuff                               = 135,
        Peru                                    = 136,
        Pink                                    = 137,
        Plum                                    = 138,
        PowderBlue                              = 139,
        Purple                                  = 140,
        Red                                             = 141,
        RosyBrown                               = 142,
        RoyalBlue                               = 143,
        SaddleBrown                             = 144,
        Salmon                                  = 145,
        SandyBrown                              = 146,
        SeaGreen                                = 147,
        SeaShell                                = 148,
        Sienna                                  = 149,
        Silver                                  = 150,
        SkyBlue                                 = 151,
        SlateBlue                               = 152,
        SlateGray                               = 153,
        Snow                                    = 154,
        SpringGreen                             = 155,
        SteelBlue                               = 156,
        Tan                                             = 157,
        Teal                                    = 158,
        Thistle                                 = 159,
        Tomato                                  = 160,
        Turquoise                               = 161,
        Violet                                  = 162,
        Wheat                                   = 163,
        White                                   = 164,
        WhiteSmoke                              = 165,
        Yellow                                  = 166,
        YellowGreen                             = 167
        
}; // enum KnownColor
        
}; // namespace System.Drawing

--- NEW FILE ---

.PHONY: System.Drawing.dll

all-local: System.Drawing.dll

System.Drawing.dll:
        "$(CSANT)" $(CSANT_FLAGS) -f System.Drawing.build all

CLEANFILES = System.Drawing.dll

pnetassembliesdir = $(libdir)/cscc/lib
pnetassemblies_DATA = System.Drawing.dll

--- NEW FILE ---
/*
 * Pen.cs - Implementation of the "System.Drawing.Pen" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Drawing.Drawing2D;
using System.Drawing.Toolkit;

public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable
{
        // Internal state.
        private Brush brush;
        private Color color;
        private float width;
        private PenAlignment alignment;
        private float[] compoundArray;
        private CustomLineCap customEndCap;
        private CustomLineCap customStartCap;
        private DashCap dashCap;
        private float dashOffset;
        private float[] dashPattern;
        private DashStyle dashStyle;
        private LineCap endCap;
        private LineJoin lineJoin;
        private float miterLimit;
        private LineCap startCap;
        private Matrix transform;
        private IToolkit toolkit;
        private IToolkitPen toolkitPen;

        // Constructors.
        public Pen(Brush brush)
                        {
                                if(brush == null)
                                {
                                        throw new 
ArgumentNullException("brush");
                                }
                                this.brush = brush;
                                this.width = 1.0f;
                                this.miterLimit = 10.0f;
                        }
        public Pen(Color color)
                        {
                                this.color = color;
                                this.width = 1.0f;
                                this.miterLimit = 10.0f;
                        }
        public Pen(Brush brush, float width)
                        {
                                if(brush == null)
                                {
                                        throw new 
ArgumentNullException("brush");
                                }
                                this.brush = brush;
                                this.width = width;
                                this.miterLimit = 10.0f;
                        }
        public Pen(Color color, float width)
                        {
                                this.color = color;
                                this.width = width;
                                this.miterLimit = 10.0f;
                        }

        // Destructor.
        ~Pen()
                        {
                                Dispose();
                        }

        // Get or set the pen properties.
        public PenAlignment Alignment
                        {
                                get
                                {
                                        return alignment;
                                }
                                set
                                {
                                        if(alignment != value)
                                        {
                                                Dispose();
                                                alignment = value;
                                        }
                                }
                        }
        [TODO]
        public Brush Brush
                        {
                                get
                                {
                                        // TODO
                                        return brush;
                                }
                                set
                                {
                                        // TODO
                                }
                        }
        public Color Color
                        {
                                get
                                {
                                        return color;
                                }
                                set
                                {
                                        if(color != value)
                                        {
                                                Dispose();
                                                color = value;
                                        }
                                }
                        }
        public float[] CompoundArray
                        {
                                get
                                {
                                        return compoundArray;
                                }
                                set
                                {
                                        Dispose();
                                        compoundArray = value;
                                }
                        }
        public CustomLineCap CustomEndCap
                        {
                                get
                                {
                                        return customEndCap;
                                }
                                set
                                {
                                        Dispose();
                                        customEndCap = value;
                                }
                        }
        public CustomLineCap CustomStartCap
                        {
                                get
                                {
                                        return customStartCap;
                                }
                                set
                                {
                                        Dispose();
                                        customStartCap = value;
                                }
                        }
        public DashCap DashCap
                        {
                                get
                                {
                                        return dashCap;
                                }
                                set
                                {
                                        if(dashCap != value)
                                        {
                                                Dispose();
                                                dashCap = value;
                                        }
                                }
                        }
        public float DashOffset
                        {
                                get
                                {
                                        return dashOffset;
                                }
                                set
                                {
                                        if(dashOffset != value)
                                        {
                                                Dispose();
                                                dashOffset = value;
                                        }
                                }
                        }
        public float[] DashPattern
                        {
                                get
                                {
                                        return dashPattern;
                                }
                                set
                                {
                                        Dispose();
                                        dashPattern = value;
                                }
                        }
        public DashStyle DashStyle
                        {
                                get
                                {
                                        return dashStyle;
                                }
                                set
                                {
                                        if(dashStyle != value)
                                        {
                                                Dispose();
                                                dashStyle = value;
                                        }
                                }
                        }
        public LineCap EndCap
                        {
                                get
                                {
                                        return endCap;
                                }
                                set
                                {
                                        if(endCap != value)
                                        {
                                                Dispose();
                                                endCap = value;
                                        }
                                }
                        }
        public LineJoin LineJoin
                        {
                                get
                                {
                                        return lineJoin;
                                }
                                set
                                {
                                        if(lineJoin != value)
                                        {
                                                Dispose();
                                                lineJoin = value;
                                        }
                                }
                        }
        public float MiterLimit
                        {
                                get
                                {
                                        return miterLimit;
                                }
                                set
                                {
                                        if(miterLimit != value)
                                        {
                                                Dispose();
                                                miterLimit = value;
                                        }
                                }
                        }
        [TODO]
        public PenType PenType
                        {
                                get
                                {
                                        // TODO
                                        return PenType.SolidColor;
                                }
                        }
        public LineCap StartCap
                        {
                                get
                                {
                                        return startCap;
                                }
                                set
                                {
                                        if(startCap != value)
                                        {
                                                Dispose();
                                                startCap = value;
                                        }
                                }
                        }
        public Matrix Transform
                        {
                                get
                                {
                                        return transform;
                                }
                                set
                                {
                                        Dispose();
                                        if(value != null)
                                        {
                                                // Make a copy of the matrix so 
that modifications
                                                // to the original don't affect 
the pen settings.
                                                transform = Matrix.Clone(value);
                                        }
                                        else
                                        {
                                                transform = null;
                                        }
                                }
                        }
        public float Width
                        {
                                get
                                {
                                        return width;
                                }
                                set
                                {
                                        if(width != value)
                                        {
                                                Dispose();
                                                width = value;
                                        }
                                }
                        }

        // Clone this pen.
        public Object Clone()
                        {
                                lock(this)
                                {
                                        Pen pen = (Pen)(MemberwiseClone());
                                        pen.toolkit = null;
                                        pen.toolkitPen = null;
                                        return pen;
                                }
                        }

        // Dispose of this pen.
        public void Dispose()
                        {
                                lock(this)
                                {
                                        if(toolkitPen != null)
                                        {
                                                toolkitPen.Dispose();
                                                toolkitPen = null;
                                        }
                                        toolkit = null;
                                }
                        }

        // Set the line capabilities.
        public void SetLineCap(LineCap startCap, LineCap endCap, DashCap 
dashCap)
                        {
                                Dispose();
                                this.startCap = startCap;
                                this.endCap = endCap;
                                this.dashCap = dashCap;
                        }

        // Get the toolkit version of this pen for a specific toolkit.
        internal IToolkitPen GetPen(IToolkit toolkit)
                        {
                                lock(this)
                                {
                                        if(this.toolkitPen == null)
                                        {
                                                // We don't yet have a toolkit 
pen yet.
                                                this.toolkitPen = 
toolkit.CreatePen(this);
                                                this.toolkit = toolkit;
                                                return this.toolkitPen;
                                        }
                                        else if(this.toolkit == toolkit)
                                        {
                                                // Same toolkit - return the 
cached pen information.
                                                return this.toolkitPen;
                                        }
                                        else
                                        {
                                                // We have a pen for another 
toolkit,
                                                // so dispose it and create for 
this toolkit.
                                                // We null out "toolkitPen" 
before calling
                                                // "CreatePen()" just in case 
an exception
                                                // is thrown while creating the 
toolkit pen.
                                                this.toolkitPen.Dispose();
                                                this.toolkitPen = null;
                                                this.toolkitPen = 
toolkit.CreatePen(this);
                                                this.toolkit = toolkit;
                                                return this.toolkitPen;
                                        }
                                }
                        }

}; // class Pen

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Point.cs - Implementation of the "System.Drawing.Point" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;
using System.ComponentModel;

[Serializable]
[ComVisible(true)]
[TypeConverter("System.Drawing.PointConverter")]
public struct Point
{
        // Internal state.
        private int x;
        private int y;

        // The empty point.
        public static readonly Point Empty = new Point(0, 0);

        // Constructors.
        public Point(int dw)
                        {
                                x = (int)(short)dw;
                                y = (dw >> 16);
                        }
        public Point(Size sz)
                        {
                                x = sz.Width;
                                y = sz.Height;
                        }
        public Point(int x, int y)
                        {
                                this.x = x;
                                this.y = y;
                        }

        // Determine if this point is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (x == 0 && y == 0);
                                }
                        }

        // Get or set the X co-ordinate.
        public int X
                        {
                                get
                                {
                                        return x;
                                }
                                set
                                {
                                        x = value;
                                }
                        }

        // Get or set the Y co-ordinate.
        public int Y
                        {
                                get
                                {
                                        return y;
                                }
                                set
                                {
                                        y = value;
                                }
                        }

        // Convert a PointF object into a Point object using ceiling conversion.
        public static Point Ceiling(PointF value)
                        {
                                return new Point((int)(Math.Ceiling(value.X)),
                                                                 
(int)(Math.Ceiling(value.Y)));
                        }

        // Determine if two points are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is Point)
                                {
                                        Point other = (Point)obj;
                                        return (x == other.x && y == other.y);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return (x ^ y);
                        }

        // Offset this point by a specified amount.
        public void Offset(int dx, int dy)
                        {
                                x += dx;
                                y += dy;
                        }

        // Convert a PointF object into a Point object using rounding 
conversion.
        public static Point Round(PointF value)
                        {
                                return new Point((int)(Math.Round(value.X)),
                                                                 
(int)(Math.Round(value.Y)));
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{X=" + x.ToString() + ",Y=" + 
y.ToString() + "}";
                        }

        // Convert a PointF object into a Point object using truncating 
conversion.
        public static Point Truncate(PointF value)
                        {
                                return new Point((int)(value.X), 
(int)(value.Y));
                        }

        // Overloaded operators.
        public static Point operator+(Point pt, Size sz)
                        {
                                return new Point(pt.x + sz.Width, pt.y + 
sz.Height);
                        }
        public static Point operator-(Point pt, Size sz)
                        {
                                return new Point(pt.x - sz.Width, pt.y - 
sz.Height);
                        }
        public static bool operator==(Point left, Point right)
                        {
                                return (left.x == right.x && left.y == right.y);
                        }
        public static bool operator!=(Point left, Point right)
                        {
                                return (left.x != right.x || left.y != right.y);
                        }
        public static explicit operator Size(Point p)
                        {
                                return new Size(p.x, p.y);
                        }
        public static implicit operator PointF(Point p)
                        {
                                return new PointF(p.x, p.y);
                        }

}; // struct Point
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * PointF.cs - Implementation of the "System.Drawing.PointF" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;

[Serializable]
[ComVisible(true)]
public struct PointF
{
        // Internal state.
        private float x;
        private float y;

        // The empty point.
        public static readonly PointF Empty = new PointF(0.0f, 0.0f);

        // Constructor.
        public PointF(float x, float y)
                        {
                                this.x = x;
                                this.y = y;
                        }

        // Determine if this point is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (x == 0.0f && y == 0.0f);
                                }
                        }

        // Get or set the X co-ordinate.
        public float X
                        {
                                get
                                {
                                        return x;
                                }
                                set
                                {
                                        x = value;
                                }
                        }

        // Get or set the Y co-ordinate.
        public float Y
                        {
                                get
                                {
                                        return y;
                                }
                                set
                                {
                                        y = value;
                                }
                        }

        // Determine if two points are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is PointF)
                                {
                                        PointF other = (PointF)obj;
                                        return (x == other.x && y == other.y);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return base.GetHashCode();
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{X=" + x.ToString() + ",Y=" + 
y.ToString() + "}";
                        }

        // Overloaded operators.
        public static PointF operator+(PointF pt, Size sz)
                        {
                                return new PointF(pt.x + sz.Width, pt.y + 
sz.Height);
                        }
        public static PointF operator-(PointF pt, Size sz)
                        {
                                return new PointF(pt.x - sz.Width, pt.y - 
sz.Height);
                        }
        public static bool operator==(PointF left, PointF right)
                        {
                                return (left.x == right.x && left.y == right.y);
                        }
        public static bool operator!=(PointF left, PointF right)
                        {
                                return (left.x != right.x || left.y != right.y);
                        }

}; // struct PointF
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Rectangle.cs - Implementation of the "System.Drawing.Rectangle" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;
using System.ComponentModel;

[Serializable]
[ComVisible(true)]
[TypeConverter("System.Drawing.RectangleConverter")]
public struct Rectangle
{
        // Internal state.
        private int x;
        private int y;
        private int width;
        private int height;

        // The empty rectangle.
        public static readonly Rectangle Empty = new Rectangle(0, 0, 0, 0);

        // Constructors.
        public Rectangle(Point location, Size size)
                        {
                                x = location.X;
                                y = location.Y;
                                width = size.Width;
                                height = size.Height;
                        }
        public Rectangle(int x, int y, int width, int height)
                        {
                                this.x = x;
                                this.y = y;
                                this.width = width;
                                this.height = height;
                        }

        // Determine if this rectangle is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (x == 0 && y == 0 && width == 0 
&& height == 0);
                                }
                        }

        // Get or set the X co-ordinate.
        public int X
                        {
                                get
                                {
                                        return x;
                                }
                                set
                                {
                                        x = value;
                                }
                        }

        // Get or set the Y co-ordinate.
        public int Y
                        {
                                get
                                {
                                        return y;
                                }
                                set
                                {
                                        y = value;
                                }
                        }

        // Get or set the width.
        public int Width
                        {
                                get
                                {
                                        return width;
                                }
                                set
                                {
                                        width = value;
                                }
                        }

        // Get or set the height.
        public int Height
                        {
                                get
                                {
                                        return height;
                                }
                                set
                                {
                                        height = value;
                                }
                        }

        // Get the bottom edge of the rectangle.
        public int Bottom
                        {
                                get
                                {
                                        return y + height;
                                }
                        }

        // Get the left edge of the rectangle.
        public int Left
                        {
                                get
                                {
                                        return x;
                                }
                        }

        // Get the right edge of the rectangle.
        public int Right
                        {
                                get
                                {
                                        return x + width;
                                }
                        }

        // Get the top edge of the rectangle.
        public int Top
                        {
                                get
                                {
                                        return y;
                                }
                        }

        // Get or set the location of the top-left corner.
        public Point Location
                        {
                                get
                                {
                                        return new Point(x, y);
                                }
                                set
                                {
                                        x = value.X;
                                        y = value.Y;
                                }
                        }

        // Get or set the size of the rectangle.
        public Size Size
                        {
                                get
                                {
                                        return new Size(width, height);
                                }
                                set
                                {
                                        width = value.Width;
                                        height = value.Height;
                                }
                        }

        // Convert a RectangleF object into a Rectangle by ceiling conversion.
        public static Rectangle Ceiling(RectangleF value)
                        {
                                return new 
Rectangle((int)(Math.Ceiling(value.X)),
                                                                     
(int)(Math.Ceiling(value.Y)),
                                                                     
(int)(Math.Ceiling(value.Width)),
                                                                     
(int)(Math.Ceiling(value.Height)));
                        }

        // Determine if a rectangle contains a point.
        public bool Contains(int x, int y)
                        {
                                return (x >= this.x && x < (this.x + 
this.width) &&
                                        y >= this.y && x < (this.y + 
this.height));
                        }
        public bool Contains(Point pt)
                        {
                                return Contains(pt.X, pt.Y);
                        }

        // Determine if one rectangle contains another.
        public bool Contains(Rectangle rect)
                        {
                                if(rect.x >= this.x &&
                                   (rect.x + rect.width) <= (this.x + 
this.width) &&
                                   rect.y >= this.y &&
                                   (rect.y + rect.height) <= (this.y + 
this.height))
                                {
                                        return true;
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Determine if two rectangles are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is Rectangle)
                                {
                                        Rectangle other = (Rectangle)obj;
                                        return (x == other.x && y == other.y &&
                                                width == other.width && height 
== other.height);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Convert left, top, right, bottom values into a rectangle.
        public static Rectangle FromLTRB(int left, int top, int right, int 
bottom)
                        {
                                return new Rectangle(left, top, right - left, 
bottom - top);
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return (x ^ y ^ width ^ height);
                        }

        // Inflate this rectangle.
        public void Inflate(int width, int height)
                        {
                                this.x -= width;
                                this.y -= height;
                                this.width += width * 2;
                                this.height += height * 2;
                        }
        public void Inflate(Size size)
                        {
                                Inflate(size.Width, size.Height);
                        }

        // Inflate a specific rectangle without modifying it.
        public static Rectangle Inflate(Rectangle rect, int x, int y)
                        {
                                return new Rectangle(rect.x - x, rect.y - y,
                                                                         
rect.width + x * 2, rect.height + y * 2);
                        }

        // Form the intersection of another rectangle with this one.
        public void Intersect(Rectangle rect)
                        {
                                int left, top, right, bottom;
                                left = x;
                                if(left < rect.x)
                                {
                                        left = rect.x;
                                }
                                top = y;
                                if(top < rect.y)
                                {
                                        top = rect.y;
                                }
                                right = x + width;
                                if(right > (rect.x + rect.width))
                                {
                                        right = (rect.x + rect.width);
                                }
                                bottom = y + height;
                                if(bottom > (rect.y + rect.height))
                                {
                                        bottom = (rect.y + rect.height);
                                }
                                if(left < right && top < bottom)
                                {
                                        x = left;
                                        y = top;
                                        width = right - left;
                                        height = bottom - top;
                                }
                                else
                                {
                                        x = 0;
                                        y = 0;
                                        width = 0;
                                        height = 0;
                                }
                        }

        // Form the intersection of two rectangles.
        public static Rectangle Intersect(Rectangle a, Rectangle b)
                        {
                                a.Intersect(b);
                                return a;
                        }

        // Determine if this rectangle intersects with another.
        public bool IntersectsWith(Rectangle rect)
                        {
                                return (rect.x < (x + width) &&
                                        (rect.x + rect.width) >= x &&
                                        rect.y < (y + height) &&
                                        (rect.y + rect.height) >= y);
                        }

        // Offset this rectangle by a point.
        public void Offset(int x, int y)
                        {
                                this.x += x;
                                this.y += y;
                        }
        public void Offset(Point pos)
                        {
                                this.x += pos.X;
                                this.y += pos.Y;
                        }

        // Convert a RectangleF object into a Rectangle by rounding conversion.
        public static Rectangle Round(RectangleF value)
                        {
                                return new Rectangle((int)(Math.Round(value.X)),
                                                                     
(int)(Math.Round(value.Y)),
                                                                     
(int)(Math.Round(value.Width)),
                                                                     
(int)(Math.Round(value.Height)));
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{X=" + x.ToString() +
                                       ",Y=" + y.ToString() +
                                           ",Width=" + width.ToString() +
                                           ",Height=" + height.ToString() + "}";
                        }

        // Convert a RectangleF object into a Rectangle by truncating 
conversion.
        public static Rectangle Truncate(RectangleF value)
                        {
                                return new Rectangle((int)(value.X), 
(int)(value.Y),
                                                                     
(int)(value.Width), (int)(value.Height));
                        }

        // Get the union of two rectangles.
        public static Rectangle Union(Rectangle a, Rectangle b)
                        {
                                int left, top, right, bottom;
                                left = a.x;
                                if(left > b.x)
                                {
                                        left = b.x;
                                }
                                top = a.y;
                                if(top > b.y)
                                {
                                        top = b.y;
                                }
                                right = a.x + a.width;
                                if(right < (b.x + b.width))
                                {
                                        right = b.x + b.width;
                                }
                                bottom = a.y + a.height;
                                if(bottom < (b.y + b.height))
                                {
                                        bottom = b.y + b.height;
                                }
                                return new Rectangle(left, top, right - left, 
bottom - top);
                        }

        // Overloaded operators.
        public static bool operator==(Rectangle left, Rectangle right)
                        {
                                return (left.x == right.x &&
                                                left.y == right.y &&
                                                left.width == right.width &&
                                                left.height == right.height);
                        }
        public static bool operator!=(Rectangle left, Rectangle right)
                        {
                                return (left.x != right.x ||
                                                left.y != right.y ||
                                                left.width != right.width ||
                                                left.height != right.height);
                        }

}; // struct Rectangle
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * RectangleF.cs - Implementation of the "System.Drawing.RectangleF" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

[Serializable]
public struct RectangleF
{
        // Internal state.
        private float x;
        private float y;
        private float width;
        private float height;

        // The empty rectangle.
        public static readonly RectangleF Empty
                                = new RectangleF(0.0f, 0.0f, 0.0f, 0.0f);

        // Constructors.
        public RectangleF(PointF location, SizeF size)
                        {
                                x = location.X;
                                y = location.Y;
                                width = size.Width;
                                height = size.Height;
                        }
        public RectangleF(float x, float y, float width, float height)
                        {
                                this.x = x;
                                this.y = y;
                                this.width = width;
                                this.height = height;
                        }

        // Determine if this rectangle is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (x == 0.0f && y == 0.0f &&
                                                        width == 0.0f && height 
== 0.0f);
                                }
                        }

        // Get or set the X co-ordinate.
        public float X
                        {
                                get
                                {
                                        return x;
                                }
                                set
                                {
                                        x = value;
                                }
                        }

        // Get or set the Y co-ordinate.
        public float Y
                        {
                                get
                                {
                                        return y;
                                }
                                set
                                {
                                        y = value;
                                }
                        }

        // Get or set the width.
        public float Width
                        {
                                get
                                {
                                        return width;
                                }
                                set
                                {
                                        width = value;
                                }
                        }

        // Get or set the height.
        public float Height
                        {
                                get
                                {
                                        return height;
                                }
                                set
                                {
                                        height = value;
                                }
                        }

        // Get the bottom edge of the rectangle.
        public float Bottom
                        {
                                get
                                {
                                        return y + height;
                                }
                        }

        // Get the left edge of the rectangle.
        public float Left
                        {
                                get
                                {
                                        return x;
                                }
                        }

        // Get the right edge of the rectangle.
        public float Right
                        {
                                get
                                {
                                        return x + width;
                                }
                        }

        // Get the top edge of the rectangle.
        public float Top
                        {
                                get
                                {
                                        return y;
                                }
                        }

        // Get or set the location of the top-left corner.
        public PointF Location
                        {
                                get
                                {
                                        return new PointF(x, y);
                                }
                                set
                                {
                                        x = value.X;
                                        y = value.Y;
                                }
                        }

        // Get or set the size of the rectangle.
        public SizeF Size
                        {
                                get
                                {
                                        return new SizeF(width, height);
                                }
                                set
                                {
                                        width = value.Width;
                                        height = value.Height;
                                }
                        }

        // Determine if a rectangle contains a point.
        public bool Contains(float x, float y)
                        {
                                return (x >= this.x && x < (this.x + 
this.width) &&
                                        y >= this.y && x < (this.y + 
this.height));
                        }
        public bool Contains(PointF pt)
                        {
                                return Contains(pt.X, pt.Y);
                        }

        // Determine if one rectangle contains another.
        public bool Contains(RectangleF rect)
                        {
                                if(rect.x >= this.x &&
                                   (rect.x + rect.width) <= (this.x + 
this.width) &&
                                   rect.y >= this.y &&
                                   (rect.y + rect.height) <= (this.y + 
this.height))
                                {
                                        return true;
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Determine if two rectangles are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is RectangleF)
                                {
                                        RectangleF other = (RectangleF)obj;
                                        return (x == other.x && y == other.y &&
                                                width == other.width && height 
== other.height);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Convert left, top, right, bottom values into a rectangle.
        public static RectangleF FromLTRB
                                (float left, float top, float right, float 
bottom)
                        {
                                return new RectangleF(left, top, right - left, 
bottom - top);
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return base.GetHashCode();
                        }

        // Inflate this rectangle.
        public void Inflate(float width, float height)
                        {
                                this.x -= width;
                                this.y -= height;
                                this.width += width * 2;
                                this.height += height * 2;
                        }
        public void Inflate(SizeF size)
                        {
                                Inflate(size.Width, size.Height);
                        }

        // Inflate a specific rectangle without modifying it.
        public static RectangleF Inflate(RectangleF rect, float x, float y)
                        {
                                return new RectangleF(rect.x - x, rect.y - y,
                                                                          
rect.width + x * 2, rect.height + y * 2);
                        }

        // Form the intersection of another rectangle with this one.
        public void Intersect(RectangleF rect)
                        {
                                float left, top, right, bottom;
                                left = x;
                                if(left < rect.x)
                                {
                                        left = rect.x;
                                }
                                top = y;
                                if(top < rect.y)
                                {
                                        top = rect.y;
                                }
                                right = x + width;
                                if(right > (rect.x + rect.width))
                                {
                                        right = (rect.x + rect.width);
                                }
                                bottom = y + height;
                                if(bottom > (rect.y + rect.height))
                                {
                                        bottom = (rect.y + rect.height);
                                }
                                if(left < right && top < bottom)
                                {
                                        x = left;
                                        y = top;
                                        width = right - left;
                                        height = bottom - top;
                                }
                                else
                                {
                                        x = 0.0f;
                                        y = 0.0f;
                                        width = 0.0f;
                                        height = 0.0f;
                                }
                        }

        // Form the intersection of two rectangles.
        public static RectangleF Intersect(RectangleF a, RectangleF b)
                        {
                                a.Intersect(b);
                                return a;
                        }

        // Determine if this rectangle intersects with another.
        public bool IntersectsWith(RectangleF rect)
                        {
                                return (rect.x < (x + width) &&
                                        (rect.x + rect.width) >= x &&
                                        rect.y < (y + height) &&
                                        (rect.y + rect.height) >= y);
                        }

        // Offset this rectangle by a point.
        public void Offset(float x, float y)
                        {
                                this.x += x;
                                this.y += y;
                        }
        public void Offset(PointF pos)
                        {
                                this.x += pos.X;
                                this.y += pos.Y;
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{X=" + x.ToString() +
                                       ",Y=" + y.ToString() +
                                           ",Width=" + width.ToString() +
                                           ",Height=" + height.ToString() + "}";
                        }

        // Get the union of two rectangles.
        public static RectangleF Union(RectangleF a, RectangleF b)
                        {
                                float left, top, right, bottom;
                                left = a.x;
                                if(left > b.x)
                                {
                                        left = b.x;
                                }
                                top = a.y;
                                if(top > b.y)
                                {
                                        top = b.y;
                                }
                                right = a.x + a.width;
                                if(right < (b.x + b.width))
                                {
                                        right = b.x + b.width;
                                }
                                bottom = a.y + a.height;
                                if(bottom < (b.y + b.height))
                                {
                                        bottom = b.y + b.height;
                                }
                                return new RectangleF(left, top, right - left, 
bottom - top);
                        }

        // Overloaded operators.
        public static bool operator==(RectangleF left, RectangleF right)
                        {
                                return (left.x == right.x &&
                                                left.y == right.y &&
                                                left.width == right.width &&
                                                left.height == right.height);
                        }
        public static bool operator!=(RectangleF left, RectangleF right)
                        {
                                return (left.x != right.x ||
                                                left.y != right.y ||
                                                left.width != right.width ||
                                                left.height != right.height);
                        }
        public static implicit operator RectangleF(Rectangle r)
                        {
                                return new RectangleF(r.X, r.Y, r.Width, 
r.Height);
                        }

}; // struct RectangleF
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Region.cs - Implementation of the "System.Drawing.Region" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;
using System.Drawing.Drawing2D;
using System.Drawing.Toolkit;

[ComVisible(false)]
public sealed class Region : MarshalByRefObject, IDisposable
{
        // Constructors.
        public Region()
                        {
                                // Infinite region
                                // TODO
                        }
        public Region(GraphicsPath path)
                        {
                                if(path == null)
                                {
                                        throw new ArgumentNullException("path");
                                }
                                // TODO
                        }
        public Region(Rectangle rect)
                        {
                                // TODO
                        }
        public Region(RectangleF rect)
                        {
                                // TODO
                        }
        public Region(RegionData rgnData)
                        {
                                if(rgnData == null)
                                {
                                        throw new 
ArgumentNullException("rgnData");
                                }
                                // TODO
                        }

        // Destructor.
        ~Region()
                        {
                                Dispose();
                        }

        // Make an exact copy of this region.
        [TODO]
        public Region Clone()
                        {
                                // TODO
                                return this;
                        }

        // Form the complement of subtracting this region from another.
        [TODO]
        public void Complement(GraphicsPath path)
                        {
                                // TODO
                        }
        [TODO]
        public void Complement(Rectangle rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Complement(RectangleF rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Complement(Region region)
                        {
                                // TODO
                        }

        // Dispose of this region.
        public void Dispose()
                        {
                                // Nothing to do in this implementation.
                        }

        // Determine if two regions are equal after applying a transformation.
        [TODO]
        public bool Equals(Region region, Graphics g)
                        {
                                if(region == null)
                                {
                                        throw new 
ArgumentNullException("region");
                                }
                                if(g == null)
                                {
                                        throw new ArgumentNullException("g");
                                }
                                // TODO
                                return false;
                        }

        // Subtract another region from this one.
        [TODO]
        public void Exclude(GraphicsPath path)
                        {
                                // TODO
                        }
        [TODO]
        public void Exclude(Rectangle rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Exclude(RectangleF rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Exclude(Region region)
                        {
                                // TODO
                        }

        // Create a region object from a HRGN.
        [TODO]
        public static Region FromHrgn(IntPtr hrgn)
                        {
                                // TODO
                                return new Region();
                        }

        // Get the bounds of this region on a particular graphics object.
        [TODO]
        public RectangleF GetBounds(Graphics graphics)
                        {
                                // TODO
                                return RectangleF.Empty;
                        }

        // Get a HRGN object for this region.
        [TODO]
        public IntPtr GetHrgn(Graphics g)
                        {
                                // TODO
                                return IntPtr.Zero;
                        }

        // Get the raw region data for this region.
        [TODO]
        public RegionData GetRegionData()
                        {
                                // TODO
                                return null;
                        }

        // Get an array of rectangles that represents this region.
        public RectangleF[] GetRegionScans(Matrix matrix)
                        {
                                // TODO
                                return null;
                        }

        // Form the intersection of this region and another.
        [TODO]
        public void Intersect(GraphicsPath path)
                        {
                                // TODO
                        }
        [TODO]
        public void Intersect(Rectangle rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Intersect(RectangleF rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Intersect(Region region)
                        {
                                // TODO
                        }

        // Determine if this region is empty on a particular graphics object.
        [TODO]
        public bool IsEmpty(Graphics g)
                        {
                                // TODO
                                return false;
                        }

        // Determine if this region is infinite on a particular graphics object.
        [TODO]
        public bool IsInfinite(Graphics g)
                        {
                                // TODO
                                return false;
                        }

        // Determine if a point is contained within this region.
        [TODO]
        public bool IsVisible(Point point)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(PointF point)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(Rectangle rect)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(RectangleF rect)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(Point point, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(PointF point, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(Rectangle rect, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(RectangleF rect, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(float x, float y)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(int x, int y, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(float x, float y, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(int x, int y, int width, int height)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(float x, float y, float width, float height)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(int x, int y, int width, int height, Graphics g)
                        {
                                // TODO
                                return false;
                        }
        [TODO]
        public bool IsVisible(float x, float y, float width,
                                                  float height, Graphics g)
                        {
                                // TODO
                                return false;
                        }

        // Make this region empty.
        [TODO]
        public void MakeEmpty()
                        {
                                // TODO
                        }

        // Make this region infinite.
        [TODO]
        public void MakeInfinite()
                        {
                                // TODO
                        }

        // Transform this region using a specified matrix.
        [TODO]
        public void Transform(Matrix matrix)
                        {
                                // TODO
                        }

        // Translate this matrix by a specific amount.
        [TODO]
        public void Translate(int dx, int dy)
                        {
                                // TODO
                        }
        [TODO]
        public void Translate(float dx, float dy)
                        {
                                // TODO
                        }

        // Form the union of this region and another.
        [TODO]
        public void Union(GraphicsPath path)
                        {
                                // TODO
                        }
        [TODO]
        public void Union(Rectangle rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Union(RectangleF rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Union(Region region)
                        {
                                // TODO
                        }

        // Form the XOR of this region and another.
        [TODO]
        public void Xor(GraphicsPath path)
                        {
                                // TODO
                        }
        [TODO]
        public void Xor(Rectangle rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Xor(RectangleF rect)
                        {
                                // TODO
                        }
        [TODO]
        public void Xor(Region region)
                        {
                                // TODO
                        }

}; // class Region

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * RotateFlipType.cs - Implementation of the
 *                      "System.Drawing.RotateFlipType" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum RotateFlipType
{
        RotateNoneFlipNone      = 0,
        Rotate90FlipNone        = 1,
        Rotate180FlipNone       = 2,
        Rotate270FlipNone       = 3,
        RotateNoneFlipX         = 4,
        Rotate90FlipX           = 5,
        Rotate180FlipX          = 6,
        Rotate270FlipX          = 7,

        Rotate180FlipXY         = RotateNoneFlipNone,
        Rotate270FlipXY         = Rotate90FlipNone,
        RotateNoneFlipXY        = Rotate180FlipNone,
        Rotate90FlipXY          = Rotate270FlipNone,
        Rotate180FlipY          = RotateNoneFlipX,
        Rotate270FlipY          = Rotate90FlipX,
        RotateNoneFlipY         = Rotate180FlipX,
        Rotate90FlipY           = Rotate270FlipX

}; // enum RotateFlipType
        
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * S.cs - Implementation of string resource handling for "System.Drawing".
 *
 * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Reflection;
using System.Resources;

// This class provides string resource support to the rest
// of the System.Drawing library assembly.  It is accessed using
// the "S._(tag)" convention.

internal sealed class S
{

#if CONFIG_RUNTIME_INFRA

        // Cached copy of the resources for this assembly and mscorlib.
#if ECMA_COMPAT
        private static ECMAResourceManager drawingResources = null;
        private static ECMAResourceManager runtimeResources = null;
#else
        private static ResourceManager drawingResources = null;
        private static ResourceManager runtimeResources = null;
#endif

        // Helper for obtaining string resources for this assembly.
        public static String _(String tag)
                        {
                                lock(typeof(S))
                                {
                                        String value;

                                        // Try the resources in the 
"System.Drawing" assembly first.
                                        if(drawingResources == null)
                                        {
                                        #if ECMA_COMPAT
                                                drawingResources = new 
ECMAResourceManager
                                                        ("System.Drawing", 
(typeof(S)).Assembly);
                                        #else
                                                drawingResources = new 
ResourceManager
                                                        ("System.Drawing", 
(typeof(S)).Assembly);
                                        #endif
                                        }
                                        value = drawingResources.GetString(tag, 
null);
                                        if(value != null)
                                        {
                                                return value;
                                        }

                                        // Try the fallbacks in the runtime 
library.
                                        if(runtimeResources == null)
                                        {
                                        #if ECMA_COMPAT
                                                runtimeResources = new 
ECMAResourceManager
                                                        ("runtime", 
(typeof(String)).Assembly);
                                        #else
                                                runtimeResources = new 
ResourceManager
                                                        ("runtime", 
(typeof(String)).Assembly);
                                        #endif
                                        }
                                        return runtimeResources.GetString(tag, 
null);
                                }
                        }

#else // !CONFIG_RUNTIME_INFRA

        // We don't have sufficient runtime infrastructure to load resources.
        public static String _(String tag)
                        {
                                return tag;
                        }

#endif // !CONFIG_RUNTIME_INFRA

}; // class S

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * Size.cs - Implementation of the "System.Drawing.Size" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;
using System.ComponentModel;

[Serializable]
[ComVisible(true)]
[TypeConverter("System.Drawing.SizeConverter")]
public struct Size
{
        // Internal state.
        private int width;
        private int height;

        // The empty size.
        public static readonly Size Empty = new Size(0, 0);

        // Constructors.
        public Size(Point pt)
                        {
                                width = pt.X;
                                height = pt.Y;
                        }
        public Size(int width, int height)
                        {
                                this.width = width;
                                this.height = height;
                        }

        // Determine if this size is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (width == 0 && height == 0);
                                }
                        }

        // Get or set the width.
        public int Width
                        {
                                get
                                {
                                        return width;
                                }
                                set
                                {
                                        width = value;
                                }
                        }

        // Get or set the height.
        public int Height
                        {
                                get
                                {
                                        return height;
                                }
                                set
                                {
                                        height = value;
                                }
                        }

        // Convert a SizeF object into a Size object using ceiling conversion.
        public static Size Ceiling(SizeF value)
                        {
                                return new 
Size((int)(Math.Ceiling(value.Width)),
                                                                
(int)(Math.Ceiling(value.Height)));
                        }

        // Determine if two sizes are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is Size)
                                {
                                        Size other = (Size)obj;
                                        return (width == other.width && height 
== other.height);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return (width ^ height);
                        }

        // Convert a SizeF object into a Size object using rounding conversion.
        public static Size Round(SizeF value)
                        {
                                return new Size((int)(Math.Round(value.Width)),
                                                                
(int)(Math.Round(value.Height)));
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{Width=" + width.ToString() +
                                           ", Height=" + height.ToString() + 
"}";
                        }

        // Convert a SizeF object into a Size object using truncating 
conversion.
        public static Size Truncate(SizeF value)
                        {
                                return new Size((int)(value.Width), 
(int)(value.Height));
                        }

        // Overloaded operators.
        public static Size operator+(Size sz1, Size sz2)
                        {
                                return new Size(sz1.width + sz2.width, 
sz1.height + sz2.height);
                        }
        public static Size operator-(Size sz1, Size sz2)
                        {
                                return new Size(sz1.width - sz2.width, 
sz1.height - sz2.height);
                        }
        public static bool operator==(Size left, Size right)
                        {
                                return (left.width == right.width &&
                                                left.height == right.height);
                        }
        public static bool operator!=(Size left, Size right)
                        {
                                return (left.width != right.width ||
                                                left.height != right.height);
                        }
        public static explicit operator Point(Size size)
                        {
                                return new Point(size.width, size.height);
                        }
        public static implicit operator SizeF(Size size)
                        {
                                return new SizeF(size.width, size.height);
                        }

}; // struct Size
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * SizeF.cs - Implementation of the "System.Drawing.SizeF" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Runtime.InteropServices;

[Serializable]
[ComVisible(true)]
public struct SizeF
{
        // Internal state.
        private float width;
        private float height;

        // The empty size.
        public static readonly SizeF Empty = new SizeF(0.0f, 0.0f);

        // Constructors.
        public SizeF(PointF pt)
                        {
                                width = pt.X;
                                height = pt.Y;
                        }
        public SizeF(SizeF size)
                        {
                                width = size.width;
                                height = size.height;
                        }
        public SizeF(float width, float height)
                        {
                                this.width = width;
                                this.height = height;
                        }

        // Determine if this size is empty.
        public bool IsEmpty
                        {
                                get
                                {
                                        return (width == 0.0f && height == 
0.0f);
                                }
                        }

        // Get or set the width.
        public float Width
                        {
                                get
                                {
                                        return width;
                                }
                                set
                                {
                                        width = value;
                                }
                        }

        // Get or set the height.
        public float Height
                        {
                                get
                                {
                                        return height;
                                }
                                set
                                {
                                        height = value;
                                }
                        }

        // Determine if two sizes are equal.
        public override bool Equals(Object obj)
                        {
                                if(obj is SizeF)
                                {
                                        SizeF other = (SizeF)obj;
                                        return (width == other.width && height 
== other.height);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return base.GetHashCode();
                        }

        // Convert this size into a point.
        public PointF ToPointF()
                        {
                                return new PointF(width, height);
                        }

        // Convert this size into its integer form.
        public Size ToSize()
                        {
                                return new Size((int)width, (int)height);
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                return "{Width=" + width.ToString() +
                                           ", Height=" + height.ToString() + 
"}";
                        }

        // Overloaded operators.
        public static SizeF operator+(SizeF sz1, SizeF sz2)
                        {
                                return new SizeF(sz1.width + sz2.width,
                                                                 sz1.height + 
sz2.height);
                        }
        public static SizeF operator-(SizeF sz1, SizeF sz2)
                        {
                                return new SizeF(sz1.width - sz2.width,
                                                                 sz1.height - 
sz2.height);
                        }
        public static bool operator==(SizeF left, SizeF right)
                        {
                                return (left.width == right.width &&
                                                left.height == right.height);
                        }
        public static bool operator!=(SizeF left, SizeF right)
                        {
                                return (left.width != right.width ||
                                                left.height != right.height);
                        }
        public static explicit operator PointF(SizeF size)
                        {
                                return new PointF(size.width, size.height);
                        }

}; // struct SizeF
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * SolidBrush.cs - Implementation of the "System.Drawing.SolidBrush" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Drawing.Toolkit;

public sealed class SolidBrush : Brush
{
        // Internal state.
        private Color color;

        // Constructor.
        public SolidBrush(Color color)
                        {
                                this.color = color;
                        }

        // Get or set the color of this brush.
        public Color Color
                        {
                                get
                                {
                                        return color;
                                }
                                set
                                {
                                        if(color != value)
                                        {
                                                color = value;
                                                Modified();
                                        }
                                }
                        }

        // Clone this brush.
        public override Object Clone()
                        {
                                return new SolidBrush(color);
                        }

        // Create this brush for a specific toolkit.  Inner part of 
"GetBrush()".
        internal override IToolkitBrush CreateBrush(IToolkit toolkit)
                        {
                                return toolkit.CreateSolidBrush(color);
                        }

}; // class SolidBrush

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringAlignment.cs - Implementation of the
 *                      "System.Drawing.StringAlignment" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum StringAlignment
{
        Near    = 0,
        Center  = 1,
        Far             = 2,

}; // enum StringAlignment
        
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringDigitSubstitute.cs - Implementation of the
 *                      "System.Drawing.StringDigitSubstitute" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum StringDigitSubstitute
{
        User                    = 0,
        None                    = 1,
        National                = 2,
        Traditional             = 3

}; // enum StringDigitSubstitute
        
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringFormat.cs - Implementation of the "System.Drawing.StringFormat" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

using System.Drawing.Toolkit;

public class StringFormat
{
        // TODO

}; // class StringFormat

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringFormatFlags.cs - Implementation of the
 *                      "System.Drawing.StringFormatFlags" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

[Flags]
public enum StringFormatFlags
{
        DirectionRightToLeft    = 0x0001,
        DirectionVertical               = 0x0002,
        FitBlackBox                             = 0x0004,
        DisplayFormatControl    = 0x0020,
        NoFontFallback                  = 0x0400,
        MeasureTrailingSpaces   = 0x0800,
        NoWrap                                  = 0x1000,
        LineLimit                               = 0x2000,
        NoClip                                  = 0x4000

}; // enum StringFormatFlags
        
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringTrimming.cs - Implementation of the
 *                      "System.Drawing.StringTrimming" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum StringTrimming
{
        None                            = 0,
        Character                       = 1,
        Word                            = 2,
        EllipsisCharacter       = 3,
        EllipsisWord            = 4,
        EllipsisPath            = 5

}; // enum StringTrimming
        
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * StringUnit.cs - Implementation of the
 *                      "System.Drawing.StringUnit" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public enum StringUnit
{
        World           = 0,
        Display         = 1,
        Pixel           = 2,
        Point           = 3,
        Inch            = 4,
        Document        = 5,
        Millimeter      = 6,
        Em                      = 32

}; // enum StringUnit
        
}; // namespace System.Drawing

--- NEW FILE ---
<?xml version="1.0"?>
<project name="pnetlib System.Drawing" default="all">
        <target name="all">

                <!-- Build the primary System.Drawing.dll library -->
                <compile output="System.Drawing.dll"
                                 target="library"
                                 unsafe="true"
                                 nostdlib="true"
                                 debug="${CONFIG_DEBUG_LINES}"
                                 optimize="true">

                        <sources>
                                <includes name="**/*.cs"/>
                        </sources>

                        <references>
                                <file name="../System/first/System.dll"/>
                                <file name="../DotGNU.SSL/DotGNU.SSL.dll"/>
                                <file name="../runtime/mscorlib.dll"/>
                        </references>

<!--
                        <resources>
                                <includes if="${CONFIG_RUNTIME_INFRA}"
                                        
name="../resources/en_US/System.Drawing/System.Drawing.resources"/>
                        </resources>
-->

                        <arg compiler="cscc" value="-Wno-empty-input"/>
                        <arg compiler="cscc" value="-fminimize-parameters"/>
                        <arg compiler="csc" value="/nowarn:626"/>
                        <arg compiler="csc" value="/nowarn:649"/>
                        <arg compiler="csc" value="/nowarn:168"/>
                        <arg compiler="csc" value="/nowarn:67"/>
                        <arg compiler="csc" value="/nowarn:169"/>
                        <arg compiler="csc" value="/nowarn:679"/>
                </compile>

        </target>
</project>

--- NEW FILE ---
/*
 * SystemBrushes.cs - Implementation of the
 *                      "System.Drawing.SystemBrushes" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public sealed class SystemBrushes
{
        // Cannot instantiate this class.
        private SystemBrushes() {}

        // Get a brush for a system color.
        public static Brush FromSystemColor(Color c)
                        {
                                return new SolidBrush(c);
                        }

        // Standard system brush objects.
        public static Brush ActiveBorder
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ActiveBorder);
                                }
                        }
        public static Brush ActiveCaption
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ActiveCaption);
                                }
                        }
        public static Brush ActiveCaptionText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ActiveCaptionText);
                                }
                        }
        public static Brush AppWorkspace
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.AppWorkspace);
                                }
                        }
        public static Brush Control
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Control);
                                }
                        }
        public static Brush ControlDark
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ControlDark);
                                }
                        }
        public static Brush ControlDarkDark
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ControlDarkDark);
                                }
                        }
        public static Brush ControlLight
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ControlLight);
                                }
                        }
        public static Brush ControlLightLight
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ControlLightLight);
                                }
                        }
        public static Brush ControlText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ControlText);
                                }
                        }
        public static Brush Desktop
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Desktop);
                                }
                        }
        public static Brush GrayText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.GrayText);
                                }
                        }
        public static Brush Highlight
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Highlight);
                                }
                        }
        public static Brush HighlightText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.HighlightText);
                                }
                        }
        public static Brush HotTrack
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.HotTrack);
                                }
                        }
        public static Brush InactiveBorder
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.InactiveBorder);
                                }
                        }
        public static Brush InactiveCaption
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.InactiveCaption);
                                }
                        }
        public static Brush InactiveCaptionText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.InactiveCaptionText);
                                }
                        }
        public static Brush Info
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Info);
                                }
                        }
        public static Brush InfoText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.InfoText);
                                }
                        }
        public static Brush Menu
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Menu);
                                }
                        }
        public static Brush MenuText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.MenuText);
                                }
                        }
        public static Brush ScrollBar
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.ScrollBar);
                                }
                        }
        public static Brush Window
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.Window);
                                }
                        }
        public static Brush WindowFrame
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.WindowFrame);
                                }
                        }
        public static Brush WindowText
                        {
                                get
                                {
                                        return new 
SolidBrush(SystemColors.WindowText);
                                }
                        }

}; // class SystemBrushes

}; // namespace System.Drawing

--- NEW FILE ---
/*
 * SystemColors.cs - Implementation of the "System.Drawing.SystemColors" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

public sealed class SystemColors
{
        // Cannot instantiate this class.
        private SystemColors() {}

        // Define the system color values as properties.
        public static Color ActiveBorder
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ActiveBorder);
                                }
                        }
        public static Color ActiveCaption
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ActiveCaption);
                                }
                        }
        public static Color ActiveCaptionText
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ActiveCaptionText);
                                }
                        }
        public static Color AppWorkspace
                        {
                                get
                                {
                                        return new 
Color(KnownColor.AppWorkspace);
                                }
                        }
        public static Color Control
                        {
                                get
                                {
                                        return new Color(KnownColor.Control);
                                }
                        }
        public static Color ControlDark
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ControlDark);
                                }
                        }
        public static Color ControlDarkDark
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ControlDarkDark);
                                }
                        }
        public static Color ControlLight
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ControlLight);
                                }
                        }
        public static Color ControlLightLight
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ControlLightLight);
                                }
                        }
        public static Color ControlText
                        {
                                get
                                {
                                        return new 
Color(KnownColor.ControlText);
                                }
                        }
        public static Color Desktop
                        {
                                get
                                {
                                        return new Color(KnownColor.Desktop);
                                }
                        }
        public static Color GrayText
                        {
                                get
                                {
                                        return new Color(KnownColor.GrayText);
                                }
                        }
        public static Color Highlight
                        {
                                get
                                {
                                        return new Color(KnownColor.Highlight);
                                }
                        }
        public static Color HighlightText
                        {
                                get
                                {
                                        return new 
Color(KnownColor.HighlightText);
                                }
                        }
        public static Color HotTrack
                        {
                                get
                                {
                                        return new Color(KnownColor.HotTrack);
                                }
                        }
        public static Color InactiveBorder
                        {
                                get
                                {
                                        return new 
Color(KnownColor.InactiveBorder);
                                }
                        }
        public static Color InactiveCaption
                        {
                                get
                                {
                                        return new 
Color(KnownColor.InactiveCaption);
                                }
                        }
        public static Color InactiveCaptionText
                        {
                                get
                                {
                                        return new 
Color(KnownColor.InactiveCaptionText);
                                }
                        }
        public static Color Info
                        {
                                get
                                {
                                        return new Color(KnownColor.Info);
                                }
                        }
        public static Color InfoText
                        {
                                get
                                {
                                        return new Color(KnownColor.InfoText);
                                }
                        }
        public static Color Menu
                        {
                                get
                                {
                                        return new Color(KnownColor.Menu);
                                }
                        }
        public static Color MenuText
                        {
                                get
                                {
                                        return new Color(KnownColor.MenuText);
                                }
                        }
        public static Color ScrollBar
                        {
                                get
                                {
                                        return new Color(KnownColor.ScrollBar);
                                }
                        }
        public static Color Window
                        {
                                get
                                {
                                        return new Color(KnownColor.Window);
                                }
                        }
        public static Color WindowFrame
                        {
                                get
                                {
                                        return new 
Color(KnownColor.WindowFrame);
                                }
                        }
        public static Color WindowText
                        {
                                get
                                {
                                        return new Color(KnownColor.WindowText);
                                }
                        }

}; // class SystemColors
                
}; // namespace System.Drawing

--- NEW FILE ---
/*
 * TODOAttribute.cs - Implementation of the
 *                      "System.Drawing.TODOAttribute" class.
 *
 * Copyright (C) 2001, 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Drawing
{

// This is a pseudo attribute which is used to tag classes, methods,
// fields, properties, etc, that are not yet complete.  This allows
// automated tools to scan the resulting binary to provide a list
// of incomplete sections of the code.

[AttributeUsage(AttributeTargets.All, AllowMultiple=false, Inherited=true)]
internal sealed class TODOAttribute : Attribute
{
        public TODOAttribute()
        {
                // Nothing to do here.
        }

}; // class TODOAttribute

}; // namespace System.Drawing





reply via email to

[Prev in Thread] Current Thread [Next in Thread]