Raxol.Terminal.Buffer.Manager.State (Raxol v0.5.0)

View Source

Defines the state structure and operations for the buffer manager. This module handles the core state management for the terminal buffer, including active buffer, back buffer, scrollback, damage tracking, and memory management.

Summary

Functions

Gets a cell from the active buffer.

Gets a cell from the active buffer at the specified coordinates.

Gets the content of the active buffer.

Gets the dimensions of the active buffer.

Gets the height of the active buffer.

Gets a line from the active buffer.

Gets the width of the active buffer.

Creates a new state with the specified dimensions.

Updates a line in the active buffer.

Types

t()

@type t() :: %Raxol.Terminal.Buffer.Manager.State{
  active_buffer: Raxol.Terminal.ScreenBuffer.t(),
  back_buffer: Raxol.Terminal.ScreenBuffer.t(),
  damage_tracker: Raxol.Terminal.Buffer.DamageTracker.t(),
  memory_limit: non_neg_integer(),
  memory_usage: non_neg_integer(),
  metrics: map(),
  scrollback: Raxol.Terminal.Buffer.Scrollback.t()
}

Functions

get_cell(state, x, y)

Gets a cell from the active buffer.

get_cell_at(state, x, y)

Gets a cell from the active buffer at the specified coordinates.

get_content(state)

Gets the content of the active buffer.

get_dimensions(state)

Gets the dimensions of the active buffer.

get_height(state)

Gets the height of the active buffer.

get_line(state, line_index)

Gets a line from the active buffer.

get_width(state)

Gets the width of the active buffer.

new(width, height)

Creates a new state with the specified dimensions.

put_line(state, line_index, new_cells)

Updates a line in the active buffer.