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
controlSize :: !(cdef .ls (PSt .l)) !Bool
!(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int))
!(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
opened as an element of a window/dialog.
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}
:: IdFun st :== st -> st
:: Void = Void // MW11++
:: Void = Void
......@@ -82,7 +82,7 @@ getMouseStateButtonState:: !MouseState -> ButtonState // ButtonUp if MouseLos
instance == MouseState // Equality on MouseState
instance == ButtonState // Constructor equality
instance toString MouseState
instance toString ButtonState
/* The SliderState type. */
......@@ -298,6 +298,8 @@ instance toString DocumentInterface // Constructor as String
| SliderDecLarge
| SliderThumb Int
instance toString SliderMove
/* Scrolling function. */
......@@ -346,7 +348,5 @@ stdUnfillUpdAreaLook :: SelectState !UpdateState !*Picture -> *Picture
instance == ErrorReport // Constructor equality
instance toString ErrorReport // Constructor as String
// MW11..
:: OkBool // iff True, the operation was successful
:== Bool
// ..MW11
......@@ -203,6 +203,14 @@ instance toString MouseState where
toString (MouseDrag pos modifiers) = brackify ("MouseDrag "+++itemsList " " [toString pos,toString modifiers])
toString (MouseUp pos modifiers) = brackify ("MouseUp " +++itemsList " " [toString pos,toString modifiers])
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. */
......@@ -537,6 +545,13 @@ instance toString DocumentInterface where
| SliderDecLarge
| 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. */
......
......@@ -18,6 +18,10 @@ isJust :: !(Maybe .x) -> Bool // case @1 of (Just _) -> True; _ -> False
isNothing :: !(Maybe .x) -> Bool // not o isJust
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 f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f Nothing = (Nothing,Nothing)
......
......@@ -22,6 +22,18 @@ isNothing :: !(Maybe .x) -> Bool
isNothing Nothing = True
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 (Just x) = x
......
......@@ -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:
getDocumentInterface :: !(IOSt .l) -> (!DocumentInterface, !IOSt .l)
......
......@@ -18,13 +18,11 @@ from iostate import PSt, IOSt
- FileSelectEnv (see StdFileSelect)
- TimeEnv (see StdTime)
- 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 FileEnv (PSt .l), (IOSt .l) // MW11 added IOSt
instance FileEnv (PSt .l), (IOSt .l)
instance FileSelectEnv (PSt .l)
instance TimeEnv (PSt .l), (IOSt .l) // MW11 added IOSt
instance TimeEnv (PSt .l), (IOSt .l)
instance playSoundFile (PSt .l)
......@@ -11,7 +11,6 @@ definition module StdPrint
// ********************************************************************************
// MW11 was from StdPicture import Picture, Point
from StdPicture import Picture, Point2
from StdIOCommon import Size, Rectangle, IdFun, UpdateState, ViewFrame, UpdateArea
from StdOverloaded import ==
......@@ -56,7 +55,7 @@ freadPrintSetup :: !*File !*env -> (!Bool, !PrintSetup, !*File, !*env)
print :: !Bool !Bool
.(PrintInfo !*Picture -> ([IdFun *Picture],!*Picture))
!PrintSetup !*printEnv
-> (!PrintSetup,!*printEnv)
-> (!PrintSetup,!*printEnv)
| PrintEnvironments printEnv
/* print doDialog emulateScreen pages printSetup env
......@@ -81,8 +80,8 @@ print :: !Bool !Bool
printUpdateFunction
:: !Bool (UpdateState -> *Picture -> *Picture) [Rectangle]
!PrintSetup !*printEnv
-> (!PrintSetup, !*printEnv)
| PrintEnvironments printEnv
-> (!PrintSetup,!*printEnv)
| PrintEnvironments printEnv
/* printUpdateFunction doDialog update area printSetup env
sends the content of the update function of a given area to the printer:
......@@ -98,7 +97,6 @@ printUpdateFunction
identical to print.
*/
// MW11 changed Point into Point2
printPagePerPage :: !Bool !Bool
.x
.(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture)))))
......
......@@ -37,8 +37,6 @@ fileToCharStream :: !*File -> *FileCharStream
charStreamToFile :: !*FileCharStream -> *File
printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv
-> (!(!*charStream,!PrintSetup),!*printEnv)
| CharStreams charStream & PrintEnvironments printEnv
......@@ -61,8 +59,6 @@ printText1 :: !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup !*printEnv
*/
printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintSetup
!*printEnv
-> (!(!*charStream,!PrintSetup),!*printEnv)
......@@ -80,8 +76,6 @@ printText2 :: !String !String !Bool !WrapMode !FontDef !Int !*charStream !PrintS
*/
printText3 ::!Bool !WrapMode !FontDef !Int
.(PrintInfo *Picture -> (state, (Int,Int), *Picture))
(state Int *Picture -> *Picture)
......
......@@ -17,7 +17,6 @@ from id import RId, R2Id, RIdtoId, R2IdtoId, ==
// Open uni- and bi-directional receivers:
// MW11 reopenReceiver removed, made types unique
class Receivers rdef where
openReceiver :: .ls !*(*rdef .ls (PSt .l)) !(PSt .l) -> (!ErrorReport,!PSt .l)
getReceiverType:: *(*rdef .ls .pst) -> ReceiverType
......
......@@ -25,18 +25,18 @@ applicationpath :: !String -> String
Use these directories to store preference/options/help files of an application.
*/
newlineChars :: !String // MW11++
newlineChars :: !String
/* the newline characters in a textfile
*/
printSetupTypical :: Bool
// System dependencies concerning the time resolution
ticksPerSecond :: Int
/* ticksPerSecond returns the maximum timer resolution per second.
*/
printSetupTypical :: Bool // MW11++
// System dependencies concerning the screen resolution.
mmperinch :== 25.4
......
......@@ -21,7 +21,7 @@ applicationpath :: !String -> String
applicationpath fname = OShomepath fname
// MW11++
newlineChars :: !String
newlineChars :: !String
newlineChars = OSnewlineChars
// System dependencies concerning the time resolution
......@@ -58,5 +58,5 @@ where
(w,h) = OSmaxScrollWindowSize
// MW11++
printSetupTypical :: Bool
printSetupTypical :: Bool
printSetupTypical = OSprintSetupTypical
......@@ -8,7 +8,7 @@ definition module StdTime
// ********************************************************************************
from StdOverloaded import <
from ostick import Tick // MW11++
from ostick import Tick
:: Time
= { hours :: !Int // hours (0-23)
......@@ -28,18 +28,16 @@ wait :: !Int .x -> .x
If n<=0, then x is evaluated immediately.
*/
// MW11..
instance < Tick
intPlusTick :: !Int !Tick -> Tick
tickDifference :: !Tick !Tick -> Int
// .. MW11
intPlusTick :: !Int !Tick -> Tick
tickDifference :: !Tick !Tick -> Int
class TimeEnv env where
getBlinkInterval:: !*env -> (!Int, !*env)
getCurrentTime :: !*env -> (!Time, !*env)
getCurrentDate :: !*env -> (!Date, !*env)
getCurrentTick :: !*env -> (!Tick, !*env) // MW11++
getCurrentTick :: !*env -> (!Tick, !*env)
/* getBlinkInterval
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
......@@ -48,6 +46,8 @@ class TimeEnv env where
returns the current Time.
getCurrentDate
returns the current Date.
getCurrentTick
returns the current Tick.
*/
instance TimeEnv World
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