application

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package application owns the imzero2 process lifecycle: configuration parsing, observability bootstrap, render-loop driver wiring, profiling hooks, and graceful shutdown. The Application[U] generic parameterizes the FFFI2 unmarshaller plugged into the Rust child process.

Index

Constants

This section is empty.

Variables

View Source
var ErrNeedsToBeLaunchedBeforeRun = eh.Errorf("application needs to be launched before run")
View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMCompiles,
	WASMJS:           packageprops.WASMCompiles,
	WASMFreestanding: packageprops.WASMCompiles,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `wasmsurvey props generate`; curate by hand, then `wasmsurvey props verify`.

Functions

This section is empty.

Types

type Application

type Application[U runtime.UnmarshallReaderI] struct {
	FffiEstablishedHandler      func(fffi *runtime.Fffi2[U]) error
	BeforeFirstFrameInitHandler func() error
	RenderLoopHandler           func() error
	Config                      *Config
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication[U runtime.UnmarshallReaderI](cfg *Config, unmarshaller U) (app *Application[U], err error)

func (*Application[U]) Launch

func (inst *Application[U]) Launch() (err error)

func (*Application[U]) Run

func (inst *Application[U]) Run() (err error)

type Config

type Config struct {
	ImZeroSkiaClientConfig *ImZeroClientConfig

	MainFontTTF       string
	MonoFontTTF       string
	PhosphorFontTTF   string
	FallbackFontTTF   string
	MainFontTweak     FontTweakConfig
	MonoFontTweak     FontTweakConfig
	PhosphorFontTweak FontTweakConfig
	FallbackFontTweak FontTweakConfig
	ClientBinary      string
	ImZeroCmdOutFile  string
	ImZeroCmdInFile   string

	MainFontSizeInPixels float32
	// contains filtered or unexported fields
}

func (*Config) FromContext

func (inst *Config) FromContext(nameTransf config.NameTransformFunc, ctx *cli.Context) (nMessages int)

func (*Config) ToCliFlags

func (inst *Config) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag

func (*Config) Validate

func (inst *Config) Validate(force bool) (nMessages int)

type FontTweakConfig

type FontTweakConfig struct {
	Scale         float32
	YOffsetFactor float32
	YOffset       float32
}

type ImZeroClientConfig

type ImZeroClientConfig struct {
	AppTitle                string `json:"appTitle"`
	Fullscreen              string `json:"fullscreen"`
	InitialMainWindowWidth  string `json:"initialMainWindowWidth"`
	InitialMainWindowHeight string `json:"initialMainWindowHeight"`
	AllowMainWindowResize   string `json:"allowMainWindowResize"`
	ExportBasePath          string `json:"exportBasePath"`
	Vsync                   string `json:"vsync"`
	BackgroundColorRGBA     string `json:"backgroundColorRGBA"`
	BackdropFilter          string `json:"backdropFilter"`
	// contains filtered or unexported fields
}

func (*ImZeroClientConfig) FromContext

func (inst *ImZeroClientConfig) FromContext(nameTransf config.NameTransformFunc, ctx *cli.Context) (nMessages int)

func (*ImZeroClientConfig) PassthroughArgs

func (inst *ImZeroClientConfig) PassthroughArgs(args []string) (argsOut []string)

func (*ImZeroClientConfig) ToCliFlags

func (inst *ImZeroClientConfig) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag

func (*ImZeroClientConfig) Validate

func (inst *ImZeroClientConfig) Validate(force bool) (nMessages int)

Jump to

Keyboard shortcuts

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