engine

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LayoutEngine

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

LayoutEngine is a Screen that renders a declarative layout that consists of other Screens. When the layout changes, LayoutEngine detects which Screens in the layout can be reused and which must be created from scratch.

func New

func New(
	ctx context.Context,
	tree *tree.Tree,
	muxServer *server.Server,
	settings ...Setting,
) *LayoutEngine

func (*LayoutEngine) Get

func (l *LayoutEngine) Get() L.Layout

Get gets the Layout this LayoutEngine is rendering.

func (*LayoutEngine) Kill

func (l *LayoutEngine) Kill()

func (*LayoutEngine) Resize

func (l *LayoutEngine) Resize(size geom.Size) error

func (*LayoutEngine) Send

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

func (*LayoutEngine) Set

func (l *LayoutEngine) Set(layout L.Layout) error

Set changes the Layout rendered by this LayoutEngine by reusing as many existing Screens as it can.

func (*LayoutEngine) State

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

type Setting

type Setting func(*LayoutEngine)

func WithContext added in v0.8.0

func WithContext(context interface{}) Setting

func WithLogger added in v0.8.0

func WithLogger(logger zerolog.Logger) Setting

func WithParams

func WithParams(params *params.Parameters) Setting

Jump to

Keyboard shortcuts

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