Package xclient

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

Overview ▾

package xclient provides an implementation of an X client for use with all of Wingo's sub-packages.

XXX: I consider this package to be a complete mess. I must find a way to simplify.

Index ▾

Constants
type Client
    func New(id xproto.Window) *Client
    func (c *Client) CanFocus() bool
    func (c *Client) CheckNewWorkspace()
    func (c *Client) Class() *icccm.WmClass
    func (c *Client) ClientGeom() xrect.Rect
    func (c *Client) Close()
    func (c *Client) CopyState(src, dest string)
    func (c *Client) CycleHighlighted()
    func (c *Client) CycleImage() *xgraphics.Image
    func (c *Client) CycleIsActive() bool
    func (c *Client) CycleItem() *prompt.CycleItem
    func (c *Client) CycleSelected()
    func (c *Client) CycleText() string
    func (c *Client) Deiconify()
    func (c *Client) DeleteState(name string)
    func (c *Client) DragGeom() xrect.Rect
    func (c *Client) DragMoveBegin(rx, ry, ex, ey int) bool
    func (c *Client) DragMoveEnd(rx, ry, ex, ey int)
    func (c *Client) DragMoveStep(rx, ry, ex, ey int)
    func (c *Client) DragResizeBegin(direction uint32, rx, ry, ex, ey int) (bool, xproto.Cursor)
    func (c *Client) DragResizeEnd(rx, ry, ex, ey int)
    func (c *Client) DragResizeStep(rx, ry, ex, ey int)
    func (c *Client) EnsureUnmax()
    func (c *Client) FireHook(hk hook.Type)
    func (c *Client) Float()
    func (c *Client) FloatingToggle()
    func (c *Client) Focus()
    func (c *Client) Focused()
    func (c *Client) Frame() frame.Frame
    func (c *Client) FrameBorders()
    func (c *Client) FrameFull()
    func (c *Client) FrameNada()
    func (c *Client) FramePieceMouseSetup(piece string, pieceid xproto.Window)
    func (c *Client) FrameSlim()
    func (c *Client) FrameTile()
    func (c *Client) FullscreenToggle()
    func (c *Client) Fullscreened()
    func (c *Client) Geom() xrect.Rect
    func (c *Client) GravitizeX(x int, gravity int) int
    func (c *Client) GravitizeY(y int, gravity int) int
    func (c *Client) HasState(name string) bool
    func (c *Client) HeadGeom() xrect.Rect
    func (c *Client) Icon(width, height int) *xgraphics.Image
    func (c *Client) Iconified() bool
    func (c *Client) IconifiedSet(iconified bool)
    func (c *Client) Iconify()
    func (c *Client) IconifyToggle()
    func (c *Client) Id() xproto.Window
    func (c *Client) ImminentDestruction() bool
    func (c *Client) IsActive() bool
    func (c *Client) IsMapped() bool
    func (c *Client) IsMaximized() bool
    func (c *Client) IsSkipPager() bool
    func (c *Client) IsSkipTaskbar() bool
    func (c *Client) IsSticky() bool
    func (c *Client) IsTransient() bool
    func (c *Client) Layer() int
    func (c *Client) Layout() layout.Layout
    func (c *Client) LayoutMROpt(flags, x, y, width, height int)
    func (c *Client) LayoutMove(x, y int)
    func (c *Client) LayoutMoveResize(x, y, width, height int)
    func (c *Client) LayoutResize(width, height int)
    func (c *Client) LoadState(name string)
    func (c *Client) MROpt(validate bool, flags, x, y, w, h int)
    func (c *Client) Map()
    func (c *Client) Maximize()
    func (c *Client) MaximizeToggle()
    func (c *Client) Move(x, y int)
    func (c *Client) MoveResize(x, y, width, height int)
    func (c *Client) MoveResizeValid(x, y, width, height int)
    func (c *Client) Name() string
    func (c *Client) PrepareForFocus()
    func (c *Client) PrimaryType() int
    func (c *Client) PrimaryTypeString() string
    func (c *Client) Raise()
    func (c *Client) Remaximize()
    func (c *Client) Resize(validate bool, width, height int)
    func (c *Client) SaveState(name string)
    func (c *Client) SelectHighlighted(data interface{})
    func (c *Client) SelectItem() *prompt.SelectItem
    func (c *Client) SelectSelected(data interface{})
    func (c *Client) SelectText() string
    func (c *Client) SendFocusNotify() bool
    func (c *Client) ShouldForceFloating() bool
    func (c *Client) SkipPagerSet(yes bool)
    func (c *Client) SkipTaskbarSet(yes bool)
    func (c *Client) StackAboveToggle()
    func (c *Client) StackBelowToggle()
    func (c *Client) State() int
    func (c *Client) StickyToggle()
    func (c *Client) String() string
    func (c *Client) TopWin() *xwindow.Window
    func (c *Client) Transient(test stack.Client) bool
    func (c *Client) Unfloat()
    func (c *Client) Unfocused()
    func (c *Client) Unfullscreened()
    func (c *Client) Unmap()
    func (c *Client) Unmaximize()
    func (c *Client) ValidateHeight(height int) int
    func (c *Client) ValidateWidth(width int) int
    func (c *Client) Win() *xwindow.Window
    func (c *Client) WmStates() []string
    func (c *Client) Workspace() workspace.Workspacer
    func (c *Client) WorkspaceSet(newWrk workspace.Workspacer)
type SelectData

Package files

bools.go client.go client_message.go doc.go drag.go event.go focus.go frame.go group.go icon.go layout.go manage.go match.go misc.go prompts.go property.go state.go toggles.go unmanage.go workspace.go

Constants

const (
    TypeNormal = iota
    TypeDesktop
    TypeDock
)

type Client

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

func New

func New(id xproto.Window) *Client

func (*Client) CanFocus

func (c *Client) CanFocus() bool

func (*Client) CheckNewWorkspace

func (c *Client) CheckNewWorkspace()

func (*Client) Class

func (c *Client) Class() *icccm.WmClass

func (*Client) ClientGeom

func (c *Client) ClientGeom() xrect.Rect

Geom returns the geometry of the client window (not the frame window).

func (*Client) Close

func (c *Client) Close()

func (*Client) CopyState

func (c *Client) CopyState(src, dest string)

func (*Client) CycleHighlighted

func (c *Client) CycleHighlighted()

func (*Client) CycleImage

func (c *Client) CycleImage() *xgraphics.Image

func (*Client) CycleIsActive

func (c *Client) CycleIsActive() bool

func (*Client) CycleItem

func (c *Client) CycleItem() *prompt.CycleItem

func (*Client) CycleSelected

func (c *Client) CycleSelected()

func (*Client) CycleText

func (c *Client) CycleText() string

func (*Client) Deiconify

func (c *Client) Deiconify()

func (*Client) DeleteState

func (c *Client) DeleteState(name string)

func (*Client) DragGeom

func (c *Client) DragGeom() xrect.Rect

func (*Client) DragMoveBegin

func (c *Client) DragMoveBegin(rx, ry, ex, ey int) bool

func (*Client) DragMoveEnd

func (c *Client) DragMoveEnd(rx, ry, ex, ey int)

func (*Client) DragMoveStep

func (c *Client) DragMoveStep(rx, ry, ex, ey int)

func (*Client) DragResizeBegin

func (c *Client) DragResizeBegin(direction uint32,
    rx, ry, ex, ey int) (bool, xproto.Cursor)

func (*Client) DragResizeEnd

func (c *Client) DragResizeEnd(rx, ry, ex, ey int)

func (*Client) DragResizeStep

func (c *Client) DragResizeStep(rx, ry, ex, ey int)

func (*Client) EnsureUnmax

func (c *Client) EnsureUnmax()

EnsureUnmax makes sure the client is not in a maximized state. It's useful when a particular operation that doesn't work in maximized mode overrides a client's maximized state. (Like issuing a tiling request.)

func (*Client) FireHook

func (c *Client) FireHook(hk hook.Type)

func (*Client) Float

func (c *Client) Float()

func (*Client) FloatingToggle

func (c *Client) FloatingToggle()

func (*Client) Focus

func (c *Client) Focus()

func (*Client) Focused

func (c *Client) Focused()

func (*Client) Frame

func (c *Client) Frame() frame.Frame

Frame returns the current frame in use by the client.

func (*Client) FrameBorders

func (c *Client) FrameBorders()

FrameBorders switches this client's frame to the 'Borders' frame.

func (*Client) FrameFull

func (c *Client) FrameFull()

FrameFull switches this client's frame to the 'Full' frame.

func (*Client) FrameNada

func (c *Client) FrameNada()

FrameNada switches this client's frame to the 'Nada' frame.

func (*Client) FramePieceMouseSetup

func (c *Client) FramePieceMouseSetup(piece string, pieceid xproto.Window)

func (*Client) FrameSlim

func (c *Client) FrameSlim()

FrameSlim switches this client's frame to the 'Slim' frame.

func (*Client) FrameTile

func (c *Client) FrameTile()

func (*Client) FullscreenToggle

func (c *Client) FullscreenToggle()

func (*Client) Fullscreened

func (c *Client) Fullscreened()

func (*Client) Geom

func (c *Client) Geom() xrect.Rect

func (*Client) GravitizeX

func (c *Client) GravitizeX(x int, gravity int) int

GravitizeX adjusts the x coordinate of a window's position using the gravity value set. Gravity refers to the way (x, y) coordinates are interpreted with respect to a client's decorations. See Section 4.1.2.3 of the ICCCM for more details.

func (*Client) GravitizeY

func (c *Client) GravitizeY(y int, gravity int) int

GravitizeY adjusts the y coordinate of a window's position using the gravity value set. Gravity refers to the way (x, y) coordinates are interpreted with respect to a client's decorations. See Section 4.1.2.3 of the ICCCM for more details.

func (*Client) HasState

func (c *Client) HasState(name string) bool

func (*Client) HeadGeom

func (c *Client) HeadGeom() xrect.Rect

func (*Client) Icon

func (c *Client) Icon(width, height int) *xgraphics.Image

func (*Client) Iconified

func (c *Client) Iconified() bool

func (*Client) IconifiedSet

func (c *Client) IconifiedSet(iconified bool)

func (*Client) Iconify

func (c *Client) Iconify()

func (*Client) IconifyToggle

func (c *Client) IconifyToggle()

func (*Client) Id

func (c *Client) Id() xproto.Window

func (*Client) ImminentDestruction

func (c *Client) ImminentDestruction() bool

func (*Client) IsActive

func (c *Client) IsActive() bool

func (*Client) IsMapped

func (c *Client) IsMapped() bool

func (*Client) IsMaximized

func (c *Client) IsMaximized() bool

func (*Client) IsSkipPager

func (c *Client) IsSkipPager() bool

func (*Client) IsSkipTaskbar

func (c *Client) IsSkipTaskbar() bool

func (*Client) IsSticky

func (c *Client) IsSticky() bool

func (*Client) IsTransient

func (c *Client) IsTransient() bool

func (*Client) Layer

func (c *Client) Layer() int

func (*Client) Layout

func (c *Client) Layout() layout.Layout

func (*Client) LayoutMROpt

func (c *Client) LayoutMROpt(flags, x, y, width, height int)

func (*Client) LayoutMove

func (c *Client) LayoutMove(x, y int)

func (*Client) LayoutMoveResize

func (c *Client) LayoutMoveResize(x, y, width, height int)

func (*Client) LayoutResize

func (c *Client) LayoutResize(width, height int)

func (*Client) LoadState

func (c *Client) LoadState(name string)

Don't revert to regular geometry when moving/resizing. We can still revert the frame or the maximized state, though. Also don't load *ever* when client's workspace isn't visible.

func (*Client) MROpt

func (c *Client) MROpt(validate bool, flags, x, y, w, h int)

func (*Client) Map

func (c *Client) Map()

func (*Client) Maximize

func (c *Client) Maximize()

func (*Client) MaximizeToggle

func (c *Client) MaximizeToggle()

func (*Client) Move

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

func (*Client) MoveResize

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

func (*Client) MoveResizeValid

func (c *Client) MoveResizeValid(x, y, width, height int)

func (*Client) Name

func (c *Client) Name() string

func (*Client) PrepareForFocus

func (c *Client) PrepareForFocus()

func (*Client) PrimaryType

func (c *Client) PrimaryType() int

func (*Client) PrimaryTypeString

func (c *Client) PrimaryTypeString() string

func (*Client) Raise

func (c *Client) Raise()

func (*Client) Remaximize

func (c *Client) Remaximize()

func (*Client) Resize

func (c *Client) Resize(validate bool, width, height int)

func (*Client) SaveState

func (c *Client) SaveState(name string)

Don't save when moving or resizing. Also don't save when client's workspace isn't visible.

func (*Client) SelectHighlighted

func (c *Client) SelectHighlighted(data interface{})

func (*Client) SelectItem

func (c *Client) SelectItem() *prompt.SelectItem

func (*Client) SelectSelected

func (c *Client) SelectSelected(data interface{})

func (*Client) SelectText

func (c *Client) SelectText() string

func (*Client) SendFocusNotify

func (c *Client) SendFocusNotify() bool

func (*Client) ShouldForceFloating

func (c *Client) ShouldForceFloating() bool

ShouldForceFloating returns true whenever a client should be floating. More specifically, it returns true when a client should NOT be added to a tiling layout even if a tiling layout is active.

func (*Client) SkipPagerSet

func (c *Client) SkipPagerSet(yes bool)

func (*Client) SkipTaskbarSet

func (c *Client) SkipTaskbarSet(yes bool)

func (*Client) StackAboveToggle

func (c *Client) StackAboveToggle()

func (*Client) StackBelowToggle

func (c *Client) StackBelowToggle()

func (*Client) State

func (c *Client) State() int

func (*Client) StickyToggle

func (c *Client) StickyToggle()

func (*Client) String

func (c *Client) String() string

func (*Client) TopWin

func (c *Client) TopWin() *xwindow.Window

func (*Client) Transient

func (c *Client) Transient(test stack.Client) bool

Transient is a wrapper around transient that type switches an empty interface to a *Client type. This is used to satisfy Client interfaces is various sub-packages.

Currently, only values that have type *Client can be transient to each other.

func (*Client) Unfloat

func (c *Client) Unfloat()

func (*Client) Unfocused

func (c *Client) Unfocused()

func (*Client) Unfullscreened

func (c *Client) Unfullscreened()

func (*Client) Unmap

func (c *Client) Unmap()

func (*Client) Unmaximize

func (c *Client) Unmaximize()

func (*Client) ValidateHeight

func (c *Client) ValidateHeight(height int) int

ValidateHeight use's a clients min/max height and height increment values from the WM_NORMAL_HINTS property to change 'height' to a valid height. See Section 4.1.2.3 of the ICCCM for more details.

func (*Client) ValidateWidth

func (c *Client) ValidateWidth(width int) int

ValidateWidth use's a clients min/max width and width increment values from the WM_NORMAL_HINTS property to change 'width' to a valid width. See Section 4.1.2.3 of the ICCCM for more details.

func (*Client) Win

func (c *Client) Win() *xwindow.Window

func (*Client) WmStates

func (c *Client) WmStates() []string

func (*Client) Workspace

func (c *Client) Workspace() workspace.Workspacer

func (*Client) WorkspaceSet

func (c *Client) WorkspaceSet(newWrk workspace.Workspacer)

type SelectData

type SelectData struct {
    Selected    func(c *Client)
    Highlighted func(c *Client)
}