Created
January 14, 2026 09:12
-
-
Save cnbluefire/df13cf69e34c707cd5d461ce9d0141ae to your computer and use it in GitHub Desktop.
ContentExternalOutputLink and ContentExternalBackdropLink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContentExternalBackdropLink : IDisposable | |
| { | |
| private ObjectReference<IContentExternalBackdropLinkVftbl> _IContentExternalBackdropLink; | |
| private WinRT.IObjectReference _ICompositionSupportsSystemBackdrop; | |
| public unsafe static ContentExternalBackdropLink Create(Microsoft.UI.Composition.Compositor compositor) | |
| { | |
| var pCompositor = ((IWinRTObject)compositor).NativeObject.ThisPtr; | |
| nint ppv = 0; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalBackdropLinkStatics.Vftbl._Create(_IContentExternalBackdropLinkStatics.ThisPtr, pCompositor, &ppv)); | |
| var ppvRef = ObjectReference<IContentExternalBackdropLinkVftbl>.Attach(ref ppv, typeof(IContentExternalBackdropLinkVftbl).GUID); | |
| return new ContentExternalBackdropLink() | |
| { | |
| _IContentExternalBackdropLink = ppvRef, | |
| _ICompositionSupportsSystemBackdrop = ppvRef.As<WinRT.Interop.IUnknownVftbl>(ABI.Windows.UI.Composition.ICompositionSupportsSystemBackdropMethods.IID), | |
| }; | |
| } | |
| public unsafe DispatcherQueue DispatcherQueue | |
| { | |
| get | |
| { | |
| nint abi; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalBackdropLink.Vftbl._get_DispatchQueue(_IContentExternalBackdropLink.ThisPtr, &abi)); | |
| return DispatcherQueue.FromAbi(abi); | |
| } | |
| } | |
| public unsafe Microsoft.UI.Composition.CompositionBorderMode ExternalOutputBorderMode | |
| { | |
| get | |
| { | |
| Microsoft.UI.Composition.CompositionBorderMode value; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalBackdropLink.Vftbl._get_ExternalOutputBorderMode(_IContentExternalBackdropLink.ThisPtr, &value)); | |
| return value; | |
| } | |
| set | |
| { | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalBackdropLink.Vftbl._set_ExternalOutputBorderMode(_IContentExternalBackdropLink.ThisPtr, value)); | |
| } | |
| } | |
| public unsafe Microsoft.UI.Composition.Visual PlacementVisual | |
| { | |
| get | |
| { | |
| nint abi; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalBackdropLink.Vftbl._get_PlacementVisual(_IContentExternalBackdropLink.ThisPtr, &abi)); | |
| return Microsoft.UI.Composition.Visual.FromAbi(abi); | |
| } | |
| } | |
| public Windows.UI.Composition.CompositionBrush SystemBackdrop | |
| { | |
| get => ABI.Windows.UI.Composition.ICompositionSupportsSystemBackdropMethods.get_SystemBackdrop(_ICompositionSupportsSystemBackdrop); | |
| set => ABI.Windows.UI.Composition.ICompositionSupportsSystemBackdropMethods.set_SystemBackdrop(_ICompositionSupportsSystemBackdrop, value); | |
| } | |
| public void Dispose() | |
| { | |
| if (_IContentExternalBackdropLink != null) | |
| { | |
| var ref1 = _IContentExternalBackdropLink; | |
| var ref2 = _ICompositionSupportsSystemBackdrop; | |
| _IContentExternalBackdropLink = null; | |
| _ICompositionSupportsSystemBackdrop = null; | |
| ABI.System.IDisposableMethods.Dispose(ref1); | |
| ref1.Dispose(); | |
| ref2.Dispose(); | |
| } | |
| } | |
| private static ObjectReference<IContentExternalBackdropLinkStaticsVftbl> _IContentExternalBackdropLinkStatics_Field; | |
| private static ObjectReference<IContentExternalBackdropLinkStaticsVftbl> _IContentExternalBackdropLinkStatics | |
| { | |
| get | |
| { | |
| if (_IContentExternalBackdropLinkStatics_Field == null) | |
| { | |
| using var factoryRef = WinRT.ActivationFactory.Get("Microsoft.UI.Content.ContentExternalBackdropLink"); | |
| _IContentExternalBackdropLinkStatics_Field = factoryRef.As<IContentExternalBackdropLinkStaticsVftbl>(typeof(IContentExternalBackdropLinkStaticsVftbl).GUID); | |
| } | |
| return _IContentExternalBackdropLinkStatics_Field; | |
| } | |
| } | |
| [Guid("46CAC6FB-BB51-510A-958D-E0EB4160F678")] | |
| private unsafe struct IContentExternalBackdropLinkStaticsVftbl | |
| { | |
| public WinRT.IInspectable.Vftbl IInspectableVftbl; | |
| public delegate* unmanaged[Stdcall]<nint, nint, nint*, int> _Create; | |
| } | |
| [Guid("1054BF83-B35B-5FDE-8DD7-AC3BB3E6CE27")] | |
| private unsafe struct IContentExternalBackdropLinkVftbl | |
| { | |
| public WinRT.IInspectable.Vftbl IInspectableVftbl; | |
| public delegate* unmanaged[Stdcall]<nint, nint*, int> _get_DispatchQueue; | |
| public delegate* unmanaged[Stdcall]<nint, Microsoft.UI.Composition.CompositionBorderMode*, int> _get_ExternalOutputBorderMode; | |
| public delegate* unmanaged[Stdcall]<nint, Microsoft.UI.Composition.CompositionBorderMode, int> _set_ExternalOutputBorderMode; | |
| public delegate* unmanaged[Stdcall]<nint, nint*, int> _get_PlacementVisual; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContentExternalOutputLink : IDisposable | |
| { | |
| private ObjectReference<IContentExternalOutputLinkVftbl> _IContentExternalOutputLink; | |
| private Windows.UI.Composition.CompositionTarget _CompositionTarget; | |
| public unsafe static ContentExternalOutputLink Create(Microsoft.UI.Composition.Compositor compositor) | |
| { | |
| var pCompositor = ((IWinRTObject)compositor).NativeObject.ThisPtr; | |
| nint ppv = 0; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLinkStatics.Vftbl._Create(_IContentExternalOutputLinkStatics.ThisPtr, pCompositor, &ppv)); | |
| var ppvRef = ObjectReference<IContentExternalOutputLinkVftbl>.Attach(ref ppv, typeof(IContentExternalOutputLinkVftbl).GUID); | |
| return new ContentExternalOutputLink() | |
| { | |
| _IContentExternalOutputLink = ppvRef, | |
| _CompositionTarget = Windows.UI.Composition.CompositionTarget.FromAbi(ppvRef.ThisPtr), | |
| }; | |
| } | |
| public unsafe Windows.UI.Color BackgroundColor | |
| { | |
| get | |
| { | |
| Windows.UI.Color value; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._get_BackgroundColor(_IContentExternalOutputLink.ThisPtr, &value)); | |
| return value; | |
| } | |
| set | |
| { | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._set_BackgroundColor(_IContentExternalOutputLink.ThisPtr, value)); | |
| } | |
| } | |
| public unsafe DispatcherQueue DispatcherQueue | |
| { | |
| get | |
| { | |
| nint abi; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._get_DispatchQueue(_IContentExternalOutputLink.ThisPtr, &abi)); | |
| return DispatcherQueue.FromAbi(abi); | |
| } | |
| } | |
| public unsafe Microsoft.UI.Composition.CompositionBorderMode ExternalOutputBorderMode | |
| { | |
| get | |
| { | |
| Microsoft.UI.Composition.CompositionBorderMode value; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._get_ExternalOutputBorderMode(_IContentExternalOutputLink.ThisPtr, &value)); | |
| return value; | |
| } | |
| set | |
| { | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._set_ExternalOutputBorderMode(_IContentExternalOutputLink.ThisPtr, value)); | |
| } | |
| } | |
| public unsafe bool IsAboveContent | |
| { | |
| get | |
| { | |
| int value; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._get_IsAboveContent(_IContentExternalOutputLink.ThisPtr, &value)); | |
| return value != 0; | |
| } | |
| set | |
| { | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._set_IsAboveContent(_IContentExternalOutputLink.ThisPtr, value ? 1 : 0)); | |
| } | |
| } | |
| public unsafe Microsoft.UI.Composition.Visual PlacementVisual | |
| { | |
| get | |
| { | |
| nint abi; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLink.Vftbl._get_PlacementVisual(_IContentExternalOutputLink.ThisPtr, &abi)); | |
| return Microsoft.UI.Composition.Visual.FromAbi(abi); | |
| } | |
| } | |
| public unsafe Windows.UI.Composition.Visual RootVisual | |
| { | |
| get => _CompositionTarget.Root; | |
| set => _CompositionTarget.Root = value; | |
| } | |
| public void Dispose() | |
| { | |
| if (_IContentExternalOutputLink != null) | |
| { | |
| var ref1 = _IContentExternalOutputLink; | |
| var ref2 = _CompositionTarget; | |
| _IContentExternalOutputLink = null; | |
| _CompositionTarget = null; | |
| ABI.System.IDisposableMethods.Dispose(ref1); | |
| ref1.Dispose(); | |
| ref2.Dispose(); | |
| } | |
| } | |
| private static ObjectReference<IContentExternalOutputLinkStaticsVftbl> _IContentExternalOutputLinkStatics_Field; | |
| private static ObjectReference<IContentExternalOutputLinkStaticsVftbl> _IContentExternalOutputLinkStatics | |
| { | |
| get | |
| { | |
| if (_IContentExternalOutputLinkStatics_Field == null) | |
| { | |
| using var factoryRef = WinRT.ActivationFactory.Get("Microsoft.UI.Content.ContentExternalOutputLink"); | |
| _IContentExternalOutputLinkStatics_Field = factoryRef.As<IContentExternalOutputLinkStaticsVftbl>(typeof(IContentExternalOutputLinkStaticsVftbl).GUID); | |
| } | |
| return _IContentExternalOutputLinkStatics_Field; | |
| } | |
| } | |
| public static unsafe bool IsSupported() | |
| { | |
| int value; | |
| ExceptionHelpers.ThrowExceptionForHR(_IContentExternalOutputLinkStatics.Vftbl._IsSupported(_IContentExternalOutputLinkStatics.ThisPtr, &value)); | |
| return value != 0; | |
| } | |
| [Guid("B758F401-833E-587D-B0CD-A3934EBA3721")] | |
| private unsafe struct IContentExternalOutputLinkStaticsVftbl | |
| { | |
| public WinRT.IInspectable.Vftbl IInspectableVftbl; | |
| public delegate* unmanaged[Stdcall]<nint, nint, nint*, int> _Create; | |
| public delegate* unmanaged[Stdcall]<nint, int*, int> _IsSupported; | |
| } | |
| [Guid("3DAC8EC8-011F-5AD2-8DB7-B73C4452F755")] | |
| private unsafe struct IContentExternalOutputLinkVftbl | |
| { | |
| public WinRT.IInspectable.Vftbl IInspectableVftbl; | |
| public delegate* unmanaged[Stdcall]<nint, Windows.UI.Color*, int> _get_BackgroundColor; | |
| public delegate* unmanaged[Stdcall]<nint, Windows.UI.Color, int> _set_BackgroundColor; | |
| public delegate* unmanaged[Stdcall]<nint, nint*, int> _get_DispatchQueue; | |
| public delegate* unmanaged[Stdcall]<nint, Microsoft.UI.Composition.CompositionBorderMode*, int> _get_ExternalOutputBorderMode; | |
| public delegate* unmanaged[Stdcall]<nint, Microsoft.UI.Composition.CompositionBorderMode, int> _set_ExternalOutputBorderMode; | |
| public delegate* unmanaged[Stdcall]<nint, int*, int> _get_IsAboveContent; | |
| public delegate* unmanaged[Stdcall]<nint, int, int> _set_IsAboveContent; | |
| public delegate* unmanaged[Stdcall]<nint, nint*, int> _get_PlacementVisual; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment