Hello,
So I've created a patch to make it build with mono (from FreeTrain.sln,
built with MonoDevelop). Though I
could not get it run fine on mono due to some SDL_Image_Load()
behavioral difference that returns null.
[EMAIL PROTECTED]:/svn/FreeTrainSDL/bin/Debug> MONO_IOMAP=all mono
--debug FreeTrainSDL.exe
Unhandled Exception: System.ArgumentNullException: Argument cannot be null.
Parameter name: src
at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure (intptr,System.Type)
at SDL.net.Surface..ctor (System.String filename) [0x00052] in
/svn/FreeTrainSDL/lib/SDLGFX.net/Surface.cs:99
at FreeTrainSDL.SDLGUI.initGUI (Int32 width, Int32 height, IntPtr pf)
[0x00067] in /svn/FreeTrainSDL/SDLGUI.cs:61
at FreeTrainSDL.FreeTrainSDL.Go () [0x0011b] in
/svn/FreeTrainSDL/Program.cs:120
at FreeTrainSDL.FreeTrainSDL.Main () [0x00006] in
/svn/FreeTrainSDL/Program.cs:79
It would be nice if someone who is familiar with Tao/SDL could try it.
Atsushi Eno
On Sun, Feb 24, 2008 at 8:09 PM, Atsushi Eno <[EMAIL PROTECTED]> wrote:
I agree that FreeTrain had been great, actually to me *the only*
valuable .NET application for years.
It is intreseting that FreeTrain was being ported to SDL land. Though it
wouldn't run on non-Windows platform
unless it drops COM dependency such as AxSHDocVw.dll and MSHtmlHost.dll.
I wonder if they can be
rewritten using WebBrowser control (it is still under heavy development
though).
DierctAudio dependency is also porting blocker, though I guess it could
be cut.
Thanks for the respons Atsushi.
The goal was to remove all Windows dependencies and fully port it but
unfortunately those who have worked on it lack the .NET skills and
necessary motivations to accomplish this task, hence why I'm asking
here. It would be a great showcase for Mono, and a bit of a steal to
have FreeTrain to move to Mono from .NET.
- C
Index: plugins/jp.co.tripod.chiname.lib.generic/FreeTrain.ContribEx.csproj
===================================================================
--- plugins/jp.co.tripod.chiname.lib.generic/FreeTrain.ContribEx.csproj (revision 200)
+++ plugins/jp.co.tripod.chiname.lib.generic/FreeTrain.ContribEx.csproj (working copy)
@@ -76,14 +76,6 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
- <Reference Include="AxSHDocVw, Version=1.1.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\AxSHDocVw.dll</HintPath>
- </Reference>
- <Reference Include="MsHtmlHost, Version=0.0.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\MsHtmlHost.dll</HintPath>
- </Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
Index: plugins/jp.co.tripod.chiname.lib.halfvoxel/FreeTrain.HalfVoxelStructure.csproj
===================================================================
--- plugins/jp.co.tripod.chiname.lib.halfvoxel/FreeTrain.HalfVoxelStructure.csproj (revision 200)
+++ plugins/jp.co.tripod.chiname.lib.halfvoxel/FreeTrain.HalfVoxelStructure.csproj (working copy)
@@ -76,14 +76,6 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
- <Reference Include="AxSHDocVw, Version=1.1.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\AxSHDocVw.dll</HintPath>
- </Reference>
- <Reference Include="MsHtmlHost, Version=0.0.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\MsHtmlHost.dll</HintPath>
- </Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
Index: FreeTrainSDL.csproj
===================================================================
--- FreeTrainSDL.csproj (revision 200)
+++ FreeTrainSDL.csproj (working copy)
@@ -33,6 +33,11 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <OutputType>WinExe</OutputType>
+ <AssemblyName>FreeTrainSDL</AssemblyName>
+ <RootNamespace>FreeTrainSDL</RootNamespace>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -42,17 +47,22 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <OutputType>WinExe</OutputType>
+ <AssemblyName>FreeTrainSDL</AssemblyName>
+ <DebugSymbols>true</DebugSymbols>
+ <RootNamespace>FreeTrainSDL</RootNamespace>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
- <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
- <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e, processorArchitecture=MSIL">
+ <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
+ <HintPath>..\..\usr\local\lib\mono\gac\Tao.Sdl\1.2.11.1__9c7a200e36c0094e\Tao.Sdl.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
- <HintPath>bin\Debug\Tao.Sdl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -111,5 +121,7 @@
<PropertyGroup>
<PostBuildEvent>copy /Y "$(SolutionDir)gui\*.*" "$(TargetDir)gui"
xcopy /Y /E "$(SolutionDir)plugins\*.*" "$(TargetDir)plugins"</PostBuildEvent>
+ <ProjectGuid>{B43DC0F1-5C4B-490F-8171-C3754A02D605}</ProjectGuid>
+ <RootNamespace>FreeTrainSDL</RootNamespace>
</PropertyGroup>
</Project>
\ No newline at end of file
Index: lib/Controls/FreeTrain.Controls.csproj
===================================================================
--- lib/Controls/FreeTrain.Controls.csproj (revision 200)
+++ lib/Controls/FreeTrain.Controls.csproj (working copy)
@@ -76,14 +76,6 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
- <Reference Include="AxSHDocVw, Version=1.1.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\AxSHDocVw.dll</HintPath>
- </Reference>
- <Reference Include="MsHtmlHost, Version=0.0.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\MsHtmlHost.dll</HintPath>
- </Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
Index: lib/Controls/src/DocHostUIHandlerImpl.cs
===================================================================
--- lib/Controls/src/DocHostUIHandlerImpl.cs (revision 200)
+++ lib/Controls/src/DocHostUIHandlerImpl.cs (working copy)
@@ -1,3 +1,4 @@
+#if use_removed
using System;
using System.Runtime.InteropServices;
using MsHtmlHost;
@@ -69,3 +70,4 @@
}
}
}
+#endif
Index: lib/Controls/src/WebBrowser.cs
===================================================================
--- lib/Controls/src/WebBrowser.cs (revision 200)
+++ lib/Controls/src/WebBrowser.cs (working copy)
@@ -1,30 +1,34 @@
using System;
-using MsHtmlHost;
-using AxSHDocVw;
+//using MsHtmlHost;
+//using AxSHDocVw;
namespace freetrain.controls
{
/// <summary>
/// WebBrowser control.
/// </summary>
- public class WebBrowser : AxWebBrowser
+ public class WebBrowser : System.Windows.Forms.WebBrowser // AxWebBrowser
{
public WebBrowser() {
}
public void navigate( string url ) {
+ /*
object flags = 0;
object targetFrame = String.Empty;
object postData = String.Empty;
object headers = String.Empty;
base.Navigate(url, ref flags, ref targetFrame, ref postData, ref headers);
+ */
+ base.Navigate(url);
}
-
+ /*
public IDocHostUIHandler docHostUIHandler {
set {
ICustomDoc cDoc = (ICustomDoc)base.Document;
cDoc.SetUIHandler(value);
}
}
+ */
}
}
Index: lib/SDLGFX.net/SDL.net.csproj
===================================================================
--- lib/SDLGFX.net/SDL.net.csproj (revision 200)
+++ lib/SDLGFX.net/SDL.net.csproj (working copy)
@@ -10,18 +10,30 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>True</DebugSymbols>
+ <DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
+ <OutputType>Library</OutputType>
+ <AssemblyName>SDLGFX.net</AssemblyName>
+ <RootNamespace>SDLGFX.net</RootNamespace>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <Optimize>true</Optimize>
+ <WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>False</DebugSymbols>
+ <DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
+ <OutputType>Library</OutputType>
+ <AssemblyName>SDLGFX.net</AssemblyName>
+ <RootNamespace>SDLGFX.net</RootNamespace>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <Optimize>true</Optimize>
+ <WarningLevel>4</WarningLevel>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
@@ -30,9 +42,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
- <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e, processorArchitecture=MSIL">
+ <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
+ <HintPath>..\..\..\..\usr\local\lib\mono\gac\Tao.Sdl\1.2.11.1__9c7a200e36c0094e\Tao.Sdl.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
- <HintPath>bin\Debug\Tao.Sdl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -47,5 +59,7 @@
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>copy "$(ProjectDir)bin\Debug\*.dll" "$(SolutionDir)core\Debug\"</PostBuildEvent>
+ <ProjectGuid>{778C6318-394F-4DE7-B9AF-FCCFA1B68AAE}</ProjectGuid>
+ <RootNamespace>SDLGFX.net</RootNamespace>
</PropertyGroup>
</Project>
\ No newline at end of file
Index: lib/SDLGFX.net/Surface.cs
===================================================================
--- lib/SDLGFX.net/Surface.cs (revision 200)
+++ lib/SDLGFX.net/Surface.cs (working copy)
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Diagnostics;
Index: core/FreeTrain.Core.csproj
===================================================================
--- core/FreeTrain.Core.csproj (revision 200)
+++ core/FreeTrain.Core.csproj (working copy)
@@ -46,6 +46,9 @@
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
+ <OutputType>Library</OutputType>
+ <AssemblyName>FreeTrain.Core</AssemblyName>
+ <RootNamespace>freetrain</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>Release\</OutputPath>
@@ -70,12 +73,11 @@
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
+ <OutputType>Library</OutputType>
+ <AssemblyName>FreeTrain.Core</AssemblyName>
+ <RootNamespace>freetrain</RootNamespace>
</PropertyGroup>
<ItemGroup>
- <Reference Include="AxSHDocVw, Version=1.1.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\AxSHDocVw.dll</HintPath>
- </Reference>
<Reference Include="Microsoft.JScript">
<Name>Microsoft.JScript</Name>
<Private>True</Private>
@@ -84,10 +86,6 @@
<Name>Microsoft.Vsa</Name>
<Private>True</Private>
</Reference>
- <Reference Include="MsHtmlHost, Version=0.0.0.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\MsHtmlHost.dll</HintPath>
- </Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
@@ -109,9 +107,9 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
- <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e, processorArchitecture=MSIL">
+ <Reference Include="Tao.Sdl, Version=1.2.11.1, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
+ <HintPath>..\..\..\usr\local\lib\mono\gac\Tao.Sdl\1.2.11.1__9c7a200e36c0094e\Tao.Sdl.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
- <HintPath>Debug\Tao.Sdl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -1012,6 +1010,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
+ <Folder Include="Properties\" />
<Folder Include="util\video\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
@@ -1019,5 +1018,7 @@
<PreBuildEvent>rem del $(ProjectDir)\obj\Debug\*.PDB</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
+ <ProjectGuid>{7746CF50-D84E-4E7B-83FB-AB43DB854DA8}</ProjectGuid>
+ <RootNamespace>freetrain</RootNamespace>
</PropertyGroup>
</Project>
\ No newline at end of file
Index: core/world/accounting/BalanceSheetForm.cs
===================================================================
--- core/world/accounting/BalanceSheetForm.cs (revision 200)
+++ core/world/accounting/BalanceSheetForm.cs (working copy)
@@ -3,8 +3,6 @@
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
-using AxSHDocVw;
-using MsHtmlHost;
using freetrain.controls;
using freetrain.framework;
using freetrain.framework.plugin;
@@ -48,7 +46,7 @@
// webBrowser.Navigate("about:hello", ref flags, ref targetFrame, ref postData, ref headers);
webBrowser.navigate("about:blank");
- webBrowser.docHostUIHandler = new DocHostUIHandlerImpl(this);
+ //webBrowser.docHostUIHandler = new DocHostUIHandlerImpl(this);
webBrowser.navigate(ResourceUtil.findSystemResource("balanceSheet.html"));
}
@@ -69,7 +67,7 @@
//
this.webBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
this.webBrowser.Enabled = true;
- this.webBrowser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("webBrowser.OcxState")));
+ //this.webBrowser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("webBrowser.OcxState")));
this.webBrowser.Size = new System.Drawing.Size(592, 206);
this.webBrowser.TabIndex = 0;
//
Index: core/world/structs/VarHeightBuilding.cs
===================================================================
--- core/world/structs/VarHeightBuilding.cs (revision 200)
+++ core/world/structs/VarHeightBuilding.cs (working copy)
@@ -161,7 +161,7 @@
Voxel v = World.world[loc];
if(!(v is VarHeightBuilding.VoxelImpl)) return null;
- return ((VarHeightBuilding.VoxelImpl)v).owner as VarHeightBuilding;
+ return ((StructureVoxel)v).owner as VarHeightBuilding;
}
public static VarHeightBuilding get( int x, int y, int z ) { return get(new Location(x,y,z)); }
Index: core/framework/AboutDialog.cs
===================================================================
--- core/framework/AboutDialog.cs (revision 200)
+++ core/framework/AboutDialog.cs (working copy)
@@ -24,7 +24,7 @@
InitializeComponent();
browser.navigate("about:blank");
- browser.docHostUIHandler = new DocHostUIHandlerImpl(this);
+ //browser.docHostUIHandler = new DocHostUIHandlerImpl(this);
browser.navigate(ResourceUtil.findSystemResource("about.html"));
}
@@ -144,10 +144,10 @@
//
// browser
//
- this.browser.ContainingControl = this;
+ //this.browser.ContainingControl = this;
this.browser.Dock = System.Windows.Forms.DockStyle.Fill;
this.browser.Enabled = true;
- this.browser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("browser.OcxState")));
+ //this.browser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("browser.OcxState")));
this.browser.Size = new System.Drawing.Size(320, 192);
this.browser.TabIndex = 0;
//
Index: core/util/UrlInvoker.cs
===================================================================
--- core/util/UrlInvoker.cs (revision 200)
+++ core/util/UrlInvoker.cs (working copy)
@@ -6,18 +6,18 @@
namespace freetrain.util
{
/// <summary>
- /// UrlInvoker ã®æ¦è¦ã®èª¬æã§ãã
+ /// summary for UrlInvoker.
/// </summary>
public class UrlInvoker
{
- // æå®ã®URLãæ¨æºãã©ã¦ã¶ã§éã
- static public void openUrl(String targetUrl) {ã
+ // Open the URL with the default browser.
+ static public void openUrl(String targetUrl) {
ProcessStartInfo info = new ProcessStartInfo();
- // URLã«é¢é£ã¥ããããã¢ããªã±ã¼ã·ã§ã³ãæ¢ã
+ // Look for the application that is bound to the URL by default.
RegistryKey rkey = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command");
String val = rkey.GetValue("").ToString();
- // ã¬ã¸ã¹ããªå¤ã«ã¯ãèµ·åãã©ã¡ã¼ã¿ãå«ã¾ããã®ã§ã
- // å®è¡ãã¡ã¤ã«åã¨èµ·åãã©ã¡ã¼ã¿ãåé¢ãã
+ // The registry valu econtains run parameters, so detach
+ // executable file name and those parameters.
if(val.StartsWith("\"")) {
int n = val.IndexOf("\"",1);
info.FileName = val.Substring(1,n-1);
@@ -28,9 +28,9 @@
info.FileName = a[0];
info.Arguments = val.Substring(a[0].Length+1);
}
- // 使¥ãã£ã¬ã¯ããªãæå®ããªãã¨ãã¡ãªããã ã»ã»ã»
+ // we also need working directory...
info.WorkingDirectory = Path.GetDirectoryName(info.FileName);
- // 弿°ã®æå¾ã«URLãå ãã
+ // add the URL at the end of the parameters.
info.Arguments += targetUrl;
Process.Start(info);
}
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list