micro: github.com/zyedidia/micro/internal/views Index | Files

package views

import "github.com/zyedidia/micro/internal/views"


Package Files



const (
    STVert  = 0
    STHoriz = 1
    STUndef = 2

func NewID Uses

func NewID() uint64

NewID returns a new unique id

type Node Uses

type Node struct {

    Kind SplitType
    // contains filtered or unexported fields

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 NewNode Uses

func NewNode(Kind SplitType, x, y, w, h int, parent *Node, id uint64) *Node

NewNode returns a new node with the given specifications

func NewRoot Uses

func NewRoot(x, y, w, h int) *Node

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) CanResize Uses

func (n *Node) CanResize() bool

CanResize returns if this node can be resized

func (*Node) Children Uses

func (n *Node) Children() []*Node

Children returns this node's children

func (*Node) GetNode Uses

func (n *Node) GetNode(id uint64) *Node

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 Uses

func (n *Node) HSplit(bottom bool) uint64

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) ID Uses

func (n *Node) ID() uint64

ID returns this node's id or 0 if it is not viewable

func (*Node) IsLeaf Uses

func (n *Node) IsLeaf() bool

IsLeaf returns if this node is a leaf node

func (*Node) PropScale Uses

func (n *Node) PropScale() bool

PropScale returns if this node is proportionally scaled

func (*Node) Resize Uses

func (n *Node) Resize(w, h int)

Resize sets this node's size and resizes all children accordlingly

func (*Node) ResizeSplit Uses

func (n *Node) ResizeSplit(size int) bool

ResizeSplit resizes a certain split to a given size

func (*Node) SetPropScale Uses

func (n *Node) SetPropScale(b bool)

SetPropScale sets the propScale flag

func (*Node) SetResize Uses

func (n *Node) SetResize(b bool)

SetResize sets the resize flag

func (*Node) String Uses

func (n *Node) String() string

String returns the string form of the node and all children (used for debugging)

func (*Node) Unsplit Uses

func (n *Node) Unsplit() bool

Unsplit deletes this split and resizes everything else accordingly

func (*Node) VSplit Uses

func (n *Node) VSplit(right bool) uint64

VSplit creates a vertical split and returns the id of the new split right specifies if the new split should be created on the right or left of the current split

type SplitType Uses

type SplitType uint8

type View Uses

type View struct {
    X, Y int
    W, H int

A View is a size and location of a split

Package views imports 2 packages (graph). Updated 2020-02-14. Refresh now. Tools for package owners.