Interface IHostWindow
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
The client's own OS window -- minimize, restore, and close, the same three controls the window's title bar already offers. A host with no window (a headless bot process) answers every query as unavailable rather than throwing, so a plugin written against a graphical host still loads there.
public interface IHostWindow
Properties
IsMinimized
Whether the window is currently minimized/iconified. Always
false on a host with no window, and also always
false on a platform that cannot report iconification back
at all (see the platform caveats below).
bool IsMinimized { get; }
Property Value
Methods
Minimize()
Minimizes the OS window (GLFW iconify; Windows, Linux, macOS). Reports Done only once the window actually reports the minimized state back; a host with no window, or one that refused the change, reports Unavailable.
That confirmation is not equally trustworthy on every platform: it is synchronous on Windows, arrives asynchronously on X11 (a call immediately after Minimize can briefly still read the old state), is animated on macOS (there is a brief window before the OS finishes iconifying), and the Wayland compositor protocol has no way to report iconification back to the client at all -- on Wayland this call always reports Unavailable even when the window did minimize. Treat Unavailable here as "not confirmed", not as "definitely still shown"; do not retry it in a loop.
HostWindowResult Minimize()
Returns
RequestClose()
Requests that the client close, following the exact route its own close button uses -- graceful logout, then teardown, then process exit. This never terminates the process directly: a host with no window ends the plugin's own session through its normal terminal path (the same one a SIGINT or a policy-driven stop already uses) instead.
HostWindowResult RequestClose()
Returns
Restore()
Un-minimizes the OS window if it is currently minimized; a no-op success if it was already shown, whatever its prior maximized or fullscreen state. Same confirmation caveats as Minimize().
HostWindowResult Restore()