1 line
17 KiB
ArmAsm
1 line
17 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
include 'scrap.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_ClosePicture
IMPORT D_CheckPurge
IMPORT X_CopyOneHandle
IMPORT X_CopyThread
IMPORT D_Deref
IMPORT X_DisposeScrap
IMPORT X_DisposeThread
IMPORT D_KillFont
IMPORT D_MemoryError
IMPORT P_BoundsRect
IMPORT P_BuildUndo
IMPORT P_CheckHand
IMPORT P_ContentRect
IMPORT P_CurrentWin
IMPORT P_DefFont
IMPORT P_DefSize
IMPORT P_DefStyle
IMPORT P_DelObjList
IMPORT P_DelObjects
IMPORT P_DeselectAll
IMPORT P_DrawObject
IMPORT P_DrawRgn
IMPORT P_Entry
IMPORT P_errorAlert
IMPORT P_FixMenus
IMPORT P_FixRect
IMPORT P_GetPictSize
IMPORT P_HotRect
IMPORT P_ImportHdl
IMPORT P_ImportType
IMPORT P_LastObj
IMPORT P_ListOp
IMPORT P_LoadWindowStuff
IMPORT P_local2PL
IMPORT P_NewObj
IMPORT P_NewTool
IMPORT P_NotActive
IMPORT P_ObjList
IMPORT P_PL2local
IMPORT P_Page
IMPORT P_PageMode
IMPORT P_PastePt
IMPORT P_Placing
IMPORT P_ThreadDir
IMPORT P_ThreadHdl
IMPORT X_PostScrap
IMPORT D_ScreenPort
IMPORT X_SwitchFont
IMPORT T_Clear
IMPORT T_Copy
IMPORT T_CpyOrClrObj
IMPORT T_CurParHdl
IMPORT T_Deactivate
IMPORT T_Dot
IMPORT T_DotLine
IMPORT T_DotObj
IMPORT T_DotOffset
IMPORT T_DotParag
IMPORT T_DrawRuler
IMPORT T_Editing
IMPORT T_GetParSize
IMPORT T_InvSelect
IMPORT T_Mark
IMPORT T_MarkLine
IMPORT T_MarkObj
IMPORT T_MarkOffset
IMPORT T_MarkParag
IMPORT T_Offset2Line
IMPORT T_PL2WPText
IMPORT T_Paste
IMPORT T_ReThread
IMPORT T_TextSelect
IMPORT T_WP2PLText
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_AddObjList
ENTRY P_ClearPrim
ENTRY P_Copy
ENTRY P_CopyObjList
ENTRY P_CopyPrim
ENTRY P_DrawImage
ENTRY P_GetCenter
ENTRY P_KillImport
;------------------------------------------------------------------------------
;
; P_Cut (Window:l) : ImageRoutine:l
;
P_Cut PROC EXPORT
;Using P_Data
;Using T_Data
;Using X_ClipData
input Window:l
output ImageRoutine:l
local SType:w,ScrapHdl:l
error Err
begin +b
in Window:l
out ImageRoutine:l,SType:w,ScrapHdl:l
xerr Err
xcall P_Copy
bcs Exit
call X_PostScrap,in=(SType:w,ScrapHdl:l)
call P_ClearPrim,in=(#1:w)
Exit return
ENDP
;------------------------------------------------------------------------------
;
; P_Copy (Window:l) : ImageRoutine:l,SType:w,ScrapHdl:l
;
P_Copy PROC EXPORT
;Using P_Data
;Using P_ObjData
;Using T_Data
;Using X_ClipData
input Window:l
output ImageRoutine:l,SType:w,ScrapHdl:l
error Err
begin +b
jsl P_Entry
stz Err
stz SType
stzl ImageRoutine
call P_BuildUndo,in=(#P_NoUndo:w)
lda T_Editing
beq NotText
lda T_TextSelect
beq Exit
call T_Copy,out=(ScrapHdl:l),err=(Err)
bcs Exit
call T_PL2WPText,in=(ScrapHdl:l)
moveword #WPText,SType
bra Exit
NotText
call P_CopyPrim,out=(ScrapHdl:l),err=(Err)
bcs Exit
cpzl ScrapHdl
beq Exit
moveword #PLPict,SType
movelong #P_DrawImage,ImageRoutine
Exit
return
ENDP
;------------------------------------------------------------------------------
;
; P_Paste (Window:l,ScrapHdl:l,X_ScrapType:w,PasteType:w,Where:l)
;
; Window - Window to paste into
; ScrapHdl - Handle to the scrap
; X_ScrapType - The type of scrap
; PasteType - 0:from menu; 1:directional; 2:import
; Where - Used if paste is directional
P_Paste PROC EXPORT
;Using P_Data
;Using P_ObjData
;Using T_Data
;Using X_ClipData
input Window:l,ScrapHdl:l,X_ScrapType:w,PasteType:w,Where:l
local ObjRect:r,Vert:w,Horiz:w,MidPt:w,Pt:l
local Hdl:l,Ptr:l,PCount:w,OldWindow:l,OldEditing:w
error Err
begin +b
stz Err
movelong P_CurrentWin,OldWindow
cmpl Window,P_CurrentWin
beq Active
inc P_NotActive
call P_LoadWindowStuff,in=(Window:l)
moveword T_Editing,OldEditing
stz T_Editing
Active
jsl P_Entry
call P_BuildUndo,in=(#P_NoUndo:w)
jsl P_KillImport
|