Documentation
¶
Overview ¶
Package wlturbo provides a high-performance Wayland client implementation optimized for gaming and real-time applications.
This package delivers sub-microsecond latency, zero-allocation hot paths, and support for 8000Hz gaming devices. It's designed for video game engines, competitive gaming, and other performance-critical applications.
Index ¶
- Constants
- func CreateAnonymousFile(size int64) (fd int, err error)
- func GetNextFD() (int, bool)
- func MapMemory(fd int, size int) ([]byte, error)
- func UnmapMemory(data []byte) error
- type BaseProxy
- type Compositor
- type Context
- func (c *Context) AllocateID() uint32
- func (c *Context) Close() error
- func (c *Context) Register(proxy Proxy)
- func (c *Context) RunTill(callback Object) error
- func (c *Context) SendRequest(proxy Proxy, opcode uint32, args ...interface{}) error
- func (c *Context) SendRequestWithFDs(proxy Proxy, opcode uint32, fds []int, args ...interface{}) error
- func (c *Context) Unregister(proxy Proxy)
- func (c *Context) UnregisterID(id uint32)
- type DirectDispatcher
- type Display
- func (d *Display) AddListener(objectID uint32, opcode uint16, handler func([]byte))
- func (d *Display) AllocateID() uint32
- func (d *Display) Close() error
- func (d *Display) Context() *Context
- func (d *Display) Dispatch() error
- func (d *Display) GetRegistry() *Registry
- func (d *Display) ID() uint32
- func (d *Display) RegisterEventHandler(objectID uint32, opcode uint16, handler EventHandler)
- func (d *Display) Registry() *Registry
- func (d *Display) Roundtrip() error
- func (d *Display) SendRequest(objectID uint32, opcode uint16, args ...interface{}) error
- func (d *Display) SendRequestWithFDs(objectID uint32, opcode uint16, fds []int, args ...interface{}) error
- func (d *Display) Sync() (Object, error)
- type Event
- func (e *Event) Array() []byte
- func (e *Event) Data() []byte
- func (e *Event) Fd() uintptr
- func (e *Event) Fixed() Fixed
- func (e *Event) Int32() int32
- func (e *Event) NewID() Proxy
- func (e *Event) Offset() int
- func (e *Event) Proxy() Proxy
- func (e *Event) String() string
- func (e *Event) Uint32() uint32
- type EventDispatcher
- type EventHandler
- type Fixed
- type Global
- type GlobalHandler
- type Keyboard
- type Object
- type Output
- type OutputHead
- type OutputMode
- type PerformanceStats
- type Pointer
- type Proxy
- type RawEvent
- type Region
- type Registry
- func (r *Registry) AddGlobalHandler(handler RegistryGlobalHandler)
- func (r *Registry) AddGlobalRemoveHandler(handler RegistryGlobalRemoveHandler)
- func (r *Registry) AddHandler(iface string, handler GlobalHandler)
- func (r *Registry) Bind(name uint32, iface string, version uint32, proxy Proxy) error
- func (r *Registry) BindID(name uint32, iface string, version uint32) (uint32, error)
- func (r *Registry) FindGlobal(iface string) (Global, bool)
- func (r *Registry) FindGlobalByName(name uint32) (Global, bool)
- func (r *Registry) GetGlobals() map[uint32]Global
- func (r *Registry) ID() uint32
- type RegistryGlobalEvent
- type RegistryGlobalHandler
- type RegistryGlobalRemoveEvent
- type RegistryGlobalRemoveHandler
- type Seat
- type SeatCapabilitiesHandler
- type SeatNameHandler
- type ShmBuffer
- type ShmPool
- type Surface
- func (s *Surface) Attach(buffer Object, x, y int32) error
- func (s *Surface) Commit() error
- func (s *Surface) Damage(x, y, width, height int32) error
- func (s *Surface) DamageBuffer(x, y, width, height int32) error
- func (s *Surface) Destroy() error
- func (s *Surface) Dispatch(event *Event)
- func (s *Surface) Frame() (Object, error)
- func (s *Surface) Offset(x, y int32) error
- func (s *Surface) SetBufferScale(scale int32) error
- func (s *Surface) SetBufferTransform(transform int32) error
- func (s *Surface) SetInputRegion(region *Region) error
- func (s *Surface) SetOpaqueRegion(region *Region) error
- type Touch
Constants ¶
const ( SeatCapabilityPointer = 1 SeatCapabilityKeyboard = 2 SeatCapabilityTouch = 4 )
Seat capability constants
const ( // 32-bit formats FormatARGB8888 = 0 FormatXRGB8888 = 1 // 24-bit formats FormatRGB888 = 0x34324752 // 'RG24' FormatBGR888 = 0x34324742 // 'BG24' // 16-bit formats FormatRGB565 = 0x36314752 // 'RG16' FormatXRGB1555 = 0x35315258 // 'XR15' // 8-bit formats FormatY8 = 0x20203859 // 'Y8 ' )
Wayland pixel formats
Variables ¶
This section is empty.
Functions ¶
func CreateAnonymousFile ¶
CreateAnonymousFile creates an anonymous file for shared memory
Types ¶
type BaseProxy ¶
type BaseProxy struct {
// contains filtered or unexported fields
}
BaseProxy provides base implementation for protocol objects
func (*BaseProxy) SetContext ¶
SetContext sets the proxy's context
type Compositor ¶
type Compositor struct {
BaseProxy
}
Compositor represents a wl_compositor
func NewCompositor ¶
func NewCompositor(ctx *Context) *Compositor
NewCompositor creates a new compositor proxy
func (*Compositor) CreateRegion ¶
func (c *Compositor) CreateRegion() (*Region, error)
CreateRegion creates a new region
func (*Compositor) CreateSurface ¶
func (c *Compositor) CreateSurface() (*Surface, error)
CreateSurface creates a new surface
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides a compatibility layer for wl.Context
func NewContext ¶
NewContext creates a new context from a display
func (*Context) AllocateID ¶
AllocateID allocates a new object ID
func (*Context) SendRequest ¶
SendRequest sends a request through the context
func (*Context) SendRequestWithFDs ¶
func (c *Context) SendRequestWithFDs(proxy Proxy, opcode uint32, fds []int, args ...interface{}) error
SendRequestWithFDs sends a request with file descriptors through the context
func (*Context) Unregister ¶
Unregister removes a proxy object
func (*Context) UnregisterID ¶
UnregisterID removes a proxy object by ID (overloaded for compatibility)
type DirectDispatcher ¶
type DirectDispatcher struct {
// contains filtered or unexported fields
}
DirectDispatcher provides the absolute fastest dispatch path for hot events
func (*DirectDispatcher) DispatchPointerButton ¶
func (d *DirectDispatcher) DispatchPointerButton(button, state uint32)
DispatchPointerButton dispatches pointer button events with zero overhead
func (*DirectDispatcher) DispatchPointerMotion ¶
func (d *DirectDispatcher) DispatchPointerMotion(surfaceX, surfaceY Fixed)
DispatchPointerMotion dispatches pointer motion events with zero overhead
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
Display represents a connection to the Wayland display
func (*Display) AddListener ¶
AddListener adds an event listener for an object
func (*Display) AllocateID ¶
AllocateID allocates a new object ID (public method)
func (*Display) GetRegistry ¶
GetRegistry returns the registry (compatibility)
func (*Display) RegisterEventHandler ¶
func (d *Display) RegisterEventHandler(objectID uint32, opcode uint16, handler EventHandler)
RegisterEventHandler registers a high-performance event handler
func (*Display) SendRequest ¶
SendRequest sends a request to the compositor
type Event ¶
Event represents a Wayland protocol event
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
EventDispatcher handles high-performance event dispatching
func NewEventDispatcher ¶
func NewEventDispatcher() *EventDispatcher
NewEventDispatcher creates a high-performance event dispatcher
func (*EventDispatcher) BatchDispatch ¶
func (d *EventDispatcher) BatchDispatch(events []RawEvent)
BatchDispatch processes multiple events in a batch for better cache locality
func (*EventDispatcher) Dispatch ¶
func (d *EventDispatcher) Dispatch(objectID uint32, opcode uint16, data []byte)
Dispatch dispatches an event with minimal overhead
func (*EventDispatcher) RegisterHandler ¶
func (d *EventDispatcher) RegisterHandler(objectID uint32, opcode uint16, handler EventHandler)
RegisterHandler registers an event handler with zero allocation in common case
type EventHandler ¶
type EventHandler func(event *Event)
EventHandler is a function type for handling events with zero allocations
type GlobalHandler ¶
GlobalHandler is called when a global is announced
type OutputHead ¶
type OutputHead struct {
BaseProxy
// contains filtered or unexported fields
}
OutputHead represents a zwlr_output_head_v1 object
func (*OutputHead) Dispatch ¶
func (h *OutputHead) Dispatch(event *Event)
Dispatch handles head events
type OutputMode ¶
type OutputMode struct {
BaseProxy
// contains filtered or unexported fields
}
OutputMode represents a zwlr_output_mode_v1 object
func (*OutputMode) Dispatch ¶
func (m *OutputMode) Dispatch(event *Event)
Dispatch handles mode events
type PerformanceStats ¶
type PerformanceStats struct {
EventsDispatched atomic.Uint64
NanosecondsSpent atomic.Uint64
CacheMisses atomic.Uint64
// contains filtered or unexported fields
}
PerformanceStats tracks dispatcher performance
func (*PerformanceStats) GetAverageLatency ¶
func (s *PerformanceStats) GetAverageLatency() uint64
GetAverageLatency returns average dispatch latency in nanoseconds
type Region ¶
type Region struct {
BaseProxy
}
Region represents a wl_region
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry represents the global registry
func (*Registry) AddGlobalHandler ¶
func (r *Registry) AddGlobalHandler(handler RegistryGlobalHandler)
AddGlobalHandler adds a global handler to the registry
func (*Registry) AddGlobalRemoveHandler ¶
func (r *Registry) AddGlobalRemoveHandler(handler RegistryGlobalRemoveHandler)
AddGlobalRemoveHandler adds a global remove handler (placeholder)
func (*Registry) AddHandler ¶
func (r *Registry) AddHandler(iface string, handler GlobalHandler)
AddHandler adds a handler for a specific interface
func (*Registry) BindID ¶
BindID binds to a global object and returns just the ID (compatibility method)
func (*Registry) FindGlobal ¶
FindGlobal finds a global by interface name
func (*Registry) FindGlobalByName ¶
FindGlobalByName finds a global by its name ID
func (*Registry) GetGlobals ¶
GetGlobals returns all announced globals
type RegistryGlobalEvent ¶
RegistryGlobalEvent represents a registry global announcement
type RegistryGlobalHandler ¶
type RegistryGlobalHandler interface {
HandleRegistryGlobal(event RegistryGlobalEvent)
}
RegistryGlobalHandler interface
type RegistryGlobalRemoveEvent ¶
RegistryGlobalRemoveEvent represents a registry global removal
type RegistryGlobalRemoveHandler ¶
type RegistryGlobalRemoveHandler interface {
HandleRegistryGlobalRemove(event RegistryGlobalRemoveEvent)
}
RegistryGlobalRemoveHandler interface
type Seat ¶
type Seat struct {
BaseProxy
// contains filtered or unexported fields
}
Seat represents a wl_seat
func (*Seat) Capabilities ¶
Capabilities returns the seat capabilities
func (*Seat) GetKeyboard ¶
GetKeyboard gets the keyboard device
func (*Seat) GetPointer ¶
GetPointer gets the pointer device
type SeatCapabilitiesHandler ¶
SeatCapabilitiesHandler handles seat capabilities events
type SeatNameHandler ¶
SeatNameHandler handles seat name events
type ShmBuffer ¶
type ShmBuffer struct {
// contains filtered or unexported fields
}
ShmBuffer represents a buffer allocated from a pool
type ShmPool ¶
type ShmPool struct {
// contains filtered or unexported fields
}
ShmPool represents a shared memory pool
func CreateShmPool ¶
CreateShmPool creates a new shared memory pool
func (*ShmPool) AllocateBuffer ¶
AllocateBuffer allocates a buffer from the pool
type Surface ¶
type Surface struct {
BaseProxy
}
Surface represents a wl_surface
func (*Surface) DamageBuffer ¶
DamageBuffer marks a region of the buffer as damaged
func (*Surface) SetBufferScale ¶
SetBufferScale sets the buffer scale
func (*Surface) SetBufferTransform ¶
SetBufferTransform sets the buffer transform
func (*Surface) SetInputRegion ¶
SetInputRegion sets the input region
func (*Surface) SetOpaqueRegion ¶
SetOpaqueRegion sets the opaque region