// //------------------ DOK FILE -------------------------------------------------- +Header uiLib =pkg bios =title UI =short user interface =desc Different kinds of UI are available: - a command line UI: read the keyboard input on windows or the standard input on unix. Write on the output with echo, echoLn, ... - a graphic UI: windows on PCs or fullscreen on mobiles, based on bitmaps or OpenGL // // //------------------ PROTO ----------------------------------------------------- KeyMask_Alt +Proto KeyMask_Alt =type Int =mode constant =pkg bios =impl native =link =desc Keyboard key state // // //------------------ PROTO ----------------------------------------------------- KeyMask_Control +Proto KeyMask_Control =type Int =mode constant =pkg bios =impl native =link =desc Keyboard key state // // //------------------ PROTO ----------------------------------------------------- KeyMask_Meta +Proto KeyMask_Meta =type Int =mode constant =pkg bios =impl native =link =desc Keyboard key state // // //------------------ PROTO ----------------------------------------------------- KeyMask_Shift +Proto KeyMask_Shift =type Int =mode constant =pkg bios =impl native =link =desc Keyboard key state // // //------------------ PROTO ----------------------------------------------------- Key_Caps_Lock +Proto Key_Caps_Lock =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Delete +Proto Key_Delete =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Down +Proto Key_Down =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_End +Proto Key_End =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F10 +Proto Key_F10 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F11 +Proto Key_F11 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F12 +Proto Key_F12 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F1 +Proto Key_F1 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F2 +Proto Key_F2 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F3 +Proto Key_F3 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F4 +Proto Key_F4 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F5 +Proto Key_F5 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F6 +Proto Key_F6 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F7 +Proto Key_F7 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F8 +Proto Key_F8 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_F9 +Proto Key_F9 =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Home +Proto Key_Home =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Insert +Proto Key_Insert =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Left +Proto Key_Left =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Next +Proto Key_Next =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Num_Lock +Proto Key_Num_Lock =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Page_Down +Proto Key_Page_Down =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Page_Up +Proto Key_Page_Up =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Pause +Proto Key_Pause =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Prior +Proto Key_Prior =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Right +Proto Key_Right =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Scroll_Lock +Proto Key_Scroll_Lock =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Sys_Req +Proto Key_Sys_Req =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- Key_Up +Proto Key_Up =type Int =mode constant =pkg bios =impl native =link =desc Special keyboard keycode // // //------------------ PROTO ----------------------------------------------------- UI_FULLSCREEN +Proto UI_FULLSCREEN =type Int =mode constant =pkg bios =impl native =link =desc To use with [[uiStart]]. On desktop, this mask will open a fullscreen window without decoration (top menu bar and borders). On mobile, this mask is ignored. // // //------------------ PROTO ----------------------------------------------------- UI_GL +Proto UI_GL =type Int =mode constant =pkg bios =impl native =link =desc To use with [[uiStart]]. This will initialize the ui display ready for OpenGL. This mask can be used in combination with UI_NORMAL, UI_FULLSCREEN, UI_RESIZE. // // //------------------ PROTO ----------------------------------------------------- UI_NORMAL +Proto UI_NORMAL =type Int =mode constant =pkg bios =impl native =link =desc To use with [[uiStart]]. This is the default mode: on desktop, this mask will open a window with decoration and not resizable. On mobile, this mask is ignored. // // //------------------ PROTO ----------------------------------------------------- UI_RESIZE +Proto UI_RESIZE =type Int =mode constant =pkg bios =impl native =link =desc To use with [[uiStart]]. On desktop, this mask will open a window with resizable borders. On mobile, this mask is ignored. // // //------------------ PROTO ----------------------------------------------------- keyboardState +Proto keyboardState =type fun -> Int =mode function =pkg bios =impl native =link =desc This function returns the current keyboard state of special keys: [[KeyMask_Alt]], [[KeyMask_Control]], [[KeyMask_Meta]], [[KeyMask_Shift]]. // +arg result =type Int =desc A mask of bits. // // //------------------ PROTO ----------------------------------------------------- uiBuffer +Proto uiBuffer =type fun -> Bitmap =mode function =pkg bios =impl mcy =link =desc This function returns the current display buffer bitmap. You should draw in this buffer and then call [[uiUpdate]] to send it to the screen. When the user resizes the window, the buffer is resized too. This is not for openGL UI. When starting the UI with [[UI_GL]], you are expected to draw with openGL functions and eventually call [[glSwapBuffers]]. // +arg result =type Bitmap =desc A bitmap // // //------------------ PROTO ----------------------------------------------------- uiH +Proto uiH =type fun -> Int =mode function =pkg bios =impl mcy =link =desc This function returns the current height of the UI. // +arg result =type Int =desc A positive number // // //------------------ PROTO ----------------------------------------------------- uiOnClick +Proto uiOnClick =type fun (fun Int Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when a Click event is fired. Button values are 1, 2, 3, respectively left, middle, right // +arg fClick =type fun Int Int Int -> a1 =desc A lambda function with 3 arguments x, y, button, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnClose +Proto uiOnClose =type fun (fun -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the user attempts to close the UI. When this lambda function is not defined or is nil, the Bios will call [[uiStop]]. When this lambda function is defined, it is its responsability to call [[uiStop]] or not. // +arg fClose =type fun -> Bool =desc A lambda function without argument, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnHwheel +Proto uiOnHwheel =type fun (fun Int Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the user activate the horizontal wheel. The system passes 3 parameters: x, y, delta - (x, y) is the position of the mouse in the UI window - delta is the direction and the speed // +arg fHwheel =type fun Int Int Int -> a1 =desc A lambda function with 3 arguments x, y, delta, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnKeyDown +Proto uiOnKeyDown =type fun (fun Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the user press a key. The system passes 1 parameter: the keycode. The keycode may be an ASCII code, or a special key like: function keys, arrows, delete, page up/down, ... These special keycodes are constants such as [[XK_F1]], [[XK_Right]], [[XK_Delete]], [[XK_Page_Down]], ... There is also a function [[uiOnKeyUp]]: it defines a lambda function fKeyUp which is called with the same keycode when the user releases the key. The auto-repeat mecanism will call fKeyDown repeatedly, before a fKeyUp when the key is released. // +arg fKeyDown =type fun Int -> a1 =desc A lambda function with 1 argument and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnKeyUp +Proto uiOnKeyUp =type fun (fun Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the key is released. See [[uiOnKeyDown]] for information on the keycode and the auto-repeat. // +arg fKeyUp =type fun Int -> a1 =desc A lambda function with 1 argument and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnMouseMove +Proto uiOnMouseMove =type fun (fun Int Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when a MouseMove event is fired. Button value 0 means rollover. Other button values are 1, 2, 3, respectively left, middle, right // +arg fMouseMove =type fun Int Int Int -> a1 =desc A lambda function with 3 arguments x, y, button, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnPaint +Proto uiOnPaint =type fun (fun -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the UI window is exposed, after it has been covered. This mecanism could vary from one host to another. Do not make any assumption on its behaviour, just redraw the UI with [[uiUpdate]] or with openGL rendering. // +arg fPaint =type fun -> a1 =desc A lambda function with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnSize +Proto uiOnSize =type fun (fun Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the user resizes the UI window. The system passes the new size with 2 parameters, width and height. // +arg fSize =type fun Int Int -> a1 =desc A lambda function with 2 arguments width, height, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnUnclick +Proto uiOnUnclick =type fun (fun Int Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when an UnClick event is fired. // +arg fUnclick =type fun Int Int Int -> a1 =desc A lambda function with 3 arguments x, y, button, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnVwheel +Proto uiOnVwheel =type fun (fun Int Int Int -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the user activate the vertical wheel. The system passes 3 parameters: x, y, delta - (x, y) is the position of the mouse in the UI window - delta is the direction and the speed // +arg fVwheel =type fun Int Int Int -> a1 =desc A lambda function with 3 arguments x, y, delta, and with any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiResize +Proto uiResize =type fun Int Int -> Bool =mode function =pkg bios =impl native =link =desc This function moves and resize the UI window. When x or y are nil, they remain unchanged. // +arg width =type Int =desc A positive integer // +arg height =type Int =desc A positive integer // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiSetTitle +Proto uiSetTitle =type fun Str -> Str =mode function =pkg bios =impl native =link =desc On computers, this function updates the title of the UI window. // +arg str =type Str =desc A string // +arg result =type Str =desc The same string // // //------------------ PROTO ----------------------------------------------------- uiStart +Proto uiStart =type fun Int Int Int Int Int Str -> Bool =mode function =pkg bios =impl mcy =link =desc This function starts the UI. Its behaviour is different on PCs and on mobiles. On mobile, the UI is always the full screen. On PCs it opens a window. This leads to some other differences: - on PCs it is possible to set a name, a position (x,y) and a size (width, height). - on PCs it is possible to use [[UI_NORMAL]] (default when nil), [[UI_RESIZE]], [[UI_FULLSCREEN]]. It has no effect on mobiles. On iOS, you must use the [[UI_GL]] mask. // +arg x =type Int =desc A positive integer // +arg y =type Int =desc A positive integer // +arg width =type Int =desc A positive integer // +arg height =type Int =desc A positive integer // +arg type =type Int =desc A flag, made of [[UI_NORMAL]], [[UI_RESIZE]], [[UI_FULLSCREEN]], [[UI_GL]] // +arg name =type Str =desc A string // +arg result =type Bool =desc A boolean // // //------------------ PROTO ----------------------------------------------------- uiStop +Proto uiStop =type fun -> Bool =mode function =pkg bios =impl mcy =link =desc This function stops the UI. On computer it closes the window. It returns true, except if the UI was not started. // +arg result =type Bool =desc A boolean // // //------------------ PROTO ----------------------------------------------------- uiUpdate +Proto uiUpdate =type fun -> Int =mode function =pkg bios =impl mcy =link =desc This function sends the current content of [[uiBuffer]] to the screen. It has no effect when UI is initialized with [[UI_GL]]. Use [[uiUpdateRegion]] when you need to update a small part of the screen. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiUpdateRegion +Proto uiUpdateRegion =type fun Int Int Int Int -> Int =mode function =pkg bios =impl mcy =link =desc This function sends a region of the [[uiBuffer]] to the screen. It has no effect when UI is initialized with [[UI_GL]]. Use [[uiUpdate]] when you need to update the full screen. // +arg x =type Int =desc A positive integer // +arg y =type Int =desc A positive integer // +arg width =type Int =desc A positive integer // +arg height =type Int =desc A positive integer // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiW +Proto uiW =type fun -> Int =mode function =pkg bios =impl mcy =link =desc This function returns the current width of the UI. // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- uiMultiTouch +Proto uiMultiTouch =type fun -> list [Int Int] =mode function =pkg bios =impl mcy =link =desc This function returns the list of current fingers positions on the screen. It is updated just before any mouse event (click, unclick or move). On touch screens, the sequence of events is the following: - a click event is fired when the first finger touches the screen. Its coordinates are provided to the click callback (see [[uiOnClick]], button is always 1), and they are also available in [[uiMultiTouch]]. - then, move events are fired when another finger hits the screen, or when fingers move on the screen. All fingers are available in [[uiMultiTouch]]. The coordinates provided to the move callback (see [[uiOnMouseMove]], button is always 1) are the average coordinates of all fingers. - an unclick event is fired when the last finger is removed from the screen. Its coordinates are provided to the unclick callback (see [[uiOnUnclick]], button is always 1), [[uiMultiTouch]] is always nil. // +arg result =type list [Int Int] =desc A list of coordinates [x y] // // //------------------ PROTO ----------------------------------------------------- uiOnSuspend +Proto uiOnSuspend =type fun (fun -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the system is going to suspend. // +arg fSuspend =type fun -> a1 =desc A lambda function with no argument and any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnResume +Proto uiOnResume =type fun (fun -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when the system resumes after suspension. // +arg fResume =type fun -> a1 =desc A lambda function with no argument and any result. // +arg result =type Bool =desc Always true // // //------------------ PROTO ----------------------------------------------------- uiOnDropFiles +Proto uiOnDropFiles =type fun (fun Int Int list Str -> a1) -> Bool =mode function =pkg bios =impl mcy =link =desc // +arg cb =type fun Int Int list Str -> a1 =desc // +arg result =type Bool =desc // // //------------------ PROTO ----------------------------------------------------- screenH +Proto screenH =type fun -> Int =mode function =pkg bios =impl native =link =desc This function returns the screen height. // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- screenW +Proto screenW =type fun -> Int =mode function =pkg bios =impl native =link =desc This function returns the screen width. // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- clipboardCopy +Proto clipboardCopy =type fun Str -> Str =mode function =pkg bios =impl native =link =desc This function store the string data into the host clipboard. // +arg data =type Str =desc A string // +arg result =type Str =desc The same string // // //------------------ PROTO ----------------------------------------------------- clipboardPaste +Proto clipboardPaste =type fun -> Str =mode function =pkg bios =impl native =link =desc This function returns the current content of the host clipboard. // +arg result =type Str =desc A string // // //------------------ PROTO ----------------------------------------------------- keyboardShow +Proto keyboardShow =type fun -> Bool =mode function =pkg bios =impl native =link =desc This function brings up the virtual keyboard on mobile. // +arg result =type Bool =desc // // //------------------ PROTO ----------------------------------------------------- keyboardHide +Proto keyboardHide =type fun -> Bool =mode function =pkg bios =impl native =link =desc This function brings down the virtual keyboard on mobile. // +arg result =type Bool =desc // // //------------------ PROTO ----------------------------------------------------- keyboardHeight +Proto keyboardHeight =type fun -> Int =mode function =pkg bios =impl native =link =desc This function returns the height of the virtual keyboard on mobile. // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- accelerometerInit +Proto accelerometerInit =type fun Float -> Float =mode function =pkg bios =impl native =link =desc This function initializes the frequency of the accelerometer capture device (number of values per second). Use nil to stop the capture. Use [[accelerometerX]], [[accelerometerY]],[[accelerometerZ]] to read the captured data. // +arg freq =type Float =desc A positive floating number or nil // +arg result =type Float =desc The same floating number // // //------------------ PROTO ----------------------------------------------------- accelerometerX +Proto accelerometerX =type fun -> Float =mode function =pkg bios =impl native =link =desc This function returns the current x-coordinate of the accelerometer, nil if the accelerometer is not initilized or if there is no accelerometer on the host. // +arg result =type Float =desc A floating number or nil // // //------------------ PROTO ----------------------------------------------------- accelerometerY +Proto accelerometerY =type fun -> Float =mode function =pkg bios =impl native =link =desc This function returns the current y-coordinate of the accelerometer, nil if the accelerometer is not initilized or if there is no accelerometer on the host. // +arg result =type Float =desc A floating number or nil // // //------------------ PROTO ----------------------------------------------------- accelerometerZ +Proto accelerometerZ =type fun -> Float =mode function =pkg bios =impl native =link =desc This function returns the current z-coordinate of the accelerometer, nil if the accelerometer is not initilized or if there is no accelerometer on the host. // +arg result =type Float =desc A floating number or nil // // //------------------ PROTO ----------------------------------------------------- orientationGet +Proto orientationGet =type fun -> Int =mode function =pkg bios =impl native =link =desc // +arg result =type Int =desc // // //------------------ PROTO ----------------------------------------------------- onPrompt +Proto onPrompt =type fun a1 (fun Str -> a2) -> Keyboard =mode Function =pkg bios =impl mcy =link =desc // +arg name =type a1 =desc // +arg fOnInput =type fun Str -> a2 =desc // +arg result =type Keyboard =desc A structure designing the keyboard input // // //------------------ PROTO ----------------------------------------------------- onInput +Proto onInput =type fun (fun Str -> a1) (fun -> a2) -> Keyboard =mode function =pkg bios =impl mcy =link =desc This function defines a lambda function which will be called when bytes are available from the keyboard. // +arg fRead =type fun Str -> a1 =desc A lambda function with one string argument and any result. // +arg fWrite =type fun -> a2 =desc A lambda function without argument and any result. // +arg result =type Keyboard =desc A structure designing the keyboard input // // //------------------ PROTO ----------------------------------------------------- Cursor +Proto Cursor =type Cursor =mode type =pkg bios =impl native =link =desc // // //------------------ PROTO ----------------------------------------------------- cursorShow +Proto cursorShow =type fun Cursor -> Cursor =mode function =pkg bios =impl mcy =link =desc // +arg cursor =type Cursor =desc // +arg result =type Cursor =desc // // //------------------ PROTO ----------------------------------------------------- cursorCreate +Proto cursorCreate =type fun Bitmap Int Int -> Cursor =mode function =pkg bios =impl mcy =link =desc // +arg bitmap =type Bitmap =desc // +arg xhot =type Int =desc // +arg yhot =type Int =desc // +arg result =type Cursor =desc // // //------------------ PROTO ----------------------------------------------------- cursorSize +Proto cursorSize =type fun -> [Int Int] =mode function =pkg bios =impl native =link =desc // +arg result =type [Int Int] =desc // // //------------------ PROTO ----------------------------------------------------- soundPlaying +Proto soundPlaying =type fun Sample -> Bool =mode function =pkg bios =impl native =link =desc // +arg A =type Sample =desc // +arg result =type Bool =desc // // //------------------ PROTO ----------------------------------------------------- soundAbort +Proto soundAbort =type fun Sample -> Sample =mode function =pkg bios =impl native =link =desc // +arg A =type Sample =desc // +arg result =type Sample =desc // // //------------------ PROTO ----------------------------------------------------- soundStart +Proto soundStart =type fun Str Float Int -> Sample =mode function =pkg bios =impl native =link =desc // +arg A =type Str =desc // +arg B =type Float =desc // +arg C =type Int =desc // +arg result =type Sample =desc // // //------------------ PROTO ----------------------------------------------------- Sample +Proto Sample =type Sample =mode type =pkg bios =impl native =link =desc // // //------------------ PROTO ----------------------------------------------------- uiBufferSetSize +Proto uiBufferSetSize =type fun Int Int Bool -> Int =mode Function =pkg bios =impl mcy =link =desc // +arg w =type Int =desc // +arg h =type Int =desc // +arg filter =type Bool =desc // +arg result =type Int =desc // // //------------------ PROTO ----------------------------------------------------- led +Proto led =type fun Bool -> Bool =mode function =pkg bios =impl native =link =desc Defines the state of the user led (baremetal host, such as MM-2350). - true: light on - false: light off // +arg state =type Bool =desc A boolean // +arg result =type Bool =desc New state