From c4ee18aef3798fe62468da6d9e00a2894e4dbccd Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Mon, 16 Sep 2024 22:44:38 +0200 Subject: [PATCH 1/3] feat: Correctly indicate support for DesktopAcrylicController and MicaController --- .../SystemBackdrops/DesktopAcrylicController.cs | 13 +++++++++++++ .../Composition/SystemBackdrops/MicaController.cs | 11 +++++++++++ .../DesktopAcrylicController.cs | 4 ++-- .../MicaController.cs | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs create mode 100644 src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs diff --git a/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs b/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs new file mode 100644 index 0000000000..85e7214940 --- /dev/null +++ b/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs @@ -0,0 +1,13 @@ +using System; + +namespace Microsoft.UI.Composition.SystemBackdrops; + +public partial class DesktopAcrylicController : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +{ + /// + /// Determines whether the acrylic material is supported on the current operating system. + /// + /// Currently returns false on all targets except for WinUI. + /// True if the acrylic material is supported on the current operating system; otherwise, false. + public static bool IsSupported() => false; +} diff --git a/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs b/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs new file mode 100644 index 0000000000..6f67ebdb59 --- /dev/null +++ b/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs @@ -0,0 +1,11 @@ +namespace Microsoft.UI.Composition.SystemBackdrops; + +public partial class MicaController : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +{ + /// + /// Determines whether the mica material is supported on the current operating system. + /// + /// Currently returns false on all targets except for WinUI. + /// True if the mica material is supported on the current operating system; otherwise, false. + public static bool IsSupported() => false; +} diff --git a/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/DesktopAcrylicController.cs b/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/DesktopAcrylicController.cs index f4b4df2160..9945b00c1a 100644 --- a/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/DesktopAcrylicController.cs +++ b/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/DesktopAcrylicController.cs @@ -3,7 +3,7 @@ #pragma warning disable 114 // new keyword hiding namespace Microsoft.UI.Composition.SystemBackdrops { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented] #endif public partial class DesktopAcrylicController : global::Microsoft.UI.Composition.SystemBackdrops.ISystemBackdropController, global::System.IDisposable, global::Microsoft.UI.Composition.SystemBackdrops.ISystemBackdropControllerWithTargets, global::Microsoft.UI.IClosableNotifier @@ -180,7 +180,7 @@ namespace Microsoft.UI.Composition.SystemBackdrops } #endif // Forced skipping of method Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicController.DesktopAcrylicController() -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public static bool IsSupported() { diff --git a/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/MicaController.cs b/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/MicaController.cs index cb6b6fdf1d..d5e4af52c9 100644 --- a/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/MicaController.cs +++ b/src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition.SystemBackdrops/MicaController.cs @@ -3,7 +3,7 @@ #pragma warning disable 114 // new keyword hiding namespace Microsoft.UI.Composition.SystemBackdrops { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented] #endif public partial class MicaController : global::Microsoft.UI.Composition.SystemBackdrops.ISystemBackdropController, global::System.IDisposable, global::Microsoft.UI.Composition.SystemBackdrops.ISystemBackdropControllerWithTargets, global::Microsoft.UI.IClosableNotifier @@ -180,7 +180,7 @@ namespace Microsoft.UI.Composition.SystemBackdrops } #endif // Forced skipping of method Microsoft.UI.Composition.SystemBackdrops.MicaController.MicaController() -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public static bool IsSupported() { From 323a7e5a6d89a6bc0f16207ef84cb4379671320e Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Tue, 17 Sep 2024 10:12:13 +0200 Subject: [PATCH 2/3] chore: Interfaces specific to WinUI on MicaController --- .../Composition/SystemBackdrops/MicaController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs b/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs index 6f67ebdb59..a8c4366224 100644 --- a/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs +++ b/src/Uno.UI.Composition/Composition/SystemBackdrops/MicaController.cs @@ -1,6 +1,11 @@ +using System; + namespace Microsoft.UI.Composition.SystemBackdrops; -public partial class MicaController : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +public partial class MicaController +#if HAS_UNO_WINUI + : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +#endif { /// /// Determines whether the mica material is supported on the current operating system. From 3fc8f7e4ef31734ac1749a25e7b71a91ce59b011 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Tue, 17 Sep 2024 10:12:50 +0200 Subject: [PATCH 3/3] chore: Interfaces specific to WinUI on DesktopAcrylicController --- .../Composition/SystemBackdrops/DesktopAcrylicController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs b/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs index 85e7214940..82e371f6aa 100644 --- a/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs +++ b/src/Uno.UI.Composition/Composition/SystemBackdrops/DesktopAcrylicController.cs @@ -2,7 +2,10 @@ using System; namespace Microsoft.UI.Composition.SystemBackdrops; -public partial class DesktopAcrylicController : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +public partial class DesktopAcrylicController +#if HAS_UNO_WINUI + : ISystemBackdropController, IDisposable, ISystemBackdropControllerWithTargets, IClosableNotifier +#endif { /// /// Determines whether the acrylic material is supported on the current operating system.