Raxol.Terminal.ScreenBuffer.Core (Raxol v2.3.0)

View Source

Core functionality for screen buffer creation, initialization, and basic queries. Consolidates: Initializer, Common, Helpers, and basic state management.

Summary

Functions

Clears the entire buffer.

Gets a cell at the specified coordinates.

Gets the character at the specified coordinates.

Gets the buffer dimensions.

Gets the buffer height.

Gets a line of cells.

Gets the buffer width.

Creates a new screen buffer with the specified dimensions.

Resizes the buffer to new dimensions.

Converts buffer to legacy cell grid format for backward compatibility.

Checks if coordinates are within buffer bounds.

Types

t()

@type t() :: %Raxol.Terminal.ScreenBuffer.Core{
  alternate_screen: boolean(),
  cells: [[Raxol.Terminal.Cell.t()]],
  cursor_blink: boolean(),
  cursor_position: {non_neg_integer(), non_neg_integer()},
  cursor_style: atom(),
  cursor_visible: boolean(),
  damage_regions: [tuple()],
  default_style: map(),
  height: non_neg_integer(),
  scroll_position: non_neg_integer(),
  scroll_region: nil | {non_neg_integer(), non_neg_integer()},
  scrollback: [[Raxol.Terminal.Cell.t()]],
  scrollback_limit: non_neg_integer(),
  selection:
    nil
    | {non_neg_integer(), non_neg_integer(), non_neg_integer(),
       non_neg_integer()},
  width: non_neg_integer()
}

Functions

clear(buffer)

Clears the entire buffer.

get_cell(buffer, x, y)

Gets a cell at the specified coordinates.

get_char(buffer, x, y)

Gets the character at the specified coordinates.

get_dimensions(map)

Gets the buffer dimensions.

get_height(map)

Gets the buffer height.

get_line(buffer, y)

Gets a line of cells.

get_width(map)

Gets the buffer width.

new(width, height, scrollback_limit \\ 1000)

Creates a new screen buffer with the specified dimensions.

resize(buffer, new_width, new_height)

Resizes the buffer to new dimensions.

to_cell_grid(buffer)

Converts buffer to legacy cell grid format for backward compatibility.

within_bounds?(map, x, y)

Checks if coordinates are within buffer bounds.