test -e upstream/mips && make -C upstream/mips clean
JVM: build/JVM/ibex.jar
-Linux: ; make gcj platform=Linux link_flags="-lX11 -lXext"
+Linux: ; make gcj platform=Linux link_flags="upstream/install/lib/libExtraWINGs.a upstream/install/lib/libWINGs.a upstream/install/lib/libwraster.a -L/usr/X11R6/lib -lXpm -lX11 -lXext"
Solaris: ; make gcj platform=Solaris link_flags="-lX11 -lXext -lpthread"
Win32: ; make gcj platform=Win32 link_flags="-Wl,--subsystem,windows -lcomdlg32"
Darwin: ; make gcj platform=Darwin link_flags="$(darwin_linker_flags)"
mkdir -p `dirname $@`
$(gcj) -c $< -o $@
+build/$(platform)/org/ibex/plat/X11.cc.o: .install_WindowMaker-0.80.2_$(target)
build/$(platform)/org/ibex/plat/$(platform).cc.o: src/org/ibex/plat/$(platform).cc src/org/ibex/plat/*.cc .configure_jpeg-6b_$(target)
@make $(java_headers)
@echo -e "\n\033[1mcompiling .cc -> .o: $<\033[0m"
build/$(platform)/$(target_bin): build/$(platform)/org/ibex/plat/$(platform).cc.o upstream/jpeg-6b/build-$(target)/libjpeg.a build/$(platform)/builtin.o build/$(platform)/$(platform).ar build/$(platform)/org/ibex/plat/$(platform).java.o
@echo -e "\n\033[1mlinking .o -> $(target_bin)\033[0m"
mkdir -p build/$(platform)
- PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.ibex.Main -o $@ -Lupstream/install/$(target)/lib $^ $(link_flags)
+ PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.ibex.Main -o $@ -Lupstream/install/$(target)/lib -Lupstream/install/lib $^ $(link_flags)
### Builtin Resources ##############################################################################
url_vera-1.10 := http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf-bitstream-vera-1.10.tar.gz
url_jode-1.1.1 := http://umn.dl.sourceforge.net/sourceforge/jode/jode-1.1.1.tar.gz
url_java-getopt-1.0.9 := ftp://ftp.urbanophile.com/pub/arenn/software/sources/java-getopt-1.0.9.tar.gz
+url_WindowMaker-0.80.2 := ftp://windowmaker.org/pub/source/release/WindowMaker-0.80.2.tar.gz
.install_binutils-2.13.2.1_powerpc-apple-darwin: .vendor
rm -rf upstream/darwin-linker/src
// Instance Methods /////////////////////////////////////////////////////////////////////
- public int fontSize() { return (font == null ? DEFAULT_FONT : font).pointsize; }
+ public final int fontSize() { return font == null ? DEFAULT_FONT.pointsize : font.pointsize; }
/** invoked when a resource needed to render ourselves finishes loading */
public void perform() throws JSExn {
else if (url.startsWith("https://")) return new Stream.HTTP(url);
else if (url.startsWith("data:")) return new Stream.ByteArray(Base64.decode(url.substring(5)), null);
else if (url.startsWith("utf8:")) return new Stream.ByteArray(url.substring(5).getBytes(), null);
+ else if (url.startsWith("file:")) {
+ // FIXME
+ Platform.fileDialog(url.substring(5), false);
+ }
throw new JSExn("invalid resource specifier " + url);
}
case "thread.sleep": sleep(JS.toInt(a)); return null;
org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
}
+#include "WINGs/WINGs.h"
+jstring org::ibex::plat::X11::_fileDialog(jstring suggestedFileName, jboolean write) {
+ int argc = 1;
+ char* argv[2];
+ argv[0] = "Ibex";
+ argv[1] = NULL;
+ // FIXME see WINGs/Tests/filedialog.c for more info... need an icon
+ WMInitializeApplication("Ibex", &argc, argv);
+ WMScreen *scr = WMCreateSimpleApplicationScreen(display);
+ int len = min(1024, JvGetStringUTFLength(suggestedFileName));
+ char buf[len + 1];
+ JvGetStringUTFRegion(suggestedFileName, 0, len, buf);
+ buf[len] = '\0';
+ if (write) {
+ WMSavePanel *sPanel;
+ sPanel = WMGetSavePanel(scr);
+ if (WMRunModalFilePanelForDirectory(sPanel, NULL, buf, /*title*/ NULL, NULL) != True) return NULL;
+ return JvNewStringLatin1(WMGetFilePanelFileName(sPanel));
+ } else {
+ WMOpenPanel *oPanel;
+ oPanel = WMGetOpenPanel(scr);
+ if (WMRunModalFilePanelForDirectory(oPanel, NULL, buf, /*title*/ NULL, NULL) != True) return NULL;
+ return JvNewStringLatin1(WMGetFilePanelFileName(oPanel));
+ }
+}
//////////////////////////////////////////////////////////////////////////////
protected native String _getClipBoard();
protected native void _setClipBoard(String s);
protected boolean _needsAutoDoubleClick() { return true; }
+ protected native String _fileDialog(String suggestedFileName, boolean write);
protected native void eventThread();
private native void natInit();