data

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package data implements the clipboard, the primary selection and drag and drop: wl_data_device_manager and zwp_primary_selection_device_manager_v1.

Index

Constants

This section is empty.

Variables

View Source
var ErrSourceUsed = errors.New("data: the source was already used")

Functions

func ReserveForDrag

func ReserveForDrag(res *sw.WlDataSource, refuse func() error) error

Types

type Drag

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

func (*Drag) Actions

func (d *Drag) Actions() Action

func (*Drag) Cancel

func (d *Drag) Cancel() error

func (*Drag) Carries

func (d *Drag) Carries(res *sw.WlDataSource) bool

func (*Drag) Drop

func (d *Drag) Drop() error

func (*Drag) Finished

func (d *Drag) Finished(ok bool) error

func (*Drag) Icon

func (d *Drag) Icon() (*surface.Surface, image.Point)

func (*Drag) Motion

func (d *Drag) Motion(target *surface.Surface, x, y float64, at time.Duration) error

func (*Drag) Origin

func (d *Drag) Origin() *surface.Surface

func (*Drag) Serial

func (d *Drag) Serial() uint32

func (*Drag) Source

func (d *Drag) Source() Source

func (*Drag) Status

func (d *Drag) Status(accepted bool, action Action) error

type DragSource

type DragSource interface {
	Source
	Actions() Action
	Target(mime *string) error
	Action(a Action) error
	DropPerformed() error
	Finished() error
}

type DropTarget

type DropTarget interface {
	Takes(s *surface.Surface) bool
	DragEnter(d *Drag, s *surface.Surface, x, y float64) error
	DragMotion(x, y float64) error
	DragLeave() error
	DragDrop() error
}

type Kind

type Kind uint8
const (
	Clipboard Kind = iota
	Primary
)

type Listener

type Listener interface {
	CanDrag(origin *surface.Surface, serial uint32) bool
	DragStarted(d *Drag) error
	DragEnded(d *Drag) error
	SelectionChanged(k Kind, src Source) error
}

type Manager

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

func New

func New(d *server.Display, listener Listener) (*Manager, error)

func (*Manager) Dragging

func (m *Manager) Dragging() bool

func (*Manager) Selection

func (m *Manager) Selection(k Kind) Source

func (*Manager) SetDropTarget

func (m *Manager) SetDropTarget(t DropTarget)

func (*Manager) SetFocus

func (m *Manager) SetFocus(c *server.Client) error

func (*Manager) SetSelection

func (m *Manager) SetSelection(k Kind, src Source) error

func (*Manager) StartForeignDrag

func (m *Manager) StartForeignDrag(src DragSource) (*Drag, error)

type Source

type Source interface {
	Client() *server.Client
	Mimes() []string
	Send(mime string, fd int) error
	Cancel() error
}

Jump to

Keyboard shortcuts

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