Commit ceabfacb authored by Peter Achten's avatar Peter Achten

(PA) Uniform Object I/O dd.29 juni '01.

parent c99ba496
This source diff could not be displayed because it is too large. You can view the blob instead.
definition module Random
// **************************************************************************************************
//
// General utility for random number generation.
//
// This module has been written in Clean 1.3.2 and uses the Clean Standard Object I/O library 1.2
//
// **************************************************************************************************
import StdTime
:: RandomSeed
nullRandomSeed :: RandomSeed
// nullRandomSeed generates a useless RandomSeed (random nullRandomSeed = (0,nullRandomSeed)).
getNewRandomSeed:: !*env -> (!RandomSeed, !*env) | TimeEnv env
// GetNewRandomSeed generates a useful RandomSeed, using the current time.
random :: !RandomSeed -> (!Int, !RandomSeed)
// Given a RandomSeed, Random generates a random number and a new RandomSeed.
implementation module Random
import StdInt, StdClass
import StdTime
:: RandomSeed :== Int
nullRandomSeed :: RandomSeed
nullRandomSeed
= 0
getNewRandomSeed :: !*env -> (!RandomSeed, !*env) | TimeEnv env
getNewRandomSeed env
# ({hours,minutes,seconds}, env) = getCurrentTime env
= (1+(hours+minutes+seconds) bitand 65535, env)
random :: !RandomSeed -> (!Int,!RandomSeed)
random seed
= (newSeed,newSeed)
where
newSeed = if (nextSeed>=0) nextSeed (nextSeed+65537)
nextSeed = (seed75 bitand 65535)-(seed75>>16)
seed75 = seed*75
......@@ -10,4 +10,5 @@ CreateCompatibleDC@4
DPtoLP@12
GetTextExtentPointA@16
CreateFontA@56
CreateEllipticRgn@16
PaintRgn@8
......@@ -253,7 +253,8 @@ void EvalCcRqDRAWMBAR (CrossCallInfo *pcci) /* framePtr, clientPtr; no result.
}
/* Track pop up menu. */
void EvalCcRqTRACKPOPMENU (CrossCallInfo *pcci) /* popupmenu,framePtr; BOOL result. */
/* This version returned BOOL. New version must return number of selected item.
void EvalCcRqTRACKPOPMENU (CrossCallInfo *pcci) // popupmenu,framePtr; BOOL result.
{
HMENU popupmenu;
HWND framePtr;
......@@ -270,6 +271,24 @@ void EvalCcRqTRACKPOPMENU (CrossCallInfo *pcci) /* popupmenu,framePtr; BOOL resu
MakeReturn1Cci (pcci,(int)ok);
}
*/
void EvalCcRqTRACKPOPMENU (CrossCallInfo *pcci) /* popupmenu,framePtr; return: index of selected item; modifiers. */
{
HMENU popupmenu;
HWND framePtr;
UINT flags;
POINT mousePos;
int menuItemID;
popupmenu = (HMENU) pcci->p1;
framePtr = (HWND) pcci->p2;
flags = TPM_CENTERALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD;
GetCursorPos (&mousePos);
menuItemID = (int)TrackPopupMenu (popupmenu,flags,mousePos.x,mousePos.y,0,framePtr,NULL);
MakeReturn2Cci (pcci,menuItemID, GetModifiers());
}
void EvalCcRqCREATEPOPMENU (CrossCallInfo *pcci) /* no params; MENU result. */
{
......
......@@ -2864,7 +2864,8 @@ void EvalCcRqCREATEMODALDIALOG (CrossCallInfo *pcci) /* textptr,parentptr; error
pdlgtemplate = p = (PWORD) rmalloc (1000);
/* start to fill in the dlgtemplate information. Addressing by WORDs */
lStyle = WS_CAPTION | DS_SETFONT | DS_MODALFRAME | WS_SYSMENU | DS_SYSMODAL | WS_VISIBLE;
// lStyle = WS_CAPTION | DS_SETFONT | DS_MODALFRAME | WS_SYSMENU | DS_SYSMODAL | WS_VISIBLE; PA: DS_SYSMODAL has become obsolete
lStyle = WS_CAPTION | DS_SETFONT | DS_MODALFRAME | WS_SYSMENU | WS_VISIBLE;
*p++ = LOWORD (lStyle);
*p++ = HIWORD (lStyle);
......
......@@ -333,6 +333,18 @@ void WinCreateRectRgn (int nLeftRect, int nTopRect, int nRightRect, int nBottomR
*oos = ios;
} /* WinCreateRectRgn */
void WinCreateEllipseRgn (int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, OS ios, HRGN * rgn, OS * oos)
{
HRGN theRegion;
theRegion = CreateEllipticRgn (nLeftRect, nTopRect, nRightRect, nBottomRect);
if (theRegion==NULL)
ErrorExit ("Fatal error in WinCreateEllipseRgn: CreateEllipticRgn returned NULL.");
*rgn = theRegion;
*oos = ios;
} /* WinCreateEllipseRgn */
void WinCreatePolygonRgn (POINT * lppt, int cPoints, int fnPolyFillMode, OS ios, HRGN * rgn, OS * oos)
{
HRGN theRegion;
......@@ -1244,6 +1256,14 @@ void WinInvertPolygon (HDC ihdc, OS ios, HDC * ohdc, OS * oos)
} /* WinInvertPolygon */
OS WinPaintRgn (HDC hdc, HRGN hrgn, OS os)
{
StartFilling (hdc);
PaintRgn(hdc, hrgn);
return (os);
} /* WinPaintRgn */
/* PA: two new routines that temporarily create and destroy a DISPLAY HDC.
Use this HDC only for local use.
*/
......
......@@ -34,10 +34,12 @@ extern OS WinFreePolyShape (POINT*,OS);
/* Operations to create, modify and destroy regions.
*/
extern void WinCreateRectRgn (int,int,int,int,OS,HRGN*,OS*);
extern void WinCreateEllipseRgn (int,int,int,int,OS,HRGN*,OS*);
extern void WinCreatePolygonRgn (POINT*,int,int,OS,HRGN*,OS*);
extern void WinSetRgnToRect (int,int,int,int,HRGN,OS,HRGN*,OS*);
extern void WinCombineRgn (HRGN,HRGN,HRGN,int,OS,HRGN*,OS*);
extern void WinGetRgnBox (HRGN,OS,int*,int*,int*,int*,BOOL*,BOOL*,OS*);
extern OS WinPaintRgn (HDC,HRGN,OS);
extern OS WinDeleteObject (HGDIOBJ,OS);
extern void WinSetPenSize (int,HDC,OS,HDC*,OS*);
......
......@@ -2,7 +2,8 @@ definition module clCCall_12
// Clean Object I/O library, version 1.2
from ostoolbox import OSToolbox
from StdIOCommon import Modifiers
from ostoolbox import OSToolbox
:: CSTR :== Int
......@@ -53,6 +54,9 @@ BUTTONDOWN :== 1
BUTTONSTILLUP :== 0 /* PA: new constant for passing mouse move events. */
// PA: moved from windowevent.icl because also used by menuCrossCall_12
toModifiers :: !Int -> Modifiers
winLaunchApp :: !{#Char} !Bool !*OSToolbox -> (!Bool,!*OSToolbox)
winLaunchApp2 :: !{#Char} !{#Char} !Bool !*OSToolbox -> (!Bool,!*OSToolbox)
winCallProcess :: !CSTR !CSTR !CSTR !CSTR !CSTR !CSTR !*OSToolbox -> (!Bool,!Int,!*OSToolbox)
......
......@@ -2,7 +2,9 @@ implementation module clCCall_12
// Clean Object I/O library, version 1.2
from ostoolbox import OSToolbox
import StdClass, StdInt
from StdIOCommon import Modifiers
from ostoolbox import OSToolbox
import code from "cCCallSystem_121.obj",
"cCCallWindows_121.obj",
"cCrossCallWindows_121.obj",
......@@ -60,6 +62,21 @@ BUTTONDOWN :== 1
BUTTONSTILLUP :== 0 /* PA: new constant for passing mouse move events. */
// PA: moved from windowevent.icl because also used by menuCrossCall_12
toModifiers :: !Int -> Modifiers
toModifiers i
= { shiftDown = shifton
, optionDown = alton
, commandDown = ctrlon
, controlDown = ctrlon
, altDown = alton
}
where
shifton = i bitand SHIFTBIT <> 0
alton = i bitand ALTBIT <> 0
ctrlon = i bitand CTRLBIT <> 0
winLaunchApp :: !{#Char} !Bool !*OSToolbox -> ( !Bool, !*OSToolbox)
winLaunchApp _ _ _
= code
......
......@@ -2,6 +2,7 @@ definition module menuCrossCall_12
import StdString
from StdIOCommon import Modifiers
from ostoolbox import OSToolbox
from ostypes import HWND
......@@ -11,7 +12,7 @@ from ostypes import HWND
winCreatePopupMenuHandle:: !*OSToolbox -> (!HMENU, !*OSToolbox)
winTrackPopupMenu :: !HMENU !HWND !*OSToolbox -> (!Bool, !*OSToolbox) // Bool: if True then item is selected; otherwise menu closed
winTrackPopupMenu :: !HMENU !HWND !*OSToolbox -> (!Int,!Modifiers,!*OSToolbox)
winInsertMenu :: !String !Bool !HMENU !HMENU !Int !*OSToolbox -> *OSToolbox
winInsertMenuItem :: !String !Bool !Bool !HMENU !Int !*OSToolbox -> (!HITEM, !*OSToolbox)
winInsertSeparator :: !HMENU !Int !*OSToolbox -> *OSToolbox
......
......@@ -2,8 +2,9 @@ implementation module menuCrossCall_12
import StdInt, StdMisc, StdTuple
from StdIOCommon import Modifiers
import clCrossCall_12
from clCCall_12 import winMakeCString, winReleaseCString, CSTR
from clCCall_12 import winMakeCString, winReleaseCString, CSTR, toModifiers
from ostypes import HWND
......@@ -13,33 +14,33 @@ from ostypes import HWND
winCreatePopupMenuHandle :: !*OSToolbox -> (!HMENU,!*OSToolbox) // PA: check if this can be a C call
winCreatePopupMenuHandle tb
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "CreatePopupMenuHandle ") (Rq0Cci CcRqCREATEPOPMENU) tb
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "winCreatePopupMenuHandle") (Rq0Cci CcRqCREATEPOPMENU) tb
menu = case rcci.ccMsg of
CcRETURN1 -> rcci.p1
CcWASQUIT -> 0
otherwise -> abort "[winCreatePopupMenuHandle] expected CcRETURN1 value."
= (menu,tb)
winTrackPopupMenu :: !HMENU !HWND !*OSToolbox -> (!Bool,!*OSToolbox)
winTrackPopupMenu :: !HMENU !HWND !*OSToolbox -> (!Int,!Modifiers,!*OSToolbox)
winTrackPopupMenu menu framePtr tb
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "TrackPopupMenu") (Rq2Cci CcRqTRACKPOPMENU menu framePtr) tb
ok = case rcci.ccMsg of
CcRETURN1 -> rcci.p1<>0
CcWASQUIT -> False
otherwise -> abort "[winTrackPopupMenu] expected CcRETURN1 value."
= (ok,tb)
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "winTrackPopupMenu") (Rq2Cci CcRqTRACKPOPMENU menu framePtr) tb
(menuItemID,mods) = case rcci.ccMsg of
CcRETURN2 -> (rcci.p1,rcci.p2)
CcWASQUIT -> (0, 0)
otherwise -> abort "[winTrackPopupMenu] expected CcRETURN2 value."
= (menuItemID,toModifiers mods,tb)
winInsertMenu :: !String !Bool !HMENU !HMENU !Int !*OSToolbox -> *OSToolbox
winInsertMenu text state submenu menu pos tb
# (textptr,tb) = winMakeCString text tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "AppendMenu") (Rq5Cci CcRqINSERTMENU (toInt state) menu textptr submenu pos) tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "winInsertMenu") (Rq5Cci CcRqINSERTMENU (toInt state) menu textptr submenu pos) tb
= winReleaseCString textptr tb
winInsertMenuItem :: !String !Bool !Bool !HMENU !Int !*OSToolbox -> (!HITEM,!*OSToolbox)
winInsertMenuItem text ablestate markstate menu pos tb
# (textptr,tb) = winMakeCString text tb
insertCci = Rq5Cci CcRqINSERTMENUITEM (toInt ablestate) menu textptr (toInt markstate) pos
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "InsertMenuItem") insertCci tb
# (rcci,tb) = issueCleanRequest2 (errorCallback2 "winInsertMenuItem") insertCci tb
hitem = case rcci.ccMsg of
CcRETURN1 -> rcci.p1
CcWASQUIT -> 0
......@@ -49,52 +50,52 @@ winInsertMenuItem text ablestate markstate menu pos tb
winInsertSeparator :: !HMENU !Int !*OSToolbox -> *OSToolbox
winInsertSeparator menu pos tb
= snd (issueCleanRequest2 (errorCallback2 "InsertSeparator") (Rq2Cci CcRqINSERTSEPARATOR menu pos) tb)
= snd (issueCleanRequest2 (errorCallback2 "winInsertSeparator") (Rq2Cci CcRqINSERTSEPARATOR menu pos) tb)
winChangeMenuItemCheck :: !HMENU !HITEM !Bool !*OSToolbox -> *OSToolbox
winChangeMenuItemCheck menu hitem state tb
= snd (issueCleanRequest2 (errorCallback2 "CheckMenuItem") (Rq3Cci CcRqCHECKMENUITEM menu hitem (toInt state)) tb)
= snd (issueCleanRequest2 (errorCallback2 "winChangeMenuItemCheck") (Rq3Cci CcRqCHECKMENUITEM menu hitem (toInt state)) tb)
winModifyMenu :: !String !HMENU !HMENU !*OSToolbox -> *OSToolbox
winModifyMenu text submenu menu tb
# (textptr,tb) = winMakeCString text tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "ModifyMenu") (Rq3Cci CcRqMODIFYMENU submenu menu textptr) tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "winModifyMenu") (Rq3Cci CcRqMODIFYMENU submenu menu textptr) tb
= winReleaseCString textptr tb
winModifyMenuItem :: !String !HITEM !HMENU !*OSToolbox -> *OSToolbox
winModifyMenuItem text hitem menu tb
# (textptr,tb) = winMakeCString text tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "ModifyMenuItem") (Rq3Cci CcRqMODIFYMENUITEM hitem menu textptr) tb
# (_,tb) = issueCleanRequest2 (errorCallback2 "winModifyMenuItem") (Rq3Cci CcRqMODIFYMENUITEM hitem menu textptr) tb
= winReleaseCString textptr tb
winDestroyMenu :: !HMENU !*OSToolbox -> *OSToolbox
winDestroyMenu menu tb
= snd (issueCleanRequest2 (errorCallback2 "DestroyMenu") (Rq1Cci CcRqDESTROYMENU menu) tb)
= snd (issueCleanRequest2 (errorCallback2 "winDestroyMenu") (Rq1Cci CcRqDESTROYMENU menu) tb)
winDeleteMenu :: !HMENU !HITEM !*OSToolbox -> *OSToolbox
winDeleteMenu menu hitem tb
= snd (issueCleanRequest2 (errorCallback2 "DeleteMenu") (Rq2Cci CcRqDELETEMENU menu hitem) tb)
= snd (issueCleanRequest2 (errorCallback2 "winDeleteMenu") (Rq2Cci CcRqDELETEMENU menu hitem) tb)
winRemoveMenuItem :: !HMENU !HITEM !*OSToolbox -> *OSToolbox
winRemoveMenuItem menu hitem tb
= snd (issueCleanRequest2 (errorCallback2 "RemoveMenuItem") (Rq2Cci CcRqREMOVEMENUITEM menu hitem) tb)
= snd (issueCleanRequest2 (errorCallback2 "winRemoveMenuItem") (Rq2Cci CcRqREMOVEMENUITEM menu hitem) tb)
winChangeItemAbility :: !HMENU !HITEM !Bool !*OSToolbox -> *OSToolbox
winChangeItemAbility parent hitem onoff tb
= snd (issueCleanRequest2 (errorCallback2 "ChangeItemAbility") (Rq3Cci CcRqITEMENABLE parent hitem (toInt onoff)) tb)
= snd (issueCleanRequest2 (errorCallback2 "winChangeItemAbility") (Rq3Cci CcRqITEMENABLE parent hitem (toInt onoff)) tb)
winChangeMenuAbility :: !HMENU !Int !Bool !*OSToolbox -> *OSToolbox
winChangeMenuAbility parent zIndex onoff tb
= snd (issueCleanRequest2 (errorCallback2 "ChangeMenuAbility") (Rq3Cci CcRqMENUENABLE parent zIndex (toInt onoff)) tb)
= snd (issueCleanRequest2 (errorCallback2 "winChangeMenuAbility") (Rq3Cci CcRqMENUENABLE parent zIndex (toInt onoff)) tb)
winDrawMenuBar :: !HWND !HWND !*OSToolbox -> *OSToolbox
winDrawMenuBar framePtr clientPtr tb
= snd (issueCleanRequest2 (errorCallback2 "DrawMenuBar") (Rq2Cci CcRqDRAWMBAR framePtr clientPtr) tb)
= snd (issueCleanRequest2 (errorCallback2 "winDrawMenuBar") (Rq2Cci CcRqDRAWMBAR framePtr clientPtr) tb)
winAddMenuShortKey :: !HWND !Int !Char !*OSToolbox -> *OSToolbox
winAddMenuShortKey framePtr cmd key tb
= snd (issueCleanRequest2 (errorCallback2 "AddMenuShortKey") (Rq3Cci CcRqADDMENUSHORTKEY framePtr cmd (toInt key)) tb)
= snd (issueCleanRequest2 (errorCallback2 "winAddMenuShortKey") (Rq3Cci CcRqADDMENUSHORTKEY framePtr cmd (toInt key)) tb)
winRemoveMenuShortKey :: !HWND !Int !*OSToolbox -> *OSToolbox
winRemoveMenuShortKey framePtr cmd tb
= snd (issueCleanRequest2 (errorCallback2 "RemoveMenuShortKey") (Rq2Cci CcRqREMOVEMENUSHORTKEY framePtr cmd) tb)
= snd (issueCleanRequest2 (errorCallback2 "winRemoveMenuShortKey") (Rq2Cci CcRqREMOVEMENUSHORTKEY framePtr cmd) tb)
......@@ -10,9 +10,14 @@ definition module menuevent
import deviceevents, devicesystemstate, menuhandle
from iostate import PSt, IOSt
from osmenu import OSTrackPopUpMenu, OSTrackPopUpMenuResult, PopUpTrackedByIndex, PopUpTrackedByItemId
menuEvent :: !SchedulerEvent !(PSt .l) -> (!Bool,!Maybe DeviceEvent,!SchedulerEvent,!PSt .l)
menuEvent :: !SchedulerEvent !(PSt .l) -> (!Bool,!Maybe DeviceEvent,!SchedulerEvent,!PSt .l)
menuHandlesGetMenuStateHandles :: !(MenuHandles .pst) -> (![MenuStateHandle .pst], !MenuHandles .pst)
// PA: moved from menudevice
/* For pop up menu's an alternative way to determine the DeviceEvent is required:
*/
popUpMenuEvent :: !OSTrackPopUpMenu !(MenuStateHandle .ps) !*OSToolbox -> (!Maybe DeviceEvent, !MenuStateHandle .ps, !*OSToolbox)
//menuHandlesGetMenuStateHandles :: !(MenuHandles .pst) -> (![MenuStateHandle .pst], !MenuHandles .pst)
// PA: not used
definition module menuwindowmenu
// Clean object I/O library, version 1.2
// The definition and implementation of the WindowMenu.
from iostate import PSt, IOSt
import windowhandle
openWindowMenu :: !( PSt .l) -> PSt .l
addWindowToWindowMenu :: !Id !Title !( PSt .l) -> PSt .l
removeWindowFromWindowMenu :: !Id !(IOSt .l) -> IOSt .l
validateWindowActivateForWindowMenu` :: !Id !Bool ![WindowAttribute *(.ls,PSt .p)] -> [WindowAttribute *(.ls,PSt .p)]
//validateWindowActivateForWindowMenu :: !Id !(WindowLSHandle .ls (PSt .l)) !(IOSt .l)
// -> (!WindowLSHandle .ls (PSt .l), ! IOSt .l)
changeWindowInWindowMenu :: !Id !String !(IOSt .l) -> IOSt .l
implementation module menuwindowmenu
// Version 1.2
// The definition and implementation of the WindowMenu.
// PA: implementation not required on Windows platform.
from iostate import PSt, IOSt
import windowhandle
/* openWindowMenu creates the WindowMenu. This menu contains atleast the following elements:
- MenuItem "&Cascade":
Reorder the current list of windows from left-top to right-bottom.
- MenuItem "Tile &Horizontally":
Reorder the current list of windows from top to bottom.
- MenuItem "&Tile Vertically":
Reorder the current list of windows from left to right.
- MenuSeparator
- RadioMenu:
Display all current open windows (hidden and shown). Selection activates and
shows the indicated window.
*/
openWindowMenu :: !(PSt .l) -> PSt .l
openWindowMenu pState = pState
/* addWindowToWindowMenu adds a new item to the RadioMenu of the WindowMenu if present.
The Id argument is the id of the window that should be added, and the Title argument its title.
*/
addWindowToWindowMenu :: !Id !Title !(PSt .l) -> PSt .l
addWindowToWindowMenu windowId windowTitle pState = pState
/* removeWindowFromWindowMenu removes the window entry from the WindowMenu if present.
*/
removeWindowFromWindowMenu :: !Id !(IOSt .l) -> IOSt .l
removeWindowFromWindowMenu wId ioState = ioState
changeWindowInWindowMenu :: !Id !String !(IOSt .l) -> IOSt .l
changeWindowInWindowMenu wId title ioState = ioState
/* validateWindowActivateForWindowMenu takes care that if this interactive process is an MDI process,
and the WindowLSHandle represents a Windows instance that the WindowActivate function of the
WindowLSHandle will select the proper RadioMenuItem of the WindowMenu if present before any other
actions are taken.
*/
validateWindowActivateForWindowMenu` :: !Id !Bool ![WindowAttribute *(.ls,PSt .p)] -> [WindowAttribute *(.ls,PSt .p)]
validateWindowActivateForWindowMenu` wId isMDI atts = atts
/* PA: apparantly this function is not required.
validateWindowActivateForWindowMenu :: !Id !(WindowLSHandle .ls (PSt .l)) !(IOSt .l)
-> (!WindowLSHandle .ls (PSt .l), !IOSt .l)
validateWindowActivateForWindowMenu wId dlsH=:{wlsHandle=dH=:{whAtts,whKind}} ioState = (dlsH,ioState)
*/
......@@ -10,7 +10,7 @@ import ospicture
toBitmap :: !OSBitmap -> Bitmap
fromBitmap :: !Bitmap -> OSBitmap
// osReadBitmap reads a bitmap from a file. See page 176 of Programming Windows 95 (Charles Petzold)
// osReadBitmap reads a bitmap from a file.
osReadBitmap :: !*File -> (!Bool,!OSBitmap,!*File)
// osGetBitmapSize returns the size of the bitmap
......
......@@ -5,11 +5,13 @@ definition module osclipboard
// Clipboard operations.
import ostoolbox
from clipboardCrossCall_12 import CF_TEXT
:: OSClipboardItemType
:== Int
OSClipboardText
:== 1 // CF_TEXT
:== CF_TEXT
osInitialiseClipboard :: !*OSToolbox -> *OSToolbox
// osInitialiseClipboard should be evaluated before any of the functions below.
......
......@@ -10,7 +10,7 @@ import clipboardCrossCall_12
:: OSClipboardItemType
:== Int
OSClipboardText
:== 1 // CF_TEXT
:== CF_TEXT
osInitialiseClipboard :: !*OSToolbox -> *OSToolbox
osInitialiseClipboard tb
......
......@@ -2,12 +2,9 @@ definition module osdocumentinterface
// Clean object I/O library, version 1.2
import StdMaybe, StdOverloaded
import StdIOCommon
from menuCrossCall_12 import HMENU
from ostoolbox import OSToolbox
from ostoolbar import OSToolbar, OSToolbarHandle
from ostypes import HWND
import ostoolbar, ostoolbox, ostypes
:: OSDInfo
= OSMDInfo !OSMDInfo
......@@ -70,3 +67,8 @@ osCloseOSDInfo:: !OSDInfo !*OSToolbox -> *OSToolbox
/* getOSDInfoOSToolbar retrieves the OSToolbar, if any.
*/
getOSDInfoOSToolbar :: !OSDInfo -> Maybe OSToolbar
/* osOSDInfoIsActive tests if the given OSDInfo represents the interactive process with the
active menu system. (Always True on Windows; use menu bar on Mac.)
*/
osOSDInfoIsActive :: !OSDInfo !*OSToolbox -> (!Bool, !*OSToolbox)
......@@ -182,3 +182,9 @@ getOSDInfoOSToolbar :: !OSDInfo -> Maybe OSToolbar
getOSDInfoOSToolbar (OSMDInfo {osmdOSInfo={osToolbar}}) = osToolbar
getOSDInfoOSToolbar (OSSDInfo {ossdOSInfo={osToolbar}}) = osToolbar
getOSDInfoOSToolbar _ = Nothing
/* osOSDInfoIsActive tests if the given OSDInfo represents the interactive process with the
active menu system. (Always True on Windows; use menu bar on Mac.)
*/
osOSDInfoIsActive :: !OSDInfo !*OSToolbox -> (!Bool, !*OSToolbox)
osOSDInfoIsActive osdinfo tb = (True,tb)
......@@ -13,8 +13,9 @@ from StdMaybe import Maybe, Just, Nothing
:: *OSEvents
osNewEvents :: OSEvents
//osCopyEvents :: !OSEvents -> (!OSEvents,!OSEvents) PA: not used
osAppendEvents :: !*[OSEvent] !OSEvents -> OSEvents // osAppendEvents adds events at the end of the queue
osInsertEvents :: !*[OSEvent] !OSEvents -> OSEvents // osAppendEvents adds events at the front of the queue
osInsertEvents :: !*[OSEvent] !OSEvents -> OSEvents // osInsertEvents adds events at the front of the queue
osIsEmptyEvents :: !OSEvents -> (!Bool,!OSEvents)
osRemoveEvent :: !OSEvents -> (!OSEvent,!OSEvents)
......@@ -23,6 +24,7 @@ osRemoveEvent :: !OSEvents -> (!OSEvent,!OSEvents)
:== CrossCallInfo
:: OSSleepTime // The max time the process allows multi-tasking
:== Int