import java.util.*;
import java.io.*;
import java.awt.*;
+import org.mozilla.javascript.*;
import org.bouncycastle.util.encoders.Base64;
/** Entry point for the XWT Engine; handles splash screen, initial xwar loading, and argument processing */
public static Applet applet = null;
+ /** don't check if all surfaces are gone (and quit) until this is true */
+ public static boolean doneInitializing = false;
+
/** applet entry point */
public void init() {
if ("true".equals(getParameter("showRenders"))) showRenders = true;
if (Log.on) Log.log(Main.class, "instantiating " + initialTemplate);
final String initialTemplate_f = initialTemplate;
- MessageQueue.add(new Message() {
- public void perform() {
+ ThreadMessage.newthread(new JSObject.JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] arg) throws JavaScriptException {
new Box(initialTemplate_f, null);
+ doneInitializing = true;
+ if (Surface.allSurfaces.size() == 0) {
+ Log.log(this, "exiting because all surfaces are gone");
+ Platform.exit();
+ }
+ return null;
}
});