Package quicktime.qd

Source Code of quicktime.qd.QDGraphics

/*      */ package quicktime.qd;
/*      */
/*      */ import java.security.AccessController;
/*      */ import java.security.PrivilegedAction;
/*      */ import quicktime.QTException;
/*      */ import quicktime.QTObject;
/*      */ import quicktime.QTSession;
/*      */ import quicktime.jdirect.QTNative;
/*      */ import quicktime.std.StdQTException;
/*      */ import quicktime.std.image.CSequence;
/*      */ import quicktime.std.image.DSequence;
/*      */ import quicktime.std.image.GraphicsExporter;
/*      */ import quicktime.std.image.GraphicsImporter;
/*      */ import quicktime.std.image.ImageDescription;
/*      */ import quicktime.std.movies.Movie;
/*      */ import quicktime.std.movies.MovieController;
/*      */ import quicktime.std.qtcomponents.ImageCompressionDialog;
/*      */ import quicktime.std.sg.SequenceGrabber;
/*      */ import quicktime.streaming.Presentation;
/*      */ import quicktime.streaming.Stream;
/*      */ import quicktime.util.EndianOrder;
/*      */ import quicktime.util.QTPointerRef;
/*      */ import quicktime.util.QTUtils;
/*      */ import sun.awt.DrawingSurfaceInfo;
/*      */ import sun.awt.MacDrawingSurface;
/*      */
/*      */ public final class QDGraphics extends QTPointerRef
/*      */ {
/*   42 */   private static boolean apriori = QTSession.apriori();
/*      */   public static final int kNativeSize = 108;
/*      */   public static QDGraphics scratch;
/*      */   public static QDGraphics validScratch;
/*  119 */   public static final int kDefaultPixelFormat = (QTSession.isCurrentOS(1)) || ((QTSession.isCurrentOS(4)) && (EndianOrder.isNativeBigEndian())) ? 32 : 1111970369;
/*      */
/*  122 */   private static final int[] savedPort = { 0 };
/*  123 */   private static final int[] savedDevice = { 0 };
/*      */   private static final int kFontInfoSz = 4;
/*      */
/*      */   public static QDGraphics fromGraphicsExporter(GraphicsExporter paramGraphicsExporter)
/*      */     throws StdQTException
/*      */   {
/*  140 */     int[] arrayOfInt = new int[1];
/*      */
/*  142 */     int i = GraphicsExportGetInputGWorld(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/*  143 */     StdQTException.checkError(i);
/*  144 */     return arrayOfInt[0] == 0 ? scratch : new QDGraphics(arrayOfInt[0], paramGraphicsExporter);
/*      */   }
/*      */
/*      */   public static QDGraphics getPort()
/*      */   {
/*  153 */     int[] arrayOfInt = { 0 };
/*  154 */     synchronized (QTNative.globalsLock) {
/*  155 */       GetPort(arrayOfInt);
/*      */     }
/*  157 */     return new QDGraphics(arrayOfInt[0], new Object());
/*      */   }
/*      */
/*      */   public static int getPixelSize(int paramInt)
/*      */     throws StdQTException
/*      */   {
/*  166 */     return QTGetPixelSize(paramInt);
/*      */   }
/*      */
/*      */   public static QDGraphics fromGraphicsImporter(GraphicsImporter paramGraphicsImporter)
/*      */     throws StdQTException
/*      */   {
/*  177 */     int[] arrayOfInt1 = new int[1];
/*  178 */     int[] arrayOfInt2 = new int[1];
/*      */
/*  180 */     int i = GraphicsImportGetGWorld(QTObject.ID(paramGraphicsImporter), arrayOfInt1, arrayOfInt2);
/*  181 */     StdQTException.checkError(i);
/*  182 */     return arrayOfInt1[0] == 0 ? scratch : new QDGraphics(arrayOfInt1[0], paramGraphicsImporter);
/*      */   }
/*      */
/*      */   public static QDGraphics fromMovie(Movie paramMovie)
/*      */     throws StdQTException
/*      */   {
/*  193 */     int[] arrayOfInt = new int[1];
/*      */
/*  195 */     synchronized (QTNative.globalsLock) {
/*  196 */       GetMovieGWorld(QTObject.ID(paramMovie), arrayOfInt, null);
/*  197 */       StdQTException.checkError(GetMoviesError());
/*      */
/*  199 */       return arrayOfInt[0] == 0 ? scratch : new QDGraphics(arrayOfInt[0], paramMovie);
/*      */     }
/*      */   }
/*      */
/*      */   public static QDGraphics fromPresentation(Presentation paramPresentation, Stream paramStream)
/*      */     throws StdQTException
/*      */   {
/*  213 */     int[] arrayOfInt1 = new int[1];
/*  214 */     int[] arrayOfInt2 = new int[1];
/*      */
/*  216 */     synchronized (QTNative.globalsLock) {
/*  217 */       StdQTException.checkError(QTSPresGetGWorld(QTObject.ID(paramPresentation), QTObject.ID(paramStream), arrayOfInt1, arrayOfInt2));
/*      */
/*  219 */       return arrayOfInt1[0] == 0 ? scratch : new QDGraphics(arrayOfInt1[0], paramPresentation);
/*      */     }
/*      */   }
/*      */
/*      */   public static QDGraphics fromMovieController(MovieController paramMovieController)
/*      */     throws StdQTException
/*      */   {
/*  231 */     synchronized (QTNative.globalsLock) {
/*  232 */       int i = MCGetControllerPort(QTObject.ID(paramMovieController));
/*  233 */       StdQTException.checkError(GetMoviesError());
/*  234 */       return i == 0 ? scratch : new QDGraphics(i, paramMovieController);
/*      */     }
/*      */   }
/*      */
/*      */   public static QDGraphics fromSequenceGrabber(SequenceGrabber paramSequenceGrabber)
/*      */     throws StdQTException
/*      */   {
/*  246 */     int[] arrayOfInt1 = new int[1];
/*  247 */     int[] arrayOfInt2 = new int[1];
/*  248 */     int i = SGGetGWorld(QTObject.ID(paramSequenceGrabber), arrayOfInt1, arrayOfInt2);
/*  249 */     StdQTException.checkError(i);
/*  250 */     return arrayOfInt1[0] == 0 ? scratch : new QDGraphics(arrayOfInt1[0], paramSequenceGrabber);
/*      */   }
/*      */
/*      */   public static QDGraphics fromCSequence(CSequence paramCSequence)
/*      */     throws StdQTException
/*      */   {
/*  262 */     int[] arrayOfInt = new int[1];
/*  263 */     StdQTException.checkError(GetCSequencePrevBuffer(QTObject.ID(paramCSequence), arrayOfInt));
/*  264 */     return arrayOfInt[0] == 0 ? scratch : new QDGraphics(arrayOfInt[0], paramCSequence);
/*      */   }
/*      */
/*      */   public static QDGraphics fromDSequenceImage(DSequence paramDSequence)
/*      */     throws StdQTException
/*      */   {
/*  276 */     int[] arrayOfInt = new int[1];
/*  277 */     StdQTException.checkError(GetDSequenceImageBuffer(QTObject.ID(paramDSequence), arrayOfInt));
/*  278 */     return arrayOfInt[0] == 0 ? scratch : new QDGraphics(arrayOfInt[0], paramDSequence);
/*      */   }
/*      */
/*      */   public static QDGraphics fromDSequenceScreen(DSequence paramDSequence)
/*      */     throws StdQTException
/*      */   {
/*  290 */     int[] arrayOfInt = new int[1];
/*  291 */     StdQTException.checkError(GetDSequenceScreenBuffer(QTObject.ID(paramDSequence), arrayOfInt));
/*  292 */     return arrayOfInt[0] == 0 ? scratch : new QDGraphics(arrayOfInt[0], paramDSequence);
/*      */   }
/*      */
/*      */   public static QDGraphics fromNativeGraphics(WinNativeGraphics paramWinNativeGraphics)
/*      */     throws NativeGraphicsException
/*      */   {
/*  300 */     if (paramWinNativeGraphics.hWnd == 0) throw new NativeGraphicsException("invalid HWnd");
/*  301 */     int i = GetNativeWindowPort(paramWinNativeGraphics.hWnd);
/*  302 */     if (i == 0) throw new NativeGraphicsException("invalid Port");
/*  303 */     return new QDGraphics(i, paramWinNativeGraphics);
/*      */   }
/*      */
/*      */   public static QDGraphics fromNativeGraphics(MacNativeGraphics paramMacNativeGraphics)
/*      */     throws NativeGraphicsException
/*      */   {
/*  310 */     synchronized (QTNative.globalsLock) {
/*      */       try {
/*  312 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  313 */           GetGWorld(savedPort, savedDevice);
/*  314 */         paramMacNativeGraphics.dsi.lock();
/*  315 */         int i = paramMacNativeGraphics.nd.getPort();
/*  316 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  317 */           SetGWorld(savedPort[0], savedDevice[0]);
/*  318 */         if (i == 0) throw new NativeGraphicsException("invalid Port");
/*  319 */         QDGraphics localQDGraphics = new QDGraphics(i, paramMacNativeGraphics);
/*      */
/*  321 */         paramMacNativeGraphics.dsi.unlock();
/*  322 */         return localQDGraphics;
/*      */       }
/*      */       finally
/*      */       {
/*  321 */         paramMacNativeGraphics.dsi.unlock();
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   private QDGraphics(int paramInt)
/*      */     throws QTException
/*      */   {
/*  331 */     super(paramInt, 108, null);
/*  332 */     if (isOffscreen()) LockPixels(GetGWorldPixMap(_ID()));
/*      */   }
/*      */
/*      */   private QDGraphics(int paramInt, Object paramObject)
/*      */   {
/*  340 */     super(paramInt, 108, paramObject);
/*  341 */     if (isOffscreen()) LockPixels(GetGWorldPixMap(_ID()));
/*      */   }
/*      */
/*      */   public QDGraphics(ImageCompressionDialog paramImageCompressionDialog, QDRect paramQDRect, int paramInt)
/*      */     throws QTException
/*      */   {
/*  353 */     this(allocate(paramImageCompressionDialog, paramQDRect, paramInt));
/*      */   }
/*      */
/*      */   public QDGraphics(ImageDescription paramImageDescription, int paramInt)
/*      */     throws QTException
/*      */   {
/*  365 */     this(allocate(paramImageDescription, paramInt));
/*      */   }
/*      */
/*      */   public QDGraphics(QDRect paramQDRect)
/*      */     throws QTException
/*      */   {
/*  378 */     this(kDefaultPixelFormat, paramQDRect, null, null, 4096);
/*      */   }
/*      */
/*      */   public QDGraphics(int paramInt, QDRect paramQDRect)
/*      */     throws QTException
/*      */   {
/*  392 */     this(paramInt, paramQDRect, null, null, 4096);
/*      */   }
/*      */
/*      */   public QDGraphics(int paramInt1, QDRect paramQDRect, int paramInt2)
/*      */     throws QTException
/*      */   {
/*  407 */     this(paramInt1, paramQDRect, null, null, paramInt2);
/*      */   }
/*      */
/*      */   public QDGraphics(int paramInt1, QDRect paramQDRect, ColorTable paramColorTable, GDevice paramGDevice, int paramInt2)
/*      */     throws QTException
/*      */   {
/*  426 */     this(allocate(paramInt1, paramQDRect, paramColorTable, paramGDevice, paramInt2));
/*      */   }
/*      */
/*      */   private static int allocate(int paramInt1, QDRect paramQDRect, ColorTable paramColorTable, GDevice paramGDevice, int paramInt2) throws QDException {
/*  430 */     int[] arrayOfInt = { 0 };
/*  431 */     int i = QTNewGWorld(arrayOfInt, paramInt1, paramQDRect.getRect(), QTObject.ID(paramColorTable), QTObject.ID(paramGDevice), paramInt2);
/*      */
/*  437 */     QDException.checkError(i);
/*  438 */     return arrayOfInt[0];
/*      */   }
/*      */
/*      */   private static int allocate(ImageCompressionDialog paramImageCompressionDialog, QDRect paramQDRect, int paramInt) throws QTException {
/*  442 */     int[] arrayOfInt = new int[1];
/*  443 */     StdQTException.checkError(SCNewGWorld(QTObject.ID(paramImageCompressionDialog), arrayOfInt, paramQDRect != null ? paramQDRect.getRect() : null, paramInt));
/*      */
/*  446 */     if (arrayOfInt[0] == 0) throw new StdQTException(-50);
/*  447 */     return arrayOfInt[0];
/*      */   }
/*      */
/*      */   private static int allocate(ImageDescription paramImageDescription, int paramInt) throws QTException {
/*  451 */     int[] arrayOfInt = new int[1];
/*  452 */     StdQTException.checkError(NewImageGWorld(arrayOfInt, QTObject.ID(paramImageDescription), paramInt));
/*  453 */     return arrayOfInt[0];
/*      */   }
/*      */
/*      */   public void beginDraw(QDDrawer paramQDDrawer)
/*      */     throws QTException
/*      */   {
/*  464 */     synchronized (QTNative.globalsLock) {
/*  465 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  466 */         GetGWorld(savedPort, savedDevice);
/*  467 */       SetGWorld(_ID(), 0);
/*  468 */       paramQDDrawer.draw(this);
/*  469 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  470 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public boolean isOffscreen()
/*      */   {
/*  480 */     if (QTSession.isCurrentOS(4)) {
/*  481 */       int i = IsPortOffscreen(_ID());
/*  482 */       return i == 1;
/*      */     }
/*  484 */     return (getShortFromPointer(_ID(), 6) & 0xC001) == 49153;
/*      */   }
/*      */
/*      */   public PixMap getPixMap()
/*      */   {
/*  493 */     return PixMap.fromQDGraphics(this);
/*      */   }
/*      */
/*      */   public QDRect getPortRect()
/*      */   {
/*  502 */     if (QTSession.isCurrentOS(4)) {
/*  503 */       localObject = new QDRect();
/*      */
/*  505 */       GetPortBounds(_ID(), ((QDRect)localObject).getBytes());
/*      */
/*  507 */       return localObject;
/*      */     }
/*      */
/*  510 */     Object localObject = new byte[8];
/*  511 */     getBytesAt(16, 8, (byte[])localObject, 0);
/*  512 */     return QDRect.fromArray((byte[])localObject, 8);
/*      */   }
/*      */
/*      */   public Pict makeThumbnail(QDRect paramQDRect, int paramInt)
/*      */     throws QTException
/*      */   {
/*  524 */     return Pict.thumbnailFromQDGraphics(this, paramQDRect, paramInt);
/*      */   }
/*      */
/*      */   public QDRect getBounds()
/*      */   {
/*  533 */     QDRect localQDRect = new QDRect();
/*      */
/*  535 */     if (QTSession.isCurrentOS(4))
/*      */     {
/*  537 */       GetPortBounds(_ID(), localQDRect.getBytes());
/*      */
/*  539 */       return localQDRect;
/*      */     }
/*      */
/*  542 */     return getPortRect();
/*      */   }
/*      */
/*      */   public Region getVisClipRgn()
/*      */     throws QTException
/*      */   {
/*  552 */     Region localRegion1 = new Region();
/*  553 */     if (QTSession.isCurrentOS(4)) {
/*  554 */       Region localRegion2 = new Region();
/*  555 */       Region localRegion3 = new Region();
/*      */
/*  558 */       GetPortClipRegion(_ID(), QTObject.ID(localRegion2));
/*  559 */       GetPortVisibleRegion(_ID(), QTObject.ID(localRegion3));
/*  560 */       SectRgn(QTObject.ID(localRegion2), QTObject.ID(localRegion3), QTObject.ID(localRegion1));
/*      */     } else {
/*  562 */       int i = getIntFromPointer(_ID(), 28);
/*  563 */       int j = getIntFromPointer(_ID(), 24);
/*  564 */       SectRgn(i, j, QTObject.ID(localRegion1));
/*      */     }
/*  566 */     return localRegion1;
/*      */   }
/*      */
/*      */   public Region getClip()
/*      */     throws QTException
/*      */   {
/*  575 */     Region localRegion = new Region();
/*  576 */     synchronized (QTNative.globalsLock) {
/*  577 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/*  578 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/*  580 */       SetGWorld(_ID(), 0);
/*  581 */       GetClip(QTObject.ID(localRegion));
/*      */
/*  583 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  584 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*  586 */     return localRegion;
/*      */   }
/*      */
/*      */   public void setClip(Region paramRegion)
/*      */   {
/*  595 */     synchronized (QTNative.globalsLock) {
/*  596 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/*  597 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/*  599 */       SetGWorld(_ID(), 0);
/*  600 */       SetClip(QTObject.ID(paramRegion));
/*      */
/*  602 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  603 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void clipRect()
/*      */   {
/*  614 */     synchronized (QTNative.globalsLock) {
/*  615 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  616 */         GetGWorld(savedPort, savedDevice);
/*  617 */       SetGWorld(_ID(), 0);
/*  618 */       ClipRect(_ID() + 16);
/*  619 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  620 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void clipRect(QDRect paramQDRect)
/*      */   {
/*  629 */     synchronized (QTNative.globalsLock) {
/*  630 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  631 */         GetGWorld(savedPort, savedDevice);
/*  632 */       SetGWorld(_ID(), 0);
/*  633 */       ClipRect(paramQDRect.getRect());
/*  634 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  635 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public QDColor getBackColor()
/*      */   {
/*  646 */     byte[] arrayOfByte = new byte[6];
/*  647 */     synchronized (QTNative.globalsLock) {
/*  648 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  649 */         GetGWorld(savedPort, savedDevice);
/*  650 */       SetGWorld(_ID(), 0);
/*  651 */       GetBackColor(arrayOfByte);
/*  652 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  653 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*  655 */     return QDColor.fromArray(arrayOfByte, 6);
/*      */   }
/*      */
/*      */   public void setBackColor(QDColor paramQDColor)
/*      */   {
/*  665 */     synchronized (QTNative.globalsLock) {
/*  666 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  667 */         GetGWorld(savedPort, savedDevice);
/*  668 */       SetGWorld(_ID(), 0);
/*  669 */       RGBBackColor(paramQDColor.getRGBColor());
/*  670 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  671 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void frameArc(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  697 */     if (paramQDRect == null) {
/*  698 */       paramQDRect = getPortRect();
/*      */     }
/*  700 */     synchronized (QTNative.globalsLock) {
/*  701 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  702 */         GetGWorld(savedPort, savedDevice);
/*  703 */       SetGWorld(_ID(), 0);
/*  704 */       FrameArc(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  705 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  706 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintArc(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  722 */     if (paramQDRect == null) {
/*  723 */       paramQDRect = getPortRect();
/*      */     }
/*  725 */     synchronized (QTNative.globalsLock) {
/*  726 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  727 */         GetGWorld(savedPort, savedDevice);
/*  728 */       SetGWorld(_ID(), 0);
/*  729 */       PaintArc(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  730 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  731 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void eraseArc(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  747 */     if (paramQDRect == null) {
/*  748 */       paramQDRect = getPortRect();
/*      */     }
/*  750 */     synchronized (QTNative.globalsLock) {
/*  751 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  752 */         GetGWorld(savedPort, savedDevice);
/*  753 */       SetGWorld(_ID(), 0);
/*  754 */       EraseArc(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  755 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  756 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void invertArc(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  773 */     if (paramQDRect == null) {
/*  774 */       paramQDRect = getPortRect();
/*      */     }
/*  776 */     synchronized (QTNative.globalsLock) {
/*  777 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  778 */         GetGWorld(savedPort, savedDevice);
/*  779 */       SetGWorld(_ID(), 0);
/*  780 */       InvertArc(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  781 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  782 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void frameRoundRect(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  800 */     if (paramQDRect == null) {
/*  801 */       paramQDRect = getPortRect();
/*      */     }
/*  803 */     synchronized (QTNative.globalsLock) {
/*  804 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  805 */         GetGWorld(savedPort, savedDevice);
/*  806 */       SetGWorld(_ID(), 0);
/*  807 */       FrameRoundRect(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  808 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  809 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintRoundRect(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  824 */     if (paramQDRect == null) {
/*  825 */       paramQDRect = getPortRect();
/*      */     }
/*  827 */     synchronized (QTNative.globalsLock) {
/*  828 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  829 */         GetGWorld(savedPort, savedDevice);
/*  830 */       SetGWorld(_ID(), 0);
/*  831 */       PaintRoundRect(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  832 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  833 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void eraseRoundRect(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  849 */     if (paramQDRect == null) {
/*  850 */       paramQDRect = getPortRect();
/*      */     }
/*  852 */     synchronized (QTNative.globalsLock) {
/*  853 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  854 */         GetGWorld(savedPort, savedDevice);
/*  855 */       SetGWorld(_ID(), 0);
/*  856 */       EraseRoundRect(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  857 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  858 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void invertRoundRect(QDRect paramQDRect, int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/*  873 */     if (paramQDRect == null) {
/*  874 */       paramQDRect = getPortRect();
/*      */     }
/*  876 */     synchronized (QTNative.globalsLock) {
/*  877 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  878 */         GetGWorld(savedPort, savedDevice);
/*  879 */       SetGWorld(_ID(), 0);
/*  880 */       InvertRoundRect(paramQDRect.getRect(), (short)paramInt1, (short)paramInt2);
/*  881 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  882 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void frameOval(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/*  897 */     if (paramQDRect == null) {
/*  898 */       paramQDRect = getPortRect();
/*      */     }
/*  900 */     synchronized (QTNative.globalsLock) {
/*  901 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  902 */         GetGWorld(savedPort, savedDevice);
/*  903 */       SetGWorld(_ID(), 0);
/*  904 */       FrameOval(paramQDRect.getRect());
/*  905 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  906 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintOval(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/*  919 */     if (paramQDRect == null) {
/*  920 */       paramQDRect = getPortRect();
/*      */     }
/*  922 */     synchronized (QTNative.globalsLock) {
/*  923 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  924 */         GetGWorld(savedPort, savedDevice);
/*  925 */       SetGWorld(_ID(), 0);
/*  926 */       PaintOval(paramQDRect.getRect());
/*  927 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  928 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void eraseOval(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/*  941 */     if (paramQDRect == null) {
/*  942 */       paramQDRect = getPortRect();
/*      */     }
/*  944 */     synchronized (QTNative.globalsLock) {
/*  945 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  946 */         GetGWorld(savedPort, savedDevice);
/*  947 */       SetGWorld(_ID(), 0);
/*  948 */       EraseOval(paramQDRect.getRect());
/*  949 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  950 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void invertOval(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/*  963 */     if (paramQDRect == null) {
/*  964 */       paramQDRect = getPortRect();
/*      */     }
/*  966 */     synchronized (QTNative.globalsLock) {
/*  967 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  968 */         GetGWorld(savedPort, savedDevice);
/*  969 */       SetGWorld(_ID(), 0);
/*  970 */       InvertOval(paramQDRect.getRect());
/*  971 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  972 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void framePoly(Polygon paramPolygon)
/*      */     throws QDException
/*      */   {
/*  989 */     synchronized (QTNative.globalsLock) {
/*  990 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  991 */         GetGWorld(savedPort, savedDevice);
/*  992 */       SetGWorld(_ID(), 0);
/*  993 */       FramePoly(QTObject.ID(paramPolygon));
/*  994 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  995 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintPoly(Polygon paramPolygon)
/*      */     throws QDException
/*      */   {
/* 1007 */     synchronized (QTNative.globalsLock) {
/* 1008 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1009 */         GetGWorld(savedPort, savedDevice);
/* 1010 */       SetGWorld(_ID(), 0);
/* 1011 */       PaintPoly(QTObject.ID(paramPolygon));
/* 1012 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1013 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void erasePoly(Polygon paramPolygon)
/*      */     throws QDException
/*      */   {
/* 1025 */     synchronized (QTNative.globalsLock) {
/* 1026 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1027 */         GetGWorld(savedPort, savedDevice);
/* 1028 */       SetGWorld(_ID(), 0);
/* 1029 */       ErasePoly(QTObject.ID(paramPolygon));
/* 1030 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1031 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void invertPoly(Polygon paramPolygon)
/*      */     throws QDException
/*      */   {
/* 1043 */     synchronized (QTNative.globalsLock) {
/* 1044 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1045 */         GetGWorld(savedPort, savedDevice);
/* 1046 */       SetGWorld(_ID(), 0);
/* 1047 */       InvertPoly(QTObject.ID(paramPolygon));
/* 1048 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1049 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void frameRect(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/* 1062 */     if (paramQDRect == null)
/* 1063 */       paramQDRect = getPortRect();
/* 1064 */     synchronized (QTNative.globalsLock) {
/* 1065 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1066 */         GetGWorld(savedPort, savedDevice);
/* 1067 */       SetGWorld(_ID(), 0);
/* 1068 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1069 */         FrameRect(paramQDRect.getRect());
/*      */       else
/* 1071 */         MacFrameRect(paramQDRect.getRect());
/* 1072 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1073 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void eraseRect(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/* 1084 */     if (paramQDRect == null) {
/* 1085 */       paramQDRect = getPortRect();
/*      */     }
/* 1087 */     synchronized (QTNative.globalsLock) {
/* 1088 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1089 */         GetGWorld(savedPort, savedDevice);
/* 1090 */       SetGWorld(_ID(), 0);
/* 1091 */       EraseRect(paramQDRect.getRect());
/* 1092 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1093 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void eraseRgn(Region paramRegion)
/*      */     throws QDException
/*      */   {
/* 1103 */     synchronized (QTNative.globalsLock) {
/* 1104 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1105 */         GetGWorld(savedPort, savedDevice);
/* 1106 */       SetGWorld(_ID(), 0);
/* 1107 */       EraseRgn(QTObject.ID(paramRegion));
/* 1108 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1109 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public QDColor getCPixel(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1123 */     byte[] arrayOfByte = new byte[6];
/* 1124 */     synchronized (QTNative.globalsLock) {
/* 1125 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1126 */         GetGWorld(savedPort, savedDevice);
/* 1127 */       SetGWorld(_ID(), 0);
/* 1128 */       GetCPixel((short)paramInt1, (short)paramInt2, arrayOfByte);
/* 1129 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1130 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/* 1132 */     return QDColor.fromArray(arrayOfByte, 6);
/*      */   }
/*      */
/*      */   public void setCPixel(int paramInt1, int paramInt2, QDColor paramQDColor)
/*      */     throws QDException
/*      */   {
/* 1149 */     synchronized (QTNative.globalsLock) {
/* 1150 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1151 */         GetGWorld(savedPort, savedDevice);
/* 1152 */       SetGWorld(_ID(), 0);
/* 1153 */       SetCPixel((short)paramInt1, (short)paramInt2, paramQDColor.getRGBColor());
/* 1154 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1155 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void penSize(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1172 */     synchronized (QTNative.globalsLock) {
/* 1173 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1174 */         GetGWorld(savedPort, savedDevice);
/* 1175 */       SetGWorld(_ID(), 0);
/* 1176 */       PenSize((short)paramInt1, (short)paramInt2);
/* 1177 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1178 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void penNormal()
/*      */     throws QDException
/*      */   {
/* 1189 */     synchronized (QTNative.globalsLock) {
/* 1190 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1191 */         GetGWorld(savedPort, savedDevice);
/* 1192 */       SetGWorld(_ID(), 0);
/* 1193 */       PenNormal();
/* 1194 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1195 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public QDColor getForeColor()
/*      */   {
/* 1208 */     byte[] arrayOfByte = new byte[6];
/* 1209 */     synchronized (QTNative.globalsLock) {
/* 1210 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1211 */         GetGWorld(savedPort, savedDevice);
/* 1212 */       SetGWorld(_ID(), 0);
/* 1213 */       GetForeColor(arrayOfByte);
/* 1214 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1215 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/* 1217 */     return QDColor.fromArray(arrayOfByte, 6);
/*      */   }
/*      */
/*      */   public void setForeColor(QDColor paramQDColor)
/*      */   {
/* 1226 */     synchronized (QTNative.globalsLock) {
/* 1227 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1228 */         GetGWorld(savedPort, savedDevice);
/* 1229 */       SetGWorld(_ID(), 0);
/* 1230 */       RGBForeColor(paramQDColor.getRGBColor());
/* 1231 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1232 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintRect(QDRect paramQDRect)
/*      */     throws QDException
/*      */   {
/* 1243 */     if (paramQDRect == null) {
/* 1244 */       paramQDRect = getPortRect();
/*      */     }
/* 1246 */     synchronized (QTNative.globalsLock) {
/* 1247 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1248 */         GetGWorld(savedPort, savedDevice);
/* 1249 */       SetGWorld(_ID(), 0);
/* 1250 */       PaintRect(paramQDRect.getRect());
/* 1251 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1252 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void lineTo(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1268 */     synchronized (QTNative.globalsLock) {
/* 1269 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1270 */         GetGWorld(savedPort, savedDevice);
/* 1271 */       SetGWorld(_ID(), 0);
/* 1272 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1273 */         LineTo((short)paramInt1, (short)paramInt2);
/*      */       else
/* 1275 */         MacLineTo((short)paramInt1, (short)paramInt2);
/* 1276 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1277 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void line(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1291 */     synchronized (QTNative.globalsLock) {
/* 1292 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1293 */         GetGWorld(savedPort, savedDevice);
/* 1294 */       SetGWorld(_ID(), 0);
/* 1295 */       Line((short)paramInt1, (short)paramInt2);
/* 1296 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1297 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void moveTo(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1312 */     synchronized (QTNative.globalsLock) {
/* 1313 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1314 */         GetGWorld(savedPort, savedDevice);
/* 1315 */       SetGWorld(_ID(), 0);
/* 1316 */       MoveTo((short)paramInt1, (short)paramInt2);
/* 1317 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1318 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void move(int paramInt1, int paramInt2)
/*      */     throws QDException
/*      */   {
/* 1332 */     synchronized (QTNative.globalsLock) {
/* 1333 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1334 */         GetGWorld(savedPort, savedDevice);
/* 1335 */       SetGWorld(_ID(), 0);
/* 1336 */       Move((short)paramInt1, (short)paramInt2);
/* 1337 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1338 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void paintRgn(Region paramRegion)
/*      */     throws QDException
/*      */   {
/* 1350 */     synchronized (QTNative.globalsLock) {
/* 1351 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1352 */         GetGWorld(savedPort, savedDevice);
/* 1353 */       SetGWorld(_ID(), 0);
/* 1354 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1355 */         PaintRgn(QTObject.ID(paramRegion));
/*      */       else
/* 1357 */         MacPaintRgn(QTObject.ID(paramRegion));
/* 1358 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1359 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public void frameRgn(Region paramRegion)
/*      */     throws QDException
/*      */   {
/* 1372 */     synchronized (QTNative.globalsLock) {
/* 1373 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1374 */         GetGWorld(savedPort, savedDevice);
/* 1375 */       SetGWorld(_ID(), 0);
/* 1376 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1377 */         FrameRgn(QTObject.ID(paramRegion));
/*      */       else
/* 1379 */         MacFrameRgn(QTObject.ID(paramRegion));
/* 1380 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 1381 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */     }
/*      */   }
/*      */
/*      */   public final void textFont(int paramInt)
/*      */   {
/* 1397 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/*      */
/* 1399 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1401 */       if (i != 0)
/*      */       {
/* 1403 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1405 */       SetGWorld(_ID(), 0);
/*      */
/* 1407 */       TextFont((short)paramInt);
/*      */
/* 1409 */       if (i != 0)
/*      */       {
/* 1411 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int getTextFont()
/*      */   {
/* 1425 */     return getShortAt(68);
/*      */   }
/*      */
/*      */   public void textFace(int paramInt)
/*      */   {
/* 1436 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/*      */
/* 1438 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1440 */       if (i != 0)
/*      */       {
/* 1442 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1444 */       SetGWorld(_ID(), 0);
/*      */
/* 1446 */       TextFace((short)paramInt);
/*      */
/* 1448 */       if (i != 0)
/*      */       {
/* 1450 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int getTextFace()
/*      */   {
/* 1463 */     return QTUtils.UByte2Int(getByteAt(70));
/*      */   }
/*      */
/*      */   public void textMode(int paramInt)
/*      */   {
/* 1475 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1476 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1478 */       if (i != 0)
/*      */       {
/* 1480 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1482 */       SetGWorld(_ID(), 0);
/*      */
/* 1484 */       TextMode((short)paramInt);
/*      */
/* 1486 */       if (i != 0)
/*      */       {
/* 1488 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int getTextMode()
/*      */   {
/* 1501 */     return getShortAt(72);
/*      */   }
/*      */
/*      */   public void textSize(int paramInt)
/*      */   {
/* 1512 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1513 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1515 */       if (i != 0)
/*      */       {
/* 1517 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1519 */       SetGWorld(_ID(), 0);
/*      */
/* 1521 */       TextSize((short)paramInt);
/*      */
/* 1523 */       if (i != 0)
/*      */       {
/* 1525 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int getTextSize()
/*      */   {
/* 1538 */     return getShortAt(74);
/*      */   }
/*      */
/*      */   public void drawChar(int paramInt)
/*      */   {
/* 1551 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1552 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1554 */       if (i != 0)
/*      */       {
/* 1556 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1558 */       SetGWorld(_ID(), 0);
/*      */
/* 1560 */       DrawChar((short)paramInt);
/*      */
/* 1562 */       if (i != 0)
/*      */       {
/* 1564 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public void drawText(String paramString, int paramInt1, int paramInt2)
/*      */   {
/* 1582 */     byte[] arrayOfByte = paramString.getBytes();
/*      */
/* 1584 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1585 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1587 */       if (i != 0)
/*      */       {
/* 1589 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1591 */       SetGWorld(_ID(), 0);
/*      */
/* 1593 */       if (i != 0)
/*      */       {
/* 1595 */         DrawText(arrayOfByte, (short)paramInt1, (short)paramInt2);
/* 1596 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */       else
/*      */       {
/* 1600 */         MacDrawText(arrayOfByte, (short)paramInt1, (short)paramInt2);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int charWidth(int paramInt)
/*      */   {
/* 1615 */     int j = 0;
/*      */
/* 1617 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1618 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1620 */       if (i != 0)
/*      */       {
/* 1622 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1624 */       SetGWorld(_ID(), 0);
/*      */
/* 1626 */       j = CharWidth((short)paramInt);
/*      */
/* 1628 */       if (i != 0)
/*      */       {
/* 1630 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/* 1633 */     return j;
/*      */   }
/*      */
/*      */   public int textWidth(String paramString, int paramInt1, int paramInt2)
/*      */   {
/* 1649 */     int j = 0;
/*      */
/* 1651 */     byte[] arrayOfByte = paramString.getBytes();
/*      */
/* 1653 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1654 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1656 */       if (i != 0)
/*      */       {
/* 1658 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1660 */       SetGWorld(_ID(), 0);
/*      */
/* 1662 */       j = TextWidth(arrayOfByte, (short)paramInt1, (short)paramInt2);
/*      */
/* 1664 */       if (i != 0)
/*      */       {
/* 1666 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/* 1669 */     return j;
/*      */   }
/*      */
/*      */   public void drawTextScaled(int paramInt, String paramString, float paramFloat1, float paramFloat2)
/*      */   {
/* 1723 */     QDPoint localQDPoint1 = new QDPoint((int)(paramFloat1 * 100.0F), (int)(paramFloat2 * 100.0F));
/* 1724 */     QDPoint localQDPoint2 = new QDPoint(100, 100);
/* 1725 */     byte[] arrayOfByte = paramString.getBytes();
/*      */
/* 1727 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1728 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1730 */       if (i != 0)
/*      */       {
/* 1732 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1734 */       SetGWorld(_ID(), 0);
/*      */
/* 1736 */       StdText((short)paramInt, arrayOfByte, localQDPoint1.getPoint(), localQDPoint2.getPoint());
/*      */
/* 1738 */       if (i != 0)
/*      */       {
/* 1740 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public int measureScaledText(int paramInt, String paramString, float paramFloat1, float paramFloat2)
/*      */   {
/* 1758 */     int[] arrayOfInt1 = { 0 };
/* 1759 */     int[] arrayOfInt2 = { 0 };
/*      */
/* 1765 */     QDPoint localQDPoint1 = new QDPoint((int)(paramFloat1 * 100.0F), (int)(paramFloat2 * 100.0F));
/* 1766 */     arrayOfInt1[0] = localQDPoint1.getPoint();
/* 1767 */     QDPoint localQDPoint2 = new QDPoint(100, 100);
/* 1768 */     arrayOfInt2[0] = localQDPoint2.getPoint();
/* 1769 */     byte[] arrayOfByte = paramString.getBytes();
/* 1770 */     short[] arrayOfShort = new short[4];
/* 1771 */     int j = 0;
/*      */
/* 1773 */     int i = (QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)) ? 1 : 0;
/* 1774 */     synchronized (QTNative.globalsLock)
/*      */     {
/* 1776 */       if (i != 0)
/*      */       {
/* 1778 */         GetGWorld(savedPort, savedDevice);
/*      */       }
/* 1780 */       SetGWorld(_ID(), 0);
/*      */
/* 1782 */       GetFontInfo(arrayOfShort);
/* 1783 */       j = StdTxMeas((short)paramInt, arrayOfByte, arrayOfInt1, arrayOfInt2, arrayOfShort);
/*      */
/* 1785 */       if (i != 0)
/*      */       {
/* 1787 */         SetGWorld(savedPort[0], savedDevice[0]);
/*      */       }
/*      */     }
/* 1790 */     return j;
/*      */   }
/*      */
/*      */   public String toString()
/*      */   {
/* 1803 */     return super.toString() + "[PortRect=" + getPortRect() + ",isOffscreen=" + isOffscreen() + "]";
/*      */   }
/*      */
/*      */   private static native int GraphicsExportGetInputGWorld(int paramInt, int[] paramArrayOfInt);
/*      */
/*      */   private static native short QTGetPixelSize(int paramInt);
/*      */
/*      */   private static native int GraphicsImportGetGWorld(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*      */
/*      */   private static native void GetMovieGWorld(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*      */
/*      */   private static native short GetMoviesError();
/*      */
/*      */   private static native int MCGetControllerPort(int paramInt);
/*      */
/*      */   private static native int SGGetGWorld(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*      */
/*      */   private static native short GetCSequencePrevBuffer(int paramInt, int[] paramArrayOfInt);
/*      */
/*      */   private static native short GetDSequenceImageBuffer(int paramInt, int[] paramArrayOfInt);
/*      */
/*      */   private static native short GetDSequenceScreenBuffer(int paramInt, int[] paramArrayOfInt);
/*      */
/*      */   private static native int GetNativeWindowPort(int paramInt);
/*      */
/*      */   private static native int GetGWorldPixMap(int paramInt);
/*      */
/*      */   private static native byte LockPixels(int paramInt);
/*      */
/*      */   private static native short QTNewGWorld(int[] paramArrayOfInt, int paramInt1, byte[] paramArrayOfByte, int paramInt2, int paramInt3, int paramInt4);
/*      */
/*      */   private static native int SCNewGWorld(int paramInt1, int[] paramArrayOfInt, byte[] paramArrayOfByte, int paramInt2);
/*      */
/*      */   private static native short NewImageGWorld(int[] paramArrayOfInt, int paramInt1, int paramInt2);
/*      */
/*      */   private static native void GetBackColor(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void RGBBackColor(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void EraseRect(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void FrameRect(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void MacFrameRect(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void EraseRgn(int paramInt);
/*      */
/*      */   private static native void GetForeColor(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void RGBForeColor(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void PaintRect(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void MacPaintRgn(int paramInt);
/*      */
/*      */   private static native void MacFrameRgn(int paramInt);
/*      */
/*      */   private static native void GetPort(int[] paramArrayOfInt);
/*      */
/*      */   private static native void SetGWorld(int paramInt1, int paramInt2);
/*      */
/*      */   private static native void PaintRgn(int paramInt);
/*      */
/*      */   private static native void FrameRgn(int paramInt);
/*      */
/*      */   private static native void CopyRgn(int paramInt1, int paramInt2);
/*      */
/*      */   private static native void SetRectRgn(int paramInt, short paramShort1, short paramShort2, short paramShort3, short paramShort4);
/*      */
/*      */   private static native void OffsetRgn(int paramInt, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void UnionRgn(int paramInt1, int paramInt2, int paramInt3);
/*      */
/*      */   private static native void XorRgn(int paramInt1, int paramInt2, int paramInt3);
/*      */
/*      */   private static native byte EqualRgn(int paramInt1, int paramInt2);
/*      */
/*      */   private static native void SectRgn(int paramInt1, int paramInt2, int paramInt3);
/*      */
/*      */   private static native void GetClip(int paramInt);
/*      */
/*      */   private static native void SetClip(int paramInt);
/*      */
/*      */   private static native void ClipRect(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void ClipRect(int paramInt);
/*      */
/*      */   private static native void GetGWorld(int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*      */
/*      */   private static native void Move(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void MoveTo(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void MacLineTo(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void LineTo(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void Line(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void SetCPixel(short paramShort1, short paramShort2, byte[] paramArrayOfByte);
/*      */
/*      */   private static native void GetCPixel(short paramShort1, short paramShort2, byte[] paramArrayOfByte);
/*      */
/*      */   private static native void PenSize(short paramShort1, short paramShort2);
/*      */
/*      */   private static native void PenNormal();
/*      */
/*      */   private static native void FrameArc(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void PaintArc(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void EraseArc(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void InvertArc(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void FrameRoundRect(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void PaintRoundRect(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void EraseRoundRect(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void InvertRoundRect(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void FrameOval(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void PaintOval(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void EraseOval(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void InvertOval(byte[] paramArrayOfByte);
/*      */
/*      */   private static native void FramePoly(int paramInt);
/*      */
/*      */   private static native void PaintPoly(int paramInt);
/*      */
/*      */   private static native void ErasePoly(int paramInt);
/*      */
/*      */   private static native void InvertPoly(int paramInt);
/*      */
/*      */   private static native short getShortFromPointer(int paramInt1, int paramInt2);
/*      */
/*      */   private static native void setIntInPointer(int paramInt1, int paramInt2, int paramInt3);
/*      */
/*      */   private static native int getIntFromPointer(int paramInt1, int paramInt2);
/*      */
/*      */   private static native void TextFont(short paramShort);
/*      */
/*      */   private static native void TextFace(short paramShort);
/*      */
/*      */   private static native void TextMode(short paramShort);
/*      */
/*      */   private static native void TextSize(short paramShort);
/*      */
/*      */   private static native void DrawChar(short paramShort);
/*      */
/*      */   private static native void MacDrawText(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void DrawText(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native short CharWidth(short paramShort);
/*      */
/*      */   private static native short TextWidth(byte[] paramArrayOfByte, short paramShort1, short paramShort2);
/*      */
/*      */   private static native void MeasureText(short paramShort, byte[] paramArrayOfByte, int[] paramArrayOfInt);
/*      */
/*      */   private static native void StdText(short paramShort, byte[] paramArrayOfByte, int paramInt1, int paramInt2);
/*      */
/*      */   private static native short StdTxMeas(short paramShort, byte[] paramArrayOfByte, int[] paramArrayOfInt1, int[] paramArrayOfInt2, short[] paramArrayOfShort);
/*      */
/*      */   private static native void GetFontInfo(short[] paramArrayOfShort);
/*      */
/*      */   private static native byte IsPortOffscreen(int paramInt);
/*      */
/*      */   private static native int GetPortBounds(int paramInt, byte[] paramArrayOfByte);
/*      */
/*      */   private static native int GetPortClipRegion(int paramInt1, int paramInt2);
/*      */
/*      */   private static native int GetPortVisibleRegion(int paramInt1, int paramInt2);
/*      */
/*      */   private static native short QTSPresGetGWorld(int paramInt1, int paramInt2, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*      */
/*      */   static
/*      */   {
/*      */     try
/*      */     {
/*   49 */       GDevice localGDevice = (GDevice)AccessController.doPrivileged(new PrivilegedAction() {
/*      */         public Object run() {
/*   51 */           return GDevice.getMain();
/*      */         }
/*      */       });
/*   55 */       scratch = new QDGraphics(kDefaultPixelFormat, new QDRect(1, 1), null, localGDevice, 2);
/*   56 */       validScratch = new QDGraphics(kDefaultPixelFormat, new QDRect(1, 1), null, localGDevice, 2);
/*      */     }
/*      */     catch (QTException localQTException)
/*      */     {
/*      */     }
/*      */   }
/*      */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.qd.QDGraphics
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.qd.QDGraphics

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.