libwing_Solaris += upstream/install/sparc-sun-solaris2.7/lib/libWINGs.a
libwing_Solaris += upstream/install/sparc-sun-solaris2.7/lib/libwraster.a
-Java2: build/JVM/ibex.jar
+Java2: build/Java2/ibex.jar
JVM:; make Java2
Linux: ; make gcj platform=Linux link_flags="$(libwing_Linux) -lXpm -lX11 -lXext"
Solaris: ; make gcj platform=Solaris link_flags="$(libwing_Solaris) -lXpm -lX11 -lXext -lpthread"
target_bin_extension_$(platform) := $(shell echo $(platform) | tr A-Z a-z)
target_bin_extension_Win32 := exe
-target_bin_extension_JVM := jar
+target_bin_extension_Java2 := jar
target_bin_extension := $(target_bin_extension_$(platform))
target_bin := ibex.$(target_bin_extension)
plat_classes_AWT := org.ibex.plat.AWT
plat_classes_Java2 := org.ibex.plat.Java2 $(plat_classes_AWT)
-plat_classes_JVM := $(plat_classes_Java2)
plat_classes_GCJ := org.ibex.plat.GCJ
plat_classes_Win32 := org.ibex.plat.Win32 $(plat_classes_GCJ)
plat_classes_POSIX := org.ibex.plat.POSIX $(plat_classes_GCJ)
plat_classes_Solaris := org.ibex.plat.Solaris $(plat_classes_X11)
plat_classes_Darwin := org.ibex.plat.Darwin org.ibex.plat.OpenGL $(plat_classes_POSIX)
-plat_java_src_sources := src/org/ibex/plat/$(platform).java
+plat_java_src_sources := $(patsubst %,build/java/%.java,$(subst .,/,$(plat_classes_$(platform))))
java_src_sources := $(shell find src -name '*.java' | grep -v Preprocessor | grep -v plat)
java_src_sources += $(plat_java_src_sources)
java_sources := $(patsubst src/%.java, build/java/%.java, $(java_src_sources))
.compile: .install_mips2java .download_bcel-5.1 $(java_sources) $(java_classes); touch $@
ifeq ($(platform),Java2)
-build/class/%.class: .preprocessor $(java_sources) .jikes
+build/class/%.class: build/java/%.java .preprocessor .jikes
@echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
- rm -rf build/class
mkdir -p build/class
- @./.jikes $(java_sources) -d build/class
+ @./.jikes $< -d build/class
else
build/class/%.class: build/java/%.java
@echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
$(gcj) -I$(bcel_jar) -C -O0 $< -d build/class
endif
-build/JVM/ibex.jar: .compile build/res/builtin.jar build/class/org/ibex/translators/MIPSApps.class
- @echo -e "\n\033[1marchiving .class -> .jar: build/JVM/ibex.jar\033[0m"
- mkdir -p build/JVM
- echo -e "Manifest-Version: 1.0\nMain-Class: org.ibex.Main\n" > build/JVM/.manifest
+build/Java2/ibex.jar: .compile build/res/builtin.jar build/class/org/ibex/translators/MIPSApps.class
+ @echo -e "\n\033[1marchiving .class -> .jar: build/Java2/ibex.jar\033[0m"
+ mkdir -p build/Java2
+ echo -e "Manifest-Version: 1.0\nMain-Class: org.ibex.Main\n" > build/Java2/.manifest
cd build/class/org/ibex; ln -sf ../../../res/builtin.jar
- cd build/class; $(jar) cfm ../JVM/ibex.jar ../JVM/.manifest \
+ cd build/class; $(jar) cfm ../Java2/ibex.jar ../Java2/.manifest \
`find . \! -type d` \
$(patsubst %,../../upstream/mips/build/org/xwt/mips/%*.class, Runtime Registers Syscalls Errno)
cd build/res/fonts/vera; ln -fs ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraSe.ttf
build/res/builtin.jar: $(builtin_src:src/%=build/res/%) build/res/fonts/vera
@echo -e "\n\033[1mzipping res/* -> .jar: builtin.jar\033[0m"
- cd build/res; $(jar) cf builtin.jar org/ibex/builtin/scar.png
+ cd build/res; $(jar) cf builtin.jar org/ibex/builtin/scar.png fonts
build/$(platform)/builtin.o: build/res/builtin.jar
@echo -e "\n\033[1mwrapping .jar -> .o: resources.o\033[0m"
@mkdir -p $(@D)
current_build := $(shell cat next.build)
strip_$(platform) := upstream/install/$(target)/bin/strip build/$(platform)/$(target_bin) -o
-strip_JVM := cp build/$(platform)/$(target_bin)
+strip_Java2 := cp build/$(platform)/$(target_bin)
install-dist:; $(strip_$(platform)) /var/www/org/xwt/dist/master/ibex-$(current_build).$(target_bin_extension).unsigned
dist: compile
(echo -n 0000; (echo "10k16o16i"; cat next.build | tr a-z A-Z; echo "1+f") | dc) | tail --bytes=5 > next.build-
make install-dist platform=Linux
make install-dist platform=Solaris
make install-dist platform=Darwin
- make install-dist platform=JVM
+ make install-dist platform=Java2
echo -e "\n\n\n*** DONE ******************************************"
propose-patch:
Glyph g = (Glyph)glyphsToBeRendered.remove(false);
if (g == null) { glyphRenderingTaskIsScheduled = false; return; }
Log.debug(Font.class, "glyphRenderingTask dequeued glyph " + g.c + " of font " + g.font);
- if (g.isLoaded) { perform(); /* tailcall to the next glyph */ return; }
- Log.debug(Glyph.class, "rendering glyph " + g.c);
- try { freetype.renderGlyph(g); } catch (IOException e) { Log.info(Freetype.class, e); }
+ if (!g.isLoaded) {
+ Log.debug(Glyph.class, "rendering glyph " + g.c);
+ try { freetype.renderGlyph(g); } catch (IOException e) { Log.info(Freetype.class, e); }
+ }
Scheduler.add(this); // keep ourselves in the queue until there are no glyphs to render
glyphRenderingTaskIsScheduled = true;
} };
}
/** we enqueue ourselves in the Scheduler when we have a Move message to deal with */
- public void perform() {
- if (mousex == newmousex && mousey == newmousey) return;
- int oldmousex = mousex; mousex = newmousex;
- int oldmousey = mousey; mousey = newmousey;
- String oldcursor = cursor; cursor = "default";
- // Root gets motion events outside itself (if trapped)
- if (!root.inside(oldmousex, oldmousey) && !root.inside(mousex, mousey) && (button1 || button2 || button3))
- root.putAndTriggerTrapsAndCatchExceptions("_Move", T);
- if (!cursor.equals(oldcursor)) syncCursor();
- }
+ private Scheduler.Task mover = new Scheduler.Task() {
+ public void perform() {
+ if (mousex == newmousex && mousey == newmousey) return;
+ int oldmousex = mousex; mousex = newmousex;
+ int oldmousey = mousey; mousey = newmousey;
+ String oldcursor = cursor; cursor = "default";
+ // Root gets motion events outside itself (if trapped)
+ if (!root.inside(oldmousex, oldmousey) && !root.inside(mousex, mousey) && (button1 || button2 || button3))
+ root.putAndTriggerTrapsAndCatchExceptions("_Move", T);
+ if (!cursor.equals(oldcursor)) syncCursor();
+ } };
/**
* Notify Ibex that the mouse has moved. If the mouse leaves the
protected final void Move(final int newmousex, final int newmousey) {
this.newmousex = newmousex;
this.newmousey = newmousey;
- Scheduler.add(this);
+ Scheduler.add(mover);
}
protected final void HScroll(int pixels) { new Message("_HScroll", new Integer(pixels), root); }
protected final void Minimized(boolean b) { minimized = b; new Message("Minimized", b ? T : F, root); }
protected final void Maximized(boolean b) { maximized = b; new Message("Maximized", b ? T : F, root); }
protected final void Focused(boolean b) { new Message("Focused", b ? T : F, root); }
- public void Refresh() { Scheduler.add(new Scheduler.Task() { public void perform() { } }); }
+
+ private boolean scheduled = false;
+ public void Refresh() { if (!scheduled) Scheduler.add(this); scheduled = true; }
+ public void perform() { scheduled = false; Scheduler.renderAll(); }
public final void setMaximized(boolean b) { if (b != maximized) _setMaximized(maximized = b); }
public final void setMinimized(boolean b) { if (b != minimized) _setMinimized(minimized = b); }
/** runs the prerender() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen */
public synchronized void render() {
-
+ scheduled = false;
// make sure the root is properly sized
do {
abort = false;
public void setMinimumSize(int minx, int miny, boolean resizable) { if (frame != null) frame.setResizable(resizable); }
+ private int oldfill = 0x0;
public void render() {
// useful optimizatin;
- window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
- Color.white :
- new Color((root.fillcolor >> 16) & 0xff,
- (root.fillcolor >> 8) & 0xff,
- (root.fillcolor) & 0xff));
+ if (oldfill != root.fillcolor) {
+ oldfill = root.fillcolor;
+ window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
+ Color.white :
+ new Color((root.fillcolor >> 16) & 0xff,
+ (root.fillcolor >> 8) & 0xff,
+ (root.fillcolor) & 0xff));
+ }
super.render();
}