Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
console.h File Reference

Go to the source code of this file.

Data Structures

struct  _CONSOLE_CHAR
struct  CONSOLE_POINT
struct  CONSOLE_RECT
struct  _CONSOLE_PROPERTIES
struct  _CONSOLE_DEVICE
struct  _CONSOLE_CARET
struct  _WINDOW_PROPERTIES
struct  _CONSOLE_WINDOW
struct  _CONSOLE_HISTORY

Macros

#define CONSOLE_NAME_PREFIX   "Console"
 Name prefix for Console Devices.
#define CONSOLE_TYPE_NONE   0
#define CONSOLE_TYPE_FRAMEBUFFER   1
#define CONSOLE_TYPE_SERIAL   2
#define CONSOLE_TYPE_REMOTE   3
#define CONSOLE_TYPE_LCD   4
#define CONSOLE_TYPE_MAX   4
#define CONSOLE_STATE_CLOSED   0
#define CONSOLE_STATE_OPEN   1
#define CONSOLE_STATE_MAX   1
#define CONSOLE_FLAG_NONE   0x00000000
#define CONSOLE_FLAG_LINE_WRAP   0x00000001
 Wrap long lines to the next line if set.
#define CONSOLE_FLAG_DMA_BOX   0x00000002
 Use DMA to draw boxes (Where applicable).
#define CONSOLE_FLAG_DMA_LINE   0x00000004
 Use DMA to draw lines (Where applicable).
#define CONSOLE_FLAG_DMA_FILL   0x00000008
 Use DMA to fill blocks (Where applicable).
#define CONSOLE_FLAG_DMA_CLEAR   0x00000010
 Use DMA to clear blocks (Where applicable).
#define CONSOLE_FLAG_DMA_SCROLL   0x00000020
 Use DMA to scroll blocks (Where applicable).
#define CONSOLE_FLAG_SINGLE_WINDOW   0x00000040
 Console supports only one window (Not multiple).
#define CONSOLE_FLAG_HARDWARE_CURSOR   0x00000080
 Console supports a hardware cursor (Mouse pointer) (Character mode only).
#define CONSOLE_FLAG_HARDWARE_CARET   0x00000100
 Console supports a hardware caret (Text cursor).
#define CONSOLE_FLAG_BLINK_CARET   0x00000200
 Console supports blinking caret.
#define CONSOLE_FLAG_TEXT_MODE   0x00000400
 Console supports text mode settings.
#define CONSOLE_FLAG_TEXT_BLINK   0x00000800
 Console supports blinking text.
#define CONSOLE_FLAG_COLOR   0x00001000
 Console supports colors.
#define CONSOLE_FLAG_FONT   0x00002000
 Console supports fonts.
#define CONSOLE_FLAG_FULLSCREEN   0x00004000
 Console supports creating a fullscreen window.
#define CONSOLE_FLAG_AUTO_SCROLL   0x00008000
 Automatically scroll up on reaching the last line.
#define CONSOLE_FLAG_DMA_TEXT   0x00010000
 Use DMA to draw text (Where applicable).
#define CONSOLE_FLAG_COLOR_REVERSE   0x00020000
 Console requires colors to be reversed for underlying hardware.
#define CONSOLE_FLAG_TEXT_CARET   0x00040000
 Console supports a caret (Text cursor.
#define CONSOLE_FLAG_FOCUS_CARET   0x00080000
 Only show caret on the focused (active) window.
#define CONSOLE_FLAG_DMA_MASK   CONSOLE_FLAG_DMA_BOX | CONSOLE_FLAG_DMA_LINE | CONSOLE_FLAG_DMA_FILL | CONSOLE_FLAG_DMA_CLEAR | CONSOLE_FLAG_DMA_SCROLL | CONSOLE_FLAG_DMA_TEXT
#define CONSOLE_FLAG_INTERNAL   CONSOLE_FLAG_SINGLE_WINDOW | CONSOLE_FLAG_HARDWARE_CURSOR | CONSOLE_FLAG_HARDWARE_CARET | CONSOLE_FLAG_BLINK_CARET | CONSOLE_FLAG_TEXT_MODE | CONSOLE_FLAG_TEXT_BLINK | CONSOLE_FLAG_COLOR | CONSOLE_FLAG_FONT | CONSOLE_FLAG_FULLSCREEN | CONSOLE_FLAG_COLOR_REVERSE | CONSOLE_FLAG_TEXT_CARET
#define CONSOLE_MODE_NONE   0
#define CONSOLE_MODE_PIXEL   1
#define CONSOLE_MODE_CHARACTER   2
#define CARET_SIGNATURE   0x9A2D40E3
#define WINDOW_SIGNATURE   0xDE3A5C04
#define WINDOW_STATE_INVISIBLE   0
#define WINDOW_STATE_VISIBLE   1
#define WINDOW_STATE_MAX   1
#define WINDOW_MODE_NONE   0
#define WINDOW_MODE_TEXT   1
#define WINDOW_MODE_GRAPHICS   2
#define WINDOW_MODE_MAX   2
#define WINDOW_FLAG_NONE   0x00000000
#define WINDOW_FLAG_LINE_WRAP   0x00000001
 Wrap long lines to the next line if set.
#define WINDOW_FLAG_BUFFERED   0x00000002
 Buffer output for scroll back and redraw.
#define WINDOW_FLAG_FULLSCREEN   0x00000004
 Window occupies the full screen.
#define WINDOW_FLAG_AUTO_SCROLL   0x00000008
 Automatically scroll up on reaching the last line.
#define WINDOW_FLAG_CHARACTER   0x00000010
 Console for this Window is character mode only.
#define WINDOW_FLAG_AUTO_UPDATE   0x00000020
 Automatically update output of buffered window.
#define WINDOW_FLAG_FOCUS_CURSOR   0x00000040
 Only show cursor (caret) on the focused (active) window.
#define WINDOW_FLAG_INTERNAL   WINDOW_FLAG_FULLSCREEN | WINDOW_FLAG_CHARACTER
#define WINDOW_DRAW_FLAG_NONE   0x00000000
#define WINDOW_DRAW_FLAG_BODY   0x00000001
 Draw the Window body.
#define WINDOW_DRAW_FLAG_TITLE   0x00000002
 Draw the Window title.
#define WINDOW_DRAW_FLAG_BORDER   0x00000004
 Draw the Window border.
#define WINDOW_DRAW_FLAG_ALL   WINDOW_DRAW_FLAG_BODY | WINDOW_DRAW_FLAG_TITLE | WINDOW_DRAW_FLAG_BORDER
#define WINDOW_HISTORY_MAX_COUNT   100
#define FRAMEBUFFER_CONSOLE_DESCRIPTION   "Framebuffer Console"
 Description of the Framebuffer Console device.

Typedefs

typedef struct _CONSOLE_CHAR CONSOLE_CHAR
typedef struct _CONSOLE_PROPERTIES CONSOLE_PROPERTIES
typedef struct _CONSOLE_DEVICE CONSOLE_DEVICE
typedef uint32_t STDCALL(* console_enumerate_cb) (CONSOLE_DEVICE *console, void *data)
typedef uint32_t STDCALL(* console_notification_cb) (DEVICE *device, void *data, uint32_t notification)
typedef uint32_t STDCALL(* console_device_open_proc) (CONSOLE_DEVICE *console)
typedef uint32_t STDCALL(* console_device_close_proc) (CONSOLE_DEVICE *console)
typedef uint32_t STDCALL(* console_device_clear_proc) (CONSOLE_DEVICE *console, uint32_t color)
typedef uint32_t STDCALL(* console_device_scroll_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t count, uint32_t direction)
typedef uint32_t STDCALL(* console_device_draw_box_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
typedef uint32_t STDCALL(* console_device_draw_line_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
typedef uint32_t STDCALL(* console_device_plot_line_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
typedef uint32_t STDCALL(* console_device_draw_char_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, char ch, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
typedef uint32_t STDCALL(* console_device_draw_text_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, uint32_t len)
typedef uint32_t STDCALL(* console_device_draw_pixel_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color)
typedef uint32_t STDCALL(* console_device_draw_block_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color)
typedef uint32_t STDCALL(* console_device_draw_circle_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color, uint32_t width, uint32_t radius)
typedef uint32_t STDCALL(* console_device_draw_image_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)
typedef uint32_t STDCALL(* console_device_draw_window_proc) (CONSOLE_DEVICE *console, WINDOW_HANDLE handle, uint32_t flags)
typedef uint32_t STDCALL(* console_device_get_pixel_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t *color)
typedef uint32_t STDCALL(* console_device_get_image_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)
typedef uint32_t STDCALL(* console_device_put_text_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, CONSOLE_CHAR *buffer, uint32_t width, uint32_t height, uint32_t skip)
typedef uint32_t STDCALL(* console_device_copy_image_proc) (CONSOLE_DEVICE *console, CONSOLE_POINT *source, CONSOLE_POINT *dest, uint32_t width, uint32_t height)
typedef HANDLE STDCALL(* console_device_add_caret_proc) (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, uint32_t offsetx, uint32_t offsety)
typedef uint32_t STDCALL(* console_device_delete_caret_proc) (CONSOLE_DEVICE *console, HANDLE handle)
typedef uint32_t STDCALL(* console_device_update_caret_proc) (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, BOOL visible, BOOL blink)
typedef uint32_t STDCALL(* console_device_update_caret_ex_proc) (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, BOOL visible, BOOL blink, BOOL reverse)
typedef uint32_t STDCALL(* console_device_set_cursor_proc) (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, char *chars)
typedef uint32_t STDCALL(* console_device_update_cursor_proc) (CONSOLE_DEVICE *console, BOOL enabled, int32_t x, int32_t y, BOOL relative)
typedef uint32_t STDCALL(* console_device_get_position_proc) (CONSOLE_DEVICE *console, uint32_t position, uint32_t *x1, uint32_t *y1, uint32_t *x2, uint32_t *y2)
typedef uint32_t STDCALL(* console_device_get_properties_proc) (CONSOLE_DEVICE *console, CONSOLE_PROPERTIES *properties)
typedef struct _CONSOLE_CARET CONSOLE_CARET
typedef struct _CONSOLE_WINDOW CONSOLE_WINDOW
typedef struct _CONSOLE_HISTORY CONSOLE_HISTORY
typedef struct _WINDOW_PROPERTIES WINDOW_PROPERTIES
typedef uint32_t STDCALL(* console_window_enumerate_cb) (CONSOLE_DEVICE *console, WINDOW_HANDLE handle, void *data)
typedef uint32_t STDCALL(* console_window_completion_cb) (WINDOW_HANDLE handle, char *buffer, void *data)

Enumerations

enum  CURSOR_MODE { CURSOR_MODE_INSERT , CURSOR_MODE_OVERWRITE }
enum  CURSOR_STATE { CURSOR_STATE_ON , CURSOR_STATE_OFF }
enum  CURSOR_SHAPE { CURSOR_SHAPE_LINE , CURSOR_SHAPE_BAR , CURSOR_SHAPE_BLOCK }

Functions

uint32_t STDCALL console_device_open (CONSOLE_DEVICE *console)
 Open a console device ready for drawing.
uint32_t STDCALL console_device_close (CONSOLE_DEVICE *console)
 Close a console device to prevent drawing.
uint32_t STDCALL console_device_clear (CONSOLE_DEVICE *console, uint32_t color)
 Clear a console device using the specified color.
uint32_t STDCALL console_device_scroll (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t count, uint32_t direction)
 Scroll all or part of a console device in the specified direction.
uint32_t STDCALL console_device_draw_box (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
 Draw an outline of a box on a console device.
uint32_t STDCALL console_device_draw_line (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
 Draw a horizontal or vertical line on a console device.
uint32_t STDCALL console_device_plot_line (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
 Draw a line in any direction on a console device.
uint32_t STDCALL console_device_draw_char (CONSOLE_DEVICE *console, FONT_HANDLE handle, char ch, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Draw a character on a console device.
uint32_t STDCALL console_device_draw_text (CONSOLE_DEVICE *console, FONT_HANDLE handle, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, uint32_t len)
 Draw a text string on a console device.
uint32_t STDCALL console_device_draw_pixel (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color)
 Draw a pixel on a console device.
uint32_t STDCALL console_device_draw_block (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color)
 Draw a filled block on a console device.
uint32_t STDCALL console_device_draw_circle (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color, uint32_t width, uint32_t radius)
 Draw a circle on a console device.
uint32_t STDCALL console_device_draw_image (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)
 Draw an image on a console device.
uint32_t STDCALL console_device_draw_window (CONSOLE_DEVICE *console, WINDOW_HANDLE handle, uint32_t flags)
 Draw a console window on a console device.
uint32_t STDCALL console_device_get_pixel (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t *color)
 Read a pixel from a console device.
uint32_t STDCALL console_device_get_image (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)
 Read an image from a console device.
uint32_t STDCALL console_device_put_text (CONSOLE_DEVICE *console, FONT_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, CONSOLE_CHAR *buffer, uint32_t width, uint32_t height, uint32_t skip)
 Output a rectangular area of text to a console device.
uint32_t STDCALL console_device_copy_image (CONSOLE_DEVICE *console, CONSOLE_POINT *source, CONSOLE_POINT *dest, uint32_t width, uint32_t height)
 Copy an image within a console device.
HANDLE STDCALL console_device_add_caret (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, uint32_t offsetx, uint32_t offsety)
 Create a new caret (cursor) of the specified size.
uint32_t STDCALL console_device_delete_caret (CONSOLE_DEVICE *console, HANDLE handle)
 Delete an existing caret (cursor).
uint32_t STDCALL console_device_update_caret (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, BOOL visible, BOOL blink)
 Update an existing carets position, visibility or blink.
uint32_t STDCALL console_device_update_caret_ex (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, BOOL visible, BOOL blink, BOOL reverse)
 Update an existing carets position, colors, visibility, blink or reverse.
uint32_t STDCALL console_device_set_cursor (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, char *chars)
 Set the mouse cursor properties of a console device (CONSOLE_MODE_CHARACTER only).
uint32_t STDCALL console_device_update_cursor (CONSOLE_DEVICE *console, BOOL enabled, int32_t x, int32_t y, BOOL relative)
 Update the position and state for the mouse cursor of a console device (CONSOLE_MODE_CHARACTER only).
uint32_t STDCALL console_device_get_position (CONSOLE_DEVICE *console, uint32_t position, uint32_t *x1, uint32_t *y1, uint32_t *x2, uint32_t *y2)
 Get the coordinates of a console position from a console device.
uint32_t STDCALL console_device_get_properties (CONSOLE_DEVICE *console, CONSOLE_PROPERTIES *properties)
 Get the current properties from a console device.
BOOL STDCALL console_device_check_flag (CONSOLE_DEVICE *console, uint32_t flag)
 Check if a console device supports a flag value.
uint32_t STDCALL console_device_update_flag (CONSOLE_DEVICE *console, uint32_t flag, BOOL clear)
 Set or clear a flag on a console device.
uint32_t STDCALL console_device_get_mode (CONSOLE_DEVICE *console)
 Get the mode of a console device.
uint32_t STDCALL console_device_get_state (CONSOLE_DEVICE *console)
 Get the state of a console device.
CONSOLE_DEVICE *STDCALL console_device_create (void)
 Create a new Console entry.
CONSOLE_DEVICE *STDCALL console_device_create_ex (uint32_t size)
 Create a new Console entry.
uint32_t STDCALL console_device_destroy (CONSOLE_DEVICE *console)
 Destroy an existing Console entry.
uint32_t STDCALL console_device_register (CONSOLE_DEVICE *console)
 Register a new Console in the Console table.
uint32_t STDCALL console_device_deregister (CONSOLE_DEVICE *console)
 Deregister a Console from the Console table.
CONSOLE_DEVICE *STDCALL console_device_find (uint32_t consoleid)
 Find a console device by ID in the console table.
CONSOLE_DEVICE *STDCALL console_device_find_by_device (DEVICE *device)
 Find a console device by its related device in the console table.
CONSOLE_DEVICE *STDCALL console_device_find_by_name (const char *name)
 Find a console device by name in the console table.
CONSOLE_DEVICE *STDCALL console_device_find_by_description (const char *description)
 Find a console device by description in the console table.
uint32_t STDCALL console_device_enumerate (console_enumerate_cb callback, void *data)
 Enumerate all console devices in the console table.
uint32_t STDCALL console_device_notification (CONSOLE_DEVICE *console, console_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
 Register a notification for console device changes.
WINDOW_HANDLE STDCALL console_window_create (CONSOLE_DEVICE *console, uint32_t position, BOOL _default)
 Create a new Console window.
WINDOW_HANDLE STDCALL console_window_create_ex (CONSOLE_DEVICE *console, FONT_HANDLE font, uint32_t size, uint32_t state, uint32_t mode, uint32_t position, BOOL _default)
 Create a new Console window.
uint32_t STDCALL console_window_destroy (WINDOW_HANDLE handle)
 Close and Destroy an existing console window.
uint32_t STDCALL console_window_show (WINDOW_HANDLE handle)
 Make an existing console window visible and show it on screen.
uint32_t STDCALL console_window_hide (WINDOW_HANDLE handle)
 Make an existing console window invisible and hide it on screen.
uint32_t STDCALL console_window_activate (WINDOW_HANDLE handle)
 Make an existing console window the active window.
uint32_t STDCALL console_window_deactivate (WINDOW_HANDLE handle)
 Make an existing console window inactive.
WINDOW_HANDLE STDCALL console_window_next (CONSOLE_DEVICE *console, BOOL visible)
 Get the next console window starting with the active window.
WINDOW_HANDLE STDCALL console_window_previous (CONSOLE_DEVICE *console, BOOL visible)
 Get the previous console window starting with the active window.
WINDOW_HANDLE STDCALL console_window_at (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, BOOL visible)
 Find the console window that X and Y coordinates are within.
WINDOW_HANDLE STDCALL console_window_find (CONSOLE_DEVICE *console, uint32_t position)
 Find an existing console window in the position specified.
uint32_t STDCALL console_window_enumerate (CONSOLE_DEVICE *console, console_window_enumerate_cb callback, void *data)
 Enumerate existing console windows on the specified console device.
BOOL STDCALL console_window_check_flag (WINDOW_HANDLE handle, uint32_t flag)
 Check an existing console window to determine if a flag is set or not.
uint32_t STDCALL console_window_update_flag (WINDOW_HANDLE handle, uint32_t flag, BOOL clear)
 Set or clear a flag on an existing console window.
uint32_t STDCALL console_window_get_mode (WINDOW_HANDLE handle)
 Get the window mode of an existing console window.
uint32_t STDCALL console_window_get_state (WINDOW_HANDLE handle)
 Get the window state of an existing console window.
uint32_t STDCALL console_window_get_position (WINDOW_HANDLE handle)
 Get the position of an existing console window.
uint32_t STDCALL console_window_set_position (WINDOW_HANDLE handle, uint32_t position)
 Set the position of an existing console window.
uint32_t STDCALL console_window_get_properties (WINDOW_HANDLE handle, WINDOW_PROPERTIES *properties)
 Get the properties for the specified console window.
uint32_t STDCALL console_window_get_min_x (WINDOW_HANDLE handle)
 Get the current minimum X of the window viewport for an existing console window.
uint32_t STDCALL console_window_get_min_y (WINDOW_HANDLE handle)
 Get the current minimum Y of the window viewport for an existing console window.
uint32_t STDCALL console_window_get_max_x (WINDOW_HANDLE handle)
 Get the current maximum X of the window viewport for an existing console window.
uint32_t STDCALL console_window_get_max_y (WINDOW_HANDLE handle)
 Get the current maximum Y of the window viewport for an existing console window.
CONSOLE_RECT STDCALL console_window_get_rect (WINDOW_HANDLE handle)
 Get the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL console_window_set_rect (WINDOW_HANDLE handle, CONSOLE_RECT *rect)
 Set the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL console_window_reset_rect (WINDOW_HANDLE handle)
 Reset the window viewport for an existing console window to the maximum size.
uint32_t STDCALL console_window_get_viewport (WINDOW_HANDLE handle, uint32_t *x1, uint32_t *y1, uint32_t *x2, uint32_t *y2)
 Get the X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL console_window_set_viewport (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)
 Set the X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL console_window_reset_viewport (WINDOW_HANDLE handle)
 Reset the window viewport for an existing console window to the maximum size.
uint32_t STDCALL console_window_get_x (WINDOW_HANDLE handle)
 Get the current X (Column) position of an existing console window.
uint32_t STDCALL console_window_set_x (WINDOW_HANDLE handle, uint32_t x)
 Set the current X (Column) position of an existing console window.
uint32_t STDCALL console_window_get_y (WINDOW_HANDLE handle)
 Get the current Y (Row) position of an existing console window.
uint32_t STDCALL console_window_set_y (WINDOW_HANDLE handle, uint32_t y)
 Set the current Y (Row) position of an existing console window.
uint32_t STDCALL console_window_get_xy (WINDOW_HANDLE handle, uint32_t *x, uint32_t *y)
 Get the current X and Y positions of an existing console window.
uint32_t STDCALL console_window_set_xy (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Set the current X and Y positions of an existing console window.
CONSOLE_POINT STDCALL console_window_get_point (WINDOW_HANDLE handle)
 Get the point X,Y of an existing console window.
uint32_t STDCALL console_window_set_point (WINDOW_HANDLE handle, CONSOLE_POINT *point)
 Set the point X,Y of an existing console window.
uint32_t STDCALL console_window_get_cols (WINDOW_HANDLE handle)
 Get the current columns of the window viewport for an existing console window.
uint32_t STDCALL console_window_get_rows (WINDOW_HANDLE handle)
 Get the current rows of the window viewport for an existing console window.
uint32_t STDCALL console_window_get_width (WINDOW_HANDLE handle)
 Get the absolute width of an existing console window.
uint32_t STDCALL console_window_get_height (WINDOW_HANDLE handle)
 Get the absolute height of an existing console window.
uint32_t STDCALL console_window_get_format (WINDOW_HANDLE handle)
 Get the color format of an existing console window.
uint32_t STDCALL console_window_get_forecolor (WINDOW_HANDLE handle)
 Get the current foreground color of an existing console window.
uint32_t STDCALL console_window_set_forecolor (WINDOW_HANDLE handle, uint32_t color)
 Set the current foreground color of an existing console window.
uint32_t STDCALL console_window_get_backcolor (WINDOW_HANDLE handle)
 Get the current background color of an existing console window.
uint32_t STDCALL console_window_set_backcolor (WINDOW_HANDLE handle, uint32_t color)
 Set the current background color of an existing console window.
FONT_HANDLE STDCALL console_window_get_font (WINDOW_HANDLE handle)
 Get the default font of an existing console window.
uint32_t STDCALL console_window_set_font (WINDOW_HANDLE handle, FONT_HANDLE font)
 Set the default font of an existing console window.
uint32_t STDCALL console_window_get_cursor_xy (WINDOW_HANDLE handle, uint32_t *x, uint32_t *y)
 Get the current cursor X and Y positions of an existing console window.
uint32_t STDCALL console_window_set_cursor_xy (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Set the current cursor X and Y positions of an existing console window.
CURSOR_MODE STDCALL console_window_get_cursor_mode (WINDOW_HANDLE handle)
 Get the current cursor mode of an existing console window.
uint32_t STDCALL console_window_set_cursor_mode (WINDOW_HANDLE handle, CURSOR_MODE cursormode)
 Set the current cursor mode of an existing console window.
BOOL STDCALL console_window_get_cursor_blink (WINDOW_HANDLE handle)
 Get the current cursor blink state of an existing console window.
uint32_t STDCALL console_window_set_cursor_blink (WINDOW_HANDLE handle, BOOL cursorblink)
 Set the current cursor blink state of an existing console window.
CURSOR_STATE STDCALL console_window_get_cursor_state (WINDOW_HANDLE handle)
 Get the current cursor state of an existing console window.
uint32_t STDCALL console_window_set_cursor_state (WINDOW_HANDLE handle, CURSOR_STATE cursorstate)
 Set the current cursor state of an existing console window.
CURSOR_SHAPE STDCALL console_window_get_cursor_shape (WINDOW_HANDLE handle)
 Get the current cursor shape of an existing console window.
uint32_t STDCALL console_window_set_cursor_shape (WINDOW_HANDLE handle, CURSOR_SHAPE cursorshape)
 Set the current cursor shape of an existing console window.
uint32_t STDCALL console_window_get_cursor_color (WINDOW_HANDLE handle)
 Get the current cursor color of an existing console window.
uint32_t STDCALL console_window_set_cursor_color (WINDOW_HANDLE handle, uint32_t color)
 Set the current cursor color of an existing console window.
BOOL STDCALL console_window_get_cursor_reverse (WINDOW_HANDLE handle)
 Get the current cursor reverse state of an existing console window.
uint32_t STDCALL console_window_set_cursor_reverse (WINDOW_HANDLE handle, BOOL cursorreverse)
 Set the current cursor reverse state of an existing console window.
uint32_t STDCALL console_window_cursor_on (WINDOW_HANDLE handle)
 Enable the cursor on an existing console window.
uint32_t STDCALL console_window_cursor_off (WINDOW_HANDLE handle)
 Disable the cursor on an existing console window.
uint32_t STDCALL console_window_cursor_line (WINDOW_HANDLE handle)
 Change the cursor to a vertical line on an existing console window.
uint32_t STDCALL console_window_cursor_bar (WINDOW_HANDLE handle)
 Change the cursor to a horizontal bar on an existing console window.
uint32_t STDCALL console_window_cursor_block (WINDOW_HANDLE handle)
 Change the cursor to a solid block on an existing console window.
uint32_t STDCALL console_window_cursor_move (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Move the cursor on an existing console window.
uint32_t STDCALL console_window_cursor_blink (WINDOW_HANDLE handle, BOOL enabled)
 Set the blink state of the cursor on an existing console window.
uint32_t STDCALL console_window_cursor_color (WINDOW_HANDLE handle, uint32_t color)
 Set the color of the cursor on an existing console window.
uint32_t STDCALL console_window_cursor_reverse (WINDOW_HANDLE handle, BOOL enabled)
 Set the reverse state of the cursor on an existing console window.
uint32_t STDCALL console_window_add_history (WINDOW_HANDLE handle, const char *value)
 Add a value to the command history table of an existing console window.
uint32_t STDCALL console_window_clear_history (WINDOW_HANDLE handle)
 Remove all entries from the command history table of an existing console window.
uint32_t STDCALL console_window_first_history (WINDOW_HANDLE handle, char *value, uint32_t len)
 Get the first (oldest) command history value from an existing console window.
uint32_t STDCALL console_window_last_history (WINDOW_HANDLE handle, char *value, uint32_t len)
 Get the last (most recent) command history value from an existing console window.
uint32_t STDCALL console_window_next_history (WINDOW_HANDLE handle, char *value, uint32_t len)
 Get the next (after current) command history value from an existing console window.
uint32_t STDCALL console_window_previous_history (WINDOW_HANDLE handle, char *value, uint32_t len)
 Get the next (before current) command history value from an existing console window.
uint32_t STDCALL console_window_current_history (WINDOW_HANDLE handle, char *value, uint32_t len)
 Get the current command history value from an existing console window.
uint32_t STDCALL console_window_scroll_up (WINDOW_HANDLE handle, uint32_t row, uint32_t lines)
 Scroll the current viewport of an existing console window up.
uint32_t STDCALL console_window_scroll_down (WINDOW_HANDLE handle, uint32_t row, uint32_t lines)
 Scroll the current viewport of an existing console window down.
uint32_t STDCALL console_window_scroll_left (WINDOW_HANDLE handle, uint32_t row, uint32_t col, uint32_t lines, uint32_t chars)
 Scroll the current viewport of an existing console window left.
uint32_t STDCALL console_window_scroll_right (WINDOW_HANDLE handle, uint32_t row, uint32_t col, uint32_t lines, uint32_t chars)
 Scroll the current viewport of an existing console window right.
uint32_t STDCALL console_window_clear (WINDOW_HANDLE handle)
 Clear the current viewport of an existing console window.
uint32_t STDCALL console_window_clear_ex (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, BOOL cursor)
 Clear part of the the current viewport of an existing console window.
uint32_t STDCALL console_window_write (WINDOW_HANDLE handle, const char *text)
 Write text on an existing console window at the current position in the current color.
uint32_t STDCALL console_window_write_ex (WINDOW_HANDLE handle, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Write text on an existing console window.
uint32_t STDCALL console_window_write_ln (WINDOW_HANDLE handle, const char *text)
 Write text on an existing console window at the current position in the current color.
uint32_t STDCALL console_window_write_ln_ex (WINDOW_HANDLE handle, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Write text on an existing console window.
uint32_t STDCALL console_window_write_chr (WINDOW_HANDLE handle, char ch)
 Write a character on an existing console window at the current position in the current color.
uint32_t STDCALL console_window_write_chr_ex (WINDOW_HANDLE handle, char ch, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Write a character on an existing console window.
uint32_t STDCALL console_window_output (WINDOW_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, CONSOLE_CHAR *buffer, uint32_t width, uint32_t height, uint32_t skip)
 Output a rectangular area of text to a console window.
uint32_t STDCALL console_window_read (WINDOW_HANDLE handle, char *text, uint32_t *len)
 Read text input from the console and echo to an existing console window at the current position in the current color.
uint32_t STDCALL console_window_read_ln (WINDOW_HANDLE handle, char *text, uint32_t *len)
 Read text input from the console and echo to an existing console window at the current position in the current color.
uint32_t STDCALL console_window_read_ln_ex (WINDOW_HANDLE handle, char *text, uint32_t *len, char *prompt, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, BOOL scroll, BOOL history, console_window_completion_cb completion, void *data)
 Read text input from the console and echo to an existing console window at the specified position in the specified color.
uint32_t STDCALL console_window_read_chr (WINDOW_HANDLE handle, char *ch)
 Read one character input from the console and echo to an existing console window at the current position in the current color.
uint32_t STDCALL console_window_read_chr_ex (WINDOW_HANDLE handle, char *ch, char *prompt, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, BOOL echo, BOOL scroll)
 Read one character input from the console and optionally echo to an existing console window at the specified position in the specified color.
int STDCALL console_window_printf (WINDOW_HANDLE handle, const char *format,...) _ATTRIBUTE((__format__(__printf__
 Print formatted text to an existing console window at the current position in the current color.
int STDCALL void STDCALL console_clr_eol (void)
 Compatible with RTL Crt unit function ClrEol.
void STDCALL console_clr_scr (void)
 Compatible with RTL Crt unit function ClrScr.
void STDCALL console_delay (uint16_t ms)
 Compatible with RTL Crt unit function Delay.
void STDCALL console_del_line (void)
 Compatible with RTL Crt unit function DelLine.
void STDCALL console_goto_xy (int x, int y)
 Compatible with RTL Crt unit function GotoXY.
void STDCALL console_high_video (void)
 Compatible with RTL Crt unit function HighVideo.
void STDCALL console_ins_line (void)
 Compatible with RTL Crt unit function InsLine.
BOOL STDCALL console_keypressed (void)
 Compatible with RTL Crt unit function KeyPressed.
void STDCALL console_low_video (void)
 Compatible with RTL Crt unit function LowVideo.
void STDCALL console_norm_video (void)
 Compatible with RTL Crt unit function NormVideo.
void STDCALL console_no_sound (void)
 Compatible with RTL Crt unit function NoSound.
char STDCALL console_read_key (void)
 Compatible with RTL Crt unit function ReadKey.
void STDCALL console_sound (uint16_t hz)
 Compatible with RTL Crt unit function Sound.
void STDCALL console_text_background (uint32_t color)
 Compatible with RTL Crt unit function TextBackground.
void STDCALL console_text_color (uint32_t color)
 Compatible with RTL Crt unit function TextColor.
void STDCALL console_text_mode (int mode)
 Compatible with RTL Crt unit function TextMode.
int STDCALL console_where_x (void)
 Compatible with RTL Crt unit function WhereX.
int STDCALL console_where_y (void)
 Compatible with RTL Crt unit function WhereY.
void STDCALL console_window (int x1, int y1, int x2, int y2)
 Compatible with RTL Crt unit function Window.
void STDCALL console_scroll_up (int row, int lines)
 Scroll the default console window up.
void STDCALL console_scroll_down (int row, int lines)
 Scroll the default console window down.
void STDCALL console_write (const char *text)
 Write text on the default console window at the current position in the current color.
void STDCALL console_write_ln (const char *text)
 Write text on the default console window at the current position in the current color.
void STDCALL console_write_chr (char ch)
 Write a character on the default console window at the current position in the current color.
void STDCALL console_read (char *text, uint32_t *len)
 Read text from console input and echo to the screen.
void STDCALL console_read_ln (char *text, uint32_t *len)
 Read text from console input and echo to the screen.
void STDCALL console_read_chr (char *ch)
 Read a character from console input and echo to the screen.
int STDCALL console_printf (const char *format,...) _ATTRIBUTE((__format__(__printf__
 Print formatted text to the default console window at the current position in the current color.
int STDCALL uint32_t STDCALL console_device_get_count (void)
 Get the current console device count.
CONSOLE_DEVICE *STDCALL console_device_get_default (void)
 Get the current default console device.
uint32_t STDCALL console_device_set_default (CONSOLE_DEVICE *console)
 Set the current default console device.
CONSOLE_DEVICE *STDCALL console_device_check (CONSOLE_DEVICE *console)
 Check if the supplied Console device is in the Console table.
CONSOLE_CARET *STDCALL console_device_caret_check (CONSOLE_DEVICE *console, CONSOLE_CARET *caret)
 Check if a console caret entry is valid.
uint32_t STDCALL console_type_to_string (uint32_t consoletype, char *value, uint32_t len)
 Convert a Console type value to a string.
uint32_t STDCALL console_state_to_string (uint32_t consolestate, char *value, uint32_t len)
 Convert a Console state value to a string.
FONT_HANDLE STDCALL console_device_get_default_font (void)
 Get the default console font.
uint32_t STDCALL console_position_to_string (uint32_t position, char *value, uint32_t len)
uint32_t STDCALL console_window_get_count (CONSOLE_DEVICE *console)
 Get the current console window count.
WINDOW_HANDLE STDCALL console_window_get_active (CONSOLE_DEVICE *console)
 Get the current console active window.
WINDOW_HANDLE STDCALL console_window_get_default (CONSOLE_DEVICE *console)
 Get the current console default window.
uint32_t STDCALL console_window_set_default (CONSOLE_DEVICE *console, WINDOW_HANDLE handle)
 Set the current console default window.
CONSOLE_WINDOW *STDCALL console_window_check (CONSOLE_DEVICE *console, CONSOLE_WINDOW *window)
 Check if a console window entry is valid.
uint32_t STDCALL console_window_state_to_string (uint32_t windowstate, char *value, uint32_t len)
 Convert a Console Window state value to a string.
uint32_t STDCALL console_window_mode_to_string (uint32_t windowmode, char *value, uint32_t len)
 Convert a Console Window mode value to a string.
FONT_HANDLE STDCALL console_window_get_default_font (void)
 Get the default console window font.
BOOL STDCALL console_window_redirect_output (WINDOW_HANDLE handle)
 Redirect standard output to the console window specified by Handle.

Macro Definition Documentation

◆ CONSOLE_NAME_PREFIX

#define CONSOLE_NAME_PREFIX   "Console"

Name prefix for Console Devices.

Console specific constants

◆ CONSOLE_TYPE_NONE

#define CONSOLE_TYPE_NONE   0

Console Device Types

◆ CONSOLE_TYPE_FRAMEBUFFER

#define CONSOLE_TYPE_FRAMEBUFFER   1

◆ CONSOLE_TYPE_SERIAL

#define CONSOLE_TYPE_SERIAL   2

◆ CONSOLE_TYPE_REMOTE

#define CONSOLE_TYPE_REMOTE   3

◆ CONSOLE_TYPE_LCD

#define CONSOLE_TYPE_LCD   4

◆ CONSOLE_TYPE_MAX

#define CONSOLE_TYPE_MAX   4

◆ CONSOLE_STATE_CLOSED

#define CONSOLE_STATE_CLOSED   0

Console Device States

◆ CONSOLE_STATE_OPEN

#define CONSOLE_STATE_OPEN   1

◆ CONSOLE_STATE_MAX

#define CONSOLE_STATE_MAX   1

◆ CONSOLE_FLAG_NONE

#define CONSOLE_FLAG_NONE   0x00000000

Console Device Flags

◆ CONSOLE_FLAG_LINE_WRAP

#define CONSOLE_FLAG_LINE_WRAP   0x00000001

Wrap long lines to the next line if set.

◆ CONSOLE_FLAG_DMA_BOX

#define CONSOLE_FLAG_DMA_BOX   0x00000002

Use DMA to draw boxes (Where applicable).

◆ CONSOLE_FLAG_DMA_LINE

#define CONSOLE_FLAG_DMA_LINE   0x00000004

Use DMA to draw lines (Where applicable).

◆ CONSOLE_FLAG_DMA_FILL

#define CONSOLE_FLAG_DMA_FILL   0x00000008

Use DMA to fill blocks (Where applicable).

◆ CONSOLE_FLAG_DMA_CLEAR

#define CONSOLE_FLAG_DMA_CLEAR   0x00000010

Use DMA to clear blocks (Where applicable).

◆ CONSOLE_FLAG_DMA_SCROLL

#define CONSOLE_FLAG_DMA_SCROLL   0x00000020

Use DMA to scroll blocks (Where applicable).

◆ CONSOLE_FLAG_SINGLE_WINDOW

#define CONSOLE_FLAG_SINGLE_WINDOW   0x00000040

Console supports only one window (Not multiple).

◆ CONSOLE_FLAG_HARDWARE_CURSOR

#define CONSOLE_FLAG_HARDWARE_CURSOR   0x00000080

Console supports a hardware cursor (Mouse pointer) (Character mode only).

◆ CONSOLE_FLAG_HARDWARE_CARET

#define CONSOLE_FLAG_HARDWARE_CARET   0x00000100

Console supports a hardware caret (Text cursor).

◆ CONSOLE_FLAG_BLINK_CARET

#define CONSOLE_FLAG_BLINK_CARET   0x00000200

Console supports blinking caret.

◆ CONSOLE_FLAG_TEXT_MODE

#define CONSOLE_FLAG_TEXT_MODE   0x00000400

Console supports text mode settings.

◆ CONSOLE_FLAG_TEXT_BLINK

#define CONSOLE_FLAG_TEXT_BLINK   0x00000800

Console supports blinking text.

◆ CONSOLE_FLAG_COLOR

#define CONSOLE_FLAG_COLOR   0x00001000

Console supports colors.

◆ CONSOLE_FLAG_FONT

#define CONSOLE_FLAG_FONT   0x00002000

Console supports fonts.

◆ CONSOLE_FLAG_FULLSCREEN

#define CONSOLE_FLAG_FULLSCREEN   0x00004000

Console supports creating a fullscreen window.

◆ CONSOLE_FLAG_AUTO_SCROLL

#define CONSOLE_FLAG_AUTO_SCROLL   0x00008000

Automatically scroll up on reaching the last line.

◆ CONSOLE_FLAG_DMA_TEXT

#define CONSOLE_FLAG_DMA_TEXT   0x00010000

Use DMA to draw text (Where applicable).

◆ CONSOLE_FLAG_COLOR_REVERSE

#define CONSOLE_FLAG_COLOR_REVERSE   0x00020000

Console requires colors to be reversed for underlying hardware.

◆ CONSOLE_FLAG_TEXT_CARET

#define CONSOLE_FLAG_TEXT_CARET   0x00040000

Console supports a caret (Text cursor.

◆ CONSOLE_FLAG_FOCUS_CARET

#define CONSOLE_FLAG_FOCUS_CARET   0x00080000

Only show caret on the focused (active) window.

◆ CONSOLE_FLAG_DMA_MASK

◆ CONSOLE_FLAG_INTERNAL

◆ CONSOLE_MODE_NONE

#define CONSOLE_MODE_NONE   0

Console Device Modes

◆ CONSOLE_MODE_PIXEL

#define CONSOLE_MODE_PIXEL   1

◆ CONSOLE_MODE_CHARACTER

#define CONSOLE_MODE_CHARACTER   2

◆ CARET_SIGNATURE

#define CARET_SIGNATURE   0x9A2D40E3

Console Caret Signature

◆ WINDOW_SIGNATURE

#define WINDOW_SIGNATURE   0xDE3A5C04

Console Window Signature

◆ WINDOW_STATE_INVISIBLE

#define WINDOW_STATE_INVISIBLE   0

Console Window States

◆ WINDOW_STATE_VISIBLE

#define WINDOW_STATE_VISIBLE   1

◆ WINDOW_STATE_MAX

#define WINDOW_STATE_MAX   1

◆ WINDOW_MODE_NONE

#define WINDOW_MODE_NONE   0

Console Window Modes

◆ WINDOW_MODE_TEXT

#define WINDOW_MODE_TEXT   1

◆ WINDOW_MODE_GRAPHICS

#define WINDOW_MODE_GRAPHICS   2

◆ WINDOW_MODE_MAX

#define WINDOW_MODE_MAX   2

◆ WINDOW_FLAG_NONE

#define WINDOW_FLAG_NONE   0x00000000

Console Window Flags

◆ WINDOW_FLAG_LINE_WRAP

#define WINDOW_FLAG_LINE_WRAP   0x00000001

Wrap long lines to the next line if set.

◆ WINDOW_FLAG_BUFFERED

#define WINDOW_FLAG_BUFFERED   0x00000002

Buffer output for scroll back and redraw.

◆ WINDOW_FLAG_FULLSCREEN

#define WINDOW_FLAG_FULLSCREEN   0x00000004

Window occupies the full screen.

◆ WINDOW_FLAG_AUTO_SCROLL

#define WINDOW_FLAG_AUTO_SCROLL   0x00000008

Automatically scroll up on reaching the last line.

◆ WINDOW_FLAG_CHARACTER

#define WINDOW_FLAG_CHARACTER   0x00000010

Console for this Window is character mode only.

◆ WINDOW_FLAG_AUTO_UPDATE

#define WINDOW_FLAG_AUTO_UPDATE   0x00000020

Automatically update output of buffered window.

◆ WINDOW_FLAG_FOCUS_CURSOR

#define WINDOW_FLAG_FOCUS_CURSOR   0x00000040

Only show cursor (caret) on the focused (active) window.

◆ WINDOW_FLAG_INTERNAL

#define WINDOW_FLAG_INTERNAL   WINDOW_FLAG_FULLSCREEN | WINDOW_FLAG_CHARACTER

Flags that cannot be changed by ConsoleWindowUpdateFlag

◆ WINDOW_DRAW_FLAG_NONE

#define WINDOW_DRAW_FLAG_NONE   0x00000000

Console Window Draw Flags

◆ WINDOW_DRAW_FLAG_BODY

#define WINDOW_DRAW_FLAG_BODY   0x00000001

Draw the Window body.

◆ WINDOW_DRAW_FLAG_TITLE

#define WINDOW_DRAW_FLAG_TITLE   0x00000002

Draw the Window title.

◆ WINDOW_DRAW_FLAG_BORDER

#define WINDOW_DRAW_FLAG_BORDER   0x00000004

Draw the Window border.

◆ WINDOW_DRAW_FLAG_ALL

◆ WINDOW_HISTORY_MAX_COUNT

#define WINDOW_HISTORY_MAX_COUNT   100

Console Window History

◆ FRAMEBUFFER_CONSOLE_DESCRIPTION

#define FRAMEBUFFER_CONSOLE_DESCRIPTION   "Framebuffer Console"

Description of the Framebuffer Console device.

Framebuffer Console specific constants

Typedef Documentation

◆ CONSOLE_CHAR

typedef struct _CONSOLE_CHAR CONSOLE_CHAR

◆ CONSOLE_PROPERTIES

◆ CONSOLE_DEVICE

◆ console_enumerate_cb

typedef uint32_t STDCALL(* console_enumerate_cb) (CONSOLE_DEVICE *console, void *data)

Console Enumeration Callback

◆ console_notification_cb

typedef uint32_t STDCALL(* console_notification_cb) (DEVICE *device, void *data, uint32_t notification)

Console Notification Callback

◆ console_device_open_proc

typedef uint32_t STDCALL(* console_device_open_proc) (CONSOLE_DEVICE *console)

Console Device Methods

◆ console_device_close_proc

typedef uint32_t STDCALL(* console_device_close_proc) (CONSOLE_DEVICE *console)

◆ console_device_clear_proc

typedef uint32_t STDCALL(* console_device_clear_proc) (CONSOLE_DEVICE *console, uint32_t color)

◆ console_device_scroll_proc

typedef uint32_t STDCALL(* console_device_scroll_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t count, uint32_t direction)

◆ console_device_draw_box_proc

typedef uint32_t STDCALL(* console_device_draw_box_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)

◆ console_device_draw_line_proc

typedef uint32_t STDCALL(* console_device_draw_line_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)

◆ console_device_plot_line_proc

typedef uint32_t STDCALL(* console_device_plot_line_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)

◆ console_device_draw_char_proc

typedef uint32_t STDCALL(* console_device_draw_char_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, char ch, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)

◆ console_device_draw_text_proc

typedef uint32_t STDCALL(* console_device_draw_text_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, uint32_t len)

◆ console_device_draw_pixel_proc

typedef uint32_t STDCALL(* console_device_draw_pixel_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color)

◆ console_device_draw_block_proc

typedef uint32_t STDCALL(* console_device_draw_block_proc) (CONSOLE_DEVICE *console, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color)

◆ console_device_draw_circle_proc

typedef uint32_t STDCALL(* console_device_draw_circle_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t color, uint32_t width, uint32_t radius)

◆ console_device_draw_image_proc

typedef uint32_t STDCALL(* console_device_draw_image_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)

◆ console_device_draw_window_proc

typedef uint32_t STDCALL(* console_device_draw_window_proc) (CONSOLE_DEVICE *console, WINDOW_HANDLE handle, uint32_t flags)

◆ console_device_get_pixel_proc

typedef uint32_t STDCALL(* console_device_get_pixel_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, uint32_t *color)

◆ console_device_get_image_proc

typedef uint32_t STDCALL(* console_device_get_image_proc) (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, void *buffer, uint32_t width, uint32_t height, uint32_t format, uint32_t skip)

◆ console_device_put_text_proc

typedef uint32_t STDCALL(* console_device_put_text_proc) (CONSOLE_DEVICE *console, FONT_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, CONSOLE_CHAR *buffer, uint32_t width, uint32_t height, uint32_t skip)

◆ console_device_copy_image_proc

typedef uint32_t STDCALL(* console_device_copy_image_proc) (CONSOLE_DEVICE *console, CONSOLE_POINT *source, CONSOLE_POINT *dest, uint32_t width, uint32_t height)

◆ console_device_add_caret_proc

typedef HANDLE STDCALL(* console_device_add_caret_proc) (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, uint32_t offsetx, uint32_t offsety)

◆ console_device_delete_caret_proc

typedef uint32_t STDCALL(* console_device_delete_caret_proc) (CONSOLE_DEVICE *console, HANDLE handle)

◆ console_device_update_caret_proc

typedef uint32_t STDCALL(* console_device_update_caret_proc) (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, BOOL visible, BOOL blink)

◆ console_device_update_caret_ex_proc

typedef uint32_t STDCALL(* console_device_update_caret_ex_proc) (CONSOLE_DEVICE *console, HANDLE handle, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor, BOOL visible, BOOL blink, BOOL reverse)

◆ console_device_set_cursor_proc

typedef uint32_t STDCALL(* console_device_set_cursor_proc) (CONSOLE_DEVICE *console, uint32_t width, uint32_t height, char *chars)

◆ console_device_update_cursor_proc

typedef uint32_t STDCALL(* console_device_update_cursor_proc) (CONSOLE_DEVICE *console, BOOL enabled, int32_t x, int32_t y, BOOL relative)

◆ console_device_get_position_proc

typedef uint32_t STDCALL(* console_device_get_position_proc) (CONSOLE_DEVICE *console, uint32_t position, uint32_t *x1, uint32_t *y1, uint32_t *x2, uint32_t *y2)

◆ console_device_get_properties_proc

typedef uint32_t STDCALL(* console_device_get_properties_proc) (CONSOLE_DEVICE *console, CONSOLE_PROPERTIES *properties)

◆ CONSOLE_CARET

typedef struct _CONSOLE_CARET CONSOLE_CARET

◆ CONSOLE_WINDOW

◆ CONSOLE_HISTORY

◆ WINDOW_PROPERTIES

◆ console_window_enumerate_cb

typedef uint32_t STDCALL(* console_window_enumerate_cb) (CONSOLE_DEVICE *console, WINDOW_HANDLE handle, void *data)

Console Window Enumeration Callback

◆ console_window_completion_cb

typedef uint32_t STDCALL(* console_window_completion_cb) (WINDOW_HANDLE handle, char *buffer, void *data)

Console Window Completion Callback

Enumeration Type Documentation

◆ CURSOR_MODE

Console specific types

Enumerator
CURSOR_MODE_INSERT 
CURSOR_MODE_OVERWRITE 

◆ CURSOR_STATE

Enumerator
CURSOR_STATE_ON 
CURSOR_STATE_OFF 

◆ CURSOR_SHAPE

Enumerator
CURSOR_SHAPE_LINE 

Line is a vertical line and (All shapes inverse any character data under them).

CURSOR_SHAPE_BAR 

Bar is a horizontal bar (All shapes inverse any character data under them).

CURSOR_SHAPE_BLOCK 

Block is a solid block (All shapes inverse any character data under them).

Function Documentation

◆ console_device_open()

uint32_t STDCALL console_device_open ( CONSOLE_DEVICE * console)

Open a console device ready for drawing.

Console Functions

Parameters
ConsoleThe console device to open
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_close()

uint32_t STDCALL console_device_close ( CONSOLE_DEVICE * console)

Close a console device to prevent drawing.

Parameters
ConsoleThe console device to close
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_clear()

uint32_t STDCALL console_device_clear ( CONSOLE_DEVICE * console,
uint32_t color )

Clear a console device using the specified color.

Parameters
ConsoleThe console device to clear
ColorThe color to use when clearing the console
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_scroll()

uint32_t STDCALL console_device_scroll ( CONSOLE_DEVICE * console,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t count,
uint32_t direction )

Scroll all or part of a console device in the specified direction.

Parameters
ConsoleThe console device to scroll
X1The left edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
CountThe number of pixels or characters (depending on console mode) to scroll
DirectionThe direction to scroll (eg CONSOLE_DIRECTION_UP)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_draw_box()

uint32_t STDCALL console_device_draw_box ( CONSOLE_DEVICE * console,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color,
uint32_t width )

Draw an outline of a box on a console device.

Parameters
ConsoleThe console device to draw on
X1The left edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the box outline (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_draw_line()

uint32_t STDCALL console_device_draw_line ( CONSOLE_DEVICE * console,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color,
uint32_t width )

Draw a horizontal or vertical line on a console device.

Parameters
ConsoleThe console device to draw on
X1The left starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_plot_line()

uint32_t STDCALL console_device_plot_line ( CONSOLE_DEVICE * console,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color,
uint32_t width )

Draw a line in any direction on a console device.

Parameters
ConsoleThe console device to draw on
X1The left starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)
Character consoles may implement plot line but the default method only supports pixel consoles

◆ console_device_draw_char()

uint32_t STDCALL console_device_draw_char ( CONSOLE_DEVICE * console,
FONT_HANDLE handle,
char ch,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Draw a character on a console device.

Parameters
ConsoleThe console device to draw on
HandleThe handle of the font to draw with
ChThe character to draw
XThe left starting point of the character (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe top starting point of the character (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ForecolorThe foreground color for the character (eg COLOR_WHITE)
BackcolorThe background color for the character (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Forecolor and Backcolor must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_draw_text()

uint32_t STDCALL console_device_draw_text ( CONSOLE_DEVICE * console,
FONT_HANDLE handle,
const char * text,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor,
uint32_t len )

Draw a text string on a console device.

Parameters
ConsoleThe console device to draw on
HandleThe handle of the font to draw with
TextThe text to draw
XThe left starting point of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe top starting point of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ForecolorThe foreground color for the text (eg COLOR_WHITE)
BackcolorThe background color for the text (eg COLOR_BLACK)
LenThe length of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Forecolor and Backcolor must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_draw_pixel()

uint32_t STDCALL console_device_draw_pixel ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
uint32_t color )

Draw a pixel on a console device.

Parameters
ConsoleThe console device to draw on
XThe column to draw the pixel (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe row to draw the pixel (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_draw_block()

uint32_t STDCALL console_device_draw_block ( CONSOLE_DEVICE * console,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color )

Draw a filled block on a console device.

Parameters
ConsoleThe console device to draw on
X1The left edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_draw_circle()

uint32_t STDCALL console_device_draw_circle ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
uint32_t color,
uint32_t width,
uint32_t radius )

Draw a circle on a console device.

Parameters
ConsoleThe console device to draw on
XThe column center point of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe row center point of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the circle outline (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
RadiusThe radius of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)
Character consoles may implement draw circle but the default method only supports pixel consoles

◆ console_device_draw_image()

uint32_t STDCALL console_device_draw_image ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
void * buffer,
uint32_t width,
uint32_t height,
uint32_t format,
uint32_t skip )

Draw an image on a console device.

Parameters
ConsoleThe console device to draw on
XThe starting column of the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe starting row of the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
BufferPointer to a block of memory containing the pixels of the image in a contiguous block of rows
WidthThe number of columns in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
HeightThe number of rows in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
FormatThe color format of the image (eg COLOR_FORMAT_RGB24)
SkipThe number of pixels to skip in the buffer after each row (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_draw_window()

uint32_t STDCALL console_device_draw_window ( CONSOLE_DEVICE * console,
WINDOW_HANDLE handle,
uint32_t flags )

Draw a console window on a console device.

Parameters
ConsoleThe console device to draw on
HandleThe handle of the console window to draw
FlagsFlags to specify what should be drawn (eg WINDOW_DRAW_FLAG_BORDER)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_get_pixel()

uint32_t STDCALL console_device_get_pixel ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
uint32_t * color )

Read a pixel from a console device.

Parameters
ConsoleThe console device to read from
XThe column to read the pixel from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe row to read the pixel from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ColorThe color value read from the console (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color is returned in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_get_image()

uint32_t STDCALL console_device_get_image ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
void * buffer,
uint32_t width,
uint32_t height,
uint32_t format,
uint32_t skip )

Read an image from a console device.

Parameters
ConsoleThe console device to read from
XThe starting column to read the image from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe starting row to read the image from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
BufferPointer to a block of memory large enough to hold the pixels of the image in a contiguous block of rows
WidthThe number of columns to store in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
HeightThe number of rows to store in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
FormatThe color format to store the image in (eg COLOR_FORMAT_RGB24)
SkipThe number of pixels to skip in the buffer after each row (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_put_text()

uint32_t STDCALL console_device_put_text ( CONSOLE_DEVICE * console,
FONT_HANDLE handle,
CONSOLE_POINT * source,
CONSOLE_POINT * dest,
CONSOLE_CHAR * buffer,
uint32_t width,
uint32_t height,
uint32_t skip )

Output a rectangular area of text to a console device.

Parameters
ConsoleThe console device to output to
SourceThe X and Y point in the source buffer to copy text from (Characters)
DestThe X and Y point on the console device to copy text to (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
BufferA pointer to a buffer of TConsoleChar structures which represent rows of text
WidthThe width of the area to be output (Characters)
HeightThe height of the area to be output (Characters)
SkipThe number of characters to skip in the buffer after each row (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Source, Width, Height and Skip are based on character rows and columns not screen pixels

◆ console_device_copy_image()

uint32_t STDCALL console_device_copy_image ( CONSOLE_DEVICE * console,
CONSOLE_POINT * source,
CONSOLE_POINT * dest,
uint32_t width,
uint32_t height )

Copy an image within a console device.

Parameters
ConsoleThe console device to copy on
SourceThe starting point for the source of the copy (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
DestThe starting point for the destination of the copy (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
WidthThe number of columns in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
HeightThe number of rows in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_add_caret()

HANDLE STDCALL console_device_add_caret ( CONSOLE_DEVICE * console,
uint32_t width,
uint32_t height,
uint32_t offsetx,
uint32_t offsety )

Create a new caret (cursor) of the specified size.

Parameters
ConsoleThe console device to create the caret on
WidthThe width of the new caret (Pixels for CONSOLE_MODE_PIXEL / Always 1 for CONSOLE_MODE_CHARACTER)
HeightThe height of the new caret (Pixels for CONSOLE_MODE_PIXEL / Always 1 for CONSOLE_MODE_CHARACTER)
OffsetXThe X offset of the new caret (Optional)(Pixels for CONSOLE_MODE_PIXEL / Always 0 for CONSOLE_MODE_CHARACTER)
OffsetYThe Y offset of the new caret (Optional)(Pixels for CONSOLE_MODE_PIXEL / Always 0 for CONSOLE_MODE_CHARACTER)
Returns
Handle to new caret on success or INVALID_HANDLE_VALUE on failure

◆ console_device_delete_caret()

uint32_t STDCALL console_device_delete_caret ( CONSOLE_DEVICE * console,
HANDLE handle )

Delete an existing caret (cursor).

Parameters
ConsoleThe console device to delete the caret on
HandleThe handle of the caret to delete (as returned from ConsoleDeviceAddCaret)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_update_caret()

uint32_t STDCALL console_device_update_caret ( CONSOLE_DEVICE * console,
HANDLE handle,
uint32_t x,
uint32_t y,
BOOL visible,
BOOL blink )

Update an existing carets position, visibility or blink.

Parameters
ConsoleThe console device to update the caret on
HandleThe handle of the caret to update (as returned from ConsoleDeviceAddCaret)
XThe X position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe Y position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
VisibleIf true then show the caret else hide it
BlinkIf true then blink the caret at the default blink rate
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_update_caret_ex()

uint32_t STDCALL console_device_update_caret_ex ( CONSOLE_DEVICE * console,
HANDLE handle,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor,
BOOL visible,
BOOL blink,
BOOL reverse )

Update an existing carets position, colors, visibility, blink or reverse.

Parameters
ConsoleThe console device to update the caret on
HandleThe handle of the caret to update (as returned from ConsoleDeviceAddCaret)
XThe X position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
YThe Y position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
ForecolorThe cursor foreground color if set or COLOR_NONE to disable
BackcolorThe cursor background color if set or COLOR_NONE to disable
VisibleIf true then show the caret else hide it
BlinkIf true then blink the caret at the default blink rate
ReverseIf true then enable reverse color else enable inverse color
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Forecolor and Backcolor must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_device_set_cursor()

uint32_t STDCALL console_device_set_cursor ( CONSOLE_DEVICE * console,
uint32_t width,
uint32_t height,
char * chars )

Set the mouse cursor properties of a console device (CONSOLE_MODE_CHARACTER only).

Parameters
ConsoleThe console device to set the cursor
WidthThe width of the cursor in characters
HeightThe height of the cursor in characters
CharsA buffer containing the cursor characters
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For devices that don't support hardware mouse cursor a software cursor will be implemented If chars is nil then the default cursor will be used

◆ console_device_update_cursor()

uint32_t STDCALL console_device_update_cursor ( CONSOLE_DEVICE * console,
BOOL enabled,
int32_t x,
int32_t y,
BOOL relative )

Update the position and state for the mouse cursor of a console device (CONSOLE_MODE_CHARACTER only).

Parameters
ConsoleThe console device to update the cursor
EnabledIf true then show the cursor else hide it
XThe cursor X location in characters
YThe cursor Y location in characters
RelativeIf true then X and Y are considered relative to the current position
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For devices that don't support hardware mouse cursor a software cursor will be implemented

◆ console_device_get_position()

uint32_t STDCALL console_device_get_position ( CONSOLE_DEVICE * console,
uint32_t position,
uint32_t * x1,
uint32_t * y1,
uint32_t * x2,
uint32_t * y2 )

Get the coordinates of a console position from a console device.

Parameters
ConsoleThe console device to get from
PositionThe console position to get the coordinates for (eg CONSOLE_POSITION_FULL)
X1The left edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y1The top edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
X2The right edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Y2The bottom edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_get_properties()

uint32_t STDCALL console_device_get_properties ( CONSOLE_DEVICE * console,
CONSOLE_PROPERTIES * properties )

Get the current properties from a console device.

Parameters
ConsoleThe console device to get properties from
PropertiesPointer to a TConsoleProperties structure to return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_check_flag()

BOOL STDCALL console_device_check_flag ( CONSOLE_DEVICE * console,
uint32_t flag )

Check if a console device supports a flag value.

Parameters
ConsoleThe console device to check
FlagThe console flag to check (eg CONSOLE_FLAG_FULLSCREEN)
Returns
True if flag is supported, False if not or on error

◆ console_device_update_flag()

uint32_t STDCALL console_device_update_flag ( CONSOLE_DEVICE * console,
uint32_t flag,
BOOL clear )

Set or clear a flag on a console device.

Parameters
ConsoleThe console device to set or clear the flag on
FlagThe console flag to set or clear (eg CONSOLE_FLAG_LINE_WRAP)
ClearIf true clear the flag, else set it
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_get_mode()

uint32_t STDCALL console_device_get_mode ( CONSOLE_DEVICE * console)

Get the mode of a console device.

Parameters
ConsoleThe console device to get from
Returns
The mode of the console (eg CONSOLE_MODE_PIXEL) or CONSOLE_MODE_NONE on error

◆ console_device_get_state()

uint32_t STDCALL console_device_get_state ( CONSOLE_DEVICE * console)

Get the state of a console device.

Parameters
ConsoleThe console device to get from
Returns
The current state of the console (eg CONSOLE_STATE_OPEN)

◆ console_device_create()

CONSOLE_DEVICE *STDCALL console_device_create ( void )

Create a new Console entry.

Returns
Pointer to new Console entry or nil if Console could not be created

◆ console_device_create_ex()

CONSOLE_DEVICE *STDCALL console_device_create_ex ( uint32_t size)

Create a new Console entry.

Parameters
SizeSize in bytes to allocate for new Console (Including the Console entry)
Returns
Pointer to new Console entry or nil if Console could not be created

◆ console_device_destroy()

uint32_t STDCALL console_device_destroy ( CONSOLE_DEVICE * console)

Destroy an existing Console entry.

Parameters
ConsoleThe console device to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_register()

uint32_t STDCALL console_device_register ( CONSOLE_DEVICE * console)

Register a new Console in the Console table.

Parameters
ConsoleThe console device to register
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_deregister()

uint32_t STDCALL console_device_deregister ( CONSOLE_DEVICE * console)

Deregister a Console from the Console table.

Parameters
ConsoleThe console device to deregister
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_find()

CONSOLE_DEVICE *STDCALL console_device_find ( uint32_t consoleid)

Find a console device by ID in the console table.

Parameters
ConsoleIdThe ID number of the console to find
Returns
Pointer to console device entry or nil if not found

◆ console_device_find_by_device()

CONSOLE_DEVICE *STDCALL console_device_find_by_device ( DEVICE * device)

Find a console device by its related device in the console table.

Parameters
DevicePointer to the related device to find
Returns
Pointer to console device entry or nil if not found

◆ console_device_find_by_name()

CONSOLE_DEVICE *STDCALL console_device_find_by_name ( const char * name)

Find a console device by name in the console table.

Parameters
NameThe name of the console to find (eg Console0)
Returns
Pointer to console device entry or nil if not found

◆ console_device_find_by_description()

CONSOLE_DEVICE *STDCALL console_device_find_by_description ( const char * description)

Find a console device by description in the console table.

Parameters
DescriptionThe description of the console to find (eg Framebuffer Console (Framebuffer0))
Returns
Pointer to console device entry or nil if not found

◆ console_device_enumerate()

uint32_t STDCALL console_device_enumerate ( console_enumerate_cb callback,
void * data )

Enumerate all console devices in the console table.

Parameters
CallbackThe callback function to call for each console in the table
DataA private data pointer to pass to callback for each console in the table
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_device_notification()

uint32_t STDCALL console_device_notification ( CONSOLE_DEVICE * console,
console_notification_cb callback,
void * data,
uint32_t notification,
uint32_t flags )

Register a notification for console device changes.

Parameters
ConsoleThe console device to notify changes for (Optional, pass nil for all console devices)
CallbackThe function to call when a notification event occurs
DataA private data pointer to pass to callback when a notification event occurs
NotificationThe events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER)
FlagsThe flags to control the notification (eg NOTIFIER_FLAG_WORKER)

◆ console_window_create()

WINDOW_HANDLE STDCALL console_window_create ( CONSOLE_DEVICE * console,
uint32_t position,
BOOL _default )

Create a new Console window.

Text Console Functions

Parameters
ConsoleThe console device to create the new window on
PositionThe console position to create the new window at (eg CONSOLE_POSITION_FULL)
DefaultIf true allow the new window to be the default window if there is no current default
Returns
Handle to new Console window or INVALID_HANDLE_VALUE if Console window could not be created

◆ console_window_create_ex()

WINDOW_HANDLE STDCALL console_window_create_ex ( CONSOLE_DEVICE * console,
FONT_HANDLE font,
uint32_t size,
uint32_t state,
uint32_t mode,
uint32_t position,
BOOL _default )

Create a new Console window.

Parameters
ConsoleThe console device to create the new window on
FontThe handle of the default font for the new console window
SizeThe size in bytes to allocate for the new window entry (Defaults to SizeOf(TConsoleWindow))
StateThe state of the new console window (WINDOW_STATE_VISIBLE or WINDOW_STATE_INVISIBLE)
ModeThe mode of the new console window (Normally WINDOW_MODE_TEXT)
PositionThe console position to create the new window at (eg CONSOLE_POSITION_FULL)
DefaultIf true allow the new window to be the default window if there is no current default
Returns
Handle to new Console window or INVALID_HANDLE_VALUE if Console window could not be created

◆ console_window_destroy()

uint32_t STDCALL console_window_destroy ( WINDOW_HANDLE handle)

Close and Destroy an existing console window.

Parameters
HandleThe handle of the window to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_show()

uint32_t STDCALL console_window_show ( WINDOW_HANDLE handle)

Make an existing console window visible and show it on screen.

Parameters
HandleThe handle of the window to show
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_hide()

uint32_t STDCALL console_window_hide ( WINDOW_HANDLE handle)

Make an existing console window invisible and hide it on screen.

Parameters
HandleThe handle of the window to hide
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_activate()

uint32_t STDCALL console_window_activate ( WINDOW_HANDLE handle)

Make an existing console window the active window.

Parameters
HandleThe handle of the window to activate
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_deactivate()

uint32_t STDCALL console_window_deactivate ( WINDOW_HANDLE handle)

Make an existing console window inactive.

Parameters
HandleThe handle of the window to deactivate
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
On success there will be no active window set

◆ console_window_next()

WINDOW_HANDLE STDCALL console_window_next ( CONSOLE_DEVICE * console,
BOOL visible )

Get the next console window starting with the active window.

Parameters
ConsoleThe console device to change the active window on
VisibleIf true only return windows that are visible
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_previous()

WINDOW_HANDLE STDCALL console_window_previous ( CONSOLE_DEVICE * console,
BOOL visible )

Get the previous console window starting with the active window.

Parameters
ConsoleThe console device to change the active window on
VisibleIf true only return windows that are visible
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_at()

WINDOW_HANDLE STDCALL console_window_at ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
BOOL visible )

Find the console window that X and Y coordinates are within.

Parameters
ConsoleThe console device to find the window on
XThe X coordinate to find the window for
YThe Y coordinate to find the window for
VisibleIf true only return windows that are visible
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character columns not screen pixels

◆ console_window_find()

WINDOW_HANDLE STDCALL console_window_find ( CONSOLE_DEVICE * console,
uint32_t position )

Find an existing console window in the position specified.

Parameters
ConsoleThe console device to find the window on
PositionThe window position to find (eg CONSOLE_POSITION_FULL)
Returns
The handle of the existing window or INVALID_HANDLE_VALUE if not found

◆ console_window_enumerate()

uint32_t STDCALL console_window_enumerate ( CONSOLE_DEVICE * console,
console_window_enumerate_cb callback,
void * data )

Enumerate existing console windows on the specified console device.

Parameters
ConsoleThe console device to enumerate windows for
CallbackThe function to call for each window enumerated
DataA pointer to private data to be passed to the callback (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_check_flag()

BOOL STDCALL console_window_check_flag ( WINDOW_HANDLE handle,
uint32_t flag )

Check an existing console window to determine if a flag is set or not.

Parameters
HandleThe handle of the window to check
FlagThe window flag to check for (eg WINDOW_FLAG_LINE_WRAP)
Returns
True if the flag is set, False if not set

◆ console_window_update_flag()

uint32_t STDCALL console_window_update_flag ( WINDOW_HANDLE handle,
uint32_t flag,
BOOL clear )

Set or clear a flag on an existing console window.

Parameters
HandleThe handle of the window to set or clear the flag on
FlagThe window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP)
ClearIf true clear the flag, else set it
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_mode()

uint32_t STDCALL console_window_get_mode ( WINDOW_HANDLE handle)

Get the window mode of an existing console window.

Parameters
HandleThe handle of the window to get the mode for
Returns
The window mode (eg WINDOW_MODE_TEXT)

◆ console_window_get_state()

uint32_t STDCALL console_window_get_state ( WINDOW_HANDLE handle)

Get the window state of an existing console window.

Parameters
HandleThe handle of the window to get the state for
Returns
The window state (eg WINDOW_STATE_INVISIBLE)

◆ console_window_get_position()

uint32_t STDCALL console_window_get_position ( WINDOW_HANDLE handle)

Get the position of an existing console window.

Parameters
HandleThe handle of the window to get the position for
Returns
The window position (eg CONSOLE_POSITION_FULL)

◆ console_window_set_position()

uint32_t STDCALL console_window_set_position ( WINDOW_HANDLE handle,
uint32_t position )

Set the position of an existing console window.

Parameters
HandleThe handle of the window to set the position for
PositionThe new window position to set
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The function will return ERROR_INVALID_PARAMETER if another window exists at the position

◆ console_window_get_properties()

uint32_t STDCALL console_window_get_properties ( WINDOW_HANDLE handle,
WINDOW_PROPERTIES * properties )

Get the properties for the specified console window.

Parameters
HandleThe handle of the window to get the properties from
PropertiesPointer to a TWindowProperties structure to fill in
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_min_x()

uint32_t STDCALL console_window_get_min_x ( WINDOW_HANDLE handle)

Get the current minimum X of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MinX for
Returns
The minimum X value for the current window viewport
Note
For Text Console functions, X is based on character columns not screen pixels

◆ console_window_get_min_y()

uint32_t STDCALL console_window_get_min_y ( WINDOW_HANDLE handle)

Get the current minimum Y of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MinY for
Returns
The minimum Y value for the current window viewport
Note
For Text Console functions, Y is based on character rows not screen pixels

◆ console_window_get_max_x()

uint32_t STDCALL console_window_get_max_x ( WINDOW_HANDLE handle)

Get the current maximum X of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MaxX for
Returns
The maximum X value for the current window viewport
Note
For Text Console functions, X is based on character columns not screen pixels

◆ console_window_get_max_y()

uint32_t STDCALL console_window_get_max_y ( WINDOW_HANDLE handle)

Get the current maximum Y of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MaxY for
Returns
The maximum Y value for the current window viewport
Note
For Text Console functions, Y is based on character rows not screen pixels

◆ console_window_get_rect()

CONSOLE_RECT STDCALL console_window_get_rect ( WINDOW_HANDLE handle)

Get the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the rectangle for
Returns
The rectangle of the current window viewport
Note
For Text Console functions, Rect is based on character rows and columns not screen pixels

◆ console_window_set_rect()

uint32_t STDCALL console_window_set_rect ( WINDOW_HANDLE handle,
CONSOLE_RECT * rect )

Set the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to set the rectangle for
RectThe rectangle to set for the window viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Rect is based on character rows and columns not screen pixels

◆ console_window_reset_rect()

uint32_t STDCALL console_window_reset_rect ( WINDOW_HANDLE handle)

Reset the window viewport for an existing console window to the maximum size.

Parameters
HandleThe handle of the window to reset the viewport for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_viewport()

uint32_t STDCALL console_window_get_viewport ( WINDOW_HANDLE handle,
uint32_t * x1,
uint32_t * y1,
uint32_t * x2,
uint32_t * y2 )

Get the X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the viewport for
X1The left edge of the current viewport
Y1The top edge of the current viewport
X2The right edge of the current viewport
Y2The bottom edge of the current viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Viewport is based on character rows and columns not screen pixels

◆ console_window_set_viewport()

uint32_t STDCALL console_window_set_viewport ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2 )

Set the X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the viewport for
X1The left edge of the window viewport
Y1The top edge of the window viewport
X2The right edge of the window viewport
Y2The bottom edge of the window viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Viewport is based on character rows and columns not screen pixels

◆ console_window_reset_viewport()

uint32_t STDCALL console_window_reset_viewport ( WINDOW_HANDLE handle)

Reset the window viewport for an existing console window to the maximum size.

Parameters
HandleThe handle of the window to reset the viewport for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_x()

uint32_t STDCALL console_window_get_x ( WINDOW_HANDLE handle)

Get the current X (Column) position of an existing console window.

Parameters
HandleThe handle of the window to get X for
Returns
The X value for the window
Note
For Text Console functions, X is based on character columns not screen pixels

◆ console_window_set_x()

uint32_t STDCALL console_window_set_x ( WINDOW_HANDLE handle,
uint32_t x )

Set the current X (Column) position of an existing console window.

Parameters
HandleThe handle of the window to set X for
XThe new X value to set
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X is based on character columns not screen pixels

◆ console_window_get_y()

uint32_t STDCALL console_window_get_y ( WINDOW_HANDLE handle)

Get the current Y (Row) position of an existing console window.

Parameters
HandleThe handle of the window to get Y for
Returns
The Y value for the window
Note
For Text Console functions, Y is based on character rows not screen pixels

◆ console_window_set_y()

uint32_t STDCALL console_window_set_y ( WINDOW_HANDLE handle,
uint32_t y )

Set the current Y (Row) position of an existing console window.

Parameters
HandleThe handle of the window to set Y for
YThe new Y value to set
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Y is based on character rows not screen pixels

◆ console_window_get_xy()

uint32_t STDCALL console_window_get_xy ( WINDOW_HANDLE handle,
uint32_t * x,
uint32_t * y )

Get the current X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to get X and Y for
XThe returned X value
YThe returned Y value
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character rows and columns not screen pixels

◆ console_window_set_xy()

uint32_t STDCALL console_window_set_xy ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Set the current X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to set X and Y for
XThe new X value
YThe new Y value
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character rows and columns not screen pixels

◆ console_window_get_point()

CONSOLE_POINT STDCALL console_window_get_point ( WINDOW_HANDLE handle)

Get the point X,Y of an existing console window.

Parameters
HandleThe handle of the window to get the point for
Returns
The current point of the window
Note
For Text Console functions, Point is based on character rows and columns not screen pixels

◆ console_window_set_point()

uint32_t STDCALL console_window_set_point ( WINDOW_HANDLE handle,
CONSOLE_POINT * point )

Set the point X,Y of an existing console window.

Parameters
HandleThe handle of the window to set the point for
PointThe new point to set for the window
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Point is based on character rows and columns not screen pixels

◆ console_window_get_cols()

uint32_t STDCALL console_window_get_cols ( WINDOW_HANDLE handle)

Get the current columns of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get columns for
Returns
The columns value for the current window viewport
Note
For Text Console functions, Columns is based on character columns not screen pixels

◆ console_window_get_rows()

uint32_t STDCALL console_window_get_rows ( WINDOW_HANDLE handle)

Get the current rows of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get rows for
Returns
The rows value for the current window viewport
Note
For Text Console functions, Rows is based on character rows not screen pixels

◆ console_window_get_width()

uint32_t STDCALL console_window_get_width ( WINDOW_HANDLE handle)

Get the absolute width of an existing console window.

Parameters
HandleThe handle of the window to get the width for
Returns
The absolute width of the window
Note
For Text Console functions, Width is based on character columns not screen pixels

◆ console_window_get_height()

uint32_t STDCALL console_window_get_height ( WINDOW_HANDLE handle)

Get the absolute height of an existing console window.

Parameters
HandleThe handle of the window to get the height for
Returns
The absolute height of the window
Note
For Text Console functions, Height is based on character rows not screen pixels

◆ console_window_get_format()

uint32_t STDCALL console_window_get_format ( WINDOW_HANDLE handle)

Get the color format of an existing console window.

Parameters
HandleThe handle of the window to get the format for
Returns
The color format of the window (eg COLOR_FORMAT_ARGB32)

◆ console_window_get_forecolor()

uint32_t STDCALL console_window_get_forecolor ( WINDOW_HANDLE handle)

Get the current foreground color of an existing console window.

Parameters
HandleThe handle of the window to get the foreground color for
Returns
The foreground color of the window (eg COLOR_WHITE)

◆ console_window_set_forecolor()

uint32_t STDCALL console_window_set_forecolor ( WINDOW_HANDLE handle,
uint32_t color )

Set the current foreground color of an existing console window.

Parameters
HandleThe handle of the window to set the foreground color for
ColorThe foreground color to set (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_backcolor()

uint32_t STDCALL console_window_get_backcolor ( WINDOW_HANDLE handle)

Get the current background color of an existing console window.

Parameters
HandleThe handle of the window to get the background color for
Returns
The background color of the window (eg COLOR_BLACK)

◆ console_window_set_backcolor()

uint32_t STDCALL console_window_set_backcolor ( WINDOW_HANDLE handle,
uint32_t color )

Set the current background color of an existing console window.

Parameters
HandleThe handle of the window to set the background color for
ColorThe background color to set (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_font()

FONT_HANDLE STDCALL console_window_get_font ( WINDOW_HANDLE handle)

Get the default font of an existing console window.

Parameters
HandleThe handle of the window to get the default font for
Returns
The font handle of the default font or INVALID_HANDLE_VALUE on error

◆ console_window_set_font()

uint32_t STDCALL console_window_set_font ( WINDOW_HANDLE handle,
FONT_HANDLE font )

Set the default font of an existing console window.

Parameters
HandleThe handle of the window to set the default font for
FontThe font handle of the default font to set
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console windows, setting the font also clears the window

◆ console_window_get_cursor_xy()

uint32_t STDCALL console_window_get_cursor_xy ( WINDOW_HANDLE handle,
uint32_t * x,
uint32_t * y )

Get the current cursor X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to get cursor X and Y for
XThe returned cursor X value
YThe returned cursor Y value
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, cursor X and Y are based on character rows and columns not screen pixels

◆ console_window_set_cursor_xy()

uint32_t STDCALL console_window_set_cursor_xy ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Set the current cursor X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to set cursor X and Y for
XThe new cursor X value
YThe new cursor Y value
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, cursor X and Y are based on character rows and columns not screen pixels

◆ console_window_get_cursor_mode()

CURSOR_MODE STDCALL console_window_get_cursor_mode ( WINDOW_HANDLE handle)

Get the current cursor mode of an existing console window.

Parameters
HandleThe handle of the window to get the mode for
Returns
The current cursor mode (eg CURSOR_MODE_INSERT)

◆ console_window_set_cursor_mode()

uint32_t STDCALL console_window_set_cursor_mode ( WINDOW_HANDLE handle,
CURSOR_MODE cursormode )

Set the current cursor mode of an existing console window.

Parameters
HandleThe handle of the window to set the mode for
CursorModeThe cursor mode to set (eg CURSOR_MODE_INSERT)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_cursor_blink()

BOOL STDCALL console_window_get_cursor_blink ( WINDOW_HANDLE handle)

Get the current cursor blink state of an existing console window.

Parameters
HandleThe handle of the window to get blink state for
Returns
True if blink is enabled, False if not or on error

◆ console_window_set_cursor_blink()

uint32_t STDCALL console_window_set_cursor_blink ( WINDOW_HANDLE handle,
BOOL cursorblink )

Set the current cursor blink state of an existing console window.

Parameters
HandleThe handle of the window to set the blink state for
CursorBlinkTrue to enable blink, False to disable
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_cursor_state()

CURSOR_STATE STDCALL console_window_get_cursor_state ( WINDOW_HANDLE handle)

Get the current cursor state of an existing console window.

Parameters
HandleThe handle of the window to get the state for
Returns
The current cursor state (eg CURSOR_STATE_ON)

◆ console_window_set_cursor_state()

uint32_t STDCALL console_window_set_cursor_state ( WINDOW_HANDLE handle,
CURSOR_STATE cursorstate )

Set the current cursor state of an existing console window.

Parameters
HandleThe handle of the window to set the state for
CursorStateThe cursor state to set (eg CURSOR_STATE_ON)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_cursor_shape()

CURSOR_SHAPE STDCALL console_window_get_cursor_shape ( WINDOW_HANDLE handle)

Get the current cursor shape of an existing console window.

Parameters
HandleThe handle of the window to get the shape for
Returns
The current cursor shape (eg CURSOR_SHAPE_LINE)

◆ console_window_set_cursor_shape()

uint32_t STDCALL console_window_set_cursor_shape ( WINDOW_HANDLE handle,
CURSOR_SHAPE cursorshape )

Set the current cursor shape of an existing console window.

Parameters
HandleThe handle of the window to set the shape for
CursorShapeThe cursor shape to set (eg CURSOR_SHAPE_LINE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_get_cursor_color()

uint32_t STDCALL console_window_get_cursor_color ( WINDOW_HANDLE handle)

Get the current cursor color of an existing console window.

Parameters
HandleThe handle of the window to get cursor color for
Returns
The cursor color of the window (eg COLOR_WHITE)
Note
Color will be returned in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_window_set_cursor_color()

uint32_t STDCALL console_window_set_cursor_color ( WINDOW_HANDLE handle,
uint32_t color )

Set the current cursor color of an existing console window.

Parameters
HandleThe handle of the window to set the cursor color for
ColorThe cursor color to set (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_window_get_cursor_reverse()

BOOL STDCALL console_window_get_cursor_reverse ( WINDOW_HANDLE handle)

Get the current cursor reverse state of an existing console window.

Parameters
HandleThe handle of the window to get reverse state for
Returns
True if reverse color is enabled, False if inverse color is enabled

◆ console_window_set_cursor_reverse()

uint32_t STDCALL console_window_set_cursor_reverse ( WINDOW_HANDLE handle,
BOOL cursorreverse )

Set the current cursor reverse state of an existing console window.

Parameters
HandleThe handle of the window to set the reverse state for
CursorReverseTrue to enable reverse color, False to enable inverse color
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_on()

uint32_t STDCALL console_window_cursor_on ( WINDOW_HANDLE handle)

Enable the cursor on an existing console window.

Parameters
HandleThe handle of the window to enable the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_off()

uint32_t STDCALL console_window_cursor_off ( WINDOW_HANDLE handle)

Disable the cursor on an existing console window.

Parameters
HandleThe handle of the window to disable the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_line()

uint32_t STDCALL console_window_cursor_line ( WINDOW_HANDLE handle)

Change the cursor to a vertical line on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_bar()

uint32_t STDCALL console_window_cursor_bar ( WINDOW_HANDLE handle)

Change the cursor to a horizontal bar on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_block()

uint32_t STDCALL console_window_cursor_block ( WINDOW_HANDLE handle)

Change the cursor to a solid block on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_move()

uint32_t STDCALL console_window_cursor_move ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Move the cursor on an existing console window.

Parameters
HandleThe handle of the window to move the cursor for
XThe column to move the cursor to
YThe row to move the cursor to
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character rows and columns not screen pixels

◆ console_window_cursor_blink()

uint32_t STDCALL console_window_cursor_blink ( WINDOW_HANDLE handle,
BOOL enabled )

Set the blink state of the cursor on an existing console window.

Parameters
HandleThe handle of the window to set the blink state for
EnabledTrue if the cursor is blinking, False if not
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_cursor_color()

uint32_t STDCALL console_window_cursor_color ( WINDOW_HANDLE handle,
uint32_t color )

Set the color of the cursor on an existing console window.

Parameters
HandleThe handle of the window to set the color for
ColorThe cursor color to set (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)

◆ console_window_cursor_reverse()

uint32_t STDCALL console_window_cursor_reverse ( WINDOW_HANDLE handle,
BOOL enabled )

Set the reverse state of the cursor on an existing console window.

Parameters
HandleThe handle of the window to set the reverse state for
EnabledTrue if the cursor shows in reverse colors, False if it shows in inverse colors
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_add_history()

uint32_t STDCALL console_window_add_history ( WINDOW_HANDLE handle,
const char * value )

Add a value to the command history table of an existing console window.

Parameters
HandleThe handle of the window to add to
ValueThe text to add to the command history
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
When the number of entries in the table reaches the maximum the first entry will be removed

◆ console_window_clear_history()

uint32_t STDCALL console_window_clear_history ( WINDOW_HANDLE handle)

Remove all entries from the command history table of an existing console window.

Parameters
HandleThe handle of the window to clear
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_first_history()

uint32_t STDCALL console_window_first_history ( WINDOW_HANDLE handle,
char * value,
uint32_t len )

Get the first (oldest) command history value from an existing console window.

Parameters
HandleThe handle of the window to get from
Returns
The command history value or an empty string on failure

◆ console_window_last_history()

uint32_t STDCALL console_window_last_history ( WINDOW_HANDLE handle,
char * value,
uint32_t len )

Get the last (most recent) command history value from an existing console window.

Parameters
HandleThe handle of the window to get from
Returns
The command history value or an empty string on failure

◆ console_window_next_history()

uint32_t STDCALL console_window_next_history ( WINDOW_HANDLE handle,
char * value,
uint32_t len )

Get the next (after current) command history value from an existing console window.

Parameters
HandleThe handle of the window to get from
Returns
The command history value or an empty string on failure

◆ console_window_previous_history()

uint32_t STDCALL console_window_previous_history ( WINDOW_HANDLE handle,
char * value,
uint32_t len )

Get the next (before current) command history value from an existing console window.

Parameters
HandleThe handle of the window to get from
Returns
The command history value or an empty string on failure
Note
If there is no current history value the last value is returned

◆ console_window_current_history()

uint32_t STDCALL console_window_current_history ( WINDOW_HANDLE handle,
char * value,
uint32_t len )

Get the current command history value from an existing console window.

Parameters
HandleThe handle of the window to get from
Returns
The command history value or an empty string on failure
Note
If there is no current history value the last value is returned

◆ console_window_scroll_up()

uint32_t STDCALL console_window_scroll_up ( WINDOW_HANDLE handle,
uint32_t row,
uint32_t lines )

Scroll the current viewport of an existing console window up.

Parameters
HandleThe handle of the window to scroll
RowThe starting row (Y) for the scroll up, all rows from top plus Lines down to Row will be scrolled up
LinesThe number of character lines to scroll up, Lines number of rows at the top will be discarded
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The starting Row will be blanked with the background color

◆ console_window_scroll_down()

uint32_t STDCALL console_window_scroll_down ( WINDOW_HANDLE handle,
uint32_t row,
uint32_t lines )

Scroll the current viewport of an existing console window down.

Parameters
HandleThe handle of the window to scroll
RowThe starting row (Y) for the scroll down, all rows from bottom minus Lines up to Row will be scrolled down
LinesThe number of character lines to scroll down, Lines number of rows at the bottom will be discarded
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The starting Row will be blanked with the background color

◆ console_window_scroll_left()

uint32_t STDCALL console_window_scroll_left ( WINDOW_HANDLE handle,
uint32_t row,
uint32_t col,
uint32_t lines,
uint32_t chars )

Scroll the current viewport of an existing console window left.

Parameters
HandleThe handle of the window to scroll
RowThe starting row (Y) for the scroll left, all rows from Row down to Row + Lines will be scrolled left
LinesThe number of rows to scroll left, all rows from Row down to Row + Lines will be scrolled left
ColThe starting column (X) for the scroll left, all cols from left plus Chars to Col with be scrolled left
CharsThe number of characters to scroll left, Chars number of columns at the left will be discarded
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The starting Col will be blanked with the background color

◆ console_window_scroll_right()

uint32_t STDCALL console_window_scroll_right ( WINDOW_HANDLE handle,
uint32_t row,
uint32_t col,
uint32_t lines,
uint32_t chars )

Scroll the current viewport of an existing console window right.

Parameters
HandleThe handle of the window to scroll
RowThe starting row (Y) for the scroll right, all rows from Row down to Row + Lines will be scrolled right
LinesThe number of rows to scroll right, all rows from Row down to Row + Lines will be scrolled right
ColThe starting column (X) for the scroll right, all rows from right minus Chars to Col will be scrolled right
CharsThe number of characters to scroll right, Chars number of columns at the right will be discarded
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The starting Col will be blanked with the background color

◆ console_window_clear()

uint32_t STDCALL console_window_clear ( WINDOW_HANDLE handle)

Clear the current viewport of an existing console window.

Parameters
HandleThe handle of the window to clear
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_clear_ex()

uint32_t STDCALL console_window_clear_ex ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
BOOL cursor )

Clear part of the the current viewport of an existing console window.

Parameters
HandleThe handle of the window to clear
X1The left edge of the area to clear (relative to current viewport)
Y1The top edge of the area to clear (relative to current viewport)
X2The right edge of the area to clear (relative to current viewport)
Y2The bottom edge of the area to clear (relative to current viewport)
CursorIf True update the cursor position after clearing
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Window is based on screen character rows and columns not screen pixels

◆ console_window_write()

uint32_t STDCALL console_window_write ( WINDOW_HANDLE handle,
const char * text )

Write text on an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to write text on
TextThe text to write
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The window will not scroll up at the end of the line

◆ console_window_write_ex()

uint32_t STDCALL console_window_write_ex ( WINDOW_HANDLE handle,
const char * text,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Write text on an existing console window.

Parameters
HandleThe handle of the window to write text on
TextThe text to write
XThe column to start writing the text at
YThe row to start writing the text at
ForecolorThe foreground color to use (eg COLOR_WHITE)
BackcolorThe background color to use (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on screen character rows and columns not screen pixels
The window will not scroll up at the end of the line

◆ console_window_write_ln()

uint32_t STDCALL console_window_write_ln ( WINDOW_HANDLE handle,
const char * text )

Write text on an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to write text on
TextThe text to write
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The window will scroll up at the end of the line

◆ console_window_write_ln_ex()

uint32_t STDCALL console_window_write_ln_ex ( WINDOW_HANDLE handle,
const char * text,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Write text on an existing console window.

Parameters
HandleThe handle of the window to write text on
TextThe text to write
XThe column to start writing the text at
YThe row to start writing the text at
ForecolorThe foreground color to use (eg COLOR_WHITE)
BackcolorThe background color to use (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character rows and columns not screen pixels
The window will scroll up at the end of the line

◆ console_window_write_chr()

uint32_t STDCALL console_window_write_chr ( WINDOW_HANDLE handle,
char ch )

Write a character on an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to write the character on
ChrThe character to write
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_write_chr_ex()

uint32_t STDCALL console_window_write_chr_ex ( WINDOW_HANDLE handle,
char ch,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Write a character on an existing console window.

Parameters
HandleThe handle of the window to write the character on
ChrThe character to write
XThe column to start writing the character at
YThe row to start writing the character at
ForecolorThe foreground color to use (eg COLOR_WHITE)
BackcolorThe background color to use (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, X and Y are based on character rows and columns not screen pixels

◆ console_window_output()

uint32_t STDCALL console_window_output ( WINDOW_HANDLE handle,
CONSOLE_POINT * source,
CONSOLE_POINT * dest,
CONSOLE_CHAR * buffer,
uint32_t width,
uint32_t height,
uint32_t skip )

Output a rectangular area of text to a console window.

Parameters
HandleThe console window to output to
SourceThe X and Y point in the source buffer to copy text from (Characters)
DestThe X and Y point on the console window to copy text to (Characters)
BufferA pointer to a buffer of TConsoleChar structures which represent rows of text
WidthThe width of the area to be output (Characters)
HeightThe height of the area to be output (Characters)
SkipThe number of characters to skip in the buffer after each row (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Text Console functions, Source, Dest, Width, Height and Skip are based on character rows and columns not screen pixels

◆ console_window_read()

uint32_t STDCALL console_window_read ( WINDOW_HANDLE handle,
char * text,
uint32_t * len )

Read text input from the console and echo to an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to echo input to
TextThe text read from the console on return
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The console window will not scroll up on return

◆ console_window_read_ln()

uint32_t STDCALL console_window_read_ln ( WINDOW_HANDLE handle,
char * text,
uint32_t * len )

Read text input from the console and echo to an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to echo input to
TextThe text read from the console on return
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The console window will scroll up one line on return

◆ console_window_read_ln_ex()

uint32_t STDCALL console_window_read_ln_ex ( WINDOW_HANDLE handle,
char * text,
uint32_t * len,
char * prompt,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor,
BOOL scroll,
BOOL history,
console_window_completion_cb completion,
void * data )

Read text input from the console and echo to an existing console window at the specified position in the specified color.

Parameters
HandleThe handle of the window to echo input to
TextThe text read from the console on return
PromptAn optional text prompt to display at the start of the line
XThe starting X position for the output (0 for current position)
YThe starting Y position for the output (0 for current position)
ForecolorThe text forecolor for the output (COLOR_NONE for current color)
BackcolorThe text backcolor for the output (COLOR_NONE for current color)
ScrollIf true then scroll up one line on return
HistoryIf true then support console history buffer using Up, Down and F3 keys
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Supports common line editing behaviour including Home, End, Left, Right, Up, Down, Insert, Backspace and Delete

◆ console_window_read_chr()

uint32_t STDCALL console_window_read_chr ( WINDOW_HANDLE handle,
char * ch )

Read one character input from the console and echo to an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to echo input to
ChrThe character read from the console on return
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The console window will not scroll up on return

◆ console_window_read_chr_ex()

uint32_t STDCALL console_window_read_chr_ex ( WINDOW_HANDLE handle,
char * ch,
char * prompt,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor,
BOOL echo,
BOOL scroll )

Read one character input from the console and optionally echo to an existing console window at the specified position in the specified color.

Parameters
HandleThe handle of the window to echo input to
ChrThe character read from the console on return
PromptAn optional text prompt to display at the start of the line
XThe starting X position for the output (0 for current position)
YThe starting Y position for the output (0 for current position)
ForecolorThe text forecolor for the output (COLOR_NONE for current color)
BackcolorThe text backcolor for the output (COLOR_NONE for current color)
EchoIf true then echo the character to the console window
ScrollIf true then scroll up one line on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_printf()

int STDCALL console_window_printf ( WINDOW_HANDLE handle,
const char * format,
... )

Print formatted text to an existing console window at the current position in the current color.

Parameters
HandleThe handle of the window to print to
FormatThe formatted text to print (As per printf in standard C library)
Returns
On success the total number of characters output to the console, on error a negative value is returned and errno is set to the error code

◆ console_clr_eol()

int STDCALL void STDCALL console_clr_eol ( void )

Compatible with RTL Crt unit function ClrEol.

CRT Console Functions

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/clreol.html

◆ console_clr_scr()

void STDCALL console_clr_scr ( void )

Compatible with RTL Crt unit function ClrScr.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/clrscr.html

◆ console_delay()

void STDCALL console_delay ( uint16_t ms)

Compatible with RTL Crt unit function Delay.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/delay.html

◆ console_del_line()

void STDCALL console_del_line ( void )

Compatible with RTL Crt unit function DelLine.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/delline.html

◆ console_goto_xy()

void STDCALL console_goto_xy ( int x,
int y )

Compatible with RTL Crt unit function GotoXY.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/gotoxy.html
Note
For CRT Console functions, X and Y are based on character rows and columns not screen pixels

◆ console_high_video()

void STDCALL console_high_video ( void )

Compatible with RTL Crt unit function HighVideo.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/highvideo.html

◆ console_ins_line()

void STDCALL console_ins_line ( void )

Compatible with RTL Crt unit function InsLine.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/insline.html

◆ console_keypressed()

BOOL STDCALL console_keypressed ( void )

Compatible with RTL Crt unit function KeyPressed.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/keypressed.html

◆ console_low_video()

void STDCALL console_low_video ( void )

Compatible with RTL Crt unit function LowVideo.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/lowvideo.html

◆ console_norm_video()

void STDCALL console_norm_video ( void )

Compatible with RTL Crt unit function NormVideo.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/normvideo.html

◆ console_no_sound()

void STDCALL console_no_sound ( void )

Compatible with RTL Crt unit function NoSound.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/nosound.html

◆ console_read_key()

char STDCALL console_read_key ( void )

Compatible with RTL Crt unit function ReadKey.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/readkey.html
Note
For extended key scan codes see: http://www.freepascal.org/docs-html/rtl/keyboard/kbdscancode.html

◆ console_sound()

void STDCALL console_sound ( uint16_t hz)

Compatible with RTL Crt unit function Sound.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/sound.html

◆ console_text_background()

void STDCALL console_text_background ( uint32_t color)

Compatible with RTL Crt unit function TextBackground.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/textbackground.html

◆ console_text_color()

void STDCALL console_text_color ( uint32_t color)

Compatible with RTL Crt unit function TextColor.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/textcolor.html

◆ console_text_mode()

void STDCALL console_text_mode ( int mode)

Compatible with RTL Crt unit function TextMode.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/textmode.html

◆ console_where_x()

int STDCALL console_where_x ( void )

Compatible with RTL Crt unit function WhereX.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/wherex.html
Note
For CRT Console functions, X is based on character columns not screen pixels

◆ console_where_y()

int STDCALL console_where_y ( void )

Compatible with RTL Crt unit function WhereY.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/wherey.html
Note
For CRT Console functions, Y is based on character row not screen pixels

◆ console_window()

void STDCALL console_window ( int x1,
int y1,
int x2,
int y2 )

Compatible with RTL Crt unit function Window.

See also
http://www.freepascal.org/docs-html-3.0.0/rtl/crt/window.html
Note
For CRT Console functions, X1, Y1, X2 and Y2 are based on character rows and columns not screen pixels

◆ console_scroll_up()

void STDCALL console_scroll_up ( int row,
int lines )

Scroll the default console window up.

Parameters
RowThe starting row (Y) for the scroll up, all rows from top plus Lines down to Row will be scrolled up
LinesThe number of character lines to scroll up, Lines number of rows at the top will be discarded
Note
For CRT Console functions, Row and Lines are based on character rows and columns not screen pixels

◆ console_scroll_down()

void STDCALL console_scroll_down ( int row,
int lines )

Scroll the default console window down.

Parameters
RowThe starting row (Y) for the scroll down, all rows from bottom minus Lines up to Row will be scrolled down
LinesThe number of character lines to scroll down, Lines number of rows at the bottom will be discarded
Note
For CRT Console functions, Row and Lines are based on character rows and columns not screen pixels

◆ console_write()

void STDCALL console_write ( const char * text)

Write text on the default console window at the current position in the current color.

Parameters
TextThe text to write
Note
The window will not scroll up at the end of the line

◆ console_write_ln()

void STDCALL console_write_ln ( const char * text)

Write text on the default console window at the current position in the current color.

Parameters
TextThe text to write
Note
The window will scroll up at the end of the line

◆ console_write_chr()

void STDCALL console_write_chr ( char ch)

Write a character on the default console window at the current position in the current color.

Parameters
ChrThe character to write

◆ console_read()

void STDCALL console_read ( char * text,
uint32_t * len )

Read text from console input and echo to the screen.

Parameters
TextThe text read from the console input

◆ console_read_ln()

void STDCALL console_read_ln ( char * text,
uint32_t * len )

Read text from console input and echo to the screen.

Parameters
TextThe text read from the console input

◆ console_read_chr()

void STDCALL console_read_chr ( char * ch)

Read a character from console input and echo to the screen.

Parameters
ChrThe character read from the console input

◆ console_printf()

int STDCALL console_printf ( const char * format,
... )

Print formatted text to the default console window at the current position in the current color.

Parameters
FormatThe formatted text to print (As per printf in standard C library)
Returns
On success the total number of characters output to the console, on error a negative value is returned and errno is set to the error code

◆ console_device_get_count()

int STDCALL uint32_t STDCALL console_device_get_count ( void )

Get the current console device count.

Console Helper Functions

◆ console_device_get_default()

CONSOLE_DEVICE *STDCALL console_device_get_default ( void )

Get the current default console device.

◆ console_device_set_default()

uint32_t STDCALL console_device_set_default ( CONSOLE_DEVICE * console)

Set the current default console device.

◆ console_device_check()

CONSOLE_DEVICE *STDCALL console_device_check ( CONSOLE_DEVICE * console)

Check if the supplied Console device is in the Console table.

◆ console_device_caret_check()

CONSOLE_CARET *STDCALL console_device_caret_check ( CONSOLE_DEVICE * console,
CONSOLE_CARET * caret )

Check if a console caret entry is valid.

Parameters
ConsoleThe console device to search for the caret
CaretThe caret entry to check for validity
Returns
The supplied caret if successful or nil on failure

◆ console_type_to_string()

uint32_t STDCALL console_type_to_string ( uint32_t consoletype,
char * value,
uint32_t len )

Convert a Console type value to a string.

◆ console_state_to_string()

uint32_t STDCALL console_state_to_string ( uint32_t consolestate,
char * value,
uint32_t len )

Convert a Console state value to a string.

◆ console_device_get_default_font()

FONT_HANDLE STDCALL console_device_get_default_font ( void )

Get the default console font.

◆ console_position_to_string()

uint32_t STDCALL console_position_to_string ( uint32_t position,
char * value,
uint32_t len )

◆ console_window_get_count()

uint32_t STDCALL console_window_get_count ( CONSOLE_DEVICE * console)

Get the current console window count.

Text Console Helper Functions

Parameters
ConsoleThe console device to get the window count for
Returns
The current number of console windows on the specified console device

◆ console_window_get_active()

WINDOW_HANDLE STDCALL console_window_get_active ( CONSOLE_DEVICE * console)

Get the current console active window.

Parameters
ConsoleThe console device to get the active window for
Returns
The window handle of the current active window or INVALID_HANDLE_VALUE on failure

◆ console_window_get_default()

WINDOW_HANDLE STDCALL console_window_get_default ( CONSOLE_DEVICE * console)

Get the current console default window.

Parameters
ConsoleThe console device to get the default window for
Returns
The window handle of the current default window or INVALID_HANDLE_VALUE on failure

◆ console_window_set_default()

uint32_t STDCALL console_window_set_default ( CONSOLE_DEVICE * console,
WINDOW_HANDLE handle )

Set the current console default window.

Parameters
ConsoleThe console device to set the default window for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ console_window_check()

CONSOLE_WINDOW *STDCALL console_window_check ( CONSOLE_DEVICE * console,
CONSOLE_WINDOW * window )

Check if a console window entry is valid.

Parameters
ConsoleThe console device to search for the window
WindowThe window entry to check for validity
Returns
The supplied window if successful or nil on failure

◆ console_window_state_to_string()

uint32_t STDCALL console_window_state_to_string ( uint32_t windowstate,
char * value,
uint32_t len )

Convert a Console Window state value to a string.

◆ console_window_mode_to_string()

uint32_t STDCALL console_window_mode_to_string ( uint32_t windowmode,
char * value,
uint32_t len )

Convert a Console Window mode value to a string.

◆ console_window_get_default_font()

FONT_HANDLE STDCALL console_window_get_default_font ( void )

Get the default console window font.

◆ console_window_redirect_output()

BOOL STDCALL console_window_redirect_output ( WINDOW_HANDLE handle)

Redirect standard output to the console window specified by Handle.

Parameters
HandleThe window handle to redirect output to (or INVALID_HANDLE_VALUE to stop redirection)
Returns
True if completed successfully or False if an error occurred
Note
Redirects the output of the text files Output, ErrOutput, StdOut and StdErr which also redirects the output of Write, WriteLn and the standard C library