--- graphmonkey-1.7.orig/MyWindow.cs +++ graphmonkey-1.7/MyWindow.cs @@ -0,0 +1,357 @@ +/* +* 21/08/2004 - 19:29 +* +* GraphMonkey - mono based graphing calculator +* Copyright (C) 2004 Bellabes Lounis +* nolius@users.sourceforge.net +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +using System; +using Gtk; +using Pango; + + +public class MyWindow : Window { + public Entry entry_eq1; + public Entry entry_eq2; + public Entry entry_eq3; + + public Entry entry_x_value; + public Entry entry_result; + + public Entry entry_xmin; + public Entry entry_xmax; + public Entry entry_ymin; + public Entry entry_ymax; + public Entry entry_graduation; + + + public float x_min; + public float x_max; + public float y_min; + public float y_max; + public float graduation; + + public Label label_info; + + + + + public MyWindow () : base ("GraphMonkey") + { + this.SetDefaultSize (400, 300); + this.DeleteEvent += new DeleteEventHandler (OnMyWindowDelete); + this.Resizable = false; + //this.ShowAll (); + + + + + // on dispose les éléments de la calculatrice + // on crée une table de 6 sur 10 + Table tableLayout = new Table(6, 10, false); + /* + Label label_titre = new Label("equations :"); + //label_titre.Justify = Gtk.Justification.Left; + tableLayout.Attach(label_titre, 0, 6, 0, 1); + */ + + + + //equation 1 + Label label_y1 = new Label("Equation 1 : y ="); + tableLayout.Attach(label_y1, 0, 1, 0, 1); + + entry_eq1 = new Entry (""); + tableLayout.Attach(entry_eq1, 1, 2, 0, 1); + + //equation 2 + Label label_y2 = new Label("Equation 2 : y ="); + tableLayout.Attach(label_y2, 0, 1, 1, 2); + + entry_eq2 = new Entry (""); + tableLayout.Attach(entry_eq2, 1, 2, 1, 2); + + //equation 3 + Label label_y3 = new Label("Equation 3 : y ="); + tableLayout.Attach(label_y3, 0, 1, 2, 3); + + entry_eq3 = new Entry (""); + tableLayout.Attach(entry_eq3, 1, 2, 2, 3); + + Button button_trace = new Button (" Trace ! "); + button_trace.Clicked += new EventHandler (button_trace_click); + tableLayout.Attach(button_trace, 3, 4, 0, 3); + + //------------------------------------------------ + + // f(x) + Label label_x_value = new Label(" x value for Eq. 1 : "); + tableLayout.Attach(label_x_value, 0, 1, 3, 4); + + entry_x_value = new Entry (""); + tableLayout.Attach(entry_x_value, 1, 2, 3, 4); + + //Label label_egal = new Label("="); + //tableLayout.Attach(label_egal, 3, 4, 1, 2); + + Button button_result = new Button (" f(x) = "); + button_result.Clicked += new EventHandler (button_result_click); + tableLayout.Attach(button_result, 2, 3, 3, 4); + + entry_result = new Entry (""); + entry_result.IsEditable = false; + tableLayout.Attach(entry_result, 3, 4, 3, 4); + + //------------------------------------------------ + + // range + Label label_range = new Label(""); + tableLayout.Attach(label_range, 0, 1, 4, 5); + + //xmin + Label label_xmin = new Label("Xmin ="); + tableLayout.Attach(label_xmin, 0, 1, 5, 6); + + entry_xmin = new Entry ("-10"); + tableLayout.Attach(entry_xmin, 1, 2, 5, 6); + + //xmax + Label label_xmax = new Label("Xmax ="); + tableLayout.Attach(label_xmax, 0, 1, 6, 7); + + entry_xmax = new Entry ("10"); + tableLayout.Attach(entry_xmax, 1, 2, 6, 7); + + //ymin + Label label_ymin = new Label("Ymin ="); + tableLayout.Attach(label_ymin, 0, 1, 7, 8); + + entry_ymin = new Entry ("-10"); + tableLayout.Attach(entry_ymin, 1, 2, 7, 8); + + //ymax + Label label_ymax = new Label("Ymax ="); + tableLayout.Attach(label_ymax, 0, 1, 8, 9); + + entry_ymax = new Entry ("10"); + tableLayout.Attach(entry_ymax, 1, 2, 8, 9); + + //graduation + Label label_graduation = new Label("Scale ="); + tableLayout.Attach(label_graduation, 0, 1, 9, 10); + + entry_graduation = new Entry ("1"); + tableLayout.Attach(entry_graduation, 1, 2, 9, 10); + + //initialize range + Button button_initialize_range = new Button ("Initialize Range"); + button_initialize_range.Clicked += new EventHandler (button_initialize_range_click); + tableLayout.Attach(button_initialize_range, 3, 4, 8, 9); + + //initialize + Button button_initialize_all = new Button ("Initialize All"); + button_initialize_all.Clicked += new EventHandler (button_initialize_all_click); + tableLayout.Attach(button_initialize_all, 3, 4, 7, 8); + + //help + Button button_about = new Button ("help"); + button_about.Clicked += new EventHandler (button_about_click); + tableLayout.Attach(button_about, 3, 4, 9, 10); + + // info + label_info = new Label("Ready!"); + tableLayout.Attach(label_info, 3, 4, 5, 6); + + + + + + + + tableLayout.ShowAll(); + this.Add (tableLayout); + + this.ShowAll (); + + + // initialisation du range + x_min = -10f; + x_max = 10f; + y_min = -10f; + y_max = 10f; + graduation = 1f; + + + + //Ecran_Form ecran = new Ecran_Form(" ", x_min, x_max, y_min, y_max, graduation); + + + + //ecran.equation = "test"; + //f.Show(); + /* + Pango.Layout layout; + layout = new Pango.Layout (this.PangoContext); + layout.Wrap = Pango.WrapMode.Word; + layout.FontDescription = FontDescription.FromString ("Tahoma 16"); + layout.SetMarkup ("test"); + this.GdkWindow.DrawLayout (this.Style.TextGC (StateType.Normal), 100, 150, layout); + this.GdkWindow.DrawLine (this.Style.TextGC (StateType.Normal), 0, 0, 100, 100); + //f.GdkWindow.DrawLayout (this.Style.TextGC (StateType.Normal), 100, 150, layout); + */ + //f.GdkWindow.DrawLine (this.Style.TextGC (StateType.Normal), 0, 0, 500, 500); + + } + + void button_result_click (object o, EventArgs args) + { + try{ + string equation = this.entry_eq1.Text; + string string_x = entry_x_value.Text; + //string_x = string_x.Replace(".", "."); + + float x; + + if (equation != ""){ + if (string_x != ""){ + decimal decimal_x = Convert.ToDecimal(string_x); + x = (float) decimal_x; + } + else{ + x = 0f; + } + + + operation op =new operation(equation); + + op.corrige(); + //op.decouper(); + float res =op.calculer(x); + this.entry_result.Text=Convert.ToString(res); + + double res_verif = (double) res; + if(Double.IsNaN(res_verif)){ + this.entry_result.Text = "NaN"; + label_info.Text = "Error!"; + } + else{ + label_info.Text = "Ready!"; + } + + } + } + catch(Exception ex) + { + label_info.Text = "Error!"; + this.entry_result.Text = ""; + + } + + + } + + void button_trace_click (object o, EventArgs args) + { + try{ + if( ( this.entry_eq1.Text != "" || this.entry_eq2.Text != "" || this.entry_eq3.Text != "") && entry_xmin.Text != "" && entry_xmax.Text != "" && entry_ymin.Text != "" && entry_ymax.Text != "" && entry_graduation.Text != "" ){ + + + decimal decimal_xmin = Convert.ToDecimal(entry_xmin.Text.Replace(".", ".")); + x_min = (float) decimal_xmin; + decimal decimal_xmax = Convert.ToDecimal(entry_xmax.Text.Replace(".", ".")); + x_max = (float) decimal_xmax; + decimal decimal_ymin = Convert.ToDecimal(entry_ymin.Text.Replace(".", ".")); + y_min = (float) decimal_ymin; + decimal decimal_ymax = Convert.ToDecimal(entry_ymax.Text.Replace(".", ".")); + y_max = (float) decimal_ymax; + decimal decimal_graduation = Convert.ToDecimal(entry_graduation.Text.Replace(".", ".")); + graduation = (float) decimal_graduation; + + if( x_min < x_max && y_min < y_max && graduation >0){ + + Ecran_Form ecran = new Ecran_Form(entry_eq1.Text, entry_eq2.Text, entry_eq3.Text, x_min, x_max, y_min, y_max, graduation); + label_info.Text = "Ready!"; + } + else{ + label_info.Text = "Range error!"; + } + + } + else{ + if(this.entry_eq1.Text == "" && this.entry_eq2.Text == "" && this.entry_eq3.Text == ""){ + label_info.Text = "No equation!"; + } + else{ + label_info.Text = "Range error!"; + } + } + + } + catch(Exception ex) + { + label_info.Text = "Range error!"; + } + + + } + + + void button_initialize_range_click (object o, EventArgs args) + { + entry_xmin.Text = "-10"; + entry_xmax.Text = "10"; + entry_ymin.Text = "-10"; + entry_ymax.Text = "10"; + entry_graduation.Text = "1"; + + + } + + + void button_initialize_all_click (object o, EventArgs args) + { + entry_eq1.Text = ""; + entry_eq2.Text = ""; + entry_eq3.Text = ""; + + entry_x_value.Text = ""; + entry_result.Text = ""; + + + entry_xmin.Text = "-10"; + entry_xmax.Text = "10"; + entry_ymin.Text = "-10"; + entry_ymax.Text = "10"; + entry_graduation.Text = "1"; + + + + } + + void button_about_click (object o, EventArgs args) + { + About_Form about = new About_Form(); + about.Show(); + + } + + void OnMyWindowDelete (object o, DeleteEventArgs args) + { + Application.Quit (); + } +} --- graphmonkey-1.7.orig/description-pak +++ graphmonkey-1.7/description-pak @@ -0,0 +1,2 @@ +graphmonkey +EOF --- graphmonkey-1.7.orig/debian/manpages +++ graphmonkey-1.7/debian/manpages @@ -0,0 +1 @@ +debian/graphmonkey.1 --- graphmonkey-1.7.orig/debian/copyright +++ graphmonkey-1.7/debian/copyright @@ -0,0 +1,27 @@ +This package was debianized by Benjamin Seidenberg on +Mon, 4 Jul 2005 17:01:40 -0400. + +It was downloaded from http://sourceforge.net/projects/graphmonkey/ + +Copyright (C) 2004 Bellabes Lounis + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301,USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- graphmonkey-1.7.orig/debian/rules +++ graphmonkey-1.7/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export MONO_SHARED_DIR=$(CURDIR) +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + rm -rf $((CURDIR)/.wapi/ + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/graphmonkey. + $(MAKE) install DESTDIR=$(CURDIR)/debian/graphmonkey + chmod 755 $(CURDIR)/debian/graphmonkey/usr/share/graphmonkey/GraphMonkey.exe + #Install linda override + mkdir -p $(CURDIR)/debian/graphmonkey/usr/share/linda/overrides + cp $(CURDIR)/debian/linda.override \ + $(CURDIR)/debian/graphmonkey/usr/share/linda/overrides/graphmonkey + +#Do nothing (Arch: All) +binary-arch: + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman + dh_installmenu + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeclilibs + dh_installdeb + dh_shlibdeps + dh_clideps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep +.PHONY: build clean binary-indep binary-arch binary install configure --- graphmonkey-1.7.orig/debian/linda.override +++ graphmonkey-1.7/debian/linda.override @@ -0,0 +1,2 @@ +Tag: exec-not-elf-or-script +Data: .*exe --- graphmonkey-1.7.orig/debian/compat +++ graphmonkey-1.7/debian/compat @@ -0,0 +1 @@ +4 --- graphmonkey-1.7.orig/debian/dirs +++ graphmonkey-1.7/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/ --- graphmonkey-1.7.orig/debian/control +++ graphmonkey-1.7/debian/control @@ -0,0 +1,18 @@ +Source: graphmonkey +Section: math +Priority: optional +Maintainer: Benjamin Seidenberg +Build-Depends: debhelper (>= 4.0.0) +Build-Depends-Indep: cli-common-dev, mono-mcs, libglade2.0-cil, libgtk2.0-cil, pkg-config +Standards-Version: 3.7.3 +Homepage: http://graphmonkey.sourceforge.net/ + +Package: graphmonkey +Architecture: all +Depends: ${misc:Depends}, ${cli:Depends} +Description: a GTK#-based graphing calculator + GraphMonkey is a GTK#-based graphic calculator. It uses a simple interface to + draw curves. + . + Homepage: http://graphmonkey.sourceforge.net/ + --- graphmonkey-1.7.orig/debian/README.Debian +++ graphmonkey-1.7/debian/README.Debian @@ -0,0 +1,6 @@ +graphmonkey for Debian +---------------------- + +The install directories have been changed from the upstream version. + + -- Benjamin Seidenberg , Mon, 4 Jul 2005 17:01:40 -0400 --- graphmonkey-1.7.orig/debian/docs +++ graphmonkey-1.7/debian/docs @@ -0,0 +1 @@ +HELP --- graphmonkey-1.7.orig/debian/changelog +++ graphmonkey-1.7/debian/changelog @@ -0,0 +1,92 @@ +graphmonkey (1.7-1) unstable; urgency=low + + * New upstream release + * debian/control: + - Bump Debian standards version + - Add Homepage field + + -- David Futcher Mon, 25 Feb 2008 20:11:39 +0000 + +graphmonkey (1.6-1) unstable; urgency=low + + * New upstream release + * New maintainer address + + -- Benjamin Seidenberg Wed, 18 Oct 2006 22:21:27 -0400 + +graphmonkey (1.5-6) unstable; urgency=low + + * Change build depend from cli-common to cli-common-dev due to package + rename. (Thanks to Andreas Jochens , Closes: #392121) + + -- Benjamin Seidenberg Tue, 10 Oct 2006 23:49:29 -0400 + +graphmonkey (1.5-5) unstable; urgency=low + + * Use gtk#2 instead of gtk#1 (Thanks to Sebastian Dröge ) + * Bump Standards-Version to 3.7.2 (No changes needed) + * Add binary-arch target (does nothing) to debian/rules to comply with + policy + * Debhelper should be a Build-Depends not Build-Depends-Indep to comply w/ + policy. + + -- Benjamin Seidenberg Wed, 31 May 2006 23:28:53 -0400 + +graphmonkey (1.5-4) unstable; urgency=low + + * Actually install menu entry (added dh_installmenu) + + -- Benjamin Seidenberg Tue, 18 Apr 2006 14:18:52 -0400 + +graphmonkey (1.5-3) unstable; urgency=low + + * Change from Arch: any to Arch: all since we have no native code (Closes: + #356903) + * Make package description more concise + * Add linda override for GraphMonkey.exe being 755. + * Remove ${shlibs:Depends} since we don't have any ELF output + * Updated README.Debian + + -- Benjamin Seidenberg Sun, 19 Mar 2006 15:52:19 -0500 + +graphmonkey (1.5-2) unstable; urgency=low + + * Fix critical problem, somehow /usr/bin/graphmonkey got reverted to + upstream's copy, breaking execution via path environment. + Put patched copy back. + * Fixed Homepage: field in debian/control + + -- Benjamin Seidenberg Fri, 24 Feb 2006 16:34:52 -0500 + +graphmonkey (1.5-1) unstable; urgency=low + + * New Upstream release + * Much saner .orig.tar.gz, redid some packaging to match + + -- Benjamin Seidenberg Sat, 18 Feb 2006 22:05:45 -0500 + +graphmonkey (1.3-3) unstable; urgency=low + + * Fixed several things for CLI Policy compliance + * debian/control: Fixed Build-Deps, used dh_clideps + * debian/rules: Added dh_clideps magic, fixed perms on .exe + + -- Benjamin Seidenberg Mon, 26 Sep 2005 16:23:24 -0400 + +graphmonkey (1.3-2) unstable; urgency=low + + * Added MONO_SHARED_DIR to debian/rules to prevent file creation out of tree + Closes: #324394 + * Fixed debian/copyright by adding date + * New email address + + -- Benjamin Seidenberg Sun, 21 Aug 2005 20:34:27 -0400 + +graphmonkey (1.3-1) unstable; urgency=low + + * Initial release Closes: #311951 + * Adjusted makefile and launch script to move program out of /usr/local + * Changed permissions of win32 binary to meet debian policy + + -- Benjamin Seidenberg Mon, 4 Jul 2005 17:01:40 -0400 + --- graphmonkey-1.7.orig/debian/graphmonkey.1 +++ graphmonkey-1.7/debian/graphmonkey.1 @@ -0,0 +1,75 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH GRAPHMONKEY 1 "July 4, 2005" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +graphmonkey \- Mono based graph drawing application +.SH SYNOPSIS +.B graphmonkey +.br +.SH DESCRIPTION +This manual page documents briefly the +.B graphmonkey +command. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBgraphmonkey\fP is a Mono based graph drawing application. +.br + +The following symbols are available: +.br + + , -, *, / +.br + square roots : sqrt() +.br + powers square : ^ +.br + brackets +.br + sine : sin() +.br + cosine : cos() +.br + tangent : tan() +.br + arcsine : asin() +.br + arccosine : acos() +.br + arctangent : atan() +.br + hyperbolic sine : sinh() +.br + hyperbolic cosine : cosh() +.br + hyperbolic tangent : tan() +.br + logarithm : log() +.br + exponential : exp() +.sp 2 +It is also possible to modify the range. + + + +.SH AUTHOR +graphmonkey was written by Bellabes Lounis . +.PP +.ad l +This manual page was written by Benjamin Seidenberg , +for the Debian project (but may be used by others). --- graphmonkey-1.7.orig/debian/menu +++ graphmonkey-1.7/debian/menu @@ -0,0 +1,2 @@ +?package(graphmonkey):needs="X11" section="Apps/Math"\ + title="graphmonkey" command="/usr/bin/graphmonkey" --- graphmonkey-1.7.orig/Makefile +++ graphmonkey-1.7/Makefile @@ -10,6 +10,6 @@ rm -rf $(EXEC) install: - mkdir -p $(SHARE)/graphmonkey - cp -f $(EXEC) $(SHARE)/graphmonkey - cp -f graphmonkey $(BIN) + mkdir $(DESTDIR)/usr/share/graphmonkey + cp $(EXEC) $(DESTDIR)/usr/share/graphmonkey/ + cp graphmonkey $(DESTDIR)/usr/bin --- graphmonkey-1.7.orig/graphmonkey +++ graphmonkey-1.7/graphmonkey @@ -1,2 +1,2 @@ #!/bin/sh -mono /usr/local/share/graphmonkey/GraphMonkey.exe +mono /usr/share/graphmonkey/GraphMonkey.exe