Class CellSurface
A grid of cells a program draws into directly, with no escape parsing: what a session shows in place of the emulator’s screen while a DarkEffekt.Terminal.ISurfaceProgram runs. It carries no cursor, scrollback, or modes. Call DarkEffekt.Terminal.CellSurface.Invalidate() after drawing so the renderer picks the change up.
Assembly: DarkEffekt.Terminal.Core
Section titled “Assembly: DarkEffekt.Terminal.Core”public sealed class CellSurfaceProperties
Section titled “Properties”public int Cols { get; }public int Rows { get; }Version
Section titled “Version”Bumped by Invalidate, Clear, and Resize; renderers compare and redraw.
public int Version { get; }this[int, int]
Section titled “this[int, int]”public ref Cell this[int x, int y] { get; }Methods
Section titled “Methods”Row(int)
Section titled “Row(int)”One row of cells, writable in place.
public Span<Cell> Row(int y)Returns
Section titled “Returns”System.Span<DarkEffekt.Terminal.Cell>
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
y |
Invalidate()
Section titled “Invalidate()”Marks the surface changed.
public void Invalidate()Resize(int, int)
Section titled “Resize(int, int)”Resizes the grid and blanks it. The contents are the program’s to redraw.
public void Resize(int cols, int rows)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
cols |
System.Int32 |
rows |
Clear(in Cell)
Section titled “Clear(in Cell)”public void Clear(in Cell fill)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Cell | fill |
Put(int, int, int, TermColor, TermColor, CellAttrs)
Section titled “Put(int, int, int, TermColor, TermColor, CellAttrs)”Writes one code point at a cell, as one cell or as the head and tail of a wide character. Out of bounds writes are dropped. Returns the cells it took, 0 for a combining mark. A control character is dropped, and half of a surrogate pair becomes U+FFFD, so a cell never holds a rune that an ANSI presenter or a font cannot take.
public int Put(int x, int y, int rune, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None)Returns
Section titled “Returns”System.Int32
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
rune |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
| DarkEffekt.Terminal.CellAttrs | attrs |
CopyFrom(CellSurface)
Section titled “CopyFrom(CellSurface)”Copies every cell from another surface of the same size.
public void CopyFrom(CellSurface other)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.CellSurface | other |