xdg

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package xdg implements the stable XDG Window Manager Base protocol

Package xdg implements the xdg_shell protocol

Index

Constants

View Source
const PopupErrorInvalidGrab = 0

PopupErrorInvalidGrab means tried to grab after being mapped

View Source
const PositionerAnchorBottom = 2

PositionerAnchorBottom

View Source
const PositionerAnchorBottomLeft = 6

PositionerAnchorBottomLeft

View Source
const PositionerAnchorBottomRight = 8

PositionerAnchorBottomRight

View Source
const PositionerAnchorLeft = 3

PositionerAnchorLeft

View Source
const PositionerAnchorNone = 0

PositionerAnchorNone

View Source
const PositionerAnchorRight = 4

PositionerAnchorRight

View Source
const PositionerAnchorTop = 1

PositionerAnchorTop

View Source
const PositionerAnchorTopLeft = 5

PositionerAnchorTopLeft

View Source
const PositionerAnchorTopRight = 7

PositionerAnchorTopRight

View Source
const PositionerConstraintAdjustmentFlipX = 4

PositionerConstraintAdjustmentFlipX

View Source
const PositionerConstraintAdjustmentFlipY = 8

PositionerConstraintAdjustmentFlipY

View Source
const PositionerConstraintAdjustmentNone = 0

PositionerConstraintAdjustmentNone

View Source
const PositionerConstraintAdjustmentResizeX = 16

PositionerConstraintAdjustmentResizeX

View Source
const PositionerConstraintAdjustmentResizeY = 32

PositionerConstraintAdjustmentResizeY

View Source
const PositionerConstraintAdjustmentSlideX = 1

PositionerConstraintAdjustmentSlideX

View Source
const PositionerConstraintAdjustmentSlideY = 2

PositionerConstraintAdjustmentSlideY

View Source
const PositionerErrorInvalidInput = 0

PositionerErrorInvalidInput means invalid input provided

View Source
const PositionerGravityBottom = 2

PositionerGravityBottom

View Source
const PositionerGravityBottomLeft = 6

PositionerGravityBottomLeft

View Source
const PositionerGravityBottomRight = 8

PositionerGravityBottomRight

View Source
const PositionerGravityLeft = 3

PositionerGravityLeft

View Source
const PositionerGravityNone = 0

PositionerGravityNone

View Source
const PositionerGravityRight = 4

PositionerGravityRight

View Source
const PositionerGravityTop = 1

PositionerGravityTop

View Source
const PositionerGravityTopLeft = 5

PositionerGravityTopLeft

View Source
const PositionerGravityTopRight = 7

PositionerGravityTopRight

View Source
const SurfaceErrorAlreadyConstructed = 2

SurfaceErrorAlreadyConstructed means Surface was already constructed

View Source
const SurfaceErrorDefunctRoleObject = 6

SurfaceErrorDefunctRoleObject means Surface was destroyed before its role object

View Source
const SurfaceErrorInvalidSerial = 4

SurfaceErrorInvalidSerial means Invalid serial number when acking a configure event

View Source
const SurfaceErrorInvalidSize = 5

SurfaceErrorInvalidSize means Width or height was zero or negative

View Source
const SurfaceErrorNotConstructed = 1

SurfaceErrorNotConstructed means Surface was not fully constructed

View Source
const SurfaceErrorUnconfiguredBuffer = 3

SurfaceErrorUnconfiguredBuffer means Attaching a buffer to an unconfigured surface

View Source
const ToplevelErrorInvalidParent = 1

ToplevelErrorInvalidParent means invalid parent toplevel

View Source
const ToplevelErrorInvalidResizeEdge = 0

ToplevelErrorInvalidResizeEdge means provided value is not a valid variant of the resize_edge enum

View Source
const ToplevelErrorInvalidSize = 2

ToplevelErrorInvalidSize means client provided an invalid min or max size

View Source
const ToplevelResizeEdgeBottom = 2

ToplevelResizeEdgeBottom

View Source
const ToplevelResizeEdgeBottomLeft = 6

ToplevelResizeEdgeBottomLeft

View Source
const ToplevelResizeEdgeBottomRight = 10

ToplevelResizeEdgeBottomRight

View Source
const ToplevelResizeEdgeLeft = 4

ToplevelResizeEdgeLeft

View Source
const ToplevelResizeEdgeNone = 0

ToplevelResizeEdgeNone

View Source
const ToplevelResizeEdgeRight = 8

ToplevelResizeEdgeRight

View Source
const ToplevelResizeEdgeTop = 1

ToplevelResizeEdgeTop

View Source
const ToplevelResizeEdgeTopLeft = 5

ToplevelResizeEdgeTopLeft

View Source
const ToplevelResizeEdgeTopRight = 9

ToplevelResizeEdgeTopRight

View Source
const ToplevelStateActivated = 4

ToplevelStateActivated means the surface is now activated

View Source
const ToplevelStateFullscreen = 2

ToplevelStateFullscreen means the surface is fullscreen

View Source
const ToplevelStateMaximized = 1

ToplevelStateMaximized means the surface is maximized

View Source
const ToplevelStateResizing = 3

ToplevelStateResizing means the surface is being resized

View Source
const ToplevelStateSuspended = 9

ToplevelStateSuspended

View Source
const ToplevelStateTiledBottom = 8

ToplevelStateTiledBottom

View Source
const ToplevelStateTiledLeft = 5

ToplevelStateTiledLeft

View Source
const ToplevelStateTiledRight = 6

ToplevelStateTiledRight

View Source
const ToplevelStateTiledTop = 7

ToplevelStateTiledTop

View Source
const ToplevelWmCapabilitiesFullscreen = 3

ToplevelWmCapabilitiesFullscreen means set_fullscreen and unset_fullscreen are available

View Source
const ToplevelWmCapabilitiesMaximize = 2

ToplevelWmCapabilitiesMaximize means set_maximized and unset_maximized are available

View Source
const ToplevelWmCapabilitiesMinimize = 4

ToplevelWmCapabilitiesMinimize means set_minimized is available

View Source
const ToplevelWmCapabilitiesWindowMenu = 1

ToplevelWmCapabilitiesWindowMenu means show_window_menu is available

View Source
const WmBaseErrorDefunctSurfaces = 1

WmBaseErrorDefunctSurfaces means xdg_wm_base was destroyed before children

View Source
const WmBaseErrorInvalidPopupParent = 3

WmBaseErrorInvalidPopupParent means the client specified an invalid popup parent surface

View Source
const WmBaseErrorInvalidPositioner = 5

WmBaseErrorInvalidPositioner means the client provided an invalid positioner

View Source
const WmBaseErrorInvalidSurfaceState = 4

WmBaseErrorInvalidSurfaceState means the client provided an invalid surface state

View Source
const WmBaseErrorNotTheTopmostPopup = 2

WmBaseErrorNotTheTopmostPopup means the client tried to map or destroy a non-topmost popup

View Source
const WmBaseErrorRole = 0

WmBaseErrorRole means given wl_surface has another role

View Source
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 BaseProxy

type BaseProxy = wl.BaseProxy

type Context

type Context = wl.Context

type Event

type Event = wl.Event

type Output

type Output = wl.Output
type Popup struct {
	BaseProxy
	// contains filtered or unexported fields
}

Popup short-lived, popup surfaces for menus

func NewPopup

func NewPopup(ctx *Context) *Popup

NewPopup is a constructor for the Popup object

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) Destroy

func (p *Popup) Destroy() error

Destroy remove xdg_popup interface

func (*Popup) Dispatch

func (p *Popup) Dispatch(event *Event)

Dispatch dispatches event for object Popup

func (*Popup) Grab

func (p *Popup) Grab(Seat *Seat, Serial uint32) error

Grab make the popup take an explicit grab

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

func (p *Positioner) SetAnchorRect(X int32, Y int32, Width int32, Height int32) error

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

func (*Positioner) SetSize

func (p *Positioner) SetSize(Width int32, Height int32) error

SetSize set the size of the to-be positioned rectangle

type Proxy

type Proxy = wl.Proxy

type Seat

type Seat = wl.Seat

type Surface

type Surface struct {
	BaseProxy
	// contains filtered or unexported fields
}

Surface desktop user interface surface base interface

func NewSurface

func NewSurface(ctx *Context) *Surface

NewSurface is a constructor for the Surface object

func (*Surface) AckConfigure

func (p *Surface) AckConfigure(Serial uint32) error

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) Destroy

func (p *Surface) Destroy() error

Destroy destroy the xdg_surface

func (*Surface) Dispatch

func (p *Surface) Dispatch(event *Event)

Dispatch dispatches event for object Surface

func (*Surface) GetPopup

func (p *Surface) GetPopup(Parent *Surface, Positioner *Positioner) (*Popup, error)

GetPopup assign the xdg_popup surface role

func (*Surface) GetToplevel

func (p *Surface) GetToplevel() (*Toplevel, error)

GetToplevel assign the xdg_toplevel surface role

func (*Surface) RemoveConfigureHandler

func (p *Surface) RemoveConfigureHandler(h SurfaceConfigureHandler)

RemoveConfigureHandler adds the Configure handler

func (*Surface) SetWindowGeometry

func (p *Surface) SetWindowGeometry(X int32, Y int32, Width int32, Height int32) error

SetWindowGeometry set the new window geometry

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

func NewToplevel(ctx *Context) *Toplevel

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) Destroy

func (p *Toplevel) Destroy() error

Destroy destroy the xdg_toplevel

func (*Toplevel) Dispatch

func (p *Toplevel) Dispatch(event *Event)

Dispatch dispatches event for object Toplevel

func (*Toplevel) Move

func (p *Toplevel) Move(Seat *Seat, Serial uint32) error

Move start an interactive move

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) Resize

func (p *Toplevel) Resize(Seat *Seat, Serial uint32, Edges uint32) error

Resize start an interactive resize

func (*Toplevel) SetAppId

func (p *Toplevel) SetAppId(AppId string) error

SetAppId set application ID

func (*Toplevel) SetFullscreen

func (p *Toplevel) SetFullscreen(Output *Output) error

SetFullscreen set the window as fullscreen on an output

func (*Toplevel) SetMaxSize

func (p *Toplevel) SetMaxSize(Width int32, Height int32) error

SetMaxSize set the maximum size

func (*Toplevel) SetMaximized

func (p *Toplevel) SetMaximized() error

SetMaximized maximize the window

func (*Toplevel) SetMinSize

func (p *Toplevel) SetMinSize(Width int32, Height int32) error

SetMinSize set the minimum size

func (*Toplevel) SetMinimized

func (p *Toplevel) SetMinimized() error

SetMinimized set the window as minimized

func (*Toplevel) SetParent

func (p *Toplevel) SetParent(Parent *Toplevel) error

SetParent set the parent of this surface

func (*Toplevel) SetTitle

func (p *Toplevel) SetTitle(Title string) error

SetTitle set surface title

func (*Toplevel) ShowWindowMenu

func (p *Toplevel) ShowWindowMenu(Seat *Seat, Serial uint32, X int32, Y int32) error

ShowWindowMenu show the window menu

func (*Toplevel) UnsetFullscreen

func (p *Toplevel) UnsetFullscreen() error

UnsetFullscreen unset the window as fullscreen

func (*Toplevel) UnsetMaximized

func (p *Toplevel) UnsetMaximized() error

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 WlSurface

type WlSurface = wl.Surface

type WmBase

type WmBase struct {
	BaseProxy
	// contains filtered or unexported fields
}

WmBase create desktop-style surfaces

func NewShell

func NewShell(ctx *Context) *WmBase

func NewWmBase

func NewWmBase(ctx *Context) *WmBase

NewWmBase is a constructor for the WmBase object

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) Destroy

func (p *WmBase) Destroy() error

Destroy destroy xdg_wm_base

func (*WmBase) Dispatch

func (p *WmBase) Dispatch(event *Event)

Dispatch dispatches event for object WmBase

func (*WmBase) GetSurface

func (p *WmBase) GetSurface(Surface *WlSurface) (*Surface, error)

GetSurface create a shell surface from a surface

func (*WmBase) Pong

func (p *WmBase) Pong(Serial uint32) error

Pong respond to a ping event

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL