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

1 line
15 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'wp.equ' include 'WP.Macros' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT W_AvailEvent IMPORT W_BotLine IMPORT W_BotPar IMPORT W_CalcDocRect IMPORT W_CalcLineHeight IMPORT W_Caret IMPORT W_CutLine IMPORT W_DateStr IMPORT W_DrawCaret IMPORT D_DrawString IMPORT D_DrawText IMPORT W_EndOffset IMPORT W_EndPtr IMPORT W_FOnPage IMPORT W_FindFont IMPORT W_FtrHt IMPORT W_GetAddr IMPORT W_GetLRecPtr IMPORT W_GetLeft IMPORT W_GetLineRec IMPORT W_GetParRec IMPORT W_GetRgn IMPORT W_GetSpaceToFooter IMPORT D_GetStats IMPORT W_GetTopSpace IMPORT W_HOnPage IMPORT W_HdrHt IMPORT W_InvSelectUC IMPORT W_JustBits IMPORT W_JustExtra IMPORT W_JustPtr IMPORT W_lastline IMPORT W_LastP IMPORT W_LineToPixel IMPORT W_MakeLines IMPORT W_MakePageStr IMPORT W_MaxAscent IMPORT W_MaxDescent IMPORT W_PageStr IMPORT W_PaperSize IMPORT W_PaperTop IMPORT W_ParLock IMPORT W_ParRec IMPORT W_ParUnLock IMPORT W_PixelToLine IMPORT W_PrintFl IMPORT W_ReadRuler IMPORT W_RulBits IMPORT W_STFont IMPORT W_STPtr IMPORT W_STColor IMPORT W_STStyle IMPORT D_SelectFont IMPORT W_SetBounds IMPORT W_ShowRuler IMPORT W_STLIne IMPORT W_Stuff IMPORT W_SwitchData import W_TimeStr IMPORT W_TopPg IMPORT W_TopPgPixel IMPORT W_UseTab IMPORT W_ValidLines IMPORT W_Descent IMPORT W_View ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_DrawLine ENTRY W_NoDraw ENTRY W_UpdateTextP ENTRY W_DrawHeader **************************************************************** W_UpdateText PROC EXPORT ;Using wpglobals ;Using SCreenData begin pha pha pha lda #-1 pha pha pushword #1 jsl W_UpdateTextP pla pla pla return ENDP **************************************************************** * W_UpdateText W_UpdateTextP PROC EXPORT ;Using wpglobals ;Using SCreenData ;Using W_ToolData EXPORT W_NoDraw input EPar:w,ELine:w,Force:w output BottomPixel:w,Par:w,line:w local rect:r,rect2:r,BaseLine:w,RgnHand:l,HPixel:w local W_ParRec:l,LineHand:l,LinePtr:l,W_lastline:w,MyClip:r local PBLine:l,TempPtr:l,Quit:w,HPage:w,ChrPtr:l begin stz BottomPixel stz Quit lda W_Caret beq StayOff jsl W_DrawCaret StayOff jsl W_SetBounds jsl W_GetRgn movelong ax,RgnHand spacelong _GetVisHandle spacelong _GetClipHandle pushlong RgnHand _SectRgn addlong [RgnHand],#2,LinePtr pushlong !rect2 jsl W_CalcDocRect pha pushlong !rect2 pushlong LinePtr pushlong !rect _SectRect pla jeq UTExit lda W_TopPg jsl W_FOnPage bcs NoFooter lda W_TopPg jsl W_GetSpaceToFooter subword a,W_TopPgPixel,a ldy W_ShowRuler beq NoAdd1 addword a,#W_RulerHt,a NoAdd1 sta HPixel cmp rect2+4 bcs NoFooter addword a,W_FtrHt,a cmp rect2 bcc NoFooter pushword HPixel pushword W_TopPg pushword #W_FooterOn jsl W_DrawHeader addword HPixel,W_FtrHt,HPixel bmi NoFooter PutifMax HPixel,BottomPixel NoFooter lda W_View bne IsOnTop lda W_TopPg jsl W_HOnPage bcs NotOnTop IsOnTop lda W_TopPg sta HPage jsl W_GetTopSpace cmp W_TopPgPixel bcc NotOnTop subword W_PaperTop,W_TopPgPixel,a ldy W_ShowRuler beq NoAdd2b addword a,#W_RulerHt,a NoAdd2b bra DoHeader NotOnTop subword rect2+4,rect2,a addword a,W_TopPgPixel,a cmp W_PaperSize jcc W_NoDraw lda W_TopPg inc a sta HPage ldy W_View bne IsHead jsl W_HOnPage bcs NoHeader IsHead subword W_PaperSize,W_TopPgPixel,a ldy W_ShowRuler beq NoAdd2 addword a,#W_RulerHt,a NoAdd2 addword a,W_PaperTop,a DoHeader ldy W_View bne NODH sta HPixel pha pushword HPage pushword #W_HeaderOn jsl W_DrawHeader NODH addword HPixel,W_HdrHt,HPixel bmi NoHeader PutIfMax Hpixel,BottomPixel NoHeader subword rect2+4,rect2,a addword a,W_TopPgPixel,a cmp W_PaperSize bcc W_NoDraw subword W_PaperSiz