// ------------------------------------------------------------------------------
//
// 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 ImGuiKeyData
{
///
/// To be documented.
///
public byte Down;
///
/// To be documented.
///
public float DownDuration;
///
/// To be documented.
///
public float DownDurationPrev;
///
/// To be documented.
///
public float AnalogValue;
///
/// To be documented.
///
public unsafe ImGuiKeyData(bool down = default, float downDuration = default, float downDurationPrev = default, float analogValue = default)
{
Down = down ? (byte)1 : (byte)0;
DownDuration = downDuration;
DownDurationPrev = downDurationPrev;
AnalogValue = analogValue;
}
}
///
/// To be documented.
///
#if NET5_0_OR_GREATER
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public unsafe struct ImGuiKeyDataPtr : IEquatable
{
public ImGuiKeyDataPtr(ImGuiKeyData* handle) { Handle = handle; }
public ImGuiKeyData* Handle;
public bool IsNull => Handle == null;
public static ImGuiKeyDataPtr Null => new ImGuiKeyDataPtr(null);
public ImGuiKeyData this[int index] { get => Handle[index]; set => Handle[index] = value; }
public static implicit operator ImGuiKeyDataPtr(ImGuiKeyData* handle) => new ImGuiKeyDataPtr(handle);
public static implicit operator ImGuiKeyData*(ImGuiKeyDataPtr handle) => handle.Handle;
public static bool operator ==(ImGuiKeyDataPtr left, ImGuiKeyDataPtr right) => left.Handle == right.Handle;
public static bool operator !=(ImGuiKeyDataPtr left, ImGuiKeyDataPtr right) => left.Handle != right.Handle;
public static bool operator ==(ImGuiKeyDataPtr left, ImGuiKeyData* right) => left.Handle == right;
public static bool operator !=(ImGuiKeyDataPtr left, ImGuiKeyData* right) => left.Handle != right;
public bool Equals(ImGuiKeyDataPtr other) => Handle == other.Handle;
///
public override bool Equals(object obj) => obj is ImGuiKeyDataPtr handle && Equals(handle);
///
public override int GetHashCode() => ((nuint)Handle).GetHashCode();
#if NET5_0_OR_GREATER
private string DebuggerDisplay => string.Format("ImGuiKeyDataPtr [0x{0}]", ((nuint)Handle).ToString("X"));
#endif
///
/// To be documented.
///
public ref bool Down => ref Unsafe.AsRef(&Handle->Down);
///
/// To be documented.
///
public ref float DownDuration => ref Unsafe.AsRef(&Handle->DownDuration);
///
/// To be documented.
///
public ref float DownDurationPrev => ref Unsafe.AsRef(&Handle->DownDurationPrev);
///
/// To be documented.
///
public ref float AnalogValue => ref Unsafe.AsRef(&Handle->AnalogValue);
}
}