1 line
11 KiB
ArmAsm
1 line
11 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT X_CopyOneHandle
IMPORT D_Deref
IMPORT Local2TextObj
IMPORT P_ContentRect
IMPORT P_DrawATab
IMPORT P_HRulRect
IMPORT P_PL2Local
IMPORT P_PortRect
IMPORT P_Traverse
IMPORT P_VRulRect
IMPORT P_VisRuler
IMPORT D_Set4Pat
IMPORT T_ChangeRuls
IMPORT T_DotObj
IMPORT T_DotParag
IMPORT T_Editing
IMPORT T_GetParPtr
IMPORT TextObj2Local
IMPORT D_UnLock
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_DragTab
ENTRY P_DrawTabwell
;---------------------------------------------------------------------------
;
; P_EraseTabs
;
; erase all of the tabs
P_EraseTabs PROC EXPORT
;Using P_Data
;Using P_RulerData
local tmprect:r
begin
lda P_VisRuler
beq Exit
call D_Set4Pat,in=(#LightYellow:w)
moveword #P_TabWBottom-6,tmprect
moveword #P_TabWBottom-1,tmprect+4
moveword P_ContentRect+2,tmprect+2
moveword P_ContentRect+6,tmprect+6
tool _ClipRect,in=(!tmprect:l)
tool _PaintRect,in=(!tmprect:l)
_PenNormal
tool _ClipRect,in=(#P_ContentRect:l)
Exit RETURN
ENDP
;---------------------------------------------------------------------------
;
; P_EraseTabwell
;
P_EraseTabwell PROC EXPORT
;Using P_Data
;Using P_RulerData
local tmprect:r
begin
lda P_VisRuler
beq Exit
call D_Set4Pat,in=(#LightYellow:w)
moveword #P_TabWTop,tmprect
moveword P_VRulRect+2,tmprect+2
moveword #P_TabWBottom-1,tmprect+4
subword P_VRulRect+6,#2,tmprect+6
tool _ClipRect,in=(!tmprect:l)
tool _PaintRect,in=(!tmprect:l)
_PenNormal
tool _ClipRect,in=(#P_ContentRect:l)
Exit RETURN
ENDP
;---------------------------------------------------------------------------
;
; P_HideTabs (erase the Tabwell and any active tabs)
;
P_HideTabs PROC EXPORT
call P_EraseTabwell
call P_EraseTabs
rtl
ENDP
;---------------------------------------------------------------------------
;
; P_DrawTabs
;
P_DrawTabs PROC EXPORT
;Using P_RulerData
;Using P_Data
;Using T_Data
;Using T_TextEqu
local count:w,ptr:l,offset:w,tmp:l,objhdl:l,hoffset:w
local rulerhdl:l
begin
lda P_VisRuler
jeq exit
lda T_Editing
jeq exit
rcall T_GetParPtr,in=(T_DotParag:a),out=(ptr:ax)
movelong [ptr]:#T_RulerHdl,RulerHdl
rcall D_Deref,in=(RulerHdl:ax),out=(ptr:ax)
cmpw [ptr]:#T_TabCount,#P_MaxTabcount
bge DidTabwell
call P_DrawTabwell
DidTabwell tool _ClipRect,in=(#P_HRulRect:l)
moveword [ptr]:#T_TabCount,count
addwl #T_Indent,ptr
stz offset
tabloop pushlong #-1
call TextObj2Local,in=([ptr]:offset:w,#0:w),out=(:w,y:w)
pushword #P_HRulTop+P_HRulWdth-6
inc offset
inc offset
pushword [ptr]:offset
call P_DrawATab,in=(:l,:l,:w)
addword offset,#2,offset
dec count
bpl tabloop
tool _ClipRect,in=(#P_ContentRect:l)
rcall D_UnLock,in=(RulerHdl:ax)
exit return
ENDP
;---------------------------------------------------------------------------
;
; P_DrawTabwell ()
;
P_DrawTabwell PROC EXPORT
;Using P_RulerData
;Using P_Data
;Using T_Data
;Using T_TextEqu
begin
tool _ClipRect,in=(#P_PortRect:l)
; Draw the 3 in the Tabwell.
addword P_VRulRect+2,#8,a
and #$FFFE
call P_DrawATab,in=(#-1:l,a:w,#P_TabWTop+5:w,#P_LeftTab:w)
addword P_VRulRect+2,#18,a
and #$FFFE
call P_DrawATab,in=(#-1:l,a:w,#P_TabWTop+5:w,#P_DecimalTab:w)
addword P_VRulRect+2,#28,a
and #$FFFE
call P_DrawATab,in=(#-1:l,a:w,#P_TabWTop+5:w,#P_RightTab:w)
tool _ClipRect,in=(#P_ContentRect:l)
RETURN
ENDP
;---------------------------------------------------------------------------
;
; P_MoveTabs (Pt:l) : Moved:w
;
; pt is local
P_MoveTabs PROC EXPORT
;Using T_Data
;Using P_Data
;Using T_TextEqu
;Using P_ObjData
;Using P_RulerData
input ThePt:l
output moved:w
local ParagPtr:l,RulerHdl:l,RulerPtr:l
local TabsHd
|