-[megacz] Adam Megacz <adam@xwt.org>
+[megacz] Adam Megacz <adam@ibex.org>
- Original Architect
- - XWT Engine
+ - Ibex Engine
- Most of the widget set
[david] David Crawshaw <david@zentus.com>
- Widget Czar
- - Fixes to slider.xwt
+ - Fixes to slider.ibex
[corey] Corey Jewett <cj@syntheticplayground.com>
- Patch to make build.xml not depend on <bash> task
05-Jun megacz Main.java: now require filename to end with .xwar
-05-Jun megacz XWT.java: xwt.fileSeparator, xwt.homeDir, xwt.tempDir,
- xwt.recursivePrintObject
+05-Jun megacz Ibex.java: ibex.fileSeparator, ibex.homeDir, ibex.tempDir,
+ ibex.recursivePrintObject
05-Jun megacz AWT.java: fix for non-US keyboards
-14-Jun megacz HTML.java, XWT.java: introduced xwt.parseHTML()
+14-Jun megacz HTML.java, Ibex.java: introduced ibex.parseHTML()
16-Jun megacz Resources.java: eliminated some annoying warning messages
16-Jun megacz Template.java: fixed erroneous attribute checks for numbers and image/border
-16-Jun megacz HTTP.java: diabled xwt-httpProxy, etc
+16-Jun megacz HTTP.java: diabled ibex-httpProxy, etc
23-Jun megacz Box.java: JPEG hack, fastpath rendering bugfix,
fixedaspect, improved >500 Pos/SizeChange loop breakout
01-Jul megacz Main.java: added browser detection output
-02-Jul david bevel.xwt: hpad/vpad must be greater than thickness
+02-Jul david bevel.ibex: hpad/vpad must be greater than thickness
-02-Jul david colorpicker.xwt, slider.xwt, slider_base.xwt: Implemented
- slider.xwt (limits, value display, quantization) and made
+02-Jul david colorpicker.ibex, slider.ibex, slider_base.ibex: Implemented
+ slider.ibex (limits, value display, quantization) and made
major improvements/fixed to colorpicker.
15-Jul megacz HTTP.java: implemented isInNet(), weekdayRange(), now
15-Jul megacz JSObject.java: added JSFunction helper
-15-Jul megacz GCJ.xml, XWT.java, Template.java, Static.java,
- Resources.java, splash.xwt, lithium.png, Main.java,
+15-Jul megacz GCJ.xml, Ibex.java, Template.java, Static.java,
+ Resources.java, splash.ibex, lithium.png, Main.java,
Box.java: builtin.xwar, loadArchive(), prefetchImage()
18-Jul megacz XMLRPC.java, MessageQueue.java: attempted to improve
18-Jul megacz Surface.java: improved shift modifier handling,
prohibited windows smaller than scar.
-18-Jul megacz XWT.java: added write-only 'proxyAuthorization' field.
+18-Jul megacz Ibex.java: added write-only 'proxyAuthorization' field.
18-Jul megacz AWT.java: boosted font size by 2 points on Java12
06-Aug megacz Platform.java: removed WPAD detection, HTTP.Proxy => Proxy.
-06-Aug megacz Static.java, Resources.java: fixed xwt.static bug.
+06-Aug megacz Static.java, Resources.java: fixed ibex.static bug.
06-Aug megacz SpecialBoxProperty.java: thisbox.root now returns null
if thisbox is a root box.
06-Aug megacz Box.java: use new HTTP interface, getIds() only returns children
-06-Aug megacz XWT.java: encodeURI, decodeURI, new HTTP stack, calling
+06-Aug megacz Ibex.java: encodeURI, decodeURI, new HTTP stack, calling
newBox in the foreground thread is deprecated.
06-Aug megacz XMLRPC.java: new HTTP stack, better verbose output
09-Aug megacz Win32.java, Win32.cc: hack to avoid strange race condition in Win32 GDI
-10-Aug megacz HTML.java, html.xwt: fixed HTML widget to handle unclosed <li> tags
+10-Aug megacz HTML.java, html.ibex: fixed HTML widget to handle unclosed <li> tags
10-Aug megacz TinySSL.java: fixed vulnerability to Mike Benham's attack
16-Aug megacz AWT.java, Java12.java, Java14.java: fixed jdk1.4 bug
with keypresses and frameless windows.
-16-Aug megacz XWT.java, SpecialBoxProperty.java: box.apply()
+16-Aug megacz Ibex.java, SpecialBoxProperty.java: box.apply()
17-Aug megacz Box.java, SpecialBoxProperty.java, Surface.java: code to
prevent engine from quitting when changing the last
15-Sep megacz Template.java: added callback for retheme operation
-15-Sep megacz XWT.java: new retheme() syntax
+15-Sep megacz Ibex.java: new retheme() syntax
23-Sep megacz SpecialBoxProperty.java: invisible now returns true if
any of the box's ancestors is invisible.
behavior, deliver clicks to box first (not root), id is
a readable attribute
-03-Oct megacz XWT.java: made recursivePrintObject public so we can
+03-Oct megacz Ibex.java: made recursivePrintObject public so we can
access it.
11-Oct megacz POSIX.cc: fixed a bug that was causing phantom messages
11-Feb megacz PNG.java: changed System.out.println to Log.log
-11-Feb megacz splash.xwt: added "press Esc to quit" message
+11-Feb megacz splash.ibex: added "press Esc to quit" message
11-Feb megacz Resources.java: removed libgcj hack; 3.3 fixed the problem
27-Feb =========== build 0274 ================================================
-27-Feb megacz Makefile: master.dist.xwt.org
+27-Feb megacz Makefile: master.dist.ibex.org
27-Feb megacz Makefile, Makefile, Makefile: none
20-Apr megacz gcc.patch: fixed the patch so it applies properly
-22-Apr megacz Lexer.java: added the Lexer for org.xwt.js
+22-Apr megacz Lexer.java: added the Lexer for org.ibex.js
24-Apr megacz Makefile, Carbon.cc, Carbon.java: added Carbon
skeleton code
29-Apr david Box.java: check for a moving redirect target
-29-Apr megacz Makefile: updated xwt cvs url
+29-Apr megacz Makefile: updated ibex cvs url
29-Apr david Parser.java, TokenStream.java: HACKS for
'and'/anonymous functions
01-May david Makefile: fix for non-linux build environments
02-May megacz Lexer.java, Parser.java: parser now parses
- splash.xwt
+ splash.ibex
02-May megacz JS.java, Parser.java: removed all FIXMES
08-May ejones Makefile, Main.java, Platform.java, Carbon.cc, Carbon.java, Win32.java:
Native Carbon Port: - Add Carbon implementation - Fix the
Makefile to build it correctly - Fix Main and Platform to call a
- method running on the Platform class when XWT is running. -
+ method running on the Platform class when Ibex is running. -
Fixed Win32 to block the main thread forever in its running
method.
11-May megacz Expr.java, JS.java, Lexer.java, Parser.java, package.html:
more JS code
-11-May megacz edit.xwt: updated to David's latest edit widget
+11-May megacz edit.ibex: updated to David's latest edit widget
-11-May megacz scar.png: scar image now lives in org.xwt.builtin
+11-May megacz scar.png: scar image now lives in org.ibex.builtin
11-May megacz Main.java: removed applet support, moved scar to
- org.xwt.builtin
+ org.ibex.builtin
-11-May megacz edit_lib.xwt: added Davids xwt.standard.lib.edit
+11-May megacz edit_lib.ibex: added Davids ibex.standard.lib.edit
-11-May megacz Arguments.java, BaseFunction.java, BinaryDigitReader.java, ClassDefinitionException.java, ClassNameHelper.java, ClassOutput.java, Context.java, ContextListener.java, DToA.java, DebuggableEngineImpl.java, DefaultErrorReporter.java, Delegator.java, EcmaError.java, ErrorReporter.java, EvaluatorException.java, FlattenedObject.java, Function.java, FunctionNode.java, FunctionObject.java, IRFactory.java, IdFunction.java, IdFunctionMaster.java, IdScriptable.java, ImporterTopLevel.java, InterpretedFunction.java, InterpretedScript.java, Interpreter.java, InterpreterData.java, InterpreterFrame.java, Invoker.java, JavaMembers.java, JavaScriptException.java, Label.java, LabelTable.java, LazilyLoadedCtor.java, LineBuffer.java, ListenerArray.java, LocalVariable.java, NativeArray.java, NativeBoolean.java, NativeCall.java, NativeDate.java, NativeError.java, NativeFunction.java, NativeGlobal.java, NativeJavaArray.java, NativeJavaClass.java, NativeJavaConstructor.java, NativeJavaMethod.java, NativeJavaObject.java, NativeJavaPackage.java, NativeMath.java, NativeNumber.java, NativeObject.java, NativeScript.java, NativeString.java, NativeWith.java, Node.java, NodeTransformer.java, NotAFunctionException.java, Parser.java, PreorderNodeIterator.java, PropertyException.java, RegExpProxy.java, Script.java, ScriptRuntime.java, Scriptable.java, ScriptableObject.java, SecuritySupport.java, ShallowNodeIterator.java, SourceTextItem.java, SourceTextManager.java, Synchronizer.java, TokenStream.java, UintMap.java, Undefined.java, VariableTable.java, WrapHandler.java, WrappedException.java, Wrapper.java, DebugFrame.java, DebugReader.java, DebuggableEngine.java, DebuggableScript.java, Debugger.java, NativeRegExp.java, NativeRegExpCtor.java, RegExpImpl.java, SubString.java, Box.java, ByteStream.java, HTML.java, HTTP.java, MessageQueue.java, Platform.java, Proxy.java, Resources.java, SOAP.java, SpecialBoxProperty.java, Static.java, Surface.java, Template.java, ThreadMessage.java, Trap.java, XMLRPC.java, XWT.java, AWT.java, Java12.java, JSObject.java:
- goodbye org.mozilla.javascript, hello org.xwt.js
+11-May megacz Arguments.java, BaseFunction.java, BinaryDigitReader.java, ClassDefinitionException.java, ClassNameHelper.java, ClassOutput.java, Context.java, ContextListener.java, DToA.java, DebuggableEngineImpl.java, DefaultErrorReporter.java, Delegator.java, EcmaError.java, ErrorReporter.java, EvaluatorException.java, FlattenedObject.java, Function.java, FunctionNode.java, FunctionObject.java, IRFactory.java, IdFunction.java, IdFunctionMaster.java, IdScriptable.java, ImporterTopLevel.java, InterpretedFunction.java, InterpretedScript.java, Interpreter.java, InterpreterData.java, InterpreterFrame.java, Invoker.java, JavaMembers.java, JavaScriptException.java, Label.java, LabelTable.java, LazilyLoadedCtor.java, LineBuffer.java, ListenerArray.java, LocalVariable.java, NativeArray.java, NativeBoolean.java, NativeCall.java, NativeDate.java, NativeError.java, NativeFunction.java, NativeGlobal.java, NativeJavaArray.java, NativeJavaClass.java, NativeJavaConstructor.java, NativeJavaMethod.java, NativeJavaObject.java, NativeJavaPackage.java, NativeMath.java, NativeNumber.java, NativeObject.java, NativeScript.java, NativeString.java, NativeWith.java, Node.java, NodeTransformer.java, NotAFunctionException.java, Parser.java, PreorderNodeIterator.java, PropertyException.java, RegExpProxy.java, Script.java, ScriptRuntime.java, Scriptable.java, ScriptableObject.java, SecuritySupport.java, ShallowNodeIterator.java, SourceTextItem.java, SourceTextManager.java, Synchronizer.java, TokenStream.java, UintMap.java, Undefined.java, VariableTable.java, WrapHandler.java, WrappedException.java, Wrapper.java, DebugFrame.java, DebugReader.java, DebuggableEngine.java, DebuggableScript.java, Debugger.java, NativeRegExp.java, NativeRegExpCtor.java, RegExpImpl.java, SubString.java, Box.java, ByteStream.java, HTML.java, HTTP.java, MessageQueue.java, Platform.java, Proxy.java, Resources.java, SOAP.java, SpecialBoxProperty.java, Static.java, Surface.java, Template.java, ThreadMessage.java, Trap.java, XMLRPC.java, Ibex.java, AWT.java, Java12.java, JSObject.java:
+ goodbye org.mozilla.javascript, hello org.ibex.js
11-May megacz msjvm.jar, netscape.jar: removing
msjvm.jar/netscape.jar; use reflection instead
-26-May megacz Box.java, Resources.java, SpecialBoxProperty.java, Static.java, XWT.java, JS.java, Parser.java:
- lots of progress on org.xwt.js
+26-May megacz Box.java, Resources.java, SpecialBoxProperty.java, Static.java, Ibex.java, JS.java, Parser.java:
+ lots of progress on org.ibex.js
26-May =========== build 0707 ================================================
26-May =========== build 0708 ================================================
-02-Jun megacz XWT.java, Lexer.java, Parser.java: more js
+02-Jun megacz Ibex.java, Lexer.java, Parser.java: more js
improvements
03-Jun megacz JS.java, Lexer.java, Parser.java: nearly finished
The contents of this distribution are copyrighted and licensed as follows:
================================================================================
- - src/org/xwt/TinySSL.java is Copyright 2002 Adam Megacz, and is
+ - src/org/ibex/TinySSL.java is Copyright 2002 Adam Megacz, and is
licensed under the GNU Library General Public License; you may
reuse it in closed source applications under certain conditions;
see the LGPL (attached below).
- - src/org/xwt/js/Lexer.java was partially derived from the Rhino
+ - src/org/ibex/js/Lexer.java was partially derived from the Rhino
JavaScript interpreter; hence is covered by the Netscape Public
License.
optimizer, written by Konstantin Knizhnik and "is freeware and is
distributed without any restrictions on its usage"
- - src/org/xwt/PNG.java is Copyright (c) 1997, Jason
+ - src/org/ibex/PNG.java is Copyright (c) 1997, Jason
Marshall. All Rights Reserved. Additional licensing terms are
contained in that file.
- - src/org/xwt/GIF.java is Copyright D. J. Hagberg, Jr. Additional
+ - src/org/ibex/GIF.java is Copyright D. J. Hagberg, Jr. Additional
licensing terms are contained in that file.
- the contents of src/org/bouncycastle is Copyright (c) 2000-2002 The
- All other files are Copyright 2003 Adam Megacz, all rights
reserved, all disclaimable warranties disclaimed.
- You may redistribute and/or modify the XWT engine (src/org/xwt/
+ You may redistribute and/or modify the Ibex engine (src/org/ibex/
and all subdirectories) under the GNU General Public License
("GPL", included below), version 2 ONLY (not any prior or later
versions), subject to the following two clarifications:
As a clarification to the General Public License, any data files
- (.xwt, .gif, .png) loaded into a running copy of the XWT Engine,
+ (.ibex, .gif, .png) loaded into a running copy of the Ibex Engine,
are specifically NOT considered "derivitave works" of the engine,
so long as they do not contain any code copied from the engine.
#############################################################################
#
-# The XWT Makefile
+# The Ibex Makefile
#
target_Darwin := powerpc-apple-darwin
find upstream -name config.cache -exec rm {} \;
test -e upstream/mips && make -C upstream/mips clean
-JVM: build/JVM/xwt.jar
+JVM: build/JVM/ibex.jar
Linux: ; make gcj platform=Linux link_flags="-lX11 -lXext"
Solaris: ; make gcj platform=Solaris link_flags="-lX11 -lXext -lpthread"
Win32: ; make gcj platform=Win32 link_flags="-Wl,--subsystem,windows -lcomdlg32"
darwin_linker_flags += -lSystem.B -lmathCommon.A -lGL -lGLU
# stupid broke-ass darwin linker...
-darwin_linker_flags += build/Darwin/org/xwt/plat/OpenGL.java.o build/Darwin/org/xwt/plat/POSIX.java.o
+darwin_linker_flags += build/Darwin/org/ibex/plat/OpenGL.java.o build/Darwin/org/ibex/plat/POSIX.java.o
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 := $(target_bin_extension_$(platform))
-target_bin := xwt.$(target_bin_extension)
+target_bin := ibex.$(target_bin_extension)
jikes_flags := -nowarn
gcc_optimizations := -O2
build/class/org/xwt/translators/MIPSApps.class: build/mips/mipsapps.mips .jikes
mkdir -p build/java/org/xwt/translators
@echo -e "\n\033[1mtranslating .mips -> .java: $<\033[0m"
- (echo -e 'package org.xwt.translators;\nimport org.xwt.mips.*;\n'; \
+ (echo -e 'package org.ibex.translators;\nimport org.xwt.mips.*;\n'; \
java -Xint -cp upstream/mips/build org.xwt.mips.Compiler MIPSApps build/mips/mipsapps.mips) \
| sed 's,//.*$$,,;'| tr -d '\n' > build/java/org/xwt/translators/MIPSApps.java
@echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
./.jikes -g:none build/java/org/xwt/translators/MIPSApps.java
-build/java/org/xwt/%.java: src/org/xwt/%.java
- make build/class/org/xwt/util/Preprocessor.class
+build/java/org/ibex/%.java: src/org/ibex/%.java
+ make build/class/org/ibex/util/Preprocessor.class
@echo -e "\n\033[1mpreprocessing .java -> .java: $<\033[0m"
- mkdir -p `dirname $@`; java -cp build/class org.xwt.util.Preprocessor < $< > $@
+ mkdir -p `dirname $@`; java -cp build/class org.ibex.util.Preprocessor < $< > $@
build/java/%.java: src/%.java ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
build/cc/%.cc: src/%.c ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
build/res/%: src/% ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
-build/class/org/xwt/util/Preprocessor.class: src/org/xwt/util/Preprocessor.java .jikes
+build/class/org/ibex/util/Preprocessor.class: src/org/ibex/util/Preprocessor.java .jikes
@echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
- mkdir -p build/class/org/xwt/util/
+ mkdir -p build/class/org/ibex/util/
./.jikes $<
oldcompile:; CLASSPATH=$$CLASSPATH:lib/libgcj-minimal.jar:upstream/mips/build javac -target 1.1 -d build/class `find build/java/ -name \*.java`
@echo -e "\n\033[1mcompiling .java -> .class: src/**/*.java\033[0m"
@rm -f $(java_sources:build/java/%.java=build/class/%.class)
mkdir -p build/class
+ echo @./.jikes $(java_sources)
@./.jikes $(java_sources)
touch .compile
-build/JVM/xwt.jar: .compile build/res/builtin.jar build/class/org/xwt/translators/MIPSApps.class
- @echo -e "\n\033[1marchiving .class -> .jar: build/JVM/xwt.jar\033[0m"
+build/JVM/ibex.jar: .compile build/res/builtin.jar build/class/org/xwt/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.xwt.Main\n" > build/JVM/.manifest
- cd build/class/org/xwt; ln -sf ../../../res/builtin.jar
- cd build/class; $(jar) cfm ../JVM/xwt.jar ../JVM/.manifest \
+ echo -e "Manifest-Version: 1.0\nMain-Class: org.ibex.Main\n" > build/JVM/.manifest
+ cd build/class/org/ibex; ln -sf ../../../res/builtin.jar
+ cd build/class; $(jar) cfm ../JVM/ibex.jar ../JVM/.manifest \
`find . \! -type d` \
$(patsubst %,../../upstream/mips/build/org/xwt/mips/%*.class, Runtime Registers Syscalls Errno)
### Native Code ##############################################################################
# a hack since we've disabled gcj's awt implementation
-build/$(platform)/org/xwt/plat/Java2.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
-build/$(platform)/org/xwt/plat/AWT.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
+build/$(platform)/org/ibex/plat/Java2.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
+build/$(platform)/org/ibex/plat/AWT.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
build/$(platform)/org/xwt/translators/MIPSApps.java.o: build/class/org/xwt/translators/MIPSApps.class
@echo -e "\n\033[1mcompiling .class -> .o: $<\033[0m"
mkdir -p `dirname $@`
$(gcj) -c $< -o $@
-build/$(platform)/org/xwt/plat/$(platform).cc.o: src/org/xwt/plat/$(platform).cc src/org/xwt/plat/*.cc .configure_jpeg-6b_$(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"
mkdir -p `dirname $@`
$(g++) -c $< -o $@
-nonplat_java_sources := $(filter-out build/java/org/xwt/plat/$(platform).java,$(java_sources))
+nonplat_java_sources := $(filter-out build/java/org/ibex/plat/$(platform).java,$(java_sources))
build/$(platform)/$(platform).ar: $(nonplat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
@echo -e "\n\033[1marchiving .o -> .a\033[0m"
mkdir -p build/$(platform)
upstream/install/$(target)/bin/ranlib $@
upstream/jpeg-6b/build-$(target)/libjpeg.a: .install_jpeg-6b_$(target)
-build/$(platform)/$(target_bin): build/$(platform)/org/xwt/plat/$(platform).cc.o upstream/jpeg-6b/build-$(target)/libjpeg.a build/$(platform)/builtin.o build/$(platform)/$(platform).ar build/$(platform)/org/xwt/plat/$(platform).java.o
+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.xwt.Main -o $@ -Lupstream/install/$(target)/lib $^ $(link_flags)
+ PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.ibex.Main -o $@ -Lupstream/install/$(target)/lib $^ $(link_flags)
### Builtin Resources ##############################################################################
-builtin_src := $(shell find src/org/xwt/builtin -name '*.*' \! -name '*.xcf')
+builtin_src := $(shell find src/org/ibex/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
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)
-install-dist:; $(strip_$(platform)) /var/www/master.dist.xwt.org/xwt-$(current_build).$(target_bin_extension).unsigned
+install-dist:; $(strip_$(platform)) /var/www/master.dist.ibex.org/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-
mv next.build- next.build
#############################################################################
#
-# The XWT upstream code Makefile
+# The Ibex upstream code Makefile
#
# deal with Apple's brokenness
url_freetype-2.1.4 := http://umn.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.4.tar.gz
url_gcc-3.3 := http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.3/gcc-3.3.tar.gz
url_jpeg-6b := http://www.ijg.org/files/jpegsrc.v6b.tar.gz
-url_jikes-1.18 := http://dist.xwt.org/jikes-1.18.tgz
+url_jikes-1.18 := http://dist.ibex.org/jikes-1.18.tgz
url_libmspack-20030726 := http://www.kyz.uklinux.net/downloads/libmspack-20030726.tar.gz
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
.download_mips2java:
mkdir -p upstream/install
curl http://www.megacz.com/tmp/mips.snapshot.tgz | tar -C upstream -xvzf -
-# echo '/1 :pserver:cvs@cvs.xwt.org:2401/ A' >> ~/.cvspass
-# cd upstream; cvs -d :pserver:cvs@cvs.xwt.org:/ co mips
+# echo '/1 :pserver:cvs@cvs.ibex.org:2401/ A' >> ~/.cvspass
+# cd upstream; cvs -d :pserver:cvs@cvs.ibex.org:/ co mips
cd upstream/mips/upstream; ln -sf `cd ../..; pwd`/install
touch $@
==============================================================================
-XWT README
+Ibex README
______________________________________________________________________________
Documentation
-If you're new to XWT, you should read the documentation in the order
+If you're new to Ibex, you should read the documentation in the order
presented below:
- README [this file]
Start here. Includes a map of all other documentation and a
description of the directory strucure
-- The XWT home page [http://www.xwt.org/]
+- The Ibex home page [http://www.ibex.org/]
-- The XWT tutorials [http://www.xwt.org/tutorials.html]
+- The Ibex tutorials [http://www.ibex.org/tutorials.html]
- Gentle introduction to what XWT is, and how to write
- .xwt's. Good for anybody who wants to write XWT applications.
+ Gentle introduction to what Ibex is, and how to write
+ .ibex's. Good for anybody who wants to write Ibex applications.
-- The XWT reference [http://www.xwt.org/reference.html]
+- The Ibex reference [http://www.ibex.org/reference.html]
- Precise, technical spec of exactly how XWT works. Assumes
- familiarity with XWT (ie, you've read the tutorial). This is the
- authoritative source for how an XWT engine should
+ Precise, technical spec of exactly how Ibex works. Assumes
+ familiarity with Ibex (ie, you've read the tutorial). This is the
+ authoritative source for how an Ibex engine should
behave.
Directory Structure
/
- AUTHORS - people involved in developing XWT
+ AUTHORS - people involved in developing Ibex
README - this file
COPYING - copyright information for all files in this distro
CHANGES - the changelot
- TM - trademark information for XWT
+ TM - trademark information for Ibex
Makefile - build file for gcc 3.3
next.build - the build id of the next build to be generated
jump.jar - the jump2 bytecode-to-palmos translator
libgcj-minimal.jar - a tiny portion of libgcj.jar; allows java->bytecode compilation without gcj
- src/ - all java source files and xwt sources go here
+ src/ - all java source files and ibex sources go here
edu/stanford/ejalbr - source code for BrowserLauncher
gnu/regexp/ - source code for the GNU regexp library for Java
org/
bouncycastle/ - the BouncyCastle Crypto Library
- xwt/
- translators/ - .xwt's and .png's that are essential to bootstrapping the engine
+ ibex/
+ translators/ - .ibex's and .png's that are essential to bootstrapping the engine
plat/ - platform-specific code
util/ - misc utilities
- js/ - the XWT JavaScript Interpreter
- mips/ - the XWT MIPS interpreter/recompiler
+ js/ - the Ibex JavaScript Interpreter
+ mips/ - the Ibex MIPS interpreter/recompiler
builtin/ - content for the core builtin resource
______________________________________________________________________________
Build Requirements
-There are pre-built, digitally signed binaries on http://dist.xwt.org/
+There are pre-built, digitally signed binaries on http://dist.ibex.org/
for every supported platform. Please consider using those unless
you're absolutely certain you need to go through the trouble of trying
-to get XWT to build.
+to get Ibex to build.
Requirements:
- jdk 1.3+
#renamer = new UniqueRenamer
-load = new WildCard { value = "org.xwt.*" },
+load = new WildCard { value = "org.ibex.*" },
new WildCard { value = "gnu.*" },
new WildCard { value = "org.bouncycastle.*" },
new WildCard { value = "edu.*" },
new WildCard { value = "java.*" }
-preserve = new WildCard { value = "org.xwt.Main" },
- new WildCard { value = "org.xwt.plat.Linux" },
+preserve = new WildCard { value = "org.ibex.Main" },
+ new WildCard { value = "org.ibex.plat.Linux" },
new WildCard { value="java.lang" },
new WildCard { value="gnu.gcj.protocol" },
new WildCard { value="java.net.URLConnection" },
private static final String VERSION = "1.1.4-dev";
// The localized strings are kept in a separate file
- // XWT LOCAL: we can't bundle property lists within the xwt executable on all platforms
+ // Ibex LOCAL: we can't bundle property lists within the ibex executable on all platforms
// private static ResourceBundle messages = PropertyResourceBundle.getBundle("gnu/regexp/MessagesBundle", Locale.getDefault());
// These are, respectively, the first and last tokens in our linked list
}
// Retrieves a message from the ResourceBundle
- // XWT LOCAL: we can't bundle property lists within the xwt executable on all platforms
+ // Ibex LOCAL: we can't bundle property lists within the ibex executable on all platforms
// for simplicity, just lookup the errors this way.
static final String getLocalizedMessage(String key) {
if(key.equals("error.prefix")) return "At position {0} in regular expression pattern:";
// FIXME
// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
// FEATURE: reflow before allowing js to read from width/height
// FEATURE: fastpath for rows=1/cols=1
// FEATURE: or else have a way to mark a column "same as last one"?
// FEATURE: reintroduce surface.abort
-import java.io.*;
-import java.net.*;
import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.xwt.translators.*;
/**
* <p>
- * Encapsulates the data for a single XWT box as well as all layout
+ * Encapsulates the data for a single Ibex box as well as all layout
* rendering logic.
* </p>
*
}
- // Methods to implement org.xwt.js.JS //////////////////////////////////////
+ // Methods to implement org.ibex.js.JS //////////////////////////////////////
public int globalToLocalX(int x) { return parent == null ? x : parent.globalToLocalX(x - this.x); }
public int globalToLocalY(int y) { return parent == null ? y : parent.globalToLocalY(y - this.y); }
int globaly = 0;
// WARNING: this method is called from the event-queueing thread -- it may run concurrently with
- // ANY part of XWT, and is UNSYNCHRONIZED for performance reasons. BE CAREFUL HERE.
+ // ANY part of Ibex, and is UNSYNCHRONIZED for performance reasons. BE CAREFUL HERE.
if (!cur.test(VISIBLE)) return null;
if (!cur.inside(x - globalx, y - globaly)) return cur.parent == null ? cur : null;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import org.xwt.translators.*;
-import org.xwt.util.*;
-import org.xwt.js.*;
-import java.util.*;
+import org.ibex.util.*;
import java.io.*;
// FEATURE: this could be cleaner
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.net.*;
import java.io.*;
import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.bouncycastle.util.encoders.Base64;
import org.bouncycastle.crypto.digests.*;
} else if (reply.startsWith("2")) {
if (h.get("HTTP").equals("1.0") && h.get("content-length") == null)
- throw new HTTPException("XWT does not support HTTP/1.0 servers which fail to return the Content-Length header");
+ throw new HTTPException("Ibex does not support HTTP/1.0 servers which fail to return the Content-Length header");
int cl = h.get("content-length") == null ? -1 : Integer.parseInt(h.get("content-length").toString());
InputStream ret = new HTTPInputStream(in, cl, releaseMe);
if ("gzip".equals(h.get("content-encoding"))) ret = new java.util.zip.GZIPInputStream(ret);
}
/** executes the PAC script and dispatches a call to one of the other attempt methods based on the result */
- private Socket attemptPAC(org.xwt.js.JS pacFunc) {
+ private Socket attemptPAC(org.ibex.js.JS pacFunc) {
if (Log.verbose) Log.info(this, "evaluating PAC script");
String pac = null;
try {
- org.xwt.js.JSArray args = new org.xwt.js.JSArray();
+ org.ibex.js.JSArray args = new org.ibex.js.JSArray();
Object obj = pacFunc.call(url.toString(), url.getHost(), null, null, 2);
if (Log.verbose) Log.info(this, " PAC script returned \"" + obj + "\"");
pac = obj.toString();
pw.print("GET " + path + " HTTP/1.1\r\n");
}
- pw.print("User-Agent: XWT\r\n");
+ pw.print("User-Agent: Ibex\r\n");
pw.print("Accept-encoding: gzip\r\n");
pw.print("Host: " + (host + (port == 80 ? "" : (":" + port))) + "\r\n");
if (proxied) pw.print("X-RequestOrigin: " + Main.originHost + "\r\n");
Log.info(Platform.class, "WPAD detection failed due to:");
if (e instanceof JSExn) {
try {
- org.xwt.js.JSArray arr = new org.xwt.js.JSArray();
+ org.ibex.js.JSArray arr = new org.ibex.js.JSArray();
arr.addElement(((JSExn)e).getObject());
} catch (Exception e2) {
Log.info(Platform.class, e);
Scheduler.add(new Scheduler.Task() {
public void perform() throws Exception {
Box b = new Box();
- Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/xwt/builtin/proxy_authorization.xwt")), new XWT(null));
+ Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
t.apply(b);
b.put("realm", realm);
b.put("proxyIP", proxyIP);
return ((d1 <= d2 && day >= d1 && day <= d2) || (d1 > d2 && (day >= d1 || day <= d2))) ? T : F;
- case "dateRange": throw new JSExn("XWT does not support dateRange() in PAC scripts");
- case "timeRange": throw new JSExn("XWT does not support timeRange() in PAC scripts");
+ case "dateRange": throw new JSExn("Ibex does not support dateRange() in PAC scripts");
+ case "timeRange": throw new JSExn("Ibex does not support timeRange() in PAC scripts");
//#end
return super.callMethod(method, a0, a1, a2, rest, nargs);
}
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.net.*;
-import java.text.*;
-import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
-import org.xwt.translators.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.bouncycastle.util.encoders.Base64;
-/** Singleton class that provides all functionality in the xwt.* namespace */
-public final class XWT extends JS.Cloneable {
+/** Singleton class that provides all functionality in the ibex.* namespace */
+public final class Ibex extends JS.Cloneable {
// FIXME remove this
private final JS rr;
- public XWT(Stream rr) { this.rr = bless(rr); }
+ public Ibex(Stream rr) { this.rr = bless(rr); }
public JS resolveString(String str, boolean permitAbsolute) throws JSExn {
if (str.indexOf("://") != -1) {
private class Sub extends JS {
String key;
Sub(String key) { this.key = key; }
- public void put(Object key, Object val) throws JSExn { XWT.this.put(this.key + "." + key, val); }
- public Object get(Object key) throws JSExn { return XWT.this.get(this.key + "." + key); }
+ public void put(Object key, Object val) throws JSExn { Ibex.this.put(this.key + "." + key, val); }
+ public Object get(Object key) throws JSExn { return Ibex.this.get(this.key + "." + key); }
public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
- return XWT.this.callMethod(this.key, a0, a1, a2, rest, nargs);
+ return Ibex.this.callMethod(this.key, a0, a1, a2, rest, nargs);
}
public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
- return XWT.this.callMethod(this.key + "." + method, a0, a1, a2, rest, nargs);
+ return Ibex.this.callMethod(this.key + "." + method, a0, a1, a2, rest, nargs);
}
}
private Cache subCache = new Cache(20);
public Object get(Object name) throws JSExn {
if (name instanceof String && ((String)name).length() == 0) return rr;
//#switch(name)
- case "math": return xwtMath;
- case "string": return xwtString;
+ case "math": return ibexMath;
+ case "string": return ibexString;
case "date": return METHOD;
case "box": return new Box();
case "clone": return METHOD;
HTTP.Proxy.Authorization.waitingForUser.release();
return;
//#end
- throw new JSExn("attempted to put unknown property: xwt."+name);
+ throw new JSExn("attempted to put unknown property: ibex."+name);
}
public Object callMethod(Object name, Object a, Object b, Object c, Object[] rest, int nargs) throws JSExn {
}
} catch (RuntimeException e) {
// FIXME: maybe JSExn should take a second argument, Exception
- Log.warn(this, "xwt."+name+"() threw: " + e);
- throw new JSExn("invalid argument for xwt object method "+name+"()");
+ Log.warn(this, "ibex."+name+"() threw: " + e);
+ throw new JSExn("invalid argument for ibex object method "+name+"()");
}
- throw new JSExn("invalid number of arguments for xwt object method "+name+"()");
+ throw new JSExn("invalid number of arguments for ibex object method "+name+"()");
}
public Stream url2res(String url) throws JSExn {
}
}
- public static final JSMath xwtMath = new JSMath() {
+ public static final JSMath ibexMath = new JSMath() {
private JS gs = new JSScope.Global();
public Object get(Object key) throws JSExn {
//#switch(key)
}
};
- public static final JS xwtString = new JS() {
+ public static final JS ibexString = new JS() {
private JS gs = new JSScope.Global();
public void put(Object key, Object val) { }
public Object get(Object key) throws JSExn {
}
// FEATURE: move this into builtin.xwar
- public Blessing bless(JS b) { return new XWT.Blessing((JS.Cloneable)b, this, null, null); }
+ public Blessing bless(JS b) { return new Ibex.Blessing((JS.Cloneable)b, this, null, null); }
public static class Blessing extends JS.Clone {
- private XWT xwt;
+ private Ibex ibex;
private Template t = null;
private Object parentkey = null;
private Blessing parent = null;
- public Blessing(JS.Cloneable clonee, XWT xwt, Blessing parent, Object parentkey) {
- super(clonee); this.xwt = xwt; this.parentkey = parentkey; this.parent = parent; }
+ 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 {
- return key.equals("") ? ((Object)getStatic()) : (new Blessing((JS.Cloneable)clonee.get(key), xwt, this, key));
+ return key.equals("") ? ((Object)getStatic()) : (new Blessing((JS.Cloneable)clonee.get(key), ibex, this, key));
}
public static Blessing getBlessing(Object o) {
if (!(o instanceof JS)) return null;
public JSScope getStatic() {
try {
// FIXME background?
- if (t == null) t = Template.buildTemplate(Stream.getInputStream(parent.get(parentkey + ".xwt")), xwt);
+ if (t == null) t = Template.buildTemplate(Stream.getInputStream(parent.get(parentkey + ".ixt")), ibex);
return t.staticScope;
} catch (Exception e) {
Log.error(this, e);
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.util.*;
-import java.util.zip.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.util.*;
import org.bouncycastle.util.encoders.Base64;
-/** Manages access to ~/.xwt */
+/** Manages access to ~/.ibex */
public class LocalStorage {
- static String xwtDirName = System.getProperty("user.home") + java.io.File.separatorChar + ".xwt";
+ static String ibexDirName = System.getProperty("user.home") + java.io.File.separatorChar + ".ibex";
- static java.io.File xwtDir = null;
+ static java.io.File ibexDir = null;
static java.io.File cacheDir = null;
static {
try {
- xwtDir = new java.io.File(xwtDirName);
- if (!xwtDir.mkdirs()) xwtDir = null;
+ ibexDir = new java.io.File(ibexDirName);
+ if (!ibexDir.mkdirs()) ibexDir = null;
try {
- cacheDir = new java.io.File(xwtDirName + java.io.File.separatorChar + "cache");
+ cacheDir = new java.io.File(ibexDirName + java.io.File.separatorChar + "cache");
if (!cacheDir.mkdirs()) cacheDir = null;
} catch (Exception e) {
Log.warn(LocalStorage.class, "unable to create cache directory " +
- xwtDirName + java.io.File.separatorChar + "cache");
+ ibexDirName + java.io.File.separatorChar + "cache");
}
} catch (Exception e) {
- Log.warn(LocalStorage.class, "unable to create xwt directory " + xwtDirName);
+ Log.warn(LocalStorage.class, "unable to create ibex directory " + ibexDirName);
}
}
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.net.*;
-import java.util.*;
import java.io.*;
-import java.awt.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
-import org.xwt.translators.*;
-import org.xwt.plat.*;
-import org.bouncycastle.util.encoders.Base64;
+import org.ibex.js.*;
+import org.ibex.util.*;
-/** Entry point for the XWT Engine; handles splash screen, initial xwar loading, and argument processing */
+/** Entry point for the Ibex Engine; handles splash screen, initial xwar loading, and argument processing */
public class Main {
/**
public static Picture scarImage = null;
public static void printUsage() {
- System.err.println("Usage: xwt [-s] [-v] [-l <port>/<url>] source-location [initial-template]");
+ System.err.println("Usage: ibex [-s] [-v] [-l <port>/<url>] source-location [initial-template]");
System.err.println("");
System.err.println("Options:");
System.err.println(" -v verbose logging (required for logging on Win32)");
if (originHost.indexOf('@') != -1) originHost = originHost.substring(originHost.indexOf('@') + 1);
originAddr = InetAddress.getByName(originHost);
rr = builtin;
- startupTemplate = "org.xwt.builtin.splash";
+ startupTemplate = "org.ibex.builtin.splash";
} else {
rr = new Stream.File(origin);
if (!new File(origin).isDirectory()) rr = new Stream.Zip(rr);
}
if (Log.on) Log.info(Main.class, "loading xwar");
- final XWT xwt = new XWT(rr);
- final JS final_rr = (JS)xwt.get("");
+ final Ibex ibex = new Ibex(rr);
+ final JS final_rr = (JS)ibex.get("");
scarImage =
- Picture.load((Stream)Main.builtin.get("org/xwt/builtin/scar.png"),
+ Picture.load((Stream)Main.builtin.get("org/ibex/builtin/scar.png"),
new Scheduler.Task() { public void perform() throws Exception {
- xwt.resolveString(startupTemplate, false).call(new Box(), null, null, null, 1);
+ ibex.resolveString(startupTemplate, false).call(new Box(), null, null, null, 1);
} });
Scheduler.init();
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.xwt.translators.*;
/**
if (ret == null) cache.put(stream, ret = Platform.createPicture(stream));
final Picture p = ret;
if (!ret.isLoaded && callback != null) {
- final XWT.Blessing b = XWT.Blessing.getBlessing(stream);
+ final Ibex.Blessing b = Ibex.Blessing.getBlessing(stream);
new java.lang.Thread() { public void run() {
InputStream in = null;
try {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
/**
* <p>
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.lang.reflect.*;
import java.net.*;
import java.io.*;
-import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
/**
* Abstracts away the small irregularities in JVM implementations.
* JVM. Subclasses are provided for other VMs. Methods whose names
* start with an underscore are meant to be overridden by
* subclasses. If you create a subclass of Platform, you should put
- * it in the org.xwt.plat package, and add code to this file's static
+ * it in the org.ibex.plat package, and add code to this file's static
* block to detect the new platform.
*/
public abstract class Platform {
static boolean clipboardReadEnabled = false; ///< true iff inside a C-v/A-v/Press3 trap handler
static Platform platform = null; ///< The appropriate Platform object for this JVM
static boolean alreadyDetectedProxy = false; ///< true if proxy autodetection has already been run
- static org.xwt.HTTP.Proxy cachedProxyInfo = null; ///< the result of proxy autodetection
+ static org.ibex.HTTP.Proxy cachedProxyInfo = null; ///< the result of proxy autodetection
public static String build = "unknown"; ///< the current build
// VM Detection Logic /////////////////////////////////////////////////////////////////////
criticalAbort("Unable to detect JVM");
}
- System.err.println(" " + os_name + " ==> org.xwt.plat." + platform_class);
+ System.err.println(" " + os_name + " ==> org.ibex.plat." + platform_class);
try {
- if (platform_class != null) Class.forName("org.xwt.plat." + platform_class).newInstance();
+ if (platform_class != null) Class.forName("org.ibex.plat." + platform_class).newInstance();
} catch (InstantiationException e) {
throw e.getCause();
}
Log.color = term != null && term.length() != 0 && !term.equals("cygwin");
try {
- build = (String)Class.forName("org.xwt.Build").getField("build").get(null);
- Log.diag(Platform.class, "XWT build: " + build);
+ build = (String)Class.forName("org.ibex.Build").getField("build").get(null);
+ Log.diag(Platform.class, "Ibex build: " + build);
} catch (ClassNotFoundException cnfe) {
- Log.warn(Platform.class, "XWT build: unknown");
+ Log.warn(Platform.class, "Ibex build: unknown");
} catch (Exception e) {
Log.info(Platform.class, "exception while detecting build:");
Log.info(Platform.class, e);
}
- Log.diag(Platform.class, "XWT VM detection: vendor = " + vendor);
+ Log.diag(Platform.class, "Ibex VM detection: vendor = " + vendor);
Log.diag(Platform.class, " version = " + version);
Log.diag(Platform.class, " os = " + os_name + " [version " + os_version + "]");
Log.diag(Platform.class, " platform = " + platform.getDescriptiveName());
protected Surface _createSurface(Box b, boolean framed) { return null; }
protected Picture _createPicture(JS r) { return null; }
protected PixelBuffer _createPixelBuffer(int w, int h, Surface owner) { return null; }
- protected Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new DefaultGlyph(f, c); }
+ protected Font.Glyph _createGlyph(org.ibex.Font f, char c) { return new DefaultGlyph(f, c); }
public static PixelBuffer createPixelBuffer(int w, int h, Surface s) { return platform._createPixelBuffer(w, h, s); }
public static Picture createPicture(JS r) { return platform._createPicture(r); }
- public static Font.Glyph createGlyph(org.xwt.Font f, char c) { return platform._createGlyph(f, c); }
+ public static Font.Glyph createGlyph(org.ibex.Font f, char c) { return platform._createGlyph(f, c); }
public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
Surface ret = platform._createSurface(b, framed);
ret.setInvisible(false);
/** invoked after initialization messages have been printed; useful for additional platform detection log messages */
protected void postInit() { }
- /** the human-readable name of the key mapped to XWT's 'alt' key */
+ /** the human-readable name of the key mapped to Ibex's 'alt' key */
public static String altKeyName() { return platform._altKeyName(); }
protected String _altKeyName() { return "alt"; }
platform._criticalAbort(message);
}
- /** if true, org.xwt.Surface will generate a Click automatically after a press and a release */
+ /** if true, org.ibex.Surface will generate a Click automatically after a press and a release */
public static boolean needsAutoClick() { return platform._needsAutoClick(); }
protected boolean _needsAutoClick() { return false; }
- /** if true, org.xwt.Surface will generate a DoubleClick automatically after recieving two clicks in a short period of time */
+ /** if true, org.ibex.Surface will generate a DoubleClick automatically after recieving two clicks in a short period of time */
public static boolean needsAutoDoubleClick() { return platform._needsAutoDoubleClick(); }
protected boolean _needsAutoDoubleClick() { return false; }
/** returns an InputStream to the builtin xwar */
public static InputStream getBuiltinInputStream() { return platform._getBuiltinInputStream(); }
- protected InputStream _getBuiltinInputStream() {return getClass().getClassLoader().getResourceAsStream("org/xwt/builtin.jar");}
+ protected InputStream _getBuiltinInputStream() {return getClass().getClassLoader().getResourceAsStream("org/ibex/builtin.jar");}
/** returns the value of the environment variable key, or null if no such key exists */
public static String getEnv(String key) { return platform._getEnv(key); }
/** displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel */
protected String _fileDialog(String suggestedFileName, boolean write) { return null; }
- public static String fileDialog(String suggestedFileName, boolean write) throws org.xwt.js.JSExn {
+ public static String fileDialog(String suggestedFileName, boolean write) throws org.ibex.js.JSExn {
return platform._fileDialog(suggestedFileName, write);
}
/** opens a new browser window */
public static void newBrowserWindow(String url) {
if (!(url.startsWith("https://") || url.startsWith("http://") || url.startsWith("ftp://") || url.startsWith("mailto:"))) {
- Log.info(Platform.class, "xwt.newBrowserWindow() only supports http and https urls");
+ Log.info(Platform.class, "ibex.newBrowserWindow() only supports http and https urls");
return;
}
// check the URL for well-formedness, as a defense against buffer overflow attacks
}
/** detects proxy settings */
- protected synchronized org.xwt.HTTP.Proxy _detectProxy() { return null; }
- public static synchronized org.xwt.HTTP.Proxy detectProxy() {
+ protected synchronized org.ibex.HTTP.Proxy _detectProxy() { return null; }
+ public static synchronized org.ibex.HTTP.Proxy detectProxy() {
if (cachedProxyInfo != null) return cachedProxyInfo;
if (alreadyDetectedProxy) return null;
alreadyDetectedProxy = true;
Log.info(Platform.class, "attempting environment-variable DNS proxy detection");
- cachedProxyInfo = org.xwt.HTTP.Proxy.detectProxyViaManual();
+ cachedProxyInfo = org.ibex.HTTP.Proxy.detectProxyViaManual();
if (cachedProxyInfo != null) return cachedProxyInfo;
Log.info(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection");
// FEATURE: be more efficient for many of the subclasses
public static class DefaultGlyph extends Font.Glyph {
private Picture p = null;
- public DefaultGlyph(org.xwt.Font f, char c) { super(f, c); }
+ public DefaultGlyph(org.ibex.Font f, char c) { super(f, c); }
public Picture getPicture() {
if (p == null && isLoaded) {
Picture p = createPicture(null);
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.net.*;
import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.bouncycastle.util.encoders.Base64;
/**
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
-import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
/** Implements cooperative multitasking */
public class Scheduler {
- // Public API Exposed to org.xwt /////////////////////////////////////////////////
+ // Public API Exposed to org.ibex /////////////////////////////////////////////////
private static Scheduler singleton;
public static interface Task { public abstract void perform() throws Exception; }
}
renderAll();
} catch (JSExn e) {
- Log.info(Scheduler.class, "a JavaScript thread spawned with xwt.thread() threw an exception:");
+ Log.info(Scheduler.class, "a JavaScript thread spawned with ibex.thread() threw an exception:");
Log.info(Scheduler.class, "JS Exception: " + e.getObject() + "\n" + e.backtrace());
Log.info(Scheduler.class,e);
} catch (Exception e) {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.util.*;
import java.util.zip.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.xwt.translators.MSPack;
-import org.bouncycastle.util.encoders.Base64;
/**
* Essentiall an InputStream "factory". You can repeatedly ask a
HTTP(String url) { while (url.endsWith("/")) url = url.substring(0, url.length() - 1); this.url = url; }
public Object get(Object key) throws JSExn { return new HTTP(url + "/" + (String)key); }
public String getCacheKey(Vec path) throws NotCacheableException { return url; }
- public InputStream getInputStream() throws IOException { return new org.xwt.HTTP(url).GET(); }
+ public InputStream getInputStream() throws IOException { return new org.ibex.HTTP(url).GET(); }
}
/** byte arrays */
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
-import org.bouncycastle.util.encoders.Base64;
-import org.xwt.js.*;
-import org.xwt.util.*;
-import java.io.*;
-import java.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
/**
- * A Surface, as described in the XWT Reference.
+ * A Surface, as described in the Ibex Reference.
*
* Platform subclasses should include an inner class subclass of
* Surface to return from the Platform._createSurface() method
}
/**
- * Notify XWT that the mouse has moved. If the mouse leaves the
+ * Notify Ibex that the mouse has moved. If the mouse leaves the
* surface, but the host windowing system does not provide its new
* position (for example, a Java MouseListener.mouseExited()
* message), the subclass should use (-1,-1).
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.util.zip.*;
import java.util.*;
-import java.lang.*;
-import org.xwt.js.*;
-import org.xwt.translators.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
/**
* Encapsulates a template node (the <template/> element of a
- * .xwt file, or any child element thereof).
+ * .ibex file, or any child element thereof).
*
* Note that the Template instance corresponding to the
* <template/> node carries all the header information -- hence
* Template instances. We refer to these non-root instances as
* <i>anonymous templates</i>.
*
- * See the XWT reference for information on the order in which
+ * See the Ibex reference for information on the order in which
* templates are applied, attributes are put, and scripts are run.
*/
public class Template {
private StringBuffer content = null; ///< during XML parsing, this holds partially-read character data; null otherwise
private int content_start = 0; ///< line number of the first line of <tt>content</tt>
private int startLine = -1; ///< the line number that this element starts on
- private XWT xwt;
+ private Ibex ibex;
// Static data/methods ///////////////////////////////////////////////////////////////////
// for non-root nodes
- private Template(Template t, int startLine) { prev = t; this.xwt = t.xwt; this.startLine = startLine; }
- private Template(XWT xwt) { this.xwt = xwt; }
+ private Template(Template t, int startLine) { prev = t; this.ibex = t.ibex; this.startLine = startLine; }
+ private Template(Ibex ibex) { this.ibex = ibex; }
// Methods to apply templates ////////////////////////////////////////////////////////
// FIXME this dollar stuff is all wrong
if (id != null) parentPis.putDollar(id, b);
- PerInstantiationScope pis = new PerInstantiationScope(b, xwt, parentPis, staticScope);
+ PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticScope);
for(int i=0; i<urikeys.length; i++) {
pis.declare(urikeys[i]);
- pis.put(urikeys[i], xwt.resolveString(urivals[i], true));
+ pis.put(urikeys[i], ibex.resolveString(urivals[i], true));
}
// FIXME needs to obey the new application-ordering rules
if (val == null) throw new JSExn("unknown box id '"+vals[i]+"' referenced in XML attribute");
break;
case '.':
- val = xwt.resolveString(((String)val).substring(1), false);
+ val = ibex.resolveString(((String)val).substring(1), false);
// FIXME: url case
// FIXME: should we be resolving all of these in the XML-parsing code?
}
// XML Parsing /////////////////////////////////////////////////////////////////
- public static Template buildTemplate(InputStream is, XWT xwt) {
+ public static Template buildTemplate(InputStream is, Ibex ibex) {
try {
- return new TemplateHelper(is, xwt).t;
+ return new TemplateHelper(is, ibex).t;
} catch (Exception e) {
Log.error(Template.class, e);
return null;
private int state = STATE_INITIAL;
private static final int STATE_INITIAL = 0;
- private static final int STATE_IN_XWT_NODE = 1;
+ private static final int STATE_IN_Ibex_NODE = 1;
private static final int STATE_IN_TEMPLATE_NODE = 2;
private static final int STATE_IN_META_NODE = 3;
Vec nodeStack = new Vec();
Template t = null;
int meta = 0;
- XWT xwt;
+ Ibex ibex;
- public TemplateHelper(InputStream is, XWT xwt) throws XML.Exn, IOException, JSExn {
- this.xwt = xwt;
+ public TemplateHelper(InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+ this.ibex = ibex;
parse(new InputStreamReader(is));
JS staticScript = parseScript(static_content, static_content_start);
- t.staticScope = new PerInstantiationScope(null, xwt, null, null);
+ t.staticScope = new PerInstantiationScope(null, ibex, null, null);
if (staticScript != null) JS.cloneWithNewParentScope(staticScript, t.staticScope).call(null, null, null, null, 0);
}
throw new XML.Exn("root element was not <ibex>", XML.Exn.SCHEMA, getLine(), getCol());
if (c.getAttrLen() != 0)
throw new XML.Exn("root element must not have attributes", XML.Exn.SCHEMA, getLine(), getCol());
- state = STATE_IN_XWT_NODE;
+ state = STATE_IN_Ibex_NODE;
return;
- case STATE_IN_XWT_NODE:
+ case STATE_IN_Ibex_NODE:
if ("meta".equals(c.getPrefix())) { state = STATE_IN_META_NODE; meta = 0; return; }
state = STATE_IN_TEMPLATE_NODE;
- t = (t == null) ? new Template(xwt) : new Template(t, getLine());
+ t = (t == null) ? new Template(ibex) : new Template(t, getLine());
break;
case STATE_IN_TEMPLATE_NODE:
nodeStack.addElement(t);
- t = new Template(xwt);
+ t = new Template(ibex);
break;
}
String tagname = (c.getUri().equals("") ? "" : (c.getUri() + ".")) + c.getLocalName();
// GROSS hack
try {
- t.prev = (Template)t.xwt.resolveString(tagname, false).call(null, null, null, null, 9999);
+ t.prev = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
} catch (Exception e) {
Log.error(Template.class, e);
}
public void endElement(XML.Element c) throws XML.Exn, IOException {
switch(state) {
- case STATE_IN_META_NODE: if (meta-- < 0) state = STATE_IN_XWT_NODE; return;
- case STATE_IN_XWT_NODE: return;
+ case STATE_IN_META_NODE: if (meta-- < 0) state = STATE_IN_Ibex_NODE; return;
+ case STATE_IN_Ibex_NODE: return;
case STATE_IN_TEMPLATE_NODE: {
if (t.content != null) { t.script = parseScript(t.content, t.content_start); t.content = null; }
- if (nodeStack.size() == 0) { state = STATE_IN_XWT_NODE; return; }
+ if (nodeStack.size() == 0) { state = STATE_IN_Ibex_NODE; return; }
Template oldt = t;
t = (Template)nodeStack.lastElement();
nodeStack.setSize(nodeStack.size() - 1);
public void characters(char[] ch, int start, int length) throws XML.Exn {
for (int i=0; length >i; i++) if (ch[start+i] == '\t')
- Log.error(Template.class, "tabs are not allowed in XWT files ("+getLine()+":"+getCol()+")");
+ Log.error(Template.class, "tabs are not allowed in Ibex files ("+getLine()+":"+getCol()+")");
switch(state) {
case STATE_IN_TEMPLATE_NODE:
if (t.content == null) {
}
t.content.append(ch, start, length);
return;
- case STATE_IN_XWT_NODE:
+ case STATE_IN_Ibex_NODE:
if (static_content == null) {
static_content_start = getLine();
static_content = new StringBuffer();
}
private static class PerInstantiationScope extends JSScope {
- XWT xwt = null;
+ Ibex ibex = null;
PerInstantiationScope parentBoxPis = null;
JSScope myStatic = null;
void putDollar(String key, Box target) throws JSExn {
declare("$" + key);
put("$" + key, target);
}
- public PerInstantiationScope(JSScope parentScope, XWT xwt, PerInstantiationScope parentBoxPis, JSScope myStatic) {
+ public PerInstantiationScope(JSScope parentScope, Ibex ibex, PerInstantiationScope parentBoxPis, JSScope myStatic) {
super(parentScope);
this.parentBoxPis = parentBoxPis;
- this.xwt = xwt;
+ this.ibex = ibex;
this.myStatic = myStatic;
}
public Object get(Object key) throws JSExn {
if (super.has(key)) return super.get(key);
- if (key.equals("xwt")) return xwt;
- if (key.equals("")) return xwt.get("");
+ if (key.equals("ibex")) return ibex;
+ if (key.equals("")) return ibex.get("");
if (key.equals("static")) return myStatic;
return super.get(key);
}
// FIXME
// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
-import org.xwt.util.*;
+package org.ibex;
import java.util.*;
// FIXME: offer a "subpixel" mode where we pass floats to the Platform and don't do any snapping
- transform each corner of the trapezoid and then interpolate
*/
-/** XWT's fully conformant Static SVG Viewer; see SVG spec, section G.7 */
+/** Ibex's fully conformant Static SVG Viewer; see SVG spec, section G.7 */
public final class VectorGraphics {
// Private Constants ///////////////////////////////////////////////////////////////////
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
+package org.ibex;
import java.io.*;
-import java.net.*;
import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
import org.bouncycastle.util.encoders.Base64;
/**
* An XML-RPC client implemented as a JavaScript Host Object. See the
- * XWT spec for information on its behavior.
+ * Ibex spec for information on its behavior.
*
* NOTE: this client is EXTREMELY lenient in the responses it will
* accept; there are many, many invalid responses that it will
objects.setElementAt(nd, objects.size() - 1);
} catch (Exception e) {
- throw new RuntimeException("xwt.net.rpc.xml.recieve.malformedDateTag" +
+ throw new RuntimeException("ibex.net.rpc.xml.recieve.malformedDateTag" +
"the server sent a <dateTime.iso8601> tag which was malformed: " + s);
}
case "member":
<!-- Copyright 2002 Adam Megacz, see the COPYING file for licensing [LGPL] -->
-<xwt>
+<ibex>
<redirect target="self"/>
<template thickness="2" depth="up" hpad="2" vpad="2">
if (thickness > hpad) hpad = thickness;
if (thickness > vpad) vpad = thickness;
- if (depth == "up") border = "org.xwt.builtin.bevel_2_up";
- else if (depth == "down") border = "org.xwt.builtin.bevel_2_down";
- else if (depth == "flat") border = "org.xwt.builtin.bevel_2_flat";
+ if (depth == "up") border = "org.ibex.builtin.bevel_2_up";
+ else if (depth == "down") border = "org.ibex.builtin.bevel_2_down";
+ else if (depth == "flat") border = "org.ibex.builtin.bevel_2_flat";
else border = null;
}
</template>
-</xwt>
+</ibex>
<!-- Copyright 2002 Adam Megacz, see the COPYING file for licensing [LGPL] -->
-<xwt>
+<ibex>
<redirect target="self"/>
- <preapply name="org.xwt.builtin.bevel"/>
+ <preapply name="org.ibex.builtin.bevel"/>
<template hot="false">
var owned = false;
owned = true;
press = true;
- xwt.thread = function() {
- xwt.sleep(holdfrequency);
+ ibex.thread = function() {
+ ibex.sleep(holdfrequency);
while (owned) {
- if (xwt.button == 1 and mouseinside) hold = true;
- xwt.sleep(holdfrequency);
+ if (ibex.button == 1 and mouseinside) hold = true;
+ ibex.sleep(holdfrequency);
}
}
root._Release1 = function() {
</template>
-</xwt>
\ No newline at end of file
+</ibex>
<!-- Copyright 2002 NeuronForge Pty Ltd, see COPYING file for licensing [LGPL] -->
-<xwt>
+<ibex>
A single-line or multi-line edit widget. Only handles text with one font and one color, and is capable of line or word wrapping.
TRAPS:
- keep length value up to date so limit checking works.
- insert key
- <preapply name="org.xwt.builtin.edit_lib"/>
+ <preapply name="org.ibex.builtin.edit_lib"/>
<template multiline="false" disabled="false" editable="true" wrap="none" font="sansserif"
selectcolor="blue" selecttextcolor="#FFFFFF" color="#FFFFFF" orient="vertical">
var key = k.substring(k.lastIndexOf('-')+1).toLowerCase();
if (key.length == 1) {
- if (xwt.control) {
+ if (ibex.control) {
if (key == 'a') {
selectText(0, 0, content.numchildren -1, content[content.numchildren -1].fulltext.length);
arguments.cascade(null);
} else if (key == 'x') {
- xwt.clipboard = selection; deleteSelection();
+ ibex.clipboard = selection; deleteSelection();
arguments.cascade(null);
} else if (key == 'c') {
- xwt.clipboard = selection;
+ ibex.clipboard = selection;
arguments.cascade(null);
} else if (key == 'v') {
- deleteSelection(); insertText(curs.cl, curs.cx, xwt.clipboard);
+ deleteSelection(); insertText(curs.cl, curs.cx, ibex.clipboard);
textChangd = true;
arguments.cascade(null);
} else {
} else if (key == "left") {
var cl, cx;
- if (xwt.control) {
+ if (ibex.control) {
// Skip word algorithm. Ugly to look at.
cl = curs.cl; cx = curs.cx;
else { cl = curs.cl; cx = curs.cx -1; }
}
- if (xwt.shift) { updateSelectionCx(cl, cx); }
+ if (ibex.shift) { updateSelectionCx(cl, cx); }
else { clearSelection(); moveCursor(cl, cx); }
arguments.cascade(null);
} else if (key == "right") {
var cl, cx;
- if (xwt.control) {
+ if (ibex.control) {
// Skip word algorithm. Ugly to look at.
cl = curs.cl; cx = curs.cx;
else { cl = curs.cl; cx = curs.cx +1; }
}
- if (xwt.shift) { updateSelectionCx(cl, cx); }
+ if (ibex.shift) { updateSelectionCx(cl, cx); }
else { clearSelection(); moveCursor(cl, cx); }
arguments.cascade(null);
} else if (key == "down") {
var cl, cy;
- if (xwt.control) { cl = content.numchildren -1; cy = content[cl].numchildren -1; }
+ if (ibex.control) { cl = content.numchildren -1; cy = content[cl].numchildren -1; }
else { if (curs.cy == content[curs.cl].numchildren -1) { cl = curs.cl +1; cy = 0; } else { cl = curs.cl; cy = curs.cy + 1; } }
- if (xwt.shift) { updateSelection(cl, cy, curs.px); }
+ if (ibex.shift) { updateSelection(cl, cy, curs.px); }
else { var px = curs.px; clearSelection(); moveCursorToCy(cl, cy, px); }
arguments.cascade(null);
} else if (key == "up") {
var cl, cy;
- if (xwt.control) { cl = 0; cy = content[0].numchildren -1; }
+ if (ibex.control) { cl = 0; cy = content[0].numchildren -1; }
else {
if (curs.cy == 0) { if (curs.cl == 0) { cl=0; cy=0; } else { cl = curs.cl -1; cy = content[cl].numchildren -1; } }
else { cl = curs.cl; cy = curs.cy -1; }
}
- if (xwt.shift) { updateSelection(cl, cy, curs.px); }
+ if (ibex.shift) { updateSelection(cl, cy, curs.px); }
else { var px = curs.px; clearSelection(); moveCursorToCy(cl, cy, px); }
arguments.cascade(null);
} else if (key == "home") {
var cy;
- if (xwt.control) { cy = 0; }
+ if (ibex.control) { cy = 0; }
else { cy = curs.cy; }
- if (xwt.shift) { updateSelection(curs.cl, cy, 0); }
+ if (ibex.shift) { updateSelection(curs.cl, cy, 0); }
else { var cl = curs.cl; clearSelection(); moveCursorToCy(cl, cy, 0); }
arguments.cascade(null);
} else if (key == "end") {
var cy;
- if (xwt.control) { cy = content[curs.cl].numchildren -1; }
+ if (ibex.control) { cy = content[curs.cl].numchildren -1; }
else { cy = curs.cy; }
- if (xwt.shift) { updateSelection(curs.cl, cy, content[curs.cl][cy].text.length); }
+ if (ibex.shift) { updateSelection(curs.cl, cy, content[curs.cl][cy].text.length); }
else { var cl = curs.cl; clearSelection(); moveCursorToCy(cl, cy, content[cl][cy].text.length); }
arguments.cascade(null);
} else if (key == "insert") {
- xwt.println("NOT YET IMPLEMENTED: insert key"); // TODO
+ ibex.println("NOT YET IMPLEMENTED: insert key"); // TODO
arguments.cascade(null);
}
}
_blink = function(v) { invisible = (focused and !disabled) ? v : true; }
</box>
</template>
-</xwt>
+</ibex>
<!-- Copyright 2002 NeuronForge Pty Ltd, see COPYING file for licensing [LGPL] -->
-<xwt>
+<ibex>
<static>
var cursors = [];
var worddivider = [' ', '-'];
- xwt.thread = function() {
- while (true) { xwt.sleep(1000); for (var i=0; cursors.length > i; i++) { cursors[i].blink = !cursors[i].blink; } }
+ ibex.thread = function() {
+ while (true) { ibex.sleep(1000); for (var i=0; cursors.length > i; i++) { cursors[i].blink = !cursors[i].blink; } }
}
// Returns the number of characters the pixel position pos is into text t. end is the pixel with of t.
if (pxpos >= pxlen) return t.length;
// Inital guess based on average character width.
- var guessch = xwt.math.min(t.length, xwt.math.floor(pxpos / (pxlen / t.length)));
- var guesspx = xwt.textwidth(tfont, t.substring(0, guessch));
+ var guessch = ibex.math.min(t.length, ibex.math.floor(pxpos / (pxlen / t.length)));
+ var guesspx = ibex.textwidth(tfont, t.substring(0, guessch));
if (guesspx > pxpos) {
while (guesspx > pxpos) {
// Textwidth of individual character must account for font kerning.
- guesspx -= xwt.textwidth(tfont, t.substring(guessch -1, guessch +1)) - xwt.textwidth(tfont, t.charAt(guessch));
+ guesspx -= ibex.textwidth(tfont, t.substring(guessch -1, guessch +1)) - ibex.textwidth(tfont, t.charAt(guessch));
guessch--;
}
} else if (pxpos > guesspx) {
while (pxpos > guesspx) {
guessch++;
if (guessch >= t.length) break;
- guesspx += xwt.textwidth(tfont, t.substring(guessch -1, guessch+1)) - xwt.textwidth(tfont, t.charAt(guessch));
+ guesspx += ibex.textwidth(tfont, t.substring(guessch -1, guessch+1)) - ibex.textwidth(tfont, t.charAt(guessch));
}
guessch--; // Round down.
}
_wrap = function(v) {
// Used on _SizeChange if wrap needs to know.
var resize = function() {
- xwt.thread = function() {
+ ibex.thread = function() {
// TODO: Only run this change if the width is different.
for (var i = 0; content.numchildren > i; i++) { content[i].fulltext = content[i].fulltext; }
};
if (multiline and v == "line") {
content.vshrink = true;
content.hshrink = false;
- content.maxwidth = xwt.maxdim; // Must reset maxwidth after shrink = true.
+ content.maxwidth = ibex.maxdim; // Must reset maxwidth after shrink = true.
ref_fulltext = fulltext_linewrap;
_SizeChange = resize;
} else if (multiline and v == "word") {
content.vshrink = true;
content.hshrink = false;
- content.maxwidth = xwt.maxdim;
+ content.maxwidth = ibex.maxdim;
ref_fulltext = fulltext_wordwrap;
_SizeChange = resize;
_selecttextcolor = function(v) { sel1.textcolor = sel2.textcolor = v; }
_font = function(f) {
- lineheight = xwt.textheight(f);
+ lineheight = ibex.textheight(f);
if (lineheight > 0) { minheight = content.minheight = linecount * lineheight; }
for (var i=0; content.numchildren > i; i++) { content[i].font = f; }
sel1.font = sel2.font = curs.font = f;
// Limit checking.
if (limit > 0 and length + t.length > limit) {
- xwt.println("WARNING: Limit applied on inserted text.");
+ ibex.println("WARNING: Limit applied on inserted text.");
t = t.substring(0, limit - length);
}
moveCursor(cl + newT.length - 1, newT[newT.length -1].length);
} else {
- xwt.println("WARNING: Single line edit, ignoring all text after the carrige return.");
+ ibex.println("WARNING: Single line edit, ignoring all text after the carrige return.");
content[0].fulltext = content[0].fulltext.substring(0, cx) + newT[0] + content[0].fulltext.substring(cx);
moveCursor(0, cx + newT[0].length);
if (sel1.cl == cl1) {
for (var i=sel1.cy+1; cy1 >= i; i++) { content[cl1][i].selected = false; }
} else if (cl1 > sel1.cl) {
- for (var i=xwt.math.max(0, sel1.cl); cl1 >= i; i++) { content[i].selected = false; }
+ for (var i=ibex.math.max(0, sel1.cl); cl1 >= i; i++) { content[i].selected = false; }
}
if (sel2.cl == cl2) {
for (var i=sel2.cy-1; i >= cy2; i--) { content[cl2][i].selected = false; }
} else if (sel2.cl > cl2) {
- for (var i=xwt.math.max(0, sel2.cl); i >= cl2; i--) { content[i].selected = false; }
+ for (var i=ibex.math.max(0, sel2.cl); i >= cl2; i--) { content[i].selected = false; }
}
// Store point data.
// Place first select box.
sel1.y = content[cl1].y + content[cl1][cy1].y;
- sel1.x = xwt.textwidth(font, content[cl1][cy1].text.substring(0, px1));
+ sel1.x = ibex.textwidth(font, content[cl1][cy1].text.substring(0, px1));
if (cl1 == cl2 and cy1 == cy2) {
// Only the first select box is required.
// Move the cursor.
curs.cl = cl; curs.cx = cx; curs.cy = cy; curs.px = px;
curs.y = content.y + content[cl].y + (lineheight * cy);
- curs.x = content.x + xwt.textwidth(font, content[cl][cy].text.substring(0, px)) -1;
+ curs.x = content.x + ibex.textwidth(font, content[cl][cy].text.substring(0, px)) -1;
curs.blink = false;
// Speed Hack: As the cursor has values that match the names used by the focusarea variable, we
// Returns a box ready to be a full line, armed with the current fulltext trap.
var newLine = function() {
- var b = xwt.newBox();
+ var b = ibex.newBox();
b.color = color;
b.align = "topleft";
// Returns a box ready to be a soft line; one of the components of a line.
var newSoftline = function() {
- var b = xwt.newBox();
+ var b = ibex.newBox();
b._selected = function(s) {
arguments.trapee.color = s ? selectcolor : color;
if (i == arguments.trapee.numchildren) { arguments.trapee[i] = newSoftline(); }
// TODO: Switch to getpos
- var nl = static.getpos(t, cw, xwt.textwidth(font, t), font);
+ var nl = static.getpos(t, cw, ibex.textwidth(font, t), font);
arguments.trapee[i].text = t.substring(0, nl);
t = t.substring(nl);
}
for (; t.length > 0; i++) {
if (i == arguments.trapee.numchildren) { arguments.trapee[i] = newSoftline(); }
- var nl = static.getpos(t, cw, xwt.textwidth(font, t), font);
+ var nl = static.getpos(t, cw, ibex.textwidth(font, t), font);
var rl = nl;
if (t.length > nl) {
root._Move = function() {
// Update Selection.
- var linediff = xwt.math.floor((content.mousey - (content[sel.cl].y + content[sel.cl][sel.cy].y)) / lineheight);
+ var linediff = ibex.math.floor((content.mousey - (content[sel.cl].y + content[sel.cl][sel.cy].y)) / lineheight);
var cl = sel.cl;
var cy = sel.cy;
// Set selection root position.
clearSelection();
sel.cl = content.indexof(refline);
- sel.cy = xwt.math.floor(refline.mousey / lineheight);
+ sel.cy = ibex.math.floor(refline.mousey / lineheight);
if (sel.cy >= refline.numchildren) sel.cy = refline.numchildren -1;
else if (0 > sel.cy) sel.cy = 0;
content[curs.cl +1] = newLine();
content[curs.cl +1].fulltext = content[curs.cl].fulltext.substring(curs.cx);
content[curs.cl].fulltext = content[curs.cl].fulltext.substring(0, curs.cx);
- xwt.thread = function() { moveCursor(curs.cl +1, 0); }
+ ibex.thread = function() { moveCursor(curs.cl +1, 0); }
}
key_back_space = function() {
} else {
content[curs.cl].fulltext = content[curs.cl].fulltext.substring(0, curs.cx)
+ k + content[curs.cl].fulltext.substring(curs.cx);
- xwt.thread = function() { moveCursor(curs.cl, curs.cx+1); }
+ ibex.thread = function() { moveCursor(curs.cl, curs.cx+1); }
textChanged = true;
}
}
</template>
-</xwt>
+</ibex>
-<xwt>
+<ibex>
- <import name="org.xwt.builtin.*"/>
+ <import name="org.ibex.builtin.*"/>
<template thisbox="frame" minwidth="397" maxwidth="397" minheight="243" maxheight="243"
vpad="20" hpad="10" titlebar="Enter Network Password">
$cancel._click = function() { thisbox = null; }
$user._focused = function(f) {
- xwt.println("user.focused = " + f);
+ ibex.println("user.focused = " + f);
if (f) $password.focused = false;
}
$password._focused = function(f) {
- xwt.println("password.focused = " + f);
+ ibex.println("password.focused = " + f);
if (f) $user.focused = false;
}
$user._SizeChange = function() { $password.height = $user.height; }
$ok._click = function() {
- xwt.proxyAuthorization = $user.text + ":" + $password.text;
+ ibex.proxyAuthorization = $user.text + ":" + $password.text;
thisbox = null;
}
<box>
<box width="75" font="dialog8" text="Password" vshrink="true"/>
<box border="bevel_2_down" hpad="2" vpad="2">
- <edit color="white" id="password" font="org.xwt.builtin.password12" focused="false"/>
+ <edit color="white" id="password" font="org.ibex.builtin.password12" focused="false"/>
</box>
</box>
<box height="30"/>
</template>
-</xwt>
\ No newline at end of file
+</ibex>
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
/**
* Constants for the various JavaScript ByteCode operations.
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
+import org.ibex.util.*;
import java.util.*;
-import java.io.*;
/** Encapsulates a single JS interpreter (ie call stack) */
class Interpreter implements ByteCodes, Tokens {
case DUP: stack.push(stack.peek()); break;
case NEWSCOPE: scope = new JSScope(scope); break;
case OLDSCOPE: scope = scope.getParentScope(); break;
- case ASSERT: if (!JS.toBoolean(stack.pop())) throw je("xwt.assertion.failed" /*FEATURE: line number*/); break;
+ case ASSERT: if (!JS.toBoolean(stack.pop())) throw je("ibex.assertion.failed" /*FEATURE: line number*/); break;
case BITNOT: stack.push(JS.N(~JS.toLong(stack.pop()))); break;
case BANG: stack.push(JS.B(!JS.toBoolean(stack.pop()))); break;
case NEWFUNCTION: stack.push(((JSFunction)arg)._cloneWithNewParentScope(scope)); break;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
-import org.xwt.*;
+import org.ibex.util.*;
+import org.ibex.*;
import java.io.*;
import java.util.*;
/** The minimum set of functionality required for objects which are manipulated by JavaScript */
-public class JS extends org.xwt.util.BalancedTree {
+public class JS extends org.ibex.util.BalancedTree {
public static final Object METHOD = new Object();
public final JS unclone() { return _unclone(); }
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
+import org.ibex.util.*;
import java.util.*;
/** A JavaScript JSArray */
* file under either the NPL or the GPL.
*/
-package org.xwt.js;
+package org.ibex.js;
-import java.util.TimeZone;
-import java.util.Locale;
-import java.text.NumberFormat;
import java.text.DateFormat;
-import java.text.SimpleDateFormat;
/**
* This class implements the Date native object.
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
-import org.xwt.*;
-import java.io.*;
-import java.util.*;
+import org.ibex.util.*;
/** An exception which can be thrown and caught by JavaScript code */
public class JSExn extends Exception {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
-import java.util.*;
import java.io.*;
/** A JavaScript function, compiled into bytecode */
-class JSFunction extends JS implements ByteCodes, Tokens, org.xwt.Scheduler.Task {
+class JSFunction extends JS implements ByteCodes, Tokens, org.ibex.Scheduler.Task {
// Fields and Accessors ///////////////////////////////////////////////
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL ]
-package org.xwt.js;
-import org.xwt.util.*;
-import java.io.*;
-import java.util.*;
+package org.ibex.js;
/** The JavaScript Math object */
public class JSMath extends JS {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
import gnu.regexp.*;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
-
-import org.xwt.util.*;
-import java.io.*;
-import java.util.*;
+package org.ibex.js;
// FIXME: should allow parentScope to be a JS, not a JSScope
/** Implementation of a JavaScript Scope */
* Contributor(s): Roger Lawrence, Mike McCabe
*/
-package org.xwt.js;
+package org.ibex.js;
import java.io.*;
/** Lexes a stream of characters into a stream of Tokens */
in.unread();
String str = in.getString();
int result = getKeyword(str);
- if (result == RESERVED) throw new LexerException("The reserved word \"" + str + "\" is not permitted in XWT scripts");
+ if (result == RESERVED) throw new LexerException("The reserved word \"" + str + "\" is not permitted in Ibex scripts");
if (result != -1) return result;
this.string = str.intern();
return NAME;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
-import org.xwt.util.*;
+import org.ibex.util.*;
import java.io.*;
/**
exceptionVar = string;
int[] writebacks = new int[] { -1, -1, -1 };
if (peekToken() != RP) {
- // extended XWT catch block: catch(e faultCode "foo.bar.baz")
+ // extended Ibex catch block: catch(e faultCode "foo.bar.baz")
consume(NAME);
String propName = string;
b.add(parserLine, DUP);
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
+package org.ibex.js;
/** this class contains a <tt>public static final int</tt> for each valid token */
interface Tokens {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.js;
-
-import java.util.*;
-import org.xwt.util.*;
-import java.io.*;
+package org.ibex.js;
/**
* This class encapsulates a single trap placed on a given node. The
--- /dev/null
+<body>
+
+<p>
+The Ibex JavaScript Engine.
+</p>
+
+</body>
<body>
<p>
-The core XWT engine classes.
+The core Ibex engine classes.
</p>
<h3>Interfacing with other code</h3>
MessageQueue ThreadMessage
</p>
-</body>
\ No newline at end of file
+</body>
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
+package org.ibex.plat;
-import org.xwt.*;
-import org.xwt.util.*;
-import java.net.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.io.*;
-import org.xwt.js.*;
-import java.util.*;
+import org.ibex.js.*;
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.image.*;
protected void _criticalAbort(String message) {
if (Log.on) Log.info(this, message);
- final Dialog d = new Dialog(new Frame(), "XWT Cannot Continue");
+ final Dialog d = new Dialog(new Frame(), "Ibex Cannot Continue");
d.setLayout(new BorderLayout());
- TextArea ta = new TextArea("XWT cannot continue because:\n\n" + message, 10, 80);
+ TextArea ta = new TextArea("Ibex cannot continue because:\n\n" + message, 10, 80);
ta.setEditable(false);
d.add(ta, "Center");
Button b = new Button("OK");
// Inner Classes /////////////////////////////////////////////////////////////////////////////////////
- protected org.xwt.Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new AWTGlyph(f, c); }
- protected static class AWTGlyph extends org.xwt.Font.Glyph {
+ protected org.ibex.Font.Glyph _createGlyph(org.ibex.Font f, char c) { return new AWTGlyph(f, c); }
+ protected static class AWTGlyph extends org.ibex.Font.Glyph {
private Image i = null;
private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
};
*/
- public AWTGlyph(org.xwt.Font f, char c) { super(f, c); }
+ public AWTGlyph(org.ibex.Font f, char c) { super(f, c); }
Image getImage() {
if (i == null && isLoaded) {
}
/** implemented with java.awt 1.1's setXORMode() */
- public void drawGlyph(org.xwt.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
+ public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
// XOR the target region
g.setXORMode(new Color((rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff));
#include <java/lang/Object.h>
#include <java/lang/Error.h>
-#include <org/xwt/plat/Darwin.h>
-#include <org/xwt/plat/Darwin$CarbonSurface.h>
-#include <org/xwt/plat/Darwin$GLCarbonSurface.h>
-#include <org/xwt/plat/Darwin$GLCarbonPixelBuffer.h>
-#include <org/xwt/plat/Darwin$CarbonMessage.h>
-#include <org/xwt/plat/Darwin$CarbonOpenGL.h>
-#include <org/xwt/plat/Darwin$FileDialogHelper.h>
-#include <org/xwt/plat/GCJ$Retainer.h>
-#include <org/xwt/HTTP$Proxy.h>
-#include <org/xwt/util/Semaphore.h>
+#include <org/ibex/plat/Darwin.h>
+#include <org/ibex/plat/Darwin$CarbonSurface.h>
+#include <org/ibex/plat/Darwin$GLCarbonSurface.h>
+#include <org/ibex/plat/Darwin$GLCarbonPixelBuffer.h>
+#include <org/ibex/plat/Darwin$CarbonMessage.h>
+#include <org/ibex/plat/Darwin$CarbonOpenGL.h>
+#include <org/ibex/plat/Darwin$FileDialogHelper.h>
+#include <org/ibex/plat/GCJ$Retainer.h>
+#include <org/ibex/HTTP$Proxy.h>
+#include <org/ibex/util/Semaphore.h>
#include <stdlib.h>
#include <pthread.h>
#include "DarwinCarbonHeaders.h"
-#define XWT_CARBON_NO_BUNDLE_HACK
-#ifdef XWT_CARBON_NO_BUNDLE_HACK
+#define Ibex_CARBON_NO_BUNDLE_HACK
+#ifdef Ibex_CARBON_NO_BUNDLE_HACK
extern "C" {
OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn);
OSErr CPSSetFrontProcess(ProcessSerialNumber *psn);
#define InstallEventHandler WC(InstallEventHandler)
#define __CFStringMakeConstantString WC(__CFStringMakeConstantString)
-using namespace org::xwt::plat;
+using namespace org::ibex::plat;
using gnu::gcj::RawData;
-using org::xwt::util::Semaphore;
+using org::ibex::util::Semaphore;
using java::lang::Object;
-namespace org { namespace xwt { namespace plat {
+namespace org { namespace ibex { namespace plat {
#pragma mark ----- Blit Locks ------
};
// CHECKME: Is just making up your own four char codes really correct?
-const static UInt32 kEventClassCarbonMessage = 'xwta';
-const static UInt32 kEventCarbonMessage = 'xwtb';
-const static UInt32 kEventParamCarbonMessage = 'xwtc';
+const static UInt32 kEventClassCarbonMessage = 'ibexa';
+const static UInt32 kEventCarbonMessage = 'ibexb';
+const static UInt32 kEventParamCarbonMessage = 'ibexc';
static OSStatus carbonMessageEventHandler(EventHandlerCallRef handler, EventRef e, void *userData);
static EventHandlerUPP carbonMessageEventHandlerUPP;
case kEventRawKeyModifiersChanged: {
const static struct {
UInt32 mask;
- jstring xwtKey;
+ jstring ibexKey;
} modifiersTable[] = {
{ shiftKey, JvNewStringLatin1("shift") },
{ alphaLock, JvNewStringLatin1("caps_lock") },
UInt32 mask = modifiersTable[i].mask;
if(!(changedModifiers & mask)) continue;
if(newModifiers & mask)
- surface->KeyPressed(modifiersTable[i].xwtKey);
+ surface->KeyPressed(modifiersTable[i].ibexKey);
else
- surface->KeyReleased(modifiersTable[i].xwtKey);
+ surface->KeyReleased(modifiersTable[i].ibexKey);
}
return noErr;
}
case kEventMouseUp: {
EventMouseButton button;
UInt32 clickCount;
- jint xwtButton;
+ jint ibexButton;
r = WC(GetEventParameter)(e,kEventParamMouseButton,typeMouseButton,NULL,sizeof(button),NULL,&button);
checkStatus(r,"GetEventParameter");
r = WC(GetEventParameter)(e,kEventParamClickCount,typeUInt32,NULL,sizeof(clickCount),NULL,&clickCount);
checkStatus(r,"GetEventParameter");
switch(button) {
- case kEventMouseButtonPrimary: xwtButton = 1; break;
- case kEventMouseButtonSecondary: xwtButton = 2; break;
- case kEventMouseButtonTertiary: xwtButton = 3; break;
+ case kEventMouseButtonPrimary: ibexButton = 1; break;
+ case kEventMouseButtonSecondary: ibexButton = 2; break;
+ case kEventMouseButtonTertiary: ibexButton = 3; break;
default: return noErr;
}
if(eKind == kEventMouseDown) {
- surface->Press(xwtButton);
+ surface->Press(ibexButton);
} else {
- surface->Release(xwtButton);
+ surface->Release(ibexButton);
while(clickCount > 1) {
- surface->DoubleClick(xwtButton);
+ surface->DoubleClick(ibexButton);
clickCount-=2;
}
- if(clickCount) surface->Click(xwtButton);
+ if(clickCount) surface->Click(ibexButton);
}
return noErr;
}
r = WC(GetEventParameter)(e,kEventParamMouseWheelDelta,typeSInt32,NULL,sizeof(delta),NULL,&delta);
checkStatus(r,"GetEventParameter");
fprintf(stderr,"kEventMouseWheelMoved: delta: %d",delta);
- // surface->MouseWheelMoved(...) IMPROVMENT: mouse wheel support in xwt
+ // surface->MouseWheelMoved(...) IMPROVMENT: mouse wheel support in ibex
return noErr;
}
}
WC(DisposeWindow)(window);
}
-void Darwin$CarbonSurface::natSetIcon(org::xwt::Picture *_p) {
+void Darwin$CarbonSurface::natSetIcon(org::ibex::Picture *_p) {
}
void Darwin$CarbonSurface::natSetLocation() {
void Darwin::natFileDialog(Darwin$FileDialogHelper *helper,jstring suggestion_, jboolean write) {
NavDialogRef dlg;
SmartCFString suggestion = suggestion_;
- CFStringRef message = CFSTR("By selecting a file in this dialog you are giving this XWT application permission to access that file.");
+ CFStringRef message = CFSTR("By selecting a file in this dialog you are giving this Ibex application permission to access that file.");
OSStatus r;
WindowRef window = WC(FrontWindow)();
NavDialogCreationOptions options;
options.optionFlags =
(options.optionFlags|kNavAllFilesInPopup|kNavSelectAllReadableItem|kNavDontUseCustomFrame|kNavDontConfirmReplacement)
&~(kNavAllowStationery|kNavAllowMultipleFiles);
- options.clientName = CFSTR("XWT");
+ options.clientName = CFSTR("Ibex");
if(write)
options.saveFileName = suggestion;
options.message = message;
}
HTTP$Proxy *Darwin::natDetectProxy() {
- using org::xwt::HTTP$Proxy;
+ using org::ibex::HTTP$Proxy;
HTTP$Proxy *p=0;
CFStringRef string;
CFNumberRef number;
*/
/*
- using org::xwt::Proxy;
+ using org::ibex::Proxy;
AutoARP pool;
Proxy *p=0;
NSString *host;
fileDialogEventHandlerUPP = WC(NewNavEventUPP)(fileDialogEventHandler);
paintProcUPP = WC(NewWindowPaintUPP)(paintProc);
- #ifdef XWT_CARBON_NO_BUNDLE_HACK
+ #ifdef Ibex_CARBON_NO_BUNDLE_HACK
{
ProcessSerialNumber currentProcess = { 0, kCurrentProcess };
- ::fprintf(stderr,"Doing XWT_CARBON_NO_BUNDLE_HACK\n");
+ ::fprintf(stderr,"Doing Ibex_CARBON_NO_BUNDLE_HACK\n");
r = WC(GetCurrentProcess)(¤tProcess);
checkStatus(r,"GetCurrentProcess");
r = WC(CPSEnableForegroundOperation)( ¤tProcess );
Darwin$CarbonSurface::natDispose();
}
-} } } // end namepsace org::xwt::plat
+} } } // end namepsace org::ibex::plat
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
// Authors: Brian Alliet and Evan Jones
-package org.xwt.plat;
+package org.ibex.plat;
import gnu.gcj.RawData;
-import org.xwt.util.*;
-import org.xwt.js.*;
-import org.xwt.*;
-import java.util.*;
+import org.ibex.util.*;
+import org.ibex.js.*;
+import org.ibex.*;
public class Darwin extends POSIX {
private static final Class openGLClass = OpenGL.class;
protected Scheduler _getScheduler() { return new DarwinScheduler(); }
protected native void runApplicationEventLoop();
- private class DarwinScheduler extends org.xwt.Scheduler {
+ private class DarwinScheduler extends org.ibex.Scheduler {
public void run() {
new Thread() { public void run() { defaultRun(); } }.start();
runApplicationEventLoop();
else
return /*new QZCarbonPicture(data,w,h);*/ null;
}
- protected org.xwt.Font.Glyph _createGlyph(org.xwt.Font f, char c) {
+ protected org.ibex.Font.Glyph _createGlyph(org.ibex.Font f, char c) {
if(openGL != null)
return openGL._createGlyph(f, c);
else
#include <setjmp.h>
#include "jpeglib.h"
}
-#include <org/xwt/Platform.h>
-#include <org/xwt/Picture.h>
-#include <org/xwt/plat/GCJ.h>
+#include <org/ibex/Platform.h>
+#include <org/ibex/Picture.h>
+#include <org/ibex/plat/GCJ.h>
#include <java/io/InputStream.h>
#include <java/io/ByteArrayInputStream.h>
#include <java/lang/RuntimeException.h>
-#include <org/xwt/plat/GCJ.h>
-#include <org/xwt/util/Log.h>
+#include <org/ibex/plat/GCJ.h>
+#include <org/ibex/util/Log.h>
#ifdef TRUE
#undef TRUE
#endif
#define TRUE 1
-using org::xwt::util::Log;
+using org::ibex::util::Log;
// builtin.xwar /////////////////////////////////////////////////////////
extern unsigned char builtin_bytes[];
extern int builtin_length;
-java::io::InputStream* org::xwt::plat::GCJ::_getBuiltinInputStream() {
+java::io::InputStream* org::ibex::plat::GCJ::_getBuiltinInputStream() {
jbyteArray ret = JvNewByteArray(builtin_length);
memcpy(elements(ret), builtin_bytes, builtin_length);
return new java::io::ByteArrayInputStream(ret);
src->pub.bytes_in_buffer -= num_bytes;
}
-void org::xwt::plat::GCJ::_decodeJPEG(java::io::InputStream* is, org::xwt::Picture* p) {
+void org::ibex::plat::GCJ::_decodeJPEG(java::io::InputStream* is, org::ibex::Picture* p) {
struct jpeg_decompress_struct cinfo;
my_error_mgr_t jerr;
my_source_mgr_t src;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
+package org.ibex.plat;
-import org.xwt.*;
-import org.xwt.util.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.io.*;
/** common superclass for all platforms that use GCJ to compile a native binary */
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
+package org.ibex.plat;
-import org.xwt.*;
+import org.ibex.*;
/** common superclass for all platforms that run in a "real" JVM */
public abstract class JVM extends Platform {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
+package org.ibex.plat;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
-import java.awt.datatransfer.*;
import java.net.*;
-import java.io.*;
import java.util.*;
-import org.xwt.util.*;
-import org.xwt.*;
+import org.ibex.util.*;
+import org.ibex.*;
import java.lang.reflect.*;
}
/** this is done with reflection in case a new version of the plugin comes out that doesn't let us pull the sun.plugin.* trick */
- protected synchronized org.xwt.HTTP.Proxy _detectProxy() {
- return (org.xwt.HTTP.Proxy)java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
+ protected synchronized org.ibex.HTTP.Proxy _detectProxy() {
+ return (org.ibex.HTTP.Proxy)java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
public Object run() {
try {
- org.xwt.HTTP.Proxy pi = new org.xwt.HTTP.Proxy();
+ org.ibex.HTTP.Proxy pi = new org.ibex.HTTP.Proxy();
Class PluginProxyHandler = Class.forName("sun.plugin.protocol.PluginProxyHandler");
Method getDefaultProxyHandler = PluginProxyHandler.getMethod("getDefaultProxyHandler", new Class[] { });
Class ProxyHandler = Class.forName("sun.plugin.protocol.ProxyHandler");
Method getProxyInfo = ProxyHandler.getMethod("getProxyInfo", new Class[] { URL.class });
- Object proxyInfo = getProxyInfo.invoke(proxyHandler, new Object[] { new URL("http://www.xwt.org") });
+ Object proxyInfo = getProxyInfo.invoke(proxyHandler, new Object[] { new URL("http://www.ibex.org") });
Class ProxyInfo = Class.forName("sun.plugin.protocol.ProxyInfo");
#include <stdint.h>
#include "X11.cc"
-#include <org/xwt/plat/Linux.h>
+#include <org/ibex/plat/Linux.h>
// we love libgcj!
extern const char **_Jv_argv;
extern int _Jv_argc;
-void org::xwt::plat::Linux::fixEnvironment() {
+void org::ibex::plat::Linux::fixEnvironment() {
// see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html
const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL");
if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
-
-import org.xwt.*;
+package org.ibex.plat;
/** Linux with an X11 display */
public class Linux extends X11 {
// IMPROVMENT: use alpha testing? might be faster
-#include <org/xwt/plat/OpenGL.h>
-#include <org/xwt/plat/OpenGL$GLPixelBuffer.h>
-#include <org/xwt/plat/OpenGL$GLPicture.h>
-#include <org/xwt/plat/OpenGL$RectGLPicture.h>
-#include <org/xwt/plat/OpenGL$SquareGLPicture.h>
-#include <org/xwt/plat/OpenGL$MosaicGLPicture.h>
+#include <org/ibex/plat/OpenGL.h>
+#include <org/ibex/plat/OpenGL$GLPixelBuffer.h>
+#include <org/ibex/plat/OpenGL$GLPicture.h>
+#include <org/ibex/plat/OpenGL$RectGLPicture.h>
+#include <org/ibex/plat/OpenGL$SquareGLPicture.h>
+#include <org/ibex/plat/OpenGL$MosaicGLPicture.h>
#include <java/lang/Error.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
-namespace org { namespace xwt { namespace plat {
+namespace org { namespace ibex { namespace plat {
#define checkGLError() checkGLError2(__FILE__,__LINE__)
static void checkGLError2(const char *file,int line) {
checkGLError();
}
-} } } // end org::xwt::plat
+} } } // end org::ibex::plat
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
// Author: Brian Alliet
-package org.xwt.plat;
-import org.xwt.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+package org.ibex.plat;
+import org.ibex.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
abstract class OpenGL {
static final boolean pretendToBeACrappyVideoCard = false;
//System.out.println("drawString(): " + text);
}
- public void drawGlyph(org.xwt.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
- drawPicture_(((org.xwt.Platform.DefaultGlyph)source).getPicture(), dx, dy, cx1, cy1, cx2, cy2, rgb);
+ public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
+ drawPicture_(((org.ibex.Platform.DefaultGlyph)source).getPicture(), dx, dy, cx1, cy1, cx2, cy2, rgb);
}
public void drawPicture(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2) {
drawPicture_(source, dx, dy, cx1, cy1, cx2, cy2, 0xffffffff);
GLPicture realPicture = null;
}
- public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new org.xwt.Platform.DefaultGlyph(f, c); }
+ public Font.Glyph _createGlyph(org.ibex.Font f, char c) { return new org.ibex.Platform.DefaultGlyph(f, c); }
private native void natDeleteTexture(int tex);
public void deleteTexture(final int tex) {
// FIXME: we don't need all these
#include <java/lang/String.h>
-#include <org/xwt/Surface.h>
-#include <org/xwt/Picture.h>
-#include <org/xwt/js/JS.h>
-#include <org/xwt/Box.h>
-#include <org/xwt/util/Semaphore.h>
-#include <org/xwt/Platform.h>
+#include <org/ibex/Surface.h>
+#include <org/ibex/Picture.h>
+#include <org/ibex/js/JS.h>
+#include <org/ibex/Box.h>
+#include <org/ibex/util/Semaphore.h>
+#include <org/ibex/Platform.h>
#include <java/lang/Long.h>
#include <java/util/Hashtable.h>
-#include <org/xwt/util/Log.h>
-#include <org/xwt/plat/POSIX.h>
+#include <org/ibex/util/Log.h>
+#include <org/ibex/plat/POSIX.h>
#include <java/lang/System.h>
#include <java/io/PrintStream.h>
-jstring org::xwt::plat::POSIX::_getEnv(jstring key) {
+jstring org::ibex::plat::POSIX::_getEnv(jstring key) {
int len = JvGetStringUTFLength(key);
char buf[len + 1];
JvGetStringUTFRegion(key, 0, len, buf);
return envstr == NULL ? NULL : JvNewStringLatin1(envstr);
}
-void org::xwt::plat::POSIX::spawnChildProcess(JArray<jstring>* cmd) {
+void org::ibex::plat::POSIX::spawnChildProcess(JArray<jstring>* cmd) {
jstring* cmdstrings = elements(cmd);
char* cmd2[cmd->length + 1];
cmd2[cmd->length] = NULL;
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
-package org.xwt.plat;
+package org.ibex.plat;
import gnu.gcj.RawData;
-import java.net.*;
-import java.lang.reflect.*;
-import java.io.*;
import java.util.*;
-import org.xwt.util.*;
-import org.xwt.*;
/** Platform implementation for POSIX compliant operating systems */
public class POSIX extends GCJ {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
-import org.xwt.*;
+package org.ibex.plat;
+import org.ibex.*;
import java.io.*;
/** Platform class for PalmOS devices */
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt.plat;
-
-import org.xwt.*;
+package org.ibex.plat;
/** Solaris with an X11 display */
public class Solaris extends X11 {
#define INT32 WIN32_INT32
// this has to precede the others so we don't get collisions on min/max
-#include <org/xwt/js/JS.h>
-#include <org/xwt/Box.h>
+#include <org/ibex/js/JS.h>
+#include <org/ibex/Box.h>
#include <stdint.h>
#include <stdlib.h>
#include <java/lang/Integer.h>
#include <java/util/Hashtable.h>
-#include <org/xwt/Box.h>
-#include <org/xwt/Surface.h>
-#include <org/xwt/PixelBuffer.h>
-#include <org/xwt/Picture.h>
-#include <org/xwt/Platform.h>
-#include <org/xwt/plat/Win32.h>
-#include <org/xwt/plat/Win32$Win32Surface.h>
-#include <org/xwt/plat/Win32$Win32PixelBuffer.h>
-#include <org/xwt/plat/Win32$Win32Picture.h>
-#include <org/xwt/util/Log.h>
-#include <org/xwt/util/Semaphore.h>
+#include <org/ibex/Box.h>
+#include <org/ibex/Surface.h>
+#include <org/ibex/PixelBuffer.h>
+#include <org/ibex/Picture.h>
+#include <org/ibex/Platform.h>
+#include <org/ibex/plat/Win32.h>
+#include <org/ibex/plat/Win32$Win32Surface.h>
+#include <org/ibex/plat/Win32$Win32PixelBuffer.h>
+#include <org/ibex/plat/Win32$Win32Picture.h>
+#include <org/ibex/util/Log.h>
+#include <org/ibex/util/Semaphore.h>
// for debugging
#include <java/lang/System.h>
// Callbacks ////////////////////////////////////////////////////////////////////
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
- org::xwt::plat::Win32$Win32Surface* surface =
- (org::xwt::plat::Win32$Win32Surface*)org::xwt::plat::Win32::hwndToWin32SurfaceMap->get(new java::lang::Integer((jint)hwnd));
+ org::ibex::plat::Win32$Win32Surface* surface =
+ (org::ibex::plat::Win32$Win32Surface*)org::ibex::plat::Win32::hwndToWin32SurfaceMap->get(new java::lang::Integer((jint)hwnd));
if (surface != NULL) {
return (LRESULT)surface->WndProc((jint)hwnd, (jint)iMsg, (jint)wParam, (jint)lParam);
static int window_class_counter = 0;
-jstring org::xwt::plat::Win32::getTempPath() {
+jstring org::ibex::plat::Win32::getTempPath() {
char buf[1024];
DWORD ret = GetTempPath(1024, buf);
if (ret == 0) criticalAbort(JvNewStringLatin1("GetTempPath() failed"));
0xFF, 0xFF, 0xFF, 0xFF
};
-void org::xwt::plat::Win32::natPreInit() {
- if (org::xwt::util::Log::verbose) {
+void org::ibex::plat::Win32::natPreInit() {
+ if (org::ibex::util::Log::verbose) {
AllocConsole();
freopen("CONOUT$", "w+t", stderr);
}
}
-void org::xwt::plat::Win32::natInit() {
+void org::ibex::plat::Win32::natInit() {
// grab desktop dc/handle
desktop_handle = (jint)GetDesktopWindow();
desktop_dc = (jint)GetDC((HWND)desktop_handle);
// create cursors
- org::xwt::plat::Win32::wait_cursor = (jint)LoadCursor(NULL, IDC_WAIT);
- org::xwt::plat::Win32::default_cursor = (jint)LoadCursor(NULL, IDC_ARROW);
- org::xwt::plat::Win32::crosshair_cursor = (jint)LoadCursor(NULL, IDC_CROSS);
- org::xwt::plat::Win32::text_cursor = (jint)LoadCursor(NULL, IDC_IBEAM);
- org::xwt::plat::Win32::move_cursor = (jint)LoadCursor(NULL, IDC_SIZEALL);
- org::xwt::plat::Win32::sizenesw_cursor = (jint)LoadCursor(NULL, IDC_SIZENESW);
- org::xwt::plat::Win32::sizens_cursor = (jint)LoadCursor(NULL, IDC_SIZENS);
- org::xwt::plat::Win32::sizenwse_cursor = (jint)LoadCursor(NULL, IDC_SIZENWSE);
- org::xwt::plat::Win32::sizewe_cursor = (jint)LoadCursor(NULL, IDC_SIZEWE);
- org::xwt::plat::Win32::hand_cursor = (jint)CreateCursor(GetModuleHandle(NULL), 14, 1, 32, 32, hand_cursor_and, hand_cursor_xor);
+ org::ibex::plat::Win32::wait_cursor = (jint)LoadCursor(NULL, IDC_WAIT);
+ org::ibex::plat::Win32::default_cursor = (jint)LoadCursor(NULL, IDC_ARROW);
+ org::ibex::plat::Win32::crosshair_cursor = (jint)LoadCursor(NULL, IDC_CROSS);
+ org::ibex::plat::Win32::text_cursor = (jint)LoadCursor(NULL, IDC_IBEAM);
+ org::ibex::plat::Win32::move_cursor = (jint)LoadCursor(NULL, IDC_SIZEALL);
+ org::ibex::plat::Win32::sizenesw_cursor = (jint)LoadCursor(NULL, IDC_SIZENESW);
+ org::ibex::plat::Win32::sizens_cursor = (jint)LoadCursor(NULL, IDC_SIZENS);
+ org::ibex::plat::Win32::sizenwse_cursor = (jint)LoadCursor(NULL, IDC_SIZENWSE);
+ org::ibex::plat::Win32::sizewe_cursor = (jint)LoadCursor(NULL, IDC_SIZEWE);
+ org::ibex::plat::Win32::hand_cursor = (jint)CreateCursor(GetModuleHandle(NULL), 14, 1, 32, 32, hand_cursor_and, hand_cursor_xor);
messagePumpThread = (jint)GetCurrentThreadId();
messagePumpStarted->release();
while(GetMessage(&msg, (HWND)NULL, 0, 0) > 0) {
if (msg.message == WM_USER_CREATEWINDOW) {
- org::xwt::plat::Win32$Win32Surface *surface = (org::xwt::plat::Win32$Win32Surface*)msg.lParam;
+ org::ibex::plat::Win32$Win32Surface *surface = (org::ibex::plat::Win32$Win32Surface*)msg.lParam;
// we must create a unique window class name for each
// window so that minimization icons can be set independantly
char buf[255];
- sprintf(buf, "XWT_WINDOW_CLASS_%i", window_class_counter++);
+ sprintf(buf, "Ibex_WINDOW_CLASS_%i", window_class_counter++);
WNDCLASSEX wc;
wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
// Platform Methods ///////////////////////////////////////////////////////////////////
-jstring org::xwt::plat::Win32::_getEnv(jstring key) {
+jstring org::ibex::plat::Win32::_getEnv(jstring key) {
int len = JvGetStringUTFLength(key);
char buf[len + 1];
JvGetStringUTFRegion(key, 0, len, buf);
return NULL;
}
-jstring org::xwt::plat::Win32::_fileDialog(jstring suggestedFileName, jboolean write) {
+jstring org::ibex::plat::Win32::_fileDialog(jstring suggestedFileName, jboolean write) {
char buf[1024];
OPENFILENAME ofn;
return ret == 0 ? NULL : JvNewStringLatin1(buf);
}
-void org::xwt::plat::Win32::__detectProxy(JArray<jstring>* container) {
+void org::ibex::plat::Win32::__detectProxy(JArray<jstring>* container) {
HKEY hkey;
char buf[1024];
elements(container)[1] = JvNewStringLatin1(buf);
}
-jstring org::xwt::plat::Win32::_getClipBoard() {
+jstring org::ibex::plat::Win32::_getClipBoard() {
OpenClipboard((HWND)desktop_handle);
HGLOBAL hmem = GetClipboardData(CF_TEXT);
if (hmem == NULL) return NULL;
return ret;
}
-void org::xwt::plat::Win32::_setClipBoard(jstring s) {
+void org::ibex::plat::Win32::_setClipBoard(jstring s) {
OpenClipboard((HWND)desktop_handle);
HGLOBAL hmem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, JvGetStringUTFLength(s) + 1);
if (hmem == NULL) return;
CloseClipboard();
}
-void org::xwt::plat::Win32::_criticalAbort(jstring message) {
+void org::ibex::plat::Win32::_criticalAbort(jstring message) {
char buf[JvGetStringUTFLength(message) + 1];
buf[JvGetStringUTFLength(message)] = '\0';
JvGetStringUTFRegion(message, 0, JvGetStringUTFLength(message), buf);
- MessageBox (NULL, buf, "XWT Cannot Continue", MB_OK | MB_ICONSTOP | MB_TASKMODAL | MB_SETFOREGROUND);
+ MessageBox (NULL, buf, "Ibex Cannot Continue", MB_OK | MB_ICONSTOP | MB_TASKMODAL | MB_SETFOREGROUND);
java::lang::System::exit(-1);
}
-jint org::xwt::plat::Win32::_getScreenWidth() {
+jint org::ibex::plat::Win32::_getScreenWidth() {
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
return rect.right - rect.left;
}
-jint org::xwt::plat::Win32::_getScreenHeight() {
+jint org::ibex::plat::Win32::_getScreenHeight() {
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
return rect.bottom - rect.top;
}
-jboolean org::xwt::plat::Win32::_newBrowserWindow_(jstring url) {
+jboolean org::ibex::plat::Win32::_newBrowserWindow_(jstring url) {
int len = min(2048, JvGetStringUTFLength(url));
char buf[len + 1];
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
-void org::xwt::plat::Win32$Win32PixelBuffer::drawPicture(org::xwt::Picture* source0,
+void org::ibex::plat::Win32$Win32PixelBuffer::drawPicture(org::ibex::Picture* source0,
jint dx, jint dy,
jint cx1, jint cy1, jint cx2, jint cy2,
jint rgb, jboolean alphaOnly) {
- org::xwt::plat::Win32$Win32Picture* source = (org::xwt::plat::Win32$Win32Picture*)source0;
+ org::ibex::plat::Win32$Win32Picture* source = (org::ibex::plat::Win32$Win32Picture*)source0;
cx1 = max(dx, cx1);
cy1 = max(dy, cy1);
// create section DIB
scratch = CreateDIBSection(NULL, &bitmapinfo, DIB_RGB_COLORS, (void**)&scratch_bits, NULL, 0);
- scratch_dc = CreateCompatibleDC((HDC)org::xwt::plat::Win32::desktop_dc);
+ scratch_dc = CreateCompatibleDC((HDC)org::ibex::plat::Win32::desktop_dc);
SelectObject(scratch_dc, scratch);
}
}
-void org::xwt::plat::Win32$Win32PixelBuffer::fillRect(jint x, jint y, jint x2, jint y2, jint color) {
+void org::ibex::plat::Win32$Win32PixelBuffer::fillRect(jint x, jint y, jint x2, jint y2, jint color) {
jint w = x2 - x;
jint h = y2 - y;
DeleteObject(brush);
}
-void org::xwt::plat::Win32$Win32Surface::blit(org::xwt::PixelBuffer* s, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
+void org::ibex::plat::Win32$Win32Surface::blit(org::ibex::PixelBuffer* s, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
// we create the DC lazily to get around some strange race condition in WinXP
if (hdc == 0) hdc = (jint)GetDC((HWND)hwnd);
- BitBlt((HDC)hdc, dx, dy, dx2 - dx, dy2 - dy, (HDC)(((org::xwt::plat::Win32$Win32PixelBuffer*)s)->hdc), sx, sy, SRCCOPY);
+ BitBlt((HDC)hdc, dx, dy, dx2 - dx, dy2 - dy, (HDC)(((org::ibex::plat::Win32$Win32PixelBuffer*)s)->hdc), sx, sy, SRCCOPY);
}
-void org::xwt::plat::Win32$Win32PixelBuffer::natInit() {
- hbitmap = (jint)CreateCompatibleBitmap((HDC)org::xwt::plat::Win32::desktop_dc, w, h);
- hdc = (jint)CreateCompatibleDC((HDC)org::xwt::plat::Win32::desktop_dc);
+void org::ibex::plat::Win32$Win32PixelBuffer::natInit() {
+ hbitmap = (jint)CreateCompatibleBitmap((HDC)org::ibex::plat::Win32::desktop_dc, w, h);
+ hdc = (jint)CreateCompatibleDC((HDC)org::ibex::plat::Win32::desktop_dc);
SetBkMode((HDC)hdc, TRANSPARENT);
SelectObject((HDC)hdc, (HBITMAP)hbitmap);
}
-void org::xwt::plat::Win32$Win32PixelBuffer::finalize() {
+void org::ibex::plat::Win32$Win32PixelBuffer::finalize() {
DeleteObject((void*)hdc);
DeleteObject((void*)hbitmap);
}
// Win32Picture /////////////////////////////////////////////////////////////////////////
-void org::xwt::plat::Win32$Win32Picture::natInit() {
+void org::ibex::plat::Win32$Win32Picture::natInit() {
BITMAPINFO bitmapinfo;
memset(&bitmapinfo, 0, sizeof(BITMAPINFO));
bitmapinfo.bmiHeader.biBitCount = 32;
bitmapinfo.bmiHeader.biCompression = BI_RGB;
- hbitmap = (jint)CreateCompatibleBitmap((HDC)org::xwt::plat::Win32::desktop_dc, width, height);
- hdc = (jint)CreateCompatibleDC((HDC)org::xwt::plat::Win32::desktop_dc);
+ hbitmap = (jint)CreateCompatibleBitmap((HDC)org::ibex::plat::Win32::desktop_dc, width, height);
+ hdc = (jint)CreateCompatibleDC((HDC)org::ibex::plat::Win32::desktop_dc);
SelectObject((HDC)hdc, (HBITMAP)hbitmap);
uint32_t* dat = (uint32_t*)elements(data);
for(int i=0; i<data->length; i++) if ((dat[i] & 0xFF000000) == 0x00000000) dat[i] = 0x00000000;
}
// hmask = (jint)CreateBitmap(w, h, 1, 1, NULL);
- hmask = (jint)CreateCompatibleBitmap((HDC)org::xwt::plat::Win32::desktop_dc, width, height);
+ hmask = (jint)CreateCompatibleBitmap((HDC)org::ibex::plat::Win32::desktop_dc, width, height);
maskdc = (jint)CreateCompatibleDC(NULL);
SelectObject((HDC)maskdc, (HBITMAP)hmask);
StretchDIBits((HDC)maskdc, 0, 0, width, height, 0, 0, width, height, copy, &bitmapinfo, DIB_RGB_COLORS, SRCCOPY);
// Win32Surface /////////////////////////////////////////////////////////////////////////////
-void org::xwt::plat::Win32$Win32Surface::natInit(jboolean framed) {
+void org::ibex::plat::Win32$Win32Surface::natInit(jboolean framed) {
// Ask the message-handling thread to create a window for us
- PostThreadMessage((DWORD)org::xwt::plat::Win32::messagePumpThread, WM_USER + 2, (WPARAM)framed, (LPARAM)this);
+ PostThreadMessage((DWORD)org::ibex::plat::Win32::messagePumpThread, WM_USER + 2, (WPARAM)framed, (LPARAM)this);
hwndCreated->block();
// turn on incremental GC now that we have a user-visible interface
ShowWindow ((HWND)hwnd, SW_SHOWDEFAULT);
}
-void org::xwt::plat::Win32$Win32Surface::finalize() { /* DeleteObject((void*)hwnd); */ }
-void org::xwt::plat::Win32$Win32Surface::toFront() { BringWindowToTop((HWND)hwnd); }
-void org::xwt::plat::Win32$Win32Surface::toBack() { SetWindowPos((HWND)hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); }
-void org::xwt::plat::Win32$Win32Surface::_dispose() { PostMessage((HWND)hwnd, WM_USER_DISPOSE, 0, 0); }
-void org::xwt::plat::Win32$Win32Surface::setInvisible(jboolean h) { ShowWindow((HWND)hwnd, h ? SW_HIDE : SW_SHOWNORMAL); }
-void org::xwt::plat::Win32$Win32Surface::_setMinimized(jboolean m) { ShowWindow((HWND)hwnd, m ? SW_SHOWMINIMIZED : SW_SHOWNORMAL); }
-void org::xwt::plat::Win32$Win32Surface::_setMaximized(jboolean m) { ShowWindow((HWND)hwnd, m ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL); }
-void org::xwt::plat::Win32$Win32Surface::postCursorChange() { PostMessage((HWND)hwnd, WM_USER_SETCURSOR, 0, 0); }
+void org::ibex::plat::Win32$Win32Surface::finalize() { /* DeleteObject((void*)hwnd); */ }
+void org::ibex::plat::Win32$Win32Surface::toFront() { BringWindowToTop((HWND)hwnd); }
+void org::ibex::plat::Win32$Win32Surface::toBack() { SetWindowPos((HWND)hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); }
+void org::ibex::plat::Win32$Win32Surface::_dispose() { PostMessage((HWND)hwnd, WM_USER_DISPOSE, 0, 0); }
+void org::ibex::plat::Win32$Win32Surface::setInvisible(jboolean h) { ShowWindow((HWND)hwnd, h ? SW_HIDE : SW_SHOWNORMAL); }
+void org::ibex::plat::Win32$Win32Surface::_setMinimized(jboolean m) { ShowWindow((HWND)hwnd, m ? SW_SHOWMINIMIZED : SW_SHOWNORMAL); }
+void org::ibex::plat::Win32$Win32Surface::_setMaximized(jboolean m) { ShowWindow((HWND)hwnd, m ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL); }
+void org::ibex::plat::Win32$Win32Surface::postCursorChange() { PostMessage((HWND)hwnd, WM_USER_SETCURSOR, 0, 0); }
-void org::xwt::plat::Win32$Win32Surface::setLocation() {
+void org::ibex::plat::Win32$Win32Surface::setLocation() {
POINT point;
RECT rect;
point.x = 0;
SetWindowPos((HWND)hwnd, NULL, root->x - (point.x - rect.left), root->y - (point.y - rect.top), 0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
-void org::xwt::plat::Win32$Win32Surface::_setSize(jint w, jint h) {
+void org::ibex::plat::Win32$Win32Surface::_setSize(jint w, jint h) {
RECT client_rect, window_rect;
GetClientRect((HWND)hwnd, &client_rect);
GetWindowRect((HWND)hwnd, &window_rect);
SetWindowPos((HWND)hwnd, NULL, 0, 0, width, height, SWP_NOZORDER | SWP_NOMOVE);
}
-void org::xwt::plat::Win32$Win32Surface::setTitleBarText(java::lang::String* title) {
+void org::ibex::plat::Win32$Win32Surface::setTitleBarText(java::lang::String* title) {
int len = min(1024, JvGetStringUTFLength(title));
char buf[len + 1];
buf[len] = '\0';
SetWindowText((HWND)hwnd, buf);
}
-void org::xwt::plat::Win32$Win32Surface::setIcon(org::xwt::Picture* p0) {
+void org::ibex::plat::Win32$Win32Surface::setIcon(org::ibex::Picture* p0) {
- org::xwt::plat::Win32$Win32Picture* p = (org::xwt::plat::Win32$Win32Picture*)p0;
+ org::ibex::plat::Win32$Win32Picture* p = (org::ibex::plat::Win32$Win32Picture*)p0;
int icon_width = GetSystemMetrics(SM_CXSMICON);
int icon_height = GetSystemMetrics(SM_CYSMICON);
}
static jstring keyToString(WPARAM wParam);
-jint org::xwt::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _wParam, jint _lParam) {
+jint org::ibex::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _wParam, jint _lParam) {
UINT iMsg = (UINT)_iMsg;
WPARAM wParam = (WPARAM)_wParam;
mmi->ptMinTrackSize.x = ((uint32_t)root->minwidth) + addwidth;
mmi->ptMinTrackSize.y = ((uint32_t)root->minheight) + addheight;
resizable = !((root->minwidth == root->maxwidth) && (root->minheight == root->maxheight));
- mmi->ptMaxTrackSize.x = resizable ? org::xwt::plat::Win32::getScreenWidth() : mmi->ptMinTrackSize.x;
- mmi->ptMaxTrackSize.y = resizable ? org::xwt::plat::Win32::getScreenHeight() : mmi->ptMinTrackSize.y;
+ mmi->ptMaxTrackSize.x = resizable ? org::ibex::plat::Win32::getScreenWidth() : mmi->ptMinTrackSize.x;
+ mmi->ptMaxTrackSize.y = resizable ? org::ibex::plat::Win32::getScreenHeight() : mmi->ptMinTrackSize.y;
return 0;
case WM_PAINT:
PAINTSTRUCT ps;
- BeginPaint((HWND)org::xwt::plat::Win32$Win32Surface::hwnd, &ps);
+ BeginPaint((HWND)org::ibex::plat::Win32$Win32Surface::hwnd, &ps);
Dirty(ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top);
- EndPaint((HWND)org::xwt::plat::Win32$Win32Surface::hwnd, &ps);
+ EndPaint((HWND)org::ibex::plat::Win32$Win32Surface::hwnd, &ps);
return 0;
default: break;
-;; This file will be copied to bin-Win32/xwt.inf and then packed up
+;; This file will be copied to bin-Win32/ibex.inf and then packed up
;; into the .cab file for distribution
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
- xwt.dll=xwt.dll
- xwt.exe=xwt.exe
- [xwt.dll]
+ ibex.dll=ibex.dll
+ ibex.exe=ibex.exe
+ [ibex.dll]
file-win32-x86=thiscab
clsid={C60D6D23-3A7D-11d6-82F9-005056CA9250}
FileVersion=7,0,0,0
RegisterServer=yes
- [xwt.exe]
+ [ibex.exe]
file-win32-x86=thiscab
clsid={FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFE}
FileVersion=7,0,0,0
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
-package org.xwt.plat;
+package org.ibex.plat;
-import org.xwt.*;
-import org.xwt.util.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.util.*;
-import org.xwt.js.*;
-import java.io.*;
+import org.ibex.js.*;
/** Platform specific code for GCJ-compiled Win32 binaries */
public class Win32 extends GCJ {
((Win32Picture)source).init();
drawPicture(source, dx, dy, cx1, cy1, cx2, cy2, 0, false);
}
- public void drawGlyph(org.xwt.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
+ public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
Win32Picture p = ((Win32Picture)((Platform.DefaultGlyph)source).getPicture());
p.init();
drawPicture(p, dx, dy, cx1, cy1, cx2, cy2, rgb, true);
#include <X11/Xmu/StdCmap.h>
#include <java/lang/String.h>
-#include <org/xwt/Surface.h>
-#include <org/xwt/Picture.h>
-#include <org/xwt/Box.h>
-#include <org/xwt/plat/X11.h>
-#include <org/xwt/plat/X11$X11Surface.h>
-#include <org/xwt/plat/X11$X11Picture.h>
-#include <org/xwt/plat/X11$X11PixelBuffer.h>
-#include <org/xwt/util/Semaphore.h>
-#include <org/xwt/Platform.h>
+#include <org/ibex/Surface.h>
+#include <org/ibex/Picture.h>
+#include <org/ibex/Box.h>
+#include <org/ibex/plat/X11.h>
+#include <org/ibex/plat/X11$X11Surface.h>
+#include <org/ibex/plat/X11$X11Picture.h>
+#include <org/ibex/plat/X11$X11PixelBuffer.h>
+#include <org/ibex/util/Semaphore.h>
+#include <org/ibex/Platform.h>
#include <java/lang/Long.h>
#include <java/util/Hashtable.h>
-#include <org/xwt/util/Log.h>
+#include <org/ibex/util/Log.h>
#include <java/lang/System.h>
#include <java/io/PrintStream.h>
}
}
-void org::xwt::plat::X11$X11PixelBuffer::fastDrawPicture(org::xwt::Picture* s,
+void org::ibex::plat::X11$X11PixelBuffer::fastDrawPicture(org::ibex::Picture* s,
jint dx, jint dy, jint cx1, jint cy1, jint cx2, jint cy2) {
- org::xwt::plat::X11$X11Picture* source = (org::xwt::plat::X11$X11Picture*)s;
+ org::ibex::plat::X11$X11Picture* source = (org::ibex::plat::X11$X11Picture*)s;
if (source->doublebuf->stipple != NULL) {
XSetClipMask(display, (*((GC*)clipped_gc)), *((Pixmap*)source->doublebuf->stipple));
cx1 - dx, cy1 - dy, cx2 - cx1, cy2 - cy1, cx1, cy1);
}
-void org::xwt::plat::X11$X11PixelBuffer::slowDrawPicture(org::xwt::Picture* s,
+void org::ibex::plat::X11$X11PixelBuffer::slowDrawPicture(org::ibex::Picture* s,
jint dx, jint dy, jint cx1, jint cy1, jint cx2, jint cy2,
jint rgb, jboolean alphaOnly) {
- org::xwt::plat::X11$X11Picture* source = (org::xwt::plat::X11$X11Picture*)s;
+ org::ibex::plat::X11$X11Picture* source = (org::ibex::plat::X11$X11Picture*)s;
XImage* xi;
// FASTEST: shared pixmap; twiddle bits in video ram directly
(((int)*(current_pixel + 1)) << 8) |
(((int)*(current_pixel + 2))); break;
case 32: targetpixel = *((int*)current_pixel); break;
- default: org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
+ default: org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
}
targetpixel -= colormap_info->base_pixel;
break;
}
case 32: *((uint32_t*)current_pixel) = destpixel; break;
- default: org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
+ default: org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
}
}
}
}
}
-void org::xwt::plat::X11$X11PixelBuffer::finalize() {
+void org::ibex::plat::X11$X11PixelBuffer::finalize() {
if (shared_pixmap) {
XShmSegmentInfo *sinfo = (XShmSegmentInfo*)shm_segment;
XShmDetach(display, sinfo);
XFreeGC(display, *((GC*)clipped_gc));
}
-void org::xwt::plat::X11$X11PixelBuffer::natInit() {
+void org::ibex::plat::X11$X11PixelBuffer::natInit() {
if (width == 0 || height == 0) return;
shared_pixmap &= shm_supported & shm_pixmaps_supported; // refuse to use shared pixmaps if we don't have shm
XChangeGC(display, (*((GC*)clipped_gc)), GCGraphicsExposures, &vm);
}
-void org::xwt::plat::X11$X11PixelBuffer::createStipple(org::xwt::plat::X11$X11Picture* xpi) {
+void org::ibex::plat::X11$X11PixelBuffer::createStipple(org::ibex::plat::X11$X11Picture* xpi) {
stipple = (gnu::gcj::RawData*)malloc(sizeof(Pixmap));
(*((Pixmap*)stipple)) = XCreatePixmap(display, RootWindow(display, screen_num), width, height, 1);
XPutImage(display, (*((Pixmap*)stipple)), stipple_gc, &xi, 0, 0, 0, 0, width, height);
}
-void org::xwt::plat::X11$X11Surface::blit(org::xwt::PixelBuffer* db, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
- org::xwt::plat::X11$X11PixelBuffer *xdb = (org::xwt::plat::X11$X11PixelBuffer*)db;
+void org::ibex::plat::X11$X11Surface::blit(org::ibex::PixelBuffer* db, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
+ org::ibex::plat::X11$X11PixelBuffer *xdb = (org::ibex::plat::X11$X11PixelBuffer*)db;
XCopyArea(display, *((Pixmap*)xdb->pm), *((Window*)window), *((GC*)gc), sx, sy, dx2 - dx, dy2 - dy, dx, dy);
XFlush(display);
}
-void org::xwt::plat::X11$X11PixelBuffer::fillRect (jint x, jint y, jint x2, jint y2, jint argb) {
+void org::ibex::plat::X11$X11PixelBuffer::fillRect (jint x, jint y, jint x2, jint y2, jint argb) {
jint w = x2 - x;
jint h = y2 - y;
// X11Surface //////////////////////////////////////////////////////////////////////
-void org::xwt::plat::X11$X11Surface::setIcon(org::xwt::Picture* pic) {
- org::xwt::plat::X11$X11Picture* p = ((org::xwt::plat::X11$X11Picture*)pic);
- org::xwt::plat::X11$X11PixelBuffer* old_dbuf = p->doublebuf;
+void org::ibex::plat::X11$X11Surface::setIcon(org::ibex::Picture* pic) {
+ org::ibex::plat::X11$X11Picture* p = ((org::ibex::plat::X11$X11Picture*)pic);
+ org::ibex::plat::X11$X11PixelBuffer* old_dbuf = p->doublebuf;
p->buildPixelBuffer(1);
XWMHints xwmh;
memset(&xwmh, 0, sizeof(XWMHints));
p->doublebuf = old_dbuf;
}
-void org::xwt::plat::X11$X11Surface::setTitleBarText(java::lang::String* s) {
+void org::ibex::plat::X11$X11Surface::setTitleBarText(java::lang::String* s) {
int len = min(JvGetStringUTFLength(s), 1024);
char buf[len + 1];
JvGetStringUTFRegion(s, 0, len, buf);
XSetTextProperty(display, (*((Window*)window)), &tp, XA_WM_ICON_NAME);
}
-void org::xwt::plat::X11$X11Surface::setLimits(jint minw, jint minh, jint maxw, jint maxh) {
+void org::ibex::plat::X11$X11Surface::setLimits(jint minw, jint minh, jint maxw, jint maxh) {
XSizeHints hints;
hints.min_width = minw;
hints.min_height = minh;
XSetWMNormalHints(display, (*((Window*)window)), &hints);
}
-void org::xwt::plat::X11$X11Surface::_setSize (jint width, jint height) {
+void org::ibex::plat::X11$X11Surface::_setSize (jint width, jint height) {
if (width <= 0 || height <= 0) return;
XResizeWindow(display, (*((Window*)window)), width, height);
XFlush(display);
}
-void org::xwt::plat::X11$X11Surface::setLocation () { XMoveWindow(display, (*((Window*)window)), root->x, root->y); }
-void org::xwt::plat::X11$X11Surface::toFront() { XRaiseWindow(display, (*((Window*)window))); }
-void org::xwt::plat::X11$X11Surface::toBack() { XLowerWindow(display, (*((Window*)window))); }
+void org::ibex::plat::X11$X11Surface::setLocation () { XMoveWindow(display, (*((Window*)window)), root->x, root->y); }
+void org::ibex::plat::X11$X11Surface::toFront() { XRaiseWindow(display, (*((Window*)window))); }
+void org::ibex::plat::X11$X11Surface::toBack() { XLowerWindow(display, (*((Window*)window))); }
-void org::xwt::plat::X11$X11Surface::_dispose() {
+void org::ibex::plat::X11$X11Surface::_dispose() {
// without this we get phantom messages after the window is gone
- org::xwt::plat::X11::windowToSurfaceMap->remove(new java::lang::Long(*((Window*)window)));
+ org::ibex::plat::X11::windowToSurfaceMap->remove(new java::lang::Long(*((Window*)window)));
XDestroyWindow(display, (*((Window*)window)));
}
-void org::xwt::plat::X11$X11Surface::setInvisible(jboolean i) {
+void org::ibex::plat::X11$X11Surface::setInvisible(jboolean i) {
if (i) XUnmapWindow(display, (*((Window*)window)));
else XMapRaised(display, (*((Window*)window)));
XFlush(display);
}
-void org::xwt::plat::X11$X11Surface::_setMinimized(jboolean b) {
+void org::ibex::plat::X11$X11Surface::_setMinimized(jboolean b) {
if (b) XIconifyWindow(display, (*((Window*)window)), screen_num);
else XMapRaised(display, (*((Window*)window)));
XFlush(display);
}
-void org::xwt::plat::X11$X11Surface::natInit() {
+void org::ibex::plat::X11$X11Surface::natInit() {
XSetWindowAttributes xswa;
window = (gnu::gcj::RawData*)malloc(sizeof(Window));
xswa.bit_gravity = NorthWestGravity;
}
XTextProperty tp;
- tp.value = (unsigned char*)"XWT";
+ tp.value = (unsigned char*)"Ibex";
tp.nitems = 3;
tp.encoding = XA_STRING;
tp.format = 8;
XSetWMProtocols(display, (*((Window*)window)), &proto, 1);
XSelectInput(display, (*((Window*)window)), StructureNotifyMask);
- org::xwt::plat::X11::windowToSurfaceMap->put(new java::lang::Long(*((Window*)window)), this);
+ org::ibex::plat::X11::windowToSurfaceMap->put(new java::lang::Long(*((Window*)window)), this);
XEvent e;
XMapRaised(display, (*((Window*)window)));
}
-void org::xwt::plat::X11$X11Surface::dispatchEvent(gnu::gcj::RawData* ev) {
+void org::ibex::plat::X11$X11Surface::dispatchEvent(gnu::gcj::RawData* ev) {
XEvent* e = (XEvent*)ev;
if (e->type == Expose) {
northeast_cursor, northwest_cursor, south_cursor, southeast_cursor,
southwest_cursor, text_cursor, west_cursor, wait_cursor, default_cursor;
-void org::xwt::plat::X11$X11Surface::syncCursor() {
+void org::ibex::plat::X11$X11Surface::syncCursor() {
Cursor curs;
if (cursor->equals(crosshair)) curs = crosshair_cursor;
// X11 ///////////////////////////////////////////////////////////////////
-jint org::xwt::plat::X11::_getScreenWidth() { return WidthOfScreen(DefaultScreenOfDisplay(display)); }
-jint org::xwt::plat::X11::_getScreenHeight() { return HeightOfScreen(DefaultScreenOfDisplay(display)); }
+jint org::ibex::plat::X11::_getScreenWidth() { return WidthOfScreen(DefaultScreenOfDisplay(display)); }
+jint org::ibex::plat::X11::_getScreenHeight() { return HeightOfScreen(DefaultScreenOfDisplay(display)); }
static void dispatchSelectionEvent(XEvent* e) {
if (e->type == SelectionNotify) {
XSelectionEvent* xsn = (XSelectionEvent*)(e);
- if (xsn->property == None) org::xwt::plat::X11::clipboard = JvNewStringLatin1("", 0);
+ if (xsn->property == None) org::ibex::plat::X11::clipboard = JvNewStringLatin1("", 0);
else {
Atom returntype;
int returnformat;
XGetWindowProperty(display, xsn->requestor, xsn->property, 0, 4096,
True, AnyPropertyType, &returntype, &returnformat,
&numitems, &bytes_after, &ret);
- org::xwt::plat::X11::clipboard =
+ org::ibex::plat::X11::clipboard =
(returntype == None ? JvNewStringLatin1("", 0) : JvNewStringLatin1((char*)ret, strlen((char*)ret)));
}
- org::xwt::plat::X11::waiting_for_selection_event->release();
+ org::ibex::plat::X11::waiting_for_selection_event->release();
} else if (e->type == SelectionRequest) {
XSelectionRequestEvent* xsr = (XSelectionRequestEvent*)(e);
xsn.property = xsr->property;
xsn.time = xsr->time;
- int len = min(1024, JvGetStringUTFLength(org::xwt::plat::X11::clipboard));
+ int len = min(1024, JvGetStringUTFLength(org::ibex::plat::X11::clipboard));
char buf[len + 1];
- JvGetStringUTFRegion(org::xwt::plat::X11::clipboard, 0, len, buf);
+ JvGetStringUTFRegion(org::ibex::plat::X11::clipboard, 0, len, buf);
buf[len] = '\0';
XChangeProperty(display, xsr->requestor, xsr->property, xsr->target, 8, PropModeReplace, (unsigned char*)buf, len + 1);
}
}
-void org::xwt::plat::X11::eventThread() {
+void org::ibex::plat::X11::eventThread() {
XEvent e;
while(true) {
XNextEvent(display, &e);
if (e.type == SelectionNotify || e.type == SelectionRequest) {
dispatchSelectionEvent(&e);
} else {
- org::xwt::plat::X11$X11Surface* surface =
- (org::xwt::plat::X11$X11Surface*)windowToSurfaceMap->get(new java::lang::Long(((XAnyEvent*)&e)->window));
+ org::ibex::plat::X11$X11Surface* surface =
+ (org::ibex::plat::X11$X11Surface*)windowToSurfaceMap->get(new java::lang::Long(((XAnyEvent*)&e)->window));
if (surface != NULL) surface->dispatchEvent((gnu::gcj::RawData*)&e);
}
}
}
-jstring org::xwt::plat::X11::_getClipBoard() {
+jstring org::ibex::plat::X11::_getClipBoard() {
XConvertSelection(display, XA_PRIMARY, XA_STRING, XInternAtom(display, "VT_SELECTION", False), selectionWindow, CurrentTime);
XFlush(display);
- org::xwt::plat::X11::waiting_for_selection_event->block();
+ org::ibex::plat::X11::waiting_for_selection_event->block();
return clipboard;
}
-void org::xwt::plat::X11::_setClipBoard(jstring s) {
+void org::ibex::plat::X11::_setClipBoard(jstring s) {
clipboard = s;
int len = JvGetStringUTFLength(clipboard);
char buf[len + 1];
shm_supported = 0;
}
-void org::xwt::plat::X11::natInit() {
+void org::ibex::plat::X11::natInit() {
if (!XInitThreads())
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("Your X11 libraries do not support multithreaded programs"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("Your X11 libraries do not support multithreaded programs"));
char* DISPLAY = getenv("DISPLAY");
if (DISPLAY == NULL || strlen(DISPLAY) == 0) DISPLAY = ":0.0";
display = XOpenDisplay(DISPLAY);
if (display == 0)
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("Unable to connect to X11 display server"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("Unable to connect to X11 display server"));
screen_num = XDefaultScreen(display);
colorDepth = (jint)(DefaultDepth(((Display*)display), 0));
visual = DefaultVisual(display, screen_num);
char buf[255];
sprintf(buf, "X11 DISPLAY: %s", XDisplayString(display));
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
sprintf(buf, "X11 SHM: %s", shm_supported ? "enabled" : "disabled");
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
sprintf(buf, "X11 Visual: %x %x %x bits: %i visualid: %i depth: %i",
visual->red_mask, visual->green_mask, visual->blue_mask, visual->bits_per_rgb, visual->visualid, colorDepth);
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
// FIXME: don't know why (True, False) is the best solution...
if(XmuLookupStandardColormap(display, screen_num, visual->visualid, colorDepth, XA_RGB_BEST_MAP, True, False) == 0)
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: XmuLookupStandardColormap failed"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: XmuLookupStandardColormap failed"));
XStandardColormap* best_map_info = NULL;
int count;
if (XGetRGBColormaps(display, RootWindow(display, screen_num), &best_map_info, &count, XA_RGB_BEST_MAP) == 0)
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: couldn't allocate a standard colormap"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: couldn't allocate a standard colormap"));
if (!best_map_info->colormap)
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: XmuLookupStandardColomap succeded, but no colormap was found on the root window"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: XmuLookupStandardColomap succeded, but no colormap was found on the root window"));
if (best_map_info->red_max == 0)
- org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: standard colormap exists, but was improperly allocated"));
+ org::ibex::Platform::criticalAbort(JvNewStringLatin1("ERROR: standard colormap exists, but was improperly allocated"));
s_colormap = best_map_info->colormap;
colormap_info = best_map_info;
sprintf(buf, " red_max / red_mult: %x %x", colormap_info->red_max, colormap_info->red_mult);
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
sprintf(buf, " green_max / green_mult: %x %x", colormap_info->green_max, colormap_info->green_mult);
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
sprintf(buf, " blue_max / blue_mult: %x %x", colormap_info->blue_max, colormap_info->blue_mult);
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
sprintf(buf, " base_pixel: %x", colormap_info->base_pixel);
- org::xwt::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
+ org::ibex::util::Log::info(this->getClass(), JvNewStringLatin1(buf));
}
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
-package org.xwt.plat;
+package org.ibex.plat;
import gnu.gcj.RawData;
-import java.net.*;
-import java.lang.reflect.*;
-import java.io.*;
import java.util.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
-import org.xwt.*;
+import org.ibex.js.*;
+import org.ibex.util.*;
+import org.ibex.*;
/** Platform implementation for POSIX compliant operating systems with an X11 Server */
public class X11 extends POSIX {
<body>
<p>
-Each platform which XWT is ported to should have a subclass of {@link
-org.xwt.Platform} in this package as well as an ant buildfile.
+Each platform which Ibex is ported to should have a subclass of {@link
+org.ibex.Platform} in this package as well as an ant buildfile.
</p>
<p>
-The subclass of {@link org.xwt.Platform} should be named
+The subclass of {@link org.ibex.Platform} should be named
<i>plat</i>.java, where <i>plat</i> is the descriptive name for the
platform. The ant buildfile should be named <i>plat</i>.xml, and
should contain three targets:
</p>
-<ul><li> <b><tt>build</tt></b>: compiles all code required for the XWT
+<ul><li> <b><tt>build</tt></b>: compiles all code required for the Ibex
Engine and creates an executable in
- <tt>xwt/www/html/dist/</tt>. If applicable, all debugging
+ <tt>ibex/www/html/dist/</tt>. If applicable, all debugging
symbols should be left in this executable.
<li> <b><tt>run</tt></b>: runs the executable, loading the
- <tt>org.xwt.demo.main</tt> widget demo. This is useful for
+ <tt>org.ibex.demo.main</tt> widget demo. This is useful for
testing.
<li> <b><tt>dist</tt></b>: prepares any files required to
-package org.xwt.util;
+package org.ibex.util;
import java.io.*;
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
// FEATURE: private void intersection() { }
// FEATURE: private void union() { }
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.io.*;
import java.util.*;
import java.util.zip.*;
-import java.math.*;
/** Reads a CAB file structure */
public class CAB {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
-
-import java.util.*;
+package org.ibex.util;
// FIXME needs to be a weak hash
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.io.*;
// FEATURE: don't use a byte[] if we have a diskCache file
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
/** a simple interface for callbacks*/
public interface Callback {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
-
-import java.util.*;
+package org.ibex.util;
/**
* A general-purpose data structure for holding a list of rectangular
-package org.xwt.util;
+package org.ibex.util;
-import java.util.*;
-import java.io.*;
-import org.xwt.js.*;
+import org.ibex.js.*;
public abstract class Grammar extends JS {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.util.*;
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.io.*;
public class InputStreamToByteArray {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.io.*;
/** a generic interface for things that "know" their length */
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
-import org.xwt.js.*;
+package org.ibex.util;
+import org.ibex.js.*;
import java.io.*;
import java.util.*;
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
-import java.io.*;
-import java.util.*;
+package org.ibex.util;
/** packs 8-bit bytes into a String of 7-bit chars (to avoid the UTF-8 non-ASCII penalty) */
public class PackBytesIntoString {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.util.*;
import java.io.*;
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
/** A simple synchronized queue, implemented as an array */
public class Queue {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import org.bouncycastle.crypto.AsymmetricBlockCipher;
import org.bouncycastle.crypto.Digest;
import org.bouncycastle.asn1.x509.X509Extensions;
import org.bouncycastle.asn1.x509.X509Extension;
import org.bouncycastle.asn1.x509.BasicConstraints;
-import org.xwt.util.Log;
+import org.ibex.util.Log;
import java.net.*;
import java.io.*;
import java.util.*;
1.03 10-Aug-02 Fixed a vulnerability outlined at
http://online.securityfocus.com/archive/1/286290
- 1.04 12-Dec-03 Renamed to org.xwt.SSL, fixed race condition
+ 1.04 12-Dec-03 Renamed to org.ibex.SSL, fixed race condition
*/
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
/** Simple implementation of a blocking, counting semaphore. */
public class Semaphore {
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
-import java.util.*;
import java.io.*;
/**
-// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+// Copyright (C) 2003 Adam Megacz <adam@ibex.org> all rights reserved.
//
// You may modify, copy, and redistribute this code under the terms of
// the GNU Library Public License version 2.1, with the exception of
// the portion of clause 6a after the semicolon (aka the "obnoxious
// relink clause")
-package org.xwt.util;
+package org.ibex.util;
import java.io.Reader;
import java.io.IOException;
<body>
An assortment of useful utility classes.
-</body>
\ No newline at end of file
+</body>
+++ /dev/null
-<xwt>
-
- <template orient="vertical" color="white">
-
- KeyPressed += function(k) { if (k == "escape") thisbox = null; }
-
- 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.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 = .org.xwt.builtin["splash.png"];
- xwt.ui.window = thisbox;
- thisbox.width=394;
- thisbox.height=276;
- x = (xwt.ui.screen.width - width) / 2;
- y = (xwt.ui.screen.height - height) / 2;
- var origin = xwt.origin;
- if (origin.substring(0, 21) == "http://launch.xwt.org") {
- origin = origin.substring(22);
- origin = "http://" + origin.substring(origin.indexOf('/') + 1);
- }
- xwt.log.println("origin is " + origin);
- var new_rr = xwt.res.unzip(xwt.res.watch(xwt.res.url(origin), progress));
- var new_xwt = xwt.clone(new_rr);
-
- xwt.thread = function() {
- for(var i=0; 100>i; i++) {
- progress(i, 100);
- xwt.thread.yield();
- }
- new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
- thisbox = null;
- }
-xwt.log.println("leaving");
- }
-
- <box height="236" align="bottomleft" packed="false" x="20" y="0">
- <box vshrink="true">
- <box packed="false" textcolor="black" x="2" y="2" id="text1"/>
- <box packed="false" textcolor="black" x="0" y="2" id="text2"/>
- <box packed="false" textcolor="black" x="2" y="0" id="text3"/>
- <box packed="false" textcolor="black" x="0" y="0" id="text4"/>
- <box cols="2">
- <box height="1" colspan="2"/>
- <box width="1"/>
- <box textcolor="white" id="text"/>
- </box>
- </box>
- </box>
- <box packed="false" id="bar" x="20" y="236" width="354" height="20" align="left">
- <box id="innerbar" fill="blue" width="10" height="20"/>
- </box>
-
- </template>
-
-</xwt>
\ No newline at end of file
+++ /dev/null
-<body>
-
-<p>
-The XWT JavaScript Engine.
-</p>
-
-</body>
\ No newline at end of file
package org.xwt.translators;
-import org.xwt.*;
-import org.xwt.util.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.io.*;
-import java.util.zip.*;
-import java.util.*;
-import org.bouncycastle.util.encoders.Base64;
import org.xwt.mips.Runtime;
*/
package org.xwt.translators;
-import org.xwt.*;
-import org.xwt.util.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.IOException;
-import java.io.PrintWriter;
/** Converts an InputStream carrying a GIF image into an ARGB int[] */
public class GIF {
// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt.translators;
-import java.util.*;
-import java.net.*;
import java.io.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
+import org.ibex.js.*;
/*
* While entities are limited to a subset of Unicode characters ,
/**
* This class parses an InputStream containing HTML and returns it
- * as an XWT DOM tree. Each HTML Element is returned as a struct,
+ * as an Ibex DOM tree. Each HTML Element is returned as a struct,
* with the following members:
*
* Since HTML may have multiple top level elements (unlike XML),
package org.xwt.translators;
-import org.xwt.Main;
-import org.xwt.util.*;
-import org.xwt.mips.*;
+import org.ibex.util.*;
import java.io.*;
import org.xwt.mips.Runtime;
package org.xwt.translators;
-import org.xwt.*;
-import org.xwt.util.*;
+import org.ibex.*;
+import org.ibex.util.*;
import java.io.*;
-import java.util.Hashtable;
-import java.util.Vector;
import java.util.Enumeration;
import java.util.zip.*;
String align = st.nextToken();
if ("defer".equals(align)) align = st.nextToken();
if (!align.equals("none")) {
- // FIXME, need to beef up XWT's align property
+ // FIXME, need to beef up Ibex's align property
align = "";
if (align.startsWith("yMin")) align = "top";
else if (align.startsWith("yMax")) align = "bottom";
public void render(DoubleBuffer buf, int x, int y, int fillcolor, int strokecolor, float scaleFactor) {
// FEATURE: make b double-buffered for increased performance
if (b == null) {
- b = new Box(t, new org.xwt.util.Vec(), new org.xwt.util.Vec(), null, 0, 0);
+ b = new Box(t, new org.ibex.util.Vec(), new org.ibex.util.Vec(), null, 0, 0);
b.put("absolute", Boolean.TRUE);
b.prerender();
t = null;