My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
PortingStrategy  
Paint.NET Porting Strategy
Phase-Deploy, plan, Phase-Implementation
Updated Feb 4, 2010 by miguel.d...@gmail.com

Basics

Paint.NET has a very clean isolation between the engine and the system specific components.

The ideal scenario is to ship a SystemLayer.dll file that will replace the one that comes with the official distribution of Paint.NET. Although I had originally hoped that the code could continue to support Mono and .NET on the same codebase, Rick suggested that I avoid this and go directly the route of replacing the library.

Ideally the port would only require the src/SystemLayer directory to be ported but currently Paint.NET still contains a few places in the core engine that must be modified (for example, at startup the program checks the list of libraries and resources to be in the target directory, but some of these assemblies are not necessary for Linux or are useless on Linux) this has required some changes in the core of Paint.NET.

In places that must be revisited in the future (unfinished implementation, stubs, routines turned into no-ops) I have added a WriteLine statement so we can keep track of what is missing. A complete port should produce no output on the console.

Directions

The port is good enough to start the application, but many features are still not tested and there are many P/Invokes that remain in the source code. I have not really spent much time trying to test it, but testing will exhibit many features that must be ported to Linux.

What needs to be done:

Repeat until we are done, and the application is working like a charm.

Current State

Paint.NET starts up, it is possible to load and save files, and run many of the effects. There are still a few bugs left and the SystemLayer work has not been completed, so a few things might break every once in a while.

It is recommended that you start with Mono 1.2.6, although a few features (saving) requires Mono from SVN as there were a few bugs that prevented it from running correctly.

P/Invoke

There are a number of cases where Paint.NET is using P/Invoke, in some cases it is using functionality from the Windows OS that is available in Unix in a different form. Porting this code should be pretty straight forward.

In some other cases the P/Invokes are used to call into features in the various Windows.Forms controls that is not exposed in the Windows.Forms API but is part of the underlying Win32 control. In these cases, sometimes the functionality is also part of the internals of Mono's Managed Windows.Forms implementation. In those cases you can access the internal features by using Reflection and Invoke, for example, consider this code that replaces the call to P/Invoke with an internal call

	MethodInfo drop_down = typeof (ComboBox).GetMethod ("DropDownListBox",
                BindingFlags.Instance|BindingFlags.NonPublic);
	if (drop_down == null){
		Console.WriteLine ("ShowComboBox: Warning, no DropDownlistBox found");
		return;
	}
	drop_down.Invoke (comboBox, new object [0]);

This was just an illustration, a better way is to just call the method that takes care of this on the comboBox:

        comboBox.Dropped = value;

Building Paint.NET on Linux

First, you should check the code out from SVN, once you have the source code, the easiest way of testing it is to use the standard Unix source configuration and installation setup:

cd src ./configure make make install

Alternatively, you can use MonoDevelop to build Paint.NET. To use it, just open the src/paintdotnet.sln solution and rebuild the solution (press F5) to run.

Original Source

To track the changes and assist us in writing a 'Lessons in Porting' document, the original source code as obtained from http://www.getpaint.net is checked into this directory:

http://paint-mono.googlecode.com/svn/vendor/pdn_src_3_0

This is the vendor/pdn_src_3_0 branch.

Contributing

If you want to contribute to this effort, please mail me your login information, and I will add you to this project.

Alternatively, you can contact other members of the administration group.

Comment by jakub.ru...@gmail.com, May 3, 2008

Paint Mono should use GTK to integrate well and stop self-drawn-widgets expansion.

Comment by batmanha...@yahoo.ca, Nov 2, 2008

I know, but the entire UI would have to be rewritten and changed, then it would be paint.net to the end user would it?

Comment by dsavi...@gmail.com, Apr 24, 2009

Hey.

This does not build on Ubuntu, (Just using ./configure; make; make install) apparently because the command for gmcs is not gmcs rather gmcs2. I went through all the makefiles manually and changed all the references to gmcs2 manually, did alias gmcs="gmcs2", nothing worked. Would be appreciated if you would fix it. Thanks for doing this project.

Comment by frederic...@gmail.com, Jul 1, 2009

There is a PPA repository for Ubuntu jaunty here: https://launchpad.net/~xmlich02/+archive/ppa However it does rely on one older package from the hardy repository: http://packages.ubuntu.com/hardy/libmono-mozilla0.1-cil

Comment by stephenjudge, Jul 28, 2009

What is the likelihood that Paint.mono will continue to be developed into the future considering that the Paint.net project has now closed its source code?

Comment by philipg...@googlemail.com, Aug 12, 2009

Depending on the license applied to the source code, we could potentially maintain paint-mono as a separate fork and develop this independently. This could be ideal, as Paint.NET v4 is supposed to be a total rewrite.

Comment by kevinshe...@gmail.com, Nov 15, 2009

I reworked this a bit on my own PC by combining everything into a single visual studio project ( instead of multiple ) It kind of runs on Mono/Suse but not too well. I want to strip out unnecessary code ( eg auto updates, installer, etc ) and sort of get it down to a bare bones single exe that can run on linux/mono without too much effort (defaulting some registry values needed too) I find the current build a difficult to make. I find it will run on mono even if built on windows, but the posix stuff does not work on mono for windows. I think microsoft has a better optimizer and will get better performance if compiled in visual studio. I can share my hacked together project if any one wants, just email! Thanks

Comment by Igor.Zub...@gmail.com, Dec 15, 2009

Any news? Project updated Dec 20, 2007 by miguel.de.icaza((((((

Comment by admirado...@gmail.com, Feb 12, 2010

Hi all people...where is the code of Paint.Net for Windows ?? thanks !!!

greetings

Comment by sebastie...@gmail.com, Feb 20, 2010

Hi miguel, i love Paint.net on Windows. I can't install paint.mono to my favorite Distro : Linux Mint 8.0 X64 Gnome Edition. (lots of bugs during install mono and/or Paint.mono ...!!)

Have you plan to integrate Paint.mono to Gnome or add a simply way to non expert linux to install it. (Paint.mono.DEB GTK2+ edition) Please, i hate GIMP and reboot to Windows only for Paint.net is a very bad Think.

Thanks a lot for all your work.

Comment by mimirat...@gmail.com, Apr 23, 2010

I think you should bring back the paint Sit from Windows . I tried looking for it last night. It was fun to do. Miriam Ratner

Comment by jens.vel...@gmail.com, Nov 27, 2010

Same here, big fan and user of Paint.Net and also using Mint (10). Sebastien did you find a good alternative to Paint.Net yet?

Having difficulties working with gimp. Can't seem to get the hang of it.

Regards and good luck with Mono Paint (i could help you translate to duch if needed).

Comment by kevin.br...@gmail.com, Jan 1, 2011

Is this project dead? :(

Comment by ArtVanda...@gmail.com, Jan 12, 2011

This project has been "continued" by the Pinta project http://pinta-project.com/ -- led by Jonathan Pobst, a programmer at Novell (i.e. the people who largely fund Mono). Pinta is a personal project of Jonathans, and is not funded by Novell AFAIK.

Comment by Alister....@gmail.com, Feb 27, 2011

No it hasn't. That is "inspired" by Paint.net

Comment by nivange...@gmail.com, Nov 24, 2011

Cant find compiled download? Where is it?

Comment by ivan.mas...@gmail.com, Nov 30, 2011

I've just found it on Launchpad: https://launchpad.net/~xmlich02/+archive/ppa

Comment by ivan.mas...@gmail.com, Nov 30, 2011

It manages to install without errors (I've installed a "Lucid" package at "Oneiric" XUbuntu) but it does not put itself to the menu, use paintdotnet command to start it. Looks nice and seems usable, not without visible bugs though.

Comment by allanv...@gmail.com, Jun 26, 2013

ponyjjkvfkgjk

Comment by gootube2...@gmail.com, Dec 28, 2013

Any help for a mac user?


Sign in to add a comment
Powered by Google Project Hosting