zig/lib/std / os/uefi/protocol/simple_text_output.zig

Character output devices

const std = @import("std");
const uefi = std.os.uefi;
const Guid = uefi.Guid;
const Status = uefi.Status;
const cc = uefi.cc;

SimpleTextOutput

Resets the text output device hardware.


/// Character output devices
pub const SimpleTextOutput = extern struct {
    _reset: *const fn (*const SimpleTextOutput, bool) callconv(cc) Status,
    _output_string: *const fn (*const SimpleTextOutput, [*:0]const u16) callconv(cc) Status,
    _test_string: *const fn (*const SimpleTextOutput, [*:0]const u16) callconv(cc) Status,
    _query_mode: *const fn (*const SimpleTextOutput, usize, *usize, *usize) callconv(cc) Status,
    _set_mode: *const fn (*const SimpleTextOutput, usize) callconv(cc) Status,
    _set_attribute: *const fn (*const SimpleTextOutput, usize) callconv(cc) Status,
    _clear_screen: *const fn (*const SimpleTextOutput) callconv(cc) Status,
    _set_cursor_position: *const fn (*const SimpleTextOutput, usize, usize) callconv(cc) Status,
    _enable_cursor: *const fn (*const SimpleTextOutput, bool) callconv(cc) Status,
    mode: *Mode,

reset()

Writes a string to the output device.


    /// Resets the text output device hardware.
    pub fn reset(self: *const SimpleTextOutput, verify: bool) Status {
        return self._reset(self, verify);
    }

outputString()

Verifies that all characters in a string can be output to the target device.


    /// Writes a string to the output device.
    pub fn outputString(self: *const SimpleTextOutput, msg: [*:0]const u16) Status {
        return self._output_string(self, msg);
    }

testString()

Returns information for an available text mode that the output device(s) supports.


    /// Verifies that all characters in a string can be output to the target device.
    pub fn testString(self: *const SimpleTextOutput, msg: [*:0]const u16) Status {
        return self._test_string(self, msg);
    }

queryMode()

Sets the output device(s) to a specified mode.


    /// Returns information for an available text mode that the output device(s) supports.
    pub fn queryMode(self: *const SimpleTextOutput, mode_number: usize, columns: *usize, rows: *usize) Status {
        return self._query_mode(self, mode_number, columns, rows);
    }

setMode()

Sets the background and foreground colors for the outputString() and clearScreen() functions.


    /// Sets the output device(s) to a specified mode.
    pub fn setMode(self: *const SimpleTextOutput, mode_number: usize) Status {
        return self._set_mode(self, mode_number);
    }

setAttribute()

Clears the output device(s) display to the currently selected background color.


    /// Sets the background and foreground colors for the outputString() and clearScreen() functions.
    pub fn setAttribute(self: *const SimpleTextOutput, attribute: usize) Status {
        return self._set_attribute(self, attribute);
    }

clearScreen()

Sets the current coordinates of the cursor position.


    /// Clears the output device(s) display to the currently selected background color.
    pub fn clearScreen(self: *const SimpleTextOutput) Status {
        return self._clear_screen(self);
    }

setCursorPosition()

Makes the cursor visible or invisible.


    /// Sets the current coordinates of the cursor position.
    pub fn setCursorPosition(self: *const SimpleTextOutput, column: usize, row: usize) Status {
        return self._set_cursor_position(self, column, row);
    }

enableCursor()


    /// Makes the cursor visible or invisible.
    pub fn enableCursor(self: *const SimpleTextOutput, visible: bool) Status {
        return self._enable_cursor(self, visible);
    }

guid


    pub const guid align(8) = Guid{
        .time_low = 0x387477c2,
        .time_mid = 0x69c7,
        .time_high_and_version = 0x11d2,
        .clock_seq_high_and_reserved = 0x8e,
        .clock_seq_low = 0x39,
        .node = [_]u8{ 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b },
    };

boxdraw_horizontal:

    pub const boxdraw_horizontal: u16 = 0x2500;

boxdraw_vertical:

    pub const boxdraw_vertical: u16 = 0x2502;

boxdraw_down_right:

    pub const boxdraw_down_right: u16 = 0x250c;

boxdraw_down_left:

    pub const boxdraw_down_left: u16 = 0x2510;

boxdraw_up_right:

    pub const boxdraw_up_right: u16 = 0x2514;

boxdraw_up_left:

    pub const boxdraw_up_left: u16 = 0x2518;

boxdraw_vertical_right:

    pub const boxdraw_vertical_right: u16 = 0x251c;

boxdraw_vertical_left:

    pub const boxdraw_vertical_left: u16 = 0x2524;

boxdraw_down_horizontal:

    pub const boxdraw_down_horizontal: u16 = 0x252c;

boxdraw_up_horizontal:

    pub const boxdraw_up_horizontal: u16 = 0x2534;

boxdraw_vertical_horizontal:

    pub const boxdraw_vertical_horizontal: u16 = 0x253c;

boxdraw_double_horizontal:

    pub const boxdraw_double_horizontal: u16 = 0x2550;

boxdraw_double_vertical:

    pub const boxdraw_double_vertical: u16 = 0x2551;

boxdraw_down_right_double:

    pub const boxdraw_down_right_double: u16 = 0x2552;

boxdraw_down_double_right:

    pub const boxdraw_down_double_right: u16 = 0x2553;

boxdraw_double_down_right:

    pub const boxdraw_double_down_right: u16 = 0x2554;

boxdraw_down_left_double:

    pub const boxdraw_down_left_double: u16 = 0x2555;

boxdraw_down_double_left:

    pub const boxdraw_down_double_left: u16 = 0x2556;

boxdraw_double_down_left:

    pub const boxdraw_double_down_left: u16 = 0x2557;

boxdraw_up_right_double:

    pub const boxdraw_up_right_double: u16 = 0x2558;

boxdraw_up_double_right:

    pub const boxdraw_up_double_right: u16 = 0x2559;

boxdraw_double_up_right:

    pub const boxdraw_double_up_right: u16 = 0x255a;

boxdraw_up_left_double:

    pub const boxdraw_up_left_double: u16 = 0x255b;

boxdraw_up_double_left:

    pub const boxdraw_up_double_left: u16 = 0x255c;

boxdraw_double_up_left:

    pub const boxdraw_double_up_left: u16 = 0x255d;

boxdraw_vertical_right_double:

    pub const boxdraw_vertical_right_double: u16 = 0x255e;

boxdraw_vertical_double_right:

    pub const boxdraw_vertical_double_right: u16 = 0x255f;

boxdraw_double_vertical_right:

    pub const boxdraw_double_vertical_right: u16 = 0x2560;

boxdraw_vertical_left_double:

    pub const boxdraw_vertical_left_double: u16 = 0x2561;

boxdraw_vertical_double_left:

    pub const boxdraw_vertical_double_left: u16 = 0x2562;

boxdraw_double_vertical_left:

    pub const boxdraw_double_vertical_left: u16 = 0x2563;

boxdraw_down_horizontal_double:

    pub const boxdraw_down_horizontal_double: u16 = 0x2564;

boxdraw_down_double_horizontal:

    pub const boxdraw_down_double_horizontal: u16 = 0x2565;

boxdraw_double_down_horizontal:

    pub const boxdraw_double_down_horizontal: u16 = 0x2566;

boxdraw_up_horizontal_double:

    pub const boxdraw_up_horizontal_double: u16 = 0x2567;

boxdraw_up_double_horizontal:

    pub const boxdraw_up_double_horizontal: u16 = 0x2568;

boxdraw_double_up_horizontal:

    pub const boxdraw_double_up_horizontal: u16 = 0x2569;

boxdraw_vertical_horizontal_double:

    pub const boxdraw_vertical_horizontal_double: u16 = 0x256a;

boxdraw_vertical_double_horizontal:

    pub const boxdraw_vertical_double_horizontal: u16 = 0x256b;

boxdraw_double_vertical_horizontal:

    pub const boxdraw_double_vertical_horizontal: u16 = 0x256c;

blockelement_full_block:

    pub const blockelement_full_block: u16 = 0x2588;

blockelement_light_shade:

    pub const blockelement_light_shade: u16 = 0x2591;

geometricshape_up_triangle:

    pub const geometricshape_up_triangle: u16 = 0x25b2;

geometricshape_right_triangle:

    pub const geometricshape_right_triangle: u16 = 0x25ba;

geometricshape_down_triangle:

    pub const geometricshape_down_triangle: u16 = 0x25bc;

geometricshape_left_triangle:

    pub const geometricshape_left_triangle: u16 = 0x25c4;

arrow_up:

    pub const arrow_up: u16 = 0x2591;

arrow_down:

    pub const arrow_down: u16 = 0x2593;

black:

    pub const black: u8 = 0x00;

blue:

    pub const blue: u8 = 0x01;

green:

    pub const green: u8 = 0x02;

cyan:

    pub const cyan: u8 = 0x03;

red:

    pub const red: u8 = 0x04;

magenta:

    pub const magenta: u8 = 0x05;

brown:

    pub const brown: u8 = 0x06;

lightgray:

    pub const lightgray: u8 = 0x07;

bright:

    pub const bright: u8 = 0x08;

darkgray:

    pub const darkgray: u8 = 0x08;

lightblue:

    pub const lightblue: u8 = 0x09;

lightgreen:

    pub const lightgreen: u8 = 0x0a;

lightcyan:

    pub const lightcyan: u8 = 0x0b;

lightred:

    pub const lightred: u8 = 0x0c;

lightmagenta:

    pub const lightmagenta: u8 = 0x0d;

yellow:

    pub const yellow: u8 = 0x0e;

white:

    pub const white: u8 = 0x0f;

background_black:

    pub const background_black: u8 = 0x00;

background_blue:

    pub const background_blue: u8 = 0x10;

background_green:

    pub const background_green: u8 = 0x20;

background_cyan:

    pub const background_cyan: u8 = 0x30;

background_red:

    pub const background_red: u8 = 0x40;

background_magenta:

    pub const background_magenta: u8 = 0x50;

background_brown:

    pub const background_brown: u8 = 0x60;

background_lightgray:

    pub const background_lightgray: u8 = 0x70;

Mode


    pub const Mode = extern struct {
        max_mode: u32, // specified as signed
        mode: u32, // specified as signed
        attribute: i32,
        cursor_column: i32,
        cursor_row: i32,
        cursor_visible: bool,
    };
};