Documentation
¶
Overview ¶
Caret debugger — press F5 in the demo to toggle stderr tracing for:
- space / char input (focus, cursor, buffer)
- caret draw color and lifecycle phase
- idle FPS blockers (needsRedraw, dirty nodes, wake)
F6 benchmark · F7 resize FPS · F10 draw-dirty · F11 perf overlay ¶
Draw-dirty debugger — press F10 to toggle per-frame dirty-node tracing.
When enabled, logs the first dirty nodes whenever a full SSAA redraw runs without an interactive wake (mouse/keyboard/resize). Use with F6 benchmark lines to correlate redraw=60 with the widgets still marking the tree dirty.
Idle guard — warns when hands-off frames cannot reach cleanForIdle (NeedsRedraw pinned).
Enable with GRU_IDLE_GUARD=1 (GORY_IDLE_GUARD alias) or toggle with F7 (resize FPS debug). See docs/IDLE_INVARIANTS.md.
Resize propagation debugger for the page shell → viewport → grid chain.
Go excludes files named *_test.go from normal builds (go run / go build), so this lives as debug_resize.go. Press F8 in the demo to print bounds.
Resize FPS debugger — press F7 in the demo to toggle detailed stderr logging.
Logs every target-FPS transition with a full snapshot of resize hold, idle policy inputs, and frame timing. While enabled, also emits throttled lines during active resize (~4/sec) so you can correlate actual FPS with hold state.
F6 = benchmark summary (1 line/sec). F7 = this trace. F8 = layout propagation.
WebView flash debugger — GRU_WEBVIEW_DEBUG=1 (GORY_WEBVIEW_DEBUG alias) or Shift+F11 while running.
Logs passthrough, visibility, and present skips when the embedded panel blanks.
Package main is the Gru demo launcher.
Press Tab (or the on-screen button) to cycle through the available demo scenes. Each scene is built by a function in the examples/ package.
Platform helpers for desktop vs Android (raylib NativeActivity).
This file is compiled on every GOOS; branches use isAndroidApp() so desktop keeps MSAA, custom chrome, and default window size. Android-only entry is main_android_init.go (build tag). See docs/ANDROID_CODE.md.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gru
command
gru is the Gru packaging CLI — build, test helpers, and package desktop apps.
|
gru is the Gru packaging CLI — build, test helpers, and package desktop apps. |
|
hello
command
hello is the public Gru sample — GRU core spine then a tiny scene (docs/GRU_CORE.md).
|
hello is the public Gru sample — GRU core spine then a tiny scene (docs/GRU_CORE.md). |
|
webviewhello
command
webviewhello — Gru WebView shell starter (window + title bar + HTML body).
|
webviewhello — Gru WebView shell starter (window + title bar + HTML body). |
|
devtools
|
|
|
studio
Package studio implements Gru Studio chrome — the internal demo launcher side panel.
|
Package studio implements Gru Studio chrome — the internal demo launcher side panel. |
|
Package examples (continued)
|
Package examples (continued) |
|
appinstance
Package appinstance forwards startup files to an already-running Gru Notepad.
|
Package appinstance forwards startup files to an already-running Gru Notepad. |
|
startuppath
Package startuppath resolves optional file paths from argv and environment.
|
Package startuppath resolves optional file paths from argv and environment. |
|
internal
|
|
|
appicon
Package appicon applies OS-facing GRU icons using raylib (SetWindowIcons) and embedded PNGs/ICOs.
|
Package appicon applies OS-facing GRU icons using raylib (SetWindowIcons) and embedded PNGs/ICOs. |
|
tray
Package tray hosts a desktop notification-area icon (separate goroutine; safe with raylib/GLFW).
|
Package tray hosts a desktop notification-area icon (separate goroutine; safe with raylib/GLFW). |
|
version
Package version holds release strings injected by cmd/gru at link time.
|
Package version holds release strings injected by cmd/gru at link time. |
|
media
|
|
|
imaging
Package imaging provides decode and thumbnail helpers for T2a (pure Go).
|
Package imaging provides decode and thumbnail helpers for T2a (pure Go). |
|
samples
|
|
|
hello
Package hello is the public “Hello, Gru” sample UI (not part of the demo catalog).
|
Package hello is the public “Hello, Gru” sample UI (not part of the demo catalog). |
|
webviewhello
Package webviewhello is the WebView shell sample — native chrome + HTML body.
|
Package webviewhello is the WebView shell sample — native chrome + HTML body. |
|
Package ui (continued) See node.go for the full package documentation.
|
Package ui (continued) See node.go for the full package documentation. |
|
markdown
Package markdown registers a goldmark (GFM) DocumentSpec bridge into package ui.
|
Package markdown registers a goldmark (GFM) DocumentSpec bridge into package ui. |
|
preview
Package preview provides focused preview widgets: markdown rendering, syntax highlighting, and math placeholders.
|
Package preview provides focused preview widgets: markdown rendering, syntax highlighting, and math placeholders. |
|
spell
Package spell registers a Hunspell/gospell SpellChecker backend into package ui.
|
Package spell registers a Hunspell/gospell SpellChecker backend into package ui. |
|
syntax
Package syntax registers Chroma-backed syntax highlighting into package ui.
|
Package syntax registers Chroma-backed syntax highlighting into package ui. |