Directory Structure
/
+ AUTHORS - people involved in developing XWT
README - this file
COPYING - copyright information for all files in this distro
TM - trademark information for XWT
ant.jar - the Jakarta project's ANT build tool, including Sun's XML parser
netscape.jar - minimal set of classes required for compiling against Netcape's Applet interfaces
msjvm.jar - minimal set of classes required for compiling against Microsoft's Applet interfaces
- signtool - the Netscape Object Signing tool, for signing applets
- signcode.exe - the Microsoft ActiveX Signing tool, for signing ActiveX controls
- guidgen.exe - the Microsoft GUID generator, for generating OLE clsid's
- cabarc.exe - the Microsoft CAB file generator, for creating .cab archives
javasrc.jar - javasrc, a tool for generating hyperlinked, syntax-colored html from java code
src/ - all java source files and xwt sources go here
jazz/ - jazzlib, which XWT currently uses since libgcj's java.util.zip.* is broken
-
org/
bouncycastle/ - the BouncyCastle Crypto Library
- gimp/tigert/ - some icons used in XWT Mail, by Tigert Labs
mozilla/ - a copy of Rhino, the Mozilla JavaScript interpreter
-
- xwt/ - the source code for the XWT engine
- demo/ - the XWT widget sampler
- chess/ - XWT Chess
- fonts/ - some XWF fonts
- mail/ - XWT Mail
- plat/ - platform abstraction classes for XWT
- tasks/ - source code for some ANT tasks used in the XWT build process
- themes/ - some XWT themes
- util/ - some helper classes
-
- xwt/standard/ - the XWT standard library
-
-
+ xwt/builtin/ - .xwt's and .png's that are essential to bootstrapping the engine
+ xwt/plat/ - platform-specific code
______________________________________________________________________________
Build Targets
else if (name.equals("math")) return org.xwt.util.JSObject.defaultObjects.get("Math", null);
else if (name.equals("loadArchive")) return loadArchive;
else if (name.equals("prefetchImage")) return prefetchImage;
+ else if (name.equals("prefs")) return prefs;
else if (name.equals("encodeURI")) return JSObject.defaultObjects.get("encodeURI", null);
else if (name.equals("encodeURIComponent")) return JSObject.defaultObjects.get("encodeURIComponent", null);
else if (name.equals("decodeURI")) return JSObject.defaultObjects.get("decodeURI", null);
}
+ // Prefs Object //////////////////////////////////////////////////////////////////////////
+
+ static Scriptable prefsRPC = new XMLRPC("http://megacz:mypassword@localhost/RPC2", "prefs");
+
+ private static final JSObject prefs = new JSObject(false, true) {
+ public Object get(String name, Scriptable start) {
+ if (name.equals("get")) return prefsGet;
+ else if (name.equals("list")) return prefsList;
+ else if (name.equals("put")) return prefsPut;
+ else return null;
+ }
+ };
+
+ private static final JSObject.JSFunction prefsGet = new JSObject.JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length != 1 || args[0] == null) return null;
+ try {
+ return ((Function)prefsRPC.get("get", null)).call(cx, null, null, new Object[] { args[0] });
+ } catch (JavaScriptException jse) {
+ Object val = jse.getValue();
+ if (val instanceof JSObject && new Integer(1).equals(((JSObject)val).get("faultCode")))
+ return null;
+ throw jse;
+ } catch (Exception e) {
+ // FIXME
+ throw new JavaScriptException(e.toString());
+ }
+ }
+ };
+
+ private static final JSObject.JSFunction prefsPut = new JSObject.JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length < 2 || args[0] == null) return null;
+ try {
+ return ((Function)prefsRPC.get("put", null)).call(cx, null, null, new Object[] { args[0].toString(), args[1] });
+ } catch (JavaScriptException jse) {
+ Object val = jse.getValue();
+ if (val instanceof JSObject && new Integer(1).equals(((JSObject)val).get("faultCode")))
+ return null;
+ throw jse;
+ } catch (Exception e) {
+ // FIXME
+ throw new JavaScriptException(e.toString());
+ }
+ }
+ };
+
+ private static final JSObject.JSFunction prefsList = new JSObject.JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length < 2 || args[0] == null) return null;
+ try {
+ return ((Function)prefsRPC.get("list", null)).call(cx, null, null, new Object[] { args[0].toString(), args[1] });
+ } catch (JavaScriptException jse) {
+ Object val = jse.getValue();
+ if (val instanceof JSObject && new Integer(1).equals(((JSObject)val).get("faultCode")))
+ return null;
+ throw jse;
+ } catch (Exception e) {
+ // FIXME
+ throw new JavaScriptException(e.toString());
+ }
+ }
+ };
+
+ private static final JSObject.JSFunction prefsInvoke = new JSObject.JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length < 2 || args[0] == null) return null;
+ try {
+ return ((Function)prefs.get("invoke")).call(cx, null, null, new Object[] { args[0].toString(), args[1], "megacz", "mypassword" });
+ } catch (JavaScriptException jse) {
+ Object val = jse.getValue();
+ if (val instanceof JSObject && new Integer(1).equals(((JSObject)val).get("faultCode")))
+ return null;
+ throw jse;
+ } catch (Exception e) {
+ // FIXME
+ throw new JavaScriptException(e.toString());
+ }
+ }
+ };
+
+
+
// JSFunction Instances ///////////////////////////////////////////////////////////////////
private static final JSObject.JSFunction newBrowserWindow = new JSObject.JSFunction() {