-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [LGPL]
+// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
package org.xwt.plat;
import org.xwt.*;
public Win32() { }
- public void init() {
- String logfile = getTempPath() + "xwt-log.txt";
- try {
- PrintStream ps = new PrintStream(new FileOutputStream(logfile));
- System.setOut(ps);
- System.setErr(ps);
- } catch (Throwable e) {
- criticalAbort("Exception while attempting to redirect logging to " + logfile + " -- " + e);
- }
-
+ public void postInit() {
new Thread() { public void run() { natInit(); } }.start();
messagePumpStarted.block();
}
protected synchronized HTTP.Proxy _detectProxy() {
String[] container = new String[] { null, null, null };
- if (Log.on) Log.log(this, "accessing Win32 registry");
+ if (Log.on) Log.info(this, "accessing Win32 registry");
__detectProxy(container);
if (container[2] == null && container[0] == null) {
- if (Log.on) Log.log(this, "no proxy settings in the Win32 registry");
+ if (Log.on) Log.info(this, "no proxy settings in the Win32 registry");
return null;
}
- if (Log.on) Log.log(this, "PAC Script URL: " + container[2]);
- if (Log.on) Log.log(this, "Proxy Server String: " + container[0]);
- if (Log.on) Log.log(this, "Proxy Override String: " + container[1]);
+ if (Log.on) Log.info(this, "PAC Script URL: " + container[2]);
+ if (Log.on) Log.info(this, "Proxy Server String: " + container[0]);
+ if (Log.on) Log.info(this, "Proxy Override String: " + container[1]);
HTTP.Proxy ret = new HTTP.Proxy();
if (container[2] != null) {
- ret.proxyAutoConfigJSFunction = HTTP.Proxy.getProxyAutoConfigJSFunction(container[2]);
- if (ret.proxyAutoConfigJSFunction != null) return ret;
+ ret.proxyAutoConfigFunction = HTTP.Proxy.getProxyAutoConfigFunction(container[2]);
+ if (ret.proxyAutoConfigFunction != null) return ret;
}
if (container[0] == null) return null;
protected native boolean _newBrowserWindow_(String url);
protected void _newBrowserWindow(String url) {
if (!_newBrowserWindow_(url))
- if (Log.on) Log.log(this, "ShellExecuteEx() failed trying to open url " + url);
+ if (Log.on) Log.info(this, "ShellExecuteEx() failed trying to open url " + url);
}
// Win32Surface ////////////////////////////////////////////////////////////////////////////
drawPicture(source, dx, dy, cx1, cy1, cx2, cy2, 0, false);
}
public void drawGlyph(org.xwt.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
- Win32Picture p = ((Win32Picture)((DefaultGlyph)source).getPicture());
+ Win32Picture p = ((Win32Picture)((Platform.DefaultGlyph)source).getPicture());
p.init();
drawPicture(p, dx, dy, cx1, cy1, cx2, cy2, rgb, true);
}