Files
LanMountainDesktop/LanMountainDesktop.PluginSdk/PluginAppearanceSnapshot.cs
lincube 6b1c738d8c Add material color services, plugin DTOs, and tests
Introduce IPC wire-format appearance DTOs (PluginIsolation.Contracts) and clarify they are distinct from the runtime PluginSdk snapshot. Update PluginSdk comments to document the runtime-facing snapshot shape. Change ComponentColorSchemeHelper to use the HostMaterialColorProvider and add an overload that accepts a MaterialColorSnapshot. Add new services and pipelines (MaterialColorService, MaterialSurfaceService, WindowMaterialService, WallpaperColorPipeline) and refactor AppearanceThemeService to depend on MaterialColorService while removing legacy internal implementations. Add multiple unit tests (ComponentColorSchemeHelper, PluginAppearanceBoundary, SettingsCatalogService, WallpaperSettingsPageViewModel) and update localization resources with new material_color and wallpaper keys.
2026-05-06 19:33:08 +08:00

29 lines
1.1 KiB
C#

namespace LanMountainDesktop.PluginSdk;
/// <remarks>
/// This is the runtime snapshot shape consumed by plugins inside the host process.
/// It is intentionally distinct from the wire DTO with the same name in
/// <c>LanMountainDesktop.PluginIsolation.Contracts.PluginAppearanceSnapshot</c>.
/// </remarks>
public sealed record PluginMaterialSurfaceSnapshot(
string BackgroundColor,
string BorderColor,
double BlurRadius,
double Opacity);
/// <remarks>
/// Runtime-facing appearance snapshot for plugins. This is not the same contract as the
/// wire-format snapshot in <c>LanMountainDesktop.PluginIsolation.Contracts</c>, even though the
/// type name matches.
/// </remarks>
public sealed record PluginAppearanceSnapshot(
PluginCornerRadiusTokens CornerRadiusTokens,
string ThemeVariant,
string? AccentColor = null,
string? SeedColor = null,
string? ColorSource = null,
string? SystemMaterialMode = null,
IReadOnlyDictionary<string, string>? ColorRoles = null,
IReadOnlyDictionary<string, PluginMaterialSurfaceSnapshot>? MaterialSurfaces = null,
IReadOnlyList<string>? WallpaperSeedCandidates = null);