refactor: 新建 Platform 平台差异层,主工程 P/Invoke 全部迁出

- 新增 Platform.Abstractions(接口+NoOp+PlatformLog 日志桥)、
  Platform.Windows、Platform.MacOS、Platform.Android 四个项目
- 迁移电源管理、原生对话框、桌面层嵌入、窗口置底/区域穿透、
  DWM 互操作、图标服务、包标识查询等全部 Windows P/Invoke 实现
- 主工程保留静态工厂门面,调用点不变;DllImport 扫描为零
- 更新 WindowPassthroughServiceTests 指向新位置(20/20 通过)
This commit is contained in:
lincube
2026-07-26 22:14:46 +09:00
parent 78cbbede9d
commit 9b7a35ddd3
35 changed files with 2157 additions and 1862 deletions

View File

@@ -0,0 +1,30 @@
using Avalonia.Controls;
namespace LanMountainDesktop.Platform.Abstractions;
/// <summary>
/// 主窗口桌面层服务接口。将主窗口嵌入系统桌面图标层(仅 Windows 支持)。
/// </summary>
public interface IMainWindowDesktopLayerService
{
bool IsSupported { get; }
void EnableOrRefresh(Window window);
void Disable(Window window);
}
/// <summary>
/// 无操作实现。用于不支持桌面层嵌入的平台Linux/macOS/移动端)。
/// </summary>
public sealed class NullMainWindowDesktopLayerService : IMainWindowDesktopLayerService
{
public bool IsSupported => false;
public void EnableOrRefresh(Window window)
{
PlatformLog.Info("MainWindowDesktopLayer", "Desktop layer requested on an unsupported platform.");
}
public void Disable(Window window)
{
}
}