BufferLine class

One line of cells, four 32-bit words per cell: foreground, background, attributes (CellAttr) and content (code point and width, see CellContent); colours are packed as CellColor describes.

Terminal.buffer.lines[i] returns a snapshot of a terminal row, made when it is first read and valid until the terminal changes: it is then no longer attached, and reading the line again returns a fresh one. The setters change the snapshot only, never the terminal. A line built with the constructor is a standalone, writable line, as in xterm.

Constructors

BufferLine(int _length, {bool isWrapped = false})
Creates an empty line of _length cells.

Properties

anchors → List<CellAnchor>
The anchors created on this line with createAnchor.
no setter
attached → bool
Whether this item is currently stored in a buffer: a line read from a terminal stays attached until the terminal changes.
no setterinherited
data → Uint32List
The raw cell storage, four words per cell (see BufferLine).
no setter
hashCode → int
The hash code for this object.
no setterinherited
index → int
The index of this item in the buffer (0 is the oldest scrollback line). Must only be accessed when attached is true; throws StateError otherwise.
no setterinherited
isWrapped ↔ bool
Whether this line continues the previous one (a soft wrap).
getter/setter pair
length → int
The number of cells.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyFrom(BufferLine src, int srcCol, int dstCol, int len) → void
Copies len cells from src starting at srcCol to dstCol at this line.
createAnchor(int offset) → CellAnchor
Creates an anchor at cell offset of this line.
createCellData(int index) → CellData
Resets cell index and returns an empty CellData, as xterm does.
dispose() → void
Disposes every anchor of this line.
eraseCell(int index, CursorStyle style) → void
Empties cell index, keeping style's colours and attributes.
eraseRange(int start, int end, CursorStyle style) → void
Erase cells whose index satisfies start <= index < end. Erased cells are filled with style.
getAttributes(int index) → int
The CellAttr bits of cell index.
getBackground(int index) → int
The packed background colour of cell index.
getCellData(int index, CellData cellData) → void
Copies cell index into cellData.
getCodePoint(int index) → int
The code point of cell index; 0 for an empty cell and for the second cell of a wide character.
getContent(int index) → int
The packed content (code point and width) of cell index.
getForeground(int index) → int
The packed foreground colour of cell index.
getText([int? from, int? to]) → String
The text of cells from (inclusive) to to (exclusive), the whole line by default. Empty cells are skipped, as in xterm.
getTrimmedLength([int? cols]) → int
Returns the offset of the last cell that has content from the start of the line.
getWidth(int index) → int
The width of cell index: 1, 2 for a wide character, 0 when empty.
insertCells(int start, int count, [CursorStyle? style]) → void
Inserts count cells at start. New cells are initialized with style.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeCells(int start, int count, [CursorStyle? style]) → void
Remove count cells starting at start. Cells that are empty after the removal are filled with style.
resetCell(int index) → void
Resets cell index to an empty, unstyled cell.
resize(int length) → void
Changes the number of cells to length, keeping the existing cells.
setAttributes(int index, int value) → void
Sets the CellAttr bits of cell index.
setBackground(int index, int value) → void
Sets the packed background colour of cell index.
setCell(int index, int char, int witdh, CursorStyle style) → void
Sets cell index to char of width witdh (sic, xterm's name) in style.
setCellData(int index, CellData cellData) → void
Sets cell index from cellData.
setCodePoint(int index, int char) → void
Sets cell index to char, with its Unicode 11 width.
setContent(int index, int value) → void
Sets the packed content of cell index.
setForeground(int index, int value) → void
Sets the packed foreground colour of cell index.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited