Documentation ¶
Index ¶
- Constants
- func NewID() uint64
- type Node
- func (n *Node) CanResize() bool
- func (n *Node) Children() []*Node
- func (n *Node) GetNode(id uint64) *Node
- func (n *Node) HSplit(bottom bool) uint64
- func (n *Node) ID() uint64
- func (n *Node) IsLeaf() bool
- func (n *Node) PropScale() bool
- func (n *Node) Resize(w, h int)
- func (n *Node) ResizeSplit(size int) bool
- func (n *Node) SetPropScale(b bool)
- func (n *Node) SetResize(b bool)
- func (n *Node) String() string
- func (n *Node) Unsplit() bool
- func (n *Node) VSplit(right bool) uint64
- type SplitType
- type View
Constants ¶
const ( STVert = 0 STHoriz = 1 STUndef = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
A Node describes a split in the tree If a node is a leaf node then it corresponds to a buffer that is being displayed otherwise it has a number of children of the opposite type (vertical splits have horizontal children and vice versa)
func NewRoot ¶
NewRoot returns an empty Node with a size and location The type of the node will be determined by the first action on the node In other words, a lone split is neither horizontal nor vertical, it only becomes one or the other after a vsplit or hsplit is made
func (*Node) GetNode ¶
GetNode returns the node with the given id in the tree of children that this node has access to or nil if the node with that id cannot be found
func (*Node) HSplit ¶
HSplit creates a horizontal split and returns the id of the new split bottom specifies if the new split should be created on the top or bottom of the current split
func (*Node) ResizeSplit ¶
ResizeSplit resizes a certain split to a given size
func (*Node) SetPropScale ¶
SetPropScale sets the propScale flag
func (*Node) String ¶
String returns the string form of the node and all children (used for debugging)