|
| | Terminal () |
| |
| | Terminal (int width, int height) |
| |
| | Terminal (int width, int height, ColorMode colorMode) |
| |
| void | SetCursorPosition (int left, int top) |
| |
| void | ResetColor () |
| |
| override void | Write (char value) |
| |
| override void | Flush () |
| |
| void | Flush (int x, int y) |
| |
| void | SetChar (int x, int y, char ch) |
| |
| void | SetForeground< TColorValue > (int x, int y, in TColorValue color) |
| |
| void | SetBackground< TColorValue > (int x, int y, in TColorValue color) |
| |
| void | Clear () |
| |
| void | Clear< TColorValue > (char c, in TColorValue foreground, in TColorValue background) |
| |
| void | Flush (TextWriter output) |
| |
| void | Flush (TextWriter output, int offsetLeft, int offsetTop) |
| |
| void | SetPoint< TColorValue > (int x, int y, char ch, in TColorValue foreground, in TColorValue background) |
| |
Represents a colored text buffer. Not thread-safe.
Internally uses AnsiTermBuffer and Win32TermBuffer based on the current Terminal.ColorMode. On Windows, Win32TermBuffer is used in 16 color mode, otherwise AnsiTermBuffer is used.
◆ Terminal() [1/3]
| TermColor.Terminal.Terminal |
( |
| ) |
|
|
inline |
Create a new terminal buffer in 24-bit color mode with dimensions taken from (Console.WindowWidth, Console.WindowHeight).
◆ Terminal() [2/3]
| TermColor.Terminal.Terminal |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
Create a new terminal buffer with given dimensions in 24-bit color mode.
- Parameters
-
| width | The number of columns in the new buffer. |
| height | The number of rows in the new buffer. |
◆ Terminal() [3/3]
| TermColor.Terminal.Terminal |
( |
int |
width, |
|
|
int |
height, |
|
|
ColorMode |
colorMode |
|
) |
| |
|
inline |
Create a new terminal buffer with given dimensions and color mode.
- Parameters
-
| width | The number of columns in the new buffer. |
| height | The number of rows in the new buffer. |
| colorMode | The color mode of the new buffer. |
◆ Clear()
| void TermColor.Terminal.Clear |
( |
| ) |
|
|
inline |
◆ Clear< TColorValue >()
Fill the buffer with given (char, IColor, IColor) tuple.
- Template Parameters
-
| TColorValue | Type of the color. |
- Parameters
-
| c | The character to clear with. |
| foreground | Foreground color. |
| background | Background color. |
Implements TermColor.ITerminalBuffer.
- Type Constraints
-
| TColorValue | : | IColor | |
| TColorValue | : | Buffer.Clear | |
| TColorValue | : | c | |
| TColorValue | : | foreground | |
| TColorValue | : | background | |
◆ Flush() [1/4]
| override void TermColor.Terminal.Flush |
( |
| ) |
|
|
inline |
◆ Flush() [2/4]
| void TermColor.Terminal.Flush |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Forward the internal buffers out to Terminal.Out.
- Parameters
-
| x | Column position of the top left corner of the displayed output. |
| y | Row position of the top left corner of the displayed output. |
◆ Flush() [3/4]
| void TermColor.Terminal.Flush |
( |
TextWriter |
output | ) |
|
|
inline |
◆ Flush() [4/4]
| void TermColor.Terminal.Flush |
( |
TextWriter |
output, |
|
|
int |
offsetLeft, |
|
|
int |
offsetTop |
|
) |
| |
|
inline |
Forward the contents of the buffer to an output device at a specific offset.
- Parameters
-
Implements TermColor.ITerminalBuffer.
◆ ResetColor()
| void TermColor.Terminal.ResetColor |
( |
| ) |
|
|
inline |
Sets the foreground and background colors to their defaults.
◆ SetBackground< TColorValue >()
| void TermColor.Terminal.SetBackground< TColorValue > |
( |
int |
x, |
|
|
int |
y, |
|
|
in TColorValue |
color |
|
) |
| |
Write background color to one point in the buffer. Rows and columns are numbered from the top left starting at zero.
- Parameters
-
| x | Column number. |
| y | Row number. |
| background | Background color of the character. |
Implements TermColor.ITerminalBuffer.
- Type Constraints
-
| TColorValue | : | IColor | |
| TColorValue | : | Buffer.SetBackground | |
| TColorValue | : | x | |
| TColorValue | : | y | |
| TColorValue | : | color | |
◆ SetChar()
| void TermColor.Terminal.SetChar |
( |
int |
x, |
|
|
int |
y, |
|
|
char |
ch |
|
) |
| |
Write a character to one point in the buffer. Rows and columns are numbered from the top left starting at zero.
- Parameters
-
| x | Column number. |
| y | Row number. |
| ch | The character to write. |
Implements TermColor.ITerminalBuffer.
◆ SetCursorPosition()
| void TermColor.Terminal.SetCursorPosition |
( |
int |
left, |
|
|
int |
top |
|
) |
| |
|
inline |
Sets the position of the cursor.
- Parameters
-
| left | The column position of the cursor. Columns are numbered from left to right starting at 0. |
| top | The row position of the cursor. Rows are numbered from top to bottom starting at 0. |
◆ SetForeground< TColorValue >()
| void TermColor.Terminal.SetForeground< TColorValue > |
( |
int |
x, |
|
|
int |
y, |
|
|
in TColorValue |
color |
|
) |
| |
Write foreground color to one point in the buffer. Rows and columns are numbered from the top left starting at zero.
- Parameters
-
| x | Column number. |
| y | Row number. |
| foreground | Foreground color of the character. |
Implements TermColor.ITerminalBuffer.
- Type Constraints
-
| TColorValue | : | IColor | |
| TColorValue | : | Buffer.SetForeground | |
| TColorValue | : | x | |
| TColorValue | : | y | |
| TColorValue | : | color | |
◆ Write()
| override void TermColor.Terminal.Write |
( |
char |
value | ) |
|
|
inline |
Writes the specified Unicode character value to the buffer at the current cursor position and advances the cursor.
- Parameters
-
| value | The character to write. |
◆ BackgroundColor
| IColor? TermColor.Terminal.BackgroundColor |
|
getset |
Gets or sets the background color of the buffer.
◆ ColorMode
Gets or sets the color mode of the buffer.
◆ CursorLeft
| int? TermColor.Terminal.CursorLeft |
|
getset |
Gets or sets the column position of the cursor within the buffer. Columns are numbered from left to right starting at 0.
◆ CursorTop
| int? TermColor.Terminal.CursorTop |
|
getset |
Gets or sets the row position of the cursor within the buffer. Rows are numbered from top to bottom starting at 0.
◆ ForegroundColor
| IColor? TermColor.Terminal.ForegroundColor |
|
getset |
Gets or sets the foreground color of the buffer.
◆ Height
| int TermColor.Terminal.Height |
|
get |
Gets the height of the buffer.
◆ Out
| TextWriter TermColor.Terminal.Out = Console.Out |
|
getset |
Gets or sets the output target. Calling Flush() forwards contents of this Terminal to Out.
◆ Width
| int TermColor.Terminal.Width |
|
get |
Gets the width of the buffer.
The documentation for this class was generated from the following file: