2004/01/13 03:59:35
[org.ibex.core.git] / src / org / xwt / XWT.java
index d599f0e..2e4999a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
 package org.xwt;
 
 import java.io.*;
@@ -54,10 +54,10 @@ public final class XWT extends JS {
         case "graft": return METHOD;
         case "clone": return METHOD;
         case "regexp": return METHOD;
-        case "font": return getSub("font");
-        case "font.sansserif": return Main.builtin.get("fonts/vera/Vera.ttf");
-        case "font.monospace": return Main.builtin.get("fonts/vera/VeraMono.ttf");
-        case "font.serif": return Main.builtin.get("fonts/vera/VeraSe.ttf");
+        case "ui.font": return getSub("ui.font");
+        case "ui.font.sansserif": return Main.builtin.get("fonts/vera/Vera.ttf");
+        case "ui.font.monospace": return Main.builtin.get("fonts/vera/VeraMono.ttf");
+        case "ui.font.serif": return Main.builtin.get("fonts/vera/VeraSe.ttf");
         case "ui": return getSub("ui");
         case "ui.browser": return METHOD;
         case "ui.mouse": return getSub("ui.mouse");
@@ -92,9 +92,10 @@ public final class XWT extends JS {
         case "stream.parse.html": return METHOD;
         case "stream.parse.xml": return METHOD;
         case "stream.parse.utf8": return METHOD;
-        case "rpc": return getSub("rpc");
-        case "rpc.xml": return METHOD;
-        case "rpc.soap": return METHOD;
+        case "net": return getSub("net");
+        case "net.rpc": return getSub("net.rpc");
+        case "net.rpc.xml": return METHOD;
+        case "net.rpc.soap": return METHOD;
         case "log": return getSub("log");
         case "log.debug": return METHOD;
         case "log.info": return METHOD;
@@ -113,7 +114,11 @@ public final class XWT extends JS {
         //#switch(name)
         case "thread": Scheduler.add((JSFunction)value); return;
         case "ui.clipboard": Platform.setClipBoard((String)value); return;
-        case "ui.frame": Platform.createSurface((Box)value, true, true); return;
+        case "ui.frame":
+            Box b = (Box)value;
+            Surface s = Platform.createSurface(b,true, true);
+            if(b.get("titlebar") != null) s.setTitleBarText(JS.toString(b.get("titlebar")));
+            return;
         case "ui.window": Platform.createSurface((Box)value, false, true); return;
         case "undocumented.internal.proxyAuthorization":
             HTTP.Proxy.Authorization.authorization = value.toString();
@@ -180,12 +185,13 @@ public final class XWT extends JS {
                             }
                         }
                         return a;
+                    case "regexp": return new JSRegexp(a, b);
                     //#end
                     break;
             }
         } catch (RuntimeException e) {
             // FIXME: maybe JSExn should take a second argument, Exception
-            Log.info(this, "xwt."+name+"() threw: "+e);
+            Log.info(this, "xwt."+name+"() threw: " + e);
             throw new JSExn("invalid argument for xwt object method "+name+"()");
         }