screen

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMargins added in v0.1.10

func AddMargins(ctx context.Context, screen Screen) mux.Screen

func WithInteractive added in v0.1.5

func WithInteractive(layer *Layer)

func WithOpaque added in v0.1.5

func WithOpaque(layer *Layer)

Types

type Layer

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

type LayerOption added in v0.1.5

type LayerOption func(*Layer)

type Layers

type Layers struct {
	deadlock.RWMutex
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

Layers allows you to stack several Screens on top of one another. The topmost layer with isInteractive set to true receives all key presses.

func NewLayers

func NewLayers() *Layers

func (*Layers) NewLayer

func (l *Layers) NewLayer(ctx context.Context, screen Screen, pos Position, options ...LayerOption) *Layer

func (*Layers) NumLayers

func (l *Layers) NumLayers() int

func (*Layers) Resize

func (l *Layers) Resize(size Size) error

func (*Layers) Send added in v0.1.6

func (l *Layers) Send(msg mux.Msg)

func (*Layers) State

func (l *Layers) State() *tty.State

type Margins

type Margins struct {
	deadlock.RWMutex
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

Margins puts empty space around a Screen and centers it. In size mode, Margins attempts to keep the Screen at a fixed size (one or both dimensions fixed). In margin mode, the Screen is surrounded by fixed-size margins that do not change with the screen size.

func NewMargins

func NewMargins(ctx context.Context, screen Screen) *Margins

func (*Margins) Resize

func (l *Margins) Resize(size Size) error

func (*Margins) Send added in v0.1.6

func (l *Margins) Send(msg mux.Msg)

func (*Margins) SetSize

func (l *Margins) SetSize(size Size) error

func (*Margins) Size

func (l *Margins) Size() Size

func (*Margins) State

func (l *Margins) State() *tty.State

type Position added in v0.1.5

type Position int
const (
	PositionTop Position = iota
	PositionBottom
)

type RenderLayer

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

type Renderable

type Renderable interface {
	Render(Size) *tty.State
	mux.Resizable
}

type Screen

type Screen = mux.Screen

type Size

type Size = mux.Size

type Split added in v0.1.11

type Split struct {
	deadlock.RWMutex
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

Split renders two screens side by side (or one above the other) at a fixed proportion of its full width or height (respectively.)

func NewSplit added in v0.1.11

func NewSplit(
	ctx context.Context,
	screenA, screenB Screen,
	percent float64,
	isVertical bool,
) *Split

func (*Split) Resize added in v0.1.11

func (s *Split) Resize(size Size) error

func (*Split) Send added in v0.1.11

func (s *Split) Send(msg mux.Msg)

func (*Split) SetPercent added in v0.1.11

func (s *Split) SetPercent(percent float64) error

func (*Split) State added in v0.1.11

func (s *Split) State() *tty.State

type Stream

type Stream = mux.Stream

type Terminal

type Terminal struct {
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

func NewTerminal

func NewTerminal(
	ctx context.Context,
	stream Stream,
	size Size,
	options ...emu.TerminalOption,
) *Terminal

func (*Terminal) IsAltMode added in v0.1.11

func (t *Terminal) IsAltMode() bool

func (*Terminal) Resize

func (t *Terminal) Resize(size Size) error

func (*Terminal) Send added in v0.1.6

func (t *Terminal) Send(msg mux.Msg)

func (*Terminal) State

func (t *Terminal) State() *tty.State

func (*Terminal) Write

func (t *Terminal) Write(p []byte) (n int, err error)

type Trigger

type Trigger struct {
	deadlock.RWMutex
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

func NewTrigger

func NewTrigger(r Renderable) *Trigger

func (*Trigger) Resize

func (t *Trigger) Resize(size Size) error

func (*Trigger) Size

func (t *Trigger) Size() Size

func (*Trigger) State

func (t *Trigger) State() *tty.State

type Updater

type Updater = mux.Updater

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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