using System; using System.Collections.Generic; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Input.Raw; using Avalonia.Rendering; using JetBrains.Annotations; namespace Avalonia.Platform { /// /// Defines a platform-specific top-level window implementation. /// /// /// This interface is the common interface to and /// . /// public interface ITopLevelImpl : IDisposable { /// /// Gets the client size of the toplevel. /// Size ClientSize { get; } /// /// Gets the scaling factor for the toplevel. /// double Scaling { get; } /// /// The list of native platform's surfaces that can be consumed by rendering subsystems. /// /// /// 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) /// IEnumerable Surfaces { get; } /// /// Gets or sets a method called when the toplevel receives input. /// Action Input { get; set; } /// /// Gets or sets a method called when the toplevel requires painting. /// Action Paint { get; set; } /// /// Gets or sets a method called when the toplevel is resized. /// Action Resized { get; set; } /// /// Gets or sets a method called when the toplevel's scaling changes. /// Action ScalingChanged { get; set; } /// /// Gets or sets a method called when the toplevel's TransparencyLevel changes. /// Action TransparencyLevelChanged { get; set; } /// /// Creates a new renderer for the toplevel. /// /// The toplevel. IRenderer CreateRenderer(IRenderRoot root); /// /// Invalidates a rect on the toplevel. /// void Invalidate(Rect rect); /// /// Sets the for the toplevel. /// void SetInputRoot(IInputRoot inputRoot); /// /// Converts a point from screen to client coordinates. /// /// The point in screen coordinates. /// The point in client coordinates. Point PointToClient(PixelPoint point); /// /// Converts a point from client to screen coordinates. /// /// The point in client coordinates. /// The point in screen coordinates. PixelPoint PointToScreen(Point point); /// /// Sets the cursor associated with the toplevel. /// /// The cursor. Use null for default cursor void SetCursor(IPlatformHandle cursor); /// /// Gets or sets a method called when the underlying implementation is destroyed. /// Action Closed { get; set; } /// /// Gets a mouse device associated with toplevel /// [CanBeNull] IMouseDevice MouseDevice { get; } IPopupImpl CreatePopup(); /// /// Sets the hint of the TopLevel. /// void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel); /// /// Gets the current of the TopLevel. /// WindowTransparencyLevel TransparencyLevel { get; } } }