screencopy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_ALREADY_USED = 0

ERROR_ALREADY_USED is the error already_used value.

View Source
const ERROR_INVALID_BUFFER = 1

ERROR_INVALID_BUFFER is the error invalid_buffer value.

View Source
const FLAGS_Y_INVERT = 1

FLAGS_Y_INVERT is the flags y_invert value.

View Source
const ScreencopyFrameInterface = "zwlr_screencopy_frame_v1"

ScreencopyFrameInterface is the protocol interface name.

View Source
const ScreencopyManagerInterface = "zwlr_screencopy_manager_v1"

ScreencopyManagerInterface is the protocol interface name.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScreencopyFrame

type ScreencopyFrame struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

ScreencopyFrame is the generated binding for zwlr_screencopy_frame_v1 version 3.

func NewScreencopyFrame

func NewScreencopyFrame(ctx *wl.Context) *ScreencopyFrame

NewScreencopyFrame returns an unbound ScreencopyFrame.

func (*ScreencopyFrame) Copy

func (o *ScreencopyFrame) Copy(buffer *cross_wl_buffer.Buffer) error

Copy the frame to the supplied buffer. The buffer must have the correct size, see zwlr_screencopy_frame_v1.buffer and zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a supported format. If the frame is successfully copied, "flags" and "ready" events are sent. Otherwise, a "failed" event is sent.

func (*ScreencopyFrame) CopyWithDamage

func (o *ScreencopyFrame) CopyWithDamage(buffer *cross_wl_buffer.Buffer) error

Same as copy, except it waits until there is damage to copy.

func (*ScreencopyFrame) Destroy

func (o *ScreencopyFrame) Destroy() error

Destroys the frame. This request can be sent at any time by the client.

func (*ScreencopyFrame) Dispatch

func (o *ScreencopyFrame) Dispatch(event *wl.Event)

Dispatch decodes one event on zwlr_screencopy_frame_v1 and calls the registered handlers.

func (*ScreencopyFrame) EventSignature

func (o *ScreencopyFrame) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*ScreencopyFrame) OnBuffer

func (o *ScreencopyFrame) OnBuffer(handler func(format uint32, width uint32, height uint32, stride uint32))

OnBuffer registers a handler for the buffer event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnBufferDone

func (o *ScreencopyFrame) OnBufferDone(handler func())

OnBufferDone registers a handler for the buffer_done event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnDamage

func (o *ScreencopyFrame) OnDamage(handler func(x uint32, y uint32, width uint32, height uint32))

OnDamage registers a handler for the damage event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnFailed

func (o *ScreencopyFrame) OnFailed(handler func())

OnFailed registers a handler for the failed event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnFlags

func (o *ScreencopyFrame) OnFlags(handler func(flags uint32))

OnFlags registers a handler for the flags event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnLinuxDmabuf

func (o *ScreencopyFrame) OnLinuxDmabuf(handler func(format uint32, width uint32, height uint32))

OnLinuxDmabuf registers a handler for the linux_dmabuf event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ScreencopyFrame) OnReady

func (o *ScreencopyFrame) OnReady(handler func(tvSecHi uint32, tvSecLo uint32, tvNsec uint32))

OnReady registers a handler for the ready event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

type ScreencopyManager

type ScreencopyManager struct {
	wl.BaseProxy
}

ScreencopyManager is the generated binding for zwlr_screencopy_manager_v1 version 3.

func NewScreencopyManager

func NewScreencopyManager(ctx *wl.Context) *ScreencopyManager

NewScreencopyManager returns an unbound ScreencopyManager.

func (*ScreencopyManager) CaptureOutput

func (o *ScreencopyManager) CaptureOutput(overlayCursor int32, output *cross_wl_output.Output) (*ScreencopyFrame, error)

Capture the next frame of an entire output.

func (*ScreencopyManager) CaptureOutputRegion

func (o *ScreencopyManager) CaptureOutputRegion(overlayCursor int32, output *cross_wl_output.Output, x int32, y int32, width int32, height int32) (*ScreencopyFrame, error)

Capture the next frame of an output's region. The region is given in output logical coordinates, see xdg_output.logical_size. The region will be clipped to the output's extents.

func (*ScreencopyManager) Destroy

func (o *ScreencopyManager) Destroy() error

All objects created by the manager will still remain valid, until their appropriate destroy request has been called.

func (*ScreencopyManager) Dispatch

func (o *ScreencopyManager) Dispatch(event *wl.Event)

Dispatch decodes one event on zwlr_screencopy_manager_v1 and calls the registered handlers.

func (*ScreencopyManager) EventSignature

func (o *ScreencopyManager) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

Jump to

Keyboard shortcuts

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