Commit 9bce33f9 authored by Diederik van Arkel's avatar Diederik van Arkel

Mainly strictness annot fixes and comments

parent f37a1b41
......@@ -369,7 +369,7 @@ where
, x
)
:: DeltaItemHandle x
:== x !OSMenu !Int !MenuElementHandle` !*OSToolbox -> *(!MenuElementHandle`,!*OSToolbox)
:== x OSMenu Int MenuElementHandle` *OSToolbox -> *(MenuElementHandle`,*OSToolbox)
:: Recurse
:== ( !Bool // Visit SubMenu elements
, !Bool // Visit RadioMenu elements
......
......@@ -319,7 +319,7 @@ instance toRegion (:^: area1 area2) | toRegion area1 & toRegion area2 where
toRegion (r1 :^: r2) = toRegion r1 + toRegion r2
instance zero Region where
zero :: !Region
zero :: Region
zero = {region_shape=[],region_bound=zero}
instance + Region where
(+) :: !Region !Region -> Region
......
......@@ -59,7 +59,7 @@ freadPrintSetup :: !*File !*env -> (!Bool,!PrintSetup,!*File,!*env)
*/
print :: !Bool !Bool
.(PrintInfo !*Picture -> ([IdFun *Picture],!*Picture))
.(PrintInfo *Picture -> ([IdFun *Picture],*Picture))
!PrintSetup !*env
-> (!PrintSetup,!*env)
| PrintEnvironments env
......
......@@ -72,7 +72,7 @@ freadPrintSetup file env
print :: !Bool !Bool
.(PrintInfo !*Picture -> ([IdFun *Picture],!*Picture))
.(PrintInfo *Picture -> ([IdFun *Picture],*Picture))
!PrintSetup !*printEnv
-> (!PrintSetup, !*printEnv)
| PrintEnvironments printEnv
......
......@@ -60,7 +60,7 @@ where
lastCh :: !Char, // contains the last character, that was read via freadLineP or evtlSkipLine
pageNo :: !Int, // actual page number
noDoneCopies :: !Int, // # copies done yet
firstPageState :: Maybe !FirstPageState,
firstPageState :: Maybe FirstPageState,
rO :: !ReadOnly userInfo
// these values won't be altered
}
......@@ -90,7 +90,7 @@ where
printableSet :: !{#Bool}, // this array represents the set of all printable characters in the font
topBsLn :: !Int, // first baseline of a page
maxBsLn :: !Int, // text won't be drawn below this baseline
eachPageDrawFunc:: userInfo !Int !*Picture -> *Picture,
eachPageDrawFunc:: userInfo Int *Picture -> *Picture,
wrapMode :: !WrapMode, // eachPageDrawFunc, wrapMode and spacePerTab are given as parameters
spacePerTab :: !Int,
tabWidth :: Real, // width of tabulator in Pixels, annotating this strict won't work
......@@ -234,20 +234,13 @@ initState :: !*( .Int,
| CharStreams charStream
initState (wrapMode, fontDef, spacePerTab, textRangeFunc, eachPageDrawFunc, file)
printInfo=:{ printSetup, jobInfo={range=(from`,to)} } picture
# {page={w=width,h=height}} = getPageDimensions printSetup emulateScr
(userInfo,(top, bot), picture)
= textRangeFunc printInfo picture
# {page={w=width,h=height}} = getPageDimensions printSetup emulateScr
(userInfo,(top, bot), picture) = textRangeFunc printInfo picture
((_,font),picture) = openFont fontDef picture
# ((_,font),picture) = openFont fontDef picture
({fAscent, fDescent, fMaxWidth, fLeading}, picture)
= getFontMetrics font picture
/* PA: I guess Diederik added this for debugging purposes.
# (res,_) = os_getresolution 42
// # res = trace_n ("PrintRes",res) res
| fst res == 42 = abort "aaaarggh"
*/
# lineHeight
= fAscent + fDescent + fLeading
= getFontMetrics font picture
# lineHeight = fAscent + fDescent + fLeading
// Check top and bot
......
......@@ -27,7 +27,7 @@ applicationpath :: !String -> String
Use these directories to store preference/options/help files of an application.
*/
newlineChars :: !String
newlineChars :: String
/* the newline characters in a textfile
*/
......
......@@ -18,7 +18,7 @@ applicationpath :: !String -> String
applicationpath fname = osApplicationpath fname
// MW11++
newlineChars :: !String
newlineChars :: String
newlineChars = OSnewlineChars
// System dependencies concerning the time resolution
......
......@@ -144,7 +144,7 @@ where
(hasTip,tipAtt) = cselect isControlTip undef itemH.wItemAtts
isEditable = contains isControlKeyboard itemH.wItemAtts
appendPopUp :: !OSWindowPtr !(Maybe !OSWindowPtr) !Index !(PopUpControlItem .pst) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp :: !OSWindowPtr !(Maybe OSWindowPtr) !Index !(PopUpControlItem .pst) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp popUpPtr editPtr index (title,_) (itemNr,tb)
# (_,tb) = osCreatePopUpControlItem popUpPtr editPtr (-1) ableContext title (index==itemNr) itemNr tb
= (itemNr+1,tb)
......
......@@ -1019,7 +1019,7 @@ where
newIndex = if (curIndex<=index) curIndex (curIndex+index)
(before,after) = split index curItems
appendPopUp :: !OSWindowPtr !(Maybe !OSWindowPtr) !Index !(PopUpControlItem .pst) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp :: !OSWindowPtr !(Maybe OSWindowPtr) !Index !(PopUpControlItem .pst) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp popUpPtr editPtr index (title,_) (itemNr,tb)
# (_,tb) = osCreatePopUpControlItem popUpPtr editPtr (-1) ableContext title (index==itemNr) itemNr tb
= (itemNr+1,tb)
......@@ -1108,7 +1108,7 @@ where
nrNewItems = length newItems
newIndex = if (isMember curIndex indexs) 1 (min nrNewItems curIndex)
appendPopUp :: !OSWindowPtr !(Maybe !OSWindowPtr) !Index !(PopUpControlItem .ps) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp :: !OSWindowPtr !(Maybe OSWindowPtr) !Index !(PopUpControlItem .ps) !(!Int,!*OSToolbox) -> (!Int,!*OSToolbox)
appendPopUp popUpPtr editPtr index (title,_) (itemNr,tb)
# (_,tb) = osCreatePopUpControlItem popUpPtr editPtr (-1) ableContext title (index==itemNr) itemNr tb
= (itemNr+1,tb)
......
......@@ -48,15 +48,15 @@ from timertable import :: TimerTable
:: InputTrackKind // Input source kinds:
= { itkMouse :: !Bool // mouse
, itkKeyboard :: !Bool // keyboard
, itkChar :: !Int // DvA: key that is being tracked
, itkSlider :: !Maybe !SliderTrackInfo // DvA: slider tracking
, itkChar :: !Int // key that is being tracked
, itkSlider :: !Maybe SliderTrackInfo // extra slider tracking info
}
:: SliderTrackInfo // PA: please add comments to meaning of record and fields
= { stiControl :: !OSWindowPtr
, stiPart :: !Int
, stiHilite :: !Bool
, stiDirection:: !Direction
, stiIsControl:: !Bool
:: SliderTrackInfo // Slider being tracked:
= { stiControl :: !OSWindowPtr // control being tracked (OSNoWindowPtr if window)
, stiPart :: !Int // part of slider being tracked
, stiHilite :: !Bool // currently highlighted
, stiDirection:: !Direction // slider direction
, stiIsControl:: !Bool // is slider control
}
:: ClipboardState
= { cbsCount :: !Int // ScrapCount of last access
......
......@@ -82,15 +82,15 @@ iostateFatalError function error
:: InputTrackKind // Input source kinds:
= { itkMouse :: !Bool // mouse
, itkKeyboard :: !Bool // keyboard
, itkChar :: !Int // DvA: key that is being tracked
, itkSlider :: !Maybe !SliderTrackInfo // DvA: slider tracking
, itkChar :: !Int // key that is being tracked
, itkSlider :: !Maybe SliderTrackInfo // extra slider tracking info
}
:: SliderTrackInfo // PA: please add comments to meaning of record and fields
= { stiControl :: !OSWindowPtr
, stiPart :: !Int
, stiHilite :: !Bool
, stiDirection:: !Direction
, stiIsControl:: !Bool
:: SliderTrackInfo // Slider being tracked:
= { stiControl :: !OSWindowPtr // control being tracked (OSNoWindowPtr if window)
, stiPart :: !Int // part of slider being tracked
, stiHilite :: !Bool // currently highlighted
, stiDirection:: !Direction // slider direction
, stiIsControl:: !Bool // is slider control
}
:: ClipboardState
= { cbsCount :: !Int // ScrapCount of last access
......
......@@ -26,9 +26,10 @@ copyKeyFocus :: !*KeyFocus -> (!KeyFocus,!*KeyFocus)
/* DvA: unused?
openFocusItems :: !(Maybe Int) !*[FocusItem] !*KeyFocus -> *KeyFocus
closeFocusItems :: ![Int] !*KeyFocus -> *KeyFocus
*/
showFocusItems :: ![Int] !*KeyFocus -> *KeyFocus
hideFocusItems :: ![Int] !*KeyFocus -> *KeyFocus
*/
getCurrentFocusItem :: !*KeyFocus -> (!Maybe Int,!*KeyFocus)
setNoFocusItem :: !*KeyFocus -> *KeyFocus
setNewFocusItem :: !Int !*KeyFocus -> *KeyFocus
......
......@@ -71,6 +71,7 @@ menuClose pState=:{io=ioState}
# (tb,ioState) = getIOToolbox ioState
// DvA: what about sub menu's, seem to be forgetting these here...
// PA: this happens automatically on Windows, but you're right. The function disposeMenuHandles should take of this. Not yet done.
// DvA: can't we call closemenu from menuinternal instead of this whole function?
# (menus,(osMenuBar,tb)) = disposeMenuHandles (isJust opt_guishare) menus (osMenuBar,tb)
# ioState = setIOToolbox tb ioState
osdinfo = setOSDInfoOSMenuBar osMenuBar osdinfo
......
......@@ -29,7 +29,7 @@ import ostoolbox
, rOneWay :: Bool // The receiver definition was Receiver (not Receiver2)
, rFun :: RHandleFunction ls m r pst // If rOneWay then [r]==[], otherwise [r]==[_]
// MW11..
, rInetInfo :: !Maybe (!EndpointRef`,!InetReceiverCategory`,!Int,!IdFun !*OSToolbox)
, rInetInfo :: !Maybe (EndpointRef`,InetReceiverCategory`,Int,IdFun *OSToolbox)
// For internet receivers
, rConnected :: ![Id] // storing the argument of the ReceiverCloseAlsoReceivers attribute
// ..MW11
......
......@@ -20,7 +20,7 @@ import ostoolbox
, rSelect :: SelectState // The current SelectState of the receiver
, rOneWay :: Bool // Flag: True iff receiver is uni-directional
, rFun :: RHandleFunction ls m r pst // If rOneWay then [r]==[], otherwise [r]==[_]
, rInetInfo :: !Maybe (!EndpointRef`,!InetReceiverCategory`,!Int,!IdFun !*OSToolbox)
, rInetInfo :: !Maybe (EndpointRef`,InetReceiverCategory`,Int,IdFun *OSToolbox)
// For internet receivers
, rConnected :: ![Id] // storing the argument of the ReceiverCloseAlsoReceivers attribute
}
......
......@@ -25,7 +25,7 @@ from StdProcessDef import :: DocumentInterface, :: ProcessInit
= { envsEvents :: !*OSEvents
, envsWorld :: !*World
}
:: *Context
:: *Context // DvA: can be made abstract if we move modalDialogExists from windowcreate to here...
= { cEnvs :: !*Environs // The global environments
, cProcessStack :: !ProcessStack // The global process stack
, cMaxIONr :: !SystemId // The global maximum system number
......
......@@ -314,7 +314,7 @@ where
getWItemAtt` (ControlVScroll f) = ControlVScroll` f
getWItemAtt` (ControlWidth width) = ControlWidth` width
getWItemInfo` :: !OSWindowPtr !OSWindowPtr !(WItemInfo .ls .pst) !*OSToolbox -> !(WItemInfo`,!WItemInfo .ls .pst,!*OSToolbox)
getWItemInfo` :: !OSWindowPtr !OSWindowPtr !(WItemInfo .ls .pst) !*OSToolbox -> (WItemInfo`,!WItemInfo .ls .pst,!*OSToolbox)
getWItemInfo` wPtr itemPtr info=:(RadioInfo {radioItems,radioLayout,radioIndex}) tb
= ( RadioInfo` { radioItems` = map getRadioInfo` radioItems
, radioLayout` = radioLayout
......@@ -360,8 +360,7 @@ where
getPopUpInfoEdit` Nothing tb
= (Nothing,tb)
getPopUpInfoEdit` (Just info=:{popUpEditPtr}) tb
# (content,tb) = osGetEditControlText wPtr popUpEditPtr tb
# tb = trace_n ("getPopUpInfoEdit`",content) tb
# (content,tb) = osGetEditControlText wPtr popUpEditPtr tb // DvA: Netter osGetPopUpControlText ???
= (Just {info & popUpEditText=content},tb)
getWItemInfo` wPtr itemPtr info=:(SliderInfo {sliderInfoDir,sliderInfoLength,sliderInfoState}) tb
= ( SliderInfo` { sliderInfoDir` = sliderInfoDir
......@@ -660,24 +659,3 @@ instance toString (ControlAttribute .st) where
toString (ControlVScroll _) = "ControlVScroll"
toString (ControlWidth _) = "ControlWidth"
//--
trace_n _ f :== f
/*
from StdFile import fwritec,fwrites,stderr
from dodebug import toString
from StdMisc import undef
l_trace_n :: !msg .a -> .a | toString msg;
l_trace_n message a
| l_file_to_true (fwritec '\n' (fwrites (toString message) stderr))
= a;
= undef;
l_file_to_true :: !File -> Bool;
l_file_to_true file
= code {
.inline l_file_to_true
pop_b 2
pushB TRUE
.end
}
*/
......@@ -11,7 +11,7 @@ definition module wstateaccess
import wstate
from keyfocus import :: FocusItem
//from keyfocus import :: FocusItem
setWElements :: (WItemHandle` *([arg],.s) -> (WItemHandle`,*([arg],.s))) ![WElementHandle`] !*(![arg],!.s)
......@@ -22,7 +22,7 @@ setWElement :: ( Id WItemHandle` .s -> *( Bool,WItemHandle`,.s)) !Id ![
-> *(!Bool, ![WElementHandle`],!.s)
setWItemHandle :: ( WItemHandle` .s -> *( Bool,WItemHandle`,.s)) ![WElementHandle`] !.s
-> *(!Bool, ![WElementHandle`],!.s)
getWElementKeyFocusIds` :: !Bool ![WElementHandle`] -> [FocusItem]
//getWElementKeyFocusIds` :: !Bool ![WElementHandle`] -> [FocusItem]
instance == WRecursiveKind
......
......@@ -85,7 +85,7 @@ where
// Determine the list of window items that can obtain the keyboard input focus.
/*
getWElementKeyFocusIds` :: !Bool ![WElementHandle`] -> [FocusItem]
getWElementKeyFocusIds` shownContext [itemH:itemHs]
= getWElementKeyFocusIds`` shownContext itemH++getWElementKeyFocusIds` shownContext itemHs
......@@ -106,7 +106,7 @@ where
= getWElementKeyFocusIds` shownContext itemHs
getWElementKeyFocusIds` _ _
= []
*/
instance == WRecursiveKind where
(==) IsWListLSHandle wRecKind = case wRecKind of
......
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