2003/09/19 05:26:46
[org.ibex.core.git] / src / org / xwt / Platform.java
index fcdc9d9..4426ca9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
 package org.xwt;
 
 import java.lang.reflect.*;
@@ -211,15 +211,24 @@ public class Platform {
 
     /** returns an InputStream to the builtin xwar */
     protected InputStream _getBuiltinInputStream() {
-       try {
-           return new FileInputStream("builtin.xwar");
-           /*
-           return new ByteArrayInputStream(org.bouncycastle.util.encoders.Base64.decode(org.xwt.Builtin.encoded));
-           */
-       } catch (Exception e) {
-           Log.log(this, e);
-           return null;
-       }
+        try {
+            return new FileInputStream("builtin.xwar");
+        } catch (Exception e) {
+            Log.log(this, e);
+            return null;
+        }
+        //return this.getClass().getClassLoader().getResourceAsStream("org/xwt/builtin.xwar");
+    }
+
+    /** returns an InputStream to the builtin xwar */
+    protected InputStream _getFreetypeInputStream() {
+        try {
+            return new FileInputStream("freetype.mips");
+        } catch (Exception e) {
+            Log.log(this, e);
+            return null;
+        }
+        //return this.getClass().getClassLoader().getResourceAsStream("org/xwt/freetype.mips");
     }
 
     /** returns the value of the environment variable key, or null if no such key exists */
@@ -315,6 +324,9 @@ public class Platform {
     /** returns an InputStream to the builtin xwar */
     public static InputStream getBuiltinInputStream() { return platform._getBuiltinInputStream(); }
         
+    /** returns an InputStream to the freetype mips binary */
+    public static InputStream getFreetypeInputStream() { return platform._getFreetypeInputStream(); }
+        
     /** creates and returns a picture */
     public static Picture createPicture(ImageDecoder i) { return platform._createPicture(i.getData(), i.getWidth(), i.getHeight()); }
 
@@ -380,9 +392,9 @@ public class Platform {
     /** this method invokes the platform _createSurface() method and then enforces a few post-call invariants */
     public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
         Surface ret = platform._createSurface(b, framed);
-        ret.setInvisible(b.invisible);
         b.width = b.height < Surface.scarPicture.getWidth() ? Surface.scarPicture.getWidth() : b.width;
         b.height = b.height < Surface.scarPicture.getHeight() ? Surface.scarPicture.getHeight() : b.height;
+        ret.setInvisible(false);
 
         Object titlebar = b.get("titlebar", true);
         if (titlebar != null) ret.setTitleBarText(titlebar.toString());