build using the autotools. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2869 92316355-f0b4-4df1-b90c-862c8a59935fremotes/tiles
@@ -23,3 +23,5 @@ stamp-h1 | |||
*.la | |||
*.lo | |||
*.o | |||
*.userprefs | |||
*.usertasks |
@@ -1,6 +1,6 @@ | |||
# $Id$ | |||
SUBDIRS = pipi src genethumb examples test | |||
SUBDIRS = pipi src genethumb examples test pipi-sharp ThePimp | |||
EXTRA_DIST = bootstrap build-win32 common.h NOTES | |||
AUTOMAKE_OPTIONS = dist-bzip2 | |||
@@ -0,0 +1,20 @@ | |||
<Combine name="ThePimp" fileversion="2.0"> | |||
<Configurations active="Debug"> | |||
<Configuration name="Debug" ctype="CombineConfiguration"> | |||
<Entry build="True" name="pipi-sharp" configuration="Debug" /> | |||
<Entry build="True" name="ThePimp" configuration="Debug" /> | |||
</Configuration> | |||
<Configuration name="Release" ctype="CombineConfiguration"> | |||
<Entry build="True" name="pipi-sharp" configuration="Release" /> | |||
<Entry build="True" name="ThePimp" configuration="Release" /> | |||
</Configuration> | |||
</Configurations> | |||
<StartMode startupentry="ThePimp" single="True"> | |||
<Execute type="None" entry="pipi-sharp" /> | |||
<Execute type="None" entry="ThePimp" /> | |||
</StartMode> | |||
<Entries> | |||
<Entry filename="pipi-sharp/pipi-sharp.mdp" /> | |||
<Entry filename="ThePimp/ThePimp.mdp" /> | |||
</Entries> | |||
</Combine> |
@@ -0,0 +1,5 @@ | |||
*.pidb | |||
*.mdb | |||
*.exe | |||
*.dll | |||
pipi-sharp.dll.* |
@@ -6,9 +6,9 @@ | |||
using System; | |||
using Gtk; | |||
namespace Pimp | |||
namespace ThePimp | |||
{ | |||
class Pimp | |||
class ThePimp | |||
{ | |||
public static void Main (string[] args) | |||
{ |
@@ -6,6 +6,7 @@ | |||
using System; | |||
using Gtk; | |||
using Pipi; | |||
using ThePimp; | |||
public partial class MainWindow: Gtk.Window | |||
{ | |||
@@ -23,11 +24,14 @@ public partial class MainWindow: Gtk.Window | |||
protected virtual void OnOpenActionActivated (object sender, System.EventArgs e) | |||
{ | |||
Pimp.OpenFile open = new Pimp.OpenFile(); | |||
ResponseType rsp = (ResponseType)open.Run(); | |||
ThePimp.OpenFile open = new ThePimp.OpenFile(); | |||
Pipi.Picture p = open.Load(); | |||
open.Destroy(); | |||
if(rsp == ResponseType.Ok) | |||
return; | |||
if(p != null) | |||
{ | |||
Title += " image " + p.Width + "x" + p.Height; | |||
scrolledwindow1.Add(new PictureView(p)); | |||
} | |||
} | |||
protected virtual void OnQuitActionActivated (object sender, System.EventArgs e) |
@@ -0,0 +1,29 @@ | |||
# $Id: $ | |||
pimp_sources = \ | |||
$(srcdir)/AssemblyInfo.cs \ | |||
$(srcdir)/Main.cs \ | |||
$(srcdir)/gtk-gui/generated.cs \ | |||
$(srcdir)/OpenFile.cs \ | |||
$(srcdir)/gtk-gui/ThePimp.OpenFile.cs \ | |||
$(srcdir)/PictureView.cs \ | |||
$(srcdir)/gtk-gui/ThePimp.PictureView.cs \ | |||
$(srcdir)/MainWindow.cs \ | |||
$(srcdir)/gtk-gui/MainWindow.cs | |||
if USE_CSHARP | |||
bin_SCRIPTS = Pimp.exe | |||
endif | |||
EXTRA_DIST = $(pimp_sources) | |||
Pimp.exe: $(pimp_sources) | |||
cp ../pipi-sharp/pipi-sharp.dll . | |||
cp ../pipi-sharp/pipi-sharp.dll.config . | |||
gmcs $(pimp_sources) -out:$@ -lib:./ \ | |||
-pkg:gtk-sharp-2.0 -r:Mono.Posix -r:pipi-sharp.dll | |||
clean-local: | |||
rm -f pipi-sharp.dll pipi-sharp.dll.config | |||
rm -f *.exe *.dll *.mdb | |||
@@ -0,0 +1,29 @@ | |||
// OpenFile.cs created with MonoDevelop | |||
// User: sam at 23:05 03/10/2008 | |||
// | |||
// To change standard headers go to Edit->Preferences->Coding->Standard Headers | |||
// | |||
using System; | |||
using Gtk; | |||
namespace ThePimp | |||
{ | |||
public partial class OpenFile : Gtk.Dialog | |||
{ | |||
public OpenFile() | |||
{ | |||
this.Build(); | |||
} | |||
public Pipi.Picture Load() | |||
{ | |||
ResponseType rsp = (ResponseType)Run(); | |||
Hide(); | |||
if(rsp != ResponseType.Ok) | |||
return null; | |||
Pipi.Picture p = new Pipi.Picture(filechooserwidget1.Filename); | |||
return p; | |||
} | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
// PictureView.cs created with MonoDevelop | |||
// User: sam at 22:59 04/10/2008 | |||
// | |||
// To change standard headers go to Edit->Preferences->Coding->Standard Headers | |||
// | |||
using System; | |||
using Gtk; | |||
using Pipi; | |||
namespace ThePimp | |||
{ | |||
public partial class PictureView : Gtk.Bin | |||
{ | |||
protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) | |||
{ | |||
Console.WriteLine("LOL WHAT"); | |||
} | |||
public PictureView(Picture p) | |||
{ | |||
this.Build(); | |||
} | |||
} | |||
} |
@@ -1,16 +1,19 @@ | |||
<Project name="Pimp" fileversion="2.0" Description="The Pathetic Image Manipulation Program" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> | |||
<Project name="ThePimp" fileversion="2.0" Description="The Pathetic Image Manipulation Program" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> | |||
<Configurations active="Debug"> | |||
<Configuration name="Debug" ctype="DotNetProjectConfiguration"> | |||
<CustomCommands> | |||
<Command type="AfterBuild" command="ln -s ${CombineDir}/Pipi/pipi-sharp.dll.config ${TargetDir}" workingdir="" /> | |||
<Command type="AfterBuild" command="cp ${CombineDir}/pipi-sharp/pipi-sharp.dll.config ${TargetDir}" workingdir="" /> | |||
</CustomCommands> | |||
<Output directory="bin/Debug" assemblyKeyFile="." assembly="Pimp" /> | |||
<Output directory="." assemblyKeyFile="." assembly="Pimp" /> | |||
<Build debugmode="True" target="Exe" /> | |||
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" /> | |||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" definesymbols="DEBUG" generatexmldocumentation="False" win32Icon="." ctype="CSharpCompilerParameters" /> | |||
</Configuration> | |||
<Configuration name="Release" ctype="DotNetProjectConfiguration"> | |||
<Output directory="bin/Release" assembly="Pimp" /> | |||
<CustomCommands> | |||
<Command type="AfterBuild" command="cp ${CombineDir}/pipi-sharp/pipi-sharp.dll.config ${TargetDir}" /> | |||
</CustomCommands> | |||
<Output directory="." assemblyKeyFile="." assembly="Pimp" /> | |||
<Build debugmode="False" target="Exe" /> | |||
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" /> | |||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" win32Icon="." ctype="CSharpCompilerParameters" /> | |||
@@ -26,6 +29,9 @@ | |||
<File name="app.desktop" subtype="Code" buildaction="FileCopy" DeployService.TargetDirectoryId="Linux.DesktopApplications" /> | |||
<File name="OpenFile.cs" subtype="Code" buildaction="Compile" /> | |||
<File name="gtk-gui/Pimp.OpenFile.cs" subtype="Code" buildaction="Compile" /> | |||
<File name="gtk-gui/objects.xml" subtype="Code" buildaction="EmbedAsResource" /> | |||
<File name="PictureView.cs" subtype="Code" buildaction="Compile" /> | |||
<File name="gtk-gui/ThePimp.PictureView.cs" subtype="Code" buildaction="Compile" /> | |||
</Contents> | |||
<References> | |||
<ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |||
@@ -35,8 +41,12 @@ | |||
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |||
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |||
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> | |||
<ProjectReference type="Project" localcopy="True" refto="Pipi" /> | |||
<ProjectReference type="Project" localcopy="True" refto="pipi-sharp" /> | |||
</References> | |||
<Deployment.LinuxDeployData /> | |||
<GtkDesignInfo gtkVersion="2.12.1" /> | |||
<GtkDesignInfo gtkVersion="2.12.1"> | |||
<ExportedWidgets> | |||
<Widget>ThePimp.PictureView</Widget> | |||
</ExportedWidgets> | |||
</GtkDesignInfo> | |||
</Project> |
@@ -80,16 +80,18 @@ public partial class MainWindow { | |||
private Gtk.ScrolledWindow scrolledwindow1; | |||
private Gtk.DrawingArea drawingarea1; | |||
private Gtk.Label label1; | |||
private Gtk.VPaned vpaned1; | |||
private Gtk.VBox vbox2; | |||
private Gtk.Label label2; | |||
private Gtk.VBox vbox3; | |||
private Gtk.Label label3; | |||
private Gtk.Statusbar statusbar1; | |||
protected virtual void Build() { | |||
@@ -237,14 +239,6 @@ public partial class MainWindow { | |||
this.scrolledwindow1.CanFocus = true; | |||
this.scrolledwindow1.Name = "scrolledwindow1"; | |||
this.scrolledwindow1.ShadowType = ((Gtk.ShadowType)(1)); | |||
// Container child scrolledwindow1.Gtk.Container+ContainerChild | |||
Gtk.Viewport w5 = new Gtk.Viewport(); | |||
w5.ShadowType = ((Gtk.ShadowType)(0)); | |||
// Container child GtkViewport.Gtk.Container+ContainerChild | |||
this.drawingarea1 = new Gtk.DrawingArea(); | |||
this.drawingarea1.Name = "drawingarea1"; | |||
w5.Add(this.drawingarea1); | |||
this.scrolledwindow1.Add(w5); | |||
this.notebook1.Add(this.scrolledwindow1); | |||
// Notebook tab | |||
this.label1 = new Gtk.Label(); | |||
@@ -253,8 +247,8 @@ public partial class MainWindow { | |||
this.notebook1.SetTabLabel(this.scrolledwindow1, this.label1); | |||
this.label1.ShowAll(); | |||
this.hpaned1.Add(this.notebook1); | |||
Gtk.Paned.PanedChild w9 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.notebook1])); | |||
w9.Resize = false; | |||
Gtk.Paned.PanedChild w6 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.notebook1])); | |||
w6.Resize = false; | |||
// Container child hpaned1.Gtk.Paned+PanedChild | |||
this.vpaned1 = new Gtk.VPaned(); | |||
this.vpaned1.CanFocus = true; | |||
@@ -264,27 +258,47 @@ public partial class MainWindow { | |||
this.vbox2 = new Gtk.VBox(); | |||
this.vbox2.Name = "vbox2"; | |||
this.vbox2.BorderWidth = ((uint)(5)); | |||
// Container child vbox2.Gtk.Box+BoxChild | |||
this.label2 = new Gtk.Label(); | |||
this.label2.WidthRequest = 100; | |||
this.label2.Name = "label2"; | |||
this.label2.LabelProp = Mono.Unix.Catalog.GetString("Tools"); | |||
this.vbox2.Add(this.label2); | |||
Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox2[this.label2])); | |||
w7.Position = 0; | |||
w7.Expand = false; | |||
w7.Fill = false; | |||
this.vpaned1.Add(this.vbox2); | |||
Gtk.Paned.PanedChild w10 = ((Gtk.Paned.PanedChild)(this.vpaned1[this.vbox2])); | |||
w10.Resize = false; | |||
Gtk.Paned.PanedChild w8 = ((Gtk.Paned.PanedChild)(this.vpaned1[this.vbox2])); | |||
w8.Resize = false; | |||
// Container child vpaned1.Gtk.Paned+PanedChild | |||
this.vbox3 = new Gtk.VBox(); | |||
this.vbox3.Name = "vbox3"; | |||
this.vbox3.BorderWidth = ((uint)(5)); | |||
// Container child vbox3.Gtk.Box+BoxChild | |||
this.label3 = new Gtk.Label(); | |||
this.label3.WidthRequest = 100; | |||
this.label3.Name = "label3"; | |||
this.label3.LabelProp = Mono.Unix.Catalog.GetString("Layers & Channels"); | |||
this.vbox3.Add(this.label3); | |||
Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox3[this.label3])); | |||
w9.Position = 0; | |||
w9.Expand = false; | |||
w9.Fill = false; | |||
this.vpaned1.Add(this.vbox3); | |||
this.hpaned1.Add(this.vpaned1); | |||
this.vbox1.Add(this.hpaned1); | |||
Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned1])); | |||
w13.Position = 2; | |||
Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned1])); | |||
w12.Position = 2; | |||
// Container child vbox1.Gtk.Box+BoxChild | |||
this.statusbar1 = new Gtk.Statusbar(); | |||
this.statusbar1.Name = "statusbar1"; | |||
this.statusbar1.Spacing = 6; | |||
this.vbox1.Add(this.statusbar1); | |||
Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); | |||
w14.Position = 3; | |||
w14.Expand = false; | |||
w14.Fill = false; | |||
Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); | |||
w13.Position = 3; | |||
w13.Expand = false; | |||
w13.Fill = false; | |||
this.Add(this.vbox1); | |||
if ((this.Child != null)) { | |||
this.Child.ShowAll(); |
@@ -8,7 +8,7 @@ | |||
// </autogenerated> | |||
// ------------------------------------------------------------------------------ | |||
namespace Pimp { | |||
namespace ThePimp { | |||
public partial class OpenFile { | |||
@@ -21,15 +21,15 @@ namespace Pimp { | |||
protected virtual void Build() { | |||
Stetic.Gui.Initialize(this); | |||
// Widget Pimp.OpenFile | |||
this.Name = "Pimp.OpenFile"; | |||
// Widget ThePimp.OpenFile | |||
this.Name = "ThePimp.OpenFile"; | |||
this.Title = Mono.Unix.Catalog.GetString("Open File"); | |||
this.Icon = Stetic.IconLoader.LoadIcon(this, "gtk-open", Gtk.IconSize.Menu, 16); | |||
this.TypeHint = ((Gdk.WindowTypeHint)(1)); | |||
this.WindowPosition = ((Gtk.WindowPosition)(4)); | |||
this.Modal = true; | |||
this.HasSeparator = false; | |||
// Internal child Pimp.OpenFile.VBox | |||
// Internal child ThePimp.OpenFile.VBox | |||
Gtk.VBox w1 = this.VBox; | |||
w1.Name = "dialog1_VBox"; | |||
w1.BorderWidth = ((uint)(2)); | |||
@@ -39,7 +39,7 @@ namespace Pimp { | |||
w1.Add(this.filechooserwidget1); | |||
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(w1[this.filechooserwidget1])); | |||
w2.Position = 0; | |||
// Internal child Pimp.OpenFile.ActionArea | |||
// Internal child ThePimp.OpenFile.ActionArea | |||
Gtk.HButtonBox w3 = this.ActionArea; | |||
w3.Name = "dialog1_ActionArea"; | |||
w3.Spacing = 6; |
@@ -0,0 +1,33 @@ | |||
// ------------------------------------------------------------------------------ | |||
// <autogenerated> | |||
// This code was generated by a tool. | |||
// Mono Runtime Version: 2.0.50727.42 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </autogenerated> | |||
// ------------------------------------------------------------------------------ | |||
namespace ThePimp { | |||
public partial class PictureView { | |||
private Gtk.DrawingArea drawingarea1; | |||
protected virtual void Build() { | |||
Stetic.Gui.Initialize(this); | |||
// Widget ThePimp.PictureView | |||
Stetic.BinContainer.Attach(this); | |||
this.Name = "ThePimp.PictureView"; | |||
// Container child ThePimp.PictureView.Gtk.Container+ContainerChild | |||
this.drawingarea1 = new Gtk.DrawingArea(); | |||
this.drawingarea1.Name = "drawingarea1"; | |||
this.Add(this.drawingarea1); | |||
if ((this.Child != null)) { | |||
this.Child.ShowAll(); | |||
} | |||
this.Show(); | |||
} | |||
} | |||
} |
@@ -55,6 +55,53 @@ namespace Stetic { | |||
} | |||
} | |||
internal class BinContainer { | |||
private Gtk.Widget child; | |||
private Gtk.UIManager uimanager; | |||
public static BinContainer Attach(Gtk.Bin bin) { | |||
BinContainer bc = new BinContainer(); | |||
bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); | |||
bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); | |||
bin.Added += new Gtk.AddedHandler(bc.OnAdded); | |||
return bc; | |||
} | |||
private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) { | |||
if ((this.child != null)) { | |||
args.Requisition = this.child.SizeRequest(); | |||
} | |||
} | |||
private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) { | |||
if ((this.child != null)) { | |||
this.child.Allocation = args.Allocation; | |||
} | |||
} | |||
private void OnAdded(object sender, Gtk.AddedArgs args) { | |||
this.child = args.Widget; | |||
} | |||
public void SetUiManager(Gtk.UIManager uim) { | |||
this.uimanager = uim; | |||
this.child.Realized += new System.EventHandler(this.OnRealized); | |||
} | |||
private void OnRealized(object sender, System.EventArgs args) { | |||
if ((this.uimanager != null)) { | |||
Gtk.Widget w; | |||
w = this.child.Toplevel; | |||
if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) { | |||
((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup); | |||
this.uimanager = null; | |||
} | |||
} | |||
} | |||
} | |||
internal class ActionGroups { | |||
public static Gtk.ActionGroup GetActionGroup(System.Type type) { |
@@ -4,6 +4,9 @@ | |||
<images-root-path>..</images-root-path> | |||
<target-gtk-version>2.12.1</target-gtk-version> | |||
</configuration> | |||
<import> | |||
<widget-library name="../Pimp.exe" internal="true" /> | |||
</import> | |||
<widget class="Gtk.Window" id="MainWindow" design-size="840 680"> | |||
<action-group name="Default"> | |||
<action id="newAction"> | |||
@@ -275,9 +278,7 @@ | |||
<property name="MemberName" /> | |||
<property name="ShadowType">None</property> | |||
<child> | |||
<widget class="Gtk.DrawingArea" id="drawingarea1"> | |||
<property name="MemberName" /> | |||
</widget> | |||
<placeholder /> | |||
</child> | |||
</widget> | |||
</child> | |||
@@ -307,7 +308,17 @@ | |||
<property name="MemberName" /> | |||
<property name="BorderWidth">5</property> | |||
<child> | |||
<placeholder /> | |||
<widget class="Gtk.Label" id="label2"> | |||
<property name="MemberName" /> | |||
<property name="WidthRequest">100</property> | |||
<property name="LabelProp" translatable="yes">Tools</property> | |||
</widget> | |||
<packing> | |||
<property name="Position">0</property> | |||
<property name="AutoSize">True</property> | |||
<property name="Expand">False</property> | |||
<property name="Fill">False</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<placeholder /> | |||
@@ -325,7 +336,17 @@ | |||
<property name="MemberName" /> | |||
<property name="BorderWidth">5</property> | |||
<child> | |||
<placeholder /> | |||
<widget class="Gtk.Label" id="label3"> | |||
<property name="MemberName" /> | |||
<property name="WidthRequest">100</property> | |||
<property name="LabelProp" translatable="yes">Layers & Channels</property> | |||
</widget> | |||
<packing> | |||
<property name="Position">0</property> | |||
<property name="AutoSize">True</property> | |||
<property name="Expand">False</property> | |||
<property name="Fill">False</property> | |||
</packing> | |||
</child> | |||
<child> | |||
<placeholder /> | |||
@@ -364,7 +385,7 @@ | |||
</widget> | |||
</child> | |||
</widget> | |||
<widget class="Gtk.Dialog" id="Pimp.OpenFile" design-size="627 448"> | |||
<widget class="Gtk.Dialog" id="ThePimp.OpenFile" design-size="627 448"> | |||
<property name="MemberName" /> | |||
<property name="Title" translatable="yes">Open File</property> | |||
<property name="Icon">stock:gtk-open Menu</property> | |||
@@ -432,4 +453,12 @@ | |||
</widget> | |||
</child> | |||
</widget> | |||
</stetic-interface> | |||
<widget class="Gtk.Bin" id="ThePimp.PictureView" design-size="300 300"> | |||
<property name="MemberName" /> | |||
<child> | |||
<widget class="Gtk.DrawingArea" id="drawingarea1"> | |||
<property name="MemberName" /> | |||
</widget> | |||
</child> | |||
</widget> | |||
</stetic-interface> |
@@ -0,0 +1,6 @@ | |||
<objects> | |||
<object type="ThePimp.PictureView" palette-category="ThePimp" allow-children="false" base-type="Gtk.Bin"> | |||
<itemgroups /> | |||
<signals /> | |||
</object> | |||
</objects> |
@@ -120,6 +120,13 @@ if test "${ac_cv_my_have_il}" = "no" -a "${ac_cv_my_have_ole}" = "no" -a "${ac_c | |||
AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2 or OpenCV, please install one of them]]) | |||
fi | |||
# Build The Pimp? | |||
AC_PATH_PROG(GMCS, gmcs, no) | |||
PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0], [:]) | |||
PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:]) | |||
PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:]) | |||
AM_CONDITIONAL(USE_CSHARP, test "${gmcs}" != "no") | |||
AC_CONFIG_FILES([ | |||
Makefile | |||
pipi/Makefile | |||
@@ -127,12 +134,14 @@ AC_CONFIG_FILES([ | |||
genethumb/Makefile | |||
examples/Makefile | |||
test/Makefile | |||
pipi-sharp/Makefile | |||
ThePimp/Makefile | |||
]) | |||
AC_CONFIG_FILES([ | |||
pipi/pipi.pc | |||
pipi-sharp/pipi-sharp.pc | |||
pipi-sharp/pipi-sharp.dll.config | |||
]) | |||
AC_OUTPUT | |||
(cd pimp && ./configure) | |||
@@ -1,8 +0,0 @@ | |||
*.userprefs | |||
*.usertasks | |||
*.pidb | |||
*.exe | |||
*.dll | |||
*.pc | |||
pimp | |||
bin |
@@ -1,71 +0,0 @@ | |||
EXTRA_DIST = rules.make configure Makefile.include | |||
all: all-recursive | |||
top_srcdir=. | |||
include $(top_srcdir)/config.make | |||
include $(top_srcdir)/rules.make | |||
#include $(top_srcdir)/custom-hooks.make | |||
#Warning: This is an automatically generated file, do not edit! | |||
ifeq ($(CONFIG),DEBUG) | |||
SUBDIRS = Pipi Pimp | |||
endif | |||
ifeq ($(CONFIG),RELEASE) | |||
SUBDIRS = Pipi Pimp | |||
endif | |||
CONFIG_MAKE=$(top_srcdir)/config.make | |||
%-recursive: $(CONFIG_MAKE) | |||
@set . $$MAKEFLAGS; final_exit=:; \ | |||
case $$2 in --unix) shift ;; esac; \ | |||
case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \ | |||
make pre-$*-hook prefix=$(prefix) ; \ | |||
for dir in $(SUBDIRS); do \ | |||
case $$dir in \ | |||
.) make $*-local || { final_exit="exit 1"; $$dk; };;\ | |||
*) (cd $$dir && make $*) || { final_exit="exit 1"; $$dk; };;\ | |||
esac \ | |||
done; \ | |||
make post-$*-hook prefix=$(prefix) ; \ | |||
$$final_exit | |||
$(CONFIG_MAKE): | |||
echo "You must run configure first" | |||
exit 1 | |||
clean distclean: clean-recursive | |||
install: install-recursive | |||
uninstall: uninstall-recursive | |||
dist: $(CONFIG_MAKE) | |||
rm -rf $(PACKAGE)-$(VERSION) | |||
mkdir $(PACKAGE)-$(VERSION) | |||
make pre-dist-hook distdir=$$distdir | |||
for dir in $(SUBDIRS); do \ | |||
pkgdir=`pwd`/$(PACKAGE)-$(VERSION); \ | |||
mkdir $$pkgdir/$$dir || true; \ | |||
case $$dir in \ | |||
.) make dist-local distdir=$$pkgdir || exit 1;; \ | |||
*) (cd $$dir; make dist-local distdir=$$pkgdir/$$dir) || exit 1;; \ | |||
esac \ | |||
done | |||
(make dist-local distdir=$(PACKAGE)-$(VERSION)) | |||
make | |||
make post-dist-hook distsir=$$distdir | |||
tar czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) | |||
rm -rf $(PACKAGE)-$(VERSION) | |||
@echo "==========================================" | |||
@echo "$(PACKAGE)-$(VERSION) has been packaged > $(PACKAGE)-$(VERSION).tar.gz" | |||
@echo "==========================================" | |||
distcheck: dist | |||
(mkdir test; cd test; \ | |||
tar xzvf ../$(PACKAGE)-$(VERSION).tar.gz; cd $(PACKAGE)-$(VERSION); \ | |||
./configure --prefix=$$(cd `pwd`/..; pwd); \ | |||
make && make install && make dist); | |||
rm -rf test |
@@ -1,86 +0,0 @@ | |||
VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT | |||
build_sources = $(FILES) $(GENERATED_FILES) | |||
build_sources_embed = $(build_sources:%='$(srcdir)/%') | |||
comma__=, | |||
get_resource_name = $(firstword $(subst $(comma__), ,$1)) | |||
get_culture = $(lastword $(subst ., ,$(basename $1))) | |||
is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) | |||
build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) | |||
build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) | |||
build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) | |||
build_others_list = $(build_non_culture_others_list) | |||
build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) | |||
# resgen all .resx resources | |||
build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) | |||
build_resx_resources = $(build_resx_files:.resx=.resources) | |||
# embed resources for the main assembly | |||
build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) | |||
build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%') | |||
build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res))) | |||
build_others_resources = $(build_others_files) | |||
build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%') | |||
build_resources = $(build_resx_resources) $(build_others_resources) | |||
build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) | |||
build_references_ref = $(foreach ref, $(REFERENCES), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))) | |||
build_references_ref += $(foreach ref, $(DLL_REFERENCES), -r:$(ref)) | |||
build_references_ref += $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref)) | |||
EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files) | |||
CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list) | |||
DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* | |||
pkglib_SCRIPTS = $(ASSEMBLY) | |||
bin_SCRIPTS = $(BINARIES) | |||
linuxdesktopapplicationsdir = @datadir@/applications | |||
linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS) | |||
programfilesdir = @libdir@/@PACKAGE@ | |||
programfiles_DATA = $(PROGRAMFILES) | |||
linuxpkgconfigdir = @libdir@/pkgconfig | |||
linuxpkgconfig_DATA = $(LINUX_PKGCONFIG) | |||
# macros | |||
# $(call emit-deploy-target,deploy-variable-name) | |||
define emit-deploy-target | |||
$($1): $($1_SOURCE) | |||
mkdir -p $$(dir $($1)) | |||
cp '$$<' '$$@' | |||
endef | |||
# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) | |||
# assumes that for a wrapper foo.pc its source template is foo.pc.in | |||
# if $3 is non-empty then wrapper is marked exec | |||
define emit-deploy-wrapper | |||
$($1): $2 $(top_srcdir)/config.make | |||
mkdir -p '$$(@D)' | |||
cp '$$<' '$$@' | |||
$(if $3,chmod +x '$$@') | |||
$2: $2.in $(top_srcdir)/config.make | |||
sed -e "s,@prefix@,$(prefix)," -e "s,@PACKAGE@,$(PACKAGE)," -e "s,@expanded_libdir@,$(libdir)," -e "s,@expanded_bindir@,$(bindir)," -e "s,@expanded_datadir@,$(datadir)," < $2.in > $2 | |||
endef | |||
# generating satellite assemblies | |||
culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) | |||
cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) | |||
culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2) | |||
culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)' | |||
build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)) | |||
build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res))) | |||
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) | |||
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) | |||
$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): | |||
mkdir -p '$(@D)' | |||
$(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) |
@@ -1,91 +0,0 @@ | |||
# Warning: This is an automatically generated file, do not edit! | |||
if ENABLE_DEBUG | |||
ASSEMBLY_COMPILER_COMMAND = gmcs | |||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" | |||
ASSEMBLY = bin/Debug/pimp.exe | |||
ASSEMBLY_MDB = $(ASSEMBLY).mdb | |||
COMPILE_TARGET = exe | |||
PROJECT_REFERENCES = | |||
BUILD_DIR = bin/Debug | |||
PIMP_DESKTOP_SOURCE=app.desktop | |||
endif | |||
if ENABLE_RELEASE | |||
ASSEMBLY_COMPILER_COMMAND = gmcs | |||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ | |||
ASSEMBLY = bin/Release/pimp.exe | |||
ASSEMBLY_MDB = | |||
COMPILE_TARGET = exe | |||
PROJECT_REFERENCES = | |||
BUILD_DIR = bin/Release | |||
PIMP_DESKTOP_SOURCE=app.desktop | |||
endif | |||
AL=al2 | |||
SATELLITE_ASSEMBLY_NAME=.resources.dll | |||
LINUX_DESKTOPAPPLICATIONS = \ | |||
$(PIMP_DESKTOP) | |||
BINARIES = \ | |||
$(PIMP) | |||
all: $(ASSEMBLY) $(LINUX_DESKTOPAPPLICATIONS) $(BINARIES) | |||
FILES = \ | |||
gtk-gui/generated.cs \ | |||
MainWindow.cs \ | |||
gtk-gui/MainWindow.cs \ | |||
Main.cs \ | |||
AssemblyInfo.cs \ | |||
OpenFile.cs \ | |||
gtk-gui/Pimp.OpenFile.cs | |||
DATA_FILES = \ | |||
app.desktop | |||
RESOURCES = \ | |||
gtk-gui/gui.stetic | |||
EXTRAS = \ | |||
pimp.in | |||
REFERENCES = \ | |||
$(GTK_SHARP_20_LIBS) \ | |||
$(GLIB_SHARP_20_LIBS) \ | |||
$(GLADE_SHARP_20_LIBS) \ | |||
System \ | |||
Mono.Posix | |||
DLL_REFERENCES = | |||
CLEANFILES = $(LINUX_DESKTOPAPPLICATIONS) $(BINARIES) | |||
include $(top_srcdir)/Makefile.include | |||
PIMP = $(BUILD_DIR)/pimp | |||
PIMP_DESKTOP = $(BUILD_DIR)/pimp.desktop | |||
$(eval $(call emit-deploy-wrapper,PIMP,pimp,x)) | |||
$(eval $(call emit-deploy-target,PIMP_DESKTOP)) | |||
$(build_xamlg_list): %.xaml.g.cs: %.xaml | |||
xamlg '$<' | |||
$(build_resx_resources) : %.resources: %.resx | |||
resgen2 '$<' '$@' | |||
$(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) | |||
mkdir -p $(dir $(ASSEMBLY)) | |||
$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) |
@@ -1,20 +0,0 @@ | |||
<Combine name="Pimp" fileversion="2.0"> | |||
<Configurations active="Debug"> | |||
<Configuration name="Debug" ctype="CombineConfiguration"> | |||
<Entry build="True" name="Pipi" configuration="Debug" /> | |||
<Entry build="True" name="Pimp" configuration="Debug" /> | |||
</Configuration> | |||
<Configuration name="Release" ctype="CombineConfiguration"> | |||
<Entry build="True" name="Pipi" configuration="Release" /> | |||
<Entry build="True" name="Pimp" configuration="Release" /> | |||
</Configuration> | |||
</Configurations> | |||
<StartMode startupentry="Pimp" single="True"> | |||
<Execute type="None" entry="Pipi" /> | |||
<Execute type="None" entry="Pimp" /> | |||
</StartMode> | |||
<Entries> | |||
<Entry filename="Pipi/Pipi.mdp" /> | |||
<Entry filename="Pimp/Pimp.mdp" /> | |||
</Entries> | |||
</Combine> |
@@ -1,18 +0,0 @@ | |||
// OpenFile.cs created with MonoDevelop | |||
// User: sam at 23:05 03/10/2008 | |||
// | |||
// To change standard headers go to Edit->Preferences->Coding->Standard Headers | |||
// | |||
using System; | |||
namespace Pimp | |||
{ | |||
public partial class OpenFile : Gtk.Dialog | |||
{ | |||
public OpenFile() | |||
{ | |||
this.Build(); | |||
} | |||
} | |||
} |
@@ -1,3 +0,0 @@ | |||
#!/bin/sh | |||
exec mono "@expanded_libdir@/@PACKAGE@/Pimp.exe" "$@" |
@@ -1,3 +0,0 @@ | |||
<configuration> | |||
<dllmap dll="libpipi.dll" target="../../../../pipi/.libs/libpipi.so.0" /> | |||
</configuration> |
@@ -1,4 +0,0 @@ | |||
Looking for required packages | |||
Checking for package 'glade-sharp-2.0'.. found. | |||
Checking for package 'glib-sharp-2.0'.. found. | |||
Checking for package 'gtk-sharp-2.0'.. found. |
@@ -1,9 +0,0 @@ | |||
prefix=/usr/local | |||
libdir=/usr/local/lib | |||
bindir=/usr/local/bin | |||
datadir=/usr/local/share | |||
RUNTIME=mono | |||
ASSEMBLY_VERSION=0.1.0.0 | |||
VERSION=0.1 | |||
PACKAGE=pimp | |||
CONFIG=DEBUG |
@@ -1,159 +0,0 @@ | |||
#!/bin/bash | |||
VERSION=0.1 | |||
PACKAGE=pimp | |||
prefix=/usr/local | |||
config=RELEASE | |||
configurations=" RELEASE DEBUG" | |||
common_packages=" glade-sharp-2.0;2.12.1 glib-sharp-2.0;2.12.1 gtk-sharp-2.0;2.12.1" | |||
usage () | |||
{ | |||
echo "Usage : configure [OPTION]... [--config=CONFIG]" | |||
echo | |||
echo "Options:" | |||
echo " --prefix=PREFIX install architecture-independent files in PREFIX" | |||
echo " [/usr/local]" | |||
echo " --bindir=DIR user executables [PREFIX/bin]" | |||
echo " --datadir=DIR read-only architecture-independent data [PREFIX/share]" | |||
echo " --libdir=DIR object code libraries [PREFIX/lib]" | |||
echo | |||
echo "Configurations available :" | |||
for c in $configurations; do | |||
if [ "$c" = "$config" ]; then | |||
echo " $c (Default)" | |||
else | |||
echo " $c" | |||
fi | |||
done | |||
} | |||
validate_config () | |||
{ | |||
test -z "$1" && return 0 | |||
for c in $configurations; do | |||
if [ "$c" = "$1" ]; then | |||
return 1 | |||
fi | |||
done | |||
return 0 | |||
} | |||
check_package () | |||
{ | |||
name=`echo $1 | cut -d\; -f1` | |||
version=`echo $1 | cut -d\; -f2` | |||
echo -n "Checking for package '$name'.." | tee -a config.log | |||
pkg-config --atleast-version=$version $name | |||
if [ $? -ne 0 ]; then | |||
echo " ERROR: Package named '$name' >= $version not found." | tee -a config.log | |||
echo "Try adjusting your PKG_CONFIG_PATH environment variable." | tee -a config.log | |||
return 1 | |||
fi | |||
echo " found." | tee -a config.log | |||
} | |||
check_required_packages () | |||
{ | |||
echo "Looking for required packages" | tee config.log | |||
var=required_packages_$config | |||
for pkg in $common_packages ${!var}; do | |||
check_package $pkg | |||
retval=$? | |||
[ $retval -ne 0 ] && return $retval | |||
done | |||
return 0 | |||
} | |||
while test x$1 != x; do | |||
case $1 in | |||
--prefix=*) | |||
prefix=`echo $1 | sed 's/--prefix=//'` | |||
;; | |||
--prefix) | |||
shift | |||
prefix=$1 | |||
;; | |||
--libdir=*) | |||
libdir=`echo $1 | sed 's/--libdir=//'` | |||
;; | |||
--libdir) | |||
shift | |||
libdir=$1 | |||
;; | |||
--bindir=*) | |||
bindir=`echo $1 | sed 's/--bindir=//'` | |||
;; | |||
--bindir) | |||
shift | |||
bindir=$1 | |||
;; | |||
--datadir=*) | |||
datadir=`echo $1 | sed 's/--datadir=//'` | |||
;; | |||
--datadir) | |||
shift | |||
datadir=$1 | |||
;; | |||
--config=*) | |||
conf=`echo $1 | sed 's/--config=//'` | |||
validate_config "$conf" | |||
if [ $? -eq 1 ]; then | |||
config=$conf | |||
else | |||
echo "Invalid config name - $conf" | |||
usage | |||
exit 1 | |||
fi | |||
;; | |||
--help) | |||
usage | |||
exit | |||
;; | |||
*) | |||
echo Unknown argument $1 >&2 | |||
usage | |||
exit 1 | |||
;; | |||
esac | |||
shift | |||
done | |||
check_required_packages | |||
[ $? -eq 1 ] && exit 1 | |||
if [ -z "$libdir" ]; then | |||
libdir=$prefix/lib | |||
fi | |||
if [ -z "$bindir" ]; then | |||
bindir=$prefix/bin | |||
fi | |||
if [ -z "$datadir" ]; then | |||
datadir=$prefix/share | |||
fi | |||
echo "prefix=$prefix" > config.make | |||
echo "libdir=$libdir" >> config.make | |||
echo "bindir=$bindir" >> config.make | |||
echo "datadir=$datadir" >> config.make | |||
echo "RUNTIME=mono" >> config.make | |||
echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make | |||
echo "VERSION=$VERSION" >> config.make | |||
echo "PACKAGE=$PACKAGE" >> config.make | |||
echo "CONFIG=$config" >> config.make | |||
echo | |||
echo "$PACKAGE has been configured with " | |||
echo " prefix = $prefix" | |||
if [ "$libdir" != "$prefix/lib" ]; then | |||
echo " libdir = $libdir" | |||
fi | |||
if [ "$bindir" != "$prefix/bin" ]; then | |||
echo " bindir = $bindir" | |||
fi | |||
if [ "$datadir" != "$prefix/share" ]; then | |||
echo " datadir = $datadir" | |||
fi | |||
echo " config = $config" | |||
echo |
@@ -1,40 +0,0 @@ | |||
clean-local: | |||
make pre-clean-local-hook | |||
make $(CONFIG)_BeforeClean | |||
-rm -f $(CLEANFILES) | |||
make $(CONFIG)_AfterClean | |||
make post-clean-local-hook | |||
install-local: | |||
uninstall-local: | |||
dist-local: | |||
make pre-dist-local-hook distdir=$$distdir | |||
list='$(EXTRA_DIST)'; \ | |||
for f in Makefile $$list; do \ | |||
d=`dirname "$$f"`; \ | |||
test -d "$(distdir)/$$d" || \ | |||
mkdir -p "$(distdir)/$$d"; \ | |||
cp -p "$$f" "$(distdir)/$$d" || exit 1; \ | |||
done | |||
make post-dist-local-hook distdir=$$distdir | |||
dist-local-recursive: | |||
for dir in $(SUBDIRS); do \ | |||
mkdir -p $(distdir)/$$dir || true; \ | |||
case $$dir in \ | |||
.) make dist-local distdir=$(distdir) || exit 1;; \ | |||
*) (cd $$dir; make dist-local distdir=$(distdir)/$$dir) || exit 1; \ | |||
esac \ | |||
done | |||
#hooks: Available hooks - all, clean, install, uninstall and dist | |||
# and their *-local variants | |||
pre-%-hook: ; @: | |||
post-%-hook: ; @: | |||
#targets for custom commands | |||
%_BeforeBuild: ; @: | |||
%_AfterBuild: ; @: | |||
%_BeforeClean: ; @: | |||
%_AfterClean: ; @: |
@@ -0,0 +1,4 @@ | |||
*.pidb | |||
*.exe | |||
*.dll | |||
pipi-sharp.pc |
@@ -0,0 +1,30 @@ | |||
# $Id: $ | |||
pipidir = $(libdir)/pipi-sharp | |||
pipi_sources = \ | |||
$(srcdir)/AssemblyInfo.cs \ | |||
$(srcdir)/Pipi.cs \ | |||
$(srcdir)/Picture.cs | |||
test_sources = \ | |||
$(srcdir)/test.cs | |||
if USE_CSHARP | |||
pipi_DATA = pipi-sharp.dll pipi-sharp.dll.config | |||
noinst_DATA = test.exe | |||
endif | |||
EXTRA_DIST = $(pipi_sources) $(test_sources) \ | |||
pipi-sharp.pc.in pipi-sharp.dll.config.in | |||
pipi-sharp.dll: $(pipi_sources) | |||
gmcs -unsafe $(pipi_sources) -out:$@ -target:library | |||
test.exe: $(test_sources) pipi-sharp.dll | |||
gmcs $(test_sources) -out:$@ -lib:./ \ | |||
-r:./pipi-sharp.dll | |||
clean-local: | |||
rm -f *.exe *.dll *.mdb | |||
@@ -0,0 +1,57 @@ | |||
// MyClass.cs created with MonoDevelop | |||
// User: sam at 13:14 04/10/2008 | |||
// | |||
// To change standard headers go to Edit->Preferences->Coding->Standard Headers | |||
// | |||
using System; | |||
using System.Runtime.InteropServices; | |||
using System.Security; | |||
namespace Pipi | |||
{ | |||
public class Picture | |||
{ | |||
private IntPtr _picture; | |||
[DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), | |||
SuppressUnmanagedCodeSecurity] | |||
private static extern IntPtr pipi_load(string s); | |||
public Picture(string s) | |||
{ | |||
_picture = pipi_load(s); | |||
} | |||
[DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), | |||
SuppressUnmanagedCodeSecurity] | |||
private static extern int pipi_free(IntPtr img); | |||
~Picture() | |||
{ | |||
pipi_free(_picture); | |||
} | |||
[DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), | |||
SuppressUnmanagedCodeSecurity] | |||
private static extern IntPtr pipi_save(IntPtr p, string s); | |||
public void Save(string s) | |||
{ | |||
_picture = pipi_save(_picture, s); | |||
} | |||
[DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), | |||
SuppressUnmanagedCodeSecurity] | |||
private static extern int pipi_get_image_width(IntPtr img); | |||
public int Width | |||
{ | |||
get { return pipi_get_image_width(_picture); } | |||
} | |||
[DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), | |||
SuppressUnmanagedCodeSecurity] | |||
private static extern int pipi_get_image_height(IntPtr img); | |||
public int Height | |||
{ | |||
get { return pipi_get_image_height(_picture); } | |||
} | |||
} | |||
} |
@@ -0,0 +1,3 @@ | |||
<configuration> | |||
<dllmap dll="libpipi.dll" target="../pipi/.libs/libpipi.so.0" /> | |||
</configuration> |
@@ -0,0 +1,3 @@ | |||
<configuration> | |||
<dllmap dll="libpipi.dll" target="../pipi/.libs/libpipi.so.@LT_MAJOR@" /> | |||
</configuration> |
@@ -1,13 +1,13 @@ | |||
<Project name="Pipi" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> | |||
<Project name="pipi-sharp" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> | |||
<Configurations active="Debug"> | |||
<Configuration name="Debug" ctype="DotNetProjectConfiguration"> | |||
<Output directory="bin/Debug" assembly="pipi-sharp" /> | |||
<Output directory="." assembly="pipi-sharp" /> | |||
<Build debugmode="True" target="Library" /> | |||
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> | |||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> | |||
</Configuration> | |||
<Configuration name="Release" ctype="DotNetProjectConfiguration"> | |||
<Output directory="bin/Release" assembly="pipi-sharp" /> | |||
<Output directory="." assembly="pipi-sharp" /> | |||
<Build debugmode="False" target="Library" /> | |||
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> | |||
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> | |||
@@ -15,6 +15,7 @@ | |||
</Configurations> | |||
<Contents> | |||
<File name="Pipi.cs" subtype="Code" buildaction="Compile" /> | |||
<File name="Picture.cs" subtype="Code" buildaction="Compile" /> | |||
<File name="AssemblyInfo.cs" subtype="Code" buildaction="Compile" /> | |||
</Contents> | |||
<References> |
@@ -0,0 +1,31 @@ | |||
/* | |||
* Test .NET bindings test program | |||
* Copyright (c) 2008 Sam Hocevar <sam@zoy.org> | |||
* All Rights Reserved | |||
* | |||
* $Id$ | |||
* | |||
* This program is free software. It comes without any warranty, to | |||
* the extent permitted by applicable law. You can redistribute it | |||
* and/or modify it under the terms of the Do What The Fuck You Want | |||
* To Public License, Version 2, as published by Sam Hocevar. See | |||
* http://sam.zoy.org/wtfpl/COPYING for more details. | |||
*/ | |||
using System; | |||
using Pipi; | |||
class Test | |||
{ | |||
public static void Main() | |||
{ | |||
Console.WriteLine("libpipi {0} .NET test", Libpipi.getVersion()); | |||
Console.WriteLine("(c) 2008 Sam Hocevar <sam@zoy.org>"); | |||
Pipi.Picture p = new Pipi.Picture("random:640x480"); | |||
Console.WriteLine("Test picture size: {0}x{1}", p.Width, p.Height); | |||
} | |||
} | |||