MiniGUI API Reference (MiniGUI-Standalone)
v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Macros | |
#define | MAX_NR_LISTEN_FD 5 |
The max number of listen fd which user can use. More... | |
Functions | |
MG_EXPORT BOOL GUIAPI | RegisterListenFD (int fd, int type, HWND hwnd, void *context) |
Registers a listening file descriptor to MiniGUI-Lite. More... | |
MG_EXPORT BOOL GUIAPI | UnregisterListenFD (int fd) |
Unregisters a being listened file descriptor. More... | |
Register/Unregister a listen fd to MiniGUI.
When you need to listen a file descriptor, you can use select(2) system call. In MiniGUI, you can also register it to MiniGUI to be a listened fd, and when there is a read/write/except event on the registered fd , MiniGUI will sent a notification message to the registered window.
Example:
#define MAX_NR_LISTEN_FD 5 |
Registers a listening file descriptor to MiniGUI-Lite.
This function registers the file desciptor fd to MiniGUI-Lite for listening.
When there is a read/write/except event on this fd, MiniGUI will post a MSG_FDEVENT message with wParam being equal to MAKELONG (fd, type), and the lParam being set to context to the target window hwnd.
fd | The file descriptor to be listened. |
type | The type of the event to be listened, can be POLLIN, POLLOUT, or POLLERR. |
hwnd | The handle to the window will receive MSG_FDEVENT message. |
context | The value will be passed to the window as lParam of MSG_FDEVENT message. |
BOOL GUIAPI UnregisterListenFD | ( | int | fd | ) |
Unregisters a being listened file descriptor.
This function unregisters the being listened file descriptor fd.
fd | The file descriptor to be unregistered, should be a being listened file descriptor. |