// using HexaGen.Runtime; using System; using System.Diagnostics; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImGuiPayloadPtr { public unsafe void Clear() { ImGuiNative.Clear(Handle); } public unsafe void Destroy() { ImGuiNative.Destroy(Handle); } public unsafe bool IsDataType(byte* type) { byte ret = ImGuiNative.IsDataType(Handle, type); return ret != 0; } public unsafe bool IsDataType(ref byte type) { fixed (byte* ptype = &type) { byte ret = ImGuiNative.IsDataType(Handle, (byte*)ptype); return ret != 0; } } public unsafe bool IsDataType(ReadOnlySpan type) { fixed (byte* ptype = type) { byte ret = ImGuiNative.IsDataType(Handle, (byte*)ptype); return ret != 0; } } public unsafe bool IsDataType(string type) { byte* pStr0 = null; int pStrSize0 = 0; if (type != null) { pStrSize0 = Utils.GetByteCountUTF8(type); if (pStrSize0 >= Utils.MaxStackallocSize) { pStr0 = Utils.Alloc(pStrSize0 + 1); } else { byte* pStrStack0 = stackalloc byte[pStrSize0 + 1]; pStr0 = pStrStack0; } int pStrOffset0 = Utils.EncodeStringUTF8(type, pStr0, pStrSize0); pStr0[pStrOffset0] = 0; } byte ret = ImGuiNative.IsDataType(Handle, pStr0); if (pStrSize0 >= Utils.MaxStackallocSize) { Utils.Free(pStr0); } return ret != 0; } public unsafe bool IsDelivery() { byte ret = ImGuiNative.IsDelivery(Handle); return ret != 0; } public unsafe bool IsPreview() { byte ret = ImGuiNative.IsPreview(Handle); return ret != 0; } }