class TermBuf::BufferSurface

Overview

A drawing surface that writes into a buffer as commands arrive.

The core layer's answer to Terminal: everything built on Drawing works against it, with no device, no fibres, and nothing to tear down afterwards.

Included Modules

Defined in:

termbuf/terminal/command.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module TermBuf::Drawing

clear(style : Style = Style::DEFAULT) : Nil clear, fill(rect : Rect, char : Char = ' ', style : Style = Style::DEFAULT) : Nil fill, issue(command : Command) : Nil issue, passthrough(bytes : Bytes) : Nil
passthrough(text : String) : Nil
passthrough
, scroll(rect : Rect, lines : Int32, style : Style = Style::DEFAULT) : Nil scroll, scroll_region(region : Region, lines : Int32, style : Style = Style::DEFAULT) : Nil scroll_region, write(x : Int32, y : Int32, text : String, style : Style = Style::DEFAULT) : Nil write, write_char(x : Int32, y : Int32, char : Char, style : Style = Style::DEFAULT) : Nil write_char

Constructor Detail

def self.new(buffer : Buffer) #

[View source]

Class Method Detail

def self.apply(command : Command, buffer : Buffer) : Bool #

Applies the commands that need nothing but a buffer, and reports whether command was one of them.

A class method because the owning fibre needs the same lines and has its own reasons to keep hold of the ones this leaves alone.


[View source]

Instance Method Detail

def buffer : Buffer #

What is being drawn on.


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

Applies command, ignoring the ones that need a terminal to mean anything.


[View source]