main f2d166b

screencast_messages.go RawHistoryFolder

1package ports
2
3import "time"
4
5// The cast messages are concrete structs, not sealed interfaces, so a send
6// on a channel never boxes them (zero allocation per frame).
7
8// CastCommandKind selects the CastCommand fields in use.
9type CastCommandKind uint8
10
11const (
12	// CastOpen starts cast ID on Output or Window.
13	CastOpen CastCommandKind = iota + 1
14	// CastFrame asks for one frame into buffer Buf.
15	CastFrame
16	// CastClose ends cast ID. Wayland sends no CastStopped for it; a frame
17	// still in flight is answered with its CastFrameDone as usual.
18	CastClose
19)
20
21// CastCommand carries screencast → wayland: open or close a cast, or request
22// one frame into a PipeWire buffer.
23type CastCommand struct {
24	Kind CastCommandKind
25	ID   uint64
26	// CastOpen: the target. A window cast sets Window and leaves Output empty.
27	Output string
28	Window WindowID
29	Cursor bool
30	// CastFrame: Buf is the buffer slot. Data is the buffer's mapping,
31	// borrowed until the CastFrameDone of Buf: the sender neither reuses nor
32	// unmaps it before then.
33	Buf           int
34	Data          []byte
35	Stride        int
36	Width, Height int
37	Format        uint32 // wl_shm format
38}
39
40// CastEventKind selects the CastEvent fields in use.
41type CastEventKind uint8
42
43const (
44	// CastSize: the target is now Width x Height; the stream must renegotiate.
45	CastSize CastEventKind = iota + 1
46	// CastDamage: the target changed and a frame may be requested. Time is
47	// the flip time.
48	CastDamage
49	// CastFrameDone: the frame into Buf finished. Err is nil when Data holds
50	// a complete image; Time is the capture time.
51	CastFrameDone
52	// CastStopped: the cast ended (Reason, Err); no event follows.
53	CastStopped
54)
55
56// CastEvent carries wayland → screencast through CastSink.Push.
57type CastEvent struct {
58	Kind          CastEventKind
59	ID            uint64
60	Width, Height int
61	Buf           int
62	Err           error
63	Time          time.Time
64	Reason        CaptureReason
65}
66
67// CastOutput is one output of the inventory.
68type CastOutput struct {
69	Info    OutputInfo
70	Modes   []OutputMode
71	Current int // index into Modes, -1 when none
72	// X, Y, Width, Height are the logical placement.
73	X, Y, Width, Height int
74	Scale               float64
75	Transform           BufferTransform
76}
77
78// CastWindow is one window of the inventory.
79type CastWindow struct {
80	ID           WindowID
81	AppID, Title string
82}
83
84// CastInventory is the set a cast target is picked from.
85type CastInventory struct {
86	Outputs []CastOutput
87	Windows []CastWindow
88	Focused string // name of the focused output
89}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close