buffer

package
v0.0.0-...-aaac02b Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer interface {
	Clear()
	Set(int, int, rune, tcell.Style)
	Get(int, int) (rune, tcell.Style)
	Size() (int, int)
	// TODO(ym): Hmm probably shouldn't be here
	Invalidate()
	Invalid() bool
	DrawString(int, int, string, tcell.Style)
}

New(Buffer, int, int, int, int, string) Buffer TODO(ym):

type Rect

type Rect struct {
	Buffer
	// contains filtered or unexported fields
}

func New

func New(buf Buffer, x, y, length, width int, name string) *Rect

func (*Rect) Get

func (rect *Rect) Get(x, y int) (rune, tcell.Style)

func (*Rect) Invalid

func (rect *Rect) Invalid() bool

func (*Rect) Invalidate

func (rect *Rect) Invalidate()

func (*Rect) Set

func (rect *Rect) Set(x, y int, char rune, style tcell.Style)

func (*Rect) Size

func (rect *Rect) Size() (int, int)

type Screen

type Screen struct {
	tcell.Screen
}

TODO(ym): Check if embedding will break stuff (aka encapsulation) // write a better comment lmao

func (*Screen) Clear

func (screen *Screen) Clear()

func (*Screen) DrawString

func (screen *Screen) DrawString(x, y int, item string, style tcell.Style)

TODO(ym): Add a wrap boolean TODO(ym): Remove the reciever

func (*Screen) Get

func (screen *Screen) Get(x, y int) (rune, tcell.Style)

func (*Screen) Invalid

func (screen *Screen) Invalid() bool

func (*Screen) Invalidate

func (screen *Screen) Invalidate()

TODO(ym): Maybe these should be no-op?

func (*Screen) Set

func (screen *Screen) Set(x, y int, char rune, style tcell.Style)

type View

type View interface {
	Handle(Buffer, tcell.Event)
	UpdateAndRedraw(*Buffer)
}

View does stuff Should probably be a Change to stuff like KeyHandler, MouseHandler, and stuff like that.

Jump to

Keyboard shortcuts

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