mirror of
https://github.com/antoinevignau/source.git
synced 2024-11-19 07:31:13 +00:00
1 line
21 KiB
Plaintext
1 line
21 KiB
Plaintext
|
load 'macros.dump'
include 'driver.equ'
include 'wp.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT W_BotLine
IMPORT W_BotPB
IMPORT W_BotPar
IMPORT W_CalcDocRect
IMPORT W_CalcFonts
IMPORT W_CalcLineHeight
IMPORT W_CaretBot
IMPORT W_CaretTop
IMPORT W_CheckWidow
IMPORT W_CutLine
IMPORT W_DateStr
IMPORT D_Deref
IMPORT W_GetAddr
IMPORT W_GetLRecPtr
IMPORT W_GetLineRec
IMPORT W_GetPageSize
IMPORT W_GetParRec
IMPORT W_GetTopSpace
IMPORT D_GetWdth
IMPORT W_Indent
IMPORT W_JustBits
IMPORT W_JustExtra
IMPORT W_JustPtr
IMPORT W_lastline
IMPORT W_LastP
IMPORT W_LeftMargin
IMPORT W_MakeVisRuler
IMPORT W_PageStr
IMPORT W_PaperSize
IMPORT W_ParLock
IMPORT W_ParRec
IMPORT W_ParUnLock
IMPORT Q_Point
IMPORT W_Ptr
IMPORT W_PutOnScreen
IMPORT W_ReadRulerP
IMPORT W_RulBits
IMPORT W_STFont
IMPORT W_STPtr
IMPORT W_STColor
IMPORT W_STStyle
IMPORT D_SelectFont
IMPORT W_SetFullREct
IMPORT W_ShowRuler
IMPORT W_STLIne
IMPORT W_StartLine
IMPORT W_StartOffset
IMPORT W_StartPar
IMPORT W_StartRuler
IMPORT W_TimeStr
IMPORT W_TopLine
IMPORT W_TopPB
IMPORT W_TopPar
IMPORT W_TopParHeight
IMPORT W_TopPg
IMPORT W_TopPgLine
IMPORT W_TopPgPar
IMPORT W_TopPgPixel
IMPORT D_UnLock
IMPORT W_UseTab
IMPORT W_ValidLines
IMPORT W_Height
IMPORT Q_Line
IMPORT W_offset
IMPORT Q_Rect
IMPORT W_Selected
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY W_GetHPos
ENTRY JustCheck
ENTRY W_LineToPixel
ENTRY W_MakeCaretGuts
ENTRY W_PixelToLine
********************************************************************
*
* Includes<65>
* Wednesday, May 3, 1989 12:47:59 AM
********************************************************************
****************************************************************
* W_SetBounds
W_SetBounds PROC EXPORT
;Using wpglobals
local Q_Rect:r
begin
pushlong !Q_Rect
jsl W_CalcDocRect
pha
pha
pha
pushword Q_Rect
jsl W_PixelToLine
pla
sta W_TopPB
cmp #1
bne NoProb2
lda #$ffff
sta 1,s
sta 3,s
NoProb2
pullword W_TopLine
pullword W_TopPar
pha
pha
pha
pushword Q_Rect+4
jsl W_PixelToLine
pla
sta W_BotPB
cmp #1
bne NoProb
lda #$ffff
sta 1,s
sta 3,s
NoProb
pullword W_BotLine
pullword W_BotPar
return
ENDP
****************************************************************
* W_MakeCaretNS - sets the W_Caret positions and menu for a D_New selection
* The D_New selection is the W_StartPar,W_StartLine,W_StartOffset
* Does not put W_Caret on screen
W_MakeCaretNS PROC EXPORT
begin
jsl W_MakeCaretGuts
jsl W_SetBounds
return
ENDP
****************************************************************
* W_MakeCaretGuts
W_MakeCaretGuts PROC EXPORT
;Using wpglobals
local W_Ptr:l,tempv:w
begin
lda W_Selected
bne NotOnScreen
stz W_CaretTop
stz W_CaretBot
pha
pushword W_StartPar
pushword W_StartLine
jsl W_LineToPixel
pla
bmi NotOnScreen
sta TempV
spacelong
pushword W_StartPar
pushword W_StartLine
jsl W_GetLRecPtr
PullLong W_Ptr
addword [W_Ptr]:#W_lDescent,TempV,W_CaretBot
subword TempV,[W_Ptr]:#W_lAscent,W_CaretTop
pha
pushword W_StartPar
pushword W_StartLine
pushword W_StartOffset
jsl W_GetHPos
pla
sta W_CaretTop+2
sta W_CaretBot+2
NotOnScreen
return
ENDP
****************************************************************
* W_MakeCaret - sets the W_Caret positions and menu for a D_New selection
* The D_New selection is the W_StartPar,W_StartLine,W_StartOffset
* Does put W_Caret on screen
W_MakeCaret PROC EXPORT
;Using wpglobals
local W_ParRec:l
begin +b
pushword W_StartPar
pushword W_StartLine
pushlong #0
jsl W_PutOnScreen
lda W_Selected
jne IsSel
jsl W_MakeCaretGuts
IsSel
lda W_StartPar
jsl W_GetParRec
movelong ax,W_ParRec
cmpw [W_ParRec]:#W_pAttr,#W_PgBrk
bne NoPB
addlong #W_pBytes,W_ParRec,W_ParRec
NoPB
jsl W_SetFull
|