Package frame

import "github.com/BurntSushi/wingo-conc/frame"
Overview
Index

Overview ▾

package frame draws window decorations around clients managed by Wingo.

Index ▾

Constants
func ClientToFrame(f Frame, gravity, x, y, w, h int) (int, int, int, int)
func Maximize(f Frame)
func Reset(f Frame)
type Borders
    func NewBorders(X *xgbutil.XUtil, t *BordersTheme, p *Parent, c Client) (*Borders, error)
    func (f *Borders) Active()
    func (f *Borders) Bottom() int
    func (f Borders) Client() Client
    func (f *Borders) Current() bool
    func (f *Borders) Destroy()
    func (f Borders) Geom() xrect.Rect
    func (f *Borders) Inactive()
    func (f Borders) IsMapped() bool
    func (f *Borders) Left() int
    func (f *Borders) MROpt(validate bool, flags, x, y, w, h int)
    func (f Borders) Map()
    func (f *Borders) Maximize()
    func (f *Borders) Move(x, y int)
    func (f *Borders) MoveResize(validate bool, x, y, w, h int)
    func (f Borders) Moving() bool
    func (f Borders) MovingState() *MoveState
    func (f *Borders) Off()
    func (f *Borders) On()
    func (f Borders) Parent() *Parent
    func (f *Borders) Resize(validate bool, w, h int)
    func (f Borders) Resizing() bool
    func (f Borders) ResizingState() *ResizeState
    func (f *Borders) Right() int
    func (f *Borders) Top() int
    func (f Borders) Unmap()
    func (f *Borders) Unmaximize()
type BordersTheme
    func DefaultBordersTheme() *BordersTheme
type Client
type Frame
type Full
    func NewFull(X *xgbutil.XUtil, t *FullTheme, p *Parent, c Client) (*Full, error)
    func (f *Full) Active()
    func (f *Full) Bottom() int
    func (f Full) Client() Client
    func (f *Full) Current() bool
    func (f *Full) Destroy()
    func (f Full) Geom() xrect.Rect
    func (f *Full) Inactive()
    func (f Full) IsMapped() bool
    func (f *Full) Left() int
    func (f *Full) MROpt(validate bool, flags, x, y, w, h int)
    func (f Full) Map()
    func (f *Full) Maximize()
    func (f *Full) Move(x, y int)
    func (f *Full) MoveResize(validate bool, x, y, w, h int)
    func (f Full) Moving() bool
    func (f Full) MovingState() *MoveState
    func (f *Full) Off()
    func (f *Full) On()
    func (f Full) Parent() *Parent
    func (f *Full) Resize(validate bool, w, h int)
    func (f Full) Resizing() bool
    func (f Full) ResizingState() *ResizeState
    func (f *Full) Right() int
    func (f *Full) Top() int
    func (f Full) Unmap()
    func (f *Full) Unmaximize()
    func (f *Full) UpdateIcon()
    func (f *Full) UpdateTitle()
type FullTheme
    func DefaultFullTheme(X *xgbutil.XUtil) *FullTheme
type MoveState
type Nada
    func NewNada(X *xgbutil.XUtil, p *Parent, c Client) (*Nada, error)
    func (f *Nada) Active()
    func (f *Nada) Bottom() int
    func (f Nada) Client() Client
    func (f *Nada) Current() bool
    func (f Nada) Destroy()
    func (f Nada) Geom() xrect.Rect
    func (f *Nada) Inactive()
    func (f Nada) IsMapped() bool
    func (f *Nada) Left() int
    func (f *Nada) MROpt(validate bool, flags, x, y, w, h int)
    func (f Nada) Map()
    func (f *Nada) Maximize()
    func (f *Nada) Move(x, y int)
    func (f *Nada) MoveResize(validate bool, x, y, w, h int)
    func (f Nada) Moving() bool
    func (f Nada) MovingState() *MoveState
    func (f *Nada) Off()
    func (f *Nada) On()
    func (f Nada) Parent() *Parent
    func (f *Nada) Resize(validate bool, w, h int)
    func (f Nada) Resizing() bool
    func (f Nada) ResizingState() *ResizeState
    func (f *Nada) Right() int
    func (f *Nada) Top() int
    func (f Nada) Unmap()
    func (f *Nada) Unmaximize()
type Parent
    func (par *Parent) Deparent(cid xproto.Window)
    func (par *Parent) Map()
    func (par *Parent) Unmap()
type ResizeState
type Slim
    func NewSlim(X *xgbutil.XUtil, t *SlimTheme, p *Parent, c Client) (*Slim, error)
    func (f *Slim) Active()
    func (f *Slim) Bottom() int
    func (f Slim) Client() Client
    func (f *Slim) Current() bool
    func (f Slim) Destroy()
    func (f Slim) Geom() xrect.Rect
    func (f *Slim) Inactive()
    func (f Slim) IsMapped() bool
    func (f *Slim) Left() int
    func (f *Slim) MROpt(validate bool, flags, x, y, w, h int)
    func (f Slim) Map()
    func (f *Slim) Maximize()
    func (f *Slim) Move(x, y int)
    func (f *Slim) MoveResize(validate bool, x, y, w, h int)
    func (f Slim) Moving() bool
    func (f Slim) MovingState() *MoveState
    func (f *Slim) Off()
    func (f *Slim) On()
    func (f Slim) Parent() *Parent
    func (f *Slim) Resize(validate bool, w, h int)
    func (f Slim) Resizing() bool
    func (f Slim) ResizingState() *ResizeState
    func (f *Slim) Right() int
    func (f *Slim) Top() int
    func (f Slim) Unmap()
    func (f *Slim) Unmaximize()
type SlimTheme
    func DefaultSlimTheme() *SlimTheme

Package files

borders.go borders_pieces.go client.go doc.go frame.go full.go full_pieces.go interface.go nada.go parent.go piece.go slim.go

Constants

const (
    Active = iota
    Inactive
)

func ClientToFrame

func ClientToFrame(f Frame, gravity, x, y, w, h int) (int, int, int, int)

func Maximize

func Maximize(f Frame)

func Reset

func Reset(f Frame)

type Borders

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

func NewBorders

func NewBorders(X *xgbutil.XUtil,
    t *BordersTheme, p *Parent, c Client) (*Borders, error)

func (*Borders) Active

func (f *Borders) Active()

func (*Borders) Bottom

func (f *Borders) Bottom() int

func (Borders) Client

func (f Borders) Client() Client

func (*Borders) Current

func (f *Borders) Current() bool

func (*Borders) Destroy

func (f *Borders) Destroy()

func (Borders) Geom

func (f Borders) Geom() xrect.Rect

func (*Borders) Inactive

func (f *Borders) Inactive()

func (Borders) IsMapped

func (f Borders) IsMapped() bool

func (*Borders) Left

func (f *Borders) Left() int

func (*Borders) MROpt

func (f *Borders) MROpt(validate bool, flags, x, y, w, h int)

func (Borders) Map

func (f Borders) Map()

func (*Borders) Maximize

func (f *Borders) Maximize()

func (*Borders) Move

func (f *Borders) Move(x, y int)

func (*Borders) MoveResize

func (f *Borders) MoveResize(validate bool, x, y, w, h int)

func (Borders) Moving

func (f Borders) Moving() bool

func (Borders) MovingState

func (f Borders) MovingState() *MoveState

func (*Borders) Off

func (f *Borders) Off()

func (*Borders) On

func (f *Borders) On()

func (Borders) Parent

func (f Borders) Parent() *Parent

func (*Borders) Resize

func (f *Borders) Resize(validate bool, w, h int)

func (Borders) Resizing

func (f Borders) Resizing() bool

func (Borders) ResizingState

func (f Borders) ResizingState() *ResizeState

func (*Borders) Right

func (f *Borders) Right() int

func (*Borders) Top

func (f *Borders) Top() int

func (Borders) Unmap

func (f Borders) Unmap()

func (*Borders) Unmaximize

func (f *Borders) Unmaximize()

type BordersTheme

type BordersTheme struct {
    BorderSize                 int
    AThinColor, IThinColor     render.Color
    ABorderColor, IBorderColor render.Color
}

func DefaultBordersTheme

func DefaultBordersTheme() *BordersTheme

type Client

type Client interface {
    State() int
    Frame() Frame
    IsMaximized() bool
    Icon(width, height int) *xgraphics.Image
    Name() string
    ClientGeom() xrect.Rect
    ValidateHeight(height int) int
    ValidateWidth(width int) int
    GravitizeX(x, gravity int) int
    GravitizeY(y, gravity int) int
    Win() *xwindow.Window
    Id() xproto.Window
    EnsureUnmax()
    FramePieceMouseSetup(ident string, wid xproto.Window)
    String() string
    HeadGeom() xrect.Rect
}

type Frame

type Frame interface {
    Client() Client
    Parent() *Parent

    Map()
    Unmap()
    Destroy()
    Geom() xrect.Rect
    IsMapped() bool

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

    Moving() bool
    MovingState() *MoveState
    Resizing() bool
    ResizingState() *ResizeState

    Current() bool

    Top() int
    Bottom() int
    Left() int
    Right() int

    Off()
    On()
    Active()
    Inactive()
    Maximize()
    Unmaximize()
}

type Full

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

func NewFull

func NewFull(X *xgbutil.XUtil,
    t *FullTheme, p *Parent, c Client) (*Full, error)

func (*Full) Active

func (f *Full) Active()

func (*Full) Bottom

func (f *Full) Bottom() int

func (Full) Client

func (f Full) Client() Client

func (*Full) Current

func (f *Full) Current() bool

func (*Full) Destroy

func (f *Full) Destroy()

func (Full) Geom

func (f Full) Geom() xrect.Rect

func (*Full) Inactive

func (f *Full) Inactive()

func (Full) IsMapped

func (f Full) IsMapped() bool

func (*Full) Left

func (f *Full) Left() int

func (*Full) MROpt

func (f *Full) MROpt(validate bool, flags, x, y, w, h int)

func (Full) Map

func (f Full) Map()

func (*Full) Maximize

func (f *Full) Maximize()

func (*Full) Move

func (f *Full) Move(x, y int)

func (*Full) MoveResize

func (f *Full) MoveResize(validate bool, x, y, w, h int)

func (Full) Moving

func (f Full) Moving() bool

func (Full) MovingState

func (f Full) MovingState() *MoveState

func (*Full) Off

func (f *Full) Off()

func (*Full) On

func (f *Full) On()

func (Full) Parent

func (f Full) Parent() *Parent

func (*Full) Resize

func (f *Full) Resize(validate bool, w, h int)

func (Full) Resizing

func (f Full) Resizing() bool

func (Full) ResizingState

func (f Full) ResizingState() *ResizeState

func (*Full) Right

func (f *Full) Right() int

func (*Full) Top

func (f *Full) Top() int

func (Full) Unmap

func (f Full) Unmap()

func (*Full) Unmaximize

func (f *Full) Unmaximize()

func (*Full) UpdateIcon

func (f *Full) UpdateIcon()

func (*Full) UpdateTitle

func (f *Full) UpdateTitle()

type FullTheme

type FullTheme struct {
    Font                   *truetype.Font
    FontSize               float64
    AFontColor, IFontColor render.Color

    TitleSize                int
    ATitleColor, ITitleColor render.Color

    BorderSize                 int
    ABorderColor, IBorderColor render.Color

    ACloseButton, ICloseButton       *xgraphics.Image
    AMaximizeButton, IMaximizeButton *xgraphics.Image
    AMinimizeButton, IMinimizeButton *xgraphics.Image
}

func DefaultFullTheme

func DefaultFullTheme(X *xgbutil.XUtil) *FullTheme

type MoveState

type MoveState struct {
    Moving       bool
    RootX, RootY int
}

type Nada

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

func NewNada

func NewNada(X *xgbutil.XUtil, p *Parent, c Client) (*Nada, error)

func (*Nada) Active

func (f *Nada) Active()

func (*Nada) Bottom

func (f *Nada) Bottom() int

func (Nada) Client

func (f Nada) Client() Client

func (*Nada) Current

func (f *Nada) Current() bool

func (Nada) Destroy

func (f Nada) Destroy()

Destroy will check if the client window is still a sub-window of this frame, and reparent it to the root window if so.

Destroy does *not* destroy the parent window! The caller must do that, since the parent window is shared across many frames.

func (Nada) Geom

func (f Nada) Geom() xrect.Rect

func (*Nada) Inactive

func (f *Nada) Inactive()

func (Nada) IsMapped

func (f Nada) IsMapped() bool

func (*Nada) Left

func (f *Nada) Left() int

func (*Nada) MROpt

func (f *Nada) MROpt(validate bool, flags, x, y, w, h int)

func (Nada) Map

func (f Nada) Map()

func (*Nada) Maximize

func (f *Nada) Maximize()

func (*Nada) Move

func (f *Nada) Move(x, y int)

func (*Nada) MoveResize

func (f *Nada) MoveResize(validate bool, x, y, w, h int)

func (Nada) Moving

func (f Nada) Moving() bool

func (Nada) MovingState

func (f Nada) MovingState() *MoveState

func (*Nada) Off

func (f *Nada) Off()

func (*Nada) On

func (f *Nada) On()

func (Nada) Parent

func (f Nada) Parent() *Parent

func (*Nada) Resize

func (f *Nada) Resize(validate bool, w, h int)

func (Nada) Resizing

func (f Nada) Resizing() bool

func (Nada) ResizingState

func (f Nada) ResizingState() *ResizeState

func (*Nada) Right

func (f *Nada) Right() int

func (*Nada) Top

func (f *Nada) Top() int

func (Nada) Unmap

func (f Nada) Unmap()

func (*Nada) Unmaximize

func (f *Nada) Unmaximize()

type Parent

type Parent struct {
    *xwindow.Window

    MoveState   *MoveState
    ResizeState *ResizeState
    // contains filtered or unexported fields
}

func (*Parent) Deparent

func (par *Parent) Deparent(cid xproto.Window)

func (*Parent) Map

func (par *Parent) Map()

func (*Parent) Unmap

func (par *Parent) Unmap()

type ResizeState

type ResizeState struct {
    Resizing            bool
    RootX, RootY        int
    X, Y, Width, Height int
    Xs, Ys, Ws, Hs      bool
}

type Slim

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

func NewSlim

func NewSlim(X *xgbutil.XUtil,
    t *SlimTheme, p *Parent, c Client) (*Slim, error)

func (*Slim) Active

func (f *Slim) Active()

func (*Slim) Bottom

func (f *Slim) Bottom() int

func (Slim) Client

func (f Slim) Client() Client

func (*Slim) Current

func (f *Slim) Current() bool

func (Slim) Destroy

func (f Slim) Destroy()

Destroy will check if the client window is still a sub-window of this frame, and reparent it to the root window if so.

Destroy does *not* destroy the parent window! The caller must do that, since the parent window is shared across many frames.

func (Slim) Geom

func (f Slim) Geom() xrect.Rect

func (*Slim) Inactive

func (f *Slim) Inactive()

func (Slim) IsMapped

func (f Slim) IsMapped() bool

func (*Slim) Left

func (f *Slim) Left() int

func (*Slim) MROpt

func (f *Slim) MROpt(validate bool, flags, x, y, w, h int)

func (Slim) Map

func (f Slim) Map()

func (*Slim) Maximize

func (f *Slim) Maximize()

func (*Slim) Move

func (f *Slim) Move(x, y int)

func (*Slim) MoveResize

func (f *Slim) MoveResize(validate bool, x, y, w, h int)

func (Slim) Moving

func (f Slim) Moving() bool

func (Slim) MovingState

func (f Slim) MovingState() *MoveState

func (*Slim) Off

func (f *Slim) Off()

func (*Slim) On

func (f *Slim) On()

func (Slim) Parent

func (f Slim) Parent() *Parent

func (*Slim) Resize

func (f *Slim) Resize(validate bool, w, h int)

func (Slim) Resizing

func (f Slim) Resizing() bool

func (Slim) ResizingState

func (f Slim) ResizingState() *ResizeState

func (*Slim) Right

func (f *Slim) Right() int

func (*Slim) Top

func (f *Slim) Top() int

func (Slim) Unmap

func (f Slim) Unmap()

func (*Slim) Unmaximize

func (f *Slim) Unmaximize()

type SlimTheme

type SlimTheme struct {
    BorderSize                 int
    ABorderColor, IBorderColor render.Color
}

func DefaultSlimTheme

func DefaultSlimTheme() *SlimTheme