2026-03-13 14:19:05 +00:00
|
|
|
// pkg/environment/platform.go
|
|
|
|
|
package environment
|
|
|
|
|
|
|
|
|
|
// Platform abstracts environment and theme backend queries.
|
|
|
|
|
type Platform interface {
|
|
|
|
|
IsDarkMode() bool
|
|
|
|
|
Info() EnvironmentInfo
|
|
|
|
|
AccentColour() string
|
|
|
|
|
OpenFileManager(path string, selectFile bool) error
|
feat: Wails v3 stub bridge + feature expansion + display bridge + MCP events
Stubs (15 files, 479 exports):
- All managers: Dialog, Event, Browser, Clipboard, ContextMenu, Environment, Screen, KeyBinding
- Window interface (~50 methods), BrowserWindow, platform options (iOS/Android)
- MenuItem (42 roles), WebviewWindowOptions (full platform types)
- Wails v3 submodule pinned at alpha 74
New events package (17th package):
- Custom event system bridged to Core IPC
- TaskEmit, TaskOn, TaskOff, QueryListeners, ActionEventFired
Feature expansions:
- Window: zoom, content (SetURL/SetHTML/ExecJS), bounds, print, flash
- Screen: QueryCurrent, ScreenPlacement, Rect geometry
- Dialog: typed tasks, file options, Info/Question/Warning/Error
- Keybinding: TaskProcess, ErrorNotRegistered
- Notification: RevokePermission, RegisterCategory, action broadcasts
- Dock: SetProgressBar, Bounce/StopBounce
- Environment: HasFocusFollowsMouse
- ContextMenu: QueryGetAll, TaskUpdate, TaskDestroy
Display bridge: 5 new event types wired to WebSocket
MCP: 4 event tools (emit, on, off, list)
17 packages build and test clean (1 flaky test ordering issue in window).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:42:09 +01:00
|
|
|
HasFocusFollowsMouse() bool
|
2026-03-13 14:19:05 +00:00
|
|
|
OnThemeChange(handler func(isDark bool)) func() // returns cancel func
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// EnvironmentInfo contains system environment details.
|
|
|
|
|
type EnvironmentInfo struct {
|
|
|
|
|
OS string `json:"os"`
|
|
|
|
|
Arch string `json:"arch"`
|
|
|
|
|
Debug bool `json:"debug"`
|
|
|
|
|
Platform PlatformInfo `json:"platform"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlatformInfo contains platform-specific details.
|
|
|
|
|
type PlatformInfo struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Version string `json:"version"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ThemeInfo contains the current theme state.
|
|
|
|
|
type ThemeInfo struct {
|
|
|
|
|
IsDark bool `json:"isDark"`
|
|
|
|
|
Theme string `json:"theme"` // "dark" or "light"
|
|
|
|
|
}
|