Commit 658b465b authored by Peter Achten's avatar Peter Achten
Browse files

(PA) improved naming and removed comments

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