2003/05/08 13:38:40
[org.ibex.core.git] / src / org / xwt / Main.java
index f6f9062..7713361 100644 (file)
@@ -69,6 +69,7 @@ public class Main extends Applet {
                 }
                 else if (args[startargs].equals("-s")) showRenders = true;
                 else if (args[startargs].equals("-v")) Log.verbose = true;
+                else if (args[startargs].equals("-l")) startargs++;          // FIXME
                 else break;
                 startargs++;
             }
@@ -82,7 +83,7 @@ public class Main extends Applet {
             PNG png = PNG.decode(new ByteArrayInputStream(Base64.decode(scarPicture_png_base64)), "bundled scar image");
             Surface.scarPicture = Platform.createPicture(png.getData(), png.getWidth(), png.getHeight());
 
-            InputStream is = Main.class.getClassLoader().getResourceAsStream("org/xwt/builtin.xwar");
+            InputStream is = Platform.getBuiltinInputStream();
             if (is == null) Platform.criticalAbort("unable to load builtin.xwar");
             Resources.loadArchive(is);
            
@@ -119,7 +120,7 @@ public class Main extends Applet {
             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;
+                       doneInitializing = true;
             if (Surface.allSurfaces.size() == 0) {
                 Log.log(this, "exiting because all surfaces are gone");
                 Platform.exit();
@@ -129,8 +130,9 @@ public class Main extends Applet {
                 });
            
             // gcj-win32 exit()'s when the original thread dies, so we have to deadlock ourselves
-            if (Log.on) Log.log(Main.class, "main thread blocking on new semaphore");
-            new org.xwt.util.Semaphore().block();
+            //if (Log.on) Log.log(Main.class, "main thread blocking on new semaphore");
+            //new org.xwt.util.Semaphore().block();
+            Platform.running();
 
         } catch (Throwable e) {
             e.printStackTrace();