mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
wip bindings upgrade
This commit is contained in:
parent
bd7e56850a
commit
0690cce995
272 changed files with 139041 additions and 1541 deletions
15
imgui/Dalamud.ImGui/Dalamud.ImGui.csproj
Normal file
15
imgui/Dalamud.ImGui/Dalamud.ImGui.csproj
Normal 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>
|
||||
37
imgui/Dalamud.ImGui/ImGui.cs
Normal file
37
imgui/Dalamud.ImGui/ImGui.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
16
imgui/Dalamud.ImGui/ImGuiP.cs
Normal file
16
imgui/Dalamud.ImGui/ImGuiP.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
48
imgui/Dalamud.ImGui/ImTextureID.cs
Normal file
48
imgui/Dalamud.ImGui/ImTextureID.cs
Normal 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
|
||||
}
|
||||
}
|
||||
238
imgui/Dalamud.ImGui/ImVector.cs
Normal file
238
imgui/Dalamud.ImGui/ImVector.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
5047
imgui/Dalamud.ImGui/Internals/Functions/Functions.000.cs
Normal file
5047
imgui/Dalamud.ImGui/Internals/Functions/Functions.000.cs
Normal file
File diff suppressed because it is too large
Load diff
5036
imgui/Dalamud.ImGui/Internals/Functions/Functions.001.cs
Normal file
5036
imgui/Dalamud.ImGui/Internals/Functions/Functions.001.cs
Normal file
File diff suppressed because it is too large
Load diff
5043
imgui/Dalamud.ImGui/Internals/Functions/Functions.002.cs
Normal file
5043
imgui/Dalamud.ImGui/Internals/Functions/Functions.002.cs
Normal file
File diff suppressed because it is too large
Load diff
5049
imgui/Dalamud.ImGui/Internals/Functions/Functions.003.cs
Normal file
5049
imgui/Dalamud.ImGui/Internals/Functions/Functions.003.cs
Normal file
File diff suppressed because it is too large
Load diff
5027
imgui/Dalamud.ImGui/Internals/Functions/Functions.004.cs
Normal file
5027
imgui/Dalamud.ImGui/Internals/Functions/Functions.004.cs
Normal file
File diff suppressed because it is too large
Load diff
5032
imgui/Dalamud.ImGui/Internals/Functions/Functions.005.cs
Normal file
5032
imgui/Dalamud.ImGui/Internals/Functions/Functions.005.cs
Normal file
File diff suppressed because it is too large
Load diff
5028
imgui/Dalamud.ImGui/Internals/Functions/Functions.006.cs
Normal file
5028
imgui/Dalamud.ImGui/Internals/Functions/Functions.006.cs
Normal file
File diff suppressed because it is too large
Load diff
5030
imgui/Dalamud.ImGui/Internals/Functions/Functions.007.cs
Normal file
5030
imgui/Dalamud.ImGui/Internals/Functions/Functions.007.cs
Normal file
File diff suppressed because it is too large
Load diff
5022
imgui/Dalamud.ImGui/Internals/Functions/Functions.008.cs
Normal file
5022
imgui/Dalamud.ImGui/Internals/Functions/Functions.008.cs
Normal file
File diff suppressed because it is too large
Load diff
5049
imgui/Dalamud.ImGui/Internals/Functions/Functions.009.cs
Normal file
5049
imgui/Dalamud.ImGui/Internals/Functions/Functions.009.cs
Normal file
File diff suppressed because it is too large
Load diff
5027
imgui/Dalamud.ImGui/Internals/Functions/Functions.010.cs
Normal file
5027
imgui/Dalamud.ImGui/Internals/Functions/Functions.010.cs
Normal file
File diff suppressed because it is too large
Load diff
5030
imgui/Dalamud.ImGui/Internals/Functions/Functions.011.cs
Normal file
5030
imgui/Dalamud.ImGui/Internals/Functions/Functions.011.cs
Normal file
File diff suppressed because it is too large
Load diff
5033
imgui/Dalamud.ImGui/Internals/Functions/Functions.012.cs
Normal file
5033
imgui/Dalamud.ImGui/Internals/Functions/Functions.012.cs
Normal file
File diff suppressed because it is too large
Load diff
5035
imgui/Dalamud.ImGui/Internals/Functions/Functions.013.cs
Normal file
5035
imgui/Dalamud.ImGui/Internals/Functions/Functions.013.cs
Normal file
File diff suppressed because it is too large
Load diff
5048
imgui/Dalamud.ImGui/Internals/Functions/Functions.014.cs
Normal file
5048
imgui/Dalamud.ImGui/Internals/Functions/Functions.014.cs
Normal file
File diff suppressed because it is too large
Load diff
5033
imgui/Dalamud.ImGui/Internals/Functions/Functions.015.cs
Normal file
5033
imgui/Dalamud.ImGui/Internals/Functions/Functions.015.cs
Normal file
File diff suppressed because it is too large
Load diff
4968
imgui/Dalamud.ImGui/Internals/Functions/Functions.016.cs
Normal file
4968
imgui/Dalamud.ImGui/Internals/Functions/Functions.016.cs
Normal file
File diff suppressed because it is too large
Load diff
433
imgui/Dalamud.ImGui/Internals/Functions/Functions.017.cs
Normal file
433
imgui/Dalamud.ImGui/Internals/Functions/Functions.017.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
21
imgui/Dalamud.ImGui/LICENSE.txt
Normal file
21
imgui/Dalamud.ImGui/LICENSE.txt
Normal 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.
|
||||
5018
imgui/Dalamud.ImGui/Manual/Functions/Functions.000.cs
Normal file
5018
imgui/Dalamud.ImGui/Manual/Functions/Functions.000.cs
Normal file
File diff suppressed because it is too large
Load diff
5029
imgui/Dalamud.ImGui/Manual/Functions/Functions.001.cs
Normal file
5029
imgui/Dalamud.ImGui/Manual/Functions/Functions.001.cs
Normal file
File diff suppressed because it is too large
Load diff
5030
imgui/Dalamud.ImGui/Manual/Functions/Functions.002.cs
Normal file
5030
imgui/Dalamud.ImGui/Manual/Functions/Functions.002.cs
Normal file
File diff suppressed because it is too large
Load diff
5031
imgui/Dalamud.ImGui/Manual/Functions/Functions.003.cs
Normal file
5031
imgui/Dalamud.ImGui/Manual/Functions/Functions.003.cs
Normal file
File diff suppressed because it is too large
Load diff
5023
imgui/Dalamud.ImGui/Manual/Functions/Functions.004.cs
Normal file
5023
imgui/Dalamud.ImGui/Manual/Functions/Functions.004.cs
Normal file
File diff suppressed because it is too large
Load diff
5028
imgui/Dalamud.ImGui/Manual/Functions/Functions.005.cs
Normal file
5028
imgui/Dalamud.ImGui/Manual/Functions/Functions.005.cs
Normal file
File diff suppressed because it is too large
Load diff
5044
imgui/Dalamud.ImGui/Manual/Functions/Functions.006.cs
Normal file
5044
imgui/Dalamud.ImGui/Manual/Functions/Functions.006.cs
Normal file
File diff suppressed because it is too large
Load diff
5047
imgui/Dalamud.ImGui/Manual/Functions/Functions.007.cs
Normal file
5047
imgui/Dalamud.ImGui/Manual/Functions/Functions.007.cs
Normal file
File diff suppressed because it is too large
Load diff
5031
imgui/Dalamud.ImGui/Manual/Functions/Functions.008.cs
Normal file
5031
imgui/Dalamud.ImGui/Manual/Functions/Functions.008.cs
Normal file
File diff suppressed because it is too large
Load diff
5037
imgui/Dalamud.ImGui/Manual/Functions/Functions.009.cs
Normal file
5037
imgui/Dalamud.ImGui/Manual/Functions/Functions.009.cs
Normal file
File diff suppressed because it is too large
Load diff
610
imgui/Dalamud.ImGui/Manual/Functions/Functions.010.cs
Normal file
610
imgui/Dalamud.ImGui/Manual/Functions/Functions.010.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
45
imgui/Dalamud.ImGui/STBTexteditStatePtr.cs
Normal file
45
imgui/Dalamud.ImGui/STBTexteditStatePtr.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
19
imgui/Dalamud.ImGuizmo/Dalamud.ImGuizmo.csproj
Normal file
19
imgui/Dalamud.ImGuizmo/Dalamud.ImGuizmo.csproj
Normal 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>
|
||||
33
imgui/Dalamud.ImGuizmo/ImGuizmo.cs
Normal file
33
imgui/Dalamud.ImGuizmo/ImGuizmo.cs
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
||||
21
imgui/Dalamud.ImGuizmo/LICENSE.txt
Normal file
21
imgui/Dalamud.ImGuizmo/LICENSE.txt
Normal 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.
|
||||
19
imgui/Dalamud.ImPlot/Dalamud.ImPlot.csproj
Normal file
19
imgui/Dalamud.ImPlot/Dalamud.ImPlot.csproj
Normal 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>
|
||||
33
imgui/Dalamud.ImPlot/ImPlot.cs
Normal file
33
imgui/Dalamud.ImPlot/ImPlot.cs
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
||||
21
imgui/Dalamud.ImPlot/LICENSE.txt
Normal file
21
imgui/Dalamud.ImPlot/LICENSE.txt
Normal 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
109
imgui/Dalamud.ImPlot/Tm.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue