// FIXME remove this
private final JS rr;
+
public Ibex(Stream rr) { this.rr = bless(rr); }
public JS resolveString(String str, boolean permitAbsolute) throws JSExn {
case "regexp": return METHOD;
case "ui": return getSub("ui");
case "ui.font": return getSub("ui.font");
+ case "ui.font.wait": return METHOD;
case "ui.font.sansserif": return Main.builtin.get("fonts/vera/Vera.ttf");
case "ui.font.monospace": return Main.builtin.get("fonts/vera/VeraMono.ttf");
case "ui.font.serif": return Main.builtin.get("fonts/vera/VeraSe.ttf");
case "stream.watch": return new Stream.ProgressWatcher((Stream)a, (JS)b);
case "regexp": return new JSRegexp(a, b);
//#end
+ case 3:
+ //#switch(name)
+ case "font.wait":
+ try {
+ JS.UnpauseCallback callback = JS.pause();
+ Font font = Font.getFont((Stream)a, JS.toInt(b));
+ if (font.rasterizeGlyphs((String)c, null, 0,0,0,0,0,0,0, callback) != -1) Scheduler.add(callback);
+ } catch (JS.NotPauseableException npe) {
+ JS.error("can't wait for a font in a foreground thread");
+ }
+ //#end
break;
}
} catch (RuntimeException e) {
public static class Blessing extends JS.Clone {
private Ibex ibex;
private Template t = null;
- private Object parentkey = null;
- private Blessing parent = null;
+ public Object parentkey = null;
+ public Blessing parent = null;
public Blessing(JS.Cloneable clonee, Ibex ibex, Blessing parent, Object parentkey) {
super(clonee); this.ibex = ibex; this.parentkey = parentkey; this.parent = parent; }
public Object get(Object key) throws JSExn {
try {
// FIXME background?
if (t == null)
- t = Template.buildTemplate(parentkey + ".t", Stream.getInputStream(parent.get(parentkey + ".t")), ibex);
+ t = Template.buildTemplate(parentkey + ".t", parent.get(parentkey + ".t"), ibex);
return t.staticScope;
} catch (Exception e) {
Log.error(this, e);