tree

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindScope

type BindScope = trie.Trie[Binding]

type Binding

type Binding struct {
	Description string
	Callback    *janet.Function
}

type Group

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

func (Group) Binds

func (m Group) Binds() *BindScope

func (*Group) Children

func (g *Group) Children() []Node

func (Group) Id

func (m Group) Id() int32

func (Group) Name

func (m Group) Name() string

func (*Group) NewCmd

func (g *Group) NewCmd(ctx context.Context, options stream.CmdOptions, size geom.Vec2) (*Pane, error)

func (*Group) NewGroup

func (g *Group) NewGroup() *Group

func (*Group) NewPane

func (g *Group) NewPane(
	ctx context.Context,
	stream mux.Stream,
	size geom.Vec2,
) *Pane

func (Group) SetName

func (m Group) SetName(name string)

type Node

type Node interface {
	Id() NodeID
	Name() string
	SetName(string)
	Binds() *BindScope
}

type NodeID

type NodeID = int32

type Pane

type Pane struct {
	util.Lifetime
	// contains filtered or unexported fields
}

func (*Pane) App

func (p *Pane) App() stream.Stream

func (Pane) Binds

func (m Pane) Binds() *BindScope

func (Pane) Id

func (m Pane) Id() int32

func (Pane) Name

func (m Pane) Name() string

func (*Pane) Recorder

func (p *Pane) Recorder() *sessions.Recorder

func (*Pane) Resize

func (p *Pane) Resize(size geom.Vec2)

func (*Pane) Screen

func (p *Pane) Screen() mux.Screen

func (Pane) SetName

func (m Pane) SetName(name string)

func (*Pane) Write

func (p *Pane) Write(data []byte) (n int, err error)

type Tree

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

func NewTree

func NewTree() *Tree

func (*Tree) DataDir added in v0.1.1

func (t *Tree) DataDir() string

func (*Tree) GroupById

func (t *Tree) GroupById(id NodeID) (*Group, bool)

func (*Tree) Leaves

func (t *Tree) Leaves() []Node

func (*Tree) NodeById

func (t *Tree) NodeById(id NodeID) (Node, bool)

func (*Tree) PaneById

func (t *Tree) PaneById(id NodeID) (*Pane, bool)

func (*Tree) PathTo

func (t *Tree) PathTo(node Node) []Node

Get the path from the root node to the given node.

func (*Tree) RemoveNode added in v0.1.1

func (t *Tree) RemoveNode(id NodeID) error

func (*Tree) Root

func (t *Tree) Root() *Group

func (*Tree) SetDataDir added in v0.1.1

func (t *Tree) SetDataDir(dir string)

Jump to

Keyboard shortcuts

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