X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fcore%2FMain.java;h=39e23d2606d51dee1b01c762d6d3d6c9ccb2ed16;hp=a9c35df8a742eb94c5d3b1b84a9f8f83ae631efe;hb=05d23fde131a7d19b378c632c6cc6b7924d8ab4d;hpb=890000a10a0ccdc49f62946bddf1c0b840495a94 diff --git a/src/org/ibex/core/Main.java b/src/org/ibex/core/Main.java index a9c35df..39e23d2 100644 --- a/src/org/ibex/core/Main.java +++ b/src/org/ibex/core/Main.java @@ -11,11 +11,21 @@ import org.ibex.js.*; 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 { + // ugly hack: we have to set these properties before AWT loads + static { + System.setProperty("apple.awt.showGrowBox", "false"); + System.setProperty("apple.awt.graphics.EnableLazyDrawing", "40"); + System.setProperty("apple.awt.graphics.EnableLazyDrawing", "true"); + System.setProperty("apple.awt.window.position.forceSafeUserPositioning", "true"); + System.setProperty("apple.awt.window.position.forceSafeCreation", "true"); + System.setProperty("com.apple.hwaccel", "true"); + System.setProperty("com.apple.forcehwaccel", "true"); + } + /** * FEATURE: this should be implemented using self-emulation * Used for security checks. If this is null, it means that only @@ -29,7 +39,15 @@ 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 ]"); @@ -99,19 +117,24 @@ public class Main { 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(); } }