From: megacz Date: Fri, 30 Jan 2004 07:41:41 +0000 (+0000) Subject: 2003/11/17 06:19:20 X-Git-Tag: RC3~337 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=929a33405c0de48f920e956ab83c1962a8e1baa0 2003/11/17 06:19:20 darcs-hash:20040130074141-2ba56-8c89302f2cdfee911c51a8b33ef3bb858d1e251e.gz --- diff --git a/Makefile b/Makefile index 4ee19ec..bb82c5f 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,8 @@ builtin_src := $(shell find src/org/xwt/builtin -name '*.*' \! -name '*.xcf') build/res/fonts/vera: .download_vera-1.10 mkdir -p build/res/fonts/vera cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/Vera.ttf - cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraBd.ttf + cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraMono.ttf + cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraSe.ttf build/res/builtin.jar: $(builtin_src:src/%=build/res/%) build/res/freetype.mips build/res/libmspack.mips build/res/fonts/vera @echo -e "\n\033[1mzipping res/* -> .jar: builtin.jar\033[0m" cd build/res; $(jar) cf builtin.jar $(^:build/res/%=%) @@ -208,11 +209,10 @@ build/res/freetype.mips: build/mips/org/xwt/translators/Freetype.c.o build/mips/ -Lupstream/freetype-2.1.4/src/objs \ -o $@ \ $^ \ - -lfreetype \ -# -Wl,-s \ + -lfreetype .install_libmspack-20030726:; make .install_libmspack-20030726_mips-unknown-elf target=mips-unknown-elf -build/mips/org/xwt/translators/MSPack.c.o: .install_libmspack-20030726 +build/mips/org/xwt/translators/MSPack.c.o: .install_libmspack-20030726 build/res/libmspack.mips: build/mips/org/xwt/translators/MSPack.c.o build/mips/org/xwt/mips/crt0.c.o build/mips/org/xwt/mips/syscalls.c.o @echo -e "\n\033[1mlinking .o -> .mips: $@\033[0m" mkdir -p build/mips build/res @@ -226,10 +226,7 @@ build/res/libmspack.mips: build/mips/org/xwt/translators/MSPack.c.o build/mips/o -Lupstream/libmspack-20030726/build-mips-unknown-elf \ -o $@ \ $^ \ - -lmspack \ -# -Wl,-s \ - - + -lmspack ############################################################################## diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index 8e51542..0d23a6f 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -208,14 +208,15 @@ public abstract class Box extends JSScope implements JSTrap.JSTrappable { if (test(FIXED) == COLS) { short r = 0; for(Box child = firstPackedChild(); child != null; r++) { - for(short col=0, numclear=0; child != null && col < cols;) { - if (numRowsInCol[col] > r) continue; - if (col != 0 && col + min(cols, child.colspan) > cols) break; + for(short c=0, numclear=0; child != null && c < cols; c++) { + if (numRowsInCol[c] > r) continue; + if (c != 0 && c + min(cols, child.colspan) - numclear > cols) break; if (++numclear < min(cols, child.colspan)) continue; - for(int i=col - numclear + 1; i <= col; i++) numRowsInCol[i] += child.rowspan; - child.col = col; child.row = r; + for(int i=c - numclear + 1; i <= c; i++) numRowsInCol[i] += child.rowspan; + child.col = (short)(c - numclear + 1); child.row = r; rows = (short)max(rows, child.row + child.rowspan); child = child.nextPackedSibling(); + numclear = 0; } } for(int i=0; i unbounded) child_x -= (child_width - unbounded) / 2; diff --git a/src/org/xwt/BoxTree.java b/src/org/xwt/BoxTree.java index 7d2d3d5..86f1566 100644 --- a/src/org/xwt/BoxTree.java +++ b/src/org/xwt/BoxTree.java @@ -346,7 +346,7 @@ public final class BoxTree extends Box { /** Returns our index in our parent */ public int getIndexInParent() { // FIXME: store numleft and numright in the tree - if (peerTree_parent == null) return left == null ? 0 : left.numPeerChildren(); + if (peerTree_parent == null) return left == null ? 0 : left.numPeerChildren() + 1; else if (peerTree_parent.left == this) return peerTree_parent.getIndexInParent() - 1; else if (peerTree_parent.right == this) return peerTree_parent.getIndexInParent() + 1; else throw new Error("we're not a child of our parent!"); diff --git a/src/org/xwt/XWT.java b/src/org/xwt/XWT.java index 51e37f3..45144cd 100644 --- a/src/org/xwt/XWT.java +++ b/src/org/xwt/XWT.java @@ -41,6 +41,10 @@ public final class XWT extends JSCallable { case "log": return new Sub("log"); case "ui": return new Sub("ui"); case "thread": return new Sub("thread"); + case "font": return new Sub("font"); + case "font.sansserif": return Main.builtin.get("fonts/vera/Vera.ttf"); + case "font.monospace": return Main.builtin.get("fonts/vera/VeraMono.ttf"); + case "font.serif": return Main.builtin.get("fonts/vera/VeraSe.ttf"); case "ui.key": return new Sub("ui.key"); case "ui.key.alt": return Surface.alt ? Boolean.TRUE : Boolean.FALSE; case "ui.key.control": return Surface.control ? Boolean.TRUE : Boolean.FALSE; diff --git a/src/org/xwt/builtin/splash.xwt b/src/org/xwt/builtin/splash.xwt index bef5995..c4f3d8b 100644 --- a/src/org/xwt/builtin/splash.xwt +++ b/src/org/xwt/builtin/splash.xwt @@ -4,19 +4,33 @@ KeyPressed += function(k) { if (k == "escape") thisbox = null; } - var progress = function(n, d) { -var t = "downloaded " + xwt.math.ceil(100 * n/d) + "%"; -xwt.log.println("downloaded " + t); - $innerbar.width = $bar.width * n / d + 1; + var settext = function(t) { $text.text = t; + $text1.text = t; + $text2.text = t; + $text3.text = t; + $text4.text = t; } + var progress = function(n, d) { + var t = "downloaded " + xwt.math.ceil(100 * n/d) + "%"; + xwt.log.println("downloaded " + t); + $innerbar.width = $bar.width * n / d + 1; + settext(t); + } + xwt.thread = function() { -// $text.font = xwt.fonts.vera["Vera.ttf"]; -// $text.font = xwt.res.cache(cab["Arial.TTF"]); - $text.font = xwt.res.uncab(xwt.res.url("http://master.dist.xwt.org/msfonts/arial32.exe"))["Arial.TTF"]; - $text.fontsize = 18; - $text.text = "downloading..."; + $text.font = xwt.font.sansserif; + $text.fontsize = 14; + $text1.font = xwt.font.sansserif; + $text1.fontsize = 14; + $text2.font = xwt.font.sansserif; + $text2.fontsize = 14; + $text3.font = xwt.font.sansserif; + $text3.fontsize = 14; + $text4.font = xwt.font.sansserif; + $text4.fontsize = 14; + settext("downloading..."); fill = xwt.org.xwt.builtin["splash.png"]; xwt.ui.window = thisbox; thisbox.width=394; @@ -44,7 +58,17 @@ xwt.log.println("leaving"); } - + + + + + + + + + + +