Page 1 of 1

Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 2:30 am
by Branan
I've run Plasma Explorer through the Mono Migration Assistant. All in all it looks pretty good.

I'm already planning on moving any DirectX code to OpenGL, so that leaves the two custom winforms-based widgets (controls in .NET terminology, right?). Those widgets/controls p/invoke into Windows DLLs. If the source is available, I might be able to fix them to work on purely managed code (might be a bit slower). Otherwise controls with the same functionality will need to be found/written entirely in managed code before Plasma Explorer runs fully cross-platform.

Plasma Explorer.exe and Plasma.dll actually have no issues - it's all in the third-party controls. Congratulations on writing good code, Hoikas :D

The full log from my MoMA analysis is here

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 3:25 am
by Christian Walther
If you permit me a pointless post of "thumbs up":
Sounds cool! 8-) I haven't even researched into what the various Plasma/PRP tools are yet, as they seemed Windows-only. But if they can be made to run on Mac OS X, I'll be sure to do that. (In fact, I wasn't aware of anything called Plasma Explorer. All I've heard of is PRP Explorer and PlasmaShop.)

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 3:28 am
by Branan
Plasma Explorer is brand new - there's a sticky in the Plasma# forum section announcing it.

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 9:10 am
by Christian Walther
Yep, that's what I get for posting before having read the whole forum... :roll:

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 12:56 pm
by Tsar Hoikas

I did try to keep Mono in mind when I wrote Plasma.dll although I (obviously) wasn't very concerned with it in Plasma Explorer itself. So, let's see... I did try to use open source components where possible. I'll explain what each of them do...

This is the "Sample Framework" used by SlimDX in its Samples... Hoikas was very lazy, so he based the (somewhat flawed) object rendering code off of it... Getting rid of this would be handled in chucking out DirectX

This is the "docking" component that manages the windows inside the application. Each "window" that opens in the application can be docked on the left/right/top/bottom or float like a tool menu. This component is somewhat buggy ... try resizing some of the editors and watch the anchors go insane. I wouldn't be sad to see these bugs fixed and for Mono compatibility to come. Here is the project's SF.NET page.

Is the control that builds the current hex editor. The hex editor form I have in Plasma Explorer isn't very useful nor does it use this component heavily. I could probably rip this out myself and use the BitConverter. FWIW, the project page can be found here.

There are still some SlimDX reliant components in Plasma.dll and Plasma Explorer itself, namely, the Mipmap code... Which I recently made a minor adjustment to... I'll finish up some of my minor tweaks and commit them to the repository. I don't know when that will happen though as I need to make sure the other project in the repository doesn't cause the compile to fail.

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 7:42 pm
by Branan
Be.Windows.Forms.HexBox.dll I should be able to fix - those calls should be easy to re-map to manged code. WeifenLuo.WinForumsUI.Docking.dll is another matter. Its code is tied pretty tightly to the Windows API, and I'm really not sure exactly what some of that native code is doing. As far as I can tell, there is no other open-source docking code. That means either refactoring the design to work with another UI paradigm.

hmmm.... just how much of the actual code is in Plasma.dll? If enough of it is there, it may be possible to write a separate GTK# based UI in parallel to your WinForms one. Only as a last resort if there's no way to get rid of those p/invokes, though.

Re: Plasma Explorer on Mono

PostPosted: Sat Jul 05, 2008 7:45 pm
by Tsar Hoikas
Plasma.dll is just the Plasma Library... I wanted to attempt to keep it as platform neutral as possible. The only WinForms based thing that happens there is getting an IntPtr of a form that's never shown to the user for converting the DDS Mipmap to a PNG.

What Plasma Explorer.exe does is take data from Plasma.dll and display it.

Re: Plasma Explorer on Mono

PostPosted: Sun Jul 06, 2008 2:26 pm
by Branan
As far as I can tell, there's no open-source replacement for the Docking control you're using, and despite years of discussion about making it portable to Mono, it still hasn't happened - which tells me it probably never will.

From what I see using Plasma Explorer on Windows and in Wine, It looks like you could fix the data browser in one place and just use a tab widget for the main view. Would that be OK with you, or did you have other plans for movable docks?

Re: Plasma Explorer on Mono

PostPosted: Sun Jul 06, 2008 3:09 pm
by Tsar Hoikas
The main plan with the docking component was ease of use. The ability to dock, float, and autohide the panes is highly useful...

I wonder if it would be possible to somehow make it either use the docking control or the tab control (as you suggested) by setting a platform in the compile settings?

Re: Plasma Explorer on Mono

PostPosted: Sun Jul 06, 2008 3:19 pm
by Branan
That should entirely possible to do, yes. It'll at least be a good holdover until I can find (or *shudders* write) a WinForms-based docking control the works on Mono.

EDIT: If you want to still be able to distribute a unified .EXE file, it's possible to detect Mono at runtime and work off of that:
Code: Select all
  public static bool IsRunningOnMono ()
    return Type.GetType ("Mono.Runtime") != null;