UtilInterrupt.dcl 1.29 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1 2 3 4 5 6 7 8
definition module UtilInterrupt

import StdId, StdPSt
import IdeState

// version A of interrupt routines
// todo: generalise and reintegrate with version B (interrupt)

9
:: Callback l :== Bool (*PSt l) -> *PSt l
Diederik van Arkel's avatar
Diederik van Arkel committed
10 11 12 13 14 15 16 17 18 19

/*	Starts an 'interruptable' function.
	1st arg.	The dialog id of the 'control dialog'. Closing this dialog 'terminates' the
				interruptable function.
	2nd arg.	The interruptable function. 'StartIntr' will start a timer which will cause the 
				interruptable function to be called once. The interruptable function must call
				'ContIntr' if it has not yet been completed its task, or 'StopIntr' when it has
				finished.
	3rd arg.	The program state.
*/
20
StartIntr :: !(!Id,!Id) !(Callback General) !*(PSt General) -> *(PSt General)
Diederik van Arkel's avatar
Diederik van Arkel committed
21 22 23 24 25

/*	Stops an 'interruptable' function. This function must be called when it wants to terminate.
	1st arg.	The dialog id of the 'control dialog'.
	2nd arg.	The program state.
*/
26
StopIntr :: !(!Id,!Id) !*(PSt .l) -> *(PSt .l)
Diederik van Arkel's avatar
Diederik van Arkel committed
27 28 29 30 31 32 33

/*	Continues an 'interruptable' function. This function is called by an 'interruptable' function to
	allow user interruption at this state of its processing.
	1st arg.	The dialog id of the 'control dialog'.
	2nd arg.	The continuation function.
	3rd arg.	The program state.
*/
34
ContIntr :: !(!Id,!Id) !(Callback General) !*(PSt General) -> *(PSt General)