Package layout

import "github.com/BurntSushi/wingo/layout"
Overview
Index

Overview ▾

package layout implements floating and tiling placement policies for Wingo.

Index ▾

Constants
type AutoTiler
type Client
type Floater
type Floating
    func NewFloating() *Floating
    func (f *Floating) Add(c Client)
    func (f *Floating) Destroy()
    func (f *Floating) Exists(c Client) bool
    func (f *Floating) InitialPlacement(c Client)
    func (f *Floating) MROpt(c Client, flags, x, y, width, height int)
    func (f *Floating) Move(c Client, x, y int)
    func (f *Floating) MoveResize(c Client, x, y, width, height int)
    func (f *Floating) Name() string
    func (f *Floating) Place()
    func (f *Floating) Remove(c Client)
    func (f *Floating) Reposition()
    func (f *Floating) Resize(c Client, width, height int)
    func (f *Floating) Save()
    func (f *Floating) SetGeom(geom xrect.Rect)
    func (f *Floating) Unplace()
type Horizontal
    func NewHorizontal() *Horizontal
    func (lay Horizontal) Add(c Client)
    func (lay Horizontal) Destroy()
    func (lay Horizontal) Exists(c Client) bool
    func (lay Horizontal) FocusMaster()
    func (lay Horizontal) MROpt(c Client, flags, x, y, width, height int)
    func (lay Horizontal) MakeMaster()
    func (lay *Horizontal) MastersFewer()
    func (lay *Horizontal) MastersMore()
    func (lay Horizontal) Move(c Client, x, y int)
    func (lay Horizontal) MoveResize(c Client, x, y, width, height int)
    func (v *Horizontal) Name() string
    func (lay Horizontal) Next()
    func (lay Horizontal) Place()
    func (lay Horizontal) Prev()
    func (lay Horizontal) Remove(c Client)
    func (lay Horizontal) Resize(c Client, width, height int)
    func (lay Horizontal) ResizeMaster(amount float64)
    func (lay Horizontal) ResizeWindow(amount float64)
    func (lay *Horizontal) SetGeom(geom xrect.Rect)
    func (lay Horizontal) SwitchNext()
    func (lay Horizontal) SwitchPrev()
    func (lay Horizontal) Unplace()
type Layout
type Maximized
    func NewMaximized() *Maximized
    func (m *Maximized) Add(c Client)
    func (m *Maximized) Destroy()
    func (m *Maximized) Exists(c Client) bool
    func (m *Maximized) FocusMaster()
    func (m *Maximized) MROpt(c Client, flags, x, y, width, height int)
    func (m *Maximized) MakeMaster()
    func (m *Maximized) MastersFewer()
    func (m *Maximized) MastersMore()
    func (m *Maximized) Move(c Client, x, y int)
    func (m *Maximized) MoveResize(c Client, x, y, width, height int)
    func (m *Maximized) Name() string
    func (m *Maximized) Next()
    func (m *Maximized) Place()
    func (m *Maximized) Prev()
    func (m *Maximized) Remove(c Client)
    func (m *Maximized) Resize(c Client, width, height int)
    func (m *Maximized) ResizeMaster(amount float64)
    func (m *Maximized) ResizeWindow(amount float64)
    func (m *Maximized) SetGeom(geom xrect.Rect)
    func (m *Maximized) SwitchNext()
    func (m *Maximized) SwitchPrev()
    func (m *Maximized) Unplace()
type Vertical
    func NewVertical() *Vertical
    func (lay Vertical) Add(c Client)
    func (lay Vertical) Destroy()
    func (lay Vertical) Exists(c Client) bool
    func (lay Vertical) FocusMaster()
    func (lay Vertical) MROpt(c Client, flags, x, y, width, height int)
    func (lay Vertical) MakeMaster()
    func (lay *Vertical) MastersFewer()
    func (lay *Vertical) MastersMore()
    func (lay Vertical) Move(c Client, x, y int)
    func (lay Vertical) MoveResize(c Client, x, y, width, height int)
    func (v *Vertical) Name() string
    func (lay Vertical) Next()
    func (lay Vertical) Place()
    func (lay Vertical) Prev()
    func (lay Vertical) Remove(c Client)
    func (lay Vertical) Resize(c Client, width, height int)
    func (lay Vertical) ResizeMaster(amount float64)
    func (lay Vertical) ResizeWindow(amount float64)
    func (lay *Vertical) SetGeom(geom xrect.Rect)
    func (lay Vertical) SwitchNext()
    func (lay Vertical) SwitchPrev()
    func (lay Vertical) Unplace()

Package files

auto_storage.go client.go doc.go floating.go layout.go maximized.go tree.go verthorz.go

Constants

const (
    AutoTileVertical = iota
)
const (
    FloatFloating = iota
)

type AutoTiler

type AutoTiler interface {
    Layout
    ResizeMaster(amount float64)
    ResizeWindow(amount float64)
    Next()
    Prev()
    SwitchNext()
    SwitchPrev()
    FocusMaster()
    MakeMaster()
    MastersMore()
    MastersFewer()
}

type Client

type Client interface {
    Id() xproto.Window
    String() string
    Layout() Layout
    Geom() xrect.Rect
    DragGeom() xrect.Rect
    ShouldForceFloating() bool
    Focus()
    Raise()
    IsActive() bool

    MROpt(validate bool, flags, x, y, width, height int)
    MoveResize(x, y, width, height int)
    MoveResizeValid(x, y, width, height int)
    Move(x, y int)
    Resize(validate bool, width, height int)

    FrameTile()

    HasState(name string) bool
    SaveState(name string)
    LoadState(name string)
    DeleteState(name string)
}

Client is the method set required for a particular client to be used by any layout.

Note that since layout clients come from workspace clients, this method set *must* be a subset of workspace.Client. (That is, if a method is added here, it must also be added to workspace.Client if it hasn't been already.)

type Floater

type Floater interface {
    Layout
    InitialPlacement(c Client)
    Save()
    Reposition()
}

type Floating

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

func NewFloating

func NewFloating() *Floating

func (*Floating) Add

func (f *Floating) Add(c Client)

func (*Floating) Destroy

func (f *Floating) Destroy()

func (*Floating) Exists

func (f *Floating) Exists(c Client) bool

func (*Floating) InitialPlacement

func (f *Floating) InitialPlacement(c Client)

func (*Floating) MROpt

func (f *Floating) MROpt(c Client, flags, x, y, width, height int)

func (*Floating) Move

func (f *Floating) Move(c Client, x, y int)

func (*Floating) MoveResize

func (f *Floating) MoveResize(c Client, x, y, width, height int)

func (*Floating) Name

func (f *Floating) Name() string

func (*Floating) Place

func (f *Floating) Place()

func (*Floating) Remove

func (f *Floating) Remove(c Client)

func (*Floating) Reposition

func (f *Floating) Reposition()

Reposition is called when a workspace switches from a tiling layout to a floating layout. It should reload the "last-floating" client state.

func (*Floating) Resize

func (f *Floating) Resize(c Client, width, height int)

func (*Floating) Save

func (f *Floating) Save()

Save is called when a workspace switches from a floating layout to a tiling layout. It should save the "last-floating" state for all floating clients.

func (*Floating) SetGeom

func (f *Floating) SetGeom(geom xrect.Rect)

func (*Floating) Unplace

func (f *Floating) Unplace()

type Horizontal

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

func NewHorizontal

func NewHorizontal() *Horizontal

func (Horizontal) Add

func (lay Horizontal) Add(c Client)

func (Horizontal) Destroy

func (lay Horizontal) Destroy()

func (Horizontal) Exists

func (lay Horizontal) Exists(c Client) bool

func (Horizontal) FocusMaster

func (lay Horizontal) FocusMaster()

func (Horizontal) MROpt

func (lay Horizontal) MROpt(c Client, flags, x, y, width, height int)

func (Horizontal) MakeMaster

func (lay Horizontal) MakeMaster()

func (*Horizontal) MastersFewer

func (lay *Horizontal) MastersFewer()

func (*Horizontal) MastersMore

func (lay *Horizontal) MastersMore()

func (Horizontal) Move

func (lay Horizontal) Move(c Client, x, y int)

func (Horizontal) MoveResize

func (lay Horizontal) MoveResize(c Client, x, y, width, height int)

func (*Horizontal) Name

func (v *Horizontal) Name() string

func (Horizontal) Next

func (lay Horizontal) Next()

func (Horizontal) Place

func (lay Horizontal) Place()

func (Horizontal) Prev

func (lay Horizontal) Prev()

func (Horizontal) Remove

func (lay Horizontal) Remove(c Client)

func (Horizontal) Resize

func (lay Horizontal) Resize(c Client, width, height int)

func (Horizontal) ResizeMaster

func (lay Horizontal) ResizeMaster(amount float64)

func (Horizontal) ResizeWindow

func (lay Horizontal) ResizeWindow(amount float64)

func (*Horizontal) SetGeom

func (lay *Horizontal) SetGeom(geom xrect.Rect)

func (Horizontal) SwitchNext

func (lay Horizontal) SwitchNext()

func (Horizontal) SwitchPrev

func (lay Horizontal) SwitchPrev()

func (Horizontal) Unplace

func (lay Horizontal) Unplace()

type Layout

type Layout interface {
    Name() string
    SetGeom(geom xrect.Rect)
    Place()
    Unplace()
    Add(c Client)
    Remove(c Client)
    Exists(c Client) bool
    Destroy()

    MROpt(c Client, flags, x, y, width, height int)
    MoveResize(c Client, x, y, width, height int)
    Move(c Client, x, y int)
    Resize(c Client, width, height int)
}

type Maximized

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

func NewMaximized

func NewMaximized() *Maximized

func (*Maximized) Add

func (m *Maximized) Add(c Client)

func (*Maximized) Destroy

func (m *Maximized) Destroy()

func (*Maximized) Exists

func (m *Maximized) Exists(c Client) bool

func (*Maximized) FocusMaster

func (m *Maximized) FocusMaster()

func (*Maximized) MROpt

func (m *Maximized) MROpt(c Client, flags, x, y, width, height int)

func (*Maximized) MakeMaster

func (m *Maximized) MakeMaster()

func (*Maximized) MastersFewer

func (m *Maximized) MastersFewer()

func (*Maximized) MastersMore

func (m *Maximized) MastersMore()

func (*Maximized) Move

func (m *Maximized) Move(c Client, x, y int)

func (*Maximized) MoveResize

func (m *Maximized) MoveResize(c Client, x, y, width, height int)

func (*Maximized) Name

func (m *Maximized) Name() string

func (*Maximized) Next

func (m *Maximized) Next()

func (*Maximized) Place

func (m *Maximized) Place()

func (*Maximized) Prev

func (m *Maximized) Prev()

func (*Maximized) Remove

func (m *Maximized) Remove(c Client)

func (*Maximized) Resize

func (m *Maximized) Resize(c Client, width, height int)

func (*Maximized) ResizeMaster

func (m *Maximized) ResizeMaster(amount float64)

func (*Maximized) ResizeWindow

func (m *Maximized) ResizeWindow(amount float64)

func (*Maximized) SetGeom

func (m *Maximized) SetGeom(geom xrect.Rect)

func (*Maximized) SwitchNext

func (m *Maximized) SwitchNext()

This is useful, but can be implemented later

func (*Maximized) SwitchPrev

func (m *Maximized) SwitchPrev()

This is useful, but can be implemented later

func (*Maximized) Unplace

func (m *Maximized) Unplace()

type Vertical

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

func NewVertical

func NewVertical() *Vertical

func (Vertical) Add

func (lay Vertical) Add(c Client)

func (Vertical) Destroy

func (lay Vertical) Destroy()

func (Vertical) Exists

func (lay Vertical) Exists(c Client) bool

func (Vertical) FocusMaster

func (lay Vertical) FocusMaster()

func (Vertical) MROpt

func (lay Vertical) MROpt(c Client, flags, x, y, width, height int)

func (Vertical) MakeMaster

func (lay Vertical) MakeMaster()

func (*Vertical) MastersFewer

func (lay *Vertical) MastersFewer()

func (*Vertical) MastersMore

func (lay *Vertical) MastersMore()

func (Vertical) Move

func (lay Vertical) Move(c Client, x, y int)

func (Vertical) MoveResize

func (lay Vertical) MoveResize(c Client, x, y, width, height int)

func (*Vertical) Name

func (v *Vertical) Name() string

func (Vertical) Next

func (lay Vertical) Next()

func (Vertical) Place

func (lay Vertical) Place()

func (Vertical) Prev

func (lay Vertical) Prev()

func (Vertical) Remove

func (lay Vertical) Remove(c Client)

func (Vertical) Resize

func (lay Vertical) Resize(c Client, width, height int)

func (Vertical) ResizeMaster

func (lay Vertical) ResizeMaster(amount float64)

func (Vertical) ResizeWindow

func (lay Vertical) ResizeWindow(amount float64)

func (*Vertical) SetGeom

func (lay *Vertical) SetGeom(geom xrect.Rect)

func (Vertical) SwitchNext

func (lay Vertical) SwitchNext()

func (Vertical) SwitchPrev

func (lay Vertical) SwitchPrev()

func (Vertical) Unplace

func (lay Vertical) Unplace()