PlatformObjectIO.icl 1.06 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
implementation module PlatformObjectIO

import StdArray, StdEnum, StdList, StdClass, StdBool, StdMisc
from ArgEnv import getCommandLine
import set_return_code
import StdPSt
from UtilIO import GetLongPathName
import StdIOCommon

cl_args =: getCommandLine

filter_opts [] = []
filter_opts [h:t]
	| h.[0] == '-'	= filter_opts (drop 1 t)
	= [h:filter_opts t]

initPlatformCommandLineArguments :: !*(PSt .l) -> (![String],!*PSt .l)
initPlatformCommandLineArguments ps
	# args	= cl_args
	# args	= [arg \\ arg <-: args]
	# args = filter_opts args
	| isEmpty args
		= ([],ps)
	# files	= tl args
	# files	= map GetLongPathName files
	= (files, ps)

pAbort :: !(PSt .a) -> PSt .a
pAbort ps
	= set_return_code_pst (-1) ps

installPlatformEventHandlers :: !*(PSt .l) -> *(PSt .l)
installPlatformEventHandlers ps
	= ps

openPlatformWindowMenu :: !*(PSt .l) -> *(PSt .l)
openPlatformWindowMenu ps
	= ps

getWindowModified :: !Id !(IOSt .l) -> (!Maybe Bool,!IOSt .l)
getWindowModified _ io = (Nothing,io)

setWindowModified :: !Id !String !Bool !(IOSt .l) -> IOSt .l
setWindowModified _ _ _ io = io