	load 'macros.dump'
	include 'driver.equ'
	include 'wp.equ'

;-----------------------------------------------
;
;   Imported addresses
;
;-----------------------------------------------

	IMPORT	D_NewDoc
	IMPORT	W_CalcPixels
	IMPORT	W_ChangeView
	
	
	IMPORT	W_MakeCaret
	IMPORT	W_NewDoc
	
	IMPORT	W_PasteText
	IMPORT	W_StartLine
	IMPORT	W_StartOffset
	IMPORT	W_StartPar
	IMPORT	W_SwitchData

********************************************************************
*
*	Includes...
* Wednesday, May 3, 1989 2:46:14 AM
********************************************************************

	


****************************************************************
*
*   W_CreateReport(scrap:l):window:l -- D_Create a report and return
*	the window pointer.  Don't D_Update anything yet -- let
*	the window manager take care of it.
*
****************************************************************
W_CreateReport	PROC	EXPORT
	;Using	WPGlobals

	input	scrap:l
	output	window:l
	error	oops

	begin

	call	D_NewDoc,in=(#1:w),out=(window:l),err=oops
	jcs	exit

	pushlong window
	_SetPort

	spaceword
	spaceword
	spaceword
	pushlong scrap
	pushword W_StartPar
	pushword W_StartLine
	pushword W_StartOffset
	jsl	  W_PasteText
	sta	  oops
	ply
	ply
	ply

	pushword #W_NormalOn
	jsl	  W_CalcPixels

	jsl	  W_MakeCaret

exit	return

	ENDP

****************************************************************
*
*   W_PasteHeader(window:l,scrap:l) -- paste into the header.
*	NOTE: The D_WP W_Document must be activated before this
*	is called!
*
****************************************************************
W_PasteHeader	PROC	EXPORT
	;Using	WPGlobals

	input	window:l,scrap:l
	error	oops

	begin

	pushlong window
	_SetPort

	pushword #W_HeaderOn
	jsl	  W_SwitchData

	spaceword
	spaceword
	spaceword
	pushlong scrap
	pushword W_StartPar
	pushword W_StartLine
	pushword W_StartOffset
	jsl	  W_PasteText
	sta	  oops
	pullword W_StartOffset
	pullword W_StartLine
	pullword W_StartPar

	pushword #W_HeaderOn
	jsl	  W_CalcPixels

	pushword #W_NormalOn
	jsl	  W_SwitchData

	pushword #W_NormalOn
	jsl	  W_CalcPixels

	pushword #W_NormalOn
	jsl	  W_ChangeView

	return

	ENDP

****************************************************************
*
*   W_PasteFooter(window:l,scrap:l) -- paste into the footer
*	NOTE: The D_WP W_Document must be activated before this
*	is called!
*
****************************************************************
W_PasteFooter	PROC	EXPORT
	;Using	WPGlobals

	input	window:l,scrap:l
	error	oops

	begin

	pushlong window
	_SetPort

	pushword #W_FooterOn
	jsl	  W_SwitchData

	spaceword
	spaceword
	spaceword
	pushlong scrap
	pushword W_StartPar
	pushword W_StartLine
	pushword W_StartOffset
	jsl	  W_PasteText
	sta	  oops
	pullword W_StartOffset
	pullword W_StartLine
	pullword W_StartPar

	pushword #W_FooterOn
	jsl	  W_CalcPixels

	pushword #W_NormalOn
	jsl	  W_SwitchData

	pushword #W_NormalOn
	jsl	  W_CalcPixels

	pushword #W_NormalOn
	jsl	  W_ChangeView

	return

	ENDP
	END

