using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using TerraFX.Interop.Windows; using TerraFX.Interop; using WinRT; using WinRT.Interop; #pragma warning disable CS0649, IDE0055, IDE1006 namespace ABI.Microsoft.Graphics.Canvas; /// /// Raw bindings for the interop interface for the activation factory. /// internal unsafe struct ICanvasFactoryNative : IUnknown.Interface { public void** lpVtbl; /// static Guid* INativeGuid.NativeGuid { get { ReadOnlySpan data = [ 0x0D, 0x44, 0x5C, 0x69, 0xB3, 0x04, 0xDD, 0x4E, 0xBF, 0xD9, 0x63, 0xE5, 0x1E, 0x9F, 0x72, 0x02 ]; return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); } } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public HRESULT QueryInterface(Guid* riid, void** ppvObject) { return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this), riid, ppvObject); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public uint AddRef() { return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this)); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public uint Release() { return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this)); } /// /// Gets or creates an IInspectable Win2D wrapper for a given native D2D resource. /// /// The input canvas device (as a marshalled ). /// The input native resource to create a wrapper for. /// The realization DPIs for /// The resulting wrapper for . /// The HRESULT for the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public HRESULT GetOrCreate(IUnknown* device, IUnknown* resource, float dpi, void** wrapper) { return ((delegate* unmanaged[MemberFunction])this.lpVtbl[6])( (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), device, resource, dpi, wrapper); } /// /// The managed interface for . /// [Guid("695C440D-04B3-4EDD-BFD9-63E51E9F7202")] [WindowsRuntimeType] [WindowsRuntimeHelperType(typeof(Interface))] public interface Interface { /// /// The vtable type for . /// [Guid("695C440D-04B3-4EDD-BFD9-63E51E9F7202")] public readonly struct Vftbl { /// /// Allows CsWinRT to retrieve a pointer to the projection vtable (the name is hardcoded by convention). /// public static readonly IntPtr AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftblPtr; } } }