Commit 4036a29a authored by John van Groningen's avatar John van Groningen

move functions that depend on ObjectIO to UtilObjectIO

parent 66d08da3
......@@ -4,7 +4,6 @@ definition module UtilIO
/* Primitives which 'should be' in the standard CLEAN IO lib */
//import StdEnv
import StdString, StdFile
import UtilDate
......@@ -26,16 +25,4 @@ FReadOnly :: !{#Char} !*env -> (!Bool, !*env) | FileSystem env
GetLongPathName :: !String -> String;
GetShortPathName :: !String -> (!Bool,!String);
import StdPSt, StdMaybe, StdPictureDef, StdId
selectInputFile` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
selectOutputFile` :: !String !String !String !(PSt .l) -> (!Maybe String,!(PSt .l))
selectDirectory` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour, !PSt .l)
isWindow :: !Id *(PSt .l) -> (Bool,*(PSt .l))
/////////
LaunchTheDocument :: !String !String !Int !*a -> (!Int,!*a)
implementation module UtilIO
import code from "cUtilSystem."
/* OS dependent module */
/* Primitives which 'should be' in the standard CLEAN IO lib */
......@@ -163,45 +165,10 @@ GetFName ioNamePtr t = code (ioNamePtr=R80O0D0SD1,t=U)(ioResult=D0,ioDate_and_Ti
instruction 0x8321004C | lwz r25,76(sp)
};
import StdFileSelect, StdPSt, StdPStClass, StdPictureDef
selectInputFile` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
selectInputFile` ps
= selectInputFile ps
selectOutputFile` :: !String !String !String !(PSt .l) -> (!Maybe String,!(PSt .l))
selectOutputFile` prompt filename ok ps
= selectOutputFile prompt filename ps
selectDirectory` :: !(PSt .l) -> (!Maybe String,!PSt .l)
selectDirectory` ps
# (ms,ps) = selectDirectory ps
# ms = mapMaybe removeDirsep ms
= (ms,ps)
where
removeDirsep s
# final = dec (size s)
| s.[final] == ':' = s%(0,dec final)
= s
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
ShellDefault _ ps = abort "no ShellDefault on a Mac silly:-)"
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour,!PSt .l)
GetDialogBackgroundColour ps
= (White/*LightGrey*/, ps) // Mac Appearance dependant!
isWindow :: !Id *(PSt .l) -> (Bool,*(PSt .l))
isWindow wId ps
# (s,ps) = accPIO getWindowsStack ps
= (isMember wId s, ps)
/////////////////////
//import nodebug
trace_n` _ f :== f
import code from "cUtilSystem."
LaunchTheDocument :: !String !String !Int !*a -> (!Int,!*a)
LaunchTheDocument docPath appPath appCreator env
# (error_n,appSpec,tb) = FSMakeFSSpec appPath OSNewToolbox
......
definition module UtilObjectIO
/* OS dependent module */
/* Primitives which 'should be' in the standard CLEAN IO lib */
import StdString, StdFile
import UtilDate
import StdPSt, StdMaybe, StdPictureDef, StdId
selectInputFile` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
selectOutputFile` :: !String !String !String !(PSt .l) -> (!Maybe String,!(PSt .l))
selectDirectory` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour, !PSt .l)
isWindow :: !Id *(PSt .l) -> (Bool,*(PSt .l))
implementation module UtilObjectIO
/* OS dependent module */
/* Primitives which 'should be' in the standard CLEAN IO lib */
import StdArray, StdBool, StdClass, StdFile, StdList, StdMisc
import StdSystem, StdWindow
import StdFileSelect, StdPSt, StdPStClass, StdPictureDef
selectInputFile` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
selectInputFile` ps
= selectInputFile ps
selectOutputFile` :: !String !String !String !(PSt .l) -> (!Maybe String,!(PSt .l))
selectOutputFile` prompt filename ok ps
= selectOutputFile prompt filename ps
selectDirectory` :: !(PSt .l) -> (!Maybe String,!PSt .l)
selectDirectory` ps
# (ms,ps) = selectDirectory ps
# ms = mapMaybe removeDirsep ms
= (ms,ps)
where
removeDirsep s
# final = dec (size s)
| s.[final] == ':' = s%(0,dec final)
= s
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
ShellDefault _ ps = abort "no ShellDefault on a Mac silly:-)"
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour,!PSt .l)
GetDialogBackgroundColour ps
= (White/*LightGrey*/, ps) // Mac Appearance dependant!
isWindow :: !Id *(PSt .l) -> (Bool,*(PSt .l))
isWindow wId ps
# (s,ps) = accPIO getWindowsStack ps
= (isMember wId s, ps)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment