using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using Decal.Interop.Core;

namespace Decal.Interop.Render;

[ComImport]
[Guid("F229E8CB-6F85-46F5-9C8A-8399F60A37CB")]
[SuppressUnmanagedCodeSecurity]
[TypeLibType(4288)]
public interface IRenderTarget
{
	[DispId(1610743808)]
	bool Lost
	{
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
		[DispId(1610743808)]
		get;
	}

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[TypeLibFunc(64)]
	[DispId(1610743809)]
	void SetSurface([In][MarshalAs(UnmanagedType.IUnknown)] object pSurface);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743810)]
	[return: MarshalAs(UnmanagedType.IUnknown)]
	object GetSurface();

	[DispId(1610743811)]
	tagRECT Region
	{
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
		[DispId(1610743811)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
		[DispId(1610743811)]
		[param: In]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743813)]
	void Fill([In] ref tagRECT FillArea, int Color = 0);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743814)]
	void Clear([In] ref tagRECT ClearArea);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743815)]
	void BeginRender([In] bool bFilterTexture = false);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743816)]
	void EndRender();

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743817)]
	void BeginText([In][MarshalAs(UnmanagedType.BStr)] string FontName, int lHeight, int lWeight, [In] bool bItalic = false);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743818)]
	void EndText();

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743819)]
	void DrawPortalImage([In] int lPortalFile, ref tagRECT DestArea);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743820)]
	void DrawPortalImageEx([In] int lPortalFile, int lAlpha, ref tagRECT SrcArea, ref tagRECT DestArea);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743821)]
	void DrawImage([In] int pBuffer, int lSize, ref tagRECT DestRegion, int lColorKey);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743822)]
	void WriteText([In] ref tagRECT Region, int lColor, int lFormat, [MarshalAs(UnmanagedType.BStr)] string Text);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743823)]
	void TilePortalImage([In] int lPortalFile, ref tagRECT DestArea);

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743824)]
	void TilePortalImageEx([In] int lPortalFile, ref tagRECT SrcArea, ref tagRECT DestArea);

	[DispId(1610743825)]
	tagRECT Constraints
	{
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
		[DispId(1610743825)]
		[TypeLibFunc(64)]
		get;
	}

	[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
	[DispId(1610743826)]
	[return: MarshalAs(UnmanagedType.Interface)]
	RenderTargetWrapper Constrain([In] ref tagRECT Region);
}
