// ------------------------------------------------------------------------------ // // 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 ImPlotTicker { /// /// To be documented. /// public ImVector Ticks; /// /// To be documented. /// public ImGuiTextBuffer TextBuffer; /// /// To be documented. /// public Vector2 MaxSize; /// /// To be documented. /// public Vector2 LateSize; /// /// To be documented. /// public int Levels; /// /// To be documented. /// public unsafe ImPlotTicker(ImVector ticks = default, ImGuiTextBuffer textBuffer = default, Vector2 maxSize = default, Vector2 lateSize = default, int levels = default) { Ticks = ticks; TextBuffer = textBuffer; MaxSize = maxSize; LateSize = lateSize; Levels = levels; } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, byte* label) { fixed (ImPlotTicker* @this = &this) { ImPlotTick* ret = ImPlot.AddTickNative(@this, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, label); return ret; } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ref byte label) { fixed (ImPlotTicker* @this = &this) { fixed (byte* plabel = &label) { ImPlotTick* ret = ImPlot.AddTickNative(@this, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, (byte*)plabel); return ret; } } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ReadOnlySpan label) { fixed (ImPlotTicker* @this = &this) { fixed (byte* plabel = label) { ImPlotTick* ret = ImPlot.AddTickNative(@this, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, (byte*)plabel); return ret; } } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, string label) { fixed (ImPlotTicker* @this = &this) { byte* pStr0 = null; int pStrSize0 = 0; if (label != null) { pStrSize0 = Utils.GetByteCountUTF8(label); if (pStrSize0 >= Utils.MaxStackallocSize) { pStr0 = Utils.Alloc(pStrSize0 + 1); } else { byte* pStrStack0 = stackalloc byte[pStrSize0 + 1]; pStr0 = pStrStack0; } int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0); pStr0[pStrOffset0] = 0; } ImPlotTick* ret = ImPlot.AddTickNative(@this, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, pStr0); if (pStrSize0 >= Utils.MaxStackallocSize) { Utils.Free(pStr0); } return ret; } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ImPlotFormatter formatter, void* data) { fixed (ImPlotTicker* @this = &this) { ImPlotTick* ret = ImPlot.AddTickNative(@this, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, formatter, data); return ret; } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(ImPlotTick tick) { fixed (ImPlotTicker* @this = &this) { ImPlotTick* ret = ImPlot.AddTickNative(@this, tick); return ret; } } /// /// To be documented. /// public unsafe void Destroy() { fixed (ImPlotTicker* @this = &this) { ImPlot.DestroyNative(@this); } } /// /// To be documented. /// public unsafe byte* GetText(int idx) { fixed (ImPlotTicker* @this = &this) { byte* ret = ImPlot.GetTextNative(@this, idx); return ret; } } /// /// To be documented. /// public unsafe string GetTextS(int idx) { fixed (ImPlotTicker* @this = &this) { string ret = Utils.DecodeStringUTF8(ImPlot.GetTextNative(@this, idx)); return ret; } } /// /// To be documented. /// public unsafe byte* GetText(ImPlotTick tick) { fixed (ImPlotTicker* @this = &this) { byte* ret = ImPlot.GetTextNative(@this, tick); return ret; } } /// /// To be documented. /// public unsafe string GetTextS(ImPlotTick tick) { fixed (ImPlotTicker* @this = &this) { string ret = Utils.DecodeStringUTF8(ImPlot.GetTextNative(@this, tick)); return ret; } } /// /// To be documented. /// public unsafe void OverrideSizeLate(Vector2 size) { fixed (ImPlotTicker* @this = &this) { ImPlot.OverrideSizeLateNative(@this, size); } } /// /// To be documented. /// public unsafe void Reset() { fixed (ImPlotTicker* @this = &this) { ImPlot.ResetNative(@this); } } /// /// To be documented. /// public unsafe int TickCount() { fixed (ImPlotTicker* @this = &this) { int ret = ImPlot.TickCountNative(@this); return ret; } } } /// /// To be documented. /// #if NET5_0_OR_GREATER [DebuggerDisplay("{DebuggerDisplay,nq}")] #endif public unsafe struct ImPlotTickerPtr : IEquatable { public ImPlotTickerPtr(ImPlotTicker* handle) { Handle = handle; } public ImPlotTicker* Handle; public bool IsNull => Handle == null; public static ImPlotTickerPtr Null => new ImPlotTickerPtr(null); public ImPlotTicker this[int index] { get => Handle[index]; set => Handle[index] = value; } public static implicit operator ImPlotTickerPtr(ImPlotTicker* handle) => new ImPlotTickerPtr(handle); public static implicit operator ImPlotTicker*(ImPlotTickerPtr handle) => handle.Handle; public static bool operator ==(ImPlotTickerPtr left, ImPlotTickerPtr right) => left.Handle == right.Handle; public static bool operator !=(ImPlotTickerPtr left, ImPlotTickerPtr right) => left.Handle != right.Handle; public static bool operator ==(ImPlotTickerPtr left, ImPlotTicker* right) => left.Handle == right; public static bool operator !=(ImPlotTickerPtr left, ImPlotTicker* right) => left.Handle != right; public bool Equals(ImPlotTickerPtr other) => Handle == other.Handle; /// public override bool Equals(object obj) => obj is ImPlotTickerPtr handle && Equals(handle); /// public override int GetHashCode() => ((nuint)Handle).GetHashCode(); #if NET5_0_OR_GREATER private string DebuggerDisplay => string.Format("ImPlotTickerPtr [0x{0}]", ((nuint)Handle).ToString("X")); #endif /// /// To be documented. /// public ref ImVector Ticks => ref Unsafe.AsRef>(&Handle->Ticks); /// /// To be documented. /// public ref ImGuiTextBuffer TextBuffer => ref Unsafe.AsRef(&Handle->TextBuffer); /// /// To be documented. /// public ref Vector2 MaxSize => ref Unsafe.AsRef(&Handle->MaxSize); /// /// To be documented. /// public ref Vector2 LateSize => ref Unsafe.AsRef(&Handle->LateSize); /// /// To be documented. /// public ref int Levels => ref Unsafe.AsRef(&Handle->Levels); /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, byte* label) { ImPlotTick* ret = ImPlot.AddTickNative(Handle, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, label); return ret; } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ref byte label) { fixed (byte* plabel = &label) { ImPlotTick* ret = ImPlot.AddTickNative(Handle, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, (byte*)plabel); return ret; } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ReadOnlySpan label) { fixed (byte* plabel = label) { ImPlotTick* ret = ImPlot.AddTickNative(Handle, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, (byte*)plabel); return ret; } } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, string label) { byte* pStr0 = null; int pStrSize0 = 0; if (label != null) { pStrSize0 = Utils.GetByteCountUTF8(label); if (pStrSize0 >= Utils.MaxStackallocSize) { pStr0 = Utils.Alloc(pStrSize0 + 1); } else { byte* pStrStack0 = stackalloc byte[pStrSize0 + 1]; pStr0 = pStrStack0; } int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0); pStr0[pStrOffset0] = 0; } ImPlotTick* ret = ImPlot.AddTickNative(Handle, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, pStr0); if (pStrSize0 >= Utils.MaxStackallocSize) { Utils.Free(pStr0); } return ret; } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(double value, bool major, int level, bool showLabel, ImPlotFormatter formatter, void* data) { ImPlotTick* ret = ImPlot.AddTickNative(Handle, value, major ? (byte)1 : (byte)0, level, showLabel ? (byte)1 : (byte)0, formatter, data); return ret; } /// /// To be documented. /// public unsafe ImPlotTick* AddTick(ImPlotTick tick) { ImPlotTick* ret = ImPlot.AddTickNative(Handle, tick); return ret; } /// /// 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 byte* GetText(ImPlotTick tick) { byte* ret = ImPlot.GetTextNative(Handle, tick); return ret; } /// /// To be documented. /// public unsafe string GetTextS(ImPlotTick tick) { string ret = Utils.DecodeStringUTF8(ImPlot.GetTextNative(Handle, tick)); return ret; } /// /// To be documented. /// public unsafe void OverrideSizeLate(Vector2 size) { ImPlot.OverrideSizeLateNative(Handle, size); } /// /// To be documented. /// public unsafe void Reset() { ImPlot.ResetNative(Handle); } /// /// To be documented. /// public unsafe int TickCount() { int ret = ImPlot.TickCountNative(Handle); return ret; } } }