using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Win32;
using WinRT;
using WinRT.Interop;
using IInspectable = ComputeSharp.Win32.IInspectable;
#pragma warning disable CS0649, IDE1006
namespace ABI.Microsoft.Graphics.Canvas;
///
/// The activation factory for .
///
[NativeTypeName("class ICanvasFactoryNative : public IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasFactoryNative
{
public void** lpVtbl;
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(0)]
public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[0])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(1)]
[return: NativeTypeName("ULONG")]
public uint AddRef()
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[1])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(2)]
[return: NativeTypeName("ULONG")]
public uint Release()
{
return ((delegate* unmanaged[Stdcall])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 for the operation.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(6)]
public HRESULT GetOrCreate(ICanvasDevice* device, IUnknown* resource, float dpi, IInspectable** wrapper)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[6])(
(ICanvasFactoryNative*)Unsafe.AsPointer(ref this),
device,
resource,
dpi,
wrapper);
}
///
/// Registers an IInspectable wrapper for a given native D2D resource.
///
/// The input native resource to register a wrapper for.
/// The wrapper to register for .
///
/// The for the operation. In case of success, it will be if the wrapper
/// was not previously registered, or if was already registered.
///
///
/// The method validates at runtime that is an
/// and that is an . Additionally,
/// has to implement IWeakReferenceSource for this method to be successful.
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(7)]
public HRESULT RegisterWrapper(IUnknown* resource, IInspectable* wrapper)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[7])(
(ICanvasFactoryNative*)Unsafe.AsPointer(ref this),
resource,
wrapper);
}
///
/// Unregisters a native D2D resource previously registered with .
///
/// The input native resource to unregister.
///
/// The for the operation. In case of success, it will be if the
/// resource was previously registered and could be correctly unregistered, otherwise.
///
///
/// The method validates at runtime that is an .
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(8)]
public HRESULT UnregisterWrapper(IUnknown* resource)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[8])(
(ICanvasFactoryNative*)Unsafe.AsPointer(ref this),
resource);
}
///
/// Registers a factory of wrappers for custom effects.
///
/// The id of the effects to register a factory for.
/// The input factory to create wrappers of native effects.
///
/// The for the operation. In case of success, it will be if the factory
/// was not previously registered, or if was already registered.
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(9)]
public HRESULT RegisterEffectFactory([NativeTypeName("const IID &")] Guid* effectId, ICanvasEffectFactoryNative* factory)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[9])(
(ICanvasFactoryNative*)Unsafe.AsPointer(ref this),
effectId,
factory);
}
///
/// Unregisters an effect factory that was previosuly registered with .
///
/// The id of the effects to unregister the factory for.
///
/// The for the operation. In case of success, it will be if the
/// factory was previously registered and could be correctly unregistered, otherwise.
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(10)]
public HRESULT UnregisterEffectFactory([NativeTypeName("const IID &")] Guid* effectId)
{
return ((delegate* unmanaged[Stdcall])this.lpVtbl[10])(
(ICanvasFactoryNative*)Unsafe.AsPointer(ref this),
effectId);
}
///
/// 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;
}
}
}