finish serial for windows, better launcher

This commit is contained in:
benfry
2002-07-30 01:11:42 +00:00
parent b053d7f129
commit e1d702db2f
9 changed files with 47 additions and 22 deletions
+2
View File
@@ -600,6 +600,8 @@ public class KjcEngine extends PdeEngine {
applet = (KjcApplet) c.newInstance();
//((KjcApplet)applet).errStream = leechErr;
applet.setEngine(this);
// has to be before init
applet.serialProperties(PdeBase.properties);
applet.init();
applet.start();
+2
View File
@@ -67,6 +67,8 @@ public class PdeBase implements ActionListener {
static public void main(String args[]) {
//System.getProperties().list(System.out);
System.out.println(System.getProperty("java.class.path"));
PdeBase app = new PdeBase();
}
+3 -3
View File
@@ -537,18 +537,18 @@ public class PdeEditor extends Panel {
// -> keep this around for closing the external window
public void doClose() {
// grab window position
if (engine != null) {
//if (engine != null) {
try {
if ((presentationWindow == null) ||
(!presentationWindow.isVisible())) {
appletLocation = engine.window.getLocation();
}
// prone to bugs and doesn't work yet
// if ((presentationWindow != null) &&
// (presentationWindow.isVisible())) {
// presentLocation = engine.window.getLocation();
// }
}
} catch (NullPointerException e) { }
if (running) {
//System.out.println("was running, will call doStop()");
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
serial.port=COM1
+20 -8
View File
@@ -13,6 +13,7 @@
//#define STACKSIZE_MATCH " -mx"
#define JAVA_ARGS ""
#define JAVA_MAIN_CLASS "PdeBase"
//#define JAVA_CLASS_PATH "lib;lib\\build;lib\\pde.jar;lib\\kjc.jar;lib\\oro.jar;lib\\ext\\comm.jar"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -55,9 +56,9 @@ BOOL CLauncherApp::InitInstance()
// what was passed to this application
char *incoming_cmdline = (char *)malloc(256 * sizeof(char));
strcpy (incoming_cmdline, this->m_lpCmdLine);
// what gets put together to pass to jre
char *outgoing_cmdline = (char *)malloc(2048 * sizeof(char));
char *outgoing_cmdline = (char *)malloc(16384 * sizeof(char));
char *p = outgoing_cmdline;
// prepend the args for -mx and -ms if they weren't
@@ -89,26 +90,36 @@ BOOL CLauncherApp::InitInstance()
strcpy(outgoing_cmdline, JAVA_ARGS);
// append the classpath and launcher.Application
char *cp = (char *)malloc(1024 * sizeof(char));
//char *cp = (char *)malloc(1024 * sizeof(char));
char *loaddir = (char *)malloc(MAX_PATH * sizeof(char));
*loaddir = 0;
GetModuleFileName(NULL, loaddir, MAX_PATH);
// remove the application name
*(strrchr(loaddir, '\\')) = '\0';
//cp = (char *)malloc(5 * strlen(loaddir) + 200);
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;"
"%s\\lib\\build;"
"%s\\lib\\pde.jar;"
"%s\\lib\\kjc.jar;"
"%s\\lib\\oro.jar"
"%s\\lib\\oro.jar;"
"%s\\lib\\java\\ext\\comm.jar"
"\" ",
loaddir, loaddir, loaddir, loaddir, loaddir);
loaddir, loaddir, loaddir, loaddir, loaddir, loaddir);
//sprintf(cp, "-cp ");
//strcat(cp, JAVA_CLASSPATH);
//strcat(cp, " ");
strcat(outgoing_cmdline, cp);
//strcat(outgoing_cmdline, "-cp ");
//strcat(outgoing_cmdline, JAVA_CLASS_PATH);
//strcat(outgoing_cmdline, " ");
// add the name of the class to execute
//strcat(outgoing_cmdline, "launcher.Application ");
@@ -125,7 +136,7 @@ BOOL CLauncherApp::InitInstance()
strcpy(executable, loaddir);
// copy in the path for jrew, relative to launcher.exe
//strcat(executable, "\\bin\\jrew");
strcat(executable, "\\java\\bin\\javaw");
strcat(executable, "\\java\\bin\\java");
//AfxMessageBox(executable);
@@ -145,7 +156,8 @@ BOOL CLauncherApp::InitInstance()
HINSTANCE result;
result = ShellExecute(NULL, "open", executable,
outgoing_cmdline, NULL, SW_SHOWNORMAL);
outgoing_cmdline, loaddir, SW_SHOWNORMAL);
// outgoing_cmdline, NULL, SW_SHOWNORMAL);
if ((int)result <= 32) {
// some type of error occurred
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/sh
cd work && ./java/bin/java -cp lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\oro.jar PdeBase
cd work && ./java/bin/java -cp lib\;lib\\build\;lib\\pde.jar\;lib\\kjc.jar\;lib\\oro.jar\;java\\lib\\ext\\comm.jar PdeBase
+18 -10
View File
@@ -4,16 +4,13 @@ X get icon in macos9/macosx/windows formats
X wahoo! figure out how to do do simple .exe with icons
o use launcher code from sun jre
o needs to be built from command line
dammit we need a text editor.
gonna get sick of people bitching about it.
also an interesting possibility (for tech-minded only)
use terminal emulator, and run iostream from process
use pooterm stuff for the emulation window
key commands would conflict
but could use emacs under osx, linux
use nano (maybe emacs?) under windows
and nothing for macos9
X keyPressed() and others weren't being called
X serial work under windows
X make bapplet a serialporteventlistener
X remove 'public' from beginner listener event handlers
X trying to make eventlistener work
X comm.jar has to be in classpath for kjc (interesting)
X fixed launcher.exe because of problems in classpath
a _ this code is not performing correctly
BImage b; // declare variable "b" of type BImage
@@ -54,6 +51,7 @@ a _ for 'java' mode, try run using external vm
a _ would need to get error output stream from app.. argh
a _ only allow under win/osx/linux
a _ not clear how to kill the process.. does that work w/ 1.3?
? _ lockup when something missing from classpath on dynamic load
macos9
a _ getResource stuff breaks, sketch.properties can't save
@@ -123,6 +121,16 @@ a _ queue for people reporting things externally
a _ bugzilla but simpler
a _ would also be nice for people to be able to vote on features
dammit we need a text editor.
gonna get sick of people bitching about it.
also an interesting possibility (for tech-minded only)
use terminal emulator, and run iostream from process
use pooterm stuff for the emulation window
key commands would conflict
but could use emacs under osx, linux
use nano (maybe emacs?) under windows
and nothing for macos9
////////////////////////////////////////////////////////////////////