render

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToANSI

func ToANSI(c ecma48.Color, bg bool) string

ToANSI emits an ANSI SGR escape code for a given color

Types

type Renderer

type Renderer struct {
	Pause  chan bool
	Resume chan bool

	DemoText string

	OutFd int
	// contains filtered or unexported fields
}

Renderer is our simplified implemention of ncurses

func NewRenderer

func NewRenderer(out int) *Renderer

NewRenderer returns an initialized Renderer

func (*Renderer) DemoKeypress

func (r *Renderer) DemoKeypress(str string)

DemoKeypress is used for demos of 3mux

func (*Renderer) HandleCh

func (r *Renderer) HandleCh(ch ecma48.PositionedChar)

HandleCh places a PositionedChar in the pending screen buffer

func (*Renderer) HardRefresh

func (r *Renderer) HardRefresh()

HardRefresh force clears all cached chars. Used for handling terminal resize

func (*Renderer) ListenToQueue

func (r *Renderer) ListenToQueue()

ListenToQueue is a blocking function that processes data sent to the RenderQueue

func (*Renderer) Resize

func (r *Renderer) Resize(w, h int)

Resize changes the size of the framebuffers to match the host terminal size

func (*Renderer) SetCursor

func (r *Renderer) SetCursor(x, y int)

SetCursor sets the position of the physical cursor

func (*Renderer) UpdateOut

func (r *Renderer) UpdateOut(out int)

func (*Renderer) Write

func (r *Renderer) Write(data []byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL