Initial support for application specific overrides.

This commit is contained in:
Storm Dragon committed 2026-10-28 03:31:33 -04:00
1 parent 901fd58ba8
commit b45f800489
37 files changed
+3909 -475

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
// Package applicationoverrides defines built-in, event-loop-owned application
// adapters. Adapters interpret snapshots; they never own devices or persistence.
package applicationoverrides
import (
"git.stormux.org/storm/fenrir/internal/command"
"git.stormux.org/storm/fenrir/internal/config"
"git.stormux.org/storm/fenrir/internal/presentation"
"git.stormux.org/storm/fenrir/internal/screen"
)
type Region struct {
Name, Text string
}
// Frame supplements the ordinary reader. OwnsPresentation replaces generic
// automatic diffs, never raw review/copy or typing echo. Updates are independent
// of focus: a focus change must not swallow a simultaneous chat message.
type Frame struct {
Recognized, OwnsPresentation, FocusChanged bool
Focus, Updates []presentation.Message
Regions []Region
// Input limits typing/deletion echo to an application's actual input field.
Input *screen.Region
}
type Adapter interface {
Name() string
Configure(*config.Settings)
Observe(screen.Snapshot) Frame
Command(command.ID) (presentation.CommandResult, bool)
// Reset forgets screen-derived baselines after suspension or layout changes.
Reset()
Close()
}