;EASE$$$ READ ONLY COPY of file “QUICKGLUE.m.a” ; 1.1 CCH 11/11/1988 Fixed Header. ; 1.0 CCH 11/ 9/1988 Adding to EASE. ; OLD REVISIONS BELOW ; 1.0 BBM 2/11/88 Adding file for the first time into EASE… ; END EASE MODIFICATION HISTORY ; File: QuickGlue.TEXT ;------------------------------------------------------------------ ; ; QuickDraw/Mac OS Interface ; ; written by Andy Hertzfeld 16-Sept-82 ; ; (c) 1982 by Apple Computer, Inc. All rights reserved. ; ; QuickGlue is the QuickDraw/Mac OS interface. It is linked with QuickDraw and ; defines all of the externals required by QuickDraw except those of the ; font manager. All of these are very short and simple (memory manager traps or ; jumps through the graphics jump table). ; ; Modification History ; ; 16-Nov-82 AJH Made font manager interface go through graphics jump table ; 09-Feb-83 AJH Added LockHandle, UnLockHandle ; 17-Aug-83 SC Made all cursor jumps preserve A0 ; 22-Apr-85 LAK Removed RInitGraf (coordinated with Bill clearing ; QDExist flag in InitGraf). ;------------------------------------------------------------------ LOAD 'SysTlQk.D' BLANKS ON STRING ASIS ;; INCLUDE 'GrafTypes.Text' ; INCLUDE 'QuickEQU.a' ; INCLUDE 'SYSERR.a' ; INCLUDE 'SysEqu.a' ; INCLUDE 'SysTraps.a' ; INCLUDE 'ToolEqu.a' ; INCLUDE 'ToolTraps.a' ; ; Here is a subset of Unit Storage (the ones needed by ; QuickDraw), implemented by trapping to the Mac OS. ; JHideCursor EQU $800 JShowCursor EQU $804 JShieldCursor EQU $808 JScrnAddr EQU $80C JScrnSize EQU $810 JInitCrsr EQU $814 JSetCrsr EQU $818 JCrsrObscure EQU $80C JUpdateProc EQU $820 JSwapFont EQU $8E0 ; ; FUNCTION NewHandle(byteCount: INTEGER): Ptr; ; NewHandle FUNC EXPORT ; MOVEQ #0,D0 ;clear out high part MOVE.L (SP)+,A1 ;get return address MOVE.W (SP)+,D0 ;get the byte count _NEWHANDLE ;ask OS to do request BNE.S MemFull ;if memory full, deep shit! MOVE.L A0,(SP) ;return result handle on stack JMP (A1) ;return to caller ; handle the memory full error by deep-shitting MemFull MOVEQ #DSMemFullErr,D0 _SysError DC.W $A9FF ;invoke debugger just in case it comes back ; ; PROCEDURE SetSize(h: Handle; newSize: INTEGER); ; EXPORT SetSize ; SetSize MOVEQ #0,D0 ;clear out high part MOVE.L (SP)+,A1 ;get return address MOVE.W (SP)+,D0 ;get the new size MOVE.L (SP)+,A0 ;get the handle _SETHANDLESIZE ;let OS do it BNE.S MemFull ;if out of memory, deepShit JMP (A1) ;return to caller ; ; PROCEDURE DisposeHandle(h: Handle); ; DisposeHandle PROC EXPORT ; MOVE.L (SP)+,A1 ;get return address MOVE.L (SP)+,A0 ;get parameter _DISPOSHANDLE ;let OS do work JMP (A1) ;return to caller ; ; PROCEDURE LockHandle(h: Handle); ; LockHandle PROC EXPORT MOVE.L 4(SP),A0 BSET #7,(A0) MOVE.L (SP)+,(SP) RTS ; ; PROCEDURE UnLockHandle(h: handle); ; UnlockHandle PROC EXPORT MOVE.L 4(SP),A0 BCLR #7,(A0) MOVE.L (SP)+,(SP) RTS ; ; Following is the QuickDraw cursor interface, implemented by accessing ; system routines through the graphics jump table ; CursorDisplay PROC EXPORT ; MOVE.L JShowCursor,-(SP) RTS ; CursorHide PROC EXPORT ; MOVE.L JHideCursor,-(SP) RTS ; CursorImage PROC EXPORT ; MOVE.L JSetCrsr,-(SP) RTS ; CursorInit PROC EXPORT ; MOVE.L JInitCrsr,-(SP) RTS ; CursorObscure PROC EXPORT ; MOVE.L JCrsrObscure,-(SP) RTS ; CursorShield PROC EXPORT ; MOVE.L JShieldCursor,-(SP) RTS ; ScreenAdress PROC EXPORT ; MOVE.L JScrnAddr,-(SP) RTS ; ScreenSize PROC EXPORT ; MOVE.L JScrnSize,-(SP) RTS ; FMSwapFont PROC EXPORT MOVE.L JSwapFont,-(SP) RTS END