antoine-source/appleworksgs/WP/Src/Undo.aii

1 line
10 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'wp.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT W_CalcPages IMPORT W_CheckDocPos IMPORT W_CurDoc IMPORT W_DelSelect IMPORT W_DeleteRange IMPORT D_DisableMItems IMPORT X_DisposeWPScrap IMPORT D_EnableMItems IMPORT W_EndLine IMPORT W_EndOffset IMPORT W_EndPar IMPORT W_LineToTopPixel IMPORT W_MakeCaret IMPORT W_MyCut IMPORT W_PasteOffset IMPORT W_PasteText IMPORT W_PutOnScreen IMPORT W_SelectOn IMPORT W_SetFullREct IMPORT D_SetUndoStr IMPORT W_StartLine IMPORT W_StartOffset IMPORT W_StartPar IMPORT W_UndoEndLine IMPORT W_UndoEndOffset IMPORT W_UndoEndPar IMPORT W_UndoHandle IMPORT W_UndoNames IMPORT W_UndoStartLine IMPORT W_UndoStartOffset IMPORT W_UndoStartPar IMPORT W_UpdateText IMPORT W_WPUndoType IMPORT W_WpCopy IMPORT W_CalcDocRect IMPORT caretOff IMPORT W_Handle IMPORT W_Selected ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_UInsert ENTRY W_UndoOff ENTRY W_UndoOnND ******************************************************************** * * includes... * * * * * Wednesday, May 3, 1989 5:05:30 AM ******************************************************************** **************************************************************** W_UndoOn PROC EXPORT ;Using wpglobals input type:w begin cmpw type,W_WPUndoType beq UOExit jsl W_UndoOff pushword type jsl W_UndoOnND UOExit return ENDP **************************************************************** W_UndoOnND PROC EXPORT ;Using wpglobals input type:w begin cmpw type,W_WPUndoType beq UOExit lda type sta W_WPUndoType and #$ff asl a asl a tax pushlong W_UndoNames:x lda type bpl NoRedo lda 3,s ora #$8000 sta 3,s NoRedo pushlong W_CurDoc jsl D_SetUndoStr GotStr pushword #UndoBit pushword #3 jsl D_EnableMItems UOExit return ENDP **************************************************************** W_UndoOff PROC EXPORT ;Using wpglobals begin lda W_WPUndoType beq UOExit dec a asl a adc #0 asl a tax jsr (DisposeTable,x) stz W_WPUndoType pushword #UndoBit pushword #3 jsl D_DisableMItems pushlong #0 pushlong W_CurDoc jsl D_SetUndoStr UOExit return DisposeTable DC.W none ;insert DC.W RangeDisp ;redo insert DC.W none ;delete DC.W none ;redo delete DC.W RangeDisp ;Range DC.W none ;redo range DC.W RangeDisp ;RangeInsert DC.W RangeDisp ;redo rangeInsert DC.W RangeDisp ;undo Style DC.W RangeDisp ;redo Style DC.W RangeDisp ;undo Case DC.W RangeDisp ;redo Case DC.W RangeDisp ;undo Cut DC.W none ;redo Cut DC.W RangeDisp ;undo Clear DC.W none ;redo Clear DC.W RangeDisp ;undo paste DC.W RangeDisp ;redo paste none rts RangeDisp cpzl W_UndoHandle beq NoDisp pushlong W_UndoHandle jsl X_DisposeWPScrap stzl W_UndoHandle NoDisp rts ENDP ***************************************************************** * Undo was chosen for the active W_Document. W_MyUndo PROC EXPORT ;Using wpglobals EXPORT RangeDispAct EXPORT W_UInsert local rect:r,W_Handle:l begin +b pushlong W_CurDoc _SetPort jsl caretOff lda W_WPUndoType dec a asl a adc #0 asl a tax jsr (UndoTable,x) MUExit return UndoTable DC.W W_UInsert ;insert DC.W RInsert ;redo insert DC.W none ;delete DC.W none ;redo delete DC.W RangeDisp ;Range DC.W RedoRange ;redo range DC.W RIUndo ;RangeInsert DC.W RIRedo ;redo rangeInsert DC.W UnStyle ;undo style DC.W UrStyle ;redo style DC.W UnCase ;undo style DC.W UrCase ;redo style DC.W RangeDispCu ;Cut DC.W RedoRangeCu ;redo Cut DC.W RangeDispCl ;Clear DC.W RedoRangeCl ;redo Clear DC.W RPUndo ;Paste Undo DC.W RPRedo ;Paste Redo none rts ;---------------------- RangeDispAct ; pushword W_StartPar pushword W_StartLine pushlong #0 jsl W_PutOnScreen pushlo