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 {
public static String origin = null;
public static String initialTemplate = null;
- public static final Fountain builtin = new Fountain.Zip(new Fountain.FromInputStream(Platform.getBuiltinInputStream()));
+ //public static final Fountain builtin = new Fountain.Zip(new Fountain.FromInputStream(Platform.getBuiltinInputStream()));
+ public static final Fountain vera;
+ static {
+ Fountain temp = null;
+ try {
+ temp = new Fountain.FromInputStream(Encode.JavaSourceCode.decode(Vera.data));
+ } catch (Exception e) { Log.error(Main.class, e); }
+ vera = temp;
+ }
public static void printUsage() {
System.err.println("Usage: ibex [-lawp] [ url | file | directory ]");
if (Log.on) Log.info(Main.class, "loading xwar");
final Ibex ibex = new Ibex(rr);
- org.ibex.graphics.Surface.scarImage =
- Picture.load(new Fountain.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(null, callargs);
- } finally { callargs[0] = null; }
- return null;
- } });
+ try {
+ JS blessed = ibex.bless(new Fountain.FromInputStream(Encode.JavaSourceCode.decode(org.ibex.core.builtin.Scar.data)));
+ org.ibex.graphics.Surface.scarImage = Platform.createPicture(blessed);
+ } catch (Exception e) {
+ Log.error(Main.class, e);
+ }
+ Platform.Scheduler.add(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(null, callargs);
+ } finally { callargs[0] = null; }
+ return null;
+ } });
+
Platform.Scheduler.init();
}
}