screen

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 RenderContext

type RenderContext struct {
	*terminfo.Terminfo
	Colors termenv.Profile
}

RenderContext contains information about the rendering environment, such as the supported color mode and terminfo database.

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 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) *Terminal

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

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