Commit 68297802 authored by Peter Achten's avatar Peter Achten
Browse files

(PA) cosmetic changes for net-distribution

parent 6416a01f
...@@ -14,7 +14,7 @@ import StdControlClass ...@@ -14,7 +14,7 @@ import StdControlClass
controlSize :: !(cdef .ls (PSt .l)) !Bool controlSize :: !(cdef .ls (PSt .l)) !Bool
!(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int))
!(PSt .l) !(PSt .l)
-> (!Size,!PSt .l) | Controls cdef -> (!Size,!PSt .l) | Controls cdef
/* controlSize calculates the size of the given control definition as it would be /* controlSize calculates the size of the given control definition as it would be
opened as an element of a window/dialog. opened as an element of a window/dialog.
The Boolean argument determines whether a window (True) or a dialog (False) is The Boolean argument determines whether a window (True) or a dialog (False) is
......
...@@ -91,4 +91,4 @@ movePoint :: !Vector2 !Point2 -> .Point2 // {vx,vy} {x,y} -> {vx+x,vy+y} ...@@ -91,4 +91,4 @@ movePoint :: !Vector2 !Point2 -> .Point2 // {vx,vy} {x,y} -> {vx+x,vy+y}
:: IdFun st :== st -> st :: IdFun st :== st -> st
:: Void = Void // MW11++ :: Void = Void
...@@ -82,7 +82,7 @@ getMouseStateButtonState:: !MouseState -> ButtonState // ButtonUp if MouseLos ...@@ -82,7 +82,7 @@ getMouseStateButtonState:: !MouseState -> ButtonState // ButtonUp if MouseLos
instance == MouseState // Equality on MouseState instance == MouseState // Equality on MouseState
instance == ButtonState // Constructor equality instance == ButtonState // Constructor equality
instance toString MouseState instance toString MouseState
instance toString ButtonState
/* The SliderState type. */ /* The SliderState type. */
...@@ -298,6 +298,8 @@ instance toString DocumentInterface // Constructor as String ...@@ -298,6 +298,8 @@ instance toString DocumentInterface // Constructor as String
| SliderDecLarge | SliderDecLarge
| SliderThumb Int | SliderThumb Int
instance toString SliderMove
/* Scrolling function. */ /* Scrolling function. */
...@@ -346,7 +348,5 @@ stdUnfillUpdAreaLook :: SelectState !UpdateState !*Picture -> *Picture ...@@ -346,7 +348,5 @@ stdUnfillUpdAreaLook :: SelectState !UpdateState !*Picture -> *Picture
instance == ErrorReport // Constructor equality instance == ErrorReport // Constructor equality
instance toString ErrorReport // Constructor as String instance toString ErrorReport // Constructor as String
// MW11..
:: OkBool // iff True, the operation was successful :: OkBool // iff True, the operation was successful
:== Bool :== Bool
// ..MW11
...@@ -203,6 +203,14 @@ instance toString MouseState where ...@@ -203,6 +203,14 @@ instance toString MouseState where
toString (MouseDrag pos modifiers) = brackify ("MouseDrag "+++itemsList " " [toString pos,toString modifiers]) toString (MouseDrag pos modifiers) = brackify ("MouseDrag "+++itemsList " " [toString pos,toString modifiers])
toString (MouseUp pos modifiers) = brackify ("MouseUp " +++itemsList " " [toString pos,toString modifiers]) toString (MouseUp pos modifiers) = brackify ("MouseUp " +++itemsList " " [toString pos,toString modifiers])
toString MouseLost = "MouseLost" toString MouseLost = "MouseLost"
instance toString ButtonState where
toString ButtonStillUp = "ButtonStillUp"
toString ButtonDown = "ButtonDown"
toString ButtonDoubleDown = "ButtonDoubleDown"
toString ButtonTripleDown = "ButtonTripleDown"
toString ButtonStillDown = "ButtonStillDown"
toString ButtonUp = "ButtonUp"
/* The SliderState type. */ /* The SliderState type. */
...@@ -537,6 +545,13 @@ instance toString DocumentInterface where ...@@ -537,6 +545,13 @@ instance toString DocumentInterface where
| SliderDecLarge | SliderDecLarge
| SliderThumb Int | SliderThumb Int
instance toString SliderMove where
toString SliderIncSmall = "SliderIncSmall"
toString SliderDecSmall = "SliderDecSmall"
toString SliderIncLarge = "SliderIncLarge"
toString SliderDecLarge = "SliderDecLarge"
toString (SliderThumb x) = brackify ("SliderThumb "+++toString x)
/* Scrolling function. */ /* Scrolling function. */
......
...@@ -18,6 +18,10 @@ isJust :: !(Maybe .x) -> Bool // case @1 of (Just _) -> True; _ -> False ...@@ -18,6 +18,10 @@ isJust :: !(Maybe .x) -> Bool // case @1 of (Just _) -> True; _ -> False
isNothing :: !(Maybe .x) -> Bool // not o isJust isNothing :: !(Maybe .x) -> Bool // not o isJust
fromJust :: !(Maybe .x) -> .x // \(Just x) -> x fromJust :: !(Maybe .x) -> .x // \(Just x) -> x
// for possibly unique elements:
u_isJust :: !(Maybe .x) -> (!Bool, !Maybe .x)
u_isNothing :: !(Maybe .x) -> (!Bool, !Maybe .x)
accMaybe :: .(St .x .a) !(Maybe .x) -> (!Maybe .a,!Maybe .x) accMaybe :: .(St .x .a) !(Maybe .x) -> (!Maybe .a,!Maybe .x)
// accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x))) // accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f Nothing = (Nothing,Nothing) // accMaybe f Nothing = (Nothing,Nothing)
......
...@@ -22,6 +22,18 @@ isNothing :: !(Maybe .x) -> Bool ...@@ -22,6 +22,18 @@ isNothing :: !(Maybe .x) -> Bool
isNothing Nothing = True isNothing Nothing = True
isNothing _ = False isNothing _ = False
u_isJust :: !(Maybe .x) -> (!Bool, !Maybe .x)
u_isJust nothing=:Nothing
= (False, nothing)
u_isJust just
= (True, just)
u_isNothing :: !(Maybe .x) -> (!Bool, !Maybe .x)
u_isNothing nothing=:Nothing
= (True, nothing)
u_isNothing just
= (False,just)
fromJust :: !(Maybe .x) -> .x fromJust :: !(Maybe .x) -> .x
fromJust (Just x) = x fromJust (Just x) = x
......
...@@ -28,27 +28,6 @@ beep :: !(IOSt .l) -> IOSt .l ...@@ -28,27 +28,6 @@ beep :: !(IOSt .l) -> IOSt .l
*/ */
// Operations on the global cursor:
/* RWS ---
setCursor :: !CursorShape !(IOSt .l) -> IOSt .l
resetCursor :: !(IOSt .l) -> IOSt .l
obscureCursor :: !(IOSt .l) -> IOSt .l
/* setCursor overrules the shape of the cursor of all windows.
resetCursor removes the overruled cursor shape of all windows.
obscureCursor hides the cursor until the mouse is moved.
*/
// Operations on the DoubleDownDistance:
setDoubleDownDistance :: !Int !(IOSt .l) -> IOSt .l
/* setDoubleDownDistance sets the maximum distance the mouse is allowed to move to
generate a ButtonDouble(Triple)Down button state. Negative values are set to
zero.
*/
--- RWS */
// Operations on the DocumentInterface of an interactive process: // Operations on the DocumentInterface of an interactive process:
getDocumentInterface :: !(IOSt .l) -> (!DocumentInterface, !IOSt .l) getDocumentInterface :: !(IOSt .l) -> (!DocumentInterface, !IOSt .l)
......
...@@ -18,13 +18,11 @@ from iostate import PSt, IOSt ...@@ -18,13 +18,11 @@ from iostate import PSt, IOSt
- FileSelectEnv (see StdFileSelect) - FileSelectEnv (see StdFileSelect)
- TimeEnv (see StdTime) - TimeEnv (see StdTime)
- playSoundFile (see StdSound) - playSoundFile (see StdSound)
- ChannelEnv (see StdChannels) // MW11++
- Ids (see StdId) // MW11++
IOSt is also an environment instance of the classes FileEnv, TimeEnv & ChannelEnv IOSt is also an environment instance of the classes FileEnv, TimeEnv
*/ */
instance FileSystem (PSt .l) instance FileSystem (PSt .l)
instance FileEnv (PSt .l), (IOSt .l) // MW11 added IOSt instance FileEnv (PSt .l), (IOSt .l)
instance FileSelectEnv (PSt .l) instance FileSelectEnv (PSt .l)
instance TimeEnv (PSt .l), (IOSt .l) // MW11 added IOSt instance TimeEnv (PSt .l), (IOSt .l)
instance playSoundFile (PSt .l) instance playSoundFile (PSt .l)
...@@ -11,7 +11,6 @@ definition module StdPrint ...@@ -11,7 +11,6 @@ definition module StdPrint
// ******************************************************************************** // ********************************************************************************
// MW11 was from StdPicture import Picture, Point
from StdPicture import Picture, Point2 from StdPicture import Picture, Point2
from StdIOCommon import Size, Rectangle, IdFun, UpdateState, ViewFrame, UpdateArea from StdIOCommon import Size, Rectangle, IdFun, UpdateState, ViewFrame, UpdateArea
from StdOverloaded import == from StdOverloaded import ==
...@@ -56,7 +55,7 @@ freadPrintSetup :: !*File !*env -> (!Bool, !PrintSetup, !*File, !*env) ...@@ -56,7 +55,7 @@ freadPrintSetup :: !*File !*env -> (!Bool, !PrintSetup, !*File, !*env)
print :: !Bool !Bool print :: !Bool !Bool
.(PrintInfo !*Picture -> ([IdFun *Picture],!*Picture)) .(PrintInfo !*Picture -> ([IdFun *Picture],!*Picture))
!PrintSetup !*printEnv !PrintSetup !*printEnv
-> (!PrintSetup,!*printEnv) -> (!PrintSetup,!*printEnv)
| PrintEnvironments printEnv | PrintEnvironments printEnv
/* print doDialog emulateScreen pages printSetup env /* print doDialog emulateScreen pages printSetup env
...@@ -81,8 +80,8 @@ print :: !Bool !Bool ...@@ -81,8 +80,8 @@ print :: !Bool !Bool
printUpdateFunction printUpdateFunction
:: !Bool (UpdateState -> *Picture -> *Picture) [Rectangle] :: !Bool (UpdateState -> *Picture -> *Picture) [Rectangle]
!PrintSetup !*printEnv !PrintSetup !*printEnv
-> (!PrintSetup, !*printEnv) -> (!PrintSetup,!*printEnv)
| PrintEnvironments printEnv | PrintEnvironments printEnv
/* printUpdateFunction doDialog update area printSetup env /* printUpdateFunction doDialog update area printSetup env
sends the content of the update function of a given area to the printer: sends the content of the update function of a given area to the printer:
...@@ -98,7 +97,6 @@ printUpdateFunction ...@@ -98,7 +97,6 @@ printUpdateFunction
identical to print. identical to print.
*/ */
// MW11 changed Point into Point2
printPagePerPage :: !Bool !Bool printPagePerPage :: !Bool !Bool
.x .x
.(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture))))) .(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture)))))
......
...@@ -37,8 +37,6 @@ fileToCharStream :: !*File -> *FileCharStream ...@@ -37,8 +37,6 @@ fileToCharStream :: !*File -> *FileCharStream
charStreamToFile :: !*FileCharStream -> *File charStreamToFile :: !*FileCharStream -> *File
printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv
-> (!(!*charStream,!PrintSetup),!*printEnv) -> (!(!*charStream,!PrintSetup),!*printEnv)
| CharStreams charStream & PrintEnvironments printEnv | CharStreams charStream & PrintEnvironments printEnv
...@@ -61,8 +59,6 @@ printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv ...@@ -61,8 +59,6 @@ printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv
*/ */
printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup
!*printEnv !*printEnv
-> (!(!*charStream,!PrintSetup),!*printEnv) -> (!(!*charStream,!PrintSetup),!*printEnv)
...@@ -80,8 +76,6 @@ printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintS ...@@ -80,8 +76,6 @@ printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintS
*/ */
printText3 ::!Bool !WrapMode !FontDef !Int printText3 ::!Bool !WrapMode !FontDef !Int
.(PrintInfo *Picture -> (state, (Int,Int), *Picture)) .(PrintInfo *Picture -> (state, (Int,Int), *Picture))
(state Int *Picture -> *Picture) (state Int *Picture -> *Picture)
......
...@@ -17,7 +17,6 @@ from id import RId, R2Id, RIdtoId, R2IdtoId, == ...@@ -17,7 +17,6 @@ from id import RId, R2Id, RIdtoId, R2IdtoId, ==
// Open uni- and bi-directional receivers: // Open uni- and bi-directional receivers:
// MW11 reopenReceiver removed, made types unique
class Receivers rdef where class Receivers rdef where
openReceiver :: .ls !*(*rdef .ls (PSt .l)) !(PSt .l) -> (!ErrorReport,!PSt .l) openReceiver :: .ls !*(*rdef .ls (PSt .l)) !(PSt .l) -> (!ErrorReport,!PSt .l)
getReceiverType:: *(*rdef .ls .pst) -> ReceiverType getReceiverType:: *(*rdef .ls .pst) -> ReceiverType
......
...@@ -25,18 +25,18 @@ applicationpath :: !String -> String ...@@ -25,18 +25,18 @@ applicationpath :: !String -> String
Use these directories to store preference/options/help files of an application. Use these directories to store preference/options/help files of an application.
*/ */
newlineChars :: !String // MW11++ newlineChars :: !String
/* the newline characters in a textfile /* the newline characters in a textfile
*/ */
printSetupTypical :: Bool
// System dependencies concerning the time resolution // System dependencies concerning the time resolution
ticksPerSecond :: Int ticksPerSecond :: Int
/* ticksPerSecond returns the maximum timer resolution per second. /* ticksPerSecond returns the maximum timer resolution per second.
*/ */
printSetupTypical :: Bool // MW11++
// System dependencies concerning the screen resolution. // System dependencies concerning the screen resolution.
mmperinch :== 25.4 mmperinch :== 25.4
......
...@@ -21,7 +21,7 @@ applicationpath :: !String -> String ...@@ -21,7 +21,7 @@ applicationpath :: !String -> String
applicationpath fname = OShomepath fname applicationpath fname = OShomepath fname
// MW11++ // MW11++
newlineChars :: !String newlineChars :: !String
newlineChars = OSnewlineChars newlineChars = OSnewlineChars
// System dependencies concerning the time resolution // System dependencies concerning the time resolution
...@@ -58,5 +58,5 @@ where ...@@ -58,5 +58,5 @@ where
(w,h) = OSmaxScrollWindowSize (w,h) = OSmaxScrollWindowSize
// MW11++ // MW11++
printSetupTypical :: Bool printSetupTypical :: Bool
printSetupTypical = OSprintSetupTypical printSetupTypical = OSprintSetupTypical
...@@ -8,7 +8,7 @@ definition module StdTime ...@@ -8,7 +8,7 @@ definition module StdTime
// ******************************************************************************** // ********************************************************************************
from StdOverloaded import < from StdOverloaded import <
from ostick import Tick // MW11++ from ostick import Tick
:: Time :: Time
= { hours :: !Int // hours (0-23) = { hours :: !Int // hours (0-23)
...@@ -28,18 +28,16 @@ wait :: !Int .x -> .x ...@@ -28,18 +28,16 @@ wait :: !Int .x -> .x
If n<=0, then x is evaluated immediately. If n<=0, then x is evaluated immediately.
*/ */
// MW11..
instance < Tick instance < Tick
intPlusTick :: !Int !Tick -> Tick intPlusTick :: !Int !Tick -> Tick
tickDifference :: !Tick !Tick -> Int tickDifference :: !Tick !Tick -> Int
// .. MW11
class TimeEnv env where class TimeEnv env where
getBlinkInterval:: !*env -> (!Int, !*env) getBlinkInterval:: !*env -> (!Int, !*env)
getCurrentTime :: !*env -> (!Time, !*env) getCurrentTime :: !*env -> (!Time, !*env)
getCurrentDate :: !*env -> (!Date, !*env) getCurrentDate :: !*env -> (!Date, !*env)
getCurrentTick :: !*env -> (!Tick, !*env) // MW11++ getCurrentTick :: !*env -> (!Tick, !*env)
/* getBlinkInterval /* getBlinkInterval
returns the time interval in ticks that should elapse between blinks of returns the time interval in ticks that should elapse between blinks of
e.g. a cursor. This interval may be changed by the user while the e.g. a cursor. This interval may be changed by the user while the
...@@ -48,6 +46,8 @@ class TimeEnv env where ...@@ -48,6 +46,8 @@ class TimeEnv env where
returns the current Time. returns the current Time.
getCurrentDate getCurrentDate
returns the current Date. returns the current Date.
getCurrentTick
returns the current Tick.
*/ */
instance TimeEnv World instance TimeEnv World
Supports Markdown
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