module TermBuf::Drawing

Overview

The drawing surface, shared by the terminal and by a batch being built.

The two differ only in what they do with a command: one sends it, the other collects it. Everything else about the API is the same, so it lives here rather than being written twice and drifting apart.

Direct including types

Defined in:

termbuf/terminal/command.cr

Instance Method Summary

Instance Method Detail

def clear(style : Style = Style::DEFAULT) : Nil #

Blanks the whole screen.


[View source]
def fill(rect : Rect, char : Char = ' ', style : Style = Style::DEFAULT) : Nil #

Sets every cell of rect to char.


[View source]
abstract def issue(command : Command) : Nil #

Sends command on, or collects it. What a Terminal and a Batcher disagree about, and all they disagree about.


[View source]
def passthrough(bytes : Bytes) : Nil #

Sends bytes to the terminal untouched, after the current frame.


[View source]
def passthrough(text : String) : Nil #

Sends bytes to the terminal untouched, after the current frame.


[View source]
def scroll(rect : Rect, lines : Int32, style : Style = Style::DEFAULT) : Nil #

Scrolls rect by lines rows, positive moving content up.


[View source]
def scroll_region(region : Region, lines : Int32, style : Style = Style::DEFAULT) : Nil #

Scrolls a region, keeping what leaves the top if it has scrollback.


[View source]
def write(x : Int32, y : Int32, text : String, style : Style = Style::DEFAULT) : Nil #

Writes text starting at (x, y), one grapheme cluster per cell, stopping at the right edge of the row.


[View source]
def write_char(x : Int32, y : Int32, char : Char, style : Style = Style::DEFAULT) : Nil #

Writes one character at (x, y).


[View source]