vga_text_info
interface facilitates the graphics console
to obtain information about displayed text from its attached VGA device,
when the video mode is a VGA text mode. This interface must be implemented
by VGA devices that are attached to the graphics console.
The text_mode method indicates whether the current video mode is a VGA text mode.
If the current video mode is not a VGA text mode, all other methods have no
effect, and will return false
. Otherwise they return true
and behaves as follows:
The font_size method sets width and height to the current font size.
The screen_size method sets columns and rows to the current screen size.
The text method retrieves the screen text data and line
lengths. The text parameter must be a buffer with size at least
columns * rows
, as given by screen_size. Similarly, the
line_length parameter must be a buffer of length rows
.
SIM_INTERFACE(vga_text_info) { bool (*text_mode)(conf_object_t *NOTNULL obj); bool (*font_size)(conf_object_t *NOTNULL obj, int *width, int *height); bool (*screen_size)(conf_object_t *NOTNULL obj, int *columns, int *rows); bool (*text)(conf_object_t *NOTNULL obj, uint8 *text, uint8 *line_lengths); }; #define VGA_TEXT_INFO_INTERFACE "vga_text_info"