screen

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

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

type Layers

type Layers struct {
	deadlock.RWMutex
	// 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, isInteractive bool, isOpaque bool) *Layer

func (*Layers) NumLayers

func (l *Layers) NumLayers() int

func (*Layers) Resize

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

func (*Layers) State

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

func (*Layers) Updates

func (l *Layers) Updates() *Updater

func (*Layers) Write

func (l *Layers) Write(data []byte) (n int, err error)

type Margins

type Margins struct {
	deadlock.RWMutex
	// 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) 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

func (*Margins) Updates

func (l *Margins) Updates() *Updater

func (*Margins) Write

func (l *Margins) Write(data []byte) (n int, err error)

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 Tea

type Tea struct {
	*Terminal
	// contains filtered or unexported fields
}

func NewTea

func NewTea(
	ctx context.Context,
	model tea.Model,
	info RenderContext,
	size Size,
) *Tea

type Terminal

type Terminal struct {
	// 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) State

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

func (*Terminal) Updates

func (t *Terminal) Updates() *Updater

func (*Terminal) Write

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

type Trigger

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

func NewTrigger

func NewTrigger(r Renderable) *Trigger

func (*Trigger) Rerender

func (t *Trigger) Rerender()

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

func (*Trigger) Updates

func (t *Trigger) Updates() *Updater

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