Manual overloads for ImGui functions accepting text (#2319)

* wip2

* Implement AutoUtf8Buffer

* reformat

* Work on manual bindings

* restructure

* Name scripts properly

* Update utility functions to use ImU8String

* add overloads

* Add more overloads

* Use ImGuiWindow from gen, support AddCallback

* Use LibraryImport for custom ImGuiNative functinos

* Make manual overloads for string-returning functinos

* Make all overloads with self as its first parameter extension methods

* Fix overload resolution by removing unnecessary

* in => scoped in

* Fix compilation errors
This commit is contained in:
srkizer 2025-08-05 03:14:00 +09:00 committed by GitHub
parent 0c63541864
commit c69329f592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
293 changed files with 61312 additions and 754 deletions

View file

@ -0,0 +1,60 @@
namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiStorage
{
public readonly ref bool GetBoolRef(uint key, bool defaultValue = false)
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetBoolRef(thisPtr, key, defaultValue);
}
public readonly ref float GetFloatRef(uint key, float defaultValue = 0.0f)
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetFloatRef(thisPtr, key, defaultValue);
}
public readonly ref int GetIntRef(uint key, int defaultValue = 0)
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetIntRef(thisPtr, key, defaultValue);
}
public readonly ref void* GetVoidPtrRef(uint key, void* defaultValue = null)
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetVoidPtrRef(thisPtr, key, defaultValue);
}
public readonly ref T* GetPtrRef<T>(uint key, T* defaultValue = null) where T : unmanaged
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetPtrRef(thisPtr, key, defaultValue);
}
public readonly ref T GetRef<T>(uint key, T defaultValue = default) where T : unmanaged
{
fixed (ImGuiStorage* thisPtr = &this)
return ref ImGui.GetRef(thisPtr, key, defaultValue);
}
}
public unsafe partial struct ImGuiStoragePtr
{
public readonly ref bool GetBoolRef(uint key, bool defaultValue = false) =>
ref ImGui.GetBoolRef(this, key, defaultValue);
public readonly ref float GetFloatRef(uint key, float defaultValue = 0.0f) =>
ref ImGui.GetFloatRef(this, key, defaultValue);
public readonly ref int GetIntRef(uint key, int defaultValue = 0) => ref ImGui.GetIntRef(this, key, defaultValue);
public readonly ref void* GetVoidPtrRef(uint key, void* defaultValue = null) =>
ref ImGui.GetVoidPtrRef(this, key, defaultValue);
public readonly ref T* GetPtrRef<T>(uint key, T* defaultValue = null) where T : unmanaged =>
ref ImGui.GetPtrRef(this, key, defaultValue);
public readonly ref T GetRef<T>(uint key, T defaultValue = default) where T : unmanaged =>
ref ImGui.GetRef(this, key, defaultValue);
}