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
_lengthcells.
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
attachedis 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
lencells fromsrcstarting atsrcColtodstColat this line. -
createAnchor(
int offset) → CellAnchor -
Creates an anchor at cell
offsetof this line. -
createCellData(
int index) → CellData -
Resets cell
indexand returns an empty CellData, as xterm does. -
dispose(
) → void - Disposes every anchor of this line.
-
eraseCell(
int index, CursorStyle style) → void -
Empties cell
index, keepingstyle's colours and attributes. -
eraseRange(
int start, int end, CursorStyle style) → void -
Erase cells whose index satisfies
start<= index <end. Erased cells are filled withstyle. -
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
indexintocellData. -
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) toto(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
countcells atstart. New cells are initialized withstyle. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCells(
int start, int count, [CursorStyle? style]) → void -
Remove
countcells starting atstart. Cells that are empty after the removal are filled withstyle. -
resetCell(
int index) → void -
Resets cell
indexto 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
indextocharof widthwitdh(sic, xterm's name) instyle. -
setCellData(
int index, CellData cellData) → void -
Sets cell
indexfromcellData. -
setCodePoint(
int index, int char) → void -
Sets cell
indextochar, 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