X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FPlatform.java;h=0963cd5898768d4b77abd5d91880857596009820;hb=0474dacf886aee03e0081e9ae64e4e4c6721f2a5;hp=dc706f552745d7e3601986db4b4ca3c1fbbfac14;hpb=0adc0a8f84391f191e793f1903bf354408bdd416;p=org.ibex.core.git diff --git a/src/org/xwt/Platform.java b/src/org/xwt/Platform.java index dc706f5..0963cd5 100644 --- a/src/org/xwt/Platform.java +++ b/src/org/xwt/Platform.java @@ -34,7 +34,7 @@ public class Platform { static boolean alreadyDetectedProxy = false; /** the result of proxy autodetection */ - static HTTP.ProxyInfo cachedProxyInfo = null; + static Proxy cachedProxyInfo = null; /** the current build */ public static String build = "unknown"; @@ -54,6 +54,7 @@ public class Platform { String vendor = System.getProperty("java.vendor", ""); String version = System.getProperty("java.version", ""); String os_name = System.getProperty("os.name", ""); + String os_version = System.getProperty("os.version", ""); String platform_class = null; //if (os_name.startsWith("Mac OS X")) platform_class = "MacOSX"; @@ -65,6 +66,10 @@ public class Platform { else if (version.startsWith("1.4")) platform_class = "Java14"; else if (!version.startsWith("1.0") && !version.startsWith("1.1")) platform_class = "Java12"; + // Disable 2d hardware acceleration on Jaguar + if (os_name.equals("Mac OS X") && os_version.equals("10.2")) + System.setProperty("com.apple.hwaccel", "false"); + if (platform_class != null) { platform = (Platform)Class.forName("org.xwt.plat." + platform_class).newInstance(); platform.init(); @@ -81,7 +86,7 @@ public class Platform { if (Log.on) Log.log(Platform.class, "XWT VM detection: vendor = " + vendor); if (Log.on) Log.log(Platform.class, " version = " + version); - if (Log.on) Log.log(Platform.class, " os = " + os_name); + if (Log.on) Log.log(Platform.class, " os = " + os_name + " [version " + os_version + "]"); if (Log.on && Main.applet != null) Log.log(Platform.class, " browser = " + Main.applet.getParameter("browser")); if (platform_class == null) { @@ -201,7 +206,7 @@ public class Platform { } /** Returns null if XWT should always use direct connection; otherwise returns a ProxyInfo object with proxy settings */ - protected synchronized HTTP.ProxyInfo _detectProxy() { return null; } + protected synchronized Proxy _detectProxy() { return null; } /** 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; } @@ -214,9 +219,13 @@ public class Platform { try { String os = System.getProperty("os.name").toLowerCase(); Process p; - if (os.indexOf("windows 9") > -1) { + if (os.indexOf("windows 9") != -1 || os.indexOf("windows me") != -1) { + // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not + if (platform.getClass().getName().endsWith("Java12")) return null; p = Runtime.getRuntime().exec("command.com /c set"); - } else if ( (os.indexOf("nt") > -1) || (os.indexOf("windows 2000") > -1) ) { + } else if (os.indexOf("windows") > -1) { + // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not + if (platform.getClass().getName().endsWith("Java12")) return null; p = Runtime.getRuntime().exec("cmd.exe /c set"); } else { p = Runtime.getRuntime().exec("env"); @@ -376,24 +385,20 @@ public class Platform { } /** detects proxy settings */ - public static synchronized HTTP.ProxyInfo detectProxy() { + public static synchronized Proxy detectProxy() { if (cachedProxyInfo != null) return cachedProxyInfo; if (alreadyDetectedProxy) return null; alreadyDetectedProxy = true; if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection"); - cachedProxyInfo = HTTP.ProxyInfo.detectProxyViaManual(); + cachedProxyInfo = Proxy.detectProxyViaManual(); if (cachedProxyInfo != null) return cachedProxyInfo; if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection"); cachedProxyInfo = platform._detectProxy(); if (cachedProxyInfo != null) return cachedProxyInfo; - if (Log.on) Log.log(Platform.class, "attempting WPAD proxy detection"); - cachedProxyInfo = HTTP.ProxyInfo.detectProxyViaWPAD(); - if (cachedProxyInfo != null) return cachedProxyInfo; - return cachedProxyInfo; }