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

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

//--- Types window

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

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

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

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

Diederik van Arkel's avatar
Diederik van Arkel committed
22
tw_safe_close :: !*(PSt *l) -> *PSt *l | Typer l
Diederik van Arkel's avatar
Diederik van Arkel committed
23 24 25 26
// tw_safe_close :: close types window

//-

27
from EdMessage import :: EditId
Diederik van Arkel's avatar
Diederik van Arkel committed
28 29 30 31 32 33 34 35 36 37 38 39 40

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
41 42
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
43 44

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