FDOSTUI
FreeDOS Text User Interface
|
window management routines More...
Go to the source code of this file.
Enumerations | |
enum | wm_error { ERROR_NONE, ERROR_INIT_SCREEN, ERROR_INIT_MOUSE, ERROR_EMPTY_QUEUE, ERROR_USER_ESC } |
error codes More... | |
Functions | |
enum wm_error | wm_init () |
initialize the FDOSTUI subsystem More... | |
void | wm_deinit () |
return the system to it's initial state More... | |
void | wm_register_window (window *const i_window) |
add a window to the window manager More... | |
enum wm_error | wm_run () |
enter the main loop More... | |
enum event_response | wm_run_modal (widget &i_widget) |
runs a widget as modal More... | |
void | wm_quit (enum wm_error const i_reason) |
signal the event manager to close down More... | |
void | wm_draw (window *const i_window) |
redraw window More... | |
void | wm_draw_widget (widget *const i_widget) |
draw a widget More... | |
window *const | wm_grab (window *const i_window) |
grab the focus More... | |
void | wm_unregister_window (window *const i_window) |
remove a window from the window manager More... | |
window management routines
enum wm_error |
void wm_deinit | ( | ) |
return the system to it's initial state
void wm_draw | ( | window *const | i_window | ) |
redraw window
[in] | i_window | window to redraw |
Redraws all windows, with i_window being the last to be drawn. If i_window is NULL, the currently focused window will be drawn last.
void wm_draw_widget | ( | widget *const | i_widget | ) |
draw a widget
[in] | i_widget | widget to draw |
grab the focus
[in] | i_window | window to grab focus. NULL to unset the focus. |
enum wm_error wm_init | ( | ) |
initialize the FDOSTUI subsystem
void wm_quit | ( | enum wm_error const | i_reason | ) |
signal the event manager to close down
[in] | i_reason | error code |
This routine signals the window manager to close down. It sets an internal flag, which signifies that the run loop should exit.
This has no affect in the wm_run_modal routine.
void wm_register_window | ( | window *const | i_window | ) |
add a window to the window manager
[in] | i_window | valid window |
enum wm_error wm_run | ( | ) |
enter the main loop
A typical scenario is to create a window, register it, and then call the run loop. Following, wait for an exit code and then terminate.
enum event_response wm_run_modal | ( | widget & | i_widget | ) |
runs a widget as modal
[in] | i_widget | widget to run as modal |
The widget will run in an infinite loop. It will exit if the user hits the escape key (RESPONSE_CLOSE) or an event produces a response other than RESPONSE_NONE or RESPONSE_HANDLED.
The code in menu::submenu illustrates the use of how to use wm_run_modal.
void wm_unregister_window | ( | window *const | i_window | ) |
remove a window from the window manager
[in] | i_window | window to remove |
Once the window has been removed, it is no longer managed by the window manager. If it was dynamically allocated, it is the callers responsibility to dispose of it.