Work around ActiveIdUsingKeyInputMask having a wrong type

This commit is contained in:
Soreepeong 2025-08-07 21:18:08 +09:00
parent b3dcdb4539
commit 3e2a6ec9cb
211 changed files with 10 additions and 219 deletions

View file

@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Unicode;
@ -209,8 +207,7 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
}
}
private static ImGuiInputTextStatePtr GetInputTextState() =>
(ImGuiInputTextState*)((nint)ImGui.GetCurrentContext().Handle + 0x4588);
private static ImGuiInputTextStatePtr GetInputTextState() => new(&ImGui.GetCurrentContext().Handle->InputTextState);
private static (string String, bool Supported) ToUcs2(char* data, int nc = -1)
{

View file

@ -21,7 +21,7 @@ $sourcePaths = (
# replace "ImGuiKey.GamepadStart"
$tmp = Get-Content -Path "$PSScriptRoot\imgui\Dalamud.Bindings.ImGui\Generated\Enums\ImGuiKeyPrivate.cs" -Raw
$tmp = $tmp.Replace("unchecked((int)GamepadStart)", "unchecked((int)ImGuiKey.GamepadStart)").Trim()
$tmp | Set-Content -Path "$PSScriptRoot\imgui\Dalamud.Bindings.ImGui\Generated\Enums\ImGuiKeyPrivate.cs" -Encoding ascii
$tmp.Trim() | Set-Content -Path "$PSScriptRoot\imgui\Dalamud.Bindings.ImGui\Generated\Enums\ImGuiKeyPrivate.cs" -Encoding ascii
try
{
@ -141,7 +141,9 @@ foreach ($sourcePath in $sourcePaths)
$husks = $husks.Replace("public unsafe struct", "public unsafe partial struct")
$husks = $referNativeFunctionQualified.Replace($husks, '$1Native.$2')
$husks = "// <auto-generated/>`r`n`r`nusing $([string]::Join(";`r`nusing ", $imports) );`r`n`r`n$husks"
$husks | Set-Content -Path "$targetPath.gen.cs" -Encoding ascii
$husks = $husks -ireplace 'nuint (ActiveIdUsingKeyInputMask)', 'ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN $1'
$husks = $husks.Replace('ref Unsafe.AsRef<nuint>(&Handle->ActiveIdUsingKeyInputMask)', 'ref Unsafe.AsRef<ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN>(&Handle->ActiveIdUsingKeyInputMask)')
$husks.Trim() | Set-Content -Path "$targetPath.gen.cs" -Encoding ascii
}
$husks = "// <auto-generated/>`r`n`r`nusing $([string]::Join(";`r`nusing ", $imports) );`r`n`r`nnamespace $namespace;`r`n`r`n"
@ -286,6 +288,6 @@ foreach ($sourcePath in $sourcePaths)
$null = $sb.Append("// DISCARDED: $methodName`r`n")
}
$sb.ToString() | Set-Content -Path "$targetPath/$className.gen.cs" -Encoding ascii
$sb.ToString().Trim() | Set-Content -Path "$targetPath/$className.gen.cs" -Encoding ascii
}
}

View file

@ -8896,4 +8896,3 @@ public unsafe partial class ImGui
// DISCARDED: internal static byte VSliderFloatNative(byte* label, Vector2 size, float* v, float vMin, float vMax, byte* format, ImGuiSliderFlags flags)
// DISCARDED: internal static byte VSliderIntNative(byte* label, Vector2 size, int* v, int vMin, int vMax, byte* format, ImGuiSliderFlags flags)
// DISCARDED: internal static byte VSliderScalarNative(byte* label, Vector2 size, ImGuiDataType dataType, void* pData, void* pMin, void* pMax, byte* format, ImGuiSliderFlags flags)

View file

@ -4828,4 +4828,3 @@ public unsafe partial class ImGuiNative
}
}

File diff suppressed because one or more lines are too long

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImBitVector
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImBitVectorPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImChunkStreamImGuiTableSettings
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImChunkStreamImGuiWindowSettings
{
}

View file

@ -47,4 +47,3 @@ public unsafe partial struct ImColor
}
}
}

View file

@ -32,4 +32,3 @@ public unsafe partial struct ImColorPtr
ImGuiNative.SetHSV(Handle, h, s, v, (float)(1.0f));
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawChannel
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawChannelPtr
{
}

View file

@ -27,4 +27,3 @@ public unsafe partial struct ImDrawCmd
}
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawCmdHeader
{
}

View file

@ -21,4 +21,3 @@ public unsafe partial struct ImDrawCmdPtr
return ret;
}
}

View file

@ -40,4 +40,3 @@ public unsafe partial struct ImDrawData
}
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawDataBuilder
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawDataBuilderPtr
{
}

View file

@ -28,4 +28,3 @@ public unsafe partial struct ImDrawDataPtr
ImGuiNative.ScaleClipRects(Handle, fbScale);
}
}

View file

@ -756,4 +756,3 @@ public unsafe partial struct ImDrawList
}
}
// DISCARDED: AddText

View file

@ -441,4 +441,3 @@ public unsafe partial struct ImDrawListPtr
}
}
// DISCARDED: AddText

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawListPtrPtr
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImDrawListSharedData
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImDrawListSharedDataPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -84,4 +84,3 @@ public unsafe partial struct ImDrawListSplitter
}
}
}

View file

@ -57,4 +57,3 @@ public unsafe partial struct ImDrawListSplitterPtr
}
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawVert
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImDrawVertPtr
{
}

View file

@ -174,4 +174,3 @@ public unsafe partial struct ImFont
// DISCARDED: GetDebugName
// DISCARDED: GetDebugNameS
// DISCARDED: RenderText

View file

@ -1829,4 +1829,3 @@ public unsafe partial struct ImFontAtlas
// DISCARDED: AddFontFromMemoryCompressedBase85TTF
// DISCARDED: AddFontFromMemoryCompressedTTF
// DISCARDED: AddFontFromMemoryTTF

View file

@ -27,4 +27,3 @@ public unsafe partial struct ImFontAtlasCustomRect
}
}
}

View file

@ -21,4 +21,3 @@ public unsafe partial struct ImFontAtlasCustomRectPtr
return ret != 0;
}
}

View file

@ -1409,4 +1409,3 @@ public unsafe partial struct ImFontAtlasPtr
// DISCARDED: AddFontFromMemoryCompressedBase85TTF
// DISCARDED: AddFontFromMemoryCompressedTTF
// DISCARDED: AddFontFromMemoryTTF

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontAtlasTexture
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontAtlasTexturePtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontBuilderIO
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontBuilderIOPtr
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImFontConfig
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImFontConfigPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontGlyph
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontGlyphHotData
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontGlyphHotDataPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontGlyphPtr
{
}

View file

@ -73,4 +73,3 @@ public unsafe partial struct ImFontGlyphRangesBuilder
}
}
// DISCARDED: AddText

View file

@ -49,4 +49,3 @@ public unsafe partial struct ImFontGlyphRangesBuilderPtr
}
}
// DISCARDED: AddText

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontKerningPair
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontKerningPairPtr
{
}

View file

@ -114,4 +114,3 @@ public unsafe partial struct ImFontPtr
// DISCARDED: GetDebugName
// DISCARDED: GetDebugNameS
// DISCARDED: RenderText

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImFontPtrPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiColorMod
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiColorModPtr
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiComboPreviewData
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiComboPreviewDataPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiContext
}
}
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiContextHook
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiContextHookPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiContextPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDataTypeInfo
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDataTypeInfoPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDataTypeTempStorage
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiDockContext
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiDockContextPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockNode
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockNodePtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockNodeSettings
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockNodeSettingsPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockRequest
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiDockRequestPtr
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiGroupData
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiGroupDataPtr
{
}

View file

@ -106,4 +106,3 @@ public unsafe partial struct ImGuiIO
// DISCARDED: AddInputCharacter
// DISCARDED: AddInputCharactersUTF8
// DISCARDED: AddInputCharacterUTF16

View file

@ -67,4 +67,3 @@ public unsafe partial struct ImGuiIOPtr
// DISCARDED: AddInputCharacter
// DISCARDED: AddInputCharactersUTF8
// DISCARDED: AddInputCharacterUTF16

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiInputEvent
}
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventAppFocused
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventKey
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventMouseButton
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventMousePos
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventMouseViewport
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventMouseWheel
{
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiInputEventPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiInputEventText
{
}

View file

@ -49,4 +49,3 @@ public unsafe partial struct ImGuiInputTextCallbackData
}
}
// DISCARDED: InsertChars

View file

@ -34,4 +34,3 @@ public unsafe partial struct ImGuiInputTextCallbackDataPtr
}
}
// DISCARDED: InsertChars

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiInputTextState
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiInputTextStatePtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiKeyData
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiKeyDataPtr
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiLastItemData
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiLastItemDataPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -55,4 +55,3 @@ public unsafe partial struct ImGuiListClipper
}
}
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiListClipperData
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiListClipperDataPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -37,4 +37,3 @@ public unsafe partial struct ImGuiListClipperPtr
return ret != 0;
}
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiListClipperRange
{
}

View file

@ -12,4 +12,3 @@ namespace Dalamud.Bindings.ImGui;
public unsafe partial struct ImGuiListClipperRangePtr
{
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiMenuColumns
}
}
}

View file

@ -16,4 +16,3 @@ public unsafe partial struct ImGuiMenuColumnsPtr
ImGuiNative.Destroy(Handle);
}
}

View file

@ -19,4 +19,3 @@ public unsafe partial struct ImGuiMetricsConfig
}
}
}

Some files were not shown because too many files have changed in this diff Show more