Interface ITopLevelImpl
Defines a platform-specific top-level window implementation.
[Unstable]
public interface ITopLevelImpl : IOptionalFeatureProvider, IDisposable
- Inherited Members
Remarks
This interface is the common interface to IWindowImpl and IPopupImpl.
Properties
AcrylicCompensationLevels
Gets the AcrylicPlatformCompensationLevels for the platform.
AcrylicPlatformCompensationLevels AcrylicCompensationLevels { get; }
Property Value
ClientSize
Gets the client size of the toplevel.
Size ClientSize { get; }
Property Value
Closed
Gets or sets a method called when the underlying implementation is destroyed.
Action? Closed { get; set; }
Property Value
Compositor
Gets the compositor that's compatible with the toplevel
Compositor Compositor { get; }
Property Value
DesktopScaling
Gets the scaling factor for Window positioning and sizing.
double DesktopScaling { get; }
Property Value
Handle
Get the platform handle.
IPlatformHandle? Handle { get; }
Property Value
Input
Gets or sets a method called when the toplevel receives input.
Action<RawInputEventArgs>? Input { get; set; }
Property Value
LostFocus
Gets or sets a method called when the input focus is lost.
Action? LostFocus { get; set; }
Property Value
Paint
Gets or sets a method called when the toplevel requires painting.
Action<Rect>? Paint { get; set; }
Property Value
RenderScaling
Gets the scaling factor for the toplevel. This is used for rendering.
double RenderScaling { get; }
Property Value
Resized
Gets or sets a method called when the toplevel is resized.
Action<Size, WindowResizeReason>? Resized { get; set; }
Property Value
ScalingChanged
Gets or sets a method called when the toplevel's scaling changes.
Action<double>? ScalingChanged { get; set; }
Property Value
Surfaces
The list of native platform's surfaces that can be consumed by rendering subsystems.
IEnumerable<object> Surfaces { get; }
Property Value
Remarks
Rendering platform will check that list and see if it can utilize one of them to output. It should be enough to expose a native window handle via IPlatformHandle and add support for framebuffer (even if it's emulated one) via IFramebufferPlatformSurface. If you have some rendering platform that's tied to your particular windowing platform, just expose some toolkit-specific object (e. g. Func<Gdk.Drawable> in case of GTK#+Cairo)
TransparencyLevel
Gets the current WindowTransparencyLevel of the TopLevel.
WindowTransparencyLevel TransparencyLevel { get; }
Property Value
TransparencyLevelChanged
Gets or sets a method called when the toplevel's TransparencyLevel changes.
Action<WindowTransparencyLevel>? TransparencyLevelChanged { get; set; }
Property Value
Methods
CreatePopup()
IPopupImpl? CreatePopup()
Returns
PointToClient(PixelPoint)
Converts a point from screen to client coordinates.
Point PointToClient(PixelPoint point)
Parameters
point
PixelPointThe point in screen coordinates.
Returns
- Point
The point in client coordinates.
PointToScreen(Point)
Converts a point from client to screen coordinates.
PixelPoint PointToScreen(Point point)
Parameters
point
PointThe point in client coordinates.
Returns
- PixelPoint
The point in screen coordinates.
SetCursor(ICursorImpl?)
Sets the cursor associated with the toplevel.
void SetCursor(ICursorImpl? cursor)
Parameters
cursor
ICursorImplThe cursor. Use null for default cursor
SetFrameThemeVariant(PlatformThemeVariant)
Sets the PlatformThemeVariant on the frame if it should be dark or light. Also applies for the mobile status bar.
void SetFrameThemeVariant(PlatformThemeVariant themeVariant)
Parameters
themeVariant
PlatformThemeVariant
SetInputRoot(IInputRoot)
Sets the IInputRoot for the toplevel.
void SetInputRoot(IInputRoot inputRoot)
Parameters
inputRoot
IInputRoot
SetTransparencyLevelHint(IReadOnlyList<WindowTransparencyLevel>)
Sets the WindowTransparencyLevel hint of the TopLevel.
void SetTransparencyLevelHint(IReadOnlyList<WindowTransparencyLevel> transparencyLevels)
Parameters
transparencyLevels
IReadOnlyList<WindowTransparencyLevel>