wm

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncNames = map[string]func(*Universe){
	"new-pane":  func(u *Universe) { u.AddPane() },
	"kill-pane": func(u *Universe) { u.KillPane() },

	"split-pane-horiz": func(u *Universe) { u.AddPaneTmux(false) },
	"split-pane-vert":  func(u *Universe) { u.AddPaneTmux(true) },

	"show-help":     func(u *Universe) {},
	"hide-help-bar": func(u *Universe) { u.HideHelpBar() },

	"toggle-fullscreen": func(u *Universe) { u.ToggleFullscreen() },
	"toggle-search":     func(u *Universe) { u.ToggleSearch() },

	"resize-up":    func(u *Universe) { u.ResizePane(Up) },
	"resize-down":  func(u *Universe) { u.ResizePane(Down) },
	"resize-left":  func(u *Universe) { u.ResizePane(Left) },
	"resize-right": func(u *Universe) { u.ResizePane(Right) },

	"move-pane-up":    func(u *Universe) { u.MoveWindow(Up) },
	"move-pane-down":  func(u *Universe) { u.MoveWindow(Down) },
	"move-pane-left":  func(u *Universe) { u.MoveWindow(Left) },
	"move-pane-right": func(u *Universe) { u.MoveWindow(Right) },

	"move-selection-up":    func(u *Universe) { u.MoveSelection(Up) },
	"move-selection-down":  func(u *Universe) { u.MoveSelection(Down) },
	"move-selection-left":  func(u *Universe) { u.MoveSelection(Left) },
	"move-selection-right": func(u *Universe) { u.MoveSelection(Right) },

	"cycle-selection-forward":  func(u *Universe) { u.CycleSelection(true) },
	"cycle-selection-backward": func(u *Universe) { u.CycleSelection(false) },
}

Functions

This section is empty.

Types

type Container

type Container interface {
	Node
	// contains filtered or unexported methods
}

type Direction

type Direction int

Direction is the type of Up, Down, Left, and Right

const (
	Up Direction
	Down
	Left
	Right
)

directions

type NewPaneFunc

type NewPaneFunc func(ecma48.Renderer) Node

type Node

type Node interface {
	SetRenderRect(fullscreen bool, x, y, w, h int)
	GetRenderRect() Rect
	Serialize() string
	SetPaused(bool)
	SetDeathHandler(func(error))
	Kill()
	IsDead() bool
	UpdateSelection(selected bool)
	ToggleSearch()
	ScrollUp()
	ScrollDown()
	HandleStdin(ecma48.Output)
}

type Rect

type Rect struct {
	X, Y, W, H int
}

Rect is a rectangle with an origin x, origin y, width, and height

type SizedNode

type SizedNode struct {
	// contains filtered or unexported fields
}

A SizedNode represents a single pane of a split, having a size (relative to a total 1.0) and renderable contents

type Universe

type Universe struct {
	// contains filtered or unexported fields
}

A Universe contains workspaces

func NewUniverse

func NewUniverse(renderer ecma48.Renderer, helpBar bool, enableStatusBar bool, onDeath func(error), renderRect Rect, newPane NewPaneFunc) *Universe

func (*Universe) AddPane

func (u *Universe) AddPane() error

func (*Universe) AddPaneTmux

func (u *Universe) AddPaneTmux(vert bool) error

func (*Universe) CycleSelection

func (u *Universe) CycleSelection(forwards bool)

func (*Universe) DragBorder

func (u *Universe) DragBorder(x1, y1, x2, y2 int)

func (*Universe) HandleStdin

func (u *Universe) HandleStdin(in ecma48.Output)

func (*Universe) HideHelpBar

func (u *Universe) HideHelpBar()

func (*Universe) IsDead

func (u *Universe) IsDead() bool

func (*Universe) Kill

func (u *Universe) Kill()

func (*Universe) KillPane

func (u *Universe) KillPane()

func (*Universe) MoveSelection

func (u *Universe) MoveSelection(d Direction)

func (*Universe) MoveWindow

func (u *Universe) MoveWindow(dir Direction) error

func (*Universe) ResizePane

func (u *Universe) ResizePane(d Direction)

func (*Universe) ScrollDown

func (u *Universe) ScrollDown()

func (*Universe) ScrollUp

func (u *Universe) ScrollUp()

func (*Universe) SelectAtCoords

func (u *Universe) SelectAtCoords(x, y int)

func (*Universe) Serialize

func (u *Universe) Serialize() string

func (*Universe) SetRenderRect

func (u *Universe) SetRenderRect(x, y, w, h int)

setRenderRect updates the Split's renderRect cache after which it calls refreshRenderRect this for when a split is reshaped

func (*Universe) ToggleFullscreen

func (u *Universe) ToggleFullscreen()

func (*Universe) ToggleSearch

func (u *Universe) ToggleSearch()

Jump to

Keyboard shortcuts

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