grid

package
v0.0.0-...-196a8a7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: ISC Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction int
const (
	Left Direction = iota
	Right
	Up
	Down
)

type FocusStrategy

type FocusStrategy int
const (
	Next FocusStrategy = iota
	Prev
)

type Grid

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

func New

func New(opts *Options) (*Grid, error)

func (*Grid) Center

func (g *Grid) Center() error

func (*Grid) Focus

func (g *Grid) Focus(strategy FocusStrategy) error

func (*Grid) Fullscreen

func (g *Grid) Fullscreen() error

func (*Grid) Grow

func (g *Grid) Grow(diff Size) error

func (*Grid) Kill

func (g *Grid) Kill() error

func (*Grid) Move

func (g *Grid) Move(diff Size) error

func (*Grid) Snap

func (g *Grid) Snap() error

func (*Grid) Spread

func (g *Grid) Spread(direction Direction) error

func (*Grid) Teleport

func (g *Grid) Teleport(r Rectangle) error

func (*Grid) Throw

func (g *Grid) Throw(direction Direction) error

func (*Grid) ViewInclude

func (g *Grid) ViewInclude(n int) error

func (*Grid) ViewSet

func (g *Grid) ViewSet(n int) error

func (*Grid) WatchWindowEvents

func (g *Grid) WatchWindowEvents() error

type Margins

type Margins struct {
	Top, Bottom, Left, Right wmutils.Pixels
}

type Options

type Options struct {
	Border                           wmutils.Pixels
	Margins                          Margins
	Pad                              wmutils.Size
	Size                             Size
	InitialView                      int
	FocusTimeout                     time.Duration
	FocussedColour, UnfocussedColour wmutils.Colour
}

type Position

type Position struct {
	X, Y int
}

func (Position) Diff

func (a Position) Diff(b Position) Size

func (Position) Offset

func (p Position) Offset(s Size) Position

type Rectangle

type Rectangle struct {
	TopLeft, BottomRight Position
}

func (Rectangle) Grow

func (r Rectangle) Grow(s Size) Rectangle

func (Rectangle) Offset

func (r Rectangle) Offset(s Size) Rectangle

func (Rectangle) Size

func (r Rectangle) Size() Size

func (Rectangle) Valid

func (r Rectangle) Valid() bool

type Size

type Size struct {
	W, H int
}

func (Size) Add

func (a Size) Add(b Size) Size

func (Size) Scale

func (a Size) Scale(k int) Size

Jump to

Keyboard shortcuts

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