iostate.dcl 6.13 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
definition module iostate


//	Clean Object I/O library, version 1.2


import	osdocumentinterface
from	osevent				import OSEvents
from	osguishare			import OSGUIShare
from	osactivaterequests	import OSActivateRequest
from	oswindow			import OSWindowPtr, OSWindowMetrics
from	ostime				import OSTime
import	devicefunctions, devicesystemstate
from	processstack		import ProcessStack, ProcessShowState, ShowFlag, ProcessKind
from	receivertable		import ReceiverTable
from	roundrobin			import RR
from	timertable			import TimerTable


20
21
::	*IOSt l
::	*PSt  l
22
23
	=	{	ls			:: !l					// The local (and private) data of the process
		,	io			:: !*IOSt l				// The IOSt environment of the process
Peter Achten's avatar
Peter Achten committed
24
25
		}

26
27
28
::	*CProcesses									// The 'context-free' processes administration
	:==	RR *CProcess							//	is a round-robin
::	*CProcess									// The context-free process
Peter Achten's avatar
Peter Achten committed
29
	=	E. .l:
30
31
		{	localState	:: !Maybe l				//	its local state
		,	localIOSt	:: !*IOSt l				//	its context-free IOSt
Peter Achten's avatar
Peter Achten committed
32
33
34
		}

::	RuntimeState
35
36
37
	=	Running									// The process is running
	|	Blocked !SystemId						// The process is blocked for the process with given id
	|	Closed									// The process is closed
Peter Achten's avatar
Peter Achten committed
38
39
40
41
42
::	GUIShare
	:==	OSGUIShare

::	ActivateRequests	:== [OSActivateRequest]
::	DoubleDownDist		:== Int
43
44
45
46
::	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
Peter Achten's avatar
Peter Achten committed
47
		}
48
49
50
::	InputTrackKind								// Input source kinds:
	=	{	itkMouse	:: !Bool				// mouse
		,	itkKeyboard	:: !Bool				// keyboard
Peter Achten's avatar
Peter Achten committed
51
52
		}
::	ClipboardState
53
	=	{	cbsCount	:: !Int					// ScrapCount of last access
Peter Achten's avatar
Peter Achten committed
54
55
56
57
58
59
		}


//	Access-rules on the IOSt:

emptyIOSt				:: !SystemId !(Maybe SystemId) !(Maybe GUIShare) !DocumentInterface !ProcessKind 
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
							![ProcessAttribute (PSt .l)] !(IdFun (PSt .l)) !(Maybe SystemId)
						-> IOSt .l

IOStButtonFreq			:: !Int !Point2 !OSWindowPtr	!(IOSt .l) -> (!Int,!IOSt .l)
IOStSetDoubleDownDist	:: !DoubleDownDist				!(IOSt .l) -> IOSt .l
IOStGetInputTrack		:: !(IOSt .l) -> (!Maybe InputTrack,			!IOSt .l)
IOStGetProcessAttributes:: !(IOSt .l) -> (![ProcessAttribute (PSt .l)],	!IOSt .l)
IOStGetInitIO			:: !(IOSt .l) -> (!IdFun (PSt .l),				!IOSt .l)
IOStClosed				:: !(IOSt .l) -> (!Bool,						!IOSt .l)
IOStGetRuntimeState		:: !(IOSt .l) -> (!RuntimeState,				!IOSt .l)
IOStGetIOIsModal		:: !(IOSt .l) -> (!Maybe SystemId,				!IOSt .l)
IOStGetIdTable			:: !(IOSt .l) -> (!IdTable,						!IOSt .l)
IOStGetReceiverTable	:: !(IOSt .l) -> (!ReceiverTable,				!IOSt .l)
IOStGetTimerTable		:: !(IOSt .l) -> (!TimerTable,					!IOSt .l)
IOStGetOSTime			:: !(IOSt .l) -> (!OSTime,						!IOSt .l)
IOStGetActivateRequests	:: !(IOSt .l) -> (!ActivateRequests,			!IOSt .l)
IOStGetEvents			:: !(IOSt .l) -> (!*OSEvents,					!IOSt .l)
IOStGetWorld			:: !(IOSt .l) -> (!*World,						!IOSt .l)
78
IOStGetCProcesses		:: !(IOSt .l) -> (!CProcesses,					!IOSt .l)
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
IOStGetProcessStack		:: !(IOSt .l) -> (!ProcessStack,				!IOSt .l)
IOStGetDocumentInterface:: !(IOSt .l) -> (!DocumentInterface,			!IOSt .l)
IOStGetOSDInfo			:: !(IOSt .l) -> (!OSDInfo,						!IOSt .l)
IOStGetProcessKind		:: !(IOSt .l) -> (!ProcessKind,					!IOSt .l)
IOStGetIOId				:: !(IOSt .l) -> (!SystemId,					!IOSt .l)
IOStGetMaxIONr			:: !(IOSt .l) -> (!SystemId,					!IOSt .l)
IOStNewMaxIONr			:: !(IOSt .l) -> (!SystemId,					!IOSt .l)
IOStGetParentId			:: !(IOSt .l) -> (!Maybe SystemId,				!IOSt .l)
IOStGetGUIShare			:: !(IOSt .l) -> (!Maybe GUIShare,				!IOSt .l)
IOStGetSubProcessIds	:: !(IOSt .l) -> (![SystemId],					!IOSt .l)
IOStGetIdSeed			:: !(IOSt .l) -> (!Int,							!IOSt .l)
IOStGetClipboardState	:: !(IOSt .l) -> (!ClipboardState,				!IOSt .l)
IOStGetOSWindowMetrics	:: !(IOSt .l) -> (!OSWindowMetrics,				!IOSt .l)
IOStGetDeviceFunctions	:: !(IOSt .l) -> (![DeviceFunctions (PSt .l)],	!IOSt .l)
IOStGetRcvDisabled		:: !(IOSt .l) -> (!Bool,						!IOSt .l)	/* MW11++ */

IOStSetInputTrack		:: !(Maybe InputTrack)				!(IOSt .l) -> IOSt .l
IOStSetProcessAttributes:: ![ProcessAttribute (PSt .l)]		!(IOSt .l) -> IOSt .l
IOStSetInitIO			:: !(IdFun (PSt .l))				!(IOSt .l) -> IOSt .l
IOStSetRuntimeState		:: !RuntimeState					!(IOSt .l) -> IOSt .l
IOStSetIOIsModal		:: !(Maybe SystemId)	 			!(IOSt .l) -> IOSt .l
IOStSetIdTable			:: !IdTable							!(IOSt .l) -> IOSt .l
IOStSetReceiverTable	:: !ReceiverTable					!(IOSt .l) -> IOSt .l
IOStSetTimerTable		:: !TimerTable						!(IOSt .l) -> IOSt .l
IOStSetOSTime			:: !OSTime							!(IOSt .l) -> IOSt .l
IOStSetActivateRequests	:: !ActivateRequests				!(IOSt .l) -> IOSt .l
IOStSetEvents			:: !*OSEvents						!(IOSt .l) -> IOSt .l
IOStSetWorld			:: !*World							!(IOSt .l) -> IOSt .l
107
IOStSetCProcesses		:: !CProcesses						!(IOSt .l) -> IOSt .l
108
109
110
111
112
113
114
115
116
117
118
IOStSetProcessStack		:: !ProcessStack					!(IOSt .l) -> IOSt .l
SelectIOSt				::									!(IOSt .l) -> IOSt .l
IOStSetOSDInfo			:: !OSDInfo							!(IOSt .l) -> IOSt .l
IOStSetMaxIONr			:: !SystemId						!(IOSt .l) -> IOSt .l
IOStSetGUIShare			:: !(Maybe GUIShare)				!(IOSt .l) -> IOSt .l
IOStSetSubProcessIds	:: ![SystemId]						!(IOSt .l) -> IOSt .l
IOStSetIdSeed			:: !Int								!(IOSt .l) -> IOSt .l
IOStSetClipboardState	:: !ClipboardState					!(IOSt .l) -> IOSt .l
IOStSetDeviceFunctions	:: ![DeviceFunctions (PSt .l)]		!(IOSt .l) -> IOSt .l
IOStSetRcvDisabled		:: !Bool							!(IOSt .l) -> IOSt .l /* MW11++*/

119
IOStSwapIO				:: !(![*World],!CProcesses)	!(IOSt .l) -> (!(![*World],!CProcesses),!IOSt .l)
120
121
122
123
124
125

IOStLastInteraction		::									!(IOSt .l) -> (!Bool,	!IOSt .l)
IOStHasDevice			:: !Device							!(IOSt .l) -> (!Bool,	!IOSt .l)
IOStGetDevices			::									!(IOSt .l) -> (![Device],!IOSt .l)

IOStGetDevice			:: !Device							!(IOSt .l) -> (!Bool,DeviceSystemState (PSt .l),!IOSt .l)
126
//	IOStGetDevice retrieves the indicated device and returns True if found. If not found the device is undefined!
127
128
IOStRemoveDevice		:: !Device							!(IOSt .l) -> IOSt .l
IOStSetDevice			:: !(DeviceSystemState (PSt .l))	!(IOSt .l) -> IOSt .l
Peter Achten's avatar
Peter Achten committed
129

130
131
132
133
getIOToolbox			::									!(IOSt .l) -> (!*OSToolbox, !IOSt .l)
setIOToolbox			:: !*OSToolbox						!(IOSt .l) -> IOSt .l
appIOToolbox			:: !.(IdFun *OSToolbox)				!(IOSt .l) -> IOSt .l
accIOToolbox			:: !.(St *OSToolbox .x)				!(IOSt .l) -> (!.x, !IOSt .l)