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 ¶
- Variables
- type Application
- type Config
- type FontTweakConfig
- type ImZeroClientConfig
- func (inst *ImZeroClientConfig) FromContext(nameTransf config.NameTransformFunc, ctx *cli.Context) (nMessages int)
- func (inst *ImZeroClientConfig) PassthroughArgs(args []string) (argsOut []string)
- func (inst *ImZeroClientConfig) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag
- func (inst *ImZeroClientConfig) Validate(force bool) (nMessages int)
Constants ¶
This section is empty.
Variables ¶
var ErrNeedsToBeLaunchedBeforeRun = eh.Errorf("application needs to be launched before run")
var PackageProps = packageprops.Props{ WASMWASI: packageprops.WASMCompiles, WASMJS: packageprops.WASMCompiles, WASMFreestanding: packageprops.WASMCompiles, }
PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.
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)
func (*Application[U]) Shutdown ¶ added in v0.0.20
func (inst *Application[U]) Shutdown()
Shutdown asks the render loop to stop at the next frame boundary, so that Run returns normally and its caller's deferred cleanup runs. It is safe to call from any goroutine — including a signal handler — and is idempotent.
It does not preempt an in-flight frame: a loop blocked reading from a wedged client will not observe this. A caller that must bound the wait (a signal handler, a supervisor) needs its own escalation path.
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 (*Config) ToCliFlags ¶
func (inst *Config) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag
type FontTweakConfig ¶
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)