v0.2.0 e178e0b

surface_types.go RawHistoryFolder

1package neferclient
2
3import "slices"
4
5// SurfaceID identifies a [Surface] in Handler callbacks. IDs are never
6// reused within a connection.
7type SurfaceID uint32
8
9// Format is one DRM format and modifier pair from linux-dmabuf feedback.
10type Format struct {
11	FourCC   uint32
12	Modifier uint64
13}
14
15// Feedback is the latest complete linux-dmabuf feedback of a surface.
16type Feedback struct {
17	MainDevice uint64   // dev_t of the compositor's main device
18	Formats    []Format // every tranche's formats, flattened in tranche order
19}
20
21// Equal reports whether f and o have the same main device and the same formats
22// in the same order. Feedback flattens tranches, so a change limited to a
23// tranche's target device or scanout flag is not visible here. A nil Feedback
24// equals only nil. The compositor sends a complete round again whenever it
25// re-evaluates its preference, often unchanged, so compare against the
26// feedback a renderer was built from before rebuilding it.
27func (f *Feedback) Equal(o *Feedback) bool {
28	if f == nil || o == nil {
29		return f == o
30	}
31	return f.MainDevice == o.MainDevice && slices.Equal(f.Formats, o.Formats)
32}
33
34// Clone returns a deep copy that stays valid after later rounds. The value from
35// [Surface.Feedback] shares memory the library reuses, so keep a Clone of the
36// feedback a renderer was built from. A nil Feedback clones to nil.
37func (f *Feedback) Clone() *Feedback {
38	if f == nil {
39		return nil
40	}
41	return &Feedback{MainDevice: f.MainDevice, Formats: slices.Clone(f.Formats)}
42}
43
44// Rect is an integer rectangle: surface-local logical pixels for input
45// regions, buffer pixels for damage.
46type Rect struct{ X, Y, Width, Height int32 }

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 1

Tags 4

↑↓ moveenter openesc close