Documentation
¶
Index ¶
- type Border
- type Container
- type ContainerType
- type Direction
- type Layout
- type Mock
- func (m Mock) Arrange(start Container)
- func (m Mock) ArrangeRoot()
- func (m Mock) Focus(ctx context.Context, container Container)
- func (m Mock) Focused(ctx context.Context) Container
- func (m Mock) FocusedByType(ctx context.Context, typ ContainerType) Container
- func (m Mock) Move(ctx context.Context, dir Direction)
- func (m Mock) NewOutput(ctx context.Context, output backend.Output)
- func (m Mock) NewView(ctx context.Context, view backend.View)
- func (m Mock) NewWorkspace(ctx context.Context, output *Output, name string, num uint)
- type Output
- func (o *Output) AddChild(workspace Container)
- func (o *Output) Children() []Container
- func (o *Output) Floating() []Container
- func (o *Output) Focused() Container
- func (o *Output) Geometry() *wlc.Geometry
- func (o *Output) Parent() Container
- func (o *Output) Type() ContainerType
- func (o *Output) Visible() bool
- type Root
- func (r *Root) AddChild(output Container)
- func (r *Root) Children() []Container
- func (r *Root) Floating() []Container
- func (r *Root) Focused() Container
- func (r *Root) Geometry() *wlc.Geometry
- func (r *Root) Parent() Container
- func (r *Root) SortedWorkspaces() []*Workspace
- func (r *Root) Type() ContainerType
- func (r *Root) Visible() bool
- type View
- func (v *View) AddChild(_ Container)
- func (v *View) Children() []Container
- func (v *View) Floating() []Container
- func (v *View) Focused() Container
- func (v *View) Fullscreen() bool
- func (v *View) Geometry() *wlc.Geometry
- func (v *View) Parent() Container
- func (v *View) SetVisible(visible bool)
- func (v *View) Type() ContainerType
- func (v *View) Visible() bool
- type Workspace
- func (w *Workspace) AddChild(container Container)
- func (w *Workspace) Children() []Container
- func (w *Workspace) Floating() []Container
- func (w *Workspace) Focused() Container
- func (w *Workspace) Geometry() *wlc.Geometry
- func (w *Workspace) Name() string
- func (w *Workspace) Parent() Container
- func (w *Workspace) Type() ContainerType
- func (w *Workspace) Visible() bool
- type Workspaces
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container interface { // Geometry of the container. Geometry() *wlc.Geometry // Children of the container. Children() []Container // Floating children of the container. Floating() []Container // Focused child of the container. Focused() Container // Parent of the container. Parent() Container // Visible returns true if the container is visible. Visible() bool // AddChild adds a child container. AddChild(Container) // Type returns the type of a container. Type() ContainerType }
Container defines an interface describing a container e.g. output, workspace or view.
type ContainerType ¶
type ContainerType int
ContainerType is a type of container e.g. Root or Output.
const ( // CRoot is the root container type. CRoot ContainerType = iota // COutput is the output container type. COutput // CWorkspace is the workspace container type. CWorkspace // CView is the view container type. CView )
type Layout ¶
type Layout interface { // Move container in direction. Move(ctx context.Context, dir Direction) // Focus container. Focus(ctx context.Context, container Container) // Focused returns the focused container of the layout. Focused(ctx context.Context) Container FocusedByType(ctx context.Context, typ ContainerType) Container // NewOuput initializes a new output. NewOutput(ctx context.Context, output backend.Output) // NewWorkspace initializes a new workspace. NewWorkspace(ctx context.Context, output *Output, name string, num uint) // NewView initializes a new view. NewView(ctx context.Context, view backend.View) // ArrangeRoot arranges the whole layout from the root and down. ArrangeRoot() // Arrange arranges a subbranch of the layout starting from the // specified container and moving down the layout. Arrange(start Container) }
Layout defines an interface for interacting with a layout.
type Mock ¶
type Mock struct{}
Mock mocks the layout interface.
func (Mock) Arrange ¶
Arrange mocks arranging a subbranch of the layout starting from the specified container and moving down the layout.
func (Mock) ArrangeRoot ¶
func (m Mock) ArrangeRoot()
ArrangeRoot mocks arranging the whole layout from the root and down.
func (Mock) FocusedByType ¶
func (m Mock) FocusedByType(ctx context.Context, typ ContainerType) Container
FocusedByType mocks returning a focused container by type.
type Output ¶
Output describes an output in the layout.
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root is the root container in a layout. The root container manages the output containers.
func (*Root) Children ¶
Children returns a list for output containers attached to the root container.
func (*Root) Floating ¶
Floating always returns nil because the root container can't have floating child containers.
func (*Root) SortedWorkspaces ¶
SortedWorkspaces returns an aggregated sorted list of workspaces on all outputs.
type View ¶
View defines a view in the layout.
func (*View) Fullscreen ¶
Fullscreen returns true if view is in fullscreen mode.
func (*View) SetVisible ¶
SetVisible sets the visibility state of the view.
type Workspace ¶
type Workspace struct { Num uint // contains filtered or unexported fields }
Workspace is a workspace container in the layout. A workspace has a list of tiled containers plus a list of floating containers associated with it.
func NewWorkspace ¶
NewWorkspace initializes a new empty workspace container.
func (*Workspace) Type ¶
func (w *Workspace) Type() ContainerType
Type returns the workspace container type.
type Workspaces ¶
type Workspaces []*Workspace
Workspaces is a list of workspaces.
func (Workspaces) Less ¶
func (w Workspaces) Less(i, j int) bool
Less returns true if workspace at index i should be sorted before workspace at index j.
func (Workspaces) Swap ¶
func (w Workspaces) Swap(i, j int)
Swap swaps two workspaces in the workspace list.