using Moli.Desktop.Plugins; namespace Moli.Desktop.Layout; /// Monitor identifier used by persisted layouts. public readonly record struct MonitorId(string Value) { public override string ToString() => Value; } public readonly record struct PointD(double X, double Y); public readonly record struct SizeD(double Width, double Height); public readonly record struct RectD(double X, double Y, double Width, double Height) { public double Right => X + Width; public double Bottom => Y + Height; } public readonly record struct WidgetInstanceId(string Value) { public override string ToString() => Value; } public enum DisplayPriority { DesktopLayer, IconLayer, AppLayer } public sealed record WidgetRuntimeState { public required WidgetInstanceId InstanceId { get; init; } public required PluginId PluginId { get; init; } public required RectD Bounds { get; init; } public required MonitorId MonitorId { get; init; } public bool IsVisible { get; init; } = true; public bool IsLocked { get; init; } public double Opacity { get; init; } = 1; public bool ClickThrough { get; init; } = true; public DisplayPriority DisplayPriority { get; init; } = DisplayPriority.IconLayer; } public sealed record WidgetLayoutPatch { public RectD? Bounds { get; init; } public MonitorId? MonitorId { get; init; } public bool? IsVisible { get; init; } public bool? IsLocked { get; init; } public double? Opacity { get; init; } public bool? ClickThrough { get; init; } public double? Scale { get; init; } public DisplayPriority? DisplayPriority { get; init; } }