// ------------------------------------------------------------------------------ // // 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 ImGuiContextHook { /// /// To be documented. /// public uint HookId; /// /// To be documented. /// public ImGuiContextHookType Type; /// /// To be documented. /// public uint Owner; /// /// To be documented. /// public unsafe void* Callback; /// /// To be documented. /// public unsafe void* UserData; /// /// To be documented. /// public unsafe ImGuiContextHook(uint hookId = default, ImGuiContextHookType type = default, uint owner = default, ImGuiContextHookCallback callback = default, void* userData = default) { HookId = hookId; Type = type; Owner = owner; Callback = (void*)Marshal.GetFunctionPointerForDelegate(callback); UserData = userData; } /// /// To be documented. /// public unsafe void Destroy() { fixed (ImGuiContextHook* @this = &this) { ImGui.DestroyNative(@this); } } } /// /// To be documented. /// #if NET5_0_OR_GREATER [DebuggerDisplay("{DebuggerDisplay,nq}")] #endif public unsafe struct ImGuiContextHookPtr : IEquatable { public ImGuiContextHookPtr(ImGuiContextHook* handle) { Handle = handle; } public ImGuiContextHook* Handle; public bool IsNull => Handle == null; public static ImGuiContextHookPtr Null => new ImGuiContextHookPtr(null); public ImGuiContextHook this[int index] { get => Handle[index]; set => Handle[index] = value; } public static implicit operator ImGuiContextHookPtr(ImGuiContextHook* handle) => new ImGuiContextHookPtr(handle); public static implicit operator ImGuiContextHook*(ImGuiContextHookPtr handle) => handle.Handle; public static bool operator ==(ImGuiContextHookPtr left, ImGuiContextHookPtr right) => left.Handle == right.Handle; public static bool operator !=(ImGuiContextHookPtr left, ImGuiContextHookPtr right) => left.Handle != right.Handle; public static bool operator ==(ImGuiContextHookPtr left, ImGuiContextHook* right) => left.Handle == right; public static bool operator !=(ImGuiContextHookPtr left, ImGuiContextHook* right) => left.Handle != right; public bool Equals(ImGuiContextHookPtr other) => Handle == other.Handle; /// public override bool Equals(object obj) => obj is ImGuiContextHookPtr handle && Equals(handle); /// public override int GetHashCode() => ((nuint)Handle).GetHashCode(); #if NET5_0_OR_GREATER private string DebuggerDisplay => string.Format("ImGuiContextHookPtr [0x{0}]", ((nuint)Handle).ToString("X")); #endif /// /// To be documented. /// public ref uint HookId => ref Unsafe.AsRef(&Handle->HookId); /// /// To be documented. /// public ref ImGuiContextHookType Type => ref Unsafe.AsRef(&Handle->Type); /// /// To be documented. /// public ref uint Owner => ref Unsafe.AsRef(&Handle->Owner); /// /// To be documented. /// public void* Callback { get => Handle->Callback; set => Handle->Callback = value; } /// /// To be documented. /// public void* UserData { get => Handle->UserData; set => Handle->UserData = value; } /// /// To be documented. /// public unsafe void Destroy() { ImGui.DestroyNative(Handle); } } }