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

3
// only this module should be imported by users of the editor
Diederik van Arkel's avatar
Diederik van Arkel committed
4

5
6
7
8
9
10
11
12
import	StdMaybe, StdId, StdPSt, StdPicture, StdPrint
from	EdState		import class Editor, :: EditorState
from	EdMessage	import :: EditId, :: EditAction
from	EdLineText	import :: Text
import	EdPosition
from	EdSelection	import :: Selection, emptySelection, lineSelection
from	EdMonad		import :: UndoState, :: EditMonad, :: EditState, :: StateM, getPathName
import	IdeState
Diederik van Arkel's avatar
Diederik van Arkel committed
13

Diederik van Arkel's avatar
Diederik van Arkel committed
14
isEditWin :: Id *(PSt *l) -> *(Bool,*PSt *l) | Editor l
Diederik van Arkel's avatar
Diederik van Arkel committed
15
16
17
				  
// "Remote method invocations". The destination is denoted by a window identifier.

Diederik van Arkel's avatar
Diederik van Arkel committed
18
19
message :: !Id !.(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
sendToActiveWindow :: .(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
Diederik van Arkel's avatar
Diederik van Arkel committed
20
21
22
23
24
25

// Messages

msgSave				::								EditAction General (Maybe String)
msgSaveTo			:: !String ->					EditAction General (Maybe String)

Diederik van Arkel's avatar
Diederik van Arkel committed
26
27
msgSetFont			:: Font	->						EditAction .l nothing
msgGetFont			::								EditAction .l Font
Diederik van Arkel's avatar
Diederik van Arkel committed
28

Diederik van Arkel's avatar
Diederik van Arkel committed
29
30
msgSetTabs			:: !(Int,Bool,Bool) ->			EditAction .l nothing
msgGetTabs			::								EditAction .l (Int,Bool,Bool)
Diederik van Arkel's avatar
Diederik van Arkel committed
31

32
33
34
msgSetMargin :: !Int -> EditAction .l nothing
msgGetMargin :: EditAction .l Int

Diederik van Arkel's avatar
Diederik van Arkel committed
35
msgCopy				::								EditAction .l nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
36
37
38
39
40
41
42
43
msgCut				::								EditAction General nothing
msgPaste			::								EditAction General nothing
msgClear			::								EditAction General nothing
msgSelectAll		::								EditAction General nothing

msgUndo				::								EditAction General nothing

msgBalance			::								EditAction General nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
44
45
46
47
48
49
50
msgGetUndoState		::								EditAction .l (UndoState,String)
msgGetPathName		::								EditAction .l String
msgSetPathName		:: String ->					EditAction .l nothing
msgGetNeedSave		::								EditAction .l Bool
msgSetNeedSave		:: Bool ->						EditAction .l nothing
msgGetText			::								EditAction .l Text
msgSetText			:: !Text ->						EditAction .l nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
51
msgRevertText		:: !Text ->						EditAction General nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
52
msgGetSelection		::								EditAction .l (String,Selection)
Diederik van Arkel's avatar
Diederik van Arkel committed
53
54
msgReplaceSelection	:: String ->					EditAction General nothing
msgChangeSelection	:: Selection -> 				EditAction General nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
55
msgScrollToCursor	::								EditAction .l nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
56
msgScrollToLine		:: LineNr ->					EditAction General nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
57
58
msgPrint			:: !PrintSetup ->				EditAction .l PrintSetup
msgDetab			::								EditAction .l nothing
Diederik van Arkel's avatar
Diederik van Arkel committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

:: FRInfo =
	{ fr_pos			:: !Selection
	, fr_search			:: !String
	, fr_replace		:: !String
	, fr_ignore_case	:: !Bool
	, fr_match_words	:: !Bool
	, fr_backwards		:: !Bool
	, fr_wraparound		:: !Bool
	, fr_regexp			:: !Bool
	}

msgFind				:: !FRInfo ->					EditAction General Bool
msgReplace			:: !FRInfo ->					EditAction General Bool
msgReplaceAll		:: !FRInfo ->					EditAction General Int