Documentation
¶
Overview ¶
Package sharepicker is the screencast source picker (crates/lys-shell/src/shell/share_picker) the portal pops over dev.stubbe.lys.SharePicker1: a layer surface with Windows, Outputs, and Region pages. A card or region confirms at once in single-select mode; in multi-select mode cards toggle into a pending set the Share button confirms. The keyboard drives all of it: the opened page's first card holds the focus, Ctrl+PageUp/PageDown switch pages, the arrows move to the nearest card that way, and Enter or Space chooses. The reply is the XDPH selection suffix - `[r]/window:<id>`, `/screen:<name>`, `/region:<out>@x,y,w,h`, several payloads joined by `;` - or empty on cancel.
Index ¶
Constants ¶
const ( ServiceName = "dev.stubbe.lys.SharePicker1" ServicePath = "/dev/stubbe/lys/SharePicker" )
D-Bus identity (wayle-ipc's share_picker proxy).
Variables ¶
This section is empty.
Functions ¶
func JoinTargets ¶ added in v0.2.0
JoinTargets writes targets as ParseTargets reads them.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls the daemon: the `lys-shell portal share-picker` stub XDPH execs, and the portal backend's ScreenCast source selection.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon exports a Picker as dev.stubbe.lys.SharePicker1.
func (*Daemon) Export ¶
Export exports the object and claims the well-known name; the returned release drops the name.
type Deps ¶
type Deps struct {
// Config is the live config: each request reads [share-picker],
// the styling scale, and the animations afresh.
Config func() *config.Config
// Font shapes the labels; Sheet styles the surface.
Font render.Font
Sheet *widget.Stylesheet
// Describe names the app asking to share (desktopentry.Describe);
// nil for a request no portal app makes (the XDPH plugin).
Describe func(appID string) (name, icon string)
}
Deps are the picker's collaborators.
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is the share picker component. Pick is its entry point; the rest runs on the lys-ui loop goroutine.
func New ¶
func New(a *app.Application, d Deps, region *regionoverlay.Overlay) *Picker
New builds the picker on the application; region is the live region overlay the Region page opens.
func (*Picker) Dismiss ¶
Dismiss cancels the request at handle: the picker showing for it, with the region overlay it opened, is taken down; a waiting one never shows. Another request's picker stays.
func (*Picker) Pick ¶
func (p *Picker) Pick(c portaldialogs.Caller, r Request) string
Pick shows the picker for one portal request and blocks until the user selects or cancels. The request's window list is the raw XDPH_WINDOW_SHARING_LIST; its sources are the pages shown; its token flag seeds the restore-token box; multiple enables multi-select. A request arriving while one is open waits its turn. Call it from any goroutine but the loop's.
type Request ¶
Request is one pick, (subb): the XDPH window list ("" without one), the kinds of source offered, whether a restore token may be granted, and whether several sources may be picked.
type Sources ¶
type Sources uint32
Sources are the kinds of source a request may pick, a bit set.
const ( SourceOutputs Sources = 1 << iota SourceWindows SourceRegions AllSources = SourceOutputs | SourceWindows | SourceRegions )
The kinds of source; a region is part of an output.
type Target ¶ added in v0.2.0
type Target struct {
Kind TargetKind
// Name is the output connector, or the window identifier.
Name string
X, Y, Width, Height int32
}
Target is one source the user picked: an output by connector name, a window by its ext-foreign-toplevel identifier (or XDPH id), or a region of an output in its logical coordinates.
func ParseReply ¶ added in v0.2.0
ParseReply reads the picker's answer: `[r]/<payload>[;<payload>...]`, r granting a restore token. Empty is a cancel; any malformed piece rejects the whole reply.
func ParseTarget ¶ added in v0.2.0
ParseTarget reads one payload; anything malformed is no target.
func ParseTargets ¶ added in v0.2.0
ParseTargets reads `<payload>[;<payload>...]`; any malformed piece rejects them all.
type TargetKind ¶ added in v0.2.0
type TargetKind uint8
TargetKind is what a Target names.
const ( TargetOutput TargetKind = iota TargetWindow TargetRegion )
The kinds of target.