multiplex

package
v0.0.0-...-80c3d28 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Motion byte = 1
	Down   byte = 2
	Up     byte = 3

	Shift byte = 0x1
	Alt   byte = 0x2
	Ctrl  byte = 0x4
)
View Source
const (
	NUL = 0x0
	DEL = 0x7f
	CAN = 0x18
	SUB = 0x1a
	ESC = 0x1b
	BEL = 0x7
	C0  = 0x20
)
View Source
const DefaultCommandBufferSize = 64 * 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBuffer

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

func (*CommandBuffer) Flush

func (cb *CommandBuffer) Flush() error

func (*CommandBuffer) SetCell

func (cb *CommandBuffer) SetCell(p state.Pos, val rune, pen *screen.ScreenPen) error

type Config

type Config struct {
	Shell []string
	Env   []string
}

type ControlEvent

type ControlEvent byte

type Event

type Event interface{}

type InputHandler

type InputHandler interface {
	HandleInput(ev Event) error
}

type InputReader

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

func NewInputReader

func NewInputReader(r io.Reader, h InputHandler) (*InputReader, error)

func (*InputReader) Drive

func (i *InputReader) Drive() error

type Layout

type Layout struct {
	Operations Operations

	Rows, Columns int
	// contains filtered or unexported fields
}

func NewLayout

func NewLayout(m *Multiplexer, t *Term, rows, cols int) (*Layout, error)

func (*Layout) Draw

func (l *Layout) Draw(w io.Writer) error

func (*Layout) Start

func (l *Layout) Start() error

func (*Layout) Write

func (l *Layout) Write(b []byte) (int, error)

type LayoutColumn

type LayoutColumn struct {
	LayoutElement
	Data []*LayoutRow
}

type LayoutElement

type LayoutElement struct {
	Position state.Rect
}

type LayoutRow

type LayoutRow struct {
	LayoutElement

	// This is an or. A row has a term OR a set of columns
	Data []*LayoutColumn
	Term *Term
}

type MouseEvent

type MouseEvent struct {
	Op       byte
	Button   byte
	Modifier byte
	Row, Col int
}

type Multiplexer

type Multiplexer struct {
	Config Config
	// contains filtered or unexported fields
}

func (*Multiplexer) Cleanup

func (m *Multiplexer) Cleanup()

func (*Multiplexer) DrawHorizLine

func (m *Multiplexer) DrawHorizLine(p state.Pos, dist int) error

func (*Multiplexer) DrawRightTee

func (m *Multiplexer) DrawRightTee(p state.Pos) error

func (*Multiplexer) DrawVerticalLine

func (m *Multiplexer) DrawVerticalLine(p state.Pos, dist int) error

func (*Multiplexer) HandleInput

func (m *Multiplexer) HandleInput(ev Event) error

func (*Multiplexer) Init

func (m *Multiplexer) Init() error

func (*Multiplexer) InputData

func (m *Multiplexer) InputData(r io.Reader) error

func (*Multiplexer) NewCommandBuffer

func (m *Multiplexer) NewCommandBuffer() *CommandBuffer

func (*Multiplexer) Redraw

func (m *Multiplexer) Redraw() error

func (*Multiplexer) Run

func (m *Multiplexer) Run(cmd *exec.Cmd) error

func (*Multiplexer) RunShell

func (m *Multiplexer) RunShell() error

type Operations

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

func (*Operations) Split

func (o *Operations) Split() error

func (*Operations) SplitHoriz

func (o *Operations) SplitHoriz() error

type Term

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

func NewTerm

func NewTerm(m *Multiplexer, cmd *exec.Cmd) (*Term, error)

func (*Term) DamageDone

func (w *Term) DamageDone(r state.Rect, cr screen.CellReader) error

func (*Term) Draw

func (w *Term) Draw()

Draw is called to inform the widget to draw itself. A containing Term will generally call this during the application draw loop.

func (*Term) MoveCursor

func (w *Term) MoveCursor(p state.Pos) error

func (*Term) Output

func (w *Term) Output(data []byte) error

func (*Term) Resize

func (w *Term) Resize(rows, cols int)

func (*Term) ResizeMoved

func (w *Term) ResizeMoved(rows, cols, rowsOffset, colsOffset int)

func (*Term) SetTermProp

func (w *Term) SetTermProp(attr state.TermAttr, val interface{}) error

func (*Term) Size

func (w *Term) Size() (int, int)

Size returns the size of the widget (content size) as width, height in columns. Layout managers should attempt to ensure that at least this much space is made available to the View for this Term. Extra space may be allocated on as an needed basis.

func (*Term) Start

func (w *Term) Start(rows, cols, roffset, coffset int) (io.Writer, error)

func (*Term) StringEvent

func (w *Term) StringEvent(kind string, data []byte) error

func (*Term) Write

func (w *Term) Write(b []byte) (int, error)

type TextEvent

type TextEvent []byte

Jump to

Keyboard shortcuts

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