// ------------------------------------------------------------------------------
//
// 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;
namespace Dalamud.Bindings.ImGui
{
///
/// Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
/// Obtained by calling TableGetSortSpecs().
/// When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time.
/// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
///
[StructLayout(LayoutKind.Sequential)]
public partial struct ImGuiTableSortSpecs
{
///
/// To be documented.
///
public unsafe ImGuiTableColumnSortSpecs* Specs;
///
/// To be documented.
///
public int SpecsCount;
///
/// To be documented.
///
public byte SpecsDirty;
///
/// To be documented.
///
public unsafe ImGuiTableSortSpecs(ImGuiTableColumnSortSpecsPtr specs = default, int specsCount = default, bool specsDirty = default)
{
Specs = specs;
SpecsCount = specsCount;
SpecsDirty = specsDirty ? (byte)1 : (byte)0;
}
///
/// To be documented.
///
public unsafe void Destroy()
{
fixed (ImGuiTableSortSpecs* @this = &this)
{
ImGui.DestroyNative(@this);
}
}
}
///
/// To be documented.
///
#if NET5_0_OR_GREATER
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public unsafe struct ImGuiTableSortSpecsPtr : IEquatable
{
public ImGuiTableSortSpecsPtr(ImGuiTableSortSpecs* handle) { Handle = handle; }
public ImGuiTableSortSpecs* Handle;
public bool IsNull => Handle == null;
public static ImGuiTableSortSpecsPtr Null => new ImGuiTableSortSpecsPtr(null);
public ImGuiTableSortSpecs this[int index] { get => Handle[index]; set => Handle[index] = value; }
public static implicit operator ImGuiTableSortSpecsPtr(ImGuiTableSortSpecs* handle) => new ImGuiTableSortSpecsPtr(handle);
public static implicit operator ImGuiTableSortSpecs*(ImGuiTableSortSpecsPtr handle) => handle.Handle;
public static bool operator ==(ImGuiTableSortSpecsPtr left, ImGuiTableSortSpecsPtr right) => left.Handle == right.Handle;
public static bool operator !=(ImGuiTableSortSpecsPtr left, ImGuiTableSortSpecsPtr right) => left.Handle != right.Handle;
public static bool operator ==(ImGuiTableSortSpecsPtr left, ImGuiTableSortSpecs* right) => left.Handle == right;
public static bool operator !=(ImGuiTableSortSpecsPtr left, ImGuiTableSortSpecs* right) => left.Handle != right;
public bool Equals(ImGuiTableSortSpecsPtr other) => Handle == other.Handle;
///
public override bool Equals(object obj) => obj is ImGuiTableSortSpecsPtr handle && Equals(handle);
///
public override int GetHashCode() => ((nuint)Handle).GetHashCode();
#if NET5_0_OR_GREATER
private string DebuggerDisplay => string.Format("ImGuiTableSortSpecsPtr [0x{0}]", ((nuint)Handle).ToString("X"));
#endif
///
/// To be documented.
///
public ref ImGuiTableColumnSortSpecsPtr Specs => ref Unsafe.AsRef(&Handle->Specs);
///
/// To be documented.
///
public ref int SpecsCount => ref Unsafe.AsRef(&Handle->SpecsCount);
///
/// To be documented.
///
public ref bool SpecsDirty => ref Unsafe.AsRef(&Handle->SpecsDirty);
///
/// To be documented.
///
public unsafe void Destroy()
{
ImGui.DestroyNative(Handle);
}
}
}