gui/stubs/wails/pkg/application/environment.go
Claude d9fa59ab04
Some checks failed
Security Scan / security (push) Failing after 24s
feat(stubs): rebuild Wails v3 stub bridge from clean dev — 15 files, 479 exports
Rebuilt from scratch on current dev (post-fleet AX passes).

Stub files:
- application.go (expanded App with 12 managers, WebviewWindow satisfies Window)
- application_options.go (Options, Mac/Win/Linux/iOS/Android, Server, TLS, Assets)
- browser_manager.go, browser_window.go (~47 no-op methods)
- clipboard.go, context_menu.go, dialog.go (full dialog builder API)
- environment.go, events.go (EventManager with On/Off/Emit/Reset)
- keybinding.go, menuitem.go (42 Role constants)
- screen.go (Rect/Point/Size geometry), services.go (generic Service[T])
- webview_window_options.go (full platform types)
- window.go (Window interface ~50 methods)

Wails v3 submodule at internal/wails3/ pinned to alpha 74.
All 16 gui packages build and test clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:20:22 +01:00

63 lines
1.7 KiB
Go

package application
// EnvironmentInfo holds runtime information about the host OS and build.
//
// info := manager.Info()
// fmt.Println(info.OS, info.Arch)
type EnvironmentInfo struct {
OS string
Arch string
Debug bool
PlatformInfo map[string]any
}
// EnvironmentManager provides queries about the host OS environment.
//
// if manager.IsDarkMode() { applyDarkTheme() }
// accent := manager.GetAccentColor()
type EnvironmentManager struct {
darkMode bool
accentColor string
}
// IsDarkMode returns true when the OS is using a dark colour scheme.
//
// if manager.IsDarkMode() { applyDarkTheme() }
func (em *EnvironmentManager) IsDarkMode() bool {
return em.darkMode
}
// GetAccentColor returns the OS accent colour as an rgb() string.
//
// colour := manager.GetAccentColor() // e.g. "rgb(0,122,255)"
func (em *EnvironmentManager) GetAccentColor() string {
if em.accentColor == "" {
return "rgb(0,122,255)"
}
return em.accentColor
}
// Info returns a snapshot of OS and build environment information.
//
// info := manager.Info()
func (em *EnvironmentManager) Info() EnvironmentInfo {
return EnvironmentInfo{
PlatformInfo: make(map[string]any),
}
}
// OpenFileManager opens the file manager at the given path, optionally selecting the file.
// No-op in the stub.
//
// err := manager.OpenFileManager("/home/user/docs", false)
func (em *EnvironmentManager) OpenFileManager(path string, selectFile bool) error {
return nil
}
// HasFocusFollowsMouse reports whether the Linux desktop is configured for
// focus-follows-mouse. Always returns false in the stub.
//
// if manager.HasFocusFollowsMouse() { adjustMouseBehaviour() }
func (em *EnvironmentManager) HasFocusFollowsMouse() bool {
return false
}