; !Draw's boundaries: the start entry the task runs from, the module
; manager's conventions, the one command and the three services.

prefix	drawapp
include	riscos/services.h

; The task runs in user mode on a stack claimed from the RMA. Dialogues
; keep their buffers on it, and grouped objects are walked recursively.
task-start	stack=65536

module-init
module-final
command	Desktop_Draw

; Service_Memory: the Wimp asking for a slot back, refused for the module's
; own - `inout`, because an `out` starts at nought, which is the refusal.
; Service_Reset: the task is gone. Service_ResourceFSStarting: the sprites
; again. In service-number order, which is the header's fast table's.
module-service	dispatch=r1
	on Service_Memory -> drawapp_service_memory
		inout	r1	claimed		uint32_t
		in	r2	area		uint32_t
	on Service_Reset -> drawapp_service_reset
	on Service_ResourceFSStarting -> drawapp_service_resourcefs_starting
		in	r2	routine		uintptr_t
		in	r3	workspace	void *
	otherwise -> drawapp_service_ignored

; ResourceFS's restart routine, called with the files in r0 and its
; workspace in r3.
call-out	drawapp_offer, hidden
	in	r0	files		const void *
	in	r3	workspace	void *
