private CarbonOpenGL openGL;
boolean jaguar; // true if we are on OS X >= 10.2
- // TEMPORARY HACKS (remove these when we ditch platform fonts)
- protected int _stringWidth(String font, String text) { return (int)Math.round(6.5 * text.length()); }
- protected int _getMaxAscent(String font) { return 10; }
- protected int _getMaxDescent(String font) { return 2; }
-
// General Methods
protected String _getAltKeyName() { return "Option"; }
protected boolean _needsAutoClick() { return false; }
protected native void _newBrowserWindow(String url);
protected native HTTP.Proxy natDetectProxy();
private native void natInit();
- protected native void _exit();
private native String natGetClipBoard();
private native void natSetClipBoard(String text);
}
- // Called by main thread after initialization, this is the event handler
- protected native void _running();
-
static void abort(String err) {
throw new Error(err);
}
private static native final boolean isJaguar();
+ // Called by main thread after initialization, this is the event handler
+ protected native void runApplicationEventLoop();
+
public void init() {
super.init();
jaguar = isJaguar();
throw new Error("No OpenGL support");
}
natInit();
+ new Thread() {
+ public void run() {
+ runApplicationEventLoop();
+ }
+ }.start();
}
private final class CarbonOpenGL extends OpenGL {
protected native void activateSharedContext();
}
- static abstract class CarbonSurface extends Surface {
+ static abstract class CarbonSurface extends Surface.DoubleBufferedSurface {
RawData rawWindowRef;
RawData rawEventHandlerUPP;
int modifiers;
public void setTitleBarText(final String s) { CarbonMessage.add(new CarbonMessage() { public void perform() { natSetTitleBarText(s); } }); }
private native void natSetSize(int w, int h);
public void setSize(final int w, final int h) { CarbonMessage.add(new CarbonMessage() { public void perform() { natSetSize(w,h); } }); }
- private native void natSetLocation(int x, int y);
- public void setLocation(final int x, final int y) { CarbonMessage.add(new CarbonMessage() { public void perform() { natSetLocation(x,y); } }); }
+ private native void natSetLocation();
+ public void setLocation() { CarbonMessage.add(new CarbonMessage() { public void perform() { natSetLocation(); } }); }
private native void natToFront();
public void toFront() { CarbonMessage.add(new CarbonMessage() { public void perform() { natToFront(); } }); }
private native void natToBack();