Permalink
Browse files

Some steps to integrate Mono's System.Drawing bitmap test suite

  • Loading branch information...
1 parent 7e0132e commit 5dca571c62c5c6cb7ded91c715e275d6b90ffe18 @migueldeicaza migueldeicaza committed Apr 13, 2012
View
@@ -4,17 +4,21 @@ MONO_SYSD=../mono/mcs/class/System.Drawing
MONO_SOURCES = \
$(MONO_SYSD)/../../build/common/Locale.cs \
+ $(MONO_SYSD)/System.Drawing/GraphicsUnit.cs \
$(MONO_SYSD)/System.Drawing/ImageConverter.cs \
$(MONO_SYSD)/System.Drawing/ImageFormatConverter.cs \
$(MONO_SYSD)/System.Drawing/StringAligment.cs \
$(MONO_SYSD)/System.Drawing/SystemColors.cs \
$(MONO_SYSD)/System.Drawing/ToolboxBitmapAttribute.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/Blend.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/ColorBlend.cs \
+ $(MONO_SYSD)/System.Drawing.Drawing2D/CombineMode.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/CompostingMode.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/FillMode.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/MatrixOrder.cs \
+ $(MONO_SYSD)/System.Drawing.Drawing2D/PathData.cs \
$(MONO_SYSD)/System.Drawing.Drawing2D/PathPointType.cs \
+ $(MONO_SYSD)/System.Drawing.Text/TextRenderingHint.cs \
$(MONO_SYSD)/System.Drawing.Imaging/ImageFormat.cs \
$(MONO_SYSD)/System.Drawing.Imaging/PixelFormat.cs \
$(MONO_SYSD)/System.Drawing.Printing/PrintPageEventHandler.cs \
@@ -41,7 +45,6 @@ SOURCES = \
./System.Drawing/StringFormat.cs \
./System.Drawing.Drawing2D/GraphicsPath.cs \
./System.Drawing.Drawing2D/Matrix.cs \
- ./System.Drawing.Drawing2D/PathData.cs \
./System.Drawing.Printing/PageSettings.cs \
./System.Drawing.Printing/PrintDocument.cs \
./System.Drawing.Printing/PrinterSettings.cs \
@@ -121,6 +121,13 @@ public Color GetPixel (int x, int y)
public void SetResolution (float xDpi, float yDpi)
{
+ throw new NotImplementedException ();
}
+
+ public void Save (string path)
+ {
+ throw new NotImplementedException ();
+ }
+
}
}
@@ -13,6 +13,8 @@
using System;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
+using System.Drawing.Text;
+
#if MONOMAC
using MonoMac.CoreGraphics;
#else
@@ -401,6 +403,10 @@ public void FillPath (Brush brush, GraphicsPath path)
}
}
+ public GraphicsUnit PageUnit { get; set; }
+ public float PageScale { get; set; }
+ public TextRenderingHint TextRenderingHint { get; set; }
+
public static Graphics FromImage (Image image)
{
if (image == null)
@@ -411,5 +417,45 @@ public static Graphics FromImage (Image image)
return null; // TODO
}
+
+ public void SetClip (RectangleF rect)
+ {
+ SetClip (rect, CombineMode.Replace);
+ }
+
+ public void SetClip (Rectangle rect)
+ {
+ SetClip (rect, CombineMode.Replace);
+ }
+
+ public void SetClip (GraphicsPath graphicsPath)
+ {
+ SetClip (graphicsPath, CombineMode.Replace);
+ }
+
+ public void SetClip (Graphics g)
+ {
+ SetClip (g, CombineMode.Replace);
+ }
+
+ public void SetClip (RectangleF rect, CombineMode combineMode)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetClip (Rectangle rect, CombineMode combineMode)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetClip (GraphicsPath graphicsPath, CombineMode combineMode)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetClip (Graphics g, CombineMode combineMode)
+ {
+ throw new NotImplementedException ();
+ }
}
}
@@ -20,7 +20,7 @@ public sealed partial class Pen : MarshalByRefObject, IDisposable, ICloneable {
Brush brush;
Color color;
bool changed = true;
- bool isModifiable;
+ internal bool isModifiable;
float width;
public Pen (Brush brush) : this (brush, 1f) {}
View
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+using MonoTouch.NUnit.UI;
+
+namespace Tests
+{
+ [Register ("AppDelegate")]
+ public partial class AppDelegate : UIApplicationDelegate
+ {
+ UIWindow window;
+ TouchRunner runner;
+
+ public override bool FinishedLaunching (UIApplication app, NSDictionary options)
+ {
+ // create a new window instance based on the screen size
+ window = new UIWindow (UIScreen.MainScreen.Bounds);
+ runner = new TouchRunner (window);
+
+ runner.Add (System.Reflection.Assembly.GetExecutingAssembly ());
+
+ window.RootViewController = new UINavigationController (runner.GetViewController ());
+
+ window.MakeKeyAndVisible ();
+
+ return true;
+ }
+ }
+}
+
@@ -0,0 +1,12 @@
+using System;
+
+namespace System
+{
+ public class CategoryAttribute :Attribute
+ {
+ public CategoryAttribute (string title)
+ {
+ }
+ }
+}
+
View
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>UIDeviceFamily</key>
+ <array>
+ <integer>1</integer>
+ <integer>2</integer>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+
+namespace Tests
+{
+ public class Application
+ {
+ // This is the main entry point of the application.
+ static void Main (string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main (args, null, "AppDelegate");
+ }
+ }
+}
View
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{AED51B37-AB93-4A7B-B293-2FABCDCAE4AB}</ProjectGuid>
+ <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>Tests</RootNamespace>
+ <AssemblyName>Tests</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
+ <DefineConstants>DEBUG;MONOTOUCH</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <MtouchDebug>true</MtouchDebug>
+ <MtouchProfiling>true</MtouchProfiling>
+ <MtouchLink>None</MtouchLink>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <MtouchLink>None</MtouchLink>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\iPhone\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <CodesignKey>iPhone Developer</CodesignKey>
+ <MtouchDebug>true</MtouchDebug>
+ <MtouchProfiling>true</MtouchProfiling>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\iPhone\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <CodesignKey>iPhone Developer</CodesignKey>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" />
+ <Reference Include="monotouch" />
+ <Reference Include="MonoTouch.NUnitLite" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Info.plist" />
+ <None Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Exocortex.DSP.v1.csproj">
+ <Link>DrawingTest\Exocortex.DSP.v1.csproj</Link>
+ </None>
+ <None Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.csproj">
+ <Link>DrawingTest\Exocortex.DSP20.v1.csproj</Link>
+ </None>
+ <None Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.J2EE.csproj">
+ <Link>DrawingTest\Exocortex.DSP20.v1.J2EE.csproj</Link>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Main.cs" />
+ <Compile Include="AppDelegate.cs" />
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\DrawingTestHelper\DrawingTest.cs">
+ <Link>DrawingTest\DrawingTest.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\DrawingTestHelper\PDComparer.cs">
+ <Link>DrawingTest\PDComparer.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\AssemblyInfo.cs">
+ <Link>DrawingTest\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Complex.cs">
+ <Link>DrawingTest\Complex.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\ComplexArray.cs">
+ <Link>DrawingTest\ComplexArray.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\ComplexF.cs">
+ <Link>DrawingTest\ComplexF.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\ComplexMath.cs">
+ <Link>DrawingTest\ComplexMath.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\ComplexStats.cs">
+ <Link>DrawingTest\ComplexStats.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Fourier.cs">
+ <Link>DrawingTest\Fourier.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\FourierDirection.cs">
+ <Link>DrawingTest\FourierDirection.cs</Link>
+ </Compile>
+ <Compile Include="..\..\mono\mcs\class\System.Drawing\Test\DrawingTest\Test\Graphics.cs">
+ <Link>DrawingTest\Graphics.cs</Link>
+ </Compile>
+ <Compile Include="Helper\Attributes.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <Folder Include="DrawingTest\" />
+ <Folder Include="Helper\" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\sysdrawing-coregraphics.csproj">
+ <Project>{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}</Project>
+ <Name>sysdrawing-coregraphics</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project>
View
@@ -0,0 +1,18 @@
+using System;
+
+namespace System.Drawing
+{
+ public class Locale
+ {
+ public static string GetText (string format)
+ {
+ return format;
+ }
+
+ public static string GetText (string format, params object [] args)
+ {
+ return string.Format (format, args);
+ }
+ }
+}
+
@@ -13,7 +13,10 @@ public override void Draw (RectangleF rect)
{
var ctx = new Graphics (UIGraphics.GetCurrentContext ());
- ctx.DrawLine (new Pen (new SolidBrush (Color.Red)), new PointF (1, 1), new PointF (100, 100));
+ var red = new SolidBrush (Color.Red);
+
+ ctx.DrawLine (new Pen (red), new PointF (1, 1), new PointF (100, 100));
+
ctx.Dispose ();
}
}
@@ -121,8 +121,26 @@
<Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing.Drawing2D\PathData.cs">
<Link>External\PathData.cs</Link>
</Compile>
+ <Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing\GraphicsUnit.cs">
+ <Link>External\GraphicsUnit.cs</Link>
+ </Compile>
+ <Compile Include="Utilities\Locale.cs" />
+ <Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing.Text\TextRenderingHint.cs">
+ <Link>External\TextRenderingHint.cs</Link>
+ </Compile>
+ <Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing\Pens.cs">
+ <Link>External\Pens.cs</Link>
+ </Compile>
+ <Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing\Brushes.cs">
+ <Link>External\Brushes.cs</Link>
+ </Compile>
+ <Compile Include="..\mono\mcs\class\System.Drawing\System.Drawing.Drawing2D\CombineMode.cs">
+ <Link>External\CombineMode.cs</Link>
+ </Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="External\" />
+ <Folder Include="Utilities\" />
+ <Folder Include="System.Drawing.Text\" />
</ItemGroup>
</Project>
Oops, something went wrong.

0 comments on commit 5dca571

Please sign in to comment.