public sealed class HeadlessPlatformThe platform with nothing attached: no window server, no GPU, no audio device, no user.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Two jobs, and they are the same job. It is the head a dedicated server and a batch tool run on (docs/plan/17), and it is the platform every test that needs a platform uses. Because the second happens on every build, the first cannot quietly rot — which is the whole argument for building it in Phase 1 rather than discovering in Phase 9 that four subsystems assume a window exists.
Windows still exist here, with sizes and events and focus; they just show nobody anything, and their surfaces report None so a graphics backend renders offscreen. The frame loop is the desktop's frame loop.
Owned by the thread that constructed it, like every other platform. Nothing here needs that restriction, and it is kept anyway: code first written against the headless platform and then run on a desktop should fail in the test suite rather than at the customer.
Fields and properties (14)
public string NameA name for logs and crash reports: "Desktop (macOS)", "Headless".
public PlatformCapabilities CapabilitiesMultiWindow, and nothing else.
public IReadOnlyList<IWindow> WindowsEvery window that exists now, in creation order.
public IDisplayInfo DisplaysThe displays.
public IFileSystemHost FileSystemWhere this platform keeps files.
public IClipboard ClipboardThe system clipboard.
public INativeDialogs DialogsNative pickers and message boxes.
public ILifecycle LifecycleThe process's lifecycle.
public IInputSource InputRaw input devices and their state.
public ITextInput TextInputText entry and the IME.
public IPowerInfo PowerBattery and thermal state.
public IProcessorTopology ProcessorsHow many processors there are, and whether threads may be pinned to them.
public HeadlessLifecycle SimulationThe lifecycle, typed so a test can suspend and resume it.
public HeadlessInputSource SimulatedInputThe input source, typed so a test can hold keys down.
Methods (8)
public HeadlessPlatform()Creates the platform.
public HeadlessPlatform(HeadlessPlatformOptions options)Creates the platform.
public IWindow CreateWindow(in WindowOptions options)Creates a window.
public bool TryGetWindow(uint id, out IWindow? window)Finds a window by the id its events carry.
public ReadOnlySpan<PlatformEvent> PumpEvents()Collects everything the OS has to say and returns it, in the order it happened.
public bool Post(in PlatformEvent platformEvent)Adds an event to the queue, as the operating system would.
public bool TryOpenUrl(string url)Always : there is no shell to hand a URL to.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (11)
- HeadlessLifecycleTestsVixen.Platform.Headless.Tests
- HeadlessPlatformTestsVixen.Platform.Headless.Tests
- PlatformExtensionsTestsVixen.Platform.Headless.Tests
- PlatformWindowHostTestsVixen.Platform.Ui.Tests
- AppBackendTestsVixen.App.Tests
- HostedEngineTestsVixen.App.Tests
- HostedRendererTestsVixen.App.Tests
- PlatformHostVixen.App
- RemoteContentMountTestsVixen.App.Tests
- StartupSceneTestsVixen.App.Tests
- VixenApplicationTestsVixen.App.Tests