Documentation ¶
Overview ¶
Package xdg implements the stable XDG Window Manager Base protocol
Package xdg implements the xdg_shell protocol
Index ¶
- Constants
- func ToplevelAddListener(tl *Toplevel, h ToplevelListener)
- func WmBaseAddListener(s *WmBase, h WmBasePingHandler)
- type BaseProxy
- type Context
- type Event
- type Output
- type Popup
- func (p *Popup) AddConfigureHandler(h PopupConfigureHandler)
- func (p *Popup) AddPopupDoneHandler(h PopupPopupDoneHandler)
- func (p *Popup) AddRepositionedHandler(h PopupRepositionedHandler)
- func (p *Popup) Destroy() error
- func (p *Popup) Dispatch(event *Event)
- func (p *Popup) Grab(Seat *Seat, Serial uint32) error
- func (p *Popup) RemoveConfigureHandler(h PopupConfigureHandler)
- func (p *Popup) RemovePopupDoneHandler(h PopupPopupDoneHandler)
- func (p *Popup) RemoveRepositionedHandler(h PopupRepositionedHandler)
- func (p *Popup) Reposition(Positioner *Positioner, Token uint32) error
- type PopupConfigureEvent
- type PopupConfigureHandler
- type PopupPopupDoneEvent
- type PopupPopupDoneHandler
- type PopupRepositionedEvent
- type PopupRepositionedHandler
- type Positioner
- func (p *Positioner) Destroy() error
- func (p *Positioner) Dispatch(event *Event)
- func (p *Positioner) SetAnchor(Anchor uint32) error
- func (p *Positioner) SetAnchorRect(X int32, Y int32, Width int32, Height int32) error
- func (p *Positioner) SetConstraintAdjustment(ConstraintAdjustment uint32) error
- func (p *Positioner) SetGravity(Gravity uint32) error
- func (p *Positioner) SetOffset(X int32, Y int32) error
- func (p *Positioner) SetParentConfigure(Serial uint32) error
- func (p *Positioner) SetParentSize(ParentWidth int32, ParentHeight int32) error
- func (p *Positioner) SetReactive() error
- func (p *Positioner) SetSize(Width int32, Height int32) error
- type Proxy
- type Seat
- type Surface
- func (p *Surface) AckConfigure(Serial uint32) error
- func (p *Surface) AddConfigureHandler(h SurfaceConfigureHandler)
- func (s *Surface) AddListener(h SurfaceConfigureHandler)
- func (p *Surface) Destroy() error
- func (p *Surface) Dispatch(event *Event)
- func (p *Surface) GetPopup(Parent *Surface, Positioner *Positioner) (*Popup, error)
- func (p *Surface) GetToplevel() (*Toplevel, error)
- func (p *Surface) RemoveConfigureHandler(h SurfaceConfigureHandler)
- func (p *Surface) SetWindowGeometry(X int32, Y int32, Width int32, Height int32) error
- type SurfaceConfigureEvent
- type SurfaceConfigureHandler
- type Toplevel
- func (p *Toplevel) AddCloseHandler(h ToplevelCloseHandler)
- func (p *Toplevel) AddConfigureBoundsHandler(h ToplevelConfigureBoundsHandler)
- func (p *Toplevel) AddConfigureHandler(h ToplevelConfigureHandler)
- func (p *Toplevel) AddWmCapabilitiesHandler(h ToplevelWmCapabilitiesHandler)
- func (p *Toplevel) Destroy() error
- func (p *Toplevel) Dispatch(event *Event)
- func (p *Toplevel) Move(Seat *Seat, Serial uint32) error
- func (p *Toplevel) RemoveCloseHandler(h ToplevelCloseHandler)
- func (p *Toplevel) RemoveConfigureBoundsHandler(h ToplevelConfigureBoundsHandler)
- func (p *Toplevel) RemoveConfigureHandler(h ToplevelConfigureHandler)
- func (p *Toplevel) RemoveWmCapabilitiesHandler(h ToplevelWmCapabilitiesHandler)
- func (p *Toplevel) Resize(Seat *Seat, Serial uint32, Edges uint32) error
- func (p *Toplevel) SetAppId(AppId string) error
- func (p *Toplevel) SetFullscreen(Output *Output) error
- func (p *Toplevel) SetMaxSize(Width int32, Height int32) error
- func (p *Toplevel) SetMaximized() error
- func (p *Toplevel) SetMinSize(Width int32, Height int32) error
- func (p *Toplevel) SetMinimized() error
- func (p *Toplevel) SetParent(Parent *Toplevel) error
- func (p *Toplevel) SetTitle(Title string) error
- func (p *Toplevel) ShowWindowMenu(Seat *Seat, Serial uint32, X int32, Y int32) error
- func (p *Toplevel) UnsetFullscreen() error
- func (p *Toplevel) UnsetMaximized() error
- type ToplevelCloseEvent
- type ToplevelCloseHandler
- type ToplevelConfigureBoundsEvent
- type ToplevelConfigureBoundsHandler
- type ToplevelConfigureEvent
- type ToplevelConfigureHandler
- type ToplevelListener
- type ToplevelWmCapabilitiesEvent
- type ToplevelWmCapabilitiesHandler
- type WlSurface
- type WmBase
- func (p *WmBase) AddPingHandler(h WmBasePingHandler)
- func (p *WmBase) CreatePositioner() (*Positioner, error)
- func (p *WmBase) Destroy() error
- func (p *WmBase) Dispatch(event *Event)
- func (p *WmBase) GetSurface(Surface *WlSurface) (*Surface, error)
- func (p *WmBase) Pong(Serial uint32) error
- func (p *WmBase) RemovePingHandler(h WmBasePingHandler)
- type WmBasePingEvent
- type WmBasePingHandler
Constants ¶
const PopupErrorInvalidGrab = 0
PopupErrorInvalidGrab means tried to grab after being mapped
const PositionerAnchorBottom = 2
PositionerAnchorBottom
const PositionerAnchorBottomLeft = 6
PositionerAnchorBottomLeft
const PositionerAnchorBottomRight = 8
PositionerAnchorBottomRight
const PositionerAnchorLeft = 3
PositionerAnchorLeft
const PositionerAnchorNone = 0
PositionerAnchorNone
const PositionerAnchorRight = 4
PositionerAnchorRight
const PositionerAnchorTop = 1
PositionerAnchorTop
const PositionerAnchorTopLeft = 5
PositionerAnchorTopLeft
const PositionerAnchorTopRight = 7
PositionerAnchorTopRight
const PositionerConstraintAdjustmentFlipX = 4
PositionerConstraintAdjustmentFlipX
const PositionerConstraintAdjustmentFlipY = 8
PositionerConstraintAdjustmentFlipY
const PositionerConstraintAdjustmentNone = 0
PositionerConstraintAdjustmentNone
const PositionerConstraintAdjustmentResizeX = 16
PositionerConstraintAdjustmentResizeX
const PositionerConstraintAdjustmentResizeY = 32
PositionerConstraintAdjustmentResizeY
const PositionerConstraintAdjustmentSlideX = 1
PositionerConstraintAdjustmentSlideX
const PositionerConstraintAdjustmentSlideY = 2
PositionerConstraintAdjustmentSlideY
const PositionerErrorInvalidInput = 0
PositionerErrorInvalidInput means invalid input provided
const PositionerGravityBottom = 2
PositionerGravityBottom
const PositionerGravityBottomLeft = 6
PositionerGravityBottomLeft
const PositionerGravityBottomRight = 8
PositionerGravityBottomRight
const PositionerGravityLeft = 3
PositionerGravityLeft
const PositionerGravityNone = 0
PositionerGravityNone
const PositionerGravityRight = 4
PositionerGravityRight
const PositionerGravityTop = 1
PositionerGravityTop
const PositionerGravityTopLeft = 5
PositionerGravityTopLeft
const PositionerGravityTopRight = 7
PositionerGravityTopRight
const SurfaceErrorAlreadyConstructed = 2
SurfaceErrorAlreadyConstructed means Surface was already constructed
const SurfaceErrorDefunctRoleObject = 6
SurfaceErrorDefunctRoleObject means Surface was destroyed before its role object
const SurfaceErrorInvalidSerial = 4
SurfaceErrorInvalidSerial means Invalid serial number when acking a configure event
const SurfaceErrorInvalidSize = 5
SurfaceErrorInvalidSize means Width or height was zero or negative
const SurfaceErrorNotConstructed = 1
SurfaceErrorNotConstructed means Surface was not fully constructed
const SurfaceErrorUnconfiguredBuffer = 3
SurfaceErrorUnconfiguredBuffer means Attaching a buffer to an unconfigured surface
const ToplevelErrorInvalidParent = 1
ToplevelErrorInvalidParent means invalid parent toplevel
const ToplevelErrorInvalidResizeEdge = 0
ToplevelErrorInvalidResizeEdge means provided value is not a valid variant of the resize_edge enum
const ToplevelErrorInvalidSize = 2
ToplevelErrorInvalidSize means client provided an invalid min or max size
const ToplevelResizeEdgeBottom = 2
ToplevelResizeEdgeBottom
const ToplevelResizeEdgeBottomLeft = 6
ToplevelResizeEdgeBottomLeft
const ToplevelResizeEdgeBottomRight = 10
ToplevelResizeEdgeBottomRight
const ToplevelResizeEdgeLeft = 4
ToplevelResizeEdgeLeft
const ToplevelResizeEdgeNone = 0
ToplevelResizeEdgeNone
const ToplevelResizeEdgeRight = 8
ToplevelResizeEdgeRight
const ToplevelResizeEdgeTop = 1
ToplevelResizeEdgeTop
const ToplevelResizeEdgeTopLeft = 5
ToplevelResizeEdgeTopLeft
const ToplevelResizeEdgeTopRight = 9
ToplevelResizeEdgeTopRight
const ToplevelStateActivated = 4
ToplevelStateActivated means the surface is now activated
const ToplevelStateFullscreen = 2
ToplevelStateFullscreen means the surface is fullscreen
const ToplevelStateMaximized = 1
ToplevelStateMaximized means the surface is maximized
const ToplevelStateResizing = 3
ToplevelStateResizing means the surface is being resized
const ToplevelStateSuspended = 9
ToplevelStateSuspended
const ToplevelStateTiledBottom = 8
ToplevelStateTiledBottom
const ToplevelStateTiledLeft = 5
ToplevelStateTiledLeft
const ToplevelStateTiledRight = 6
ToplevelStateTiledRight
const ToplevelStateTiledTop = 7
ToplevelStateTiledTop
const ToplevelWmCapabilitiesFullscreen = 3
ToplevelWmCapabilitiesFullscreen means set_fullscreen and unset_fullscreen are available
const ToplevelWmCapabilitiesMaximize = 2
ToplevelWmCapabilitiesMaximize means set_maximized and unset_maximized are available
const ToplevelWmCapabilitiesMinimize = 4
ToplevelWmCapabilitiesMinimize means set_minimized is available
const ToplevelWmCapabilitiesWindowMenu = 1
ToplevelWmCapabilitiesWindowMenu means show_window_menu is available
const WmBaseErrorDefunctSurfaces = 1
WmBaseErrorDefunctSurfaces means xdg_wm_base was destroyed before children
const WmBaseErrorInvalidPopupParent = 3
WmBaseErrorInvalidPopupParent means the client specified an invalid popup parent surface
const WmBaseErrorInvalidPositioner = 5
WmBaseErrorInvalidPositioner means the client provided an invalid positioner
const WmBaseErrorInvalidSurfaceState = 4
WmBaseErrorInvalidSurfaceState means the client provided an invalid surface state
const WmBaseErrorNotTheTopmostPopup = 2
WmBaseErrorNotTheTopmostPopup means the client tried to map or destroy a non-topmost popup
const WmBaseErrorRole = 0
WmBaseErrorRole means given wl_surface has another role
const WmBaseErrorUnresponsive = 6
WmBaseErrorUnresponsive means the client didn’t respond to a ping event in time
Variables ¶
This section is empty.
Functions ¶
func ToplevelAddListener ¶
func ToplevelAddListener(tl *Toplevel, h ToplevelListener)
func WmBaseAddListener ¶
func WmBaseAddListener(s *WmBase, h WmBasePingHandler)
Types ¶
type Popup ¶
type Popup struct { BaseProxy // contains filtered or unexported fields }
Popup short-lived, popup surfaces for menus
func (*Popup) AddConfigureHandler ¶
func (p *Popup) AddConfigureHandler(h PopupConfigureHandler)
AddConfigureHandler removes the Configure handler
func (*Popup) AddPopupDoneHandler ¶
func (p *Popup) AddPopupDoneHandler(h PopupPopupDoneHandler)
AddPopupDoneHandler removes the PopupDone handler
func (*Popup) AddRepositionedHandler ¶
func (p *Popup) AddRepositionedHandler(h PopupRepositionedHandler)
AddRepositionedHandler removes the Repositioned handler
func (*Popup) RemoveConfigureHandler ¶
func (p *Popup) RemoveConfigureHandler(h PopupConfigureHandler)
RemoveConfigureHandler adds the Configure handler
func (*Popup) RemovePopupDoneHandler ¶
func (p *Popup) RemovePopupDoneHandler(h PopupPopupDoneHandler)
RemovePopupDoneHandler adds the PopupDone handler
func (*Popup) RemoveRepositionedHandler ¶
func (p *Popup) RemoveRepositionedHandler(h PopupRepositionedHandler)
RemoveRepositionedHandler adds the Repositioned handler
func (*Popup) Reposition ¶
func (p *Popup) Reposition(Positioner *Positioner, Token uint32) error
Reposition recalculate the popup's location
type PopupConfigureEvent ¶
type PopupConfigureEvent struct { // X is the x position relative to parent surface window geometry X int32 // Y is the y position relative to parent surface window geometry Y int32 // Width is the window geometry width Width int32 // Height is the window geometry height Height int32 }
PopupConfigureEvent is the configure the popup surface
type PopupConfigureHandler ¶
type PopupConfigureHandler interface {
HandlePopupConfigure(PopupConfigureEvent)
}
PopupConfigureHandler is the handler interface for PopupConfigureEvent
type PopupPopupDoneEvent ¶
type PopupPopupDoneEvent struct { }
PopupPopupDoneEvent is the popup interaction is done
type PopupPopupDoneHandler ¶
type PopupPopupDoneHandler interface {
HandlePopupPopupDone(PopupPopupDoneEvent)
}
PopupPopupDoneHandler is the handler interface for PopupPopupDoneEvent
type PopupRepositionedEvent ¶
type PopupRepositionedEvent struct { // Token is the reposition request token Token uint32 }
PopupRepositionedEvent is the signal the completion of a repositioned request
type PopupRepositionedHandler ¶
type PopupRepositionedHandler interface {
HandlePopupRepositioned(PopupRepositionedEvent)
}
PopupRepositionedHandler is the handler interface for PopupRepositionedEvent
type Positioner ¶
type Positioner struct {
BaseProxy
}
Positioner child surface positioner
func NewPositioner ¶
func NewPositioner(ctx *Context) *Positioner
NewPositioner is a constructor for the Positioner object
func (*Positioner) Destroy ¶
func (p *Positioner) Destroy() error
Destroy destroy the xdg_positioner object
func (*Positioner) Dispatch ¶
func (p *Positioner) Dispatch(event *Event)
Dispatch dispatches event for object Positioner
func (*Positioner) SetAnchor ¶
func (p *Positioner) SetAnchor(Anchor uint32) error
SetAnchor set anchor rectangle anchor
func (*Positioner) SetAnchorRect ¶
SetAnchorRect set the anchor rectangle within the parent surface
func (*Positioner) SetConstraintAdjustment ¶
func (p *Positioner) SetConstraintAdjustment(ConstraintAdjustment uint32) error
SetConstraintAdjustment set the adjustment to be done when constrained
func (*Positioner) SetGravity ¶
func (p *Positioner) SetGravity(Gravity uint32) error
SetGravity set child surface gravity
func (*Positioner) SetOffset ¶
func (p *Positioner) SetOffset(X int32, Y int32) error
SetOffset set surface position offset
func (*Positioner) SetParentConfigure ¶
func (p *Positioner) SetParentConfigure(Serial uint32) error
SetParentConfigure set parent configure this is a response to
func (*Positioner) SetParentSize ¶
func (p *Positioner) SetParentSize(ParentWidth int32, ParentHeight int32) error
SetParentSize
func (*Positioner) SetReactive ¶
func (p *Positioner) SetReactive() error
SetReactive continuously reconstrain the surface
type Surface ¶
type Surface struct { BaseProxy // contains filtered or unexported fields }
Surface desktop user interface surface base interface
func NewSurface ¶
NewSurface is a constructor for the Surface object
func (*Surface) AckConfigure ¶
AckConfigure ack a configure event
func (*Surface) AddConfigureHandler ¶
func (p *Surface) AddConfigureHandler(h SurfaceConfigureHandler)
AddConfigureHandler removes the Configure handler
func (*Surface) AddListener ¶
func (s *Surface) AddListener(h SurfaceConfigureHandler)
func (*Surface) GetPopup ¶
func (p *Surface) GetPopup(Parent *Surface, Positioner *Positioner) (*Popup, error)
GetPopup assign the xdg_popup surface role
func (*Surface) GetToplevel ¶
GetToplevel assign the xdg_toplevel surface role
func (*Surface) RemoveConfigureHandler ¶
func (p *Surface) RemoveConfigureHandler(h SurfaceConfigureHandler)
RemoveConfigureHandler adds the Configure handler
type SurfaceConfigureEvent ¶
type SurfaceConfigureEvent struct { // Serial is the serial of the configure event Serial uint32 }
SurfaceConfigureEvent is the suggest a surface change
type SurfaceConfigureHandler ¶
type SurfaceConfigureHandler interface {
HandleSurfaceConfigure(SurfaceConfigureEvent)
}
SurfaceConfigureHandler is the handler interface for SurfaceConfigureEvent
type Toplevel ¶
type Toplevel struct { BaseProxy // contains filtered or unexported fields }
Toplevel toplevel surface
func NewToplevel ¶
NewToplevel is a constructor for the Toplevel object
func (*Toplevel) AddCloseHandler ¶
func (p *Toplevel) AddCloseHandler(h ToplevelCloseHandler)
AddCloseHandler removes the Close handler
func (*Toplevel) AddConfigureBoundsHandler ¶
func (p *Toplevel) AddConfigureBoundsHandler(h ToplevelConfigureBoundsHandler)
AddConfigureBoundsHandler removes the ConfigureBounds handler
func (*Toplevel) AddConfigureHandler ¶
func (p *Toplevel) AddConfigureHandler(h ToplevelConfigureHandler)
AddConfigureHandler removes the Configure handler
func (*Toplevel) AddWmCapabilitiesHandler ¶
func (p *Toplevel) AddWmCapabilitiesHandler(h ToplevelWmCapabilitiesHandler)
AddWmCapabilitiesHandler removes the WmCapabilities handler
func (*Toplevel) RemoveCloseHandler ¶
func (p *Toplevel) RemoveCloseHandler(h ToplevelCloseHandler)
RemoveCloseHandler adds the Close handler
func (*Toplevel) RemoveConfigureBoundsHandler ¶
func (p *Toplevel) RemoveConfigureBoundsHandler(h ToplevelConfigureBoundsHandler)
RemoveConfigureBoundsHandler adds the ConfigureBounds handler
func (*Toplevel) RemoveConfigureHandler ¶
func (p *Toplevel) RemoveConfigureHandler(h ToplevelConfigureHandler)
RemoveConfigureHandler adds the Configure handler
func (*Toplevel) RemoveWmCapabilitiesHandler ¶
func (p *Toplevel) RemoveWmCapabilitiesHandler(h ToplevelWmCapabilitiesHandler)
RemoveWmCapabilitiesHandler adds the WmCapabilities handler
func (*Toplevel) SetFullscreen ¶
SetFullscreen set the window as fullscreen on an output
func (*Toplevel) SetMaxSize ¶
SetMaxSize set the maximum size
func (*Toplevel) SetMaximized ¶
SetMaximized maximize the window
func (*Toplevel) SetMinSize ¶
SetMinSize set the minimum size
func (*Toplevel) SetMinimized ¶
SetMinimized set the window as minimized
func (*Toplevel) ShowWindowMenu ¶
ShowWindowMenu show the window menu
func (*Toplevel) UnsetFullscreen ¶
UnsetFullscreen unset the window as fullscreen
func (*Toplevel) UnsetMaximized ¶
UnsetMaximized unmaximize the window
type ToplevelCloseEvent ¶
type ToplevelCloseEvent struct { }
ToplevelCloseEvent is the surface wants to be closed
type ToplevelCloseHandler ¶
type ToplevelCloseHandler interface {
HandleToplevelClose(ToplevelCloseEvent)
}
ToplevelCloseHandler is the handler interface for ToplevelCloseEvent
type ToplevelConfigureBoundsEvent ¶
type ToplevelConfigureBoundsEvent struct { // Width is the Width int32 // Height is the Height int32 }
ToplevelConfigureBoundsEvent is the recommended window geometry bounds
type ToplevelConfigureBoundsHandler ¶
type ToplevelConfigureBoundsHandler interface {
HandleToplevelConfigureBounds(ToplevelConfigureBoundsEvent)
}
ToplevelConfigureBoundsHandler is the handler interface for ToplevelConfigureBoundsEvent
type ToplevelConfigureEvent ¶
type ToplevelConfigureEvent struct { // Width is the Width int32 // Height is the Height int32 // States is the States []int32 }
ToplevelConfigureEvent is the suggest a surface change
type ToplevelConfigureHandler ¶
type ToplevelConfigureHandler interface {
HandleToplevelConfigure(ToplevelConfigureEvent)
}
ToplevelConfigureHandler is the handler interface for ToplevelConfigureEvent
type ToplevelListener ¶
type ToplevelListener interface { ToplevelConfigureHandler ToplevelCloseHandler }
type ToplevelWmCapabilitiesEvent ¶
type ToplevelWmCapabilitiesEvent struct { // Capabilities is the array of 32-bit capabilities Capabilities []int32 }
ToplevelWmCapabilitiesEvent is the compositor capabilities
type ToplevelWmCapabilitiesHandler ¶
type ToplevelWmCapabilitiesHandler interface {
HandleToplevelWmCapabilities(ToplevelWmCapabilitiesEvent)
}
ToplevelWmCapabilitiesHandler is the handler interface for ToplevelWmCapabilitiesEvent
type WmBase ¶
type WmBase struct { BaseProxy // contains filtered or unexported fields }
WmBase create desktop-style surfaces
func (*WmBase) AddPingHandler ¶
func (p *WmBase) AddPingHandler(h WmBasePingHandler)
AddPingHandler removes the Ping handler
func (*WmBase) CreatePositioner ¶
func (p *WmBase) CreatePositioner() (*Positioner, error)
CreatePositioner create a positioner object
func (*WmBase) GetSurface ¶
GetSurface create a shell surface from a surface
func (*WmBase) RemovePingHandler ¶
func (p *WmBase) RemovePingHandler(h WmBasePingHandler)
RemovePingHandler adds the Ping handler
type WmBasePingEvent ¶
type WmBasePingEvent struct { // Serial is the pass this to the pong request Serial uint32 }
WmBasePingEvent is the check if the client is alive
type WmBasePingHandler ¶
type WmBasePingHandler interface {
HandleWmBasePing(WmBasePingEvent)
}
WmBasePingHandler is the handler interface for WmBasePingEvent