wip bindings upgrade

This commit is contained in:
goaaats 2025-04-06 20:59:23 +02:00
parent bd7e56850a
commit 0690cce995
272 changed files with 139041 additions and 1541 deletions

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HexaGen.Runtime" Version="1.1.17" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,37 @@
#nullable disable
using System.Reflection;
namespace Dalamud.Bindings.ImGui
{
using HexaGen.Runtime;
using System.Diagnostics;
public static class ImGuiConfig
{
public static bool AotStaticLink;
}
public static unsafe partial class ImGui
{
static ImGui()
{
if (ImGuiConfig.AotStaticLink)
{
InitApi(new NativeLibraryContext(Process.GetCurrentProcess().MainModule!.BaseAddress));
}
else
{
//InitApi(new NativeLibraryContext(LibraryLoader.LoadLibrary(GetLibraryName, null)));
InitApi(new NativeLibraryContext(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, GetLibraryName() + ".dll")));
}
}
public static string GetLibraryName()
{
return "cimgui";
}
public const nint ImDrawCallbackResetRenderState = -8;
}
}

View file

@ -0,0 +1,16 @@
#nullable disable
namespace Dalamud.Bindings.ImGui
{
using HexaGen.Runtime;
public static unsafe partial class ImGuiP
{
internal static FunctionTable funcTable;
static ImGuiP()
{
funcTable = ImGui.funcTable;
}
}
}

View file

@ -0,0 +1,48 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using HexaGen.Runtime;
using System.Numerics;
namespace Dalamud.Bindings.ImGui
{
/// <summary>
/// To be documented.
/// </summary>
#if NET5_0_OR_GREATER
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public readonly unsafe partial struct ImTextureID : IEquatable<ImTextureID>
{
public ImTextureID(ulong handle) { Handle = handle; }
public ImTextureID(nint handle) { Handle = (ulong)handle; }
public ImTextureID(void* handle) { Handle = (ulong)handle; }
public ulong Handle { get; }
public bool IsNull => Handle == 0;
public static ImTextureID Null => new ImTextureID(0);
public static implicit operator ImTextureID(ulong handle) => new ImTextureID(handle);
public static bool operator ==(ImTextureID left, ImTextureID right) => left.Handle == right.Handle;
public static bool operator !=(ImTextureID left, ImTextureID right) => left.Handle != right.Handle;
public static bool operator ==(ImTextureID left, nint right) => left.Handle == (ulong)right;
public static bool operator !=(ImTextureID left, nint right) => left.Handle != (ulong)right;
public static bool operator ==(ImTextureID left, ulong right) => left.Handle == right;
public static bool operator !=(ImTextureID left, ulong right) => left.Handle != right;
public bool Equals(ImTextureID other) => Handle == other.Handle;
/// <inheritdoc/>
public override bool Equals(object obj) => obj is ImTextureID handle && Equals(handle);
/// <inheritdoc/>
public override int GetHashCode() => Handle.GetHashCode();
#if NET5_0_OR_GREATER
private string DebuggerDisplay => string.Format("ImTextureID [0x{0}]", Handle.ToString("X"));
#endif
}
}

View file

@ -0,0 +1,238 @@
using System.Runtime.CompilerServices;
namespace Dalamud.Bindings.ImGui
{
public unsafe struct ImVector
{
public readonly int Size;
public readonly int Capacity;
public readonly void* Data;
public ImVector(int size, int capacity, void* data)
{
Size = size;
Capacity = capacity;
Data = data;
}
public ref T Ref<T>(int index)
{
return ref Unsafe.AsRef<T>((byte*)Data + index * Unsafe.SizeOf<T>());
}
public IntPtr Address<T>(int index)
{
return (IntPtr)((byte*)Data + index * Unsafe.SizeOf<T>());
}
}
/// <summary>
/// A structure representing a dynamic array for unmanaged types.
/// </summary>
/// <typeparam name="T">The type of elements in the vector, must be unmanaged.</typeparam>
public unsafe struct ImVector<T> where T : unmanaged
{
/// <summary>
/// Initializes a new instance of the <see cref="ImVector{T}"/> struct with the specified size, capacity, and data pointer.
/// </summary>
/// <param name="size">The initial size of the vector.</param>
/// <param name="capacity">The initial capacity of the vector.</param>
/// <param name="data">Pointer to the initial data.</param>
public ImVector(int size, int capacity, T* data)
{
this.size = size;
this.capacity = capacity;
this.data = data;
}
private int size;
private int capacity;
private unsafe T* data;
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the element to get or set.</param>
/// <returns>The element at the specified index.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is out of range.</exception>
public T this[int index]
{
get
{
if (index < 0 || index >= size)
{
throw new IndexOutOfRangeException();
}
return data[index];
}
set
{
if (index < 0 || index >= size)
{
throw new IndexOutOfRangeException();
}
data[index] = value;
}
}
/// <summary>
/// Gets a pointer to the first element of the vector.
/// </summary>
public readonly T* Data => data;
/// <summary>
/// Gets a pointer to the first element of the vector.
/// </summary>
public readonly T* Front => data;
/// <summary>
/// Gets a pointer to the last element of the vector.
/// </summary>
public readonly T* Back => size > 0 ? data + size - 1 : null;
/// <summary>
/// Gets or sets the capacity of the vector.
/// </summary>
public int Capacity
{
readonly get => capacity;
set
{
if (capacity == value)
{
return;
}
if (data == null)
{
data = (T*)ImGui.MemAlloc((nuint)(value * sizeof(T)));
}
else
{
int newSize = Math.Min(size, value);
T* newData = (T*)ImGui.MemAlloc((nuint)(value * sizeof(T)));
Buffer.MemoryCopy(data, newData, (nuint)(value * sizeof(T)), (nuint)(newSize * sizeof(T)));
ImGui.MemFree(data);
data = newData;
size = newSize;
}
capacity = value;
// Clear the rest of the data
for (int i = size; i < capacity; i++)
{
data[i] = default;
}
}
}
/// <summary>
/// Gets the number of elements in the vector.
/// </summary>
public readonly int Size => size;
/// <summary>
/// Grows the capacity of the vector to at least the specified value.
/// </summary>
/// <param name="newCapacity">The new capacity.</param>
public void Grow(int newCapacity)
{
if (newCapacity > capacity)
{
Capacity = newCapacity * 2;
}
}
/// <summary>
/// Ensures that the vector has at least the specified capacity.
/// </summary>
/// <param name="size">The minimum capacity required.</param>
public void EnsureCapacity(int size)
{
if (size > capacity)
{
Grow(size);
}
}
/// <summary>
/// Resizes the vector to the specified size.
/// </summary>
/// <param name="newSize">The new size of the vector.</param>
public void Resize(int newSize)
{
EnsureCapacity(newSize);
size = newSize;
}
/// <summary>
/// Clears all elements from the vector.
/// </summary>
public void Clear()
{
size = 0;
}
/// <summary>
/// Adds an element to the end of the vector.
/// </summary>
/// <param name="value">The value to add.</param>
public void PushBack(T value)
{
EnsureCapacity(size + 1);
data[size++] = value;
}
/// <summary>
/// Removes the last element from the vector.
/// </summary>
public void PopBack()
{
if (size > 0)
{
size--;
}
}
/// <summary>
/// Frees the memory allocated for the vector.
/// </summary>
public void Free()
{
if (data != null)
{
ImGui.MemFree(data);
data = null;
size = 0;
capacity = 0;
}
}
public ref T Ref(int index)
{
return ref Unsafe.AsRef<T>((byte*)Data + index * Unsafe.SizeOf<T>());
}
public ref TCast Ref<TCast>(int index)
{
return ref Unsafe.AsRef<TCast>((byte*)Data + index * Unsafe.SizeOf<TCast>());
}
public void* Address(int index)
{
return (byte*)Data + index * Unsafe.SizeOf<T>();
}
public void* Address<TCast>(int index)
{
return (byte*)Data + index * Unsafe.SizeOf<TCast>();
}
public ImVector* ToUntyped()
{
return (ImVector*)Unsafe.AsPointer(ref this);
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,433 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using HexaGen.Runtime;
using System.Numerics;
namespace Dalamud.Bindings.ImGui
{
public unsafe partial class ImGuiP
{
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ImFontAtlasBuildRender8bppRectFromStringNative(ImFontAtlas* atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
#if NET5_0_OR_GREATER
((delegate* unmanaged[Cdecl]<ImFontAtlas*, int, int, int, int, int, byte*, byte, byte, void>)funcTable[1261])(atlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
#else
((delegate* unmanaged[Cdecl]<nint, int, int, int, int, int, nint, byte, byte, void>)funcTable[1261])((nint)atlas, textureIndex, x, y, w, h, (nint)inStr, inMarkerChar, inMarkerPixelValue);
#endif
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
ImFontAtlasBuildRender8bppRectFromStringNative(atlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
ImFontAtlasBuildRender8bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, ref byte inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (byte* pinStr = &inStr)
{
ImFontAtlasBuildRender8bppRectFromStringNative(atlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, ReadOnlySpan<byte> inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (byte* pinStr = inStr)
{
ImFontAtlasBuildRender8bppRectFromStringNative(atlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, string inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (inStr != null)
{
pStrSize0 = Utils.GetByteCountUTF8(inStr);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(inStr, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImFontAtlasBuildRender8bppRectFromStringNative(atlas, textureIndex, x, y, w, h, pStr0, inMarkerChar, inMarkerPixelValue);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, ref byte inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
fixed (byte* pinStr = &inStr)
{
ImFontAtlasBuildRender8bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, ReadOnlySpan<byte> inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
fixed (byte* pinStr = inStr)
{
ImFontAtlasBuildRender8bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender8bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, string inStr, byte inMarkerChar, byte inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (inStr != null)
{
pStrSize0 = Utils.GetByteCountUTF8(inStr);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(inStr, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImFontAtlasBuildRender8bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, pStr0, inMarkerChar, inMarkerPixelValue);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ImFontAtlasBuildRender32bppRectFromStringNative(ImFontAtlas* atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
#if NET5_0_OR_GREATER
((delegate* unmanaged[Cdecl]<ImFontAtlas*, int, int, int, int, int, byte*, byte, uint, void>)funcTable[1262])(atlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
#else
((delegate* unmanaged[Cdecl]<nint, int, int, int, int, int, nint, byte, uint, void>)funcTable[1262])((nint)atlas, textureIndex, x, y, w, h, (nint)inStr, inMarkerChar, inMarkerPixelValue);
#endif
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
ImFontAtlasBuildRender32bppRectFromStringNative(atlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, byte* inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
ImFontAtlasBuildRender32bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, inStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, ref byte inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (byte* pinStr = &inStr)
{
ImFontAtlasBuildRender32bppRectFromStringNative(atlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, ReadOnlySpan<byte> inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (byte* pinStr = inStr)
{
ImFontAtlasBuildRender32bppRectFromStringNative(atlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlasPtr atlas, int textureIndex, int x, int y, int w, int h, string inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (inStr != null)
{
pStrSize0 = Utils.GetByteCountUTF8(inStr);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(inStr, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImFontAtlasBuildRender32bppRectFromStringNative(atlas, textureIndex, x, y, w, h, pStr0, inMarkerChar, inMarkerPixelValue);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, ref byte inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
fixed (byte* pinStr = &inStr)
{
ImFontAtlasBuildRender32bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, ReadOnlySpan<byte> inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
fixed (byte* pinStr = inStr)
{
ImFontAtlasBuildRender32bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, (byte*)pinStr, inMarkerChar, inMarkerPixelValue);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildRender32bppRectFromString(ref ImFontAtlas atlas, int textureIndex, int x, int y, int w, int h, string inStr, byte inMarkerChar, uint inMarkerPixelValue)
{
fixed (ImFontAtlas* patlas = &atlas)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (inStr != null)
{
pStrSize0 = Utils.GetByteCountUTF8(inStr);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(inStr, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
ImFontAtlasBuildRender32bppRectFromStringNative((ImFontAtlas*)patlas, textureIndex, x, y, w, h, pStr0, inMarkerChar, inMarkerPixelValue);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ImFontAtlasBuildMultiplyCalcLookupTableNative(byte* outTable, float inMultiplyFactor, float gammaFactor)
{
#if NET5_0_OR_GREATER
((delegate* unmanaged[Cdecl]<byte*, float, float, void>)funcTable[1263])(outTable, inMultiplyFactor, gammaFactor);
#else
((delegate* unmanaged[Cdecl]<nint, float, float, void>)funcTable[1263])((nint)outTable, inMultiplyFactor, gammaFactor);
#endif
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyCalcLookupTable(byte* outTable, float inMultiplyFactor, float gammaFactor)
{
ImFontAtlasBuildMultiplyCalcLookupTableNative(outTable, inMultiplyFactor, gammaFactor);
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyCalcLookupTable(ref byte outTable, float inMultiplyFactor, float gammaFactor)
{
fixed (byte* poutTable = &outTable)
{
ImFontAtlasBuildMultiplyCalcLookupTableNative((byte*)poutTable, inMultiplyFactor, gammaFactor);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyCalcLookupTable(ReadOnlySpan<byte> outTable, float inMultiplyFactor, float gammaFactor)
{
fixed (byte* poutTable = outTable)
{
ImFontAtlasBuildMultiplyCalcLookupTableNative((byte*)poutTable, inMultiplyFactor, gammaFactor);
}
}
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void ImFontAtlasBuildMultiplyRectAlpha8Native(byte* table, byte* pixels, int x, int y, int w, int h, int stride)
{
#if NET5_0_OR_GREATER
((delegate* unmanaged[Cdecl]<byte*, byte*, int, int, int, int, int, void>)funcTable[1264])(table, pixels, x, y, w, h, stride);
#else
((delegate* unmanaged[Cdecl]<nint, nint, int, int, int, int, int, void>)funcTable[1264])((nint)table, (nint)pixels, x, y, w, h, stride);
#endif
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(byte* table, byte* pixels, int x, int y, int w, int h, int stride)
{
ImFontAtlasBuildMultiplyRectAlpha8Native(table, pixels, x, y, w, h, stride);
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(ref byte table, byte* pixels, int x, int y, int w, int h, int stride)
{
fixed (byte* ptable = &table)
{
ImFontAtlasBuildMultiplyRectAlpha8Native((byte*)ptable, pixels, x, y, w, h, stride);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(ReadOnlySpan<byte> table, byte* pixels, int x, int y, int w, int h, int stride)
{
fixed (byte* ptable = table)
{
ImFontAtlasBuildMultiplyRectAlpha8Native((byte*)ptable, pixels, x, y, w, h, stride);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(byte* table, ref byte pixels, int x, int y, int w, int h, int stride)
{
fixed (byte* ppixels = &pixels)
{
ImFontAtlasBuildMultiplyRectAlpha8Native(table, (byte*)ppixels, x, y, w, h, stride);
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(ref byte table, ref byte pixels, int x, int y, int w, int h, int stride)
{
fixed (byte* ptable = &table)
{
fixed (byte* ppixels = &pixels)
{
ImFontAtlasBuildMultiplyRectAlpha8Native((byte*)ptable, (byte*)ppixels, x, y, w, h, stride);
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void ImFontAtlasBuildMultiplyRectAlpha8(ReadOnlySpan<byte> table, ref byte pixels, int x, int y, int w, int h, int stride)
{
fixed (byte* ptable = table)
{
fixed (byte* ppixels = &pixels)
{
ImFontAtlasBuildMultiplyRectAlpha8Native((byte*)ptable, (byte*)ppixels, x, y, w, h, stride);
}
}
}
}
}

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Juna Meinhold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,610 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using HexaGen.Runtime;
using System.Numerics;
namespace Dalamud.Bindings.ImGui
{
public unsafe partial class ImGui
{
/// <summary>
/// To be documented.
/// </summary>
public static bool InputTextEx(string label, ReadOnlySpan<byte> hint, ref string buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, void* userData)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
fixed (byte* phint = hint)
{
byte* pStr1 = null;
int pStrSize1 = 0;
if (buf != null)
{
pStrSize1 = Math.Max(Utils.GetByteCountUTF8(buf), (int)bufSize);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(buf, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
byte ret = InputTextExNative(pStr0, (byte*)phint, pStr1, bufSize, sizeArg, flags, (ImGuiInputTextCallback)(default), userData);
if (ret != 0)
{
buf = Utils.DecodeStringUTF8(pStr1);
}
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool InputTextEx(string label, string hint, ref byte buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte* pStr1 = null;
int pStrSize1 = 0;
if (hint != null)
{
pStrSize1 = Utils.GetByteCountUTF8(hint);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(hint, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
fixed (byte* pbuf = &buf)
{
byte ret = InputTextExNative(pStr0, pStr1, (byte*)pbuf, bufSize, sizeArg, flags, callback, userData);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool InputTextEx(string label, string hint, ref byte buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte* pStr1 = null;
int pStrSize1 = 0;
if (hint != null)
{
pStrSize1 = Utils.GetByteCountUTF8(hint);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(hint, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
fixed (byte* pbuf = &buf)
{
byte ret = InputTextExNative(pStr0, pStr1, (byte*)pbuf, bufSize, sizeArg, flags, callback, (void*)(default));
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool InputTextEx(string label, string hint, ref byte buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte* pStr1 = null;
int pStrSize1 = 0;
if (hint != null)
{
pStrSize1 = Utils.GetByteCountUTF8(hint);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(hint, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
fixed (byte* pbuf = &buf)
{
byte ret = InputTextExNative(pStr0, pStr1, (byte*)pbuf, bufSize, sizeArg, flags, (ImGuiInputTextCallback)(default), (void*)(default));
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool InputTextEx(string label, string hint, ref byte buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, void* userData)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte* pStr1 = null;
int pStrSize1 = 0;
if (hint != null)
{
pStrSize1 = Utils.GetByteCountUTF8(hint);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(hint, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
fixed (byte* pbuf = &buf)
{
byte ret = InputTextExNative(pStr0, pStr1, (byte*)pbuf, bufSize, sizeArg, flags, (ImGuiInputTextCallback)(default), userData);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static byte TempInputTextNative(ImRect bb, uint id, byte* label, byte* buf, int bufSize, ImGuiInputTextFlags flags)
{
#if NET5_0_OR_GREATER
return ((delegate* unmanaged[Cdecl]<ImRect, uint, byte*, byte*, int, ImGuiInputTextFlags, byte>)funcTable[1275])(bb, id, label, buf, bufSize, flags);
#else
return (byte)((delegate* unmanaged[Cdecl]<ImRect, uint, nint, nint, int, ImGuiInputTextFlags, byte>)funcTable[1275])(bb, id, (nint)label, (nint)buf, bufSize, flags);
#endif
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, byte* label, byte* buf, int bufSize, ImGuiInputTextFlags flags)
{
byte ret = TempInputTextNative(bb, id, label, buf, bufSize, flags);
return ret != 0;
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ref byte label, byte* buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = &label)
{
byte ret = TempInputTextNative(bb, id, (byte*)plabel, buf, bufSize, flags);
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ReadOnlySpan<byte> label, byte* buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = label)
{
byte ret = TempInputTextNative(bb, id, (byte*)plabel, buf, bufSize, flags);
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, string label, byte* buf, int bufSize, ImGuiInputTextFlags flags)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte ret = TempInputTextNative(bb, id, pStr0, buf, bufSize, flags);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, byte* label, ref byte buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* pbuf = &buf)
{
byte ret = TempInputTextNative(bb, id, label, (byte*)pbuf, bufSize, flags);
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, byte* label, ref string buf, int bufSize, ImGuiInputTextFlags flags)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (buf != null)
{
pStrSize0 = Math.Max(Utils.GetByteCountUTF8(buf), (int)bufSize);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(buf, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte ret = TempInputTextNative(bb, id, label, pStr0, bufSize, flags);
if (ret != 0)
{
buf = Utils.DecodeStringUTF8(pStr0);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ref byte label, ref byte buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = &label)
{
fixed (byte* pbuf = &buf)
{
byte ret = TempInputTextNative(bb, id, (byte*)plabel, (byte*)pbuf, bufSize, flags);
return ret != 0;
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ReadOnlySpan<byte> label, ref byte buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = label)
{
fixed (byte* pbuf = &buf)
{
byte ret = TempInputTextNative(bb, id, (byte*)plabel, (byte*)pbuf, bufSize, flags);
return ret != 0;
}
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, string label, ref string buf, int bufSize, ImGuiInputTextFlags flags)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte* pStr1 = null;
int pStrSize1 = 0;
if (buf != null)
{
pStrSize1 = Math.Max(Utils.GetByteCountUTF8(buf), (int)bufSize);
if (pStrSize1 >= Utils.MaxStackallocSize)
{
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
}
else
{
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
pStr1 = pStrStack1;
}
int pStrOffset1 = Utils.EncodeStringUTF8(buf, pStr1, pStrSize1);
pStr1[pStrOffset1] = 0;
}
byte ret = TempInputTextNative(bb, id, pStr0, pStr1, bufSize, flags);
if (ret != 0)
{
buf = Utils.DecodeStringUTF8(pStr1);
}
if (pStrSize1 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr1);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ref byte label, ref string buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = &label)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (buf != null)
{
pStrSize0 = Math.Max(Utils.GetByteCountUTF8(buf), (int)bufSize);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(buf, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte ret = TempInputTextNative(bb, id, (byte*)plabel, pStr0, bufSize, flags);
if (ret != 0)
{
buf = Utils.DecodeStringUTF8(pStr0);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, ReadOnlySpan<byte> label, ref string buf, int bufSize, ImGuiInputTextFlags flags)
{
fixed (byte* plabel = label)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (buf != null)
{
pStrSize0 = Math.Max(Utils.GetByteCountUTF8(buf), (int)bufSize);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(buf, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
byte ret = TempInputTextNative(bb, id, (byte*)plabel, pStr0, bufSize, flags);
if (ret != 0)
{
buf = Utils.DecodeStringUTF8(pStr0);
}
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static bool TempInputText(ImRect bb, uint id, string label, ref byte buf, int bufSize, ImGuiInputTextFlags flags)
{
byte* pStr0 = null;
int pStrSize0 = 0;
if (label != null)
{
pStrSize0 = Utils.GetByteCountUTF8(label);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
}
else
{
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
pStr0 = pStrStack0;
}
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
pStr0[pStrOffset0] = 0;
}
fixed (byte* pbuf = &buf)
{
byte ret = TempInputTextNative(bb, id, pStr0, (byte*)pbuf, bufSize, flags);
if (pStrSize0 >= Utils.MaxStackallocSize)
{
Utils.Free(pStr0);
}
return ret != 0;
}
}
}
}

View file

@ -0,0 +1,45 @@
#nullable disable
namespace Dalamud.Bindings.ImGui
{
using System;
public unsafe struct STBTexteditStatePtr : IEquatable<STBTexteditStatePtr>
{
public STBTexteditState* Handle;
public unsafe STBTexteditStatePtr(STBTexteditState* handle)
{
Handle = handle;
}
public override readonly bool Equals(object obj)
{
return obj is STBTexteditStatePtr ptr && Equals(ptr);
}
public readonly bool Equals(STBTexteditStatePtr other)
{
return Handle == other.Handle;
}
public override readonly int GetHashCode()
{
return ((nint)Handle).GetHashCode();
}
public static bool operator ==(STBTexteditStatePtr left, STBTexteditStatePtr right)
{
return left.Equals(right);
}
public static bool operator !=(STBTexteditStatePtr left, STBTexteditStatePtr right)
{
return !(left == right);
}
public static implicit operator STBTexteditState*(STBTexteditStatePtr handle) => handle.Handle;
public static implicit operator STBTexteditStatePtr(STBTexteditState* handle) => new(handle);
}
}

View file

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HexaGen.Runtime" Version="1.1.17" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dalamud.ImGui\Dalamud.ImGui.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,33 @@
using System.Reflection;
namespace Dalamud.Bindings.ImGuizmo
{
using HexaGen.Runtime;
using System.Diagnostics;
public static class ImGuizmoConfig
{
public static bool AotStaticLink;
}
public static unsafe partial class ImGuizmo
{
static ImGuizmo()
{
if (ImGuizmoConfig.AotStaticLink)
{
InitApi(new NativeLibraryContext(Process.GetCurrentProcess().MainModule!.BaseAddress));
}
else
{
// InitApi(new NativeLibraryContext(LibraryLoader.LoadLibrary(GetLibraryName, null)));
InitApi(new NativeLibraryContext(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, GetLibraryName() + ".dll")));
}
}
public static string GetLibraryName()
{
return "cimguizmo";
}
}
}

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Juna Meinhold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HexaGen.Runtime" Version="1.1.17" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dalamud.ImGui\Dalamud.ImGui.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,33 @@
using System.Reflection;
namespace Dalamud.Bindings.ImPlot
{
using HexaGen.Runtime;
using System.Diagnostics;
public static class ImPlotConfig
{
public static bool AotStaticLink;
}
public static unsafe partial class ImPlot
{
static ImPlot()
{
if (ImPlotConfig.AotStaticLink)
{
InitApi(new NativeLibraryContext(Process.GetCurrentProcess().MainModule!.BaseAddress));
}
else
{
// InitApi(new NativeLibraryContext(LibraryLoader.LoadLibrary(GetLibraryName, null)));
InitApi(new NativeLibraryContext(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, GetLibraryName() + ".dll")));
}
}
public static string GetLibraryName()
{
return "cimplot";
}
}
}

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Juna Meinhold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

109
imgui/Dalamud.ImPlot/Tm.cs Normal file
View file

@ -0,0 +1,109 @@
namespace Dalamud.Bindings.ImPlot
{
using System;
public struct Tm : IEquatable<Tm>
{
/// <summary>
/// seconds after the minute - [0, 60] including leap second
/// </summary>
public int Sec;
/// <summary>
/// minutes after the hour - [0, 59]
/// </summary>
public int Min;
/// <summary>
/// hours since midnight - [0, 23]
/// </summary>
public int Hour;
/// <summary>
/// day of the month - [1, 31]
/// </summary>
public int MDay;
/// <summary>
/// months since January - [0, 11]
/// </summary>
public int Mon;
/// <summary>
/// years since 1900
/// </summary>
public int Year;
/// <summary>
/// days since Sunday - [0, 6]
/// </summary>
public int WDay;
/// <summary>
/// days since January 1 - [0, 365]
/// </summary>
public int YDay;
/// <summary>
/// daylight savings time flag
/// </summary>
public int IsDst;
public override bool Equals(object? obj)
{
return obj is Tm tm && Equals(tm);
}
public bool Equals(Tm other)
{
return Sec == other.Sec &&
Min == other.Min &&
Hour == other.Hour &&
MDay == other.MDay &&
Mon == other.Mon &&
Year == other.Year &&
WDay == other.WDay &&
YDay == other.YDay &&
IsDst == other.IsDst;
}
public override int GetHashCode()
{
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
HashCode hash = new HashCode();
hash.Add(Sec);
hash.Add(Min);
hash.Add(Hour);
hash.Add(MDay);
hash.Add(Mon);
hash.Add(Year);
hash.Add(WDay);
hash.Add(YDay);
hash.Add(IsDst);
return hash.ToHashCode();
#else
int hash = 17;
hash = hash * 31 + Sec.GetHashCode();
hash = hash * 31 + Min.GetHashCode();
hash = hash * 31 + Hour.GetHashCode();
hash = hash * 31 + MDay.GetHashCode();
hash = hash * 31 + Mon.GetHashCode();
hash = hash * 31 + Year.GetHashCode();
hash = hash * 31 + WDay.GetHashCode();
hash = hash * 31 + YDay.GetHashCode();
hash = hash * 31 + IsDst.GetHashCode();
return hash;
#endif
}
public static bool operator ==(Tm left, Tm right)
{
return left.Equals(right);
}
public static bool operator !=(Tm left, Tm right)
{
return !(left == right);
}
}
}