clip

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: BSD-3-Clause Imports: 1 Imported by: 1

Documentation

Overview

Package clip defines the system clipboard for the GoGi GUI system. Data is represented using mimedata type codes and []byte raw data -- multiple different representations can be available -- in general when writing to the clipboard, having a text/plain version in addition to a more specific format is a good idea

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board interface {

	// IsEmpty returns true if there is nothing on the clipboard to read.  Can
	// be used for inactivating a Paste menu.
	IsEmpty() bool

	// Read attempts to read data of the given MIME type(s), in preference
	// order, from the clipboard, returning mimedata.Mimes which can
	// potentially have multiple types / multiple items, etc -- if first type
	// listed is a text type, then text-based retrieval is assumed -- always
	// put the most specific desired type first -- anything else present will
	// be returned
	Read(types []string) mimedata.Mimes

	// Write writes given mimedata to the clipboard -- in general having a
	// text/plain representation of the data in addition to a more specific
	// format is a good idea for anything more complex than plain text -- if
	// data has > 1 element, it is all encoded as a multipart MIME text string
	Write(data mimedata.Mimes) error

	// Clear clears the clipboard
	Clear()
}

clip.Board interface defines the methods for reading and writing data to the system clipboard -- uses mimedata to represent the data. Due to limitations of Windows (and linux to a lesser extent), a multipart MIME formatted string is used if there are multiple elements in the mimedata, with any binary data text-encoded using base64

type BoardBase added in v0.0.15

type BoardBase struct{}

BoardBase is a basic implementation of Board that does nothing.

func (*BoardBase) Clear added in v0.0.15

func (bb *BoardBase) Clear()

func (*BoardBase) IsEmpty added in v0.0.15

func (bb *BoardBase) IsEmpty() bool

func (*BoardBase) Read added in v0.0.15

func (bb *BoardBase) Read(types []string) mimedata.Mimes

func (*BoardBase) Write added in v0.0.15

func (bb *BoardBase) Write(data mimedata.Mimes) error

Jump to

Keyboard shortcuts

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