X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FDarwin.java;h=34030caf2e0105d24e334261ed3ccfb103bfad41;hb=c6069948906645d974f46bdb96617a9a6a504636;hp=c6ec3505dd464fec3a51f6121dbf101032f6a428;hpb=032661c3770e2df9b19495ceeff402c42e17738e;p=org.ibex.core.git diff --git a/src/org/xwt/plat/Darwin.java b/src/org/xwt/plat/Darwin.java index c6ec350..34030ca 100644 --- a/src/org/xwt/plat/Darwin.java +++ b/src/org/xwt/plat/Darwin.java @@ -8,8 +8,8 @@ import org.xwt.util.*; import org.xwt.*; import java.util.*; -public class Carbon extends POSIX { - static Carbon singleton; +public class Darwin extends POSIX { + static Darwin singleton; private CarbonOpenGL openGL; boolean jaguar; // true if we are on OS X >= 10.2 @@ -22,7 +22,7 @@ public class Carbon extends POSIX { protected String _getAltKeyName() { return "Option"; } protected boolean _needsAutoClick() { return false; } protected boolean _needsAutoDoubleClick() { return false; } - protected String getDescriptiveName() { return "GCJ Carbon Binary"; } + protected String getDescriptiveName() { return "GCJ Darwin Binary"; } protected boolean _isCaseSensitive() { return false; /* Well, not always, could be UFS */ } @@ -74,9 +74,9 @@ public class Carbon extends POSIX { throw new Error(err); } - public Carbon() { - synchronized(Carbon.class) { - if(singleton != null) abort("Tried to instansiate Carbon more than once"); + public Darwin() { + synchronized(Darwin.class) { + if(singleton != null) abort("Tried to instansiate Darwin more than once"); singleton = this; } } @@ -86,9 +86,11 @@ public class Carbon extends POSIX { } private static native final boolean isJaguar(); + private static native final void linkMe(); public void init() { super.init(); + linkMe(); jaguar = isJaguar(); try { openGL = new CarbonOpenGL(); @@ -156,7 +158,7 @@ public class Carbon extends POSIX { public void toBack() { CarbonMessage.add(new CarbonMessage() { public void perform() { natToBack(); } }); } private native void natSetLimits(int minWidth, int minHeight, int maxWidth, int maxHeight); public void setLimits(final int mnw, final int mnh, final int mxw, final int mxh) { - if(Carbon.singleton.jaguar) + if(Darwin.singleton.jaguar) CarbonMessage.add(new CarbonMessage() { public void perform() { natSetLimits(mnw,mnh,mxw,mxh); } }); } private native void natSyncCursor(int n); @@ -177,7 +179,7 @@ public class Carbon extends POSIX { public void _sizeChange(int w, int h) { SizeChange(w,h); } /* Drawing stuff */ - public abstract void blit(DoubleBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2); + public abstract void blit(PixelBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2); public final void _dispose() { CarbonMessage.add(new CarbonMessage() { public void perform() { natDispose(); } }); } public native void natDispose(); @@ -194,7 +196,7 @@ public class Carbon extends POSIX { public void reshape(int w, int h) { } } - static class GLCarbonDoubleBuffer extends OpenGL.GLDoubleBuffer { + static class GLCarbonPixelBuffer extends OpenGL.GLDoubleBuffer { RawData rawCTX; RawData rawWindowRef; int textureName; @@ -209,12 +211,12 @@ public class Carbon extends POSIX { if(!gl.rectangularTextures) n = OpenGL.roundToPowerOf2(n); return Math.min(n,gl.maxAglSurfaceTexSize); } - public GLCarbonDoubleBuffer(int w, int h, final CarbonOpenGL gl) { + public GLCarbonPixelBuffer(int w, int h, final CarbonOpenGL gl) { super(fixupDimension(gl,w),fixupDimension(gl,h)); this.gl = gl; rectTexture = gl.hasRectangularTextures(); final Semaphore sem = new Semaphore(); - CarbonMessage.add(new CarbonMessage() { public void perform() { GLCarbonDoubleBuffer.this.natInit(); sem.release(); } }); + CarbonMessage.add(new CarbonMessage() { public void perform() { GLCarbonPixelBuffer.this.natInit(); sem.release(); } }); sem.block(); } public native void activateContext(); @@ -254,9 +256,9 @@ public class Carbon extends POSIX { super.setSize(w,h); } - private native void natBlit(GLCarbonDoubleBuffer db, int sx, int sy, int dx, int dy, int dx2, int dy2); - public synchronized void blit(DoubleBuffer db, int sx, int sy, int dx, int dy, int dx2, int dy2) { - natBlit((GLCarbonDoubleBuffer)db,sx,sy,dx,dy,dx2,dy2); + private native void natBlit(GLCarbonPixelBuffer db, int sx, int sy, int dx, int dy, int dx2, int dy2); + public synchronized void blit(PixelBuffer db, int sx, int sy, int dx, int dy, int dx2, int dy2) { + natBlit((GLCarbonPixelBuffer)db,sx,sy,dx,dy,dx2,dy2); } private native void natReshape(int w, int h); @@ -265,17 +267,16 @@ public class Carbon extends POSIX { public native void natDispose(); } - /*private class QZCarbonDoubleBuffer extends DoubleBuffer { + /*private class QZCarbonPixelBuffer extends DoubleBuffer { - public QZCarbonDoubleBuffer(int width, int height) { + public QZCarbonPixelBuffer(int width, int height) { } } - - private class QZCarbonSurface extends CarbonSurface { + private class QZCarbonSurface extends CarbonSurface { public QZCarbonSurface(Box root, boolean framed) { super(b,root); } - public native void blit(DoubleBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2); + public native void blit(PixelBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2); } private class QZCarbonPicture extends Picture { @@ -291,11 +292,11 @@ public class Carbon extends POSIX { } }*/ - protected DoubleBuffer _createDoubleBuffer(int w, int h, Surface owner) { + protected PixelBuffer _createDoubleBuffer(int w, int h, Surface owner) { if(openGL != null) - return new GLCarbonDoubleBuffer(w,h,openGL); + return new GLCarbonPixelBuffer(w,h,openGL); else - return /*new QZCarbonDoubleBuffer(w,h)*/ null; + return /*new QZCarbonPixelBuffer(w,h)*/ null; } protected Surface _createSurface(Box b, boolean framed) { if(openGL != null)