Commit e1f4cd2d authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

cleanup for Clean2 release

parent af9b4495
definition module EdAction definition module EdAction
//********************************************************************************* // performing editor Actions
// Original Clean Library Software Module
// Written for Clean version : 1.3
// Written for I/O version : 1.2
// Author : Diederik van Arkel
// Date :
// Last Modified by :
// Date :
// Copyright : 1999 Hilt - High Level Software Tools B.V.
// : University of Nijmegen
// e-mail : clean@cs.kun.nl or rinus@hilt.nl
//*********************************************************************************
// It is allowed to modify this module for your own purposes but it is NOT allowed
// to (re)distribute the code or the modified code in ANY form without written
// permission.
//*********************************************************************************
/*
* EdAction.dcl: performing editor Actions
*/
import EdMonad, EdMovement import EdMonad, EdMovement
import EdCommon import EdCommon
......
implementation module EdAction implementation module EdAction
//*********************************************************************************
// Original Clean Library Software Module
// Written for Clean version : 1.3
// Written for I/O version : 1.2
// Author : Diederik van Arkel
// Date :
// Last Modified by :
// Date :
// Copyright : 1999 Hilt - High Level Software Tools B.V.
// : University of Nijmegen
// e-mail : clean@cs.kun.nl or rinus@hilt.nl
//*********************************************************************************
// It is allowed to modify this module for your own purposes but it is NOT allowed
// to (re)distribute the code or the modified code in ANY form without written
// permission.
//*********************************************************************************
/*
* EdAction.icl: performing editor Actions
*/
import StdInt, StdArray, StdTuple, StdBool, StdChar, StdList, StdMisc import StdInt, StdArray, StdTuple, StdBool, StdChar, StdList, StdMisc
import StdIOCommon, StdPSt, StdWindow import StdIOCommon, StdPSt, StdWindow
import EdVisualCursor, EdVisualText, EdMovement, StrictList, EdMonad import EdVisualCursor, EdVisualText, EdMovement, StrictList, EdMonad
......
definition module EdActionType definition module EdActionType
//*********************************************************************************
// Original Clean Library Software Module
// Written for Clean version : 1.3
// Written for I/O version : 1.2
// Author : Diederik van Arkel
// Date :
// Last Modified by :
// Date :
// Copyright : 1999 Hilt - High Level Software Tools B.V.
// : University of Nijmegen
// e-mail : clean@cs.kun.nl or rinus@hilt.nl
//*********************************************************************************
// It is allowed to modify this module for your own purposes but it is NOT allowed
// to (re)distribute the code or the modified code in ANY form without written
// permission.
//*********************************************************************************
import StdOverloaded import StdOverloaded
import EdMovement import EdMovement
from EdText import :: TextFragment from EdText import :: TextFragment
......
implementation module EdActionType implementation module EdActionType
//*********************************************************************************
// Original Clean Library Software Module
// Written for Clean version : 1.3
// Written for I/O version : 1.2
// Author : Diederik van Arkel
// Date :
// Last Modified by :
// Date :
// Copyright : 1999 Hilt - High Level Software Tools B.V.
// : University of Nijmegen
// e-mail : clean@cs.kun.nl or rinus@hilt.nl
//*********************************************************************************
// It is allowed to modify this module for your own purposes but it is NOT allowed
// to (re)distribute the code or the modified code in ANY form without written
// permission.
//*********************************************************************************
import StdOverloaded, StdArray, StdInt, StdString, StdChar, StdList import StdOverloaded, StdArray, StdInt, StdString, StdChar, StdList
import StrictList import StrictList
import EdMovement import EdMovement
......
/*
* EdFile.dcl: reading and writing text files
*/
definition module EdFile definition module EdFile
from StdFile import class FileSystem // reading and writing text files
from EdText import :: Text
import StdError, StdMaybe import StdError, StdMaybe
from UtilNewlinesFile import :: NewlineConvention from StdFile import class FileSystem
from EdText import :: Text
from UtilNewlinesFile import :: NewlineConvention
readText :: !String !*env -> ((Error Text,NewlineConvention,Bool), !*env) | FileSystem env readText :: !String !*env -> ((Error Text,NewlineConvention,Bool), !*env) | FileSystem env
writeText :: !String !NewlineConvention !Text !*env -> (Maybe String, !*env) | FileSystem env writeText :: !String !NewlineConvention !Text !*env -> (Maybe String, !*env) | FileSystem env
......
/*
* EdFile.icl: reading and writing text files
*/
implementation module EdFile implementation module EdFile
// reading and writing text files
import StdBool, StdFile, StdArray, StdInt, StdString, StdChar, StdFunc import StdBool, StdFile, StdArray, StdInt, StdString, StdChar, StdFunc
import UtilNewlinesFile import UtilNewlinesFile
import EdText, StrictList import EdText, StrictList
......
definition module EdFind definition module EdFind
import StdMaybe import StdMaybe
from StrictList import :: StrictList from StrictList import :: StrictList
import EdSelection import EdSelection
simpleLineSearch :: simpleLineSearch ::
// plain search // plain search
......
/*
* EdKeyMapping.dcl: configuring the key mapping of the editor
*/
definition module EdKeyMapping definition module EdKeyMapping
// configuring the key mapping of the editor
from StdFile import :: Files from StdFile import :: Files
from StdPSt import :: PSt from StdPSt import :: PSt
from StdIOCommon import :: KeyboardState, :: SpecialKey from StdIOCommon import :: KeyboardState, :: SpecialKey
from StdMaybe import :: Maybe from StdMaybe import :: Maybe
from StdOverloaded import class ==, class toString, class fromString from StdOverloaded import class ==, class toString, class fromString
from EdActionType import :: Action from EdActionType import :: Action
//from EdMonad import EditMonad, EditState, StateM
:: KeyMapping :: KeyMapping
...@@ -19,6 +16,7 @@ from EdActionType import :: Action ...@@ -19,6 +16,7 @@ from EdActionType import :: Action
// not allowed. The type should be: // not allowed. The type should be:
// configureKeyMapping :: (PSt EditorState .p) -> (PSt EditorState .p) // configureKeyMapping :: (PSt EditorState .p) -> (PSt EditorState .p)
// But then you have to import EdState which imports this module... // But then you have to import EdState which imports this module...
// => can be removed in Clean 2.0!
configureKeyMapping :: KeyMapping (KeyMapping (PSt .l) -> (PSt .l)) (PSt .l) -> (PSt .l) configureKeyMapping :: KeyMapping (KeyMapping (PSt .l) -> (PSt .l)) (PSt .l) -> (PSt .l)
......
/*
* EdKeyMapping.icl: configuring the key mapping of the editor
*/
implementation module EdKeyMapping implementation module EdKeyMapping
//import StdEnv, StdIO // configuring the key mapping of the editor
import StdArray,StdEnum, StdFunc, StdMisc,StdOrdList,StdTuple import StdArray,StdEnum, StdFunc, StdMisc,StdOrdList,StdTuple
import StdFileSelect,StdPStClass,StdWindow import StdFileSelect,StdPStClass,StdWindow
import EdState, Table, StdListBox import EdState, Table, StdListBox
......
/*
* EdKeyboard.dcl: handling keyboard events
*/
definition module EdKeyboard definition module EdKeyboard
from StdIOCommon import :: KeyboardState // handling keyboard events
from StdPSt import :: PSt
//from EdState import EditorState import EdCommon, StdMaybe
from EdKeyMapping import :: KeyMapping from StdIOCommon import :: KeyboardState
import EdMonad, StdMaybe from StdPSt import :: PSt
import EdCommon from EdKeyMapping import :: KeyMapping
editWindowKeyboard :: editWindowKeyboard ::
KeyMapping KeyboardState !(!EditState, !PSt PLocState) -> (!EditState, !PSt PLocState) KeyMapping KeyboardState !(!EditState, !PSt PLocState) -> (!EditState, !PSt PLocState)
......
/*
* EdKeyboard.icl: handling keyboard events
*/
implementation module EdKeyboard implementation module EdKeyboard
// handling keyboard events
import StdClass, StdBool, StdArray, StdInt, StdChar, StdTuple, StdList, StdMisc import StdClass, StdBool, StdArray, StdInt, StdChar, StdTuple, StdList, StdMisc
import StdIOCommon, StdWindow, StdPSt import StdIOCommon, StdWindow, StdPSt
import EdVisualText, EdVisualCursor, EdSelection, import EdVisualText, EdVisualCursor, EdSelection, EdAction, EdKeyMapping, EdState
EdAction, EdKeyMapping, EdState, StrictList import StrictList
import EdActionType import EdActionType
//from dodebug import trace_n` //from dodebug import trace_n`
......
/*
* EdLineText.dcl: a type for dealing with line-oriented operations on texts
*/
definition module EdLineText definition module EdLineText
// a type for dealing with line-oriented operations on texts
from StrictList import :: StrictList from StrictList import :: StrictList
from EdPosition import :: LineNr from EdPosition import :: LineNr
......
/*
* EdLineText.icl: a type for dealing with line-oriented operations on texts
*/
implementation module EdLineText implementation module EdLineText
import StdString, StdClass, StdInt, StdList, StdBool, StdFunc, StdArray, StdTuple // a type for dealing with line-oriented operations on texts
import StrictList
from EdPosition import :: LineNr import StdString, StdClass, StdInt, StdList, StdBool, StdFunc, StdArray, StdTuple
import syncol import StrictList
import Platform from EdPosition import :: LineNr
import syncol
import Platform
//-- stuff we want to parametrise... //-- stuff we want to parametrise...
/* /*
......
/*
* EdLook.dcl: the edit window update function
*/
definition module EdLook definition module EdLook
from StdPicture import :: Picture // the edit window update function
from StdIOCommon import :: SelectState, :: UpdateState
import EdMonad from StdPicture import :: Picture
from StdIOCommon import :: SelectState, :: UpdateState
import EdMonad
editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture) editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture)
// editWindowLook: defines the look of the editor window. This function // editWindowLook: defines the look of the editor window. This function
......
/*
* EdLook.icl: the edit window update function
*/
implementation module EdLook implementation module EdLook
// the edit window update function
import StdInt, StdBool, StdClass import StdInt, StdBool, StdClass
import StdIOCommon import StdIOCommon
import StdPicture import StdPicture
...@@ -30,15 +28,6 @@ where ...@@ -30,15 +28,6 @@ where
(height,ds4) = getCursorHeight ds3 (height,ds4) = getCursorHeight ds3
(selection=:{end},_) = getSelection ds4 (selection=:{end},_) = getSelection ds4
/*
import StdDebug,dodebug
traceUpdate [] s = s
traceUpdate [h:t] s
#! s = trace_n h s
= traceUpdate t s
*/
cleanUpdate [] = [] cleanUpdate [] = []
cleanUpdate [h:t] cleanUpdate [h:t]
| h.corner1.x == h.corner2.x = cleanUpdate t | h.corner1.x == h.corner2.x = cleanUpdate t
......
/*
* EdMessage.dcl: message passing with the editor
*/
definition module EdMessage definition module EdMessage
// message passing with the editor
from StdId import class Ids from StdId import class Ids
from StdPSt import :: PSt from StdPSt import :: PSt
from StdReceiver import :: Receiver2 from StdReceiver import :: Receiver2
......
/*
* EdMessage.icl: message passing with the editor
*/
implementation module EdMessage implementation module EdMessage
// message passing with the editor
import StdFunc, StdMisc import StdFunc, StdMisc
import StdReceiver, StdPSt, StdId import StdReceiver, StdPSt, StdId
import EdMonad import EdMonad
......
/*
* EdMonad.dcl: the monad that keeps track of the local EditState and another state (mostly the program state)
*/
definition module EdMonad definition module EdMonad
// the monad that keeps track of the local EditState and another state (mostly the program state)
from StdPicture import :: Font, :: FontMetrics, :: Colour from StdPicture import :: Font, :: FontMetrics, :: Colour
from StdPSt import :: PSt, :: IOSt from StdPSt import :: PSt, :: IOSt
from StdId import :: Id from StdId import :: Id
...@@ -59,8 +57,6 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr ...@@ -59,8 +57,6 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr
DefaultSyntaxColours :: !SyntaxColours DefaultSyntaxColours :: !SyntaxColours
//:: CursorInfo
:: UndoInfo = :: UndoInfo =
{ state :: !UndoState // undo or redo { state :: !UndoState // undo or redo
, action :: !String // string describing action to be undone/redone , action :: !String // string describing action to be undone/redone
......
/*
* EdMonad.icl: the monad that keeps track of the local EditState and another state (mostly the program state)
*/
implementation module EdMonad implementation module EdMonad
// the monad that keeps track of the local EditState and another state (mostly the program state)
import StdArray, StdBool, StdChar, StdClass, StdFunc, StdInt, StdMisc import StdArray, StdBool, StdChar, StdClass, StdFunc, StdInt, StdMisc
import StdMenuElement, StdPSt, StdWindow, StdSystem import StdMenuElement, StdPSt, StdWindow, StdSystem
import UtilNewlinesFile, StateMonad import UtilNewlinesFile, StateMonad
import StdId // P4 import StdId
import EdVisualText, EdSelection, EdLook import EdVisualText, EdSelection, EdLook
import EdAction import EdAction
...@@ -522,7 +519,7 @@ getUndoInfo ...@@ -522,7 +519,7 @@ getUndoInfo
setUndoInfo :: UndoInfo -> EditMonad (PSt .l) nothing setUndoInfo :: UndoInfo -> EditMonad (PSt .l) nothing
setUndoInfo undoInfo setUndoInfo undoInfo
= getEditState >>>= \{/*undomId,*/undoeId} -> = getEditState >>>= \{undoeId} ->
appEnv (appPIO (mfun undoeId)) >>> appEnv (appPIO (mfun undoeId)) >>>
updateEditState update updateEditState update
where where
......
definition module EdMouse definition module EdMouse
//********************************************************************************* // handling mouse events
// Original Clean Library Software Module
// Written for Clean version : 1.3
// Written for I/O version : 1.2
// Author : Diederik van Arkel
// Date :
// Last Modified by :
// Date :
// Copyright : 1999 Hilt - High Level Software Tools B.V.
// : University of Nijmegen
// e-mail : clean@cs.kun.nl or rinus@hilt.nl
//*********************************************************************************
// It is allowed to modify this module for your own purposes but it is NOT allowed
// to (re)distribute the code or the modified code in ANY form without written
// permission.
//*********************************************************************************
/* from StdIOCommon import :: MouseState
* EdMouse.dcl: handling mouse events from StdPSt import :: PSt
*/ import EdMonad, EdCommon
from StdIOCommon import :: MouseState
from StdPSt import :: PSt
import EdMonad, EdCommon
editWindowMouse :: MouseState (!EditState, !PSt PLocState) -> (EditState, PSt PLocState) editWindowMouse :: MouseState (!EditState, !PSt PLocState) -> (EditState, PSt PLocState)
// editWindowMouse: handles mouse events in the edit window // editWindowMouse: handles mouse events in the edit window
......
Markdown is supported
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