Table of Contents

Interface IWindow

Namespace
Xui.Core.Abstract
Assembly
Core.dll

Defines the abstract interface for a platform window in Xui. This surface hosts rendering, input handling, and layout updates.

public interface IWindow

Remarks

Implementations of this interface bridge platform-specific Actual windowing with the framework’s abstract layer. It is used both for physical windows (e.g. desktop apps) and virtual windows (e.g. emulator windows).

Properties

DisplayArea

Gets or sets the total visible area of the window, including content that may be obscured by hardware cutouts, rounded corners, or system UI overlays.

Rect DisplayArea { get; set; }

Property Value

Rect

Remarks

Used by the layout system to determine the full available size.

SafeArea

Gets or sets the "safe" area of the window, excluding obstructions like notches or status bars. Important UI elements should be placed within this area.

Rect SafeArea { get; set; }

Property Value

Rect

Remarks

Especially relevant on mobile devices and in emulator scenarios.

Methods

Closed()

Invoked when the window is closed and cleanup should occur.

void Closed()

Closing()

Invoked before the window closes. Returning false can cancel the closure.

bool Closing()

Returns

bool

true if the window may close; otherwise, false.

OnAnimationFrame(ref FrameEventRef)

Invoked once per frame to propagate animation timing information.

void OnAnimationFrame(ref FrameEventRef animationFrame)

Parameters

animationFrame FrameEventRef

Timing details for the current animation frame.

OnMouseDown(ref MouseDownEventRef)

Invoked when a mouse button is pressed within the window.

void OnMouseDown(ref MouseDownEventRef evRef)

Parameters

evRef MouseDownEventRef

The mouse down event data.

OnMouseMove(ref MouseMoveEventRef)

Invoked when the mouse is moved within the window.

void OnMouseMove(ref MouseMoveEventRef evRef)

Parameters

evRef MouseMoveEventRef

The mouse movement event data.

OnMouseUp(ref MouseUpEventRef)

Invoked when a mouse button is released within the window.

void OnMouseUp(ref MouseUpEventRef evRef)

Parameters

evRef MouseUpEventRef

The mouse up event data.

OnScrollWheel(ref ScrollWheelEventRef)

Invoked when the scroll wheel is used within the window.

void OnScrollWheel(ref ScrollWheelEventRef evRef)

Parameters

evRef ScrollWheelEventRef

The scroll wheel event data.

OnTouch(ref TouchEventRef)

Invoked when touch input occurs within the window.

void OnTouch(ref TouchEventRef touchEventRef)

Parameters

touchEventRef TouchEventRef

The touch event data.

Render(ref RenderEventRef)

Invoked during the render phase of the UI lifecycle. Responsible for triggering layout and visual updates.

void Render(ref RenderEventRef render)

Parameters

render RenderEventRef

The render event data, including target rect and frame info.

WindowHitTest(ref WindowHitTestEventRef)

Invoked when the system requests a hit test for window interaction. Allows the app to indicate whether a region is draggable, resizable, etc.

void WindowHitTest(ref WindowHitTestEventRef evRef)

Parameters

evRef WindowHitTestEventRef

The hit test event containing pointer position and window bounds.