wlroots

package
v0.0.0-...-7241d52 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	InputDeviceTypeKeyboard   InputDeviceType = C.WLR_INPUT_DEVICE_KEYBOARD
	InputDeviceTypePointer    InputDeviceType = C.WLR_INPUT_DEVICE_POINTER
	InputDeviceTypeTouch      InputDeviceType = C.WLR_INPUT_DEVICE_TOUCH
	InputDeviceTypeTabletTool InputDeviceType = C.WLR_INPUT_DEVICE_TABLET_TOOL
	InputDeviceTypeTabletPad  InputDeviceType = C.WLR_INPUT_DEVICE_TABLET_PAD
	InputDeviceTypeSwitch     InputDeviceType = C.WLR_INPUT_DEVICE_SWITCH

	ButtonStateReleased ButtonState = C.WLR_BUTTON_RELEASED
	ButtonStatePressed  ButtonState = C.WLR_BUTTON_PRESSED

	AxisSourceWheel      AxisSource = C.WLR_AXIS_SOURCE_WHEEL
	AxisSourceFinger     AxisSource = C.WLR_AXIS_SOURCE_FINGER
	AxisSourceContinuous AxisSource = C.WLR_AXIS_SOURCE_CONTINUOUS
	AxisSourceWheelTilt  AxisSource = C.WLR_AXIS_SOURCE_WHEEL_TILT

	AxisOrientationVertical   AxisOrientation = C.WLR_AXIS_ORIENTATION_VERTICAL
	AxisOrientationHorizontal AxisOrientation = C.WLR_AXIS_ORIENTATION_HORIZONTAL
)
View Source
const (
	KeyboardLedCount               = C.WLR_LED_COUNT
	KeyboardModifierCount          = C.WLR_MODIFIER_COUNT
	KeyboardKeysCap                = C.WLR_KEYBOARD_KEYS_CAP
	KeyStateReleased      KeyState = C.WL_KEYBOARD_KEY_STATE_RELEASED
	KeyStatePressed       KeyState = C.WL_KEYBOARD_KEY_STATE_PRESSED

	KeyboardModifierShift KeyboardModifier = C.WLR_MODIFIER_SHIFT
	KeyboardModifierCaps  KeyboardModifier = C.WLR_MODIFIER_CAPS
	KeyboardModifierCtrl  KeyboardModifier = C.WLR_MODIFIER_CTRL
	KeyboardModifierAlt   KeyboardModifier = C.WLR_MODIFIER_ALT
	KeyboardModifierMod2  KeyboardModifier = C.WLR_MODIFIER_MOD2
	KeyboardModifierMod3  KeyboardModifier = C.WLR_MODIFIER_MOD3
	KeyboardModifierMod5  KeyboardModifier = C.WLR_MODIFIER_MOD5

	KeyboardLedNumLock    KeyboardLed = C.WLR_LED_NUM_LOCK
	KeyboardLedCapsLock   KeyboardLed = C.WLR_LED_CAPS_LOCK
	KeyboardLedScrollLock KeyboardLed = C.WLR_LED_SCROLL_LOCK
)

Variables

This section is empty.

Functions

func DisplayCreate

func DisplayCreate()

func OnLog

func OnLog(verbosity LogImportance, cb LogFunc)

func OutputTransformInvert

func OutputTransformInvert(transform uint32) uint32

Types

type Allocator

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

func (Allocator) Nil

func (s Allocator) Nil() bool

type AxisOrientation

type AxisOrientation uint32

type AxisSource

type AxisSource uint32

type Backend

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

func (Backend) AllocatorAutocreate

func (b Backend) AllocatorAutocreate(r Renderer) (Allocator, error)

func (Backend) Destroy

func (b Backend) Destroy()

func (Backend) NewAllocator

func (b Backend) NewAllocator(r Renderer) (Allocator, error)

func (Backend) NewRenderer

func (b Backend) NewRenderer() (Renderer, error)

func (Backend) OnDestroy

func (b Backend) OnDestroy(cb func(Backend))

func (Backend) OnNewInput

func (b Backend) OnNewInput(cb func(InputDevice))

func (Backend) OnNewOutput

func (b Backend) OnNewOutput(cb func(Output))

func (Backend) RendererAutoCreate

func (b Backend) RendererAutoCreate() (Renderer, error)

func (Backend) Start

func (b Backend) Start() error

type Buffer

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

*

  • A buffer containing pixel data. *
  • A buffer has a single producer (the party who created the buffer) and
  • multiple consumers (parties reading the buffer). When all consumers are done
  • with the buffer, it gets released and can be re-used by the producer. When
  • the producer and all consumers are done with the buffer, it gets destroyed.

func (Buffer) Drop

func (b Buffer) Drop()

*

  • Unreference the buffer. This function should be called by producers when
  • they are done with the buffer.

func (Buffer) Lock

func (b Buffer) Lock() Buffer

*

  • Lock the buffer. This function should be called by consumers to make
  • sure the buffer can be safely read from. Once the consumer is done with the
  • buffer, they should call wlr_buffer_unlock().

func (Buffer) Unlock

func (b Buffer) Unlock()

*

  • Unlock the buffer. This function should be called by consumers once they are
  • done with the buffer.

type ButtonState

type ButtonState uint32

type Color

type Color struct {
	R, G, B, A float32
}

func (*Color) Set

func (c *Color) Set(r, g, b, a float32)

type Compositor

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

func (Compositor) OnDestroy

func (c Compositor) OnDestroy(cb func(Compositor))

type Cursor

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

*

  • wlr_cursor implements the behavior of the "cursor", that is, the image on the
  • screen typically moved about with a mouse or so. It provides tracking for
  • this in global coordinates, and integrates with struct wlr_output,
  • struct wlr_output_layout, and struct wlr_input_device. You can use it to
  • abstract multiple input devices over a single cursor, constrain cursor
  • movement to the usable area of a struct wlr_output_layout and communicate
  • position updates to the hardware cursor, constrain specific input devices to
  • specific outputs or regions of the screen, and so on.

func NewCursor

func NewCursor() Cursor

func (Cursor) AttachInputDevice

func (c Cursor) AttachInputDevice(dev InputDevice)

*

  • Attaches this input device to this cursor. The input device must be one of: *
  • - WLR_INPUT_DEVICE_POINTER
  • - WLR_INPUT_DEVICE_TOUCH
  • - WLR_INPUT_DEVICE_TABLET_TOOL

func (Cursor) AttachOutputLayout

func (c Cursor) AttachOutputLayout(layout OutputLayout)

*

  • Uses the given layout to establish the boundaries and movement semantics of
  • this cursor. Cursors without an output layout allow infinite movement in any
  • direction and do not support absolute input events.

func (Cursor) Destroy

func (c Cursor) Destroy()

func (Cursor) DetachInputDevice

func (c Cursor) DetachInputDevice(dev InputDevice)

func (Cursor) MapInputToOutput

func (c Cursor) MapInputToOutput(input InputDevice, output Output)

*

  • Maps all input from a specific input device to a given output. The input
  • device must be attached to this cursor and the output must be among the
  • outputs in the attached output layout.

func (Cursor) MapInputToRegion

func (c Cursor) MapInputToRegion(dev InputDevice, box GeoBox)

*

  • Maps inputs from this input device to an arbitrary region on the associated
  • struct wlr_output_layout.

func (Cursor) MapToOutput

func (c Cursor) MapToOutput(output Output)

*

  • Attaches this cursor to the given output, which must be among the outputs in
  • the current output_layout for this cursor. This call is invalid for a cursor
  • without an associated output layout.

func (Cursor) MapToRegion

func (c Cursor) MapToRegion(box GeoBox)

*

  • Maps this cursor to an arbitrary region on the associated
  • struct wlr_output_layout.

func (Cursor) Move

func (c Cursor) Move(dev InputDevice, dx float64, dy float64)

*

  • Move the cursor in the direction of the given x and y layout coordinates. If
  • one coordinate is NAN, it will be ignored. *
  • `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
  • device mapping constraints will be ignored.

func (Cursor) OnAxis

func (c Cursor) OnAxis(cb func(dev InputDevice, time uint32, source AxisSource, orientation AxisOrientation, delta float64, deltaDiscrete int32))

func (Cursor) OnButton

func (c Cursor) OnButton(cb func(dev InputDevice, time uint32, button uint32, state ButtonState))

func (Cursor) OnFrame

func (c Cursor) OnFrame(cb func())

func (Cursor) OnMotion

func (c Cursor) OnMotion(cb func(dev InputDevice, time uint32, dx float64, dy float64))

func (Cursor) OnMotionAbsolute

func (c Cursor) OnMotionAbsolute(cb func(dev InputDevice, time uint32, x float64, y float64))

func (Cursor) SetSurface

func (c Cursor) SetSurface(surface Surface, hotspotX int32, hotspotY int32)

*

  • Set the cursor surface. The surface can be committed to update the cursor
  • image. The surface position is subtracted from the hotspot. A NULL surface
  • commit hides the cursor.

func (Cursor) SetXCursor

func (c Cursor) SetXCursor(cm XCursorManager, name string)

*

  • Set the cursor image from an XCursor theme. *
  • The image will be loaded from the struct wlr_xcursor_manager.

func (Cursor) UnsetImage

func (c Cursor) UnsetImage()

*

  • Hide the cursor image.

func (Cursor) WarpAbsolute

func (c Cursor) WarpAbsolute(dev InputDevice, x float64, y float64)

*

  • Warp the cursor to the given x and y in absolute 0..1 coordinates. If the
  • given point is out of the layout boundaries or constraints, the closest point
  • will be used. If one coordinate is NAN, it will be ignored. *
  • `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
  • device mapping constraints will be ignored.

func (Cursor) X

func (c Cursor) X() float64

func (Cursor) Y

func (c Cursor) Y() float64

type DMABuf

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

func NewDMABuf

func NewDMABuf(display Display, renderer Renderer) DMABuf

func (DMABuf) OnDestroy

func (b DMABuf) OnDestroy(cb func(DMABuf))

type DataDeviceManager

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

func (DataDeviceManager) OnDestroy

func (m DataDeviceManager) OnDestroy(cb func(DataDeviceManager))

type Display

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

func NewDisplay

func NewDisplay() Display

func (Display) AddSocketAuto

func (d Display) AddSocketAuto() (string, error)

func (Display) BackendAutocreate

func (d Display) BackendAutocreate() (Backend, error)

func (Display) CompositorCreate

func (d Display) CompositorCreate(version int, renderer Renderer) Compositor

func (Display) DataDeviceManagerCreate

func (d Display) DataDeviceManagerCreate() DataDeviceManager

func (Display) Destroy

func (d Display) Destroy()

func (Display) DestroyClients

func (d Display) DestroyClients()

func (Display) EventLoop

func (d Display) EventLoop() EventLoop

func (Display) FlushClients

func (d Display) FlushClients()

func (Display) NewBackend

func (d Display) NewBackend() (Backend, error)

func (Display) NewCompositor

func (d Display) NewCompositor(version int, renderer Renderer) Compositor

func (Display) NewDataDeviceManager

func (d Display) NewDataDeviceManager() DataDeviceManager

func (Display) NewSeat

func (d Display) NewSeat(name string) Seat

func (Display) NewSubCompositor

func (d Display) NewSubCompositor() SubCompositor

func (Display) NewXDGShell

func (d Display) NewXDGShell(version int) XDGShell

func (Display) OnDestroy

func (d Display) OnDestroy(cb func(Display))

func (Display) Run

func (d Display) Run()

func (Display) SeatCreate

func (d Display) SeatCreate(name string) Seat

func (Display) SubCompositorCreate

func (d Display) SubCompositorCreate() SubCompositor

func (Display) Terminate

func (d Display) Terminate()

func (Display) XDGShellCreate

func (d Display) XDGShellCreate(version int) XDGShell

func (Display) XWaylandCreate

func (d Display) XWaylandCreate(compositor Compositor, lazy bool) XWayland
  • Create an Xwayland server and XWM. *
  • The server supports a lazy mode in which Xwayland is only started when a
  • client tries to connect.

type Edges

type Edges uint32
const (
	EdgeNone   Edges = C.WLR_EDGE_NONE
	EdgeTop    Edges = C.WLR_EDGE_TOP
	EdgeBottom Edges = C.WLR_EDGE_BOTTOM
	EdgeLeft   Edges = C.WLR_EDGE_LEFT
	EdgeRight  Edges = C.WLR_EDGE_RIGHT
)

type EventLoop

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

func (EventLoop) Dispatch

func (evl EventLoop) Dispatch(timeout time.Duration)

func (EventLoop) Fd

func (evl EventLoop) Fd() uintptr

func (EventLoop) OnDestroy

func (evl EventLoop) OnDestroy(cb func(EventLoop))

type GeoBox

type GeoBox struct {
	X, Y, Width, Height int
	// contains filtered or unexported fields
}

func (*GeoBox) Set

func (b *GeoBox) Set(x, y, width, height int)

type InputDevice

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

func (InputDevice) Keyboard

func (d InputDevice) Keyboard() Keyboard

func (InputDevice) Name

func (d InputDevice) Name() string

func (InputDevice) OnDestroy

func (d InputDevice) OnDestroy(cb func(InputDevice))

func (InputDevice) Product

func (d InputDevice) Product() int

func (InputDevice) Type

func (d InputDevice) Type() InputDeviceType

func (InputDevice) Vendor

func (d InputDevice) Vendor() int

type InputDeviceType

type InputDeviceType uint32

type KeyState

type KeyState uint32

type Keyboard

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

*

  • Get a struct wlr_keyboard from a struct wlr_input_device. *
  • Asserts that the input device is a keyboard.

func (Keyboard) Base

func (k Keyboard) Base() InputDevice

func (Keyboard) Leds

func (k Keyboard) Leds() int

func (Keyboard) Modifiers

func (k Keyboard) Modifiers() KeyboardModifier

func (Keyboard) OnDestroy

func (k Keyboard) OnDestroy(cb func(keyboard Keyboard))

func (Keyboard) OnKey

func (k Keyboard) OnKey(cb func(keyboard Keyboard, time uint32, keyCode uint32, updateState bool, state KeyState))

func (Keyboard) OnModifiers

func (k Keyboard) OnModifiers(cb func(keyboard Keyboard))

func (Keyboard) RepeatInfo

func (k Keyboard) RepeatInfo() (rate int32, delay int32)

func (Keyboard) SetKeymap

func (k Keyboard) SetKeymap(keymap xkb.Keymap)

func (Keyboard) SetRepeatInfo

func (k Keyboard) SetRepeatInfo(rate int32, delay int32)

func (Keyboard) XKBState

func (k Keyboard) XKBState() xkb.State

type KeyboardLed

type KeyboardLed uint32

type KeyboardModifier

type KeyboardModifier uint32

type KeyboardModifiers

type KeyboardModifiers uint32

type LogFunc

type LogFunc func(importance LogImportance, msg string)

type LogImportance

type LogImportance uint32
const (
	LogImportanceSilent LogImportance = C.WLR_SILENT
	LogImportanceError  LogImportance = C.WLR_ERROR
	LogImportanceInfo   LogImportance = C.WLR_INFO
	LogImportanceDebug  LogImportance = C.WLR_DEBUG
)

type Matrix

type Matrix [9]float32

func (*Matrix) ProjectBox

func (m *Matrix) ProjectBox(box *GeoBox, transform uint32, rotation float32, projection *Matrix)

type Output

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

*

  • A compositor output region. This typically corresponds to a monitor that
  • displays part of the compositor space. *
  • The `frame` event will be emitted when it is a good time for the compositor
  • to submit a new frame. *
  • To render a new frame, compositors should call wlr_output_attach_render(),
  • render and call wlr_output_commit(). No rendering should happen outside a
  • `frame` event handler or before wlr_output_attach_render().

func (Output) AttachRender

func (o Output) AttachRender() (int, error)

*

  • Attach the renderer's buffer to the output. Compositors must call this
  • function before rendering. After they are done rendering, they should call
  • wlr_output_commit() to submit the new frame. The output needs to be
  • enabled. *
  • If non-NULL, `buffer_age` is set to the drawing buffer age in number of
  • frames or -1 if unknown. This is useful for damage tracking. *
  • If the compositor decides not to render after calling this function, it
  • must call wlr_output_rollback().

func (Output) Commit

func (o Output) Commit() bool

*

  • Commit the pending output state. If wlr_output_attach_render() has been
  • called, the pending frame will be submitted for display and a `frame` event
  • will be scheduled. *
  • On failure, the pending changes are rolled back.

func (Output) CommitState

func (o Output) CommitState(s OutputState) bool

*

  • Attempts to apply the state to this output. This function may fail for any
  • reason and return false. If failed, none of the state would have been applied,
  • this function is atomic. If the commit succeeded, true is returned. *
  • Note: wlr_output_state_finish() would typically be called after the state
  • has been committed.

func (Output) CreateGlobal

func (o Output) CreateGlobal()

func (Output) Destroy

func (o Output) Destroy()

func (Output) DestroyGlobal

func (o Output) DestroyGlobal()

func (Output) EffectiveResolution

func (o Output) EffectiveResolution() (int, int)

*

  • Computes the transformed and scaled output resolution.

func (Output) Enable

func (o Output) Enable(enable bool)

*

  • Enables or disables the output. A disabled output is turned off and doesn't
  • emit `frame` events. *
  • Whether an output is enabled is double-buffered state, see
  • wlr_output_commit().

func (Output) EnableAdaptiveSync

func (o Output) EnableAdaptiveSync(enable bool)

*

  • Enables or disables adaptive sync (ie. variable refresh rate) on this
  • output. On some backends, this is just a hint and may be ignored.
  • Compositors can inspect `wlr_output.adaptive_sync_status` to query the
  • effective status. Backends that don't support adaptive sync will reject
  • the output commit. *
  • When enabled, compositors can submit frames a little bit later than the
  • deadline without dropping a frame. *
  • Adaptive sync is double-buffered state, see wlr_output_commit().

func (Output) Enabled

func (o Output) Enabled() bool

func (Output) InitRender

func (o Output) InitRender(a Allocator, r Renderer) bool

*

  • Initialize the output's rendering subsystem with the provided allocator and
  • renderer. After initialization, this function may invoked again to reinitialize
  • the allocator and renderer to different values. *
  • Call this function prior to any call to wlr_output_attach_render(),
  • wlr_output_commit() or wlr_output_cursor_create(). *
  • The buffer capabilities of the provided must match the capabilities of the
  • output's backend. Returns false otherwise.

func (Output) Modes

func (o Output) Modes() []OutputMode

func (Output) Name

func (o Output) Name() string

func (Output) OnDestroy

func (o Output) OnDestroy(cb func(Output))

func (Output) OnFrame

func (o Output) OnFrame(cb func(Output))

func (Output) OnRequestState

func (o Output) OnRequestState(cb func(Output, OutputState))

func (Output) PrefferedMode

func (o Output) PrefferedMode() (OutputMode, error)

*

  • Returns the preferred mode for this output. If the output doesn't support
  • modes, returns NULL.

func (Output) Refresh

func (o Output) Refresh() int

func (Output) RenderSoftwareCursors

func (o Output) RenderSoftwareCursors()

func (Output) Rollback

func (o Output) Rollback()

*

  • Discard the pending output state.

func (Output) Scale

func (o Output) Scale() float32

func (Output) ScheduleDone

func (o Output) ScheduleDone()

*

  • Schedule a done event. *
  • This is intended to be used by wl_output add-on interfaces.

func (Output) ScheduleFrame

func (o Output) ScheduleFrame()

*

  • Manually schedules a `frame` event. If a `frame` event is already pending,
  • it is a no-op.

func (Output) SetCustomMode

func (o Output) SetCustomMode(width int, height int, refresh int)

*

  • Sets a custom mode on the output. *
  • When the output advertises fixed modes, custom modes are not guaranteed to
  • work correctly, they may result in visual artifacts. If a suitable fixed mode
  • is available, compositors should prefer it and use wlr_output_set_mode()
  • instead of custom modes. *
  • Setting `refresh` to zero lets the backend pick a preferred value. The
  • output needs to be enabled. *
  • Custom mode is double-buffered state, see wlr_output_commit().

func (Output) SetDescription

func (o Output) SetDescription(desc string)

func (Output) SetMode

func (o Output) SetMode(mode OutputMode)

*

  • Sets the output mode. The output needs to be enabled. *
  • Mode is double-buffered state, see wlr_output_commit().

func (Output) SetName

func (o Output) SetName(name string)

*

  • Set the output name. *
  • Output names are subject to the following rules: *
  • - Each output name must be unique.
  • - The name cannot change after the output has been advertised to clients. *
  • For more details, see the protocol documentation for wl_output.name.

func (Output) SetScale

func (o Output) SetScale(scale float32)

*

  • Sets a scale for the output. *
  • Scale is double-buffered state, see wlr_output_commit().

func (Output) SetTitle

func (o Output) SetTitle(title string) error

func (Output) Test

func (o Output) Test() bool

*

  • Test whether the pending output state would be accepted by the backend. If
  • this function returns true, wlr_output_commit() can only fail due to a
  • runtime error. *
  • This function doesn't mutate the pending state.

func (Output) TestState

func (o Output) TestState(s OutputState) bool

*

  • Test whether this output state would be accepted by the backend. If this
  • function returns true, wlr_output_commit_state() will only fail due to a
  • runtime error. This function does not change the current state of the
  • output.

func (Output) TransformMatrix

func (o Output) TransformMatrix() Matrix

func (Output) TransformedResolution

func (o Output) TransformedResolution() (int, int)

*

  • Computes the transformed output resolution.

type OutputLayout

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

func NewOutputLayout

func NewOutputLayout() OutputLayout

func OutputLayoutCerate

func OutputLayoutCerate() OutputLayout

func (OutputLayout) AddOutputAuto

func (l OutputLayout) AddOutputAuto(output Output) OutputLayoutOutput

func (OutputLayout) Coords

func (l OutputLayout) Coords(output Output) (x float64, y float64)

func (OutputLayout) Destroy

func (l OutputLayout) Destroy()

type OutputLayoutOutput

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

type OutputMode

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

func (OutputMode) Height

func (m OutputMode) Height() int

func (OutputMode) PictureAspectRatio

func (m OutputMode) PictureAspectRatio() OutputModeAspectRatio

func (OutputMode) Preferred

func (m OutputMode) Preferred() bool

func (OutputMode) Refresh

func (m OutputMode) Refresh() int

mHz

func (OutputMode) Width

func (m OutputMode) Width() int

type OutputModeAspectRatio

type OutputModeAspectRatio uint32

type OutputSdaptiveSyncStatus

type OutputSdaptiveSyncStatus uint32

type OutputState

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

*

  • Holds the double-buffered output state.

func NewOutputState

func NewOutputState() OutputState

func (OutputState) Finish

func (os OutputState) Finish()

func (OutputState) SetMode

func (os OutputState) SetMode(mode OutputMode)

func (OutputState) StateInit

func (os OutputState) StateInit()

func (OutputState) StateSetEnabled

func (os OutputState) StateSetEnabled(enabled bool)

type OutputStateField

type OutputStateField uint32

type Renderer

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

func (Renderer) Begin

func (r Renderer) Begin(output Output, width int, height int)

func (Renderer) Clear

func (r Renderer) Clear(color *Color)

func (Renderer) Destroy

func (r Renderer) Destroy()

func (Renderer) End

func (r Renderer) End()

func (Renderer) InitDisplay

func (r Renderer) InitDisplay(display Display)

func (Renderer) OnDestroy

func (r Renderer) OnDestroy(cb func(Renderer))

func (Renderer) RenderRect

func (r Renderer) RenderRect(box *GeoBox, color *Color, projection *Matrix)

func (Renderer) RenderTextureWithMatrix

func (r Renderer) RenderTextureWithMatrix(texture Texture, matrix *Matrix, alpha float32)

type Scene

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

* The root scene-graph node.

func NewScene

func NewScene() Scene

func (Scene) AttachOutputLayout

func (s Scene) AttachOutputLayout(layout OutputLayout) SceneOutputLayout

func (Scene) NewOutput

func (s Scene) NewOutput(o Output) SceneOutput

func (Scene) OutputCreate

func (s Scene) OutputCreate(o Output) SceneOutput

func (Scene) SceneOutput

func (s Scene) SceneOutput(o Output) (SceneOutput, error)

func (Scene) Tree

func (s Scene) Tree() SceneTree

type SceneBuffer

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

* A scene-graph node displaying a buffer

func (SceneBuffer) SceneSurface

func (sb SceneBuffer) SceneSurface() SceneSurface

*

  • If this buffer is backed by a surface, then the struct wlr_scene_surface is
  • returned. If not, NULL will be returned.

func (SceneBuffer) SendFrameDone

func (sb SceneBuffer) SendFrameDone(when time.Time)

*

  • Calls the buffer's frame_done signal.

func (SceneBuffer) SetBuffer

func (sb SceneBuffer) SetBuffer(b Buffer)

type SceneNode

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

* A node is an object in the scene.

func (SceneNode) At

*

  • Find the topmost node in this scene-graph that contains the point at the
  • given layout-local coordinates. (For surface nodes, this means accepting
  • input events at that point.) Returns the node and coordinates relative to the
  • returned node, or NULL if no node is found at that location.

func (SceneNode) Destroy

func (sn SceneNode) Destroy()

*

  • Immediately destroy the scene-graph node.

func (SceneNode) LowerToBottom

func (sn SceneNode) LowerToBottom()

*

  • Move the node below all of its sibling nodes.

func (SceneNode) Nil

func (sn SceneNode) Nil() bool

func (SceneNode) Parent

func (sn SceneNode) Parent() SceneTree

func (SceneNode) PlaceAbove

func (sn SceneNode) PlaceAbove(sib SceneNode)

*

  • Move the node right above the specified sibling.
  • Asserts that node and sibling are distinct and share the same parent.

func (SceneNode) PlaceBellow

func (sn SceneNode) PlaceBellow(sib SceneNode)

*

  • Move the node right below the specified sibling.
  • Asserts that node and sibling are distinct and share the same parent.

func (SceneNode) RaiseToTop

func (sn SceneNode) RaiseToTop()

*

  • Move the node above all of its sibling nodes.

func (SceneNode) Reparent

func (sn SceneNode) Reparent(tree SceneTree)

*

  • Move the node to another location in the tree.

func (SceneNode) SceneBuffer

func (sn SceneNode) SceneBuffer() SceneBuffer

*

  • If this node represents a wlr_scene_buffer, that buffer will be returned. It
  • is not legal to feed a node that does not represent a wlr_scene_buffer.

func (SceneNode) SceneRect

func (sn SceneNode) SceneRect() SceneRect

*

  • If this node represents a wlr_scene_rect, that rect will be returned. It
  • is not legal to feed a node that does not represent a wlr_scene_rect.

func (SceneNode) SceneTree

func (sn SceneNode) SceneTree() SceneTree

*

  • If this node represents a wlr_scene_tree, that tree will be returned. It
  • is not legal to feed a node that does not represent a wlr_scene_tree.

func (SceneNode) SceneTreeFromData

func (x SceneNode) SceneTreeFromData() SceneTree

func (SceneNode) SetData

func (sn SceneNode) SetData(tree SceneTree)

func (SceneNode) SetEnabled

func (sn SceneNode) SetEnabled(enabled bool)

*

  • Enable or disable this node. If a node is disabled, all of its children are
  • implicitly disabled as well.

func (SceneNode) SetPosition

func (sn SceneNode) SetPosition(x float64, y float64)

*

  • Set the position of the node relative to its parent.

func (SceneNode) Type

func (sn SceneNode) Type() SceneNodeType

func (SceneNode) X

func (sn SceneNode) X() int

relative to parent

func (SceneNode) Y

func (sn SceneNode) Y() int

relative to parent

type SceneNodeType

type SceneNodeType uint32
const (
	SceneNodeTree   SceneNodeType = C.WLR_SCENE_NODE_TREE
	SceneNodeRect   SceneNodeType = C.WLR_SCENE_NODE_RECT
	SceneNodeBuffer SceneNodeType = C.WLR_SCENE_NODE_BUFFER
)

type SceneOutput

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

* A viewport for an output in the scene-graph

func (SceneOutput) Commit

func (s SceneOutput) Commit()

func (SceneOutput) Destroy

func (s SceneOutput) Destroy()

func (SceneOutput) SendFrameDone

func (s SceneOutput) SendFrameDone(when time.Time)

type SceneOutputLayout

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

func (SceneOutputLayout) AddOutput

func (sol SceneOutputLayout) AddOutput(l OutputLayoutOutput, o SceneOutput)

type SceneRect

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

* A scene-graph node displaying a solid-colored rectangle

type SceneSurface

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

* A scene-graph node displaying a single surface.

func (SceneSurface) Nil

func (s SceneSurface) Nil() bool

func (SceneSurface) Surface

func (s SceneSurface) Surface() Surface

type SceneTimer

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

type SceneTree

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

* A sub-tree in the scene-graph.

func (SceneTree) BufferCreate

func (parent SceneTree) BufferCreate(b Buffer) SceneBuffer

func (SceneTree) NewBuffer

func (parent SceneTree) NewBuffer(b Buffer) SceneBuffer

func (SceneTree) NewSceneTree

func (parent SceneTree) NewSceneTree() SceneTree

*

  • Add a node displaying nothing but its children.

func (SceneTree) NewSurface

func (parent SceneTree) NewSurface(surface Surface) SceneSurface

func (SceneTree) NewXDGSurface

func (st SceneTree) NewXDGSurface(s XDGSurface) SceneTree

func (SceneTree) Nil

func (st SceneTree) Nil() bool

func (SceneTree) Node

func (st SceneTree) Node() SceneNode

func (SceneTree) XDGSurfaceCreate

func (st SceneTree) XDGSurfaceCreate(s XDGSurface) SceneTree

*

  • Add a node displaying an xdg_surface and all of its sub-surfaces to the
  • scene-graph. *
  • The origin of the returned scene-graph node will match the top-left corner
  • of the xdg_surface window geometry.

type Seat

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

func (Seat) ClearPointerFocus

func (s Seat) ClearPointerFocus()

func (Seat) Destroy

func (s Seat) Destroy()

func (Seat) Keyboard

func (s Seat) Keyboard() Keyboard

func (Seat) KeyboardState

func (s Seat) KeyboardState() SeatKeyboardState

func (Seat) NotifyKeyboardEnter

func (s Seat) NotifyKeyboardEnter(surface Surface, k Keyboard)

func (Seat) NotifyKeyboardKey

func (s Seat) NotifyKeyboardKey(time uint32, keyCode uint32, state KeyState)

func (Seat) NotifyKeyboardModifiers

func (s Seat) NotifyKeyboardModifiers(k Keyboard)

func (Seat) NotifyPointerAxis

func (s Seat) NotifyPointerAxis(time uint32, orientation AxisOrientation, delta float64, deltaDiscrete int32, source AxisSource)

func (Seat) NotifyPointerButton

func (s Seat) NotifyPointerButton(time uint32, button uint32, state ButtonState)

func (Seat) NotifyPointerEnter

func (s Seat) NotifyPointerEnter(surface Surface, sx float64, sy float64)

func (Seat) NotifyPointerFrame

func (s Seat) NotifyPointerFrame()

func (Seat) NotifyPointerMotion

func (s Seat) NotifyPointerMotion(time uint32, sx float64, sy float64)

func (Seat) OnDestroy

func (s Seat) OnDestroy(cb func(Seat))

func (Seat) OnSetCursorRequest

func (s Seat) OnSetCursorRequest(cb func(client SeatClient, surface Surface, serial uint32, hotspotX int32, hotspotY int32))

func (Seat) PointerState

func (s Seat) PointerState() SeatPointerState

func (Seat) SetCapabilities

func (s Seat) SetCapabilities(caps SeatCapability)

func (Seat) SetKeyboard

func (s Seat) SetKeyboard(dev InputDevice)

type SeatCapability

type SeatCapability uint32
const (
	SeatCapabilityPointer  SeatCapability = C.WL_SEAT_CAPABILITY_POINTER
	SeatCapabilityKeyboard SeatCapability = C.WL_SEAT_CAPABILITY_KEYBOARD
	SeatCapabilityTouch    SeatCapability = C.WL_SEAT_CAPABILITY_TOUCH
)

type SeatClient

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

type SeatKeyboardState

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

func (SeatKeyboardState) FocusedSurface

func (s SeatKeyboardState) FocusedSurface() Surface

type SeatPointerState

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

func (SeatPointerState) FocusedClient

func (s SeatPointerState) FocusedClient() SeatClient

func (SeatPointerState) FocusedSurface

func (s SeatPointerState) FocusedSurface() Surface

type ServerDecoration

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

func (ServerDecoration) Mode

func (ServerDecoration) OnDestroy

func (d ServerDecoration) OnDestroy(cb func(ServerDecoration))

func (ServerDecoration) OnMode

func (d ServerDecoration) OnMode(cb func(ServerDecoration))

type ServerDecorationManager

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

func NewServerDecorationManager

func NewServerDecorationManager(display Display) ServerDecorationManager

func (ServerDecorationManager) OnDestroy

func (m ServerDecorationManager) OnDestroy(cb func(ServerDecorationManager))

func (ServerDecorationManager) OnNewMode

func (ServerDecorationManager) SetDefaultMode

type ServerDecorationManagerMode

type ServerDecorationManagerMode uint32

type SubCompositor

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

func (SubCompositor) OnDestroy

func (c SubCompositor) OnDestroy(cb func(SubCompositor))

type Surface

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

func (Surface) CurrentState

func (s Surface) CurrentState() SurfaceState

func (Surface) HasBuffer

func (s Surface) HasBuffer() bool

*

  • Whether or not this surface currently has an attached buffer. A surface has
  • an attached buffer when it commits with a non-null buffer in its pending
  • state. A surface will not have a buffer if it has never committed one, has
  • committed a null buffer, or something went wrong with uploading the buffer.

func (Surface) Map

func (s Surface) Map()

*

  • Map the surface. If the surface is already mapped, this is no-op. *
  • This function must only be used by surface role implementations.

func (Surface) Nil

func (s Surface) Nil() bool

func (Surface) OnDestroy

func (s Surface) OnDestroy(cb func(Surface))

func (Surface) RootSurface

func (s Surface) RootSurface() Surface

*

  • Get the root of the subsurface tree for this surface. Can return NULL if
  • a surface in the tree has been destroyed.

func (Surface) SendEnter

func (s Surface) SendEnter(o Output)

*

  • Notify the client that the surface has entered an output. *
  • This is a no-op if the surface has already entered the output.

func (Surface) SendFrameDone

func (s Surface) SendFrameDone(when time.Time)

*

  • Complete the queued frame callbacks for this surface. *
  • This will send an event to the client indicating that now is a good time to
  • draw its next frame.

func (Surface) SendLeave

func (s Surface) SendLeave(o Output)

*

  • Notify the client that the surface has left an output. *
  • This is a no-op if the surface has already left the output.

func (Surface) SurfaceAt

func (s Surface) SurfaceAt(sx float64, sy float64) (surface Surface, subX float64, subY float64)

func (Surface) Texture

func (s Surface) Texture() Texture

*

  • Get the texture of the buffer currently attached to this surface. Returns
  • NULL if no buffer is currently attached or if something went wrong with
  • uploading the buffer.

func (Surface) Type

func (s Surface) Type() SurfaceType

func (Surface) Unmap

func (s Surface) Unmap()

*

  • Unmap the surface. If the surface is already unmapped, this is no-op. *
  • This function must only be used by surface role implementations.

func (Surface) Walk

func (s Surface) Walk(visit func())

func (Surface) XDGSurface

func (s Surface) XDGSurface() XDGSurface

func (Surface) XDGTopLevel

func (s Surface) XDGTopLevel() (XDGTopLevel, error)

func (Surface) XWaylandSurface

func (s Surface) XWaylandSurface() XWaylandSurface

*

  • Get a struct wlr_xwayland_surface from a struct wlr_surface. *
  • If the surface hasn't been created by Xwayland or has no X11 window
  • associated, NULL is returned.

type SurfaceOutput

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

func (SurfaceOutput) Output

func (s SurfaceOutput) Output() Output

func (SurfaceOutput) Surface

func (s SurfaceOutput) Surface() Surface

type SurfaceRole

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

func (SurfaceRole) Name

func (s SurfaceRole) Name() string

func (SurfaceRole) NoObject

func (s SurfaceRole) NoObject() bool

*

  • If true, the role isn't represented by any object.
  • For example, this applies to cursor surfaces.

type SurfaceState

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

func (SurfaceState) Buffer

func (s SurfaceState) Buffer() Buffer

func (SurfaceState) BufferHeight

func (s SurfaceState) BufferHeight() int

func (SurfaceState) BufferWidth

func (s SurfaceState) BufferWidth() int

func (SurfaceState) Commited

func (s SurfaceState) Commited() SurfaceStateField

func (SurfaceState) DX

func (s SurfaceState) DX() int

relative to previous position

func (SurfaceState) DY

func (s SurfaceState) DY() int

relative to previous position

func (SurfaceState) Height

func (s SurfaceState) Height() int

in surface-local coordinates

func (SurfaceState) Scale

func (s SurfaceState) Scale() int

func (SurfaceState) Transform

func (s SurfaceState) Transform() uint32

func (SurfaceState) Width

func (s SurfaceState) Width() int

in surface-local coordinates

type SurfaceType

type SurfaceType uint32
const (
	SurfaceTypeNone SurfaceType = iota
	SurfaceTypeXDG
	SurfaceTypeXWayland
)

type Texture

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

func (Texture) Destroy

func (t Texture) Destroy()

func (Texture) Nil

func (t Texture) Nil() bool

type XCursor

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

func (XCursor) Image

func (c XCursor) Image(i int) XCursorImage

func (XCursor) ImageCount

func (c XCursor) ImageCount() int

func (XCursor) Images

func (c XCursor) Images() []XCursorImage

func (XCursor) Name

func (c XCursor) Name() string

type XCursorImage

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

type XCursorManager

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

func NewXCursorManager

func NewXCursorManager(name string, size int) XCursorManager

func (XCursorManager) Destroy

func (m XCursorManager) Destroy()

func (XCursorManager) Load

func (m XCursorManager) Load(scale float32)

type XDGPopup

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

func (XDGPopup) Base

func (x XDGPopup) Base() XDGSurface

func (XDGPopup) Parent

func (x XDGPopup) Parent() Surface

func (XDGPopup) Seat

func (x XDGPopup) Seat() Seat

type XDGShell

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

func (XDGShell) OnDestroy

func (s XDGShell) OnDestroy(cb func(XDGShell))

func (XDGShell) OnNewSurface

func (s XDGShell) OnNewSurface(cb func(XDGSurface))

func (XDGShell) PingTimeout

func (s XDGShell) PingTimeout() int

func (XDGShell) Version

func (s XDGShell) Version() int

type XDGSurface

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

func (XDGSurface) Geometry

func (x XDGSurface) Geometry() GeoBox

func (XDGSurface) Nil

func (x XDGSurface) Nil() bool

func (XDGSurface) OnDestroy

func (x XDGSurface) OnDestroy(cb func(XDGSurface))

func (XDGSurface) OnMap

func (x XDGSurface) OnMap(cb func(XDGSurface))

func (XDGSurface) OnNewPopup

func (x XDGSurface) OnNewPopup(cb func(XDGSurface, XDGPopup))

func (XDGSurface) OnPingTimeout

func (x XDGSurface) OnPingTimeout(cb func(XDGSurface))

func (XDGSurface) OnUnmap

func (x XDGSurface) OnUnmap(cb func(XDGSurface))

func (XDGSurface) Ping

func (x XDGSurface) Ping()

func (XDGSurface) Popup

func (x XDGSurface) Popup() XDGPopup

func (XDGSurface) Role

func (x XDGSurface) Role() XDGSurfaceRole

*

  • The lifetime-bound role of the xdg_surface. WLR_XDG_SURFACE_ROLE_NONE
  • if the role was never set.

func (XDGSurface) SceneTree

func (x XDGSurface) SceneTree() SceneTree

func (XDGSurface) SendClose

func (x XDGSurface) SendClose()

func (XDGSurface) SetData

func (x XDGSurface) SetData(tree SceneTree)

func (XDGSurface) Surface

func (x XDGSurface) Surface() Surface

func (XDGSurface) SurfaceAt

func (x XDGSurface) SurfaceAt(sx float64, sy float64) (surface Surface, subX float64, subY float64)

func (XDGSurface) TopLevel

func (x XDGSurface) TopLevel() XDGTopLevel

func (XDGSurface) TopLevelSetActivated

func (x XDGSurface) TopLevelSetActivated(activated bool)

func (XDGSurface) TopLevelSetSize

func (x XDGSurface) TopLevelSetSize(width uint32, height uint32)

func (XDGSurface) TopLevelSetTiled

func (x XDGSurface) TopLevelSetTiled(edges Edges)

func (XDGSurface) Walk

func (x XDGSurface) Walk(visit XDGSurfaceWalkFunc)

type XDGSurfaceRole

type XDGSurfaceRole uint32
const (
	XDGSurfaceRoleNone     XDGSurfaceRole = C.WLR_XDG_SURFACE_ROLE_NONE
	XDGSurfaceRoleTopLevel XDGSurfaceRole = C.WLR_XDG_SURFACE_ROLE_TOPLEVEL
	XDGSurfaceRolePopup    XDGSurfaceRole = C.WLR_XDG_SURFACE_ROLE_POPUP
)

type XDGSurfaceWalkFunc

type XDGSurfaceWalkFunc func(surface Surface, sx int, sy int)

type XDGTopLevel

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

func (XDGTopLevel) AppId

func (t XDGTopLevel) AppId() string

func (XDGTopLevel) Base

func (t XDGTopLevel) Base() XDGSurface

func (XDGTopLevel) Nil

func (t XDGTopLevel) Nil() bool

func (XDGTopLevel) OnRequestMove

func (t XDGTopLevel) OnRequestMove(cb func(client SeatClient, serial uint32))

func (XDGTopLevel) OnRequestResize

func (t XDGTopLevel) OnRequestResize(cb func(client SeatClient, serial uint32, edges Edges))

func (XDGTopLevel) Parent

func (t XDGTopLevel) Parent() XDGTopLevel

func (XDGTopLevel) SetActivated

func (t XDGTopLevel) SetActivated(activated bool)

func (XDGTopLevel) Title

func (t XDGTopLevel) Title() string

type XWayland

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

func (XWayland) Destroy

func (x XWayland) Destroy()

func (XWayland) OnNewSurface

func (x XWayland) OnNewSurface(cb func(XWaylandSurface))

func (XWayland) SetCursor

func (x XWayland) SetCursor(img XCursorImage)

type XWaylandSurface

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

*

  • An Xwayland user interface component. It has an absolute position in
  • layout-local coordinates. *
  • The inner struct wlr_surface is valid once the associate event is emitted.
  • Compositors can set up e.g. map and unmap listeners at this point. The
  • struct wlr_surface becomes invalid when the dissociate event is emitted.

func (XWaylandSurface) Activate

func (s XWaylandSurface) Activate(activated bool)

func (XWaylandSurface) Configure

func (s XWaylandSurface) Configure(x int16, y int16, width uint16, height uint16)

func (XWaylandSurface) Geometry

func (s XWaylandSurface) Geometry() GeoBox

func (XWaylandSurface) OnDestroy

func (s XWaylandSurface) OnDestroy(cb func(XWaylandSurface))

func (XWaylandSurface) OnMap

func (s XWaylandSurface) OnMap(cb func(XWaylandSurface))

func (XWaylandSurface) OnRequestConfigure

func (s XWaylandSurface) OnRequestConfigure(cb func(surface XWaylandSurface, x int16, y int16, width uint16, height uint16))

func (XWaylandSurface) OnRequestMove

func (s XWaylandSurface) OnRequestMove(cb func(surface XWaylandSurface))

func (XWaylandSurface) OnRequestResize

func (s XWaylandSurface) OnRequestResize(cb func(surface XWaylandSurface, edges Edges))

func (XWaylandSurface) OnUnmap

func (s XWaylandSurface) OnUnmap(cb func(XWaylandSurface))

func (XWaylandSurface) Surface

func (s XWaylandSurface) Surface() Surface

Jump to

Keyboard shortcuts

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