Documentation ¶
Overview ¶
Package xgbsel provides easy clipboard/selection manipulation and access with xgb and xgbutil.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claim ¶
type Claim struct {
// contains filtered or unexported fields
}
Claim represents a claim that a window has on a particular selection.
func NewClaim ¶
NewClaim claims ownership of a specified selection, and allows using data passed to it to fulfill requests for the selection's contents.
func (*Claim) HandleSelectionRequest ¶
func (claim *Claim) HandleSelectionRequest( connection *xgbutil.XUtil, event xevent.SelectionRequestEvent, )
While the selection claim is active, HandleSelectionRequest should be called when the owner window recieves a SelectionRequest event.
type Confidence ¶
type Confidence int
const ( ConfidenceNone Confidence = iota ConfidencePartial ConfidenceFull )
type Data ¶
type Data interface { Convert(Target) (reader io.ReadSeekCloser, ok bool) Supported() []Target }
Data represents a polymorphic data structure
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents an ongoing request for the selection contents.
func NewRequest ¶
NewRequest sends a new selection request.
func (*Request) HandlePropertyNotify ¶
func (request *Request) HandlePropertyNotify( connection *xgbutil.XUtil, event xevent.PropertyNotifyEvent, )
While the selection request is active, HandlePropertyNotify should be called when the requesting window recieves a PropertyNotify event.
func (*Request) HandleSelectionNotify ¶
func (request *Request) HandleSelectionNotify( connection *xgbutil.XUtil, event xevent.SelectionNotifyEvent, )
While the selection request is active, HandleSelectionNotify should be called when the requesting window recieves a SelectionNotify event.
type Requestor ¶
type Requestor interface { Window() *xwindow.Window Choose(from []Target) (chosen Target, ok bool) Success(Target, io.ReadCloser) Failure(error) }
Requestor provices details about the request such as the window that is requesting the selection data, and what targets it accepts.
type Target ¶
type Target string
Target represents an X selection target. It defines the type of data stored within an X selection. This data may be a mime type, or a more specific name that is unique to X. A list of these names can be found here: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.2
func MimeToTargets ¶
MimeToTargets returns a list of targets that correspond to a specified MIME type.
func (Target) ToMime ¶
func (target Target) ToMime() (string, Confidence)
ToMime converts the specified target to a MIME type. Because a single MIME type may correspond to several targets, a confidence value is returned representing how good of a match it is. If data is represented by multiple targets, they can be checked one after the other and the one with the highest confidence value chosen.