pane

package
v0.0.0-...-af25313 Latest Latest
Warning

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

Go to latest
Published: May 1, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEW_LINE        = 0xA
	TERMINAL_BELL   = 0x7
	BACKSPACE       = 0x8
	CARRIAGE_RETURN = 0xD
)

Variables

View Source
var BYTE_HANDLERS = map[byte]ByteHandler{
	NEW_LINE:        (*Pane).NewLine,
	BACKSPACE:       (*Pane).Backspace,
	TERMINAL_BELL:   (*Pane).TerminalBell,
	CARRIAGE_RETURN: (*Pane).CarriageReturn,
}
View Source
var ESCAPE_HANDLERS = map[pansi.AnsiEscapeType]EscapeCodeHandler{
	pansi.CursorUp:       (*Pane).CursorUp,
	pansi.CursorDown:     (*Pane).CursorDown,
	pansi.CursorForward:  (*Pane).CursorForward,
	pansi.CursorBackward: (*Pane).CursorBackward,

	pansi.EraseLine:      (*Pane).EraseLine,
	pansi.EraseDisplay:   (*Pane).EraseDisplay,
	pansi.ReverseIndex:   (*Pane).ReverseIndex,
	pansi.SetGraphicMode: (*Pane).SetGraphicMode,
	pansi.CursorPosition: (*Pane).CursorPosition,
}

Functions

This section is empty.

Types

type ByteHandler

type ByteHandler func(p *Pane)

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

func NewCursor

func NewCursor(width, height int) *Cursor

func (*Cursor) Down

func (c *Cursor) Down(count int)

func (*Cursor) Get

func (c *Cursor) Get() (int, int)

func (*Cursor) Left

func (c *Cursor) Left(count int)

func (*Cursor) Right

func (c *Cursor) Right(count int)

func (*Cursor) Set

func (c *Cursor) Set(x, y int)

func (*Cursor) SetX

func (c *Cursor) SetX(x int)

func (*Cursor) SetY

func (c *Cursor) SetY(y int)

func (*Cursor) Up

func (c *Cursor) Up(count int)

func (*Cursor) X

func (c *Cursor) X() int

func (*Cursor) Y

func (c *Cursor) Y() int

type EscapeCodeHandler

type EscapeCodeHandler func(p *Pane, c *pansi.AnsiEscapeCode)

type Pane

type Pane struct {

	//TODO Remove this
	ShouldRedraw chan struct{}
	// contains filtered or unexported fields
}

func CreatePane

func CreatePane(prog string, args []string, width, height int) *Pane

func (*Pane) Args

func (p *Pane) Args() []string

func (*Pane) Backspace

func (p *Pane) Backspace()

func (*Pane) CarriageReturn

func (p *Pane) CarriageReturn()

func (*Pane) CursorBackward

func (p *Pane) CursorBackward(c *pansi.AnsiEscapeCode)

func (*Pane) CursorDown

func (p *Pane) CursorDown(c *pansi.AnsiEscapeCode)

func (*Pane) CursorForward

func (p *Pane) CursorForward(c *pansi.AnsiEscapeCode)

func (*Pane) CursorPosition

func (p *Pane) CursorPosition(c *pansi.AnsiEscapeCode)

func (*Pane) CursorUp

func (p *Pane) CursorUp(c *pansi.AnsiEscapeCode)

func (*Pane) Draw

func (p *Pane) Draw(xOffset, yOffset int)

func (*Pane) EraseDisplay

func (p *Pane) EraseDisplay(c *pansi.AnsiEscapeCode)

func (*Pane) EraseLine

func (p *Pane) EraseLine(c *pansi.AnsiEscapeCode)

func (*Pane) Kill

func (p *Pane) Kill() error

func (*Pane) NewLine

func (p *Pane) NewLine()

func (*Pane) Prog

func (p *Pane) Prog() string

func (*Pane) ReverseIndex

func (p *Pane) ReverseIndex(c *pansi.AnsiEscapeCode)

func (*Pane) Send

func (p *Pane) Send(input []byte) (int, error)

func (*Pane) SetGraphicMode

func (p *Pane) SetGraphicMode(c *pansi.AnsiEscapeCode)

func (*Pane) Start

func (p *Pane) Start() error

func (*Pane) Stop

func (p *Pane) Stop() error

func (*Pane) TerminalBell

func (p *Pane) TerminalBell()

This function intentionally left blank

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

func NewRingBuffer

func NewRingBuffer(initial [][]termbox.Cell) RingBuffer

func (*RingBuffer) Append

func (r *RingBuffer) Append(data []termbox.Cell)

func (*RingBuffer) Clear

func (r *RingBuffer) Clear()

func (*RingBuffer) Get

func (r *RingBuffer) Get(i int) []termbox.Cell

func (*RingBuffer) Length

func (r *RingBuffer) Length() int

func (*RingBuffer) Range

func (r *RingBuffer) Range(begin, length int) [][]termbox.Cell

func (*RingBuffer) RollBack

func (r *RingBuffer) RollBack(count int)

TODO Test me

func (*RingBuffer) Set

func (r *RingBuffer) Set(i int, data []termbox.Cell)

func (*RingBuffer) Tail

func (r *RingBuffer) Tail(count int) [][]termbox.Cell

type Screen

type Screen struct {
	RingBuffer
	// contains filtered or unexported fields
}

TODO Maybe Embedding is a better idea?

func NewScreen

func NewScreen(width, height int) Screen

func (*Screen) Cell

func (s *Screen) Cell(x, y int) *termbox.Cell

func (*Screen) Cells

func (s *Screen) Cells() [][]termbox.Cell

func (*Screen) NewLine

func (s *Screen) NewLine()

func (*Screen) Row

func (s *Screen) Row(index int) []termbox.Cell

Jump to

Keyboard shortcuts

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