Commit d40c8434 authored by Peter Achten's avatar Peter Achten

(PA) modifications for Clean 2.0 compatibility.

parent e0332fb4
......@@ -2,7 +2,7 @@ implementation module Random
import StdInt, StdClass
from StdTime import getCurrentTime, Time
import StdTime
:: RandomSeed :== Int
......
......@@ -6,10 +6,9 @@ definition module StdGameDef
// StdGameDef contains all the type definitions needed to specify a game.
// ********************************************************************************
import StdString
from StdFunc import St
from StdOverloaded import zero
from StdString import String
from StdIOBasic import Point2, Size, IdFun
from StdMaybe import Maybe, Just, Nothing
from StdPictureDef import Colour, RGB, RGBColour, Black, White,
......
......@@ -7,9 +7,9 @@ implementation module StdGameDef
// StdGameDef contains all the type definitions needed to specify a game.
// ********************************************************************************
import StdString
from StdFunc import St
from StdOverloaded import zero
from StdString import String
from StdIOBasic import Point2, Size, IdFun
from StdMaybe import Maybe, Just, Nothing
from StdPictureDef import Colour, RGB, RGBColour, Black, White,
......
......@@ -140,7 +140,7 @@ OSSetBoundMap :: !Int !Int !Int !*OSToolbox -> (!GRESULT, !*OSToolbox)
OSSetBoundMap x y newvalue tb
= WinSetBoundMap x y newvalue tb
handleGameEvents :: !CrossCallInfo !(OSGameData .gs) !*OSToolbox -> (!CrossCallInfo,!OSGameData .gs,!*OSToolbox)
handleGameEvents :: !CrossCallInfo !v:(OSGameData u:gs) !*OSToolbox -> (!CrossCallInfo,!v:OSGameData u:gs,!*OSToolbox), [v<=u]
handleGameEvents fromOSCci=:{ccMsg=CcWmGAMEKEYBOARD,p1=key,p2=x,p3=y} state tb
= (Return2Cci x` y`,state,tb)
where
......@@ -252,7 +252,7 @@ MakePoint :: !Int !Int -> Point2
MakePoint a b = {x = a, y = b}
handleUserEvent :: !Int !InstanceID !Int !Int !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleUserEvent :: !Int !InstanceID !Int !Int !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:(OSGameData u:gs), !*OSToolbox), [v<=u]
handleUserEvent objtype id ev par1 par2 data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -282,7 +282,7 @@ where
handleAnimationEvent :: !Int !InstanceID !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleAnimationEvent :: !Int !InstanceID !v:(OSGameData u:gs) !*OSToolbox -> (!v:(OSGameData u:gs), !*OSToolbox), [v<=u]
handleAnimationEvent objtype id data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -312,7 +312,7 @@ where
handleTimerEvent :: !Int !InstanceID !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleTimerEvent :: !Int !InstanceID !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox), [v<=u]
handleTimerEvent objtype id data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -342,7 +342,7 @@ where
moveGameObject :: !Int !InstanceID !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
moveGameObject :: !Int !InstanceID !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox)
moveGameObject objtype id data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -371,7 +371,7 @@ where
// = ({obj & instances`=newinstances},objrec,gst)
touchBound :: !Int !InstanceID !Int !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
touchBound :: !Int !InstanceID !Int !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox)
touchBound objtype id dir mapcode data=:{gamest,gamehnd} tb
# directions = makeDirectionSet dir
# maybefound = getobject objtype gamehnd
......@@ -401,7 +401,7 @@ where
initialiseGameObject :: !Int !Int !InstanceID !Point2 !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
initialiseGameObject :: !Int !Int !InstanceID !Point2 !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox)
initialiseGameObject objtype subtype id p time data=:{scroll,gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -424,7 +424,7 @@ where
= ({obj & instances`=newinstances},objrec,gst)
doneGameObject :: !Int !InstanceID !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
doneGameObject :: !Int !InstanceID !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox)
doneGameObject objtype id data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -453,7 +453,7 @@ where
handleCollision :: !Int !InstanceID !Int !InstanceID !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleCollision :: !Int !InstanceID !Int !InstanceID !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox), [v<=u]
handleCollision ot1 id1 ot2 id2 dir data=:{gamest,gamehnd} tb
# directions = makeDirectionSet dir
# maybefound = getobject ot1 gamehnd
......@@ -485,7 +485,7 @@ where
handleKeyDown :: !Int !InstanceID !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleKeyDown :: !Int !InstanceID !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox), [v<=u]
handleKeyDown objtype id key data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......@@ -514,7 +514,7 @@ where
// = ({obj & instances`=newinstances},objrec,gst)
handleKeyUp :: !Int !InstanceID !Int !(OSGameData .gs) !*OSToolbox -> (!OSGameData .gs, !*OSToolbox)
handleKeyUp :: !Int !InstanceID !Int !v:(OSGameData u:gs) !*OSToolbox -> (!v:OSGameData u:gs, !*OSToolbox), [v<=u]
handleKeyUp objtype id key data=:{gamest,gamehnd} tb
# maybefound = getobject objtype gamehnd
| isJust maybefound
......
definition module menuCrossCall_12
from StdString import String
import StdString
from ostoolbox import OSToolbox
from ostypes import HWND
......
......@@ -91,7 +91,7 @@ where
# (found,mMenus)= UContains (eqMenuId menuId) mMenus
= (found,{mHs & mMenus=mMenus})
where
eqMenuId :: !Id !(MenuStateHandle .pst) -> (!Bool,!MenuStateHandle .pst)
eqMenuId :: !Id !(MenuStateHandle .pst) -> *(!Bool,!MenuStateHandle .pst)
eqMenuId theId msH
# (mId,msH) = menuStateHandleGetMenuId msH
= (theId==mId,msH)
......
......@@ -2,12 +2,12 @@ definition module osdocumentinterface
// Clean object I/O library, version 1.2
import StdMaybe
import StdMaybe, StdOverloaded
import StdIOCommon
from menuCrossCall_12 import HMENU
from ostoolbox import OSToolbox
from ostoolbar import OSToolbar, OSToolbarHandle
from ostypes import HWND
from StdIOCommon import DocumentInterface, MDI, SDI, NDI
:: OSDInfo
= OSMDInfo !OSMDInfo
......
......@@ -4,9 +4,9 @@ implementation module osdocumentinterface
// Clean object I/O library, version 1.2
import StdMaybe, StdTuple
import StdMaybe, StdOverloaded, StdString, StdTuple
import clCrossCall_12, ostoolbar, ossystem, ostypes, windowCrossCall_12
from commondef import FatalError,String
from commondef import FatalError
from StdIOCommon import DocumentInterface, MDI, SDI, NDI
......
......@@ -2,7 +2,7 @@ definition module osfileselect
// Clean Object I/O library, version 1.2
from StdString import String
import StdString
from ostoolbox import OSToolbox
import osevent
......
......@@ -5,7 +5,8 @@ definition module osfont
from StdOverloaded import ==
from StdString import String
//from StdString import String
import StdString
from ostoolbox import OSToolbox
......
......@@ -4,7 +4,7 @@ implementation module osfont
// Clean Object I/O library, version 1.2
import StdBool, StdEnum, StdReal
import StdBool, StdClass, StdEnum, StdReal
import clCrossCall_12, pictCCall_12
from clCCall_12 import WinMakeCString, WinGetCString, CSTR, WinGetVertResolution
from StdPictureDef import FontName, FontSize, FontStyle, BoldStyle, ItalicsStyle, UnderlinedStyle
......@@ -99,8 +99,8 @@ where
OSfontnames :: !*OSToolbox -> (![String], !*OSToolbox)
OSfontnames tb
# GetFontNamesCci = {ccMsg=CcRqGETFONTNAMES,p1=0,p2=0,p3=0,p4=0,p5=0,p6=0}
# (_,unsortednames,tb) = IssueCleanRequest FontnamesCallback GetFontNamesCci [] tb
# getFontNamesCci = {ccMsg=CcRqGETFONTNAMES,p1=0,p2=0,p3=0,p4=0,p5=0,p6=0}
# (_,unsortednames,tb) = IssueCleanRequest FontnamesCallback getFontNamesCci [] tb
= (SortAndRemoveDuplicates unsortednames,tb)
where
FontnamesCallback :: !CrossCallInfo ![FontName] !*OSToolbox -> (!CrossCallInfo,![String],!*OSToolbox)
......
......@@ -103,7 +103,7 @@ where
# (x,mb_context,os) = printPagePerPageBothSemaphor
doDialog emulateScreen x initFun transFun printSetup (Just context) os
= (x,EnvSetOS os (fromJust mb_context))
zipWithSelectState :: .Id *(IOSt .a) -> *(.(Maybe SelectState,Id),*IOSt .a)
zipWithSelectState :: Id (IOSt .l) -> (v:(Maybe SelectState,Id),IOSt .l)
zipWithSelectState id io
#! (mbSelectState, io) = getWindowSelectState id io
= ((mbSelectState, id), io)
......@@ -130,10 +130,11 @@ where
= (printSetup, files) // oh lala
printPagePerPageBothSemaphor :: !.Bool !.Bool .a
.(.a -> .(.PrintInfo -> .(.Picture -> *((.Bool,.Origin),*(.b,*Picture))))) ((.b,.Picture) -> *((.Bool,.Origin),*(.b,*Picture)))
!.PrintSetup *(Maybe *Context) !*OSToolbox
-> *(Alternative .a .b,*Maybe *Context,!.OSToolbox);
printPagePerPageBothSemaphor :: !Bool !Bool .a
.(.a -> .(.PrintInfo -> .(*Picture -> *((Bool,Origin),*(.b,*Picture)))))
(*(.b,*Picture) -> *((Bool,Origin),*(.b,*Picture)))
!PrintSetup *(Maybe *Context) !*OSToolbox
-> *(*(Alternative .a .b),*(Maybe *Context),!*OSToolbox)
printPagePerPageBothSemaphor p1 p2 x p4 p5 printSetup mb_context os
// with this mechanism it is assured, that only one print job can happen at a time
// addSemaphor adds the parameter to a C global and gives back the previous value of that
......@@ -146,10 +147,11 @@ printPagePerPageBothSemaphor p1 p2 x p4 p5 printSetup mb_context os
(_,os) = addSemaphor (-1) os
= (result,mb_context,os)
printPagePerPageBoth :: !.Bool !.Bool .a
.(.a -> .(.PrintInfo -> .(.Picture -> *((.Bool,.Origin),*(.b,*Picture))))) ((.b,.Picture) -> *((.Bool,.Origin),*(.b,*Picture)))
.PrintSetup *(Maybe *Context) !*OSToolbox
-> *(Alternative .a .b,*Maybe *Context,!.OSToolbox);
printPagePerPageBoth :: !Bool !Bool .a
.(.a -> .(.PrintInfo -> .(*Picture -> *((Bool,Origin),*(.b,*Picture)))))
(*(.b,*Picture) -> *((Bool,Origin),*(.b,*Picture)))
PrintSetup *(Maybe *Context) !*OSToolbox
-> *(*(Alternative .a .b),*(Maybe *Context),!*OSToolbox)
printPagePerPageBoth doDialog emulateScreen x initFun transFun printSetup mb_context os
// do the print dialog (or not) and get the hdc and the printInfo
......@@ -187,11 +189,10 @@ printPagePerPageBoth doDialog emulateScreen x initFun transFun printSetup mb_con
(mb_context, os) = CCendDoc hdc mb_context os
= (StartedPrinting finalState, mb_context, (deleteDC hdc os))
printPages :: Int
((.a,.Picture) -> *((.Bool,u:Origin),*(.a,*Picture)))
(Bool,v:Origin) .a HDC *(Maybe *Context) !*OSToolbox
-> *(.a,HDC,*Maybe *Context,!.OSToolbox), [u <= v];
printPages :: Int
(*(.a,*Picture) -> *((Bool,Origin),* (.a,*Picture)))
(Bool,Origin) .a HDC *(Maybe *Context) !*OSToolbox
-> *(.a,HDC,*(Maybe *Context),!*OSToolbox)
printPages _ _ (True,_) state hdc mb_context os
=(state,hdc,mb_context,os)
printPages pageNr fun (_,origin) state hdc mb_context os
......@@ -324,7 +325,7 @@ evtlSwitchToOS pageNr hdc (Just context) os
# os = WinReleaseCString textPtr os
= (Just context, os)
initPicture :: !.Origin !*(!.OSPictContext,!*OSToolbox) -> !.Picture
initPicture :: !.Origin !*(!.OSPictContext,!*OSToolbox) -> *Picture
initPicture origin intPict
= packPicture origin defaultPen False (fst intPict) (snd intPict)
......
......@@ -2,7 +2,7 @@ definition module ossystem
// Clean Object I/O library, version 1.2
from StdString import String
import StdString
from StdMaybe import Maybe, Just, Nothing
from menuCrossCall_12 import HMENU
from osdocumentinterface import OSDInfo, OSMDInfo, OSSDInfo, OSInfo, OSToolbar, OSToolbarHandle
......
......@@ -4,9 +4,7 @@ definition module oswindow
// Clean Object I/O library, version 1.2
from StdString import String
from StdOverloaded import ==
from StdMaybe import Maybe, Just, Nothing
import StdMaybe, StdOverloaded, StdString
from osdocumentinterface import OSDInfo, OSMDInfo, OSSDInfo, OSInfo, OSToolbar, OSToolbarHandle, HMENU, HWND
from osevent import OSEvent, CrossCallInfo
from osfont import Font
......@@ -112,20 +110,20 @@ OSgetSliderControlMinWidth :: !OSWindowMetrics -> Int
OScreateDialog :: !Bool
!Bool !String !(!Int,!Int) !(!Int,!Int) !OSWindowPtr
!(.s->(OSWindowPtr,.s))
!(OSWindowPtr-> .s -> *OSToolbox -> (.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!.s,!*OSToolbox)
!(u:s->*(OSWindowPtr,u:s))
!(OSWindowPtr-> u:s -> u:(*OSToolbox -> *(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!OSDInfo !u:s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!u:s,!*OSToolbox)
OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!Int) !(!Int,!Int)
!Bool !String !(!Int,!Int) !(!Int,!Int)
!(.s->(OSWindowPtr,.s))
!(OSWindowPtr-> .s -> *OSToolbox -> (.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !OSWindowPtr !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox)
OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> .s -> ([Int],.s)) !.s !*OSToolbox
-> (!Bool,!.s,!*OSToolbox)
!(u:s->*(OSWindowPtr,u:s))
!(OSWindowPtr-> u:s -> u:(*OSToolbox -> *(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!OSDInfo !OSWindowPtr !u:s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!u:s,!*OSToolbox)
OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> u:s -> *([Int],u:s)) !u:s !*OSToolbox
-> (!Bool,!u:s,!*OSToolbox)
// Mike //
......
......@@ -133,11 +133,11 @@ OSgetSliderControlMinWidth _ = 0
| DelayDeactivatedControl OSWindowPtr OSWindowPtr // the control (@2) in window (@1) has become inactive
OScreateDialog :: !Bool !Bool !String !(!Int,!Int) !(!Int,!Int) !OSWindowPtr
!(.s->(OSWindowPtr,.s))
!(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!.s,!*OSToolbox)
!(u:s->*(OSWindowPtr,u:s))
!(OSWindowPtr->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!OSDInfo !u:s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!u:s,!*OSToolbox)
OScreateDialog isModal isClosable title pos size behindPtr get_focus create_controls update_controls osdinfo control_info tb
# (textPtr,tb) = WinMakeCString title tb
createcci = Rq4Cci CcRqCREATEDIALOG textPtr parentptr (if (behindPtr==OSNoWindowPtr) 0 behindPtr) (toInt isModal)
......@@ -156,11 +156,11 @@ where
Nothing -> 0
Just {osFrame} -> osFrame
OScreateDialogCallback :: !(.s->(OSWindowPtr,.s))
!(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!CrossCallInfo !(.s,[DelayActivationInfo]) !*OSToolbox
-> (!CrossCallInfo,!(.s,[DelayActivationInfo]),!*OSToolbox)
OScreateDialogCallback :: !(u:s->*(OSWindowPtr,u:s))
!(OSWindowPtr->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!CrossCallInfo !*(u:s,[DelayActivationInfo]) !*OSToolbox
-> (!CrossCallInfo,!*(u:s,[DelayActivationInfo]),!*OSToolbox)
OScreateDialogCallback _ _ _ {ccMsg=CcWmPAINT,p1=hwnd} s tb
= //trace_n "OScreateDialogCallback CcWmPAINT"
(Return0Cci, s, WinFakePaint hwnd tb)
......@@ -194,11 +194,11 @@ where
OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!Int) !(!Int,!Int)
!Bool !String !(!Int,!Int) !(!Int,!Int)
!(.s->(OSWindowPtr,.s))
!(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !OSWindowPtr !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox)
!(u:s->*(OSWindowPtr,u:s))
!(OSWindowPtr->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!OSDInfo !OSWindowPtr !u:s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!u:s,!*OSToolbox)
OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbiHasScroll=hasVScroll} minSize maxSize
isClosable title pos size
get_focus
......@@ -254,10 +254,10 @@ where
osFrame = osinfo.osFrame
OScreateWindowCallback :: !Bool !(!Int,!Int) !(!Int,!Int)
!(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!CrossCallInfo !(.s,[DelayActivationInfo]) !*OSToolbox
-> (!CrossCallInfo,!(.s,[DelayActivationInfo]),!*OSToolbox)
!(OSWindowPtr->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!(OSWindowPtr->OSWindowPtr->OSPictContext->u:s->u:(*OSToolbox->*(u:s,*OSToolbox)))
!CrossCallInfo !*(u:s,[DelayActivationInfo]) !*OSToolbox
-> (!CrossCallInfo,!*(u:s,[DelayActivationInfo]),!*OSToolbox)
/* PA: This alternative replaced by WinFakePaint function.
OScreateWindowCallback _ _ _ _ _ {ccMsg=CcWmPAINT,p1=hwnd} s tb
= //trace "OScreateWindowCallback CcWmPAINT"
......@@ -306,7 +306,8 @@ OScreateWindowCallback _ _ _ _ _ {ccMsg} s tb
/* PA: new function that creates modal dialog and handles events until termination.
The Bool result is True iff no error occurred.
*/
OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> .s -> ([Int],.s)) !.s !*OSToolbox -> (!Bool,!.s,!*OSToolbox)
OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> u:s -> *([Int],u:s)) !u:s !*OSToolbox
-> (!Bool,!u:s,!*OSToolbox)
OScreateModalDialog isClosable title osdinfo currentActiveModal handleOSEvents s tb
# (textPtr,tb) = WinMakeCString title tb
createcci = Rq2Cci CcRqCREATEMODALDIALOG textPtr parentptr
......@@ -325,7 +326,7 @@ where
)
(fromJust currentActiveModal)
OScreateModalDialogCallback :: !(OSEvent -> .s -> ([Int],.s)) !CrossCallInfo !.s !*OSToolbox -> (!CrossCallInfo,!.s,!*OSToolbox)
OScreateModalDialogCallback :: !(OSEvent -> u:s -> *([Int],u:s)) !CrossCallInfo !u:s !*OSToolbox -> (!CrossCallInfo,!u:s,!*OSToolbox)
OScreateModalDialogCallback handleOSEvents osEvent s tb
// # (replyToOS,s) = handleOSEvents (if (osEvent.ccMsg==CcWmIDLETIMER) osEvent (trace_n ("OScreateModalDialogCallback-->"+++toString osEvent) osEvent)) s
# (replyToOS,s) = handleOSEvents osEvent s
......
definition module windowCrossCall_12
from StdString import String
import StdString
from ostoolbox import OSToolbox
from ostypes import HWND
from rgnCCall_12 import HRGN
......
......@@ -7,7 +7,7 @@ implementation module StdControlClass
import StdBool, StdFunc, StdList, StdMisc, StdTuple
import commondef, iostate, StdControlAttribute, windowhandle//, id, iostate, StdControlAttribute
import commondef, iostate, StdControlAttribute, windowhandle
from controlvalidate import validateSliderState
from StdPSt import accScreenPicture
from windowvalidate import validateViewDomain
......
......@@ -8,10 +8,9 @@ implementation module StdIOCommon
// ********************************************************************************
import StdBool, StdFunc, StdInt, StdList, StdOverloaded, StdString
import StdBitmap, StdIOBasic, StdKey, StdMaybe
import StdArray, StdBool, StdFunc, StdInt, StdList, StdOverloaded, StdString
import id, StdBitmap, StdIOBasic, StdKey, StdMaybe
from commondef import StateMap2
from id import Id, WindowMenuId, toId, RId, R2Id, RIdtoId, R2IdtoId, toString
/* The SelectState type. */
......@@ -107,14 +106,14 @@ instance == KeyState where
instance toString KeyboardState where
toString :: !KeyboardState -> {#Char}
toString (CharKey char keystate)
= brackify ("CharKey "+++fromChar char+++" "+++brackify ("ASCII: "+++toString (toInt char))+++" "+++toString keystate)
= brackify ("CharKey "+++toString char+++" "+++brackify ("ASCII: "+++toString (toInt char))+++" "+++toString keystate)
toString (SpecialKey special keystate modifiers)
= brackify ("SpecialKey "+++itemsList " " [toString special,toString keystate,toString modifiers])
toString KeyLost
= "KeyLost"
instance toString KeyState where
toString :: !KeyState -> {#Char}
toString (KeyDown isRepeat) = brackify ("KeyDown "+++toString isRepeat)
toString (KeyDown isRepeat) = brackify ("KeyDown "+++fromBool isRepeat)
toString KeyUp = "KeyUp"
......
......@@ -32,9 +32,9 @@ class Ids env where
is generated.
*/
instance Ids World,
IOSt .l,
PSt .l
instance Ids World
instance Ids (IOSt .l)
instance Ids (PSt .l)
getParentId :: !Id !(IOSt .l) -> (!Maybe Id,!IOSt .l)
/* getParentId returns the Id of the parent top-level GUI object
......
......@@ -19,10 +19,10 @@ 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)
u_isJust :: !u:(Maybe v:x) -> (!Bool, !u:(Maybe v:x)), [u<=v]
u_isNothing :: !u:(Maybe v:x) -> (!Bool, !u:(Maybe v:x)), [u<=v]
accMaybe :: .(St .x .a) !(Maybe .x) -> (!Maybe .a,!Maybe .x)
accMaybe :: .(St u:x .a) !v:(Maybe u:x) -> (!Maybe .a,!v:(Maybe u:x)), [v<=u]
// accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f Nothing = (Nothing,Nothing)
......
......@@ -22,13 +22,13 @@ isNothing :: !(Maybe .x) -> Bool
isNothing Nothing = True
isNothing _ = False
u_isJust :: !(Maybe .x) -> (!Bool, !Maybe .x)
u_isJust :: !u:(Maybe v:x) -> (!Bool, !u:(Maybe v:x)), [u<=v]
u_isJust nothing=:Nothing
= (False, nothing)
u_isJust just
= (True, just)
u_isNothing :: !(Maybe .x) -> (!Bool, !Maybe .x)
u_isNothing :: !u:(Maybe v:x) -> (!Bool, !u:(Maybe v:x)), [u<=v]
u_isNothing nothing=:Nothing
= (True, nothing)
u_isNothing just
......@@ -37,7 +37,7 @@ u_isNothing just
fromJust :: !(Maybe .x) -> .x
fromJust (Just x) = x
accMaybe :: .(St .x .a) !(Maybe .x) -> (!Maybe .a,!Maybe .x)
accMaybe :: .(St u:x .a) !v:(Maybe u:x) -> (!Maybe .a,!v:(Maybe u:x)), [v<=u]
accMaybe f (Just x)
# (a,x) = f x
= (Just a,Just x)
......