diff --git a/processing/app/KjcEngine.java b/processing/app/KjcEngine.java index e51c781b1..b3609fec6 100644 --- a/processing/app/KjcEngine.java +++ b/processing/app/KjcEngine.java @@ -133,22 +133,24 @@ public class KjcEngine extends PdeEngine { (3.) (.3 * 6) (.30*7) + float f = 0.3; + fill(0.3, 0.2, 0.1); - next to white space \s or math ops +-/*() + next to white space \s or math ops +-/*() + or , on either side, + followed by ; (might as well on either side) - */ - program = substipoot(program, "([\\s\\+\\-\\/\\*\\(\\)])(\\d+\\.\\d*)([\\s\\+\\-\\/\\*\\(\\)])", "$1$2f$3"); - program = substipoot(program, "([\\s\\+\\-\\/\\*\\(\\)])(\\d*\\.\\d+)([\\s\\+\\-\\/\\*\\(\\)])", "$1$2f$3"); + // allow 3. to work (also allows x.x too) + program = substipoot(program, "(\\d+\\.\\d*)(\\D)", "$1f$2"); + program = substipoot(program, "(\\d+\\.\\d*)ff", "$1f"); - /* - // allow 3. to work (also allows x.x too) - program = substipoot(program, "(\\d+\\.\\d*)(\\D)", "$1f$2"); - program = substipoot(program, "(\\d+\\.\\d*)ff", "$1f"); - - // allow .3 to work (also allows x.x) - program = substipoot(program, "(\\d*\\.\\d+)(\\D)", "$1f$2"); - program = substipoot(program, "(\\d*\\.\\d+)ff", "$1f"); + // allow .3 to work (also allows x.x) + program = substipoot(program, "(\\d*\\.\\d+)(\\D)", "$1f$2"); + program = substipoot(program, "(\\d*\\.\\d+)ff", "$1f"); */ + + program = substipoot(program, "([\\s\\,\\;\\+\\-\\/\\*\\(\\)])(\\d+\\.\\d*)([\\s\\,\\;\\+\\-\\/\\*\\(\\)])", "$1$2f$3"); + program = substipoot(program, "([\\s\\,\\;\\+\\-\\/\\*\\(\\)])(\\d*\\.\\d+)([\\s\\,\\;\\+\\-\\/\\*\\(\\)])", "$1$2f$3"); } // allow int(3.75) instead of just (int)3.75 diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index cc066f5f0..6ee76f7c5 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -339,6 +339,8 @@ public class PdeEditor extends Panel { public void doRun(boolean presentation) { + //System.out.println(System.getProperty("java.class.path")); + //doStop(); doClose(); running = true; diff --git a/processing/app/PdeEditorConsole.java b/processing/app/PdeEditorConsole.java index d69019fa3..e085afe79 100644 --- a/processing/app/PdeEditorConsole.java +++ b/processing/app/PdeEditorConsole.java @@ -55,6 +55,9 @@ public class PdeEditorConsole extends Component { static PrintStream consoleOut; static PrintStream consoleErr; + static OutputStream stdoutFile; + static OutputStream stderrFile; + public PdeEditorConsole(PdeEditor editor) { this.editor = editor; @@ -65,8 +68,30 @@ public class PdeEditorConsole extends Component { systemOut = System.out; systemErr = System.err; - consoleOut = new PrintStream(new PdeEditorConsoleStream(this, false)); - consoleErr = new PrintStream(new PdeEditorConsoleStream(this, true)); + if (PdeBase.getBoolean("editor.console.out.enabled", false)) { + String outFileName = + PdeBase.get("editor.console.out.file", "lib/stdout.txt"); + try { + stdoutFile = new FileOutputStream(outFileName); + } catch (IOException e) { + e.printStackTrace(); + } + } + + if (PdeBase.getBoolean("editor.console.err.enabled", false)) { + String errFileName = + PdeBase.get("editor.console.err.file", "lib/stderr.txt"); + try { + stderrFile = new FileOutputStream(errFileName); + } catch (IOException e) { + e.printStackTrace(); + } + } + + consoleOut = + new PrintStream(new PdeEditorConsoleStream(this, false, stdoutFile)); + consoleErr = + new PrintStream(new PdeEditorConsoleStream(this, true, stderrFile)); System.setOut(consoleOut); System.setErr(consoleErr); @@ -95,6 +120,7 @@ public class PdeEditorConsole extends Component { public void paint(Graphics screen) { //systemOut.println("paint()"); if (bgColor == null) { + bgColor = PdeBase.getColor("editor.console.bgcolor", new Color(26, 26, 26)); fgColorOut = PdeBase.getColor("editor.console.fgcolor.output", @@ -251,10 +277,13 @@ class PdeEditorConsoleStream extends OutputStream { PdeEditorConsole parent; boolean err; // whether stderr or stdout byte single[] = new byte[1]; + OutputStream echo; - public PdeEditorConsoleStream(PdeEditorConsole parent, boolean err) { + public PdeEditorConsoleStream(PdeEditorConsole parent, + boolean err, OutputStream echo) { this.parent = parent; this.err = err; + this.echo = echo; } public void close() { } @@ -263,10 +292,28 @@ class PdeEditorConsoleStream extends OutputStream { public void write(byte b[]) { // appears never to be used parent.write(b, 0, b.length, err); + if (echo != null) { + try { + echo.write(b); //, 0, b.length); + echo.flush(); + } catch (IOException e) { + e.printStackTrace(); + echo = null; + } + } } public void write(byte b[], int offset, int length) { parent.write(b, offset, length, err); + if (echo != null) { + try { + echo.write(b, offset, length); + echo.flush(); + } catch (IOException e) { + e.printStackTrace(); + echo = null; + } + } /* //System.out.println("leech2:"); if (length >= 1) { @@ -295,6 +342,15 @@ class PdeEditorConsoleStream extends OutputStream { public void write(int b) { single[0] = (byte)b; parent.write(single, 0, 1, err); + if (echo != null) { + try { + echo.write(b); + echo.flush(); + } catch (IOException e) { + e.printStackTrace(); + echo = null; + } + } //parent.message(String.valueOf((char)b), err); } } diff --git a/processing/build/windows/dist.sh b/processing/build/windows/dist.sh index 95a887e3e..a18b24b93 100755 --- a/processing/build/windows/dist.sh +++ b/processing/build/windows/dist.sh @@ -55,6 +55,7 @@ rm -rf processing/lib/export/CVS # get platform-specific goodies from the dist dir cp dist/Proce55ing.exe processing/ +cp dist/run.bat processing/ cp dist/lib/pde_windows.properties processing/lib/ # convert notes.txt to windows LFs diff --git a/processing/build/windows/dist/Proce55ing.exe b/processing/build/windows/dist/Proce55ing.exe index d87368016..8e5084d77 100755 Binary files a/processing/build/windows/dist/Proce55ing.exe and b/processing/build/windows/dist/Proce55ing.exe differ diff --git a/processing/build/windows/dist/run.bat b/processing/build/windows/dist/run.bat new file mode 100755 index 000000000..5b98c143f --- /dev/null +++ b/processing/build/windows/dist/run.bat @@ -0,0 +1,2 @@ +@echo off +.\java\bin\java -cp lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\oro.jar;java\lib\ext\comm.jar \ No newline at end of file diff --git a/processing/build/windows/launcher/.cvsignore b/processing/build/windows/launcher/.cvsignore index 9f4af1117..1edae2c96 100644 --- a/processing/build/windows/launcher/.cvsignore +++ b/processing/build/windows/launcher/.cvsignore @@ -6,4 +6,7 @@ launcher.plg launcher.exe launcher.ilk launcher.aps +Proce55ing.ilk +Proce55ing.exe + diff --git a/processing/build/windows/launcher/document.ico b/processing/build/windows/launcher/document.ico index 6e1ec7498..98650ac3a 100644 Binary files a/processing/build/windows/launcher/document.ico and b/processing/build/windows/launcher/document.ico differ diff --git a/processing/build/windows/launcher/launcher.cpp b/processing/build/windows/launcher/launcher.cpp index 4c2859b0c..d972edb3b 100644 --- a/processing/build/windows/launcher/launcher.cpp +++ b/processing/build/windows/launcher/launcher.cpp @@ -101,7 +101,7 @@ BOOL CLauncherApp::InitInstance() char *cp = (char *)malloc(8 * strlen(loaddir) + 200); // put quotes around contents of cp, // because %s might have spaces in it. - + sprintf(cp, "-cp \"" "%s\\lib;" @@ -109,7 +109,7 @@ BOOL CLauncherApp::InitInstance() "%s\\lib\\pde.jar;" "%s\\lib\\kjc.jar;" "%s\\lib\\oro.jar;" - "%s\\lib\\java\\ext\\comm.jar" + "%s\\java\\lib\\ext\\comm.jar" "\" ", loaddir, loaddir, loaddir, loaddir, loaddir, loaddir); @@ -136,8 +136,8 @@ BOOL CLauncherApp::InitInstance() strcpy(executable, loaddir); // copy in the path for jrew, relative to launcher.exe //strcat(executable, "\\bin\\jrew"); - strcat(executable, "\\java\\bin\\java"); - + strcat(executable, "\\java\\bin\\javaw"); + //AfxMessageBox(executable); // code to add the lib directory to the path, in case that's needed diff --git a/processing/build/windows/launcher/launcher.dsp b/processing/build/windows/launcher/launcher.dsp index a4dd17947..0797c76d2 100644 --- a/processing/build/windows/launcher/launcher.dsp +++ b/processing/build/windows/launcher/launcher.dsp @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"launcher.exe" /pdbtype:sept +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Proce55ing.exe" /pdbtype:sept !ENDIF diff --git a/processing/build/windows/launcher/launcher.exe b/processing/build/windows/launcher/launcher.exe deleted file mode 100755 index 9a8dabd4b..000000000 Binary files a/processing/build/windows/launcher/launcher.exe and /dev/null differ diff --git a/processing/todo.txt b/processing/todo.txt index 636e3f9b6..221bc28f3 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -43,13 +43,15 @@ X use osx utilities to setfileinfo for .jar files etc o try to build macutils under osx X bug where pde.properties was being replaced for sketch.properties X changed pde.properties_PLATFORM -> pde_PLATFORM.properties +X f subst problems: include , and ; as allowable +X float f = 0.3; and fill(0.3, 0.2, 0.1); +X windows needs to work from the .exe +X also included run.bat just in case -before 39 goes out -_ f subst problems: include , and ; as allowable -_ float f = 0.3; and fill(0.3, 0.2, 0.1); -_ make win/linux write stderr to stderr.txt like the mac -_ this will be useful until i implement scrollbar +0039 +a _ make win/linux write stderr to stderr.txt like the mac +a _ this will be useful until i implement scrollbar bagel a _ serial @@ -96,6 +98,7 @@ a _ include release number, platform, and a copy of the code a _ need comprehensive set of tests for 'f' substitution scenarios web / docs +a _ check on linefeeds and other errors with bbs on web site a _ online discussion/talk system (gets people using the site too) a _ online signup cgi for people to add themselves to the list a _ see about setting up simple bug tracker/feature system