typewin.dcl 1.34 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1 2
definition module typewin

3 4
// Types window

Diederik van Arkel's avatar
Diederik van Arkel committed
5
import StdPSt, StdId, StdWindowDef
6 7 8
from UtilStrictLists import :: List
from EdMonad import :: EditState, :: EditMonad, :: StateM
from PmPrefs import :: TypPrefs
9
from EdMessage import :: EditId
Diederik van Arkel's avatar
Diederik van Arkel committed
10

11
iniTypeWinInfo :: !Id !Id ![Id] !TypPrefs !*a -> *(.TypeWinInfo,*a) | Ids, accScreenPicture a
Diederik van Arkel's avatar
Diederik van Arkel committed
12 13
// initialise type window info

Diederik van Arkel's avatar
Diederik van Arkel committed
14
updateTypeWindow :: !Bool !String [WindowAttribute *(EditState,*(PSt *l))] ![String] !*(PSt *l) -> *PSt *l | Typer l
Diederik van Arkel's avatar
Diederik van Arkel committed
15 16 17 18 19
// add content to the types window

isTypeWindow :: !Id !.TypeWinInfo -> Bool
// is window the Types window

Diederik van Arkel's avatar
Diederik van Arkel committed
20
tw_maybe_close :: !Id !*(PSt *l) -> *(Bool,*(PSt *l)) | Typer l
Diederik van Arkel's avatar
Diederik van Arkel committed
21 22
// tw_maybe_close :: close window if it is types window

Diederik van Arkel's avatar
Diederik van Arkel committed
23
tw_safe_close :: !*(PSt *l) -> *PSt *l | Typer l
Diederik van Arkel's avatar
Diederik van Arkel committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37
// tw_safe_close :: close types window

class Typer env
where
	getTypeWinInfo :: !*env -> *(!TypeWinInfo, !*env)
	setTypeWinInfo :: !TypeWinInfo !*env -> *env

:: TypeWinInfo

// TypeWinInfo accessors
TW_GetInf :: !TypeWinInfo -> TypPrefs
TW_SetUpd :: ![Id] !TypeWinInfo -> TypeWinInfo

// message passing with types window
Diederik van Arkel's avatar
Diederik van Arkel committed
38 39
maybe_type_win_message :: !Id .(EditMonad *(PSt *l) .c) !*(PSt *l) -> (Maybe .c,*(PSt *l)) | Typer l
type_win_message :: !.(EditMonad *(PSt *l) .c) !*(PSt *l) -> *(Maybe .c,*(PSt *l)) | Typer l
Diederik van Arkel's avatar
Diederik van Arkel committed
40 41

// dialogue to set colours for types window
Diederik van Arkel's avatar
Diederik van Arkel committed
42
typewinColours :: !*(PSt *l) -> *(PSt *l) | Typer l