// ------------------------------------------------------------------------------
//
// 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
{
///
/// To be documented.
///
[StructLayout(LayoutKind.Sequential)]
public partial struct ImGuiPtrOrIndex
{
///
/// To be documented.
///
public unsafe void* Ptr;
///
/// To be documented.
///
public int Index;
///
/// To be documented.
///
public unsafe ImGuiPtrOrIndex(void* ptr = default, int index = default)
{
Ptr = ptr;
Index = index;
}
///
/// To be documented.
///
public unsafe void Destroy()
{
fixed (ImGuiPtrOrIndex* @this = &this)
{
ImGui.DestroyNative(@this);
}
}
}
///
/// To be documented.
///
#if NET5_0_OR_GREATER
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public unsafe struct ImGuiPtrOrIndexPtr : IEquatable
{
public ImGuiPtrOrIndexPtr(ImGuiPtrOrIndex* handle) { Handle = handle; }
public ImGuiPtrOrIndex* Handle;
public bool IsNull => Handle == null;
public static ImGuiPtrOrIndexPtr Null => new ImGuiPtrOrIndexPtr(null);
public ImGuiPtrOrIndex this[int index] { get => Handle[index]; set => Handle[index] = value; }
public static implicit operator ImGuiPtrOrIndexPtr(ImGuiPtrOrIndex* handle) => new ImGuiPtrOrIndexPtr(handle);
public static implicit operator ImGuiPtrOrIndex*(ImGuiPtrOrIndexPtr handle) => handle.Handle;
public static bool operator ==(ImGuiPtrOrIndexPtr left, ImGuiPtrOrIndexPtr right) => left.Handle == right.Handle;
public static bool operator !=(ImGuiPtrOrIndexPtr left, ImGuiPtrOrIndexPtr right) => left.Handle != right.Handle;
public static bool operator ==(ImGuiPtrOrIndexPtr left, ImGuiPtrOrIndex* right) => left.Handle == right;
public static bool operator !=(ImGuiPtrOrIndexPtr left, ImGuiPtrOrIndex* right) => left.Handle != right;
public bool Equals(ImGuiPtrOrIndexPtr other) => Handle == other.Handle;
///
public override bool Equals(object obj) => obj is ImGuiPtrOrIndexPtr handle && Equals(handle);
///
public override int GetHashCode() => ((nuint)Handle).GetHashCode();
#if NET5_0_OR_GREATER
private string DebuggerDisplay => string.Format("ImGuiPtrOrIndexPtr [0x{0}]", ((nuint)Handle).ToString("X"));
#endif
///
/// To be documented.
///
public void* Ptr { get => Handle->Ptr; set => Handle->Ptr = value; }
///
/// To be documented.
///
public ref int Index => ref Unsafe.AsRef(&Handle->Index);
///
/// To be documented.
///
public unsafe void Destroy()
{
ImGui.DestroyNative(Handle);
}
}
}