v0.5.1 657f658

renderer.go RawHistoryFolder

1//go:build linux
2
3package nefergui
4
5import "github.com/bnema/nefergui/internal/ui"
6
7// Renderer renders views into DMA-BUF buffers for a Wayland client the
8// application owns. It imports no Wayland library, starts no goroutine and is
9// used from one owner goroutine. Typical loop: forward Wayland events with
10// Input and Resize, call Render when a redraw is needed, import and present
11// the Output buffer, and call Released when its ReleaseFD becomes readable.
12//
13// Pending() reports a built frame waiting for the GPU rather than the
14// compositor; arm a short timer (about 2 ms) and call Render again.
15//
16// Render is generic over the model type, so it is a generic method:
17//
18//	ok, err := r.Render(&out, &model, view)
19type Renderer = ui.Renderer
20
21// RendererConfig configures NewRenderer. MainDevice and Formats come from the
22// compositor's linux-dmabuf feedback.
23type RendererConfig = ui.RendererConfig
24
25// Format is a DRM format and modifier the compositor accepts.
26type Format = ui.Format
27
28// Input is one platform input event; Text is valid only during Renderer.Input.
29type Input = ui.Input
30
31// Output describes one frame to present, in physical pixels. All file
32// descriptors stay owned by the Renderer: duplicate them before handing them to
33// a transport that consumes descriptors. Slices are valid until the next Render.
34type Output = ui.Output
35
36// Plane, Timeline and Retired are parts of Output. A Timeline FD is valid only
37// when Output.NewTimelines is set. The client must stop watching and destroy
38// each Retired buffer before the next Render.
39type (
40	Plane    = ui.Plane
41	Timeline = ui.Timeline
42	Retired  = ui.Retired
43)
44
45// Clipboard is an optional asynchronous clipboard; IME an optional input method.
46type (
47	Clipboard = ui.Clipboard
48	IME       = ui.IME
49)
50
51// Cursor is the pointer shape the surface wants.
52type Cursor = ui.Cursor
53
54const (
55	CursorDefault    = ui.CursorDefault
56	CursorPointer    = ui.CursorPointer
57	CursorText       = ui.CursorText
58	CursorNotAllowed = ui.CursorNotAllowed
59)
60
61// NewRenderer opens the GPU named by cfg.MainDevice and loads fonts and
62// styles. It allocates no images.
63func NewRenderer(cfg RendererConfig) (*Renderer, error) { return ui.NewRenderer(cfg) }

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 12

↑↓ moveenter openesc close