// ------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// ------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using HexaGen.Runtime;
using System.Numerics;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Bindings.ImPlot
{
///
/// To be documented.
///
[StructLayout(LayoutKind.Sequential)]
public partial struct ImPlotAnnotationCollection
{
///
/// To be documented.
///
public ImVector Annotations;
///
/// To be documented.
///
public ImGuiTextBuffer TextBuffer;
///
/// To be documented.
///
public int Size;
///
/// To be documented.
///
public unsafe ImPlotAnnotationCollection(ImVector annotations = default, ImGuiTextBuffer textBuffer = default, int size = default)
{
Annotations = annotations;
TextBuffer = textBuffer;
Size = size;
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, byte* fmt)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
ImPlot.AppendNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, fmt);
}
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ref byte fmt)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
fixed (byte* pfmt = &fmt)
{
ImPlot.AppendNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt);
}
}
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ReadOnlySpan fmt)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
fixed (byte* pfmt = fmt)
{
ImPlot.AppendNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt);
}
}
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, string fmt)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (fmt != null)
{
pStrSize0 = Utils.GetByteCountUTF8(fmt);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(fmt, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImPlot.AppendNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, pStr0);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, byte* fmt, nuint args)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
ImPlot.AppendVNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, fmt, args);
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ref byte fmt, nuint args)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
fixed (byte* pfmt = &fmt)
{
ImPlot.AppendVNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt, args);
}
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ReadOnlySpan fmt, nuint args)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
fixed (byte* pfmt = fmt)
{
ImPlot.AppendVNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt, args);
}
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, string fmt, nuint args)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (fmt != null)
{
pStrSize0 = Utils.GetByteCountUTF8(fmt);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(fmt, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImPlot.AppendVNative(@this, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, pStr0, args);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
}
///
/// To be documented.
///
public unsafe void Destroy()
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
ImPlot.DestroyNative(@this);
}
}
///
/// To be documented.
///
public unsafe byte* GetText(int idx)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
byte* ret = ImPlot.GetTextNative(@this, idx);
return ret;
}
}
///
/// To be documented.
///
public unsafe string GetTextS(int idx)
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
string ret = Utils.DecodeStringUTF8(ImPlot.GetTextNative(@this, idx));
return ret;
}
}
///
/// To be documented.
///
public unsafe void Reset()
{
fixed (ImPlotAnnotationCollection* @this = &this)
{
ImPlot.ResetNative(@this);
}
}
}
///
/// To be documented.
///
#if NET5_0_OR_GREATER
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public unsafe struct ImPlotAnnotationCollectionPtr : IEquatable
{
public ImPlotAnnotationCollectionPtr(ImPlotAnnotationCollection* handle) { Handle = handle; }
public ImPlotAnnotationCollection* Handle;
public bool IsNull => Handle == null;
public static ImPlotAnnotationCollectionPtr Null => new ImPlotAnnotationCollectionPtr(null);
public ImPlotAnnotationCollection this[int index] { get => Handle[index]; set => Handle[index] = value; }
public static implicit operator ImPlotAnnotationCollectionPtr(ImPlotAnnotationCollection* handle) => new ImPlotAnnotationCollectionPtr(handle);
public static implicit operator ImPlotAnnotationCollection*(ImPlotAnnotationCollectionPtr handle) => handle.Handle;
public static bool operator ==(ImPlotAnnotationCollectionPtr left, ImPlotAnnotationCollectionPtr right) => left.Handle == right.Handle;
public static bool operator !=(ImPlotAnnotationCollectionPtr left, ImPlotAnnotationCollectionPtr right) => left.Handle != right.Handle;
public static bool operator ==(ImPlotAnnotationCollectionPtr left, ImPlotAnnotationCollection* right) => left.Handle == right;
public static bool operator !=(ImPlotAnnotationCollectionPtr left, ImPlotAnnotationCollection* right) => left.Handle != right;
public bool Equals(ImPlotAnnotationCollectionPtr other) => Handle == other.Handle;
///
public override bool Equals(object obj) => obj is ImPlotAnnotationCollectionPtr handle && Equals(handle);
///
public override int GetHashCode() => ((nuint)Handle).GetHashCode();
#if NET5_0_OR_GREATER
private string DebuggerDisplay => string.Format("ImPlotAnnotationCollectionPtr [0x{0}]", ((nuint)Handle).ToString("X"));
#endif
///
/// To be documented.
///
public ref ImVector Annotations => ref Unsafe.AsRef>(&Handle->Annotations);
///
/// To be documented.
///
public ref ImGuiTextBuffer TextBuffer => ref Unsafe.AsRef(&Handle->TextBuffer);
///
/// To be documented.
///
public ref int Size => ref Unsafe.AsRef(&Handle->Size);
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, byte* fmt)
{
ImPlot.AppendNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, fmt);
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ref byte fmt)
{
fixed (byte* pfmt = &fmt)
{
ImPlot.AppendNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt);
}
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ReadOnlySpan fmt)
{
fixed (byte* pfmt = fmt)
{
ImPlot.AppendNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt);
}
}
///
/// To be documented.
///
public unsafe void Append(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, string fmt)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (fmt != null)
{
pStrSize0 = Utils.GetByteCountUTF8(fmt);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(fmt, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImPlot.AppendNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, pStr0);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, byte* fmt, nuint args)
{
ImPlot.AppendVNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, fmt, args);
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ref byte fmt, nuint args)
{
fixed (byte* pfmt = &fmt)
{
ImPlot.AppendVNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt, args);
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, ReadOnlySpan fmt, nuint args)
{
fixed (byte* pfmt = fmt)
{
ImPlot.AppendVNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, (byte*)pfmt, args);
}
}
///
/// To be documented.
///
public unsafe void AppendV(Vector2 pos, Vector2 off, uint bg, uint fg, bool clamp, string fmt, nuint args)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (fmt != null)
{
pStrSize0 = Utils.GetByteCountUTF8(fmt);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(fmt, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImPlot.AppendVNative(Handle, pos, off, bg, fg, clamp ? (byte)1 : (byte)0, pStr0, args);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
///
/// To be documented.
///
public unsafe void Destroy()
{
ImPlot.DestroyNative(Handle);
}
///
/// To be documented.
///
public unsafe byte* GetText(int idx)
{
byte* ret = ImPlot.GetTextNative(Handle, idx);
return ret;
}
///
/// To be documented.
///
public unsafe string GetTextS(int idx)
{
string ret = Utils.DecodeStringUTF8(ImPlot.GetTextNative(Handle, idx));
return ret;
}
///
/// To be documented.
///
public unsafe void Reset()
{
ImPlot.ResetNative(Handle);
}
}
}