-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of openPDN, unmodified source of Paint.NET 3.36.7
Everything is MIT licenced, except Artwork (cc-by-nc-nd) and GPC (non comercial use only) - those parts are to be removed soon.
- Loading branch information
benpicco
committed
Dec 4, 2009
0 parents
commit 8deba5a
Showing
1,116 changed files
with
175,686 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
==[Notes on the Fork]== | ||
|
||
Forking a vivid software project is usually a bad thing and there are | ||
only few reasons when this action is considered legitimated. | ||
The most common of those reasons is a licence change of the project - | ||
this is what happened here. | ||
The main author of this great piece of software, Rick Brewster, decided | ||
to change the licence for all further releases of Paint.NET [1] making | ||
this version the last one to licensed under MIT Licence (with exceptions | ||
for Artwork and the GPC library, limiting the whole software to | ||
non-commercial distribution, see src/Resources/Files/License.txt). | ||
Any further releases include the restrictive clause | ||
"You may not modify, adapt, rent, lease, loan, sell, or create | ||
derivative works based upon the Software or any part thereof." | ||
One year has passed since the last free sources of the project had been | ||
released, giving the authors time to change their minds. | ||
Their decision has to be respected, but the OpenSource community still | ||
has to be able to build upon the last version of this powerful tool. | ||
|
||
Main goals of this fork are: | ||
* Linux port (which means porting it to mono basically) | ||
* replacing non-free parts (Artworks, General Polygon Clipper as those | ||
are only usable non-commercially, making this non-free software in | ||
the sense of OSI [2]) | ||
|
||
Of cause, all credits to the initial authors will remain, naturally new | ||
contributors will be credited as well. | ||
|
||
|
||
[1] http://blog.getpaint.net/2009/11/06/a-new-license-for-paintnet-v35/ | ||
[2] http://opensource.org/docs/osd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See src/Resources/Files/License.txt for the license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Paint.NET Source Code | ||
--------------------- | ||
If you're just trying to install and use Paint.NET, then you've downloaded | ||
the wrong package. Just thought we'd let you know. | ||
|
||
For information on building Paint.NET, refer to src/readme.txt | ||
|
||
Directory Layout | ||
---------------- | ||
|
||
extras/ | ||
Contains other stuff related to Paint.NET. | ||
|
||
src/ | ||
All source and other files necessary for building Paint.NET. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
///////////////////////////////////////////////////////////////////////////////// | ||
// Paint.NET // | ||
// Copyright (C) Rick Brewster, Tom Jackson, and past contributors. // | ||
// Portions Copyright (C) Microsoft Corporation. All Rights Reserved. // | ||
// See src/Setup/License.txt for full licensing and attribution details. // | ||
// 2 // | ||
// 1 // | ||
///////////////////////////////////////////////////////////////////////////////// | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// | ||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
// | ||
[assembly: AssemblyTitle("")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// | ||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
|
||
[assembly: AssemblyVersion("1.0.*")] | ||
|
||
// | ||
// In order to sign your assembly you must specify a key to use. Refer to the | ||
// Microsoft .NET Framework documentation for more information on assembly signing. | ||
// | ||
// Use the attributes below to control which key is used for signing. | ||
// | ||
// Notes: | ||
// (*) If no key is specified, the assembly is not signed. | ||
// (*) KeyName refers to a key that has been installed in the Crypto Service | ||
// Provider (CSP) on your machine. KeyFile refers to a file which contains | ||
// a key. | ||
// (*) If the KeyFile and the KeyName values are both specified, the | ||
// following processing occurs: | ||
// (1) If the KeyName can be found in the CSP, that key is used. | ||
// (2) If the KeyName does not exist and the KeyFile does exist, the key | ||
// in the KeyFile is installed into the CSP and used. | ||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. | ||
// When specifying the KeyFile, the location of the KeyFile should be | ||
// relative to the project output directory which is | ||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is | ||
// located in the project directory, you would specify the AssemblyKeyFile | ||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] | ||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework | ||
// documentation for more information on this. | ||
// | ||
[assembly: AssemblyDelaySign(false)] | ||
[assembly: AssemblyKeyFile("")] | ||
[assembly: AssemblyKeyName("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
///////////////////////////////////////////////////////////////////////////////// | ||
// Paint.NET // | ||
// Copyright (C) Rick Brewster, Tom Jackson, and past contributors. // | ||
// Portions Copyright (C) Microsoft Corporation. All Rights Reserved. // | ||
// See src/Setup/License.txt for full licensing and attribution details. // | ||
// 2 // | ||
// 1 // | ||
///////////////////////////////////////////////////////////////////////////////// | ||
|
||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace PaintDotNet.Effects | ||
{ | ||
public class CodeEditor : TextBox | ||
{ | ||
private Timer compileTimer; | ||
|
||
public CodeEditor() | ||
{ | ||
this.AcceptsReturn = true; | ||
this.AcceptsTab = true; | ||
this.Multiline = true; | ||
this.ScrollBars = ScrollBars.Vertical; | ||
this.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); | ||
|
||
this.compileTimer = new Timer(); | ||
this.compileTimer.Interval = 500; | ||
this.compileTimer.Enabled = false; | ||
this.compileTimer.Tick += new EventHandler(compileTimer_Tick); | ||
} | ||
|
||
public event EventHandler CompileTimeHint; | ||
protected virtual void OnCompileTimeHint() | ||
{ | ||
if (CompileTimeHint != null) | ||
{ | ||
CompileTimeHint(this, EventArgs.Empty); | ||
} | ||
} | ||
|
||
protected override void OnKeyPress(KeyPressEventArgs e) | ||
{ | ||
if (e.KeyChar == '\r') | ||
{ | ||
int count = 0; | ||
int end = this.SelectionStart; | ||
string text = this.Text, indent = "\r\n"; | ||
for (int i = 0; i < end; i++) | ||
{ | ||
if (text[i] == '(' || text[i] == '[' || text[i] == '{') | ||
{ | ||
count++; | ||
} | ||
if (text[i] == ')' || text[i] == ']' || text[i] == '}') | ||
{ | ||
count--; | ||
} | ||
} | ||
|
||
while (count-- > 0) | ||
{ | ||
indent += " "; | ||
} | ||
|
||
this.SelectedText = indent; | ||
e.Handled = true; | ||
} | ||
|
||
this.compileTimer.Enabled = false; | ||
this.compileTimer.Enabled = true; | ||
|
||
base.OnKeyPress (e); | ||
} | ||
|
||
public void Highlight(int line, int column) | ||
{ | ||
int startIndex = 0; | ||
int endIndex = -1; | ||
int linesPassed = 0; | ||
string txt = this.Text; | ||
|
||
for (int i = 0; i < txt.Length; ++i) | ||
{ | ||
if (txt[i] == '\n') | ||
{ | ||
linesPassed++; | ||
|
||
if (linesPassed == line - 1) | ||
{ | ||
startIndex = i + column; | ||
} | ||
else if (linesPassed == line) | ||
{ | ||
endIndex = i - 1; | ||
} | ||
} | ||
} | ||
|
||
if (startIndex > 0 && endIndex > 0) | ||
{ | ||
this.Select(startIndex, endIndex - startIndex); | ||
} | ||
} | ||
|
||
private void compileTimer_Tick(object sender, EventArgs e) | ||
{ | ||
OnCompileTimeHint(); | ||
this.compileTimer.Enabled = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
///////////////////////////////////////////////////////////////////////////////// | ||
// Paint.NET // | ||
// Copyright (C) Rick Brewster, Tom Jackson, and past contributors. // | ||
// Portions Copyright (C) Microsoft Corporation. All Rights Reserved. // | ||
// See src/Setup/License.txt for full licensing and attribution details. // | ||
// 2 // | ||
// 1 // | ||
///////////////////////////////////////////////////////////////////////////////// | ||
|
||
using System; | ||
using System.Drawing; | ||
using System.Drawing.Drawing2D; | ||
using System.Reflection; | ||
using System.IO; | ||
using Microsoft.CSharp; | ||
|
||
namespace PaintDotNet.Effects | ||
{ | ||
public class CodeLab : Effect | ||
{ | ||
public static Image StaticImage | ||
{ | ||
get | ||
{ | ||
Assembly ourAssembly = Assembly.GetCallingAssembly(); | ||
Stream imageStream = ourAssembly.GetManifestResourceStream("PaintDotNet.Effects.Icons.CodeLab.png"); | ||
Image image = Image.FromStream(imageStream); | ||
return image; | ||
} | ||
} | ||
|
||
public CodeLab() | ||
: base("Code Lab", StaticImage, true) | ||
{ | ||
} | ||
|
||
public override EffectConfigDialog CreateConfigDialog() | ||
{ | ||
CodeLabConfigDialog secd = new CodeLabConfigDialog(); | ||
return secd; | ||
} | ||
|
||
public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) | ||
{ | ||
CodeLabConfigToken sect = (CodeLabConfigToken)parameters; | ||
Effect userEffect = sect.UserScriptObject; | ||
|
||
if (userEffect != null) | ||
{ | ||
userEffect.EnvironmentParameters = this.EnvironmentParameters; | ||
|
||
try | ||
{ | ||
userEffect.Render(null, dstArgs, srcArgs, rois, startIndex, length); | ||
} | ||
|
||
catch (Exception exc) | ||
{ | ||
sect.LastExceptions.Add(exc); | ||
dstArgs.Surface.CopySurface(srcArgs.Surface); | ||
sect.UserScriptObject = null; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.