-// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the GNU General Public License version 2 ("the License").
+// You may not use this file except in compliance with the License.
+
package org.ibex.core;
import java.net.*;
import org.ibex.util.*;
import org.ibex.plat.*;
import org.ibex.graphics.*;
+import org.ibex.core.builtin.*;
/** Entry point for the Ibex Engine; handles splash screen, initial xwar loading, and argument processing */
public class Main {
originHost = originHost.substring(0, originHost.indexOf('/') == -1 ? originHost.length() : originHost.indexOf('/'));
if (originHost.indexOf('@') != -1) originHost = originHost.substring(originHost.indexOf('@') + 1);
originAddr = InetAddress.getByName(originHost);
- rr = builtin;
- startupTemplate = "org.ibex.builtin.splash";
+ //rr = builtin;
+ //startupTemplate = "org.ibex.builtin.splash";
+ rr = new Stream.HTTP(origin);
+ startupTemplate = initialTemplate;
} else {
rr = new Stream.File(origin);
if (!new File(origin).isDirectory()) rr = new Stream.Zip(rr);
final Ibex ibex = new Ibex(rr);
org.ibex.graphics.Surface.scarImage =
- Picture.load(Main.builtin.get(JS.S("org/ibex/core/builtin/scar.png")),
- new Task() { public void perform() throws JSExn, UnknownHostException {
- if (Log.on) Log.info(Main.class, "invoking initial template");
- ibex.resolveString(startupTemplate, false).call(new Box(), null, null, null, 1);
+ Picture.load(new Stream.FromInputStream(Encode.JavaSourceCode.decode(Scar.data)),
+ new Callable() {
+ private final JS[] callargs = new JS[1];
+ public Object run(Object o) throws JSExn,UnknownHostException {
+ if (Log.on) Log.info(Main.class, "invoking initial template");
+ try {
+ callargs[0] = new Box();
+ ibex.resolveString(startupTemplate, false).call(callargs);
+ } finally { callargs[0] = null; }
+ return null;
} });
Scheduler.init();