2003/12/29 22:29:29
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:45 +0000 (07:43 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:45 +0000 (07:43 +0000)
darcs-hash:20040130074345-2ba56-478b5a73fb0f3961023705f75edbaf58c51f98bf.gz

src/org/xwt/Font.java
src/org/xwt/HTTP.java
src/org/xwt/Main.java

index 5124a7a..deb3c07 100644 (file)
@@ -9,12 +9,12 @@ import java.io.*;
 /** encapsulates a single font (a set of Glyphs) */
 public class Font {
 
-    private Font(Res res, int pointsize) { this.res = res; this.pointsize = pointsize; }
+    private Font(Stream res, int pointsize) { this.res = res; this.pointsize = pointsize; }
 
     private static boolean glyphRenderingTaskIsScheduled = false;
 
     public final int pointsize;                 ///< the size of the font
-    public final Res res;                       ///< the resource from which this font was loaded
+    public final Stream res;                       ///< the resource from which this font was loaded
     public int max_ascent;                      ///< the maximum ascent, in pixels
     public int max_descent;                     ///< the maximum descent, in pixels
     boolean latinCharsPreloaded = false;        ///< true if a request to preload ASCII 32-127 has begun
@@ -39,7 +39,7 @@ public class Font {
     private static final Freetype freetype = new Freetype();
     static final Queue glyphsToBeRendered = new Queue(255);
     private static Cache fontCache = new Cache(100);
-    public static Font getFont(Res res, int pointsize) {
+    public static Font getFont(Stream res, int pointsize) {
         Font ret = (Font)fontCache.get(res, new Integer(pointsize));
         if (ret == null) fontCache.put(res, new Integer(pointsize), ret = new Font(res, pointsize));
         return ret;
index a3525e4..778b99d 100644 (file)
@@ -781,7 +781,7 @@ public class HTTP {
                 Scheduler.add(new Scheduler.Task() {
                         public void perform() throws Exception {
                             Box b = new Box();
-                            Template t = Template.getTemplate((Res)Main.builtin.get("org/xwt/builtin/proxy_authorization.xwt"));
+                            Template t = Template.getTemplate((Stream)Main.builtin.get("org/xwt/builtin/proxy_authorization.xwt"));
                             t.apply(b, null);
                             b.put("realm", realm);
                             b.put("proxyIP", proxyIP);
index 179ffab..23d48ce 100644 (file)
@@ -25,7 +25,7 @@ public class Main {
     public static String originHost = null;
     public static String origin = null;
     
-    public static final Res builtin = new Res.Zip(new Res.Builtin());
+    public static final Stream builtin = new Stream.Zip(new Stream.Builtin());
     public static Picture scarImage = null;
 
     public static void printUsage() {
@@ -59,7 +59,7 @@ public class Main {
         initialTemplateName = initialTemplateName.replace('.', '/');
         origin = args[startargs];
 
-        Res rr;
+        Stream rr;
         final String initialTemplate;
 
         if (origin.startsWith("http://") || origin.startsWith("https://")) {
@@ -70,19 +70,19 @@ public class Main {
             rr = builtin;
             initialTemplate = "org/xwt/builtin/splash.xwt";
         } else {
-            rr = new Res.File(origin);
-            if (!new File(origin).isDirectory()) rr = new Res.Zip(rr);
+            rr = new Stream.File(origin);
+            if (!new File(origin).isDirectory()) rr = new Stream.Zip(rr);
             initialTemplate = initialTemplateName;
         }
 
         if (Log.on) Log.info(Main.class, "loading xwar");
         final XWT xwt = new XWT(rr);
-        final Res final_rr = rr;
+        final Stream final_rr = rr;
 
         scarImage =
-            Picture.load((Res)Main.builtin.get("org/xwt/builtin/scar.png"),
+            Picture.load((Stream)Main.builtin.get("org/xwt/builtin/scar.png"),
                          new Scheduler.Task() { public void perform() throws JSExn {
-                             Template.getTemplate(((Res)final_rr.get(initialTemplate))).apply(new Box(), xwt);
+                             Template.getTemplate(((Stream)final_rr.get(initialTemplate))).apply(new Box(), xwt);
                          } });
 
         Scheduler.init();