/* */ package quicktime.qd;
/* */
/* */ import java.awt.Canvas;
/* */ import java.awt.Component;
/* */ import java.awt.Point;
/* */ import java.awt.Rectangle;
/* */ import java.awt.peer.ComponentPeer;
/* */ import quicktime.QTSession;
/* */ import quicktime.QTUnknownOSException;
/* */ import quicktime.WinJNIDrawingSurface;
/* */ import sun.awt.DrawingSurface;
/* */ import sun.awt.DrawingSurfaceInfo;
/* */
/* */ public abstract class NativeGraphics
/* */ {
/* 23 */ private static boolean apriori = QTSession.apriori();
/* */ DrawingSurfaceInfo dsi;
/* */ WinJNIDrawingSurface jnidrawingsurfaceinfo;
/* */
/* */ public static final NativeGraphics getContext(Canvas paramCanvas)
/* */ throws NativeGraphicsException, QTUnknownOSException
/* */ {
/* 33 */ return getContext(paramCanvas);
/* */ }
/* */
/* */ public static final NativeGraphics getContext(Component paramComponent)
/* */ throws NativeGraphicsException, QTUnknownOSException
/* */ {
/* 44 */ ComponentPeer localComponentPeer = paramComponent.getPeer();
/* */
/* 46 */ if (localComponentPeer == null) throw new NativeGraphicsException("AWT drawing environment is not initialised");
/* */ Object localObject;
/* 48 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/* 49 */ localObject = ((DrawingSurface)localComponentPeer).getDrawingSurfaceInfo();
/* 50 */ return new MacNativeGraphics((DrawingSurfaceInfo)localObject);
/* */ }
/* 52 */ if (QTSession.isCurrentOS(2)) {
/* 53 */ if (QTSession.getJavaVersion() >= 65540) {
/* 54 */ localObject = new WinJNIDrawingSurface(paramComponent);
/* 55 */ return new WinNativeGraphics((WinJNIDrawingSurface)localObject);
/* */ }
/* 57 */ localObject = ((DrawingSurface)localComponentPeer).getDrawingSurfaceInfo();
/* 58 */ return new WinNativeGraphics((DrawingSurfaceInfo)localObject);
/* */ }
/* */
/* 62 */ throw new QTUnknownOSException();
/* */ }
/* */
/* */ public static final NativeGraphics getContext(Object paramObject)
/* */ throws NativeGraphicsException, QTUnknownOSException
/* */ {
/* 72 */ Class localClass = paramObject.getClass();
/* 73 */ String str = localClass.getName();
/* 74 */ while (!localClass.getName().equals("java.lang.Object")) {
/* 75 */ str = localClass.getName();
/* 76 */ localClass = localClass.getSuperclass();
/* */ }
/* */
/* 79 */ if (str.equals("java.awt.Component")) {
/* 80 */ ComponentPeer localComponentPeer = ((Component)paramObject).getPeer();
/* */
/* 82 */ if (localComponentPeer == null) throw new NativeGraphicsException("AWT drawing environment is not initialised");
/* */ Object localObject;
/* 84 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/* 85 */ localObject = ((DrawingSurface)localComponentPeer).getDrawingSurfaceInfo();
/* 86 */ return new MacNativeGraphics((DrawingSurfaceInfo)localObject);
/* */ }
/* 88 */ if (QTSession.isCurrentOS(2)) {
/* 89 */ if (QTSession.getJavaVersion() >= 65540) {
/* 90 */ localObject = new WinJNIDrawingSurface((Component)paramObject);
/* 91 */ return new WinNativeGraphics((WinJNIDrawingSurface)localObject);
/* */ }
/* 93 */ localObject = ((DrawingSurface)localComponentPeer).getDrawingSurfaceInfo();
/* 94 */ return new WinNativeGraphics((DrawingSurfaceInfo)localObject);
/* */ }
/* */
/* 98 */ throw new QTUnknownOSException();
/* */ }
/* */
/* 109 */ throw new NativeGraphicsException("Unknown Native Context");
/* */ }
/* */
/* */ NativeGraphics(Object paramObject)
/* */ {
/* 131 */ this.dsi = null;
/* 132 */ this.jnidrawingsurfaceinfo = null;
/* */ }
/* */
/* */ NativeGraphics(DrawingSurfaceInfo paramDrawingSurfaceInfo) {
/* 136 */ this.dsi = paramDrawingSurfaceInfo;
/* */ }
/* */
/* */ NativeGraphics(WinJNIDrawingSurface paramWinJNIDrawingSurface) {
/* 140 */ this.jnidrawingsurfaceinfo = paramWinJNIDrawingSurface;
/* */ }
/* */
/* */ public abstract QDGraphics getGWorld()
/* */ throws NativeGraphicsException;
/* */
/* */ abstract int _getWindow()
/* */ throws NativeGraphicsException;
/* */
/* */ public final Point getLocation()
/* */ {
/* 161 */ if ((QTSession.isCurrentOS(2)) && (QTSession.getJavaVersion() >= 65540)) {
/* 162 */ return this.jnidrawingsurfaceinfo.getBounds().getLocation();
/* */ }
/* 164 */ return this.dsi.getBounds().getLocation();
/* */ }
/* */
/* */ public void lock()
/* */ {
/* 172 */ if ((QTSession.isCurrentOS(2)) && (QTSession.getJavaVersion() >= 65540))
/* 173 */ this.jnidrawingsurfaceinfo.lock();
/* */ else
/* 175 */ this.dsi.lock();
/* */ }
/* */
/* */ public void unlock()
/* */ {
/* 182 */ if ((QTSession.isCurrentOS(2)) && (QTSession.getJavaVersion() >= 65540))
/* 183 */ this.jnidrawingsurfaceinfo.unlock();
/* */ else
/* 185 */ this.dsi.unlock();
/* */ }
/* */
/* */ protected void finalize() throws Throwable {
/* 189 */ this.dsi = null;
/* 190 */ this.jnidrawingsurfaceinfo = null;
/* 191 */ super.finalize();
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.qd.NativeGraphics
* JD-Core Version: 0.6.2
*/