Commit e1604c5f authored by Peter Achten's avatar Peter Achten
Browse files

(PA) improved naming and removed comments

parent c953ba22
...@@ -19,38 +19,38 @@ from timertable import TimerTable ...@@ -19,38 +19,38 @@ from timertable import TimerTable
:: *IOSt l :: *IOSt l
:: *PSt l :: *PSt l
= { ls :: !l // The local (and private) data of the process = { ls :: !l // The local (and private) data of the process
, io :: !*IOSt l // The IOSt environment of the process , io :: !*IOSt l // The IOSt environment of the process
} }
:: *Locals :: *CProcesses // The 'context-free' processes administration
:== RR *LocalIO :== RR *CProcess // is a round-robin
:: *LocalIO :: *CProcess // The context-free process
= E. .l: = E. .l:
{ localState :: !Maybe l { localState :: !Maybe l // its local state
, localIOSt :: !*IOSt l , localIOSt :: !*IOSt l // its context-free IOSt
} }
:: RuntimeState :: RuntimeState
= Running // The process is running = Running // The process is running
| Blocked !SystemId // The process is blocked for the process with given id | Blocked !SystemId // The process is blocked for the process with given id
| Closed // The process is closed | Closed // The process is closed
:: GUIShare :: GUIShare
:== OSGUIShare :== OSGUIShare
:: ActivateRequests :== [OSActivateRequest] :: ActivateRequests :== [OSActivateRequest]
:: DoubleDownDist :== Int :: DoubleDownDist :== Int
:: InputTrack // Input being tracked: :: InputTrack // Input being tracked:
= { itWindow :: !OSWindowPtr // the parent window = { itWindow :: !OSWindowPtr // the parent window
, itControl :: !Int // zero if parent window, otherwise item nr of control (>0) , itControl :: !Int // zero if parent window, otherwise item nr of control (>0)
, itKind :: !InputTrackKind // the input kinds being tracked , itKind :: !InputTrackKind // the input kinds being tracked
} }
:: InputTrackKind // Input source kinds: :: InputTrackKind // Input source kinds:
= { itkMouse :: !Bool // mouse = { itkMouse :: !Bool // mouse
, itkKeyboard :: !Bool // keyboard , itkKeyboard :: !Bool // keyboard
} }
:: ClipboardState :: ClipboardState
= { cbsCount :: !Int // ScrapCount of last access = { cbsCount :: !Int // ScrapCount of last access
} }
...@@ -75,7 +75,7 @@ IOStGetOSTime :: !(IOSt .l) -> (!OSTime, !IOSt .l) ...@@ -75,7 +75,7 @@ IOStGetOSTime :: !(IOSt .l) -> (!OSTime, !IOSt .l)
IOStGetActivateRequests :: !(IOSt .l) -> (!ActivateRequests, !IOSt .l) IOStGetActivateRequests :: !(IOSt .l) -> (!ActivateRequests, !IOSt .l)
IOStGetEvents :: !(IOSt .l) -> (!*OSEvents, !IOSt .l) IOStGetEvents :: !(IOSt .l) -> (!*OSEvents, !IOSt .l)
IOStGetWorld :: !(IOSt .l) -> (!*World, !IOSt .l) IOStGetWorld :: !(IOSt .l) -> (!*World, !IOSt .l)
IOStGetLocals :: !(IOSt .l) -> (!Locals, !IOSt .l) IOStGetCProcesses :: !(IOSt .l) -> (!CProcesses, !IOSt .l)
IOStGetProcessStack :: !(IOSt .l) -> (!ProcessStack, !IOSt .l) IOStGetProcessStack :: !(IOSt .l) -> (!ProcessStack, !IOSt .l)
IOStGetDocumentInterface:: !(IOSt .l) -> (!DocumentInterface, !IOSt .l) IOStGetDocumentInterface:: !(IOSt .l) -> (!DocumentInterface, !IOSt .l)
IOStGetOSDInfo :: !(IOSt .l) -> (!OSDInfo, !IOSt .l) IOStGetOSDInfo :: !(IOSt .l) -> (!OSDInfo, !IOSt .l)
...@@ -104,7 +104,7 @@ IOStSetOSTime :: !OSTime !(IOSt .l) -> IOSt .l ...@@ -104,7 +104,7 @@ IOStSetOSTime :: !OSTime !(IOSt .l) -> IOSt .l
IOStSetActivateRequests :: !ActivateRequests !(IOSt .l) -> IOSt .l IOStSetActivateRequests :: !ActivateRequests !(IOSt .l) -> IOSt .l
IOStSetEvents :: !*OSEvents !(IOSt .l) -> IOSt .l IOStSetEvents :: !*OSEvents !(IOSt .l) -> IOSt .l
IOStSetWorld :: !*World !(IOSt .l) -> IOSt .l IOStSetWorld :: !*World !(IOSt .l) -> IOSt .l
IOStSetLocals :: !Locals !(IOSt .l) -> IOSt .l IOStSetCProcesses :: !CProcesses !(IOSt .l) -> IOSt .l
IOStSetProcessStack :: !ProcessStack !(IOSt .l) -> IOSt .l IOStSetProcessStack :: !ProcessStack !(IOSt .l) -> IOSt .l
SelectIOSt :: !(IOSt .l) -> IOSt .l SelectIOSt :: !(IOSt .l) -> IOSt .l
IOStSetOSDInfo :: !OSDInfo !(IOSt .l) -> IOSt .l IOStSetOSDInfo :: !OSDInfo !(IOSt .l) -> IOSt .l
...@@ -116,7 +116,7 @@ IOStSetClipboardState :: !ClipboardState !(IOSt .l) -> IOSt .l ...@@ -116,7 +116,7 @@ IOStSetClipboardState :: !ClipboardState !(IOSt .l) -> IOSt .l
IOStSetDeviceFunctions :: ![DeviceFunctions (PSt .l)] !(IOSt .l) -> IOSt .l IOStSetDeviceFunctions :: ![DeviceFunctions (PSt .l)] !(IOSt .l) -> IOSt .l
IOStSetRcvDisabled :: !Bool !(IOSt .l) -> IOSt .l /* MW11++*/ IOStSetRcvDisabled :: !Bool !(IOSt .l) -> IOSt .l /* MW11++*/
IOStSwapIO :: !(![*World],!Locals) !(IOSt .l) -> (!(![*World],!Locals),!IOSt .l) IOStSwapIO :: !(![*World],!CProcesses) !(IOSt .l) -> (!(![*World],!CProcesses),!IOSt .l)
IOStLastInteraction :: !(IOSt .l) -> (!Bool, !IOSt .l) IOStLastInteraction :: !(IOSt .l) -> (!Bool, !IOSt .l)
IOStHasDevice :: !Device !(IOSt .l) -> (!Bool, !IOSt .l) IOStHasDevice :: !Device !(IOSt .l) -> (!Bool, !IOSt .l)
......
...@@ -22,12 +22,12 @@ from roundrobin import RR, emptyRR, notodoRR ...@@ -22,12 +22,12 @@ from roundrobin import RR, emptyRR, notodoRR
, io :: !*IOSt l // The IOSt environment of the process , io :: !*IOSt l // The IOSt environment of the process
} }
:: *Locals :: *CProcesses // The 'context-free' processes administration
:== RR *LocalIO :== RR *CProcess // is a round-robin
:: *LocalIO :: *CProcess // The context-free process
= E. .l: = E. .l:
{ localState :: !Maybe l { localState :: !Maybe l // its local state
, localIOSt :: !*IOSt l , localIOSt :: !*IOSt l // its context-free IOSt
} }
:: *IOSt l :: *IOSt l
= { iounique :: !*IOUnique l = { iounique :: !*IOUnique l
...@@ -36,7 +36,7 @@ from roundrobin import RR, emptyRR, notodoRR ...@@ -36,7 +36,7 @@ from roundrobin import RR, emptyRR, notodoRR
:: *IOUnique l :: *IOUnique l
= { ioevents :: !*OSEvents // The event stream environment = { ioevents :: !*OSEvents // The event stream environment
, ioworld :: ![*World] // The world environment , ioworld :: ![*World] // The world environment
, iolocal :: *Locals // All other processes , ioprocesses :: *CProcesses // All other processes
, ioinit :: !IdFun (PSt l) // The initialisation functions of the process , ioinit :: !IdFun (PSt l) // The initialisation functions of the process
, iotoolbox :: !*OSToolbox // The Mac continuation value , iotoolbox :: !*OSToolbox // The Mac continuation value
} }
...@@ -148,7 +148,7 @@ emptyIOUnique initIO ...@@ -148,7 +148,7 @@ emptyIOUnique initIO
= ( wMetrics = ( wMetrics
, { ioevents = OSnewEvents , { ioevents = OSnewEvents
, ioworld = [] , ioworld = []
, iolocal = emptyRR , ioprocesses = emptyRR
, ioinit = initIO , ioinit = initIO
, iotoolbox = tb , iotoolbox = tb
} }
...@@ -306,13 +306,13 @@ IOStSetWorld :: !*World !(IOSt .l) -> IOSt .l ...@@ -306,13 +306,13 @@ IOStSetWorld :: !*World !(IOSt .l) -> IOSt .l
IOStSetWorld w ioState=:{iounique=unique=:{ioworld=ws}} = {ioState & iounique={unique & ioworld=[w:ws]}} IOStSetWorld w ioState=:{iounique=unique=:{ioworld=ws}} = {ioState & iounique={unique & ioworld=[w:ws]}}
// Access rules to Locals: // Access rules to CProcesses:
IOStGetLocals :: !(IOSt .l) -> (!Locals, !IOSt .l) IOStGetCProcesses :: !(IOSt .l) -> (!CProcesses, !IOSt .l)
IOStGetLocals ioState=:{iounique=unique=:{iolocal}} = (iolocal,{ioState & iounique={unique & iolocal=emptyRR}}) IOStGetCProcesses ioState=:{iounique=unique=:{ioprocesses}} = (ioprocesses,{ioState & iounique={unique & ioprocesses=emptyRR}})
IOStSetLocals :: !Locals !(IOSt .l) -> IOSt .l IOStSetCProcesses :: !CProcesses !(IOSt .l) -> IOSt .l
IOStSetLocals local ioState = {ioState & iounique={ioState.iounique & iolocal=local}} IOStSetCProcesses processes ioState = {ioState & iounique={ioState.iounique & ioprocesses=processes}}
// Access to the ProcessStack of the IOSt: // Access to the ProcessStack of the IOSt:
...@@ -350,9 +350,9 @@ IOStGetProcessKind ioState=:{ioshare} = (ioshare.iokind, ioState) ...@@ -350,9 +350,9 @@ IOStGetProcessKind ioState=:{ioshare} = (ioshare.iokind, ioState)
// Swapping of IOSt environments: // Swapping of IOSt environments:
IOStSwapIO :: !(![*World],!Locals) !(IOSt .l) -> (!(![*World],!Locals),!IOSt .l) IOStSwapIO :: !(![*World],!CProcesses) !(IOSt .l) -> (!(![*World],!CProcesses),!IOSt .l)
IOStSwapIO (world`,locals`) ioState=:{iounique=unique=:{ioworld,iolocal}} IOStSwapIO (world`,cprocesses`) ioState=:{iounique=unique=:{ioworld,ioprocesses}}
= ((ioworld,iolocal),{ioState & iounique={unique & ioworld=world`,iolocal=locals`}}) = ((ioworld,ioprocesses),{ioState & iounique={unique & ioworld=world`,ioprocesses=cprocesses`}})
// Access to the SystemId of the IOSt: // Access to the SystemId of the IOSt:
...@@ -441,9 +441,9 @@ IOStSetDeviceFunctions funcs ioState=:{ioshare} = {ioState & ioshare={ioshare & ...@@ -441,9 +441,9 @@ IOStSetDeviceFunctions funcs ioState=:{ioshare} = {ioState & ioshare={ioshare &
IOStLastInteraction :: !(IOSt .l) -> (!Bool,!IOSt .l) IOStLastInteraction :: !(IOSt .l) -> (!Bool,!IOSt .l)
IOStLastInteraction ioState IOStLastInteraction ioState
# (locals,ioState) = IOStGetLocals ioState # (processes,ioState) = IOStGetCProcesses ioState
(empty,locals) = notodoRR locals (empty,processes) = notodoRR processes
# ioState = IOStSetLocals locals ioState # ioState = IOStSetCProcesses processes ioState
= (not empty,ioState) = (not empty,ioState)
IOStHasDevice :: !Device !(IOSt .l) -> (!Bool,!IOSt .l) IOStHasDevice :: !Device !(IOSt .l) -> (!Bool,!IOSt .l)
......
...@@ -8,7 +8,7 @@ definition module scheduler ...@@ -8,7 +8,7 @@ definition module scheduler
import deviceevents, StdMaybe import deviceevents, StdMaybe
from StdString import String from StdString import String
from id import Id from id import Id
from iostate import PSt, IOSt, RR, Locals, LocalIO from iostate import PSt, IOSt, RR, CProcesses, CProcess
from receivertable import ReceiverTable, ReceiverTableEntry, RecLoc from receivertable import ReceiverTable, ReceiverTableEntry, RecLoc
from device import Device from device import Device
from processstack import ProcessStack, ProcessShowState, ShowFlag, ProcessKind, InteractiveProcess, VirtualProcess from processstack import ProcessStack, ProcessShowState, ShowFlag, ProcessKind, InteractiveProcess, VirtualProcess
...@@ -32,18 +32,11 @@ from StdProcessDef import ProcessInit, DocumentInterface, NDI, SDI, MDI ...@@ -32,18 +32,11 @@ from StdProcessDef import ProcessInit, DocumentInterface, NDI, SDI, MDI
= { envsEvents :: !*OSEvents = { envsEvents :: !*OSEvents
, envsWorld :: !*World , envsWorld :: !*World
} }
/*
:: *GContext p
= { groupPublic :: p
, groupLocals :: !*Locals p
}
*/
:: *Context :: *Context
= { cEnvs :: !*Environs // The global environments = { cEnvs :: !*Environs // The global environments
, cProcessStack :: ProcessStack // The global process stack , cProcessStack :: ProcessStack // The global process stack
, cMaxIONr :: SystemId // The global maximum system number , cMaxIONr :: SystemId // The global maximum system number
// , cGroups :: *Groups // All process groups , cProcesses :: *CProcesses // All processes
, cProcesses :: *Locals // All processes
, cModalProcess :: Maybe SystemId // The SystemId of the interactive process that has a modal window , cModalProcess :: Maybe SystemId // The SystemId of the interactive process that has a modal window
, cReceiverTable :: ReceiverTable // The global receiver-process table , cReceiverTable :: ReceiverTable // The global receiver-process table
, cTimerTable :: TimerTable // The table of all currently active timers , cTimerTable :: TimerTable // The table of all currently active timers
...@@ -149,11 +142,11 @@ accContext :: !.(St Context .x) !(PSt .l) -> (!.x, !PSt .l) ...@@ -149,11 +142,11 @@ accContext :: !.(St Context .x) !(PSt .l) -> (!.x, !PSt .l)
, !Maybe r // optional access information , !Maybe r // optional access information
) )
accessLocals :: !(St LocalIO (Result r)) !*Locals -> (!Result r,!*Locals) accessLocals :: !(St CProcess (Result r)) !*CProcesses -> (!Result r,!*CProcesses)
/* Let f::(IOSt .l .p) -> (Result r,IOSt .l .p) be an IOSt access function. /* Let f::(IOSt .l .p) -> (Result r,IOSt .l .p) be an IOSt access function.
To thread f through *Locals until fst(fst(f io)), define gLocals as follows: To thread f through *CProcesses until fst(fst(f io)), define gLocals as follows:
gLocals :: *(Locals .p) -> (Result r, *Locals .p) gLocals :: *CProcesses -> (Result r, *CProcesses)
gLocals locals = accessLocals f` locals gLocals locals = accessLocals f` locals
where f` localIO = (r,{localIO & localIOSt=ioState}) where f` localIO = (r,{localIO & localIOSt=ioState})
where (r,ioState) = f localIO.localIOSt where (r,ioState) = f localIO.localIOSt
......
This diff is collapsed.
Supports Markdown
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