supermario/base/SuperMarioProj.1994-02-09/Internal/Asm/MenuMgrPriv.a
2019-06-29 23:17:50 +08:00

169 lines
7.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
; File: MenuMgrPriv.a
;
; Contains: Private equates and macros for using menu manager private calls
;
; Written by: Kevin S. MacDonell
;
; Copyright: © 1990-1991, 1993 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: System
;
; Change History (most recent first):
;
; <2> 3/31/93 IH Add _CalcMenuBar for Display Manager
; <12> 8/22/91 KSM DCC,#Bruges: Added utility routine InsertFontResMenu for Finder.
; <11> 4/16/91 KSM dba,#86852: Add reentrancy bit to fix case where Think Pascal
; patches DrawMenuBar to call HiliteMenu and we die in a recursive
; patch conflict.
; <10> 3/29/91 JSM dba, #84426: Add MenuBarGlobalInvalidBit and
; MenuBarGlobalInvalidByte.
; <9> 2/5/91 stb gs: move in SaveBits, RestoreBits, DiscardBits
; <8> 1/30/91 gbm sab, #38: Change the already including this file variable to
; all uppercase (for security reasons)
; <7> 1/21/91 DFH (ksm) Changing kProcessMenuID to kApplicationMenuID.
; <6> 11/26/90 KSM (dba)Make the MenuBarInvalidBit a switched value.
; <5> 7/2/90 KSM Add InvalMenubar constants.
; <4> 6/8/90 KSM Add SystemMenuList lowmem equate.
; <3> 6/8/90 KSM Define System Menus range.
; <2> 5/14/90 KSM Update header comments
; <1> 5/14/90 KSM New today.
;
;————————————————————————————————————————————————————————————————————————————————————————————————————
IF &TYPE('__INCLUDINGMENUMGRPRIVATE__') = 'UNDEFINED' THEN
__INCLUDINGMENUMGRPRIVATE__ SET 1
IF &TYPE('__INCLUDINGMENUS__') = 'UNDEFINED' THEN
INCLUDE 'Menus.a'
ENDIF
;————————————————————————————————————————————————————————————————————————————————————————————————————
MenuBarInvalidBit equ 6
MenuBarInvalidByte equ $B21
MenuBarGlobalInvalidBit equ 6
MenuBarGlobalInvalidByte equ $B20
ValidateMenuBarSemaphoreBit equ 3
ValidateMenuBarSemaphoreByte equ $B20
;————————————————————————————————————————————————————————————————————————————————————————————————————
; Define the Menu Manager Dispatch trap opword
SystemMenuList EQU $286 ; a list of all the system menus (same format as MenuList)
kLoSystemMenuRange EQU $B000 ; This is -20480 (the lowest value)
kHiSystemMenuRange EQU $BFFF ; This is -16385 (the highest value)
kApplicationMenuID EQU $BF97 ; -16489: The application menu ID
kHelpMenuID EQU $BF96 ; -16490: The help menu ID
kScriptMenuID EQU $BF95 ; -16491: The keyboard menu ID
;————————————————————————————————————————————————————————————————————————————————————————————————————
; Define the new selectors for the Menu Manager
selectGetMenuTitleRect EQU -1
selectGetMBARRect EQU -2
selectGetAppMenusRect EQU -3
selectGetSysMenusRect EQU -4
selectDrawMBARString EQU -5
selectIsSystemMenu EQU -6
selectMenuCalc EQU -11
paramWordsMenuCalc EQU 1
;————————————————————————————————————————————————————————————————————————————————————————————————————
; Define the parameter size passed for each call
paramWordsGetMenuTitleRect EQU 6
paramWordsGetMBARRect EQU 4
paramWordsGetAppMenusRect EQU 4
paramWordsGetSysMenusRect EQU 4
paramWordsDrawMBARString EQU 8
paramWordsIsSystemMenu EQU 3
;————————————————————————————————————————————————————————————————————————————————————————————————————
;————————————————————————————————————————————————————————————————————————————————————————————————————
; Define the MBDF message numbers of the new calls
;————————————————————————————————————————————————————————————————————————————————————————————————————
; MBDFRectCall -- Get rectangles for various parts of the menubar
MBDFRectCall EQU 14
; <pos> = 6 B.O.
MBDFRectBar EQU 0 ; Get the menubar rect
MBDFRectApps EQU -1 ; Get the rect enclosing the app menus
MBDFRectSys EQU -2 ; Get the rect enclosing the system menus
;————————————————————————————————————————————————————————————————————————————————————————————————————
; MBDFDrawMBARString -- Splash a message into the menubar in a given script
MBDFDrawMBARString EQU 15
;————————————————————————————————————————————————————————————————————————————————————————————————————
; Define the dispatch macros to get to the calls
MACRO
_GetMenuTitleRect
DoDispatch _MenuDispatch,selectGetMenuTitleRect,paramWordsGetMBARRect
ENDM
MACRO
_GetMBARRect
DoDispatch _MenuDispatch,selectGetMBARRect,paramWordsGetMBARRect
ENDM
MACRO
_GetAppMenusRect
DoDispatch _MenuDispatch,selectGetAppMenusRect,paramWordsGetAppMenusRect
ENDM
MACRO
_GetSysMenusRect
DoDispatch _MenuDispatch,selectGetSysMenusRect,paramWordsGetSysMenusRect
ENDM
MACRO
_DrawMBARString
DoDispatch _MenuDispatch,selectDrawMBARString,paramWordsDrawMBARString
ENDM
MACRO
_IsSystemMenu
DoDispatch _MenuDispatch,selectIsSystemMenu,paramWordsIsSystemMenu
ENDM
;————————————————————————————————————————————————————————————————————————————————————————————————————
; SaveRestoreBits
_SaveRestoreBits OPWORD $A81E
selectSaveBits EQU 1
paramWordsSaveBits EQU 5
selectRestoreBits EQU 2
paramWordsRestoreBits EQU 2
selectDiscardBits EQU 3
paramWordsDiscardBits EQU 2
MACRO
_SaveBits
DoDispatch _SaveRestoreBits,selectSaveBits,paramWordsSaveBits
ENDM
MACRO
_RestoreBits
DoDispatch _SaveRestoreBits,selectRestoreBits,paramWordsRestoreBits
ENDM
MACRO
_DiscardBits
DoDispatch _SaveRestoreBits,selectDiscardBits,paramWordsDiscardBits
ENDM
MACRO
_CalcMenuBar
DoDispatch _MenuDispatch,selectMenuCalc,paramWordsMenuCalc
ENDM
ENDIF ; Already included