wayland

package
v0.0.0-...-554ea94 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

README

In this package, we provide utilities for working with Wayland protocol over Unix domain sockets. This will hopefully be a reusable package for custom go Wayland compositors (that I will use at least).

Documentation

Overview

Package wayland provides a pure Go implementation of a Wayland compositor.

This package allows you to create Wayland servers that can host Wayland clients (such as browsers, terminals, and other applications) and render their output to your own display surface.

Basic Usage

To create a Wayland compositor, you need to:

  1. Create a socket listener with MakeSocketListener
  2. Accept client connections
  3. Handle frame requests and render client surfaces

Minimal Example

First, implement the args interface to provide the display name:

type Args struct {
	DisplayName string
}

func (a *Args) WaylandDisplayName() string {
	return a.DisplayName // empty string auto-generates a name
}

Create the socket listener and start accepting connections:

args := &Args{DisplayName: ""}
listener, err := wayland.MakeSocketListener(args)
if err != nil {
	log.Fatal(err)
}
go listener.MainLoopThenClose()

// Track connected clients
var clients []*wayland.Client
var mu sync.Mutex

// Accept new client connections
go func() {
	for conn := range listener.OnConnection {
		client := wayland.MakeClient(conn)
		mu.Lock()
		clients = append(clients, client)
		mu.Unlock()
		go client.MainLoop()
		go handleFrameRequests(client)
	}
}()

Handle frame callbacks to know when clients want to redraw:

func handleFrameRequests(client *wayland.Client) {
	for callbackID := range client.FrameDrawRequests {
		protocols.WlCallback_done(client, callbackID, uint32(time.Now().UnixMilli()))
		if client.Status != wayland.ClientStatus_Connected {
			break
		}
		// Signal your render loop that a redraw is needed
	}
}

Create a desktop for compositing and render in your main loop:

desktop := wayland.MakeDesktop(
	wayland.Size{Width: 800, Height: 600},
	false,     // useLinuxDMABuf
	iconPNG,   // icon data for the desktop
)

// In your render loop:
desktop.DrawClients(clients)
// desktop.Buffer now contains RGBA pixel data
// desktop.Stride is the row stride in bytes

Forward input events to clients:

// Mouse movement (x, y in surface coordinates)
wayland.SendPointerMotion(clients, float32(x), float32(y))

// Mouse buttons (use Linux BTN_LEFT=0x110, BTN_RIGHT=0x111, etc.)
wayland.SendPointerButton(clients, 0x110, true)  // pressed
wayland.SendPointerButton(clients, 0x110, false) // released

// Mouse scroll (axis: protocols.WlPointerAxis_enum_vertical_scroll)
wayland.SendPointerAxis(clients, protocols.WlPointerAxis_enum_vertical_scroll, 15.0)

// Keyboard (use Linux evdev keycodes, e.g., 30 for 'A')
wayland.SendKeyboardKey(clients, 30, true)  // key down
wayland.SendKeyboardKey(clients, 30, false) // key up

Launch a Wayland client with the correct environment:

cmd := exec.Command("weston-terminal")
cmd.Env = append(os.Environ(),
	"WAYLAND_DISPLAY="+listener.WaylandDisplayName,
	"XDG_SESSION_TYPE=wayland",
)
cmd.Start()

Assuming surface.Role has a Data field that can be set to nil

Index

Constants

View Source
const (
	GetMessage_timeout      = 1 * time.Millisecond
	GetMessage_maxFDsInCmsg = 10  // matches C++: CMSG_SPACE(sizeof(int) * 10)
	GetMessage_hardFDLimit  = 255 // matches C++ guard in the copy loop
	GetMessage_intSizeBytes = 4   // sizeof(int) on Linux
)

Variables

View Source
var GlobalEnterSerial uint32 = 0
View Source
var Global_WlCompositor = MakeWlCompositor()
View Source
var Global_WlDataDevice = Global_WlSeat
View Source
var Global_WlDataDeviceManager = MakeWlDataDeviceManager()
View Source
var Global_WlDisplay = MakeWLDisplay()
View Source
var Global_WlKeyboard = MakeWlKeyboard()
View Source
var Global_WlOutput = MakeWlOutput()
View Source
var Global_WlPointer = &protocols.WlPointer{
	Delegate: &Pointer,
}
View Source
var Global_WlSeat = MakeWLSeat()
View Source
var Global_WlShm = MakeWlShm()
View Source
var Global_WlSubcompositor = MakeWlSubcompositor()
View Source
var Global_WlTouch = MakeWlTouch()
View Source
var Global_XdgWmBase = MakeXdgWmBase()
View Source
var Global_XwaylandShellV1 = MakeXwaylandShellV1()
View Source
var Global_ZwpXwaylandKeyboardGrabManagerV1 = MakeZwpXwaylandKeyboardGrabManagerV1()
View Source
var Global_ZxdgDecorationManagerV1 = MakeZxdgDecorationManagerV1()
View Source
var Pointer = WlPointer{
	PointerSurfaceID: make(map[protocols.ClientState]*protocols.ObjectID[protocols.WlSurface]),
}
View Source
var VirtualMonitorSize = PixelSize{
	Width:  640,
	Height: 480,
}

Functions

func AddObject

func AddObject[T any](cs protocols.ClientState, id protocols.ObjectID[T], v *T)

func AreSame

func AreSame[T comparable](a, b *T) bool

func CopyBufferToWlSurfaceTexture

func CopyBufferToWlSurfaceTexture(
	s protocols.ClientState,
	surfaceID protocols.ObjectID[protocols.WlSurface],
	zIndex int,
	maybebufferID *protocols.ObjectID[protocols.WlBuffer],
)

func DecodeIconToNRGBA

func DecodeIconToNRGBA(data []byte) *image.NRGBA

func GetMessageAndFileDescriptors

func GetMessageAndFileDescriptors(conn *net.UnixConn, buf []byte) (n int, fds []int, err error)

func GetNextEventSerial

func GetNextEventSerial() uint32

func GetSocketPathFromName

func GetSocketPathFromName(socketName string) string

func GetWaylandDisplayName

func GetWaylandDisplayName(args HasDisplayName) string

func ListenToWaylandSocket

func ListenToWaylandSocket(socketName string, socketPath string) (listner *net.UnixListener, fd int, e error)

func MakeWLDisplay

func MakeWLDisplay() *protocols.WlDisplay

func MakeWLSeat

func MakeWLSeat() *protocols.WlSeat

func MakeWlCompositor

func MakeWlCompositor() *protocols.WlCompositor

func MakeWlDataDevice

func MakeWlDataDevice(seat protocols.ObjectID[protocols.WlSeat]) *wl_data_device

func MakeWlDataDeviceManager

func MakeWlDataDeviceManager() *protocols.WlDataDeviceManager

func MakeWlDataSource

func MakeWlDataSource() *protocols.WlDataSource

func MakeWlKeyboard

func MakeWlKeyboard() *protocols.WlKeyboard

func MakeWlOutput

func MakeWlOutput() *protocols.WlOutput

func MakeWlPointer

func MakeWlPointer() *protocols.WlPointer

func MakeWlRegion

func MakeWlRegion() *protocols.WlRegion

func MakeWlRegistry

func MakeWlRegistry() *protocols.WlRegistry

func MakeWlShm

func MakeWlShm() *protocols.WlShm

Helper to construct a protocol object with this delegate (like static make() in TS)

func MakeWlShmPool

func MakeWlShmPool(
	client protocols.ClientState,
	wlShmPoolObjectID protocols.ObjectID[protocols.WlShmPool],
	fd protocols.FileDescriptor,
	size int32,
) *protocols.WlShmPool

func MakeWlSubcompositor

func MakeWlSubcompositor() *protocols.WlSubcompositor

func MakeWlSubsurface

func MakeWlSubsurface(parent protocols.ObjectID[protocols.WlSurface]) *protocols.WlSubsurface

Constructor (literal to TS `static make(parent)` style)

func MakeWlSurface

func MakeWlSurface() *protocols.WlSurface

Constructor

func MakeWlTouch

func MakeWlTouch() *protocols.WlTouch

func MakeXdgPopup

func MakeXdgPopup(
	version uint32,
	parent *protocols.ObjectID[protocols.XdgSurface],
	state XdgPositionerState,
) *protocols.XdgPopup

func MakeXdgPositioner

func MakeXdgPositioner() *protocols.XdgPositioner

func MakeXdgSurface

func MakeXdgSurface(version uint32, xdg_surface_id protocols.ObjectID[protocols.XdgSurface]) *protocols.XdgSurface

func MakeXdgToplevel

func MakeXdgToplevel() *protocols.XdgToplevel

func MakeXdgWmBase

func MakeXdgWmBase() *protocols.XdgWmBase

func MakeXwaylandShellV1

func MakeXwaylandShellV1() *protocols.XwaylandShellV1

func MakeXwaylandSurfaceV1

func MakeXwaylandSurfaceV1() *protocols.XwaylandSurfaceV1

func MakeZwpXwaylandKeyboardGrabManagerV1

func MakeZwpXwaylandKeyboardGrabManagerV1() *protocols.ZwpXwaylandKeyboardGrabManagerV1

func MakeZwpXwaylandKeyboardGrabV1

func MakeZwpXwaylandKeyboardGrabV1() *protocols.ZwpXwaylandKeyboardGrabV1

func MakeZxdgDecorationManagerV1

func MakeZxdgDecorationManagerV1() *protocols.ZxdgDecorationManagerV1

func RegisterRoleToSurface

func RegisterRoleToSurface[T RoleOrXDGSurfaceObjectID](cs protocols.ClientState, roleID T, surfaceID protocols.ObjectID[protocols.WlSurface])

func RemoveObject

func RemoveObject[T any](cs protocols.ClientState, id protocols.ObjectID[T])

func RgbaToBgra

func RgbaToBgra(src *image.NRGBA) *image.NRGBA

func SendError

func SendError[T any, U ~uint32 | ~uint8](cs protocols.ClientState, id protocols.ObjectID[T], code U, message string)

func SendKeyboardKey

func SendKeyboardKey(clients []*Client, key uint32, pressed bool)

func SendMessageAndFileDescriptors

func SendMessageAndFileDescriptors(conn *net.UnixConn, buf []byte, fds []int) error

func SendPointerAxis

func SendPointerAxis(clients []*Client, axis protocols.WlPointerAxis_enum, value float32)

func SendPointerButton

func SendPointerButton(clients []*Client, button uint32, pressed bool)

func SendPointerMotion

func SendPointerMotion(clients []*Client, x, y float32)

func ToBytes

func ToBytes[T ~uint8 | ~uint32](a []T) []byte

func UnregisterRoleToSurface

func UnregisterRoleToSurface[T RoleOrXDGSurfaceObjectID](cs protocols.ClientState, id T)

Types

type BufferInfo

type BufferInfo struct {
	Offset int32
	Width  int32
	Height int32
	Stride int32
	Format protocols.WlShmFormat_enum
}

type ChildPosition

type ChildPosition struct {
	Child protocols.ObjectID[protocols.WlSurface]
	X     int32
	Y     int32
}

ChildPosition mirrors { child: Object_ID<wl_surface>; x: number; y: number }

type Client

type Client struct {
	Status ClientStatus

	UnixConnection *net.UnixConn

	CompositorVersion uint32

	DisplayID protocols.ObjectID[protocols.WlDisplay]

	OutgoingChannel chan protocols.OutgoingEvent

	Decoder *MessageDecoder

	UnclaimedFDs []protocols.FileDescriptor

	Objects map[protocols.AnyObjectID]any

	RolesToSurfaces map[protocols.AnyObjectID]protocols.ObjectID[protocols.WlSurface]

	FrameDrawRequests chan protocols.ObjectID[protocols.WlCallback]

	GlobalBinds map[protocols.GlobalID]any

	LastGetMessageTime time.Time

	Access sync.Mutex
	// contains filtered or unexported fields
}

func MakeClient

func MakeClient(conn *net.UnixConn) *Client

func (*Client) AddFrameDrawRequest

func (c *Client) AddFrameDrawRequest(cb protocols.ObjectID[protocols.WlCallback])

func (*Client) AddGlobalWlDataDeviceBind

func (c *Client) AddGlobalWlDataDeviceBind(objectID protocols.ObjectID[protocols.WlDataDevice], version protocols.Version)

func (*Client) AddGlobalWlKeyboardBind

func (c *Client) AddGlobalWlKeyboardBind(objectID protocols.ObjectID[protocols.WlKeyboard], version protocols.Version)

func (*Client) AddGlobalWlOutputBind

func (c *Client) AddGlobalWlOutputBind(objectID protocols.ObjectID[protocols.WlOutput], version protocols.Version)

func (*Client) AddGlobalWlPointerBind

func (c *Client) AddGlobalWlPointerBind(objectID protocols.ObjectID[protocols.WlPointer], version protocols.Version)

func (*Client) AddGlobalWlSeatBind

func (c *Client) AddGlobalWlSeatBind(objectID protocols.ObjectID[protocols.WlSeat], version protocols.Version)

func (*Client) AddGlobalWlShmBind

func (c *Client) AddGlobalWlShmBind(objectID protocols.ObjectID[protocols.WlShm], version protocols.Version)

func (*Client) AddGlobalWlTouchBind

func (c *Client) AddGlobalWlTouchBind(objectID protocols.ObjectID[protocols.WlTouch], version protocols.Version)

func (*Client) AddGlobalZwpXwaylandKeyboardGrabManagerV1Bind

func (c *Client) AddGlobalZwpXwaylandKeyboardGrabManagerV1Bind(objectID protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1], version protocols.Version)

func (*Client) AddObject

func (c *Client) AddObject(id protocols.AnyObjectID, v any)

func (*Client) ClaimFileDescriptor

func (c *Client) ClaimFileDescriptor() *protocols.FileDescriptor

func (*Client) DrawableSurfaces

func (c *Client) DrawableSurfaces() map[protocols.ObjectID[protocols.WlSurface]]bool

func (*Client) FindDescendantSurface

func (c *Client) FindDescendantSurface(surfaceID protocols.ObjectID[protocols.WlSurface], maybeDescendantID protocols.ObjectID[protocols.WlSurface]) bool

*

  • Seed if maybe_desceneding_id is a descendant of surface_id
  • @param s
  • @param surface_id
  • @param maybe_descendant_id

func (*Client) GetCompositorVersion

func (c *Client) GetCompositorVersion() uint32

func (*Client) GetGlobalBinds

func (c *Client) GetGlobalBinds(globalID protocols.GlobalID) any

func (*Client) GetGlobalObjectByID

func (c *Client) GetGlobalObjectByID(globalID uint32) any

func (*Client) GetObject

func (c *Client) GetObject(id protocols.AnyObjectID) any

func (*Client) GetSurfaceFromRole

func (c *Client) GetSurfaceFromRole(roleObjectID protocols.AnyObjectID) any

func (*Client) GetSurfaceIDFromRole

func (c *Client) GetSurfaceIDFromRole(roleObjectID protocols.AnyObjectID) *protocols.ObjectID[protocols.WlSurface]

func (*Client) MainLoop

func (c *Client) MainLoop() error

func (*Client) ParseMessages

func (c *Client) ParseMessages(n int, fds []int) error

func (*Client) RegisterRoleToSurface

func (c *Client) RegisterRoleToSurface(roleID protocols.AnyObjectID, surfaceID protocols.ObjectID[protocols.WlSurface])

func (*Client) RemoveGlobalWlDataDeviceBind

func (c *Client) RemoveGlobalWlDataDeviceBind(objectID protocols.ObjectID[protocols.WlDataDevice])

func (*Client) RemoveGlobalWlKeyboardBind

func (c *Client) RemoveGlobalWlKeyboardBind(objectID protocols.ObjectID[protocols.WlKeyboard])

func (*Client) RemoveGlobalWlOutputBind

func (c *Client) RemoveGlobalWlOutputBind(objectID protocols.ObjectID[protocols.WlOutput])

func (*Client) RemoveGlobalWlPointerBind

func (c *Client) RemoveGlobalWlPointerBind(objectID protocols.ObjectID[protocols.WlPointer])

func (*Client) RemoveGlobalWlSeatBind

func (c *Client) RemoveGlobalWlSeatBind(objectID protocols.ObjectID[protocols.WlSeat])

func (*Client) RemoveGlobalWlShmBind

func (c *Client) RemoveGlobalWlShmBind(objectID protocols.ObjectID[protocols.WlShm])

func (*Client) RemoveGlobalWlTouchBind

func (c *Client) RemoveGlobalWlTouchBind(objectID protocols.ObjectID[protocols.WlTouch])

func (*Client) RemoveGlobalZwpXwaylandKeyboardGrabManagerV1Bind

func (c *Client) RemoveGlobalZwpXwaylandKeyboardGrabManagerV1Bind(objectID protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1])

func (*Client) RemoveObject

func (c *Client) RemoveObject(id protocols.AnyObjectID)

func (*Client) Send

func (c *Client) Send(ev protocols.OutgoingEvent)

func (*Client) SendError

func (c *Client) SendError(objectID protocols.AnyObjectID, code uint32, message string)

func (*Client) SendPendingMessage

func (c *Client) SendPendingMessage(ev protocols.OutgoingEvent) error

*

*
* @param message
* @returns Returns if we should continue listening or sending on this socket any more
* returns falsy mostly if the client has disconnected

func (*Client) SetCompositorVersion

func (c *Client) SetCompositorVersion(v uint32)

func (*Client) TopLevelSurfaces

func (c *Client) TopLevelSurfaces() map[protocols.ObjectID[protocols.XdgToplevel]]bool

func (*Client) UnregisterRoleToSurface

func (c *Client) UnregisterRoleToSurface(roleID protocols.AnyObjectID)

type ClientStatus

type ClientStatus int
const (
	ClientStatus_Connected    ClientStatus = 0
	ClientStatus_Disconnected ClientStatus = 2
)

type CursorHotspot

type CursorHotspot struct {
	X, Y int32
}

type Desktop

type Desktop struct {
	Width  int
	Height int
	Stride int // bytes per row (Width * 4)

	// Back buffer as image.RGBA (Pix backed by Buffer)
	Buffer []byte
	RGBA   *image.RGBA

	IconImg *image.NRGBA

	CreatedAt                 time.Time
	WillShowAppRightAtStartup bool
}

func MakeDesktop

func MakeDesktop(size Size, willShowAppRightAtStartup bool, iconPNG []byte) *Desktop

func (*Desktop) AfterOpeningTimeout

func (cd *Desktop) AfterOpeningTimeout() bool

* If we will show an app right at startup,

  • we want to wait a bit before potentially
  • drawing the icon. Otherwise it will
  • flash the icon, and the show the app
  • content which is annoying. *

func (*Desktop) Clear

func (cd *Desktop) Clear()

func (*Desktop) DrawClients

func (cd *Desktop) DrawClients(clients []*Client)

func (*Desktop) DrawImage

func (cd *Desktop) DrawImage(src image.Image, dx, dy int)

type HasDisplayName

type HasDisplayName interface {
	WaylandDisplayName() string
}

type MapState

type MapState int
const (
	MapStateDestroyed MapState = iota
	MapStateMmapped
	MapStateDestroyWhenBuffersEmpty
)

type MemMapInfo

type MemMapInfo struct {
	Bytes          []byte
	Addr           unsafe.Pointer
	Size           C.size_t
	FileDescriptor C.int
	UnMapped       bool
}

func NewMemMapInfo

func NewMemMapInfo(fd int, size uint64) (MemMapInfo, error)

func (*MemMapInfo) Unmap

func (m *MemMapInfo) Unmap()

type MessageDecoder

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

func MakeMessageDecoder

func MakeMessageDecoder() *MessageDecoder

func (*MessageDecoder) Consume

func (d *MessageDecoder) Consume(buf []byte) []protocols.Message

type PendingBufferUpdates

type PendingBufferUpdates struct {
	Surface protocols.ObjectID[protocols.WlSurface]
	Buffer  *protocols.ObjectID[protocols.WlBuffer]
	ZIndex  int
}

func ApplyWlSurfaceDoubleBufferedState

func ApplyWlSurfaceDoubleBufferedState(
	s protocols.ClientState,
	surfaceObjectID protocols.ObjectID[protocols.WlSurface],
	syncSetByParent bool,
	accumulator []PendingBufferUpdates,
	zIndex int,
) []PendingBufferUpdates

type PendingToplevelState

type PendingToplevelState struct {
	MaxSize *Size
	MinSize *Size
}

type PixelSize

type PixelSize struct {
	Width  Pixels
	Height Pixels
}

type Pixels

type Pixels int

type Point

type Point struct {
	X int32
	Y int32
}

type Rect

type Rect struct {
	X      int32
	Y      int32
	Width  int32
	Height int32
}

type Size

type Size struct {
	Width  uint32
	Height uint32
}

type SocketListener

type SocketListener struct {
	WaylandDisplayName string
	SocketPath         string
	Listener           *net.UnixListener

	OnConnection chan *net.UnixConn
}

SocketListener listens for new Wayland client connections on a Unix socket. It provides a channel to receive new connections. Whoevere reads from the channel is responsible for closing the connections when done.

func MakeSocketListener

func MakeSocketListener(args HasDisplayName) (*SocketListener, error)

func (*SocketListener) Close

func (w *SocketListener) Close() error

func (*SocketListener) MainLoop

func (w *SocketListener) MainLoop() error

func (*SocketListener) MainLoopThenClose

func (w *SocketListener) MainLoopThenClose() error

type SortedSurfaceEntry

type SortedSurfaceEntry struct {
	Surface   *WlSurface
	Src       *image.RGBA
	SurfaceID protocols.ObjectID[protocols.WlSurface]
}

type SortedSurfaceEntryParentLocation

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

type SurfaceRole

type SurfaceRole interface {
	HasData() bool
	ClearData()
	// contains filtered or unexported methods
}

*

  • Surface roles can be thought of as type.
  • [source ](https://wayland.app/protocols/wayland#wl_surface)
  • Things you may do:
  • 1. if unset you may assign it a role
  • 2. if assigned a role you may *not* change it to another role
  • 3. if assigned a role you may *may* assign it the *same* role
  • 4. The role may destroyed, allowing you assign it to the role again (maybe with different data), but not a different role.
  • 5. If the surface is destroyed before the role is destroyed, that is an error.

type SurfaceRoleCursor

type SurfaceRoleCursor struct {
	Data *SurfaceRoleCursorData
}

func (*SurfaceRoleCursor) ClearData

func (r *SurfaceRoleCursor) ClearData()

func (*SurfaceRoleCursor) HasData

func (r *SurfaceRoleCursor) HasData() bool

type SurfaceRoleCursorData

type SurfaceRoleCursorData struct {
	Hotspot CursorHotspot
}

type SurfaceRoleSubSurface

type SurfaceRoleSubSurface struct {
	Data *protocols.ObjectID[protocols.WlSubsurface]
}

func (*SurfaceRoleSubSurface) ClearData

func (r *SurfaceRoleSubSurface) ClearData()

func (*SurfaceRoleSubSurface) HasData

func (r *SurfaceRoleSubSurface) HasData() bool

type SurfaceRoleWaylandSurfaceData

type SurfaceRoleWaylandSurfaceData struct {
	Serial *XWaylandSurfaceV1Serial
}

type SurfaceRoleXWaylandSurface

type SurfaceRoleXWaylandSurface struct {
	Data *SurfaceRoleWaylandSurfaceData
}

func (*SurfaceRoleXWaylandSurface) ClearData

func (r *SurfaceRoleXWaylandSurface) ClearData()

func (*SurfaceRoleXWaylandSurface) HasData

func (r *SurfaceRoleXWaylandSurface) HasData() bool

type SurfaceRoleXdgPopup

type SurfaceRoleXdgPopup struct {
	Data *protocols.ObjectID[protocols.XdgPopup]
}

func (*SurfaceRoleXdgPopup) ClearData

func (r *SurfaceRoleXdgPopup) ClearData()

func (*SurfaceRoleXdgPopup) HasData

func (r *SurfaceRoleXdgPopup) HasData() bool

type SurfaceRoleXdgToplevel

type SurfaceRoleXdgToplevel struct {
	Data *protocols.ObjectID[protocols.XdgToplevel]
}

func (*SurfaceRoleXdgToplevel) ClearData

func (r *SurfaceRoleXdgToplevel) ClearData()

func (*SurfaceRoleXdgToplevel) HasData

func (r *SurfaceRoleXdgToplevel) HasData() bool

type SurfaceUpdate

type SurfaceUpdate struct {
	Offset *Point

	Damage []Rect

	DamageBuffer []Rect

	BufferScale *int32

	BufferTransform *protocols.WlOutputTransform_enum

	InputRegion *protocols.ObjectID[protocols.WlRegion]

	OpaqueRegion *protocols.ObjectID[protocols.WlRegion]

	Buffer *protocols.ObjectID[protocols.WlBuffer]

	/**
	 * You should unshift when adding to
	 * this array so that the objects will
	 * be added in the correct order. (ie
	 * the ones added last will be on top)
	 */
	AddSubSurface []protocols.ObjectID[protocols.WlSurface]

	XdgSurfaceWindowGeometry *XdgWindowGeometry

	/**
	 * set_child_position and z_oder_subsurfaces
	 * take place whenever the parent surface is committed,
	 * thus they are part of the SurfaceUpdate of the parent
	 */
	SetChildPosition []ChildPosition

	/**
	 * null means above or below the parent.
	 */
	ZOrderSubsurfaces []ZOrderSubsurface

	XwaylandSurfarfaceV1Serial *XWaylandSurfaceV1Serial
}

type Texture

type Texture struct {
	Stride uint32
	Width  uint32
	Height uint32
	Data   []byte
}

func (*Texture) AsRGBA

func (t *Texture) AsRGBA() *image.RGBA

type ToplevelPendingState

type ToplevelPendingState struct {
	MinSize *Size
	MaxSize *Size
}

type WlCompositor

type WlCompositor struct{}

func (*WlCompositor) OnBind

type WlDataDeviceManagerImpl

type WlDataDeviceManagerImpl struct{}

func (*WlDataDeviceManagerImpl) OnBind

func (*WlDataDeviceManagerImpl) WlDataDeviceManager_create_data_source

type WlDataSource

type WlDataSource struct {
	MimeTypes []string
	Actions   protocols.WlDataDeviceManagerDndAction_enum
}

func (*WlDataSource) OnBind

func (*WlDataSource) WlDataSource_destroy

func (w *WlDataSource) WlDataSource_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlDataSource],
) bool

func (*WlDataSource) WlDataSource_offer

func (w *WlDataSource) WlDataSource_offer(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlDataSource],
	mime_type string,
)

func (*WlDataSource) WlDataSource_set_actions

func (w *WlDataSource) WlDataSource_set_actions(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlDataSource],
	dnd_actions protocols.WlDataDeviceManagerDndAction_enum,
)

type WlKeyboard

type WlKeyboard struct {
	Key_map_fd   protocols.FileDescriptor
	Key_map_size uint32
	// let's prevent the garbage collector from closing the file descriptor
	File *os.File
}

func (*WlKeyboard) AfterGetKeyboard

func (o *WlKeyboard) AfterGetKeyboard(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlKeyboard],
)

func (*WlKeyboard) OnBind

func (*WlKeyboard) WlKeyboard_release

type WlOutput

type WlOutput struct {
	Version uint32
}

func (*WlOutput) OnBind

func (o *WlOutput) OnBind(
	s protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlOutput) WlOutput_release

type WlPointer

type WlPointer struct {
	// Last cursor surface set via set_cursor
	PointerSurfaceID map[protocols.ClientState]*protocols.ObjectID[protocols.WlSurface]

	WindowX float32
	WindowY float32
}

func (*WlPointer) AfterGetPointer

func (*WlPointer) OnBind

func (p *WlPointer) OnBind(
	s protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlPointer) WlPointer_release

func (p *WlPointer) WlPointer_release(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlPointer],
) bool

func (*WlPointer) WlPointer_set_cursor

func (p *WlPointer) WlPointer_set_cursor(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlPointer],
	_ uint32,
	surface_id *protocols.ObjectID[protocols.WlSurface],
	hotspot_x int32,
	hotspot_y int32,
)

type WlRegion

type WlRegion struct {
}

func (*WlRegion) OnBind

func (r *WlRegion) OnBind(
	s protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlRegion) WlRegion_add

func (r *WlRegion) WlRegion_add(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlRegion],
	x int32,
	y int32,
	width int32,
	height int32,
)

func (*WlRegion) WlRegion_destroy

func (r *WlRegion) WlRegion_destroy(
	s protocols.ClientState,
	id protocols.ObjectID[protocols.WlRegion],
) bool

func (*WlRegion) WlRegion_subtract

func (r *WlRegion) WlRegion_subtract(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlRegion],
	_x int32,
	_y int32,
	_width int32,
	_height int32,
)

type WlRegistryDelegateImpl

type WlRegistryDelegateImpl struct{}

func (*WlRegistryDelegateImpl) OnBind

func (*WlRegistryDelegateImpl) WlRegistry_bind

func (w *WlRegistryDelegateImpl) WlRegistry_bind(s protocols.ClientState, object_id protocols.ObjectID[protocols.WlRegistry], name uint32, idInterface string, idVersion uint32, idID protocols.AnyObjectID)

type WlSeat

type WlSeat struct {
	Version uint32
}

func (*WlSeat) OnBind

func (w *WlSeat) OnBind(
	s protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newIdAny protocols.AnyObjectID,
	version uint32,
)

func (*WlSeat) WlSeat_get_touch

func (w *WlSeat) WlSeat_get_touch(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSeat],
	_ protocols.ObjectID[protocols.WlTouch],
)

func (*WlSeat) WlSeat_release

func (w *WlSeat) WlSeat_release(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSeat],
) bool

type WlShm

type WlShm struct{}

func (*WlShm) OnBind

func (s *WlShm) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlShm) WlShm_create_pool

func (*WlShm) WlShm_release

func (s *WlShm) WlShm_release(
	_cs protocols.ClientState,
	_objectID protocols.ObjectID[protocols.WlShm],
) bool

*

  • Here's what this does according to the docs:
  • Using this request a client can tell the server that it is not going to use the shm object anymore.
  • Objects created via this interface remain unaffected. *
  • So I guess remove the object from the client, but leave all pools alone?
  • @param s
  • @param _object_id

type WlShmPool

type WlShmPool struct {
	MapState          MapState
	Buffers           map[protocols.ObjectID[protocols.WlBuffer]]BufferInfo
	MemMaps           map[protocols.ObjectID[protocols.WlShmPool]]MemMapInfo
	WlShmPoolObjectID protocols.ObjectID[protocols.WlShmPool]
}

func (*WlShmPool) OnBind

func (p *WlShmPool) OnBind(
	s protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlShmPool) OnDestroyShmPool

func (p *WlShmPool) OnDestroyShmPool(s protocols.ClientState, objectID protocols.ObjectID[protocols.WlShmPool])

func (*WlShmPool) WlBuffer_destroy

func (p *WlShmPool) WlBuffer_destroy(
	s protocols.ClientState,
	bufferObjectID protocols.ObjectID[protocols.WlBuffer],
) bool

func (*WlShmPool) WlShmPool_create_buffer

func (p *WlShmPool) WlShmPool_create_buffer(
	s protocols.ClientState,
	_objectID protocols.ObjectID[protocols.WlShmPool],
	id protocols.ObjectID[protocols.WlBuffer],
	offset int32,
	width int32,
	height int32,
	stride int32,
	format protocols.WlShmFormat_enum,
)

func (*WlShmPool) WlShmPool_destroy

func (p *WlShmPool) WlShmPool_destroy(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.WlShmPool],
) bool

*

  • This can be called by either on the buffer delegate or the pool delegate
  • @param s
  • @param _object_id Check This!! to see if it is the buffer id or the pool id
  • @returns false because wl_shm_pool hndles remove objet by itself

func (*WlShmPool) WlShmPool_on_bind

func (p *WlShmPool) WlShmPool_on_bind(
	_s protocols.ClientState,
	_name protocols.ObjectID[protocols.WlShmPool],
	_interface_ string,
	newID protocols.ObjectID[protocols.WlShmPool],
	version uint32,
)

*

  • This can be called by either on the buffer delegate or the pool delegate
  • check the name and compare to object id
  • @param _s
  • @param _name
  • @param new_id
  • @param version

func (*WlShmPool) WlShmPool_resize

func (p *WlShmPool) WlShmPool_resize(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.WlShmPool],
	size int32,
)

type WlSubcompositor

type WlSubcompositor struct{}

func (*WlSubcompositor) OnBind

func (*WlSubcompositor) WlSubcompositor_destroy

func (sc *WlSubcompositor) WlSubcompositor_destroy(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSubcompositor],
) bool

func (*WlSubcompositor) WlSubcompositor_get_subsurface

type WlSubsurface

type WlSubsurface struct {
	Parent   protocols.ObjectID[protocols.WlSurface]
	Sync     bool
	Position Point
}

func (*WlSubsurface) OnBind

func (ss *WlSubsurface) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlSubsurface) PlaceSubsurface

func (ss *WlSubsurface) PlaceSubsurface(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
	sibling_or_parent_id protocols.ObjectID[protocols.WlSurface],
	aboveOrBelow ZOrder,
)

func (*WlSubsurface) WlSubsurface_destroy

func (ss *WlSubsurface) WlSubsurface_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
) bool

func (*WlSubsurface) WlSubsurface_place_above

func (ss *WlSubsurface) WlSubsurface_place_above(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
	sibling_or_parent_id protocols.ObjectID[protocols.WlSurface],
)

func (*WlSubsurface) WlSubsurface_place_below

func (ss *WlSubsurface) WlSubsurface_place_below(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
	sibling_or_parent_id protocols.ObjectID[protocols.WlSurface],
)

func (*WlSubsurface) WlSubsurface_set_desync

func (ss *WlSubsurface) WlSubsurface_set_desync(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSubsurface],
)

func (*WlSubsurface) WlSubsurface_set_position

func (ss *WlSubsurface) WlSubsurface_set_position(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
	x int32,
	y int32,
)

func (*WlSubsurface) WlSubsurface_set_sync

func (ss *WlSubsurface) WlSubsurface_set_sync(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSubsurface],
)

type WlSurface

type WlSurface struct {
	Position struct {
		X int32
		Y int32
		Z int32
	}

	Texture *Texture
	/**
	 * xdg_surface is not a role,
	 * but have to keep track anyway.
	 */
	XdgSurfaceState *protocols.ObjectID[protocols.XdgSurface]

	/**
	 * nil represents to draw the current surface.
	 * By index, 0 is the bottom, and the last index is the top.
	 */
	ChildrenInDrawOrder []*protocols.ObjectID[protocols.WlSurface]

	Role SurfaceRole

	BufferTransform protocols.WlOutputTransform_enum
	BufferScale     int32

	/**
	 * Null means infinite, (ie we can accept input from everywhere)
	 */
	InputRegion *protocols.ObjectID[protocols.WlRegion]
	/**
	 * Unlink opaque region, null means empty!
	 */
	OpaqueRegion *protocols.ObjectID[protocols.WlRegion]

	PendingUpdate SurfaceUpdate

	Offset Point

	/**
	 * Don't care about regions for now.
	 * Just need to clear this when the surface has
	 * been drawn.
	 */
	Damaged bool
}

func GetSurfaceFromRole

func GetSurfaceFromRole[T RoleOrXDGSurfaceObjectID](cs protocols.ClientState, id T) *WlSurface

func (*WlSurface) ClearRoleData

func (w *WlSurface) ClearRoleData()

func (*WlSurface) HasRoleData

func (w *WlSurface) HasRoleData() bool

func (*WlSurface) OnBind

func (w *WlSurface) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*WlSurface) ResetPendingUpdate

func (w *WlSurface) ResetPendingUpdate()

func (*WlSurface) WlSurface_attach

func (w *WlSurface) WlSurface_attach(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSurface],
	buffer *protocols.ObjectID[protocols.WlBuffer],
	x int32,
	y int32,
)

func (*WlSurface) WlSurface_commit

func (w *WlSurface) WlSurface_commit(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSurface],
)

func (*WlSurface) WlSurface_damage

func (w *WlSurface) WlSurface_damage(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	x int32,
	y int32,
	width int32,
	height int32,
)

func (*WlSurface) WlSurface_damage_buffer

func (w *WlSurface) WlSurface_damage_buffer(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	x int32,
	y int32,
	width int32,
	height int32,
)

func (*WlSurface) WlSurface_destroy

func (w *WlSurface) WlSurface_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSurface],
) bool

func (*WlSurface) WlSurface_frame

func (*WlSurface) WlSurface_offset

func (w *WlSurface) WlSurface_offset(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	x int32,
	y int32,
)

func (*WlSurface) WlSurface_set_buffer_scale

func (w *WlSurface) WlSurface_set_buffer_scale(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	scale int32,
)

func (*WlSurface) WlSurface_set_buffer_transform

func (w *WlSurface) WlSurface_set_buffer_transform(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	transform int32,
)

func (*WlSurface) WlSurface_set_input_region

func (w *WlSurface) WlSurface_set_input_region(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	region *protocols.ObjectID[protocols.WlRegion],
)

func (*WlSurface) WlSurface_set_opaque_region

func (w *WlSurface) WlSurface_set_opaque_region(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.WlSurface],
	region *protocols.ObjectID[protocols.WlRegion],
)

type WlTouchDelegate

type WlTouchDelegate struct {
}

func (*WlTouchDelegate) OnBind

func (w *WlTouchDelegate) OnBind(s protocols.ClientState, name protocols.AnyObjectID, interface_ string, new_id protocols.AnyObjectID, version_number uint32)

func (*WlTouchDelegate) WlTouch_release

func (w *WlTouchDelegate) WlTouch_release(s protocols.ClientState, object_id protocols.ObjectID[protocols.WlTouch]) bool

type XWaylandSurfaceV1Serial

type XWaylandSurfaceV1Serial struct {
	Low uint32
	Hi  uint32
}

type XdgPopup

type XdgPopup struct {
	Version uint32
	Parent  *protocols.ObjectID[protocols.XdgSurface]
	State   XdgPositionerState
	// contains filtered or unexported fields
}

func (*XdgPopup) OnBind

func (x *XdgPopup) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*XdgPopup) XdgPopup_destroy

func (x *XdgPopup) XdgPopup_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.XdgPopup],
) bool

func (*XdgPopup) XdgPopup_reposition

func (x *XdgPopup) XdgPopup_reposition(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.XdgPopup],
	positionerID protocols.ObjectID[protocols.XdgPositioner],
	token uint32,
)

type XdgPositioner

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

func (*XdgPositioner) OnBind

func (x *XdgPositioner) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*XdgPositioner) XdgPositioner_destroy

func (x *XdgPositioner) XdgPositioner_destroy(
	s protocols.ClientState,
	id protocols.ObjectID[protocols.XdgPositioner],
) bool

func (*XdgPositioner) XdgPositioner_set_anchor_rect

func (x *XdgPositioner) XdgPositioner_set_anchor_rect(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
	ax int32,
	ay int32,
	aw int32,
	ah int32,
)

func (*XdgPositioner) XdgPositioner_set_gravity

func (*XdgPositioner) XdgPositioner_set_offset

func (x *XdgPositioner) XdgPositioner_set_offset(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
	ox int32,
	oy int32,
)

func (*XdgPositioner) XdgPositioner_set_parent_configure

func (x *XdgPositioner) XdgPositioner_set_parent_configure(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
	serial uint32,
)

func (*XdgPositioner) XdgPositioner_set_parent_size

func (x *XdgPositioner) XdgPositioner_set_parent_size(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
	parentWidth int32,
	parentHeight int32,
)

func (*XdgPositioner) XdgPositioner_set_reactive

func (x *XdgPositioner) XdgPositioner_set_reactive(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
)

func (*XdgPositioner) XdgPositioner_set_size

func (x *XdgPositioner) XdgPositioner_set_size(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgPositioner],
	width int32,
	height int32,
)

type XdgPositionerState

type XdgPositionerState struct {
	Width                 int32
	Height                int32
	AnchorRect            anchorRect
	Anchor                protocols.XdgPositionerAnchor_enum
	Gravity               protocols.XdgPositionerGravity_enum
	ConstraintAdjustment  protocols.XdgPositionerConstraintAdjustment_enum
	Offset                offset
	Reactive              bool
	ParentSize            Size
	ParentConfigureSerial uint32
}

type XdgSurface

type XdgSurface struct {
	Version        uint32
	XdgSurfaceID   protocols.ObjectID[protocols.XdgSurface]
	OnConfigure    map[uint32]chan uint32
	LatestSerial   uint32
	WindowGeometry XdgWindowGeometry
}

func (*XdgSurface) OnBind

func (x *XdgSurface) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*XdgSurface) XdgSurface_ack_configure

func (x *XdgSurface) XdgSurface_ack_configure(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgSurface],
	serial uint32,
)

func (*XdgSurface) XdgSurface_destroy

func (x *XdgSurface) XdgSurface_destroy(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgSurface],
) bool

func (*XdgSurface) XdgSurface_get_toplevel

func (x *XdgSurface) XdgSurface_get_toplevel(
	s protocols.ClientState,
	xdgSurfaceObjectID protocols.ObjectID[protocols.XdgSurface],
	id protocols.ObjectID[protocols.XdgToplevel],
)

func (*XdgSurface) XdgSurface_set_window_geometry

func (x *XdgSurface) XdgSurface_set_window_geometry(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgSurface],
	wx int32,
	wy int32,
	ww int32,
	wh int32,
)

type XdgToplevel

type XdgToplevel struct {
	Parent *protocols.ObjectID[protocols.XdgToplevel]

	Title *string
	AppID string

	Maximized  bool
	Fullscreen bool

	MinSize *Size
	MaxSize *Size

	PendingState *PendingToplevelState
}

func (*XdgToplevel) OnBind

func (t *XdgToplevel) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*XdgToplevel) XdgToplevel_destroy

func (t *XdgToplevel) XdgToplevel_destroy(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgToplevel],
) bool

func (*XdgToplevel) XdgToplevel_set_app_id

func (t *XdgToplevel) XdgToplevel_set_app_id(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgToplevel],
	appID string,
)

func (*XdgToplevel) XdgToplevel_set_fullscreen

func (t *XdgToplevel) XdgToplevel_set_fullscreen(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgToplevel],
	_ *protocols.ObjectID[protocols.WlOutput],
)

func (*XdgToplevel) XdgToplevel_set_max_size

func (t *XdgToplevel) XdgToplevel_set_max_size(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgToplevel],
	width int32,
	height int32,
)

func (*XdgToplevel) XdgToplevel_set_maximized

func (t *XdgToplevel) XdgToplevel_set_maximized(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgToplevel],
)

func (*XdgToplevel) XdgToplevel_set_min_size

func (t *XdgToplevel) XdgToplevel_set_min_size(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgToplevel],
	width int32,
	height int32,
)

func (*XdgToplevel) XdgToplevel_set_minimized

func (t *XdgToplevel) XdgToplevel_set_minimized(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgToplevel],
)

func (*XdgToplevel) XdgToplevel_set_parent

func (*XdgToplevel) XdgToplevel_set_title

func (t *XdgToplevel) XdgToplevel_set_title(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgToplevel],
	title string,
)

func (*XdgToplevel) XdgToplevel_show_window_menu

func (*XdgToplevel) XdgToplevel_unset_fullscreen

func (t *XdgToplevel) XdgToplevel_unset_fullscreen(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgToplevel],
)

func (*XdgToplevel) XdgToplevel_unset_maximized

func (t *XdgToplevel) XdgToplevel_unset_maximized(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgToplevel],
)

type XdgWindowGeometry

type XdgWindowGeometry struct {
	X      int32
	Y      int32
	Width  int32
	Height int32
}

type XdgWmBase

type XdgWmBase struct {
	Version uint32
}

func (*XdgWmBase) OnBind

func (*XdgWmBase) XdgWmBase_destroy

func (x *XdgWmBase) XdgWmBase_destroy(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgWmBase],
) bool

func (*XdgWmBase) XdgWmBase_get_xdg_surface

func (x *XdgWmBase) XdgWmBase_get_xdg_surface(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgWmBase],
	xdgSurfaceID protocols.ObjectID[protocols.XdgSurface],
	surfaceID protocols.ObjectID[protocols.WlSurface],
)

func (*XdgWmBase) XdgWmBase_pong

func (x *XdgWmBase) XdgWmBase_pong(
	_ protocols.ClientState,
	_ protocols.ObjectID[protocols.XdgWmBase],
	_ uint32,
)

type XwaylandShellV1

type XwaylandShellV1 struct {
}

func (*XwaylandShellV1) OnBind

func (x *XwaylandShellV1) OnBind(
	_s protocols.ClientState,
	_name protocols.AnyObjectID,
	_interface_ string,
	_new_id protocols.AnyObjectID,
	_version_number uint32,
)

func (*XwaylandShellV1) XwaylandShellV1_destroy

func (x *XwaylandShellV1) XwaylandShellV1_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.XwaylandShellV1],
) bool

type XwaylandSurfaceV1

type XwaylandSurfaceV1 struct {
}

func (*XwaylandSurfaceV1) OnBind

func (x *XwaylandSurfaceV1) OnBind(
	cs protocols.ClientState,
	_ protocols.AnyObjectID,
	_ string,
	newId_any protocols.AnyObjectID,
	version uint32,
)

func (*XwaylandSurfaceV1) XwaylandSurfaceV1_destroy

func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.XwaylandSurfaceV1],
) bool

func (*XwaylandSurfaceV1) XwaylandSurfaceV1_on_bind

func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_on_bind(
	_s protocols.ClientState,
	_name protocols.AnyObjectID,
	_interface_ string,
	_new_id protocols.AnyObjectID,
	_version_number uint32,
)

func (*XwaylandSurfaceV1) XwaylandSurfaceV1_set_serial

func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_set_serial(
	_s protocols.ClientState,
	_object_id protocols.ObjectID[protocols.XwaylandSurfaceV1],
	_serial_lo uint32,
	_serial_hi uint32,
)

type ZOrder

type ZOrder int
const (
	ZOrderTypeAbove ZOrder = iota
	ZOrderTypeBelow ZOrder = iota + 1
)

type ZOrderSubsurface

type ZOrderSubsurface struct {
	Type        ZOrder
	ChildToMove protocols.ObjectID[protocols.WlSurface]
	/**
	 * nil means above or below the parent.
	 */
	RelativeTo *protocols.ObjectID[protocols.WlSurface]
}

type ZwpXwaylandKeyboardGrabManagerV1

type ZwpXwaylandKeyboardGrabManagerV1 struct {
}

func (*ZwpXwaylandKeyboardGrabManagerV1) OnBind

func (m *ZwpXwaylandKeyboardGrabManagerV1) OnBind(
	_s protocols.ClientState,
	_name protocols.AnyObjectID,
	_interface_ string,
	_new_id protocols.AnyObjectID,
	_version_number uint32,
)

func (*ZwpXwaylandKeyboardGrabManagerV1) ZwpXwaylandKeyboardGrabManagerV1_destroy

func (m *ZwpXwaylandKeyboardGrabManagerV1) ZwpXwaylandKeyboardGrabManagerV1_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1],
) bool

type ZwpXwaylandKeyboardGrabV1

type ZwpXwaylandKeyboardGrabV1 struct {
}

func (*ZwpXwaylandKeyboardGrabV1) OnBind

func (*ZwpXwaylandKeyboardGrabV1) ZwpXwaylandKeyboardGrabV1_destroy

type ZxdgDecorationManagerV1

type ZxdgDecorationManagerV1 struct{}

func (*ZxdgDecorationManagerV1) OnBind

func (*ZxdgDecorationManagerV1) ZxdgDecorationManagerV1_destroy

func (z *ZxdgDecorationManagerV1) ZxdgDecorationManagerV1_destroy(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.ZxdgDecorationManagerV1],
) bool

type ZxdgToplevelDecorationV1

type ZxdgToplevelDecorationV1 struct {
	XdgToplevel protocols.ObjectID[protocols.XdgToplevel]
}

func (*ZxdgToplevelDecorationV1) OnBind

func (*ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_destroy

func (*ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_unset_mode

func (z *ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_unset_mode(
	s protocols.ClientState,
	_ protocols.ObjectID[protocols.ZxdgToplevelDecorationV1],
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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