Improve doc comments on the Requestor interface

This commit is contained in:
Sasha Koshka 2024-07-05 23:38:57 -04:00
parent c8b7059976
commit d1ba6eac9a

View File

@ -20,9 +20,20 @@ type selReqState int; const (
// Requestor provices details about the request such as the window that is
// requesting the selection data, and what targets it accepts.
type Requestor interface {
Window () *xwindow.Window
Choose (from []Target) (chosen Target, ok bool)
// Window returns the window that is requesting the selection data.
Window () *xwindow.Window
// Choose picks target from a slice of available targets and returns
// (target, true). If no target was picket, it returns ("", false).
Choose (available []Target) (target Target, ok bool)
// Success is called once the owner responds with data. The data must be
// closed once it has been read.
Success (Target, io.ReadCloser)
// Failure is called if the transfer fails at any point, or if there
// isn't any data to begin with. In the first case, an error is given.
// In the second case, the error will be nil.
Failure (error)
}