Compare commits
No commits in common. "c8b70599764598225853e15751f8a833e2b0d115" and "49eff984ab2ff6bdcc15e2dc6d5e85b0a114b8ca" have entirely different histories.
c8b7059976
...
49eff984ab
3
claim.go
3
claim.go
@ -102,8 +102,7 @@ func (claim *Claim) fulfillSelectionRequest (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// While the selection claim is active, HandleSelectionRequest should be called
|
// While the selection claim is active, HandleSelectionRequest should be called
|
||||||
// when the owner window recieves a SelectionRequest event. This must be
|
// when the owner window recieves a SelectionRequest event.
|
||||||
// registered as an event handler manually.
|
|
||||||
func (claim *Claim) HandleSelectionRequest (
|
func (claim *Claim) HandleSelectionRequest (
|
||||||
connection *xgbutil.XUtil,
|
connection *xgbutil.XUtil,
|
||||||
event xevent.SelectionRequestEvent,
|
event xevent.SelectionRequestEvent,
|
||||||
|
|||||||
24
data.go
24
data.go
@ -3,25 +3,18 @@ package xgbsel
|
|||||||
import "io"
|
import "io"
|
||||||
import "strings"
|
import "strings"
|
||||||
|
|
||||||
// Data represents X selection data.
|
// Data represents a polymorphic data structure
|
||||||
type Data interface {
|
type Data interface {
|
||||||
// Convert converts the data to the specified target and returns it. If
|
|
||||||
// the target is not supported, this behavior will return false for ok.
|
|
||||||
Convert (Target) (reader io.ReadSeekCloser, ok bool)
|
Convert (Target) (reader io.ReadSeekCloser, ok bool)
|
||||||
|
|
||||||
// Supported returns a slice of targets that Convert can accept. This
|
|
||||||
// can just be the result of MimeToTargets.
|
|
||||||
Supported () []Target
|
Supported () []Target
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target represents an X selection target. It defines the type of data stored
|
// 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
|
// 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:
|
// 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
|
// https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.2
|
||||||
type Target string
|
type Target string
|
||||||
|
|
||||||
// Confidence represents how accurate a conversion from a target to a MIME type
|
|
||||||
// is.
|
|
||||||
type Confidence int; const (
|
type Confidence int; const (
|
||||||
ConfidenceNone Confidence = iota
|
ConfidenceNone Confidence = iota
|
||||||
ConfidencePartial
|
ConfidencePartial
|
||||||