From 6fb77905ef02f0ebf0b88c228602ec82a873be6a Mon Sep 17 00:00:00 2001 From: sam Date: Sat, 4 Oct 2008 15:54:36 +0000 Subject: [PATCH] Starting the work on Pimp. It's a MonoDevelop project but eventually it will be properly integrated with the autotools solution, too. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2866 92316355-f0b4-4df1-b90c-862c8a59935f --- configure.ac | 15 +- pimp/.gitignore | 8 + pimp/Makefile | 71 +++++ pimp/Makefile.include | 86 ++++++ pimp/Pimp.make | 91 ++++++ pimp/Pimp.mds | 20 ++ pimp/Pimp/AssemblyInfo.cs | 30 ++ pimp/Pimp/Main.cs | 21 ++ pimp/Pimp/MainWindow.cs | 37 +++ pimp/Pimp/OpenFile.cs | 18 ++ pimp/Pimp/Pimp.mdp | 42 +++ pimp/Pimp/app.desktop | 8 + pimp/Pimp/gtk-gui/MainWindow.cs | 300 ++++++++++++++++++++ pimp/Pimp/gtk-gui/Pimp.OpenFile.cs | 81 ++++++ pimp/Pimp/gtk-gui/generated.cs | 68 +++++ pimp/Pimp/gtk-gui/gui.stetic | 435 +++++++++++++++++++++++++++++ pimp/Pimp/pimp.in | 3 + pimp/Pipi/AssemblyInfo.cs | 30 ++ pimp/Pipi/Pipi.cs | 23 ++ pimp/Pipi/Pipi.mdp | 23 ++ pimp/Pipi/pipi-sharp.dll.config | 3 + pimp/Pipi/pipi.pc.in | 6 + pimp/config.log | 4 + pimp/config.make | 9 + pimp/configure | 159 +++++++++++ pimp/rules.make | 40 +++ 26 files changed, 1626 insertions(+), 5 deletions(-) create mode 100644 pimp/.gitignore create mode 100644 pimp/Makefile create mode 100644 pimp/Makefile.include create mode 100644 pimp/Pimp.make create mode 100644 pimp/Pimp.mds create mode 100644 pimp/Pimp/AssemblyInfo.cs create mode 100644 pimp/Pimp/Main.cs create mode 100644 pimp/Pimp/MainWindow.cs create mode 100644 pimp/Pimp/OpenFile.cs create mode 100644 pimp/Pimp/Pimp.mdp create mode 100644 pimp/Pimp/app.desktop create mode 100644 pimp/Pimp/gtk-gui/MainWindow.cs create mode 100644 pimp/Pimp/gtk-gui/Pimp.OpenFile.cs create mode 100644 pimp/Pimp/gtk-gui/generated.cs create mode 100644 pimp/Pimp/gtk-gui/gui.stetic create mode 100644 pimp/Pimp/pimp.in create mode 100644 pimp/Pipi/AssemblyInfo.cs create mode 100644 pimp/Pipi/Pipi.cs create mode 100644 pimp/Pipi/Pipi.mdp create mode 100644 pimp/Pipi/pipi-sharp.dll.config create mode 100644 pimp/Pipi/pipi.pc.in create mode 100644 pimp/config.log create mode 100644 pimp/config.make create mode 100755 pimp/configure create mode 100644 pimp/rules.make diff --git a/configure.ac b/configure.ac index 17d8d21..a91feed 100644 --- a/configure.ac +++ b/configure.ac @@ -1,23 +1,26 @@ # $Id$ AC_INIT(libpipi, 0.0) +AC_PREREQ(2.50) AC_CONFIG_AUX_DIR(.auto) +AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE([no-define tar-ustar]) dnl AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) -AM_PROG_CC_C_O -AC_PROG_CPP - LT_MAJOR="0" -LT_MINOR="99" -LT_MICRO="13" +LT_MINOR="0" +LT_MICRO="0" AC_SUBST(LT_MAJOR) AC_SUBST(LT_MINOR) AC_SUBST(LT_MICRO) LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO" AC_SUBST(LT_VERSION) + +AM_PROG_CC_C_O +AC_PROG_CPP + AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_LIBTOOL_CXX @@ -131,3 +134,5 @@ AC_CONFIG_FILES([ AC_OUTPUT +(cd pimp && ./configure) + diff --git a/pimp/.gitignore b/pimp/.gitignore new file mode 100644 index 0000000..28b37c4 --- /dev/null +++ b/pimp/.gitignore @@ -0,0 +1,8 @@ +*.userprefs +*.usertasks +*.pidb +*.exe +*.dll +*.pc +pimp +bin diff --git a/pimp/Makefile b/pimp/Makefile new file mode 100644 index 0000000..227e349 --- /dev/null +++ b/pimp/Makefile @@ -0,0 +1,71 @@ + +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 diff --git a/pimp/Makefile.include b/pimp/Makefile.include new file mode 100644 index 0000000..e0eb56d --- /dev/null +++ b/pimp/Makefile.include @@ -0,0 +1,86 @@ +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_$*) \ No newline at end of file diff --git a/pimp/Pimp.make b/pimp/Pimp.make new file mode 100644 index 0000000..60600ed --- /dev/null +++ b/pimp/Pimp.make @@ -0,0 +1,91 @@ + + +# 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) diff --git a/pimp/Pimp.mds b/pimp/Pimp.mds new file mode 100644 index 0000000..9ecc0e0 --- /dev/null +++ b/pimp/Pimp.mds @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/pimp/Pimp/AssemblyInfo.cs b/pimp/Pimp/AssemblyInfo.cs new file mode 100644 index 0000000..4a8b5c5 --- /dev/null +++ b/pimp/Pimp/AssemblyInfo.cs @@ -0,0 +1,30 @@ +// AssemblyInfo.cs created with MonoDevelop +// User: sam at 10:31 AM 9/2/2008 +// +// To change standard headers go to Edit->Preferences->Coding->Standard Headers +// +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("Pimp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// If the build and revision are set to '*' they will be updated automatically. + +[assembly: AssemblyVersion("1.0.*.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/pimp/Pimp/Main.cs b/pimp/Pimp/Main.cs new file mode 100644 index 0000000..b6e11a4 --- /dev/null +++ b/pimp/Pimp/Main.cs @@ -0,0 +1,21 @@ +// Main.cs created with MonoDevelop +// User: sam at 10:31 AM 9/2/2008 +// +// To change standard headers go to Edit->Preferences->Coding->Standard Headers +// +using System; +using Gtk; + +namespace Pimp +{ + class Pimp + { + public static void Main (string[] args) + { + Application.Init (); + MainWindow win = new MainWindow (); + win.Show (); + Application.Run (); + } + } +} diff --git a/pimp/Pimp/MainWindow.cs b/pimp/Pimp/MainWindow.cs new file mode 100644 index 0000000..3f323f3 --- /dev/null +++ b/pimp/Pimp/MainWindow.cs @@ -0,0 +1,37 @@ +// MainWindow.cs created with MonoDevelop +// User: sam at 10:31 AM 9/2/2008 +// +// To change standard headers go to Edit->Preferences->Coding->Standard Headers +// +using System; +using Gtk; +using Pipi; + +public partial class MainWindow: Gtk.Window +{ + public MainWindow (): base (Gtk.WindowType.Toplevel) + { + Build (); + Title += " v" + Libpipi.getVersion(); + } + + protected void OnDeleteEvent (object sender, DeleteEventArgs a) + { + Application.Quit (); + a.RetVal = true; + } + + protected virtual void OnOpenActionActivated (object sender, System.EventArgs e) + { + Pimp.OpenFile open = new Pimp.OpenFile(); + ResponseType rsp = (ResponseType)open.Run(); + open.Destroy(); + if(rsp == ResponseType.Ok) + return; + } + + protected virtual void OnQuitActionActivated (object sender, System.EventArgs e) + { + Application.Quit (); + } +} diff --git a/pimp/Pimp/OpenFile.cs b/pimp/Pimp/OpenFile.cs new file mode 100644 index 0000000..0368066 --- /dev/null +++ b/pimp/Pimp/OpenFile.cs @@ -0,0 +1,18 @@ +// 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(); + } + } +} diff --git a/pimp/Pimp/Pimp.mdp b/pimp/Pimp/Pimp.mdp new file mode 100644 index 0000000..058e534 --- /dev/null +++ b/pimp/Pimp/Pimp.mdp @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pimp/Pimp/app.desktop b/pimp/Pimp/app.desktop new file mode 100644 index 0000000..77b8421 --- /dev/null +++ b/pimp/Pimp/app.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=Pathetic Image Manipulation Program +Exec=pimp +Terminal=false +GenericName=Image Editor +Comment=Create and edit images diff --git a/pimp/Pimp/gtk-gui/MainWindow.cs b/pimp/Pimp/gtk-gui/MainWindow.cs new file mode 100644 index 0000000..ff05806 --- /dev/null +++ b/pimp/Pimp/gtk-gui/MainWindow.cs @@ -0,0 +1,300 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + + + +public partial class MainWindow { + + private Gtk.Action newAction; + + private Gtk.Action openAction; + + private Gtk.Action saveAction; + + private Gtk.Action Action; + + private Gtk.Action FileAction; + + private Gtk.Action EditAction; + + private Gtk.Action ViewAction; + + private Gtk.Action HelpAction; + + private Gtk.Action NewAction; + + private Gtk.Action OpenAction; + + private Gtk.Action SaveAction; + + private Gtk.Action SaveAsAction; + + private Gtk.Action QuitAction; + + private Gtk.Action HelpAction1; + + private Gtk.Action AboutAction; + + private Gtk.Action UndoAction; + + private Gtk.Action RedoAction; + + private Gtk.Action BestFitAction; + + private Gtk.Action NormalSizeAction; + + private Gtk.Action ZoomOutAction; + + private Gtk.Action ZoomInAction; + + private Gtk.Action undoAction; + + private Gtk.Action redoAction; + + private Gtk.Action zoom100Action; + + private Gtk.Action zoomFitAction; + + private Gtk.Action zoomOutAction; + + private Gtk.Action zoomInAction; + + private Gtk.Action helpAction; + + private Gtk.VBox vbox1; + + private Gtk.MenuBar menubar1; + + private Gtk.Toolbar toolbar1; + + private Gtk.HPaned hpaned1; + + private Gtk.Notebook notebook1; + + private Gtk.ScrolledWindow scrolledwindow1; + + private Gtk.DrawingArea drawingarea1; + + private Gtk.Label label1; + + private Gtk.VPaned vpaned1; + + private Gtk.VBox vbox2; + + private Gtk.VBox vbox3; + + private Gtk.Statusbar statusbar1; + + protected virtual void Build() { + Stetic.Gui.Initialize(this); + // Widget MainWindow + Gtk.UIManager w1 = new Gtk.UIManager(); + Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default"); + this.newAction = new Gtk.Action("newAction", null, null, "gtk-new"); + this.newAction.Sensitive = false; + w2.Add(this.newAction, null); + this.openAction = new Gtk.Action("openAction", null, null, "gtk-open"); + w2.Add(this.openAction, null); + this.saveAction = new Gtk.Action("saveAction", null, null, "gtk-save"); + this.saveAction.Sensitive = false; + w2.Add(this.saveAction, null); + this.Action = new Gtk.Action("Action", null, null, null); + w2.Add(this.Action, null); + this.FileAction = new Gtk.Action("FileAction", Mono.Unix.Catalog.GetString("File"), null, null); + this.FileAction.ShortLabel = Mono.Unix.Catalog.GetString("File"); + w2.Add(this.FileAction, null); + this.EditAction = new Gtk.Action("EditAction", Mono.Unix.Catalog.GetString("Edit"), null, null); + this.EditAction.ShortLabel = Mono.Unix.Catalog.GetString("Edit"); + w2.Add(this.EditAction, null); + this.ViewAction = new Gtk.Action("ViewAction", Mono.Unix.Catalog.GetString("View"), null, null); + this.ViewAction.ShortLabel = Mono.Unix.Catalog.GetString("View"); + w2.Add(this.ViewAction, null); + this.HelpAction = new Gtk.Action("HelpAction", Mono.Unix.Catalog.GetString("Help"), null, null); + this.HelpAction.ShortLabel = Mono.Unix.Catalog.GetString("Help"); + w2.Add(this.HelpAction, null); + this.NewAction = new Gtk.Action("NewAction", Mono.Unix.Catalog.GetString("_New"), null, "gtk-new"); + this.NewAction.Sensitive = false; + this.NewAction.ShortLabel = Mono.Unix.Catalog.GetString("_New"); + w2.Add(this.NewAction, null); + this.OpenAction = new Gtk.Action("OpenAction", Mono.Unix.Catalog.GetString("_Open"), null, "gtk-open"); + this.OpenAction.ShortLabel = Mono.Unix.Catalog.GetString("_Open"); + w2.Add(this.OpenAction, null); + this.SaveAction = new Gtk.Action("SaveAction", Mono.Unix.Catalog.GetString("_Save"), null, "gtk-save"); + this.SaveAction.Sensitive = false; + this.SaveAction.ShortLabel = Mono.Unix.Catalog.GetString("_Save"); + w2.Add(this.SaveAction, null); + this.SaveAsAction = new Gtk.Action("SaveAsAction", Mono.Unix.Catalog.GetString("Save _As"), null, "gtk-save-as"); + this.SaveAsAction.Sensitive = false; + this.SaveAsAction.ShortLabel = Mono.Unix.Catalog.GetString("Save _As"); + w2.Add(this.SaveAsAction, null); + this.QuitAction = new Gtk.Action("QuitAction", Mono.Unix.Catalog.GetString("_Quit"), null, "gtk-quit"); + this.QuitAction.ShortLabel = Mono.Unix.Catalog.GetString("_Quit"); + w2.Add(this.QuitAction, null); + this.HelpAction1 = new Gtk.Action("HelpAction1", Mono.Unix.Catalog.GetString("_Help"), null, "gtk-help"); + this.HelpAction1.Sensitive = false; + this.HelpAction1.ShortLabel = Mono.Unix.Catalog.GetString("_Help"); + w2.Add(this.HelpAction1, null); + this.AboutAction = new Gtk.Action("AboutAction", Mono.Unix.Catalog.GetString("_About"), null, "gtk-about"); + this.AboutAction.Sensitive = false; + this.AboutAction.ShortLabel = Mono.Unix.Catalog.GetString("_About"); + w2.Add(this.AboutAction, null); + this.UndoAction = new Gtk.Action("UndoAction", Mono.Unix.Catalog.GetString("_Undo"), null, "gtk-undo"); + this.UndoAction.Sensitive = false; + this.UndoAction.ShortLabel = Mono.Unix.Catalog.GetString("_Undo"); + w2.Add(this.UndoAction, null); + this.RedoAction = new Gtk.Action("RedoAction", Mono.Unix.Catalog.GetString("_Redo"), null, "gtk-redo"); + this.RedoAction.Sensitive = false; + this.RedoAction.ShortLabel = Mono.Unix.Catalog.GetString("_Redo"); + w2.Add(this.RedoAction, null); + this.BestFitAction = new Gtk.Action("BestFitAction", Mono.Unix.Catalog.GetString("Best _Fit"), null, "gtk-zoom-fit"); + this.BestFitAction.Sensitive = false; + this.BestFitAction.ShortLabel = Mono.Unix.Catalog.GetString("Best _Fit"); + w2.Add(this.BestFitAction, null); + this.NormalSizeAction = new Gtk.Action("NormalSizeAction", Mono.Unix.Catalog.GetString("_Normal Size"), null, "gtk-zoom-100"); + this.NormalSizeAction.Sensitive = false; + this.NormalSizeAction.ShortLabel = Mono.Unix.Catalog.GetString("_Normal Size"); + w2.Add(this.NormalSizeAction, null); + this.ZoomOutAction = new Gtk.Action("ZoomOutAction", Mono.Unix.Catalog.GetString("Zoom _Out"), null, "gtk-zoom-out"); + this.ZoomOutAction.Sensitive = false; + this.ZoomOutAction.ShortLabel = Mono.Unix.Catalog.GetString("Zoom _Out"); + w2.Add(this.ZoomOutAction, null); + this.ZoomInAction = new Gtk.Action("ZoomInAction", Mono.Unix.Catalog.GetString("Zoom _In"), null, "gtk-zoom-in"); + this.ZoomInAction.Sensitive = false; + this.ZoomInAction.ShortLabel = Mono.Unix.Catalog.GetString("Zoom _In"); + w2.Add(this.ZoomInAction, null); + this.undoAction = new Gtk.Action("undoAction", null, null, "gtk-undo"); + this.undoAction.Sensitive = false; + w2.Add(this.undoAction, null); + this.redoAction = new Gtk.Action("redoAction", null, null, "gtk-redo"); + this.redoAction.Sensitive = false; + w2.Add(this.redoAction, null); + this.zoom100Action = new Gtk.Action("zoom100Action", null, null, "gtk-zoom-100"); + this.zoom100Action.Sensitive = false; + w2.Add(this.zoom100Action, null); + this.zoomFitAction = new Gtk.Action("zoomFitAction", null, null, "gtk-zoom-fit"); + this.zoomFitAction.Sensitive = false; + w2.Add(this.zoomFitAction, null); + this.zoomOutAction = new Gtk.Action("zoomOutAction", null, null, "gtk-zoom-out"); + this.zoomOutAction.Sensitive = false; + w2.Add(this.zoomOutAction, null); + this.zoomInAction = new Gtk.Action("zoomInAction", null, null, "gtk-zoom-in"); + this.zoomInAction.Sensitive = false; + w2.Add(this.zoomInAction, null); + this.helpAction = new Gtk.Action("helpAction", null, null, "gtk-help"); + this.helpAction.Sensitive = false; + w2.Add(this.helpAction, null); + w1.InsertActionGroup(w2, 0); + this.AddAccelGroup(w1.AccelGroup); + this.Name = "MainWindow"; + this.Title = Mono.Unix.Catalog.GetString("The Pimp"); + this.Icon = Stetic.IconLoader.LoadIcon(this, "stock_insert_image", Gtk.IconSize.Menu, 16); + this.WindowPosition = ((Gtk.WindowPosition)(4)); + // Container child MainWindow.Gtk.Container+ContainerChild + this.vbox1 = new Gtk.VBox(); + this.vbox1.Name = "vbox1"; + // Container child vbox1.Gtk.Box+BoxChild + w1.AddUiFromString(""); + this.menubar1 = ((Gtk.MenuBar)(w1.GetWidget("/menubar1"))); + this.menubar1.Name = "menubar1"; + this.vbox1.Add(this.menubar1); + Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar1])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + w1.AddUiFromString(""); + this.toolbar1 = ((Gtk.Toolbar)(w1.GetWidget("/toolbar1"))); + this.toolbar1.Name = "toolbar1"; + this.toolbar1.ShowArrow = false; + this.toolbar1.ToolbarStyle = ((Gtk.ToolbarStyle)(0)); + this.vbox1.Add(this.toolbar1); + Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox1[this.toolbar1])); + w4.Position = 1; + w4.Expand = false; + w4.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.hpaned1 = new Gtk.HPaned(); + this.hpaned1.CanFocus = true; + this.hpaned1.Name = "hpaned1"; + this.hpaned1.Position = 408; + // Container child hpaned1.Gtk.Paned+PanedChild + this.notebook1 = new Gtk.Notebook(); + this.notebook1.CanFocus = true; + this.notebook1.Name = "notebook1"; + this.notebook1.CurrentPage = 0; + this.notebook1.BorderWidth = ((uint)(5)); + // Container child notebook1.Gtk.Notebook+NotebookChild + this.scrolledwindow1 = new Gtk.ScrolledWindow(); + this.scrolledwindow1.WidthRequest = 640; + this.scrolledwindow1.HeightRequest = 480; + 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(); + this.label1.Name = "label1"; + this.label1.LabelProp = Mono.Unix.Catalog.GetString("Test tab"); + 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; + // Container child hpaned1.Gtk.Paned+PanedChild + this.vpaned1 = new Gtk.VPaned(); + this.vpaned1.CanFocus = true; + this.vpaned1.Name = "vpaned1"; + this.vpaned1.Position = 60; + // Container child vpaned1.Gtk.Paned+PanedChild + this.vbox2 = new Gtk.VBox(); + this.vbox2.Name = "vbox2"; + this.vbox2.BorderWidth = ((uint)(5)); + this.vpaned1.Add(this.vbox2); + Gtk.Paned.PanedChild w10 = ((Gtk.Paned.PanedChild)(this.vpaned1[this.vbox2])); + w10.Resize = false; + // Container child vpaned1.Gtk.Paned+PanedChild + this.vbox3 = new Gtk.VBox(); + this.vbox3.Name = "vbox3"; + this.vbox3.BorderWidth = ((uint)(5)); + 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; + // 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; + this.Add(this.vbox1); + if ((this.Child != null)) { + this.Child.ShowAll(); + } + this.DefaultWidth = 840; + this.DefaultHeight = 680; + this.Show(); + this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); + this.openAction.Activated += new System.EventHandler(this.OnOpenActionActivated); + this.OpenAction.Activated += new System.EventHandler(this.OnOpenActionActivated); + this.QuitAction.Activated += new System.EventHandler(this.OnQuitActionActivated); + } +} diff --git a/pimp/Pimp/gtk-gui/Pimp.OpenFile.cs b/pimp/Pimp/gtk-gui/Pimp.OpenFile.cs new file mode 100644 index 0000000..a808445 --- /dev/null +++ b/pimp/Pimp/gtk-gui/Pimp.OpenFile.cs @@ -0,0 +1,81 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +namespace Pimp { + + + public partial class OpenFile { + + private Gtk.FileChooserWidget filechooserwidget1; + + private Gtk.Button buttonCancel; + + private Gtk.Button buttonOk; + + protected virtual void Build() { + Stetic.Gui.Initialize(this); + // Widget Pimp.OpenFile + this.Name = "Pimp.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 + Gtk.VBox w1 = this.VBox; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); + // Container child dialog1_VBox.Gtk.Box+BoxChild + this.filechooserwidget1 = new Gtk.FileChooserWidget(((Gtk.FileChooserAction)(0))); + this.filechooserwidget1.Name = "filechooserwidget1"; + w1.Add(this.filechooserwidget1); + Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(w1[this.filechooserwidget1])); + w2.Position = 0; + // Internal child Pimp.OpenFile.ActionArea + Gtk.HButtonBox w3 = this.ActionArea; + w3.Name = "dialog1_ActionArea"; + w3.Spacing = 6; + w3.BorderWidth = ((uint)(5)); + w3.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonCancel = new Gtk.Button(); + this.buttonCancel.CanDefault = true; + this.buttonCancel.CanFocus = true; + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.UseStock = true; + this.buttonCancel.UseUnderline = true; + this.buttonCancel.Label = "gtk-cancel"; + this.AddActionWidget(this.buttonCancel, -6); + Gtk.ButtonBox.ButtonBoxChild w4 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonCancel])); + w4.Expand = false; + w4.Fill = false; + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonOk = new Gtk.Button(); + this.buttonOk.CanDefault = true; + this.buttonOk.CanFocus = true; + this.buttonOk.Name = "buttonOk"; + this.buttonOk.UseStock = true; + this.buttonOk.UseUnderline = true; + this.buttonOk.Label = "gtk-ok"; + this.AddActionWidget(this.buttonOk, -5); + Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonOk])); + w5.Position = 1; + w5.Expand = false; + w5.Fill = false; + if ((this.Child != null)) { + this.Child.ShowAll(); + } + this.DefaultWidth = 627; + this.DefaultHeight = 448; + this.Show(); + } + } +} diff --git a/pimp/Pimp/gtk-gui/generated.cs b/pimp/Pimp/gtk-gui/generated.cs new file mode 100644 index 0000000..dd18ad7 --- /dev/null +++ b/pimp/Pimp/gtk-gui/generated.cs @@ -0,0 +1,68 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +namespace Stetic { + + + internal class Gui { + + private static bool initialized; + + internal static void Initialize(Gtk.Widget iconRenderer) { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class IconLoader { + + public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) { + Gdk.Pixbuf res = widget.RenderIcon(name, size, null); + if ((res != null)) { + return res; + } + else { + try { + return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); + } + catch (System.Exception ) { + if ((name != "gtk-missing-image")) { + return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz); + } + else { + Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz); + Gdk.GC gc = new Gdk.GC(pmap); + gc.RgbFgColor = new Gdk.Color(255, 255, 255); + pmap.DrawRectangle(gc, true, 0, 0, sz, sz); + gc.RgbFgColor = new Gdk.Color(0, 0, 0); + pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1)); + gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + gc.RgbFgColor = new Gdk.Color(255, 0, 0); + pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); + pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); + return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + } + } + } + } + } + + internal class ActionGroups { + + public static Gtk.ActionGroup GetActionGroup(System.Type type) { + return Stetic.ActionGroups.GetActionGroup(type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup(string name) { + return null; + } + } +} diff --git a/pimp/Pimp/gtk-gui/gui.stetic b/pimp/Pimp/gtk-gui/gui.stetic new file mode 100644 index 0000000..e85c9b1 --- /dev/null +++ b/pimp/Pimp/gtk-gui/gui.stetic @@ -0,0 +1,435 @@ + + + + .. + 2.12.1 + + + + + Action + + False + gtk-new + + + Action + + gtk-open + + + + Action + + False + gtk-save + + + Action + + + + Action + File + File + + + Action + Edit + Edit + + + Action + View + View + + + Action + Help + Help + + + Action + _New + False + _New + gtk-new + + + Action + _Open + _Open + gtk-open + + + + Action + _Save + False + _Save + gtk-save + + + Action + Save _As + False + Save _As + gtk-save-as + + + Action + _Quit + _Quit + gtk-quit + + + + Action + _Help + False + _Help + gtk-help + + + Action + _About + False + _About + gtk-about + + + Action + _Undo + False + _Undo + gtk-undo + + + Action + _Redo + False + _Redo + gtk-redo + + + Action + Best _Fit + False + Best _Fit + gtk-zoom-fit + + + Action + _Normal Size + False + _Normal Size + gtk-zoom-100 + + + Action + Zoom _Out + False + Zoom _Out + gtk-zoom-out + + + Action + Zoom _In + False + Zoom _In + gtk-zoom-in + + + Action + + False + gtk-undo + + + Action + + False + gtk-redo + + + Action + + False + gtk-zoom-100 + + + Action + + False + gtk-zoom-fit + + + Action + + False + gtk-zoom-out + + + Action + + False + gtk-zoom-in + + + Action + + False + gtk-help + + + + The Pimp + stock:stock_insert_image Menu + CenterOnParent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + True + False + False + + + + + + False + Icons + + + + + + + + + + + + + + + + + + 1 + True + False + False + + + + + + True + 408 + + + + True + 0 + 5 + + + + 640 + 480 + True + In + + + + None + + + + + + + + + + + + + Test tab + + + tab + + + + + False + + + + + + True + 60 + + + + 5 + + + + + + + + + + + + False + + + + + + 5 + + + + + + + + + + + + + + + + 2 + True + + + + + + 6 + + + + + + + + + 3 + True + False + False + + + + + + + + Open File + stock:gtk-open Menu + Dialog + CenterOnParent + True + 2 + False + False + + + + 2 + + + + + + 0 + True + + + + + + + + 6 + 5 + 2 + End + + + + True + True + True + StockItem + gtk-cancel + -6 + gtk-cancel + + + False + False + + + + + + True + True + True + StockItem + gtk-ok + -5 + gtk-ok + + + 1 + False + False + + + + + + \ No newline at end of file diff --git a/pimp/Pimp/pimp.in b/pimp/Pimp/pimp.in new file mode 100644 index 0000000..1e0cf2e --- /dev/null +++ b/pimp/Pimp/pimp.in @@ -0,0 +1,3 @@ +#!/bin/sh + +exec mono "@expanded_libdir@/@PACKAGE@/Pimp.exe" "$@" diff --git a/pimp/Pipi/AssemblyInfo.cs b/pimp/Pipi/AssemblyInfo.cs new file mode 100644 index 0000000..0a05afe --- /dev/null +++ b/pimp/Pipi/AssemblyInfo.cs @@ -0,0 +1,30 @@ +// AssemblyInfo.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.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("Pipi")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// If the build and revision are set to '*' they will be updated automatically. + +[assembly: AssemblyVersion("1.0.*.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/pimp/Pipi/Pipi.cs b/pimp/Pipi/Pipi.cs new file mode 100644 index 0000000..6127c43 --- /dev/null +++ b/pimp/Pipi/Pipi.cs @@ -0,0 +1,23 @@ +// 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 static class Libpipi + { + [DllImport("libpipi.dll", CallingConvention=CallingConvention.Cdecl), + SuppressUnmanagedCodeSecurity] + private static extern IntPtr pipi_get_version(); + public static string getVersion() + { + return Marshal.PtrToStringAnsi(pipi_get_version()); + } + } +} diff --git a/pimp/Pipi/Pipi.mdp b/pimp/Pipi/Pipi.mdp new file mode 100644 index 0000000..5c9d723 --- /dev/null +++ b/pimp/Pipi/Pipi.mdp @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pimp/Pipi/pipi-sharp.dll.config b/pimp/Pipi/pipi-sharp.dll.config new file mode 100644 index 0000000..c4ad2a0 --- /dev/null +++ b/pimp/Pipi/pipi-sharp.dll.config @@ -0,0 +1,3 @@ + + + diff --git a/pimp/Pipi/pipi.pc.in b/pimp/Pipi/pipi.pc.in new file mode 100644 index 0000000..ff88ab7 --- /dev/null +++ b/pimp/Pipi/pipi.pc.in @@ -0,0 +1,6 @@ +Name: Pipi +Description: Pipi +Version: 0.1 + +Requires: +Libs: -r:@expanded_libdir@/@PACKAGE@/pipi-sharp.dll diff --git a/pimp/config.log b/pimp/config.log new file mode 100644 index 0000000..ba0328c --- /dev/null +++ b/pimp/config.log @@ -0,0 +1,4 @@ +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. diff --git a/pimp/config.make b/pimp/config.make new file mode 100644 index 0000000..b328722 --- /dev/null +++ b/pimp/config.make @@ -0,0 +1,9 @@ +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 diff --git a/pimp/configure b/pimp/configure new file mode 100755 index 0000000..829ba11 --- /dev/null +++ b/pimp/configure @@ -0,0 +1,159 @@ +#!/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 diff --git a/pimp/rules.make b/pimp/rules.make new file mode 100644 index 0000000..5f906b2 --- /dev/null +++ b/pimp/rules.make @@ -0,0 +1,40 @@ +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: ; @: