glutter

module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: BSD-3-Clause

README

Glutter

Glutter is a GUI toolkit for Go that has Flutter's framework API: widgets, rendering, gestures, animation and Material 3. It runs on its own engine: a Wayland and X11 platform layer and a Vulkan renderer with an OpenGL ES 3.0 fallback, with the system libraries called through purego, and text layout on go-text. There is no cgo: CGO_ENABLED=0 go build makes the app, and Go is all you need to build it.

Linux desktop comes first. Every part that depends on the operating system or the GPU sits behind an internal interface, so Windows, macOS, the web and mobile can be added later.

The counter example The gallery, light
examples/counter examples/gallery, light and dark, every Material 3 component

Install

You need Go 1.27 or newer, and nothing else to build:

go get github.com/rm4n0s/glutter@latest

Apps import one package, the way Flutter's apps import material.dart:

import m "github.com/rm4n0s/glutter/material"

Try the examples from a clone: go run ./examples/counter, go run ./examples/gallery.

Quick start

This is examples/counter, the app that flutter create makes:

package main

import (
	"log"
	"strconv"

	m "github.com/rm4n0s/glutter/material"
)

func main() {
	err := m.RunApp(NewMyApp(), m.RunAppOpts{
		AppID:  "dev.glutter.counter",
		Window: m.WindowConfig{Title: "Counter", Size: m.Size{Width: 480, Height: 640}},
	})
	if err != nil {
		log.Fatal(err)
	}
}

type MyApp struct{ m.StatelessWidget }

func NewMyApp() *MyApp { return &MyApp{} }

func (a *MyApp) Build(bc m.BuildContext) m.Widget {
	return m.NewMaterialApp(m.MaterialAppOpts{
		Title:                      "Counter",
		Theme:                      m.NewThemeData(m.ThemeDataOpts{ColorSchemeSeed: m.Some(m.Colors.Blue.Primary)}),
		DebugShowCheckedModeBanner: m.Some(false),
		Home:                       NewCounterPage("Counter"),
	})
}

type CounterPage struct {
	m.StatefulWidget
	title string
}

func NewCounterPage(title string, opts ...m.WidgetOpts) *CounterPage {
	return &CounterPage{StatefulWidget: m.NewStatefulWidgetBase(opts...), title: title}
}

func (p *CounterPage) Title() string        { return p.title }
func (p *CounterPage) CreateState() m.State { return &counterPageState{} }

type counterPageState struct {
	m.StateOf[*CounterPage]
	count int
}

func (s *counterPageState) increment() { s.SetState(func() { s.count++ }) }

func (s *counterPageState) Build(bc m.BuildContext) m.Widget {
	return m.NewScaffold(m.ScaffoldOpts{
		AppBar: m.NewAppBar(m.AppBarOpts{Title: m.NewText(s.Widget().Title())}),
		Body: m.NewCenter(
			m.NewColumn([]m.Widget{
				m.NewText("You have pushed the button this many times:"),
				m.NewText(strconv.Itoa(s.count), m.TextOpts{Style: m.ThemeOf(bc).TextTheme.HeadlineMedium}),
			}, m.ColumnOpts{MainAxisAlignment: m.MainAxisAlignmentCenter}),
		),
		FloatingActionButton: m.NewFloatingActionButton(s.increment, m.NewIcon(m.Icons.Add()),
			m.FloatingActionButtonOpts{Tooltip: "Increment"}),
	})
}

Run it with go run .. The code reads like the Dart one: SetState, Scaffold, AppBar, FloatingActionButton, ThemeOf(bc).TextTheme.HeadlineMedium.

Fonts

An app loads its own fonts, for example a monospace font for a code view, from bytes or from its assets, and names them in TextStyle.FontFamily and FontFamilyFallback. The families of a style are tried in order, and the system's default font comes last, so monospace as a fallback reaches the user's monospace font. services.FontLoader and PlatformDispatcher.LoadFontFromList load a font while the app runs, and gluttertest.Opts.Fonts gives a widget test its fonts. docs/GUIDE.md has the details.

A code view also wants tab stops: TextPainterOpts.TabSize puts the stops that many spaces apart, measured from the start of each line, as CSS's tab-size does (Flutter has none, so the default is off). The text engine keeps the shaped runs of the lines it builds, so a line whose spans did not change is built again several times faster than it was the first time.

var editorStyle = m.NewTextStyle(m.TextStyleOpts{
	FontFamily:         "JetBrains Mono",
	FontFamilyFallback: []string{"monospace"},
})

func options(mono []byte) m.RunAppOpts {
	return m.RunAppOpts{Fonts: []m.FontSource{{Family: "JetBrains Mono", Data: mono}}}
}

An app that lives in the system tray closes its window to the tray: SetHidden(true) on the window's controller takes it off the screen and the task bar while the app goes on, and SetHidden(false) or Activate() brings it back as it was (Flutter has no counterpart; examples/tray does it from AppLifecycleListener.OnExitRequested).

From Flutter to Glutter

Flutter Glutter
Text('hi') m.NewText("hi")
Padding(padding: EdgeInsets.all(8), child: c) m.NewPadding(m.NewEdgeInsetsAll(8), c)
Container(width: 100, color: Colors.blue, child: c) m.NewContainer(c, m.ContainerOpts{Width: m.Some(100.0), Color: m.Some(m.Colors.Blue.Primary)})
ListView.builder(itemBuilder: ...) m.NewListViewBuilder(func(bc m.BuildContext, i int) m.Widget {...})
Theme.of(context) m.ThemeOf(bc)
Navigator.push(context, route) m.NavigatorPush(bc, route); the result comes from a channel
MainAxisAlignment.center m.MainAxisAlignmentCenter
Icons.add m.Icons.Add()
setState(() {...}) s.SetState(func() {...})
Future, await func(ctx context.Context) (T, error), goroutines, State.Go

The required parameters are positional (child and children last), the optional ones are fields of a trailing XOpts struct, a nullable parameter is m.Some(v), and the zero value of an enum, XUnspecified, means the widget's default. The rules are in SPEC §12, every difference from Flutter is in §12.10, and docs/GUIDE.md shows eleven things side by side in Dart and Go.

What runs where

Required at run time:

  • a Wayland compositor with xdg_wm_base, or an X server
  • a GPU driver: either Vulkan 1.3 (or 1.1 with dynamic rendering and synchronization 2; libvulkan.so.1 and a driver such as Mesa's RADV, ANV or NVK, or NVIDIA's), or an EGL driver with OpenGL ES 3.0 (Mesa 20 or newer, NVIDIA through glvnd, or llvmpipe). Glutter uses Vulkan where it works and falls back to OpenGL ES where it does not, without being told
  • the libraries that every Linux desktop has (Wayland, xkbcommon, libdecor where the compositor draws no title bars, EGL); a missing one is reported as a tagged error

Optional: a D-Bus session bus (file dialogs, notifications, the tray, settings, opening URLs), xdg-desktop-portal and a backend, a StatusNotifierItem host for the tray, and at-spi2-core for accessibility (screen readers such as Orca). SPEC §16 has the list.

GLUTTER_BACKEND=x11|wayland chooses the backend; the default is Wayland when it is there. GLUTTER_RENDERER=auto|vulkan|gles chooses the renderer (RunAppOpts.Renderer does the same). The default is auto: Vulkan first, then OpenGL ES when there is no Vulkan loader, no driver that can present to the window, or only a software device (llvmpipe, lavapipe); each fallback is logged once at Info level with its error. A name never falls back, and is the only way to use a software Vulkan device. The log line renderer chosen names the renderer and the GPU. If the GPU is lost, Glutter makes its resources again once and draws the frame again; a second loss within ten seconds ends the app with VulkanDeviceLost. GLUTTER_VULKAN_DEVICE=<index or part of the name> picks another Vulkan device, GLUTTER_VULKAN_VALIDATION=1 turns on the validation layer, and GLUTTER_DAMAGE=0 and GLUTTER_RASTER_CACHE=0 turn off the damage rectangles and the raster cache of both renderers.

Web

Glutter runs in the browser too: GOOS=js GOARCH=wasm with the standard Go toolchain (no TinyGo). Every example except multiwindow and tray builds and runs there (a page has no second window and no tray).

go run ./cmd/glutter-web serve ./examples/gallery          # builds, serves at http://localhost:8080/
go run ./cmd/glutter-web build -release -o dist ./examples/counter   # a directory for any static server
go run ./cmd/glutter-web shot -browser firefox -o gallery.png ./examples/gallery

build writes index.html (the loader), wasm_exec.js, app.wasm and app.wasm.gz; -release builds with -tags glutter_release -ldflags=-s -w. Serve the .gz with Content-Encoding: gzip and app.wasm as application/wasm, which glutter-web serve does. The page needs no configuration; globalThis.glutterConfig.hostElement (a CSS selector, set in index.html) puts the view in an element instead of the whole page.

Browsers. Tried: Chromium 155 (WebGPU, WebGL 2) and Firefox 158 (WebGL 2; its WebGPU is off by default on Linux), both on Fedora 44. Safari and other engines were not tried.

Renderers. The page tries WebGPU, then WebGL 2, then a software renderer on a 2D canvas, once, at the first frame. ?GLUTTER_RENDERER=webgpu|webgl|soft in the page's address (or RunAppOpts.Renderer) chooses one; a name never falls back, and a browser that cannot give it shows the error in the page. Any query parameter that starts with GLUTTER_ is the program's environment variable of that name.

What the web lacks (SPEC §3, §23): accessibility (no ARIA tree in 1.1), a second window or view on a page, system fonts (the text uses the bundled Roboto and Material Icons and the fonts an app loads), drag and drop out of the app, file dialogs, the tray, KeepScreenOn, and closing the page from the app. Opening a link and notifications (without buttons) work. An app asks foundation.IsWeb where it must differ; docs/GUIDE.md has a note for Flutter web developers.

A release build of the counter is 38 MB of WebAssembly and 8.8 MB gzipped, the gallery 58 MB and 11.9 MB; docs/PERFORMANCE.md has the web numbers and the targets that are not met.

Examples

Each one uses only the public packages and has tests that run on a fake platform.

Example Shows Screenshot
counter the reference app of SPEC §12.12
layout Row, Column, Stack, Wrap, Flex
animations implicit and explicit animations
scrolling lists, grids and slivers
navigation Navigator, routes, Hero, the Pages API
editor text editing, selection, clipboard, input methods
gallery every Material 3 component, light and dark
multiwindow several windows of one app
tray system tray, notifications, file dialog (the window alone is shown: a tray needs a desktop)
custompaint CustomPaint and the Canvas
todo a DataTable of tasks; each row has a checkbox, an Edit button (a dialog) and a Delete button

Performance

On release builds (-tags glutter_release) an animation-only frame costs microseconds on the UI thread, a full rebuild of the gallery page about 4 ms, and an idle app uses no CPU. docs/PERFORMANCE.md has the numbers, the machine they were measured on and the targets that are not met yet.

Working on Glutter

Go 1.27 and a C compiler (only because go test -race needs cgo). docs/SPEC.md is the source of truth, docs/IMPLEMENTATION.md the plan and docs/IMPLEMENTED.md the log of what is done. CLAUDE.md lists the commands:

go build ./...                  # CGO_ENABLED=0 go build ./... must always work
go test -race ./...
go vet ./... && golangci-lint run
go generate ./...
go run ./cmd/glutter-gen apicheck -allow cmd/glutter-gen/apicheck.allow

License

BSD-3-Clause, see LICENSE. Glutter is a derivative of the Flutter framework (BSD-3-Clause, third_party/flutter/LICENSE); NOTICE lists the other components.

Directories

Path Synopsis
Package animation provides AnimationController, Tween, Curves and the other animation primitives.
Package animation provides AnimationController, Tween, Curves and the other animation primitives.
cmd
glutter-gen command
Command glutter-gen runs the code generators: Wayland protocol bindings, key tables, material re-exports, CopyWith methods and icons, and the API check.
Command glutter-gen runs the code generators: Wayland protocol bindings, key tables, material re-exports, CopyWith methods and icons, and the API check.
glutter-gen/internal/apicheck
Package apicheck implements the `glutter-gen apicheck` subcommand, which reads the public packages and reports what breaks the API conventions of SPEC §12.
Package apicheck implements the `glutter-gen apicheck` subcommand, which reads the public packages and reports what breaks the API conventions of SPEC §12.
glutter-gen/internal/copywith
Package copywith implements the `glutter-gen copywith` subcommand, which generates the CopyWith methods of the immutable value classes (ThemeData, ColorScheme, TextTheme...), as SPEC §12.3 describes.
Package copywith implements the `glutter-gen copywith` subcommand, which generates the CopyWith methods of the immutable value classes (ThemeData, ColorScheme, TextTheme...), as SPEC §12.3 describes.
glutter-gen/internal/icons
Package icons implements the `glutter-gen icons` subcommand, which generates the Material icon constants.
Package icons implements the `glutter-gen icons` subcommand, which generates the Material icon constants.
glutter-gen/internal/keys
Package keys implements the `glutter-gen keys` subcommand, which generates the key tables (XKB keycode to Flutter key ids).
Package keys implements the `glutter-gen keys` subcommand, which generates the key tables (XKB keycode to Flutter key ids).
glutter-gen/internal/reexport
Package reexport implements the `glutter-gen reexport` subcommand, which generates the wrappers that re-export package widgets from package material.
Package reexport implements the `glutter-gen reexport` subcommand, which generates the wrappers that re-export package widgets from package material.
glutter-gen/internal/shaders
Package shaders implements the `glutter-gen shaders` subcommand: it compiles the WGSL shaders of the explicit renderer to SPIR-V with naga, and writes the Go file that holds them (D20).
Package shaders implements the `glutter-gen shaders` subcommand: it compiles the WGSL shaders of the explicit renderer to SPIR-V with naga, and writes the Go file that holds them (D20).
glutter-gen/internal/wayland
Package wayland implements the `glutter-gen wayland` subcommand: it reads the Wayland protocol XML files and writes the Go bindings, one *_gen.go file per protocol, for package wl.
Package wayland implements the `glutter-gen wayland` subcommand: it reads the Wayland protocol XML files and writes the Go bindings, one *_gen.go file per protocol, for package wl.
glutter-proof command
Command glutter-proof renders a proof scene with the software renderer and saves it as a PNG, as proof that a step of docs/IMPLEMENTATION.md works.
Command glutter-proof renders a proof scene with the software renderer and saves it as a PNG, as proof that a step of docs/IMPLEMENTATION.md works.
glutter-web command
Command glutter-web builds, serves and screenshots Glutter apps for the web (SPEC §23.1, §23.8):
Command glutter-web builds, serves and screenshots Glutter apps for the web (SPEC §23.1, §23.8):
Package desktop holds the desktop services that Flutter leaves to plugins: the system tray, notifications, file dialogs and opening URIs.
Package desktop holds the desktop services that Flutter leaves to plugins: the system tray, notifications, file dialogs and opening URIs.
Package examples is the parent of the runnable examples.
Package examples is the parent of the runnable examples.
animations command
Command animations shows four animations in four labelled tiles: an AnimatedContainer that changes size, color and corner radius when tapped, a Pulse (a ScaleTransition driven by a repeating controller), an AnimatedSwitcher that cycles a counter, and a TweenAnimationBuilder that turns a plus sign.
Command animations shows four animations in four labelled tiles: an AnimatedContainer that changes size, color and corner radius when tapped, a Pulse (a ScaleTransition driven by a repeating controller), an AnimatedSwitcher that cycles a counter, and a TweenAnimationBuilder that turns a plus sign.
counter command
Command counter is the reference example of the SPEC (§12.12): a Material 3 app with an app bar, a counter and a floating action button that adds one.
Command counter is the reference example of the SPEC (§12.12): a Material 3 app with an app bar, a counter and a floating action button that adds one.
custompaint command
Command custompaint shows CustomPaint with a custom painter: an analog clock with a gradient face, a shadow, minute and hour ticks and three hands.
Command custompaint shows CustomPaint with a custom painter: an analog clock with a gradient face, a shadow, minute and hour ticks and three hands.
dev/canvas-tour command
Command canvas-tour opens a 640x480 window that shows the proof scenes of milestones 2 to 4 (shapes, gradients, blend modes, effects, text), one per page, drawn by the GPU renderer, and a last page, size-grid, that depends on the size of the window: a grid of lines one pixel wide, which shows whether the buffer is as sharp as the screen (on a display with a fractional scale it must be, step 3.7).
Command canvas-tour opens a 640x480 window that shows the proof scenes of milestones 2 to 4 (shapes, gradients, blend modes, effects, text), one per page, drawn by the GPU renderer, and a last page, size-grid, that depends on the size of the window: a grid of lines one pixel wide, which shows whether the buffer is as sharp as the screen (on a display with a fractional scale it must be, step 3.7).
dev/input command
Command input opens a 640x400 window that logs every key and pointer event (with slog) and changes the mouse cursor: a text cursor over the left half of the window, a pointing hand over the right half.
Command input opens a 640x400 window that logs every key and pointer event (with slog) and changes the mouse cursor: a text cursor over the left half of the window, a pointing hand over the right half.
dev/runapp command
Command runapp is a development example (step 7.4): it runs the widgets binding with widgets.RunApp and shows a render tree made of widgets, to check the whole path from RunApp to the window.
Command runapp is a development example (step 7.4): it runs the widgets binding with widgets.RunApp and shows a render tree made of widgets, to check the whole path from RunApp to the window.
dev/text-tour command
Command text-tour opens a 640x480 window that shows the text proof (the text-tour scene of internal/proof) drawn by the GPU renderer: Latin text in several sizes, weights and styles, Arabic and Hebrew, CJK, color emoji, every decoration style, shadows, an ellipsized paragraph and a justified one.
Command text-tour opens a 640x480 window that shows the text proof (the text-tour scene of internal/proof) drawn by the GPU renderer: Latin text in several sizes, weights and styles, Arabic and Hebrew, CJK, color emoji, every decoration style, shadows, an ellipsized paragraph and a justified one.
dev/window command
Command window opens a 640x400 window (Wayland or X11) titled "Glutter dev window" and fills it with #6750A4 using OpenGL ES, drawing a new frame each time the compositor asks for one.
Command window opens a 640x400 window (Wayland or X11) titled "Glutter dev window" and fills it with #6750A4 using OpenGL ES, drawing a new frame each time the compositor asks for one.
editor command
Command editor is a small text editor on a WidgetsApp, without Material.
Command editor is a small text editor on a WidgetsApp, without Material.
gallery command
Command gallery shows the Material components of Glutter, one page for each group of them, with a side list to choose the page and a toggle between the light and the dark theme.
Command gallery shows the Material components of Glutter, one page for each group of them, with a side list to choose the page and a toggle between the light and the dark theme.
layout command
Command layout shows the layout widgets of Glutter in five labelled sections: a Row with Expanded and Flexible children, a Column for each MainAxisAlignment, a Stack with a Positioned badge, a Wrap of twelve colored tags and a Table.
Command layout shows the layout widgets of Glutter in five labelled sections: a Row with Expanded and Flexible children, a Column for each MainAxisAlignment, a Stack with a Positioned badge, a Wrap of twelve colored tags and a Table.
multiwindow command
Command multiwindow shows several windows.
Command multiwindow shows several windows.
navigation command
Command navigation shows the navigation of Glutter on a WidgetsApp, without Material.
Command navigation shows the navigation of Glutter on a WidgetsApp, without Material.
scrolling command
Command scrolling shows the scroll views of Glutter in seven tabs: a ListView with 10,000 rows, a GridView of colored tiles, a CustomScrollView with a pinned header, a list and a grid, a PageView of three pages, a ReorderableList, a TreeSliver (a file tree whose folders expand and collapse) and a Material ReorderableListView (with its drag handles).
Command scrolling shows the scroll views of Glutter in seven tabs: a ListView with 10,000 rows, a GridView of colored tiles, a CustomScrollView with a pinned header, a list and a grid, a PageView of three pages, a ReorderableList, a TreeSliver (a file tree whose folders expand and collapse) and a Material ReorderableListView (with its drag handles).
todo command
Command todo is a to-do list in a table.
Command todo is a to-do list in a table.
tray command
Command tray is a small note-taking window that lives in the system tray.
Command tray is a small note-taking window that lives in the system tray.
Package foundation holds the basic building blocks of the framework: Key, Opt[T], ChangeNotifier, TargetPlatform, diagnostics and debug flags.
Package foundation holds the basic building blocks of the framework: Key, Opt[T], ChangeNotifier, TargetPlatform, diagnostics and debug flags.
Package gestures turns pointer events into gestures: hit testing, the gesture arena and the recognizers.
Package gestures turns pointer events into gestures: hit testing, the gesture arena and the recognizers.
Package gluttertest is the widget-testing package: WidgetTester, finders and golden comparison, driven by a fake clock and a fake platform.
Package gluttertest is the widget-testing package: WidgetTester, finders and golden comparison, driven by a fake clock and a fake platform.
internal
dartfmt
Package dartfmt formats numbers the way Dart's toString and toStringAsFixed do, so that text printed by ported Flutter code (diagnostics, dumps) reads the same.
Package dartfmt formats numbers the way Dart's toString and toStringAsFixed do, so that text printed by ported Flutter code (diagnostics, dumps) reads the same.
dbus
Package dbus holds the D-Bus services, in pure Go on godbus: tray, notifications, portals, settings and AT-SPI2.
Package dbus holds the D-Bus services, in pure Go on godbus: tray, notifications, portals, settings and AT-SPI2.
dbus/atspi
Package atspi is the accessibility bridge for Linux desktops (SPEC §8.10): it mirrors the framework's semantics tree as AT-SPI2 objects on the accessibility bus, so that screen readers such as Orca can read the app and act on it.
Package atspi is the accessibility bridge for Linux desktops (SPEC §8.10): it mirrors the framework's semantics tree as AT-SPI2 objects on the accessibility bus, so that screen readers such as Orca can read the app and act on it.
dbus/fakebus
Package fakebus is an in-process D-Bus for tests (SPEC §17).
Package fakebus is an in-process D-Bus for tests (SPEC §17).
engine
Package engine wires the platform, the renderer and the text layout into the contracts of package ui, and owns the run loop.
Package engine wires the platform, the renderer and the text layout into the contracts of package ui, and owns the run loop.
fakeclock
Package fakeclock is a clock that a test moves by hand, so that timers and frame times in tests need no sleeping.
Package fakeclock is a clock that a test moves by hand, so that timers and frame times in tests need no sleeping.
goid
Package goid tells goroutines apart.
Package goid tells goroutines apart.
goldens
Package goldens compares rendered images with the golden PNGs of a package's tests.
Package goldens compares rendered images with the golden PNGs of a package's tests.
gpu
Package gpu defines the Renderer interface, flattens a ui.Scene into draw commands, and holds the glyph and path atlases shared by the renderers.
Package gpu defines the Renderer interface, flattens a ui.Scene into draw commands, and holds the glyph and path atlases shared by the renderers.
gpu/canvas2d
Package canvas2d is the last renderer of the web (SPEC §9.6): it draws each frame with the software renderer (internal/gpu/soft) and puts the image into the page's 2D canvas with putImageData, so that an app shows even where neither WebGPU nor WebGL 2 works.
Package canvas2d is the last renderer of the web (SPEC §9.6): it draws each frame with the software renderer (internal/gpu/soft) and puts the image into the page's 2D canvas with putImageData, so that an app shows even where neither WebGPU nor WebGL 2 works.
gpu/explicit
Package explicit is the renderer for the explicit GPU APIs, Vulkan and WebGPU (D19): the Device interface that both implement, the design limits they share (SPEC §9.3), and the WGSL shaders with the SPIR-V that glutter-gen makes from them (D20).
Package explicit is the renderer for the explicit GPU APIs, Vulkan and WebGPU (D19): the Device interface that both implement, the design limits they share (SPEC §9.3), and the WGSL shaders with the SPIR-V that glutter-gen makes from them (D20).
gpu/explicit/fakedevice
Package fakedevice is an explicit.Device that records every call, for the unit tests of the explicit renderer without a GPU.
Package fakedevice is an explicit.Device that records every call, for the unit tests of the explicit renderer without a GPU.
gpu/gles
Package gles is the OpenGL ES 3.0 renderer.
Package gles is the OpenGL ES 3.0 renderer.
gpu/gles/glwebtest command
Command glwebtest is the program of the browser tests of the WebGL 2 renderer (step 21.4, SPEC §9.1, §17).
Command glwebtest is the program of the browser tests of the WebGL 2 renderer (step 21.4, SPEC §9.1, §17).
gpu/gputest
Package gputest has what the display tests of the GPU renderers share: the scenes the renderers are compared on, the comparison with the software renderer's image, and its tolerance.
Package gputest has what the display tests of the GPU renderers share: the scenes the renderers are compared on, the comparison with the software renderer's image, and its tolerance.
gpu/soft
Package soft is the pure-Go software rasterizer, used for golden tests and headless rendering.
Package soft is the pure-Go software rasterizer, used for golden tests and headless rendering.
gpu/textdraw
Package textdraw turns the drawing of a paragraph into ordinary drawing operations, for the renderers: each glyph is a path, drawn with its origin on a quarter of a pixel horizontally and on a pixel vertically, so that the coverage of a glyph at a size can be cached for the four subpixel positions (SPEC §9.1).
Package textdraw turns the drawing of a paragraph into ordinary drawing operations, for the renderers: each glyph is a path, drawn with its origin on a quarter of a pixel horizontally and on a pixel vertically, so that the coverage of a glyph at a size can be cached for the four subpixel positions (SPEC §9.1).
gpu/vulkan
Package vulkan is the Vulkan backend of the explicit renderer (SPEC §9.4): it loads libvulkan.so.1 through purego and implements explicit.Device on it.
Package vulkan is the Vulkan backend of the explicit renderer (SPEC §9.4): it loads libvulkan.so.1 through purego and implements explicit.Device on it.
gpu/webgpu
Package webgpu is the WebGPU backend of the explicit renderer (SPEC §9.5): an explicit.Device over navigator.gpu, through syscall/js, so that internal/gpu/explicit draws on the web the way it draws on Vulkan.
Package webgpu is the WebGPU backend of the explicit renderer (SPEC §9.5): an explicit.Device over navigator.gpu, through syscall/js, so that internal/gpu/explicit draws on the web the way it draws on Vulkan.
gpu/webgpu/gpuwebtest command
Command gpuwebtest is the program of the browser tests of the WebGPU renderer (step 21.5, SPEC §9.5, §17).
Command gpuwebtest is the program of the browser tests of the WebGPU renderer (step 21.5, SPEC §9.5, §17).
opts
Package opts holds the helper behind the trailing options parameter of every constructor (SPEC §12.1).
Package opts holds the helper behind the trailing options parameter of every constructor (SPEC §12.1).
platform
Package platform defines the interface between the engine and an operating system backend, together with the types shared by all backends.
Package platform defines the interface between the engine and an operating system backend, together with the types shared by all backends.
platform/fake
Package fake is a scripted platform for tests: it replays queued events and records what the engine asks of it.
Package fake is a scripted platform for tests: it replays queued events and records what the engine asks of it.
platform/linux
Package linux holds what the Linux backends share: the event loop, the key tables, system settings and the choice between Wayland and X11.
Package linux holds what the Linux backends share: the event loop, the key tables, system settings and the choice between Wayland and X11.
platform/linux/dl
Package dl is the one safe way to load C libraries and call into them without cgo: it wraps purego's Dlopen, Dlsym and callbacks, tags every failure, and offers the libc helpers (malloc, free, C strings) and the struct-layout test helper that the backends share.
Package dl is the one safe way to load C libraries and call into them without cgo: it wraps purego's Dlopen, Dlsym and callbacks, tags every failure, and offers the libc helpers (malloc, free, C strings) and the struct-layout test helper that the backends share.
platform/linux/fontconfig
Package fontconfig binds libfontconfig (through purego, SPEC §8.1) to match a font family, weight, slant and language to the font files of the system, in the fallback order the user's fontconfig settings give.
Package fontconfig binds libfontconfig (through purego, SPEC §8.1) to match a font family, weight, slant and language to the font files of the system, in the fallback order the user's fontconfig settings give.
platform/linux/ime
Package ime connects a window system backend to an input method framework over D-Bus (IBus or Fcitx5): the same way for X11, and for Wayland on a compositor without text-input-v3 (SPEC §8.3, §8.6).
Package ime connects a window system backend to an input method framework over D-Bus (IBus or Fcitx5): the same way for X11, and for Wayland on a compositor without text-input-v3 (SPEC §8.3, §8.6).
platform/linux/ime/imetest
Package imetest has test doubles for the input method of the Linux backends: an input method that records its calls, and a poster that lets the test run what the bridge hands to the UI thread.
Package imetest has test doubles for the input method of the Linux backends: an input method that records its calls, and a poster that lets the test run what the bridge hands to the UI thread.
platform/linux/input
Package input turns what the Linux windowing systems report about pointers and touch screens into ui.PointerData, the same way for Wayland and X11.
Package input turns what the Linux windowing systems report about pointers and touch screens into ui.PointerData, the same way for Wayland and X11.
platform/linux/wayland
Package wayland is the Wayland backend.
Package wayland is the Wayland backend.
platform/linux/wayland/decor
Package decor binds libdecor, the library that draws native title bars for Wayland compositors without server-side decorations (GNOME).
Package decor binds libdecor, the library that draws native title bars for Wayland compositors without server-side decorations (GNOME).
platform/linux/wayland/fakecomp
Package fakecomp is a tiny fake Wayland compositor for tests: it speaks the wire protocol over a socket pair, answers the requests that the tests send, and logs them.
Package fakecomp is a tiny fake Wayland compositor for tests: it speaks the wire protocol over a socket pair, answers the requests that the tests send, and logs them.
platform/linux/wayland/wl
Package wl is the Wayland client: the runtime over libwayland-client, which is bound with purego, and the Go bindings of every protocol in ../protocols, generated by `glutter-gen wayland` into the *_gen.go files.
Package wl is the Wayland client: the runtime over libwayland-client, which is bound with purego, and the Go bindings of every protocol in ../protocols, generated by `glutter-gen wayland` into the *_gen.go files.
platform/linux/x11
Package x11 is the X11 backend.
Package x11 is the X11 backend.
platform/linux/xkb
Package xkb binds libxkbcommon (through purego, SPEC §8.1) and turns key presses into Flutter key data: the physical key, the logical key and the text, for any keyboard layout, with dead keys and compose sequences.
Package xkb binds libxkbcommon (through purego, SPEC §8.1) and turns key presses into Flutter key data: the physical key, the logical key and the text, for any keyboard layout, with dead keys and compose sequences.
platform/web
Package web is the platform backend of the web (GOOS=js GOARCH=wasm, SPEC §23): one window that is a canvas in a host element of the page, frames from requestAnimationFrame, and the lifecycle and the settings of the browser.
Package web is the platform backend of the web (GOOS=js GOARCH=wasm, SPEC §23): one window that is a canvas in a host element of the page, frames from requestAnimationFrame, and the lifecycle and the settings of the browser.
platform/web/desktoptest command
Command desktoptest is the program of the browser tests of the web desktop services (step 21.6, SPEC §17, §23.7).
Command desktoptest is the program of the browser tests of the web desktop services (step 21.6, SPEC §17, §23.7).
platform/web/inputtest command
Command inputtest is the program of the browser tests of the web input (step 21.2, SPEC §17, §23.4).
Command inputtest is the program of the browser tests of the web input (step 21.2, SPEC §17, §23.4).
platform/web/synthetic
Package synthetic dispatches synthetic DOM events at the canvas of a Glutter app, the way the browser would deliver real ones: the debug-only script of the web platform (GLUTTER_DEV_EVENTS, for proof screenshots) and the browser tests use it.
Package synthetic dispatches synthetic DOM events at the canvas of a Glutter app, the way the browser would deliver real ones: the debug-only script of the web platform (GLUTTER_DEV_EVENTS, for proof screenshots) and the browser tests use it.
platform/web/texttest command
Command texttest is the program of the browser tests of the web text input and clipboard (step 21.3, SPEC §17, §23.5).
Command texttest is the program of the browser tests of the web text input and clipboard (step 21.3, SPEC §17, §23.5).
proof
Package proof holds the scenes that cmd/glutter-proof renders to prove, with a picture, that a step of docs/IMPLEMENTATION.md works.
Package proof holds the scenes that cmd/glutter-proof renders to prove, with a picture, that a step of docs/IMPLEMENTATION.md works.
proof/widgetscenes
Package widgetscenes holds the proof scenes that are made by pumping a widget tree through gluttertest.
Package widgetscenes holds the proof scenes that are made by pumping a widget tree through gluttertest.
renderhost
Package renderhost builds a RendererBinding on a fake engine with one view, lays out and paints a render tree through the pipeline, and keeps the scenes that the view rendered.
Package renderhost builds a RendererBinding on a fake engine with one view, lays out and paints a render tree through the pipeline, and keeps the scenes that the view rendered.
renderingtest
Package renderingtest is a temporary harness for the tests of the rendering library: it builds a RendererBinding on a fake engine, lays out and paints a render tree through the pipeline, and renders the scene with the software renderer.
Package renderingtest is a temporary harness for the tests of the rendering library: it builds a RendererBinding on a fake engine, lays out and paints a render tree through the pipeline, and renders the scene with the software renderer.
text
Package text lays out paragraphs on go-text: the font collection, shaping, line breaking, bidi and glyph outlines.
Package text lays out paragraphs on go-text: the font collection, shaping, line breaking, bidi and glyph outlines.
text/layout
Package layout lays out paragraphs: it turns the styled text of a ui.ParagraphBuilder into lines of shaped glyphs with go-text.
Package layout lays out paragraphs: it turns the styled text of a ui.ParagraphBuilder into lines of shaped glyphs with go-text.
webtest
Package webtest is the harness that runs a Glutter web app in a headless browser (SPEC §17 "Browser tests", §23.8): an httptest server that serves a build made by internal/webtool and collects the PNG and the results the page posts, launchers for Chromium and Firefox with temporary profiles that run under timeout in their own process group and are killed when the test ends, and Shot, which glutter-web's shot command and the browser tests use.
Package webtest is the harness that runs a Glutter web app in a headless browser (SPEC §17 "Browser tests", §23.8): an httptest server that serves a build made by internal/webtool and collects the PNG and the results the page posts, launchers for Chromium and Firefox with temporary profiles that run under timeout in their own process group and are killed when the test ends, and Shot, which glutter-web's shot command and the browser tests use.
webtool
Package webtool packages a Glutter app for the web (SPEC §23.1): it builds the program for js/wasm, writes the directory that a static web server can serve (index.html, wasm_exec.js, app.wasm and app.wasm.gz), and serves such a directory with the right types and with the gzip file for a browser that accepts it.
Package webtool packages a Glutter app for the web (SPEC §23.1): it builds the program for js/wasm, writes the directory that a static web server can serve (index.html, wasm_exec.js, app.wasm and app.wasm.gz), and serves such a directory with the right types and with the gzip file for a browser that accepts it.
Package material implements Material 3.
Package material implements Material 3.
fonts
Package fonts holds the fonts that Glutter bundles with the program: Roboto, the first family of Flutter's Linux typography, and Material Icons.
Package fonts holds the fonts that Glutter bundles with the program: Roboto, the first family of Flutter's Linux typography, and Material Icons.
internal/mcu
Package mcu is a port of Google's material-color-utilities (the Dart package in reference/material-color-utilities): the HCT color space, the CAM16 color appearance model, tonal palettes, the dynamic color scheme variants and the contrast tools that Material 3 builds its color schemes with.
Package mcu is a port of Google's material-color-utilities (the Dart package in reference/material-color-utilities): the HCT color space, the CAM16 color appearance model, tonal palettes, the dynamic color scheme variants and the contrast tools that Material 3 builds its color schemes with.
Package painting provides the painting building blocks above the engine: EdgeInsets, BoxDecoration, borders, TextPainter and ImageProvider.
Package painting provides the painting building blocks above the engine: EdgeInsets, BoxDecoration, borders, TextPainter and ImageProvider.
Package physics provides the simulations used by scrolling and animation, such as springs, friction and clamping.
Package physics provides the simulations used by scrolling and animation, such as springs, friction and clamping.
Package rendering holds the render tree: RenderObject, RenderBox, slivers, layers and the PipelineOwner.
Package rendering holds the render tree: RenderObject, RenderBox, slivers, layers and the PipelineOwner.
Package scheduler schedules frames and callbacks: the SchedulerBinding, Ticker and the frame phases.
Package scheduler schedules frames and callbacks: the SchedulerBinding, Ticker and the frame phases.
Package semantics describes the app to assistive technology: SemanticsNode, actions and flags.
Package semantics describes the app to assistive technology: SemanticsNode, actions and flags.
Package services connects the framework to the platform: keyboard, text input, clipboard, mouse cursors and assets.
Package services connects the framework to the platform: keyboard, text input, clipboard, mouse cursors and assets.
Package ui is the engine API: geometry, Color, Paint, Path, Canvas, Scene, Paragraph, images, views and input events.
Package ui is the engine API: geometry, Color, Paint, Path, Canvas, Scene, Paragraph, images, views and input events.
Package widgets is the widgets library: the Widget, Element and State classes and the basic widgets built on the render tree.
Package widgets is the widgets library: the Widget, Element and State classes and the basic widgets built on the render tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL