using System.Windows;
|
using Moli.Desktop.Configuration;
|
using Moli.Desktop.Interop;
|
|
namespace Moli.Desktop.Tests.Interop;
|
|
public sealed class FakeWin32InteropService : IWin32InteropService
|
{
|
public bool ClickThroughEnabled { get; private set; }
|
public bool ToolWindowEnabled { get; private set; }
|
public bool NoActivateEnabled { get; private set; }
|
public byte Opacity { get; private set; } = 255;
|
public DesktopLayerMode? LayerMode { get; private set; }
|
|
public IntPtr GetWindowHandle(Window window) => new(42);
|
|
public void SetClickThrough(IntPtr hwnd, bool enabled) => ClickThroughEnabled = enabled;
|
|
public void SetToolWindow(IntPtr hwnd, bool enabled) => ToolWindowEnabled = enabled;
|
|
public void SetNoActivate(IntPtr hwnd, bool enabled) => NoActivateEnabled = enabled;
|
|
public void SetLayered(IntPtr hwnd, bool enabled, byte opacity) => Opacity = enabled ? opacity : (byte)255;
|
|
public void MoveToDesktopLayer(IntPtr hwnd, DesktopLayerMode mode, MonitorInfo monitor) => LayerMode = mode;
|
|
public void SetBottomMost(IntPtr hwnd) => LayerMode = DesktopLayerMode.BottomMost;
|
|
public IReadOnlyList<MonitorInfo> GetMonitors() =>
|
[
|
new MonitorInfo
|
{
|
Id = new Moli.Desktop.Layout.MonitorId("primary"),
|
Bounds = new Moli.Desktop.Layout.RectD(0, 0, 1920, 1080),
|
WorkArea = new Moli.Desktop.Layout.RectD(0, 0, 1920, 1040),
|
IsPrimary = true
|
}
|
];
|
}
|