From b53a97408b8fee13dd589cda5b01fb95a7a258bd Mon Sep 17 00:00:00 2001 From: Soreepeong <3614868+Soreepeong@users.noreply.github.com> Date: Sat, 26 Jul 2025 22:33:38 +0900 Subject: [PATCH] restructure --- .../SingleFontChooserDialog.cs | 57 +-- .../Internal/ActiveNotification.ImGui.cs | 2 +- Dalamud/Interface/Internal/UiDebug.cs | 2 +- .../UiDebug2/Browsing/NodeTree.Editor.cs | 2 +- .../Internal/Windows/BranchSwitcherWindow.cs | 2 +- .../Internal/Windows/ConsoleWindow.cs | 22 +- .../Windows/Data/Widgets/DataShareWidget.cs | 22 +- .../Data/Widgets/FontAwesomeTestWidget.cs | 2 +- .../Widgets/GamePrebakedFontsTestWidget.cs | 10 +- .../Windows/Data/Widgets/ImGuiWidget.cs | 24 +- .../Data/Widgets/NounProcessorWidget.cs | 4 +- .../Data/Widgets/SeStringCreatorWidget.cs | 4 +- .../Widgets/SeStringRendererTestWidget.cs | 12 +- .../Data/Widgets/TaskSchedulerWidget.cs | 4 +- .../Windows/Data/Widgets/TexWidget.cs | 9 +- .../Windows/Data/Widgets/ToastWidget.cs | 6 +- .../Windows/Data/Widgets/UldWidget.cs | 4 +- .../Widgets/LanguageChooserSettingsEntry.cs | 2 +- .../Windows/StyleEditor/StyleEditorWindow.cs | 4 +- .../TextureWraps/IDrawListTextureWrap.cs | 2 +- Dalamud/Interface/Utility/ImGuiHelpers.cs | 13 +- .../Functions.gen.cs} | 0 .../{ => Generated/Functions}/ImGui.gen.cs | 1 + .../Functions}/ImGuiNative.gen.cs | 46 -- .../Structs.gen.cs} | 0 ...edKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs | 0 .../Structs}/ImBitVector.gen.cs | 0 .../Structs}/ImBitVectorPtr.gen.cs | 0 .../ImChunkStreamImGuiTableSettings.gen.cs | 0 .../ImChunkStreamImGuiWindowSettings.gen.cs | 0 .../{ => Generated/Structs}/ImColor.gen.cs | 0 .../{ => Generated/Structs}/ImColorPtr.gen.cs | 0 .../Structs}/ImDrawChannel.gen.cs | 0 .../Structs}/ImDrawChannelPtr.gen.cs | 0 .../{ => Generated/Structs}/ImDrawCmd.gen.cs | 0 .../Structs}/ImDrawCmdHeader.gen.cs | 0 .../Structs}/ImDrawCmdPtr.gen.cs | 0 .../{ => Generated/Structs}/ImDrawData.gen.cs | 0 .../Structs}/ImDrawDataBuilder.gen.cs | 0 .../Structs}/ImDrawDataBuilderPtr.gen.cs | 0 .../Structs}/ImDrawDataPtr.gen.cs | 0 .../{ => Generated/Structs}/ImDrawList.gen.cs | 0 .../Structs}/ImDrawListPtr.gen.cs | 0 .../Structs}/ImDrawListPtrPtr.gen.cs | 0 .../Structs}/ImDrawListSharedData.gen.cs | 0 .../Structs}/ImDrawListSharedDataPtr.gen.cs | 0 .../Structs}/ImDrawListSplitter.gen.cs | 0 .../Structs}/ImDrawListSplitterPtr.gen.cs | 0 .../{ => Generated/Structs}/ImDrawVert.gen.cs | 0 .../Structs}/ImDrawVertPtr.gen.cs | 0 .../{ => Generated/Structs}/ImFont.gen.cs | 0 .../Structs}/ImFontAtlas.gen.cs | 0 .../Structs}/ImFontAtlasCustomRect.gen.cs | 0 .../Structs}/ImFontAtlasCustomRectPtr.gen.cs | 0 .../Structs}/ImFontAtlasPtr.gen.cs | 0 .../Structs}/ImFontAtlasTexture.gen.cs | 0 .../Structs}/ImFontAtlasTexturePtr.gen.cs | 0 .../Structs}/ImFontBuilderIO.gen.cs | 0 .../Structs}/ImFontBuilderIOPtr.gen.cs | 0 .../Structs}/ImFontConfig.gen.cs | 0 .../Structs}/ImFontConfigPtr.gen.cs | 0 .../Structs}/ImFontGlyph.gen.cs | 0 .../Structs}/ImFontGlyphHotData.gen.cs | 0 .../Structs}/ImFontGlyphHotDataPtr.gen.cs | 0 .../Structs}/ImFontGlyphPtr.gen.cs | 0 .../Structs}/ImFontGlyphRangesBuilder.gen.cs | 0 .../ImFontGlyphRangesBuilderPtr.gen.cs | 0 .../Structs}/ImFontKerningPair.gen.cs | 0 .../Structs}/ImFontKerningPairPtr.gen.cs | 0 .../{ => Generated/Structs}/ImFontPtr.gen.cs | 0 .../Structs}/ImFontPtrPtr.gen.cs | 0 .../Structs}/ImGuiColorMod.gen.cs | 0 .../Structs}/ImGuiColorModPtr.gen.cs | 0 .../Structs}/ImGuiComboPreviewData.gen.cs | 0 .../Structs}/ImGuiComboPreviewDataPtr.gen.cs | 0 .../Structs}/ImGuiContext.gen.cs | 0 .../Structs}/ImGuiContextHook.gen.cs | 0 .../Structs}/ImGuiContextHookPtr.gen.cs | 0 .../Structs}/ImGuiContextPtr.gen.cs | 0 .../Structs}/ImGuiDataTypeInfo.gen.cs | 0 .../Structs}/ImGuiDataTypeInfoPtr.gen.cs | 0 .../Structs}/ImGuiDataTypeTempStorage.gen.cs | 0 .../Structs}/ImGuiDockContext.gen.cs | 0 .../Structs}/ImGuiDockContextPtr.gen.cs | 0 .../Structs}/ImGuiDockNode.gen.cs | 0 .../Structs}/ImGuiDockNodePtr.gen.cs | 0 .../Structs}/ImGuiDockNodeSettings.gen.cs | 0 .../Structs}/ImGuiDockNodeSettingsPtr.gen.cs | 0 .../Structs}/ImGuiDockRequest.gen.cs | 0 .../Structs}/ImGuiDockRequestPtr.gen.cs | 0 .../Structs}/ImGuiGroupData.gen.cs | 0 .../Structs}/ImGuiGroupDataPtr.gen.cs | 0 .../{ => Generated/Structs}/ImGuiIO.gen.cs | 0 .../{ => Generated/Structs}/ImGuiIOPtr.gen.cs | 0 .../Structs}/ImGuiInputEvent.gen.cs | 0 .../Structs}/ImGuiInputEventAppFocused.gen.cs | 0 .../Structs}/ImGuiInputEventKey.gen.cs | 0 .../ImGuiInputEventMouseButton.gen.cs | 0 .../Structs}/ImGuiInputEventMousePos.gen.cs | 0 .../ImGuiInputEventMouseViewport.gen.cs | 0 .../Structs}/ImGuiInputEventMouseWheel.gen.cs | 0 .../Structs}/ImGuiInputEventPtr.gen.cs | 0 .../Structs}/ImGuiInputEventText.gen.cs | 0 .../ImGuiInputTextCallbackData.gen.cs | 0 .../ImGuiInputTextCallbackDataPtr.gen.cs | 0 .../Structs}/ImGuiInputTextState.gen.cs | 0 .../Structs}/ImGuiInputTextStatePtr.gen.cs | 0 .../Structs}/ImGuiKeyData.gen.cs | 0 .../Structs}/ImGuiKeyDataPtr.gen.cs | 0 .../Structs}/ImGuiLastItemData.gen.cs | 0 .../Structs}/ImGuiLastItemDataPtr.gen.cs | 0 .../Structs}/ImGuiListClipper.gen.cs | 0 .../Structs}/ImGuiListClipperData.gen.cs | 0 .../Structs}/ImGuiListClipperDataPtr.gen.cs | 0 .../Structs}/ImGuiListClipperPtr.gen.cs | 0 .../Structs}/ImGuiListClipperRange.gen.cs | 0 .../Structs}/ImGuiListClipperRangePtr.gen.cs | 0 .../Structs}/ImGuiMenuColumns.gen.cs | 0 .../Structs}/ImGuiMenuColumnsPtr.gen.cs | 0 .../Structs}/ImGuiMetricsConfig.gen.cs | 0 .../Structs}/ImGuiMetricsConfigPtr.gen.cs | 0 .../Structs}/ImGuiNavItemData.gen.cs | 0 .../Structs}/ImGuiNavItemDataPtr.gen.cs | 0 .../Structs}/ImGuiNextItemData.gen.cs | 0 .../Structs}/ImGuiNextItemDataPtr.gen.cs | 0 .../Structs}/ImGuiNextWindowData.gen.cs | 0 .../Structs}/ImGuiNextWindowDataPtr.gen.cs | 0 .../Structs}/ImGuiOldColumnData.gen.cs | 0 .../Structs}/ImGuiOldColumnDataPtr.gen.cs | 0 .../Structs}/ImGuiOldColumns.gen.cs | 0 .../Structs}/ImGuiOldColumnsPtr.gen.cs | 0 .../Structs}/ImGuiOnceUponAFrame.gen.cs | 0 .../Structs}/ImGuiOnceUponAFramePtr.gen.cs | 0 .../Structs}/ImGuiPayload.gen.cs | 0 .../Structs}/ImGuiPayloadPtr.gen.cs | 0 .../Structs}/ImGuiPlatformIO.gen.cs | 0 .../Structs}/ImGuiPlatformIOPtr.gen.cs | 0 .../Structs}/ImGuiPlatformImeData.gen.cs | 0 .../Structs}/ImGuiPlatformImeDataPtr.gen.cs | 0 .../Structs}/ImGuiPlatformMonitor.gen.cs | 0 .../Structs}/ImGuiPlatformMonitorPtr.gen.cs | 0 .../Structs}/ImGuiPopupData.gen.cs | 0 .../Structs}/ImGuiPopupDataPtr.gen.cs | 0 .../Structs}/ImGuiPtrOrIndex.gen.cs | 0 .../Structs}/ImGuiPtrOrIndexPtr.gen.cs | 0 .../Structs}/ImGuiSettingsHandler.gen.cs | 0 .../Structs}/ImGuiSettingsHandlerPtr.gen.cs | 0 .../Structs}/ImGuiShrinkWidthItem.gen.cs | 0 .../Structs}/ImGuiShrinkWidthItemPtr.gen.cs | 0 .../Structs}/ImGuiSizeCallbackData.gen.cs | 0 .../Structs}/ImGuiStackLevelInfo.gen.cs | 0 .../Structs}/ImGuiStackLevelInfoPtr.gen.cs | 0 .../Structs}/ImGuiStackSizes.gen.cs | 0 .../Structs}/ImGuiStackSizesPtr.gen.cs | 0 .../Structs}/ImGuiStackTool.gen.cs | 0 .../Structs}/ImGuiStackToolPtr.gen.cs | 0 .../Structs}/ImGuiStorage.gen.cs | 1 + .../Structs}/ImGuiStoragePair.gen.cs | 0 .../Structs}/ImGuiStoragePairPtr.gen.cs | 0 .../Structs}/ImGuiStoragePtr.gen.cs | 1 + .../{ => Generated/Structs}/ImGuiStyle.gen.cs | 0 .../Structs}/ImGuiStyleMod.gen.cs | 0 .../Structs}/ImGuiStyleModPtr.gen.cs | 0 .../Structs}/ImGuiStylePtr.gen.cs | 0 .../Structs}/ImGuiTabBar.gen.cs | 0 .../Structs}/ImGuiTabBarPtr.gen.cs | 0 .../Structs}/ImGuiTabItem.gen.cs | 0 .../Structs}/ImGuiTabItemPtr.gen.cs | 0 .../{ => Generated/Structs}/ImGuiTable.gen.cs | 0 .../Structs}/ImGuiTableCellData.gen.cs | 0 .../Structs}/ImGuiTableCellDataPtr.gen.cs | 0 .../Structs}/ImGuiTableColumn.gen.cs | 0 .../Structs}/ImGuiTableColumnPtr.gen.cs | 0 .../Structs}/ImGuiTableColumnSettings.gen.cs | 0 .../ImGuiTableColumnSettingsPtr.gen.cs | 0 .../Structs}/ImGuiTableColumnSortSpecs.gen.cs | 0 .../ImGuiTableColumnSortSpecsPtr.gen.cs | 0 .../Structs}/ImGuiTableColumnsSettings.gen.cs | 0 .../Structs}/ImGuiTableInstanceData.gen.cs | 0 .../Structs}/ImGuiTableInstanceDataPtr.gen.cs | 0 .../Structs}/ImGuiTablePtr.gen.cs | 0 .../Structs}/ImGuiTableSettings.gen.cs | 0 .../Structs}/ImGuiTableSettingsPtr.gen.cs | 0 .../Structs}/ImGuiTableSortSpecs.gen.cs | 0 .../Structs}/ImGuiTableSortSpecsPtr.gen.cs | 0 .../Structs}/ImGuiTableTempData.gen.cs | 0 .../Structs}/ImGuiTableTempDataPtr.gen.cs | 0 .../Structs}/ImGuiTextBuffer.gen.cs | 0 .../Structs}/ImGuiTextBufferPtr.gen.cs | 0 .../Structs}/ImGuiTextFilter.gen.cs | 0 .../Structs}/ImGuiTextFilterPtr.gen.cs | 0 .../Structs}/ImGuiTextRange.gen.cs | 0 .../Structs}/ImGuiTextRangePtr.gen.cs | 0 .../Structs}/ImGuiViewport.gen.cs | 0 .../Structs}/ImGuiViewportP.gen.cs | 0 .../Structs}/ImGuiViewportPPtr.gen.cs | 0 .../Structs}/ImGuiViewportPPtrPtr.gen.cs | 0 .../Structs}/ImGuiViewportPtr.gen.cs | 0 .../Structs}/ImGuiViewportPtrPtr.gen.cs | 0 .../Structs}/ImGuiWindow.gen.cs | 0 .../Structs}/ImGuiWindowClass.gen.cs | 0 .../Structs}/ImGuiWindowClassPtr.gen.cs | 0 .../Structs}/ImGuiWindowDockStyle.gen.cs | 0 .../Structs}/ImGuiWindowPtr.gen.cs | 0 .../Structs}/ImGuiWindowPtrPtr.gen.cs | 0 .../Structs}/ImGuiWindowSettings.gen.cs | 0 .../Structs}/ImGuiWindowSettingsPtr.gen.cs | 0 .../Structs}/ImGuiWindowStackData.gen.cs | 0 .../Structs}/ImGuiWindowStackDataPtr.gen.cs | 0 .../Structs}/ImGuiWindowTempData.gen.cs | 0 .../Structs}/ImPoolImGuiTabBar.gen.cs | 0 .../Structs}/ImPoolImGuiTable.gen.cs | 0 .../{ => Generated/Structs}/ImRect.gen.cs | 0 .../{ => Generated/Structs}/ImRectPtr.gen.cs | 0 .../Structs}/ImSpanImGuiTableCellData.gen.cs | 0 .../Structs}/ImSpanImGuiTableColumn.gen.cs | 0 .../Structs}/ImSpanImGuiTableColumnIdx.gen.cs | 0 .../{ => Generated/Structs}/ImVec1.gen.cs | 0 .../{ => Generated/Structs}/ImVec1Ptr.gen.cs | 0 .../{ => Generated/Structs}/ImVec2Ih.gen.cs | 0 .../Structs}/ImVec2IhPtr.gen.cs | 0 .../Structs}/STBTexteditState.gen.cs | 0 .../Structs}/StbTexteditRow.gen.cs | 0 .../Structs}/StbUndoRecord.gen.cs | 0 .../Structs}/StbUndoState.gen.cs | 0 .../Structs}/StbttPackContext.gen.cs | 0 .../Structs}/StbttPackContextPtr.gen.cs | 0 .../Functions.gen.cs} | 0 .../{ => Internals/Functions}/ImGuiP.gen.cs | 0 .../Functions}/ImGuiPNative.gen.cs | 0 .../Custom/Generated/Manual/Functions.gen.cs | 51 ++ .../Generated/Manual/Functions/ImGui.gen.cs | 27 + .../Manual/Functions/ImGuiNative.gen.cs | 92 ++++ .../Custom/ImDrawList.Custom.cs | 12 +- .../Custom/ImFont.Custom.cs | 6 +- .../Custom/ImFontAtlas.Custom.cs | 8 +- .../Custom/ImFontGlyphRangesBuilder.Custom.cs | 4 +- .../Custom/ImGui.ColorEditPicker.cs | 12 +- .../Custom/ImGui.ComboAndList.cs | 312 +++++++++--- .../Custom/ImGui.Custom.cs | 69 +++ .../Custom/ImGui.DragScalar.cs | 112 ++--- .../Custom/ImGui.InputScalar.cs | 76 +-- .../Custom/ImGui.Manual.cs | 468 ++++++++++++++++++ .../Custom/ImGui.Misc.cs | 12 +- .../Custom/ImGui.Plot.cs | 115 ++++- .../Custom/ImGui.SliderScalar.cs | 112 ++--- .../Custom/ImGui.Text.cs | 50 +- .../Custom/ImGui.Widgets.cs | 124 ++--- .../Custom/ImGuiIO.Custom.cs | 4 +- .../ImGuiInputTextCallbackData.Custom.cs | 12 +- .../Custom/ImGuiP.Misc.cs | 74 +-- .../Custom/ImGuiP.Plot.cs | 68 ++- .../Custom/ImGuiP.Text.cs | 20 +- .../Custom/ImGuiPayload.Custom.cs | 4 +- .../Custom/ImGuiTextBuffer.Custom.cs | 4 +- .../Custom/ImGuiTextFilter.Custom.cs | 8 +- .../Custom/ImGuiWindow.Custom.cs | 4 +- .../Custom/PointerTuple.cs | 116 +++++ .../Custom/Utf8Buffer.cs | 334 ------------- .../Dalamud.Bindings.ImGui.csproj | 5 +- imgui/Dalamud.Bindings.ImGui/ImU8String.cs | 378 ++++++++++++++ imgui/Dalamud.Bindings.ImGui/ImVector.cs | 421 ++++++++-------- test.ps1 | 40 +- 263 files changed, 2221 insertions(+), 1191 deletions(-) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{Generated.Functions.gen.cs => Generated/Functions.gen.cs} (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Functions}/ImGui.gen.cs (99%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Functions}/ImGuiNative.gen.cs (99%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{Generated.Structs.gen.cs => Generated/Structs.gen.cs} (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImBitVector.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImBitVectorPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImChunkStreamImGuiTableSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImChunkStreamImGuiWindowSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImColor.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImColorPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawChannel.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawChannelPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawCmd.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawCmdHeader.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawCmdPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawDataBuilder.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawDataBuilderPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawList.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListPtrPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListSharedData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListSharedDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListSplitter.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawListSplitterPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawVert.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImDrawVertPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFont.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlas.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlasCustomRect.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlasCustomRectPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlasPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlasTexture.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontAtlasTexturePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontBuilderIO.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontBuilderIOPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontConfig.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontConfigPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyph.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyphHotData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyphHotDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyphPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyphRangesBuilder.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontGlyphRangesBuilderPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontKerningPair.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontKerningPairPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImFontPtrPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiColorMod.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiColorModPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiComboPreviewData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiComboPreviewDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiContext.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiContextHook.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiContextHookPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiContextPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDataTypeInfo.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDataTypeInfoPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDataTypeTempStorage.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockContext.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockContextPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockNode.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockNodePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockNodeSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockNodeSettingsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockRequest.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiDockRequestPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiGroupData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiGroupDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiIO.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiIOPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEvent.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventAppFocused.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventKey.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventMouseButton.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventMousePos.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventMouseViewport.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventMouseWheel.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputEventText.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputTextCallbackData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputTextCallbackDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputTextState.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiInputTextStatePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiKeyData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiKeyDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiLastItemData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiLastItemDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipper.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipperData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipperDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipperPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipperRange.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiListClipperRangePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiMenuColumns.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiMenuColumnsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiMetricsConfig.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiMetricsConfigPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNavItemData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNavItemDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNextItemData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNextItemDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNextWindowData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiNextWindowDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOldColumnData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOldColumnDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOldColumns.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOldColumnsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOnceUponAFrame.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiOnceUponAFramePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPayload.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPayloadPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformIO.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformIOPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformImeData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformImeDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformMonitor.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPlatformMonitorPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPopupData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPopupDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPtrOrIndex.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiPtrOrIndexPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiSettingsHandler.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiSettingsHandlerPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiShrinkWidthItem.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiShrinkWidthItemPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiSizeCallbackData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackLevelInfo.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackLevelInfoPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackSizes.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackSizesPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackTool.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStackToolPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStorage.gen.cs (98%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStoragePair.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStoragePairPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStoragePtr.gen.cs (98%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStyle.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStyleMod.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStyleModPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiStylePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTabBar.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTabBarPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTabItem.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTabItemPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTable.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableCellData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableCellDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumn.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnSettingsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnSortSpecs.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnSortSpecsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableColumnsSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableInstanceData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableInstanceDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTablePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableSettingsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableSortSpecs.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableSortSpecsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableTempData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTableTempDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextBuffer.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextBufferPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextFilter.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextFilterPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextRange.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiTextRangePtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewport.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewportP.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewportPPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewportPPtrPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewportPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiViewportPtrPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindow.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowClass.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowClassPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowDockStyle.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowPtrPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowSettings.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowSettingsPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowStackData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowStackDataPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImGuiWindowTempData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImPoolImGuiTabBar.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImPoolImGuiTable.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImRect.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImRectPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImSpanImGuiTableCellData.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImSpanImGuiTableColumn.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImSpanImGuiTableColumnIdx.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImVec1.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImVec1Ptr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImVec2Ih.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/ImVec2IhPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/STBTexteditState.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/StbTexteditRow.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/StbUndoRecord.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/StbUndoState.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/StbttPackContext.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Generated/Structs}/StbttPackContextPtr.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{Internals.Functions.gen.cs => Internals/Functions.gen.cs} (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Internals/Functions}/ImGuiP.gen.cs (100%) rename imgui/Dalamud.Bindings.ImGui/Custom/Generated/{ => Internals/Functions}/ImGuiPNative.gen.cs (100%) create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions.gen.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGui.gen.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGuiNative.gen.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Custom.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Manual.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/PointerTuple.cs delete mode 100644 imgui/Dalamud.Bindings.ImGui/Custom/Utf8Buffer.cs create mode 100644 imgui/Dalamud.Bindings.ImGui/ImU8String.cs diff --git a/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs b/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs index 2b25ffca5..9ebb873d3 100644 --- a/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs +++ b/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs @@ -205,8 +205,8 @@ public sealed class SingleFontChooserDialog : IDisposable /// Gets or sets a value indicating whether this popup should be modal, blocking everything behind from /// being interacted. - /// If true, then will be - /// used. Otherwise, will be used. + /// If true, then will be + /// used. Otherwise, will be used. public bool IsModal { get; set; } = true; /// Gets or sets the window flags. @@ -558,21 +558,10 @@ public sealed class SingleFontChooserDialog : IDisposable ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); using (this.fontHandle?.Push()) { - unsafe - { - fixed (byte* buf = this.fontPreviewText) - fixed (byte* label = "##fontPreviewText"u8) - { - ImGui.InputTextMultiline( - label, - buf, - (uint)this.fontPreviewText.Length, - ImGui.GetContentRegionAvail(), - ImGuiInputTextFlags.None, - null, - null); - } - } + ImGui.InputTextMultiline( + "##fontPreviewText"u8, + this.fontPreviewText, + ImGui.GetContentRegionAvail()); } } } @@ -608,15 +597,15 @@ public sealed class SingleFontChooserDialog : IDisposable ref this.familySearch, 255, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory, - data => + (ref ImGuiInputTextCallbackData data) => { if (families.Count == 0) return 0; var baseIndex = this.selectedFamilyIndex; - if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen) + if (data.SelectionStart == 0 && data.SelectionEnd == data.BufTextLen) { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: this.selectedFamilyIndex = (this.selectedFamilyIndex + 1) % families.Count; @@ -632,13 +621,13 @@ public sealed class SingleFontChooserDialog : IDisposable if (changed) { ImGuiHelpers.SetTextFromCallback( - data, + ref data, this.ExtractName(families[this.selectedFamilyIndex])); } } else { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: this.selectedFamilyIndex = families.FindIndex( @@ -776,15 +765,15 @@ public sealed class SingleFontChooserDialog : IDisposable ref this.fontSearch, 255, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory, - data => + (ref ImGuiInputTextCallbackData data) => { if (fonts.Count == 0) return 0; var baseIndex = this.selectedFontIndex; - if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen) + if (data.SelectionStart == 0 && data.SelectionEnd == data.BufTextLen) { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: this.selectedFontIndex = (this.selectedFontIndex + 1) % fonts.Count; @@ -799,13 +788,13 @@ public sealed class SingleFontChooserDialog : IDisposable if (changed) { ImGuiHelpers.SetTextFromCallback( - data, + ref data, this.ExtractName(fonts[this.selectedFontIndex])); } } else { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: this.selectedFontIndex = fonts.FindIndex( @@ -925,9 +914,9 @@ public sealed class SingleFontChooserDialog : IDisposable 255, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory | ImGuiInputTextFlags.CharsDecimal, - data => + (ref ImGuiInputTextCallbackData data) => { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: this.selectedFont = this.selectedFont with @@ -946,7 +935,7 @@ public sealed class SingleFontChooserDialog : IDisposable } if (changed) - ImGuiHelpers.SetTextFromCallback(data, $"{this.selectedFont.SizePt:0.##}"); + ImGuiHelpers.SetTextFromCallback(ref data, $"{this.selectedFont.SizePt:0.##}"); return 0; })) @@ -1129,19 +1118,19 @@ public sealed class SingleFontChooserDialog : IDisposable 255, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory | ImGuiInputTextFlags.CharsDecimal, - data => + (ref ImGuiInputTextCallbackData data) => { - switch (data->EventKey) + switch (data.EventKey) { case ImGuiKey.DownArrow: changed2 = true; value = Math.Min(max, (MathF.Round(value / step) * step) + step); - ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}"); + ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}"); break; case ImGuiKey.UpArrow: changed2 = true; value = Math.Max(min, (MathF.Round(value / step) * step) - step); - ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}"); + ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}"); break; } diff --git a/Dalamud/Interface/ImGuiNotification/Internal/ActiveNotification.ImGui.cs b/Dalamud/Interface/ImGuiNotification/Internal/ActiveNotification.ImGui.cs index 1afc1262b..351f0a2e1 100644 --- a/Dalamud/Interface/ImGuiNotification/Internal/ActiveNotification.ImGui.cs +++ b/Dalamud/Interface/ImGuiNotification/Internal/ActiveNotification.ImGui.cs @@ -218,7 +218,7 @@ internal sealed partial class ActiveNotification /// Calculates the effective expiry, taking ImGui window state into account. /// Notification will not dismiss while this paramter is true. /// The calculated effective expiry. - /// Expected to be called BETWEEN and . + /// Expected to be called BETWEEN and . private DateTime CalculateEffectiveExpiry(ref bool warrantsExtension) { DateTime expiry; diff --git a/Dalamud/Interface/Internal/UiDebug.cs b/Dalamud/Interface/Internal/UiDebug.cs index 26d3f6f70..11858e49d 100644 --- a/Dalamud/Interface/Internal/UiDebug.cs +++ b/Dalamud/Interface/Internal/UiDebug.cs @@ -211,7 +211,7 @@ internal unsafe class UiDebug ImGui.SameLine(); Service.Get().Draw(textNode->NodeText); - ImGui.InputText($"Replace Text##{(ulong)textNode:X}", textNode->NodeText.StringPtr, (uint)textNode->NodeText.BufSize); + ImGui.InputText($"Replace Text##{(ulong)textNode:X}", new(textNode->NodeText.StringPtr, (int)textNode->NodeText.BufSize)); ImGui.SameLine(); if (ImGui.Button($"Encode##{(ulong)textNode:X}")) diff --git a/Dalamud/Interface/Internal/UiDebug2/Browsing/NodeTree.Editor.cs b/Dalamud/Interface/Internal/UiDebug2/Browsing/NodeTree.Editor.cs index b940dddea..a1a98f287 100644 --- a/Dalamud/Interface/Internal/UiDebug2/Browsing/NodeTree.Editor.cs +++ b/Dalamud/Interface/Internal/UiDebug2/Browsing/NodeTree.Editor.cs @@ -321,7 +321,7 @@ internal unsafe partial class TextNodeTree ImGui.Text("Font:"); ImGui.TableNextColumn(); ImGui.SetNextItemWidth(150); - if (ImGui.Combo($"##{(nint)this.Node:X}fontType", ref fontIndex, FontNames, FontList.Count)) + if (ImGui.Combo($"##{(nint)this.Node:X}fontType", ref fontIndex, FontNames)) { this.TxtNode->FontType = FontList[fontIndex]; } diff --git a/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs index 4af9b7cfd..bcb3141f9 100644 --- a/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs +++ b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs @@ -68,7 +68,7 @@ public class BranchSwitcherWindow : Window var si = Service.Get().StartInfo; var itemsArray = this.branches.Select(x => x.Key).ToArray(); - ImGui.ListBox("Branch", ref this.selectedBranchIndex, itemsArray, itemsArray.Length); + ImGui.ListBox("Branch", ref this.selectedBranchIndex, itemsArray); var pickedBranch = this.branches.ElementAt(this.selectedBranchIndex); diff --git a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs index 8e030819b..4786373ba 100644 --- a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs @@ -835,11 +835,9 @@ internal class ConsoleWindow : Window, IDisposable } } - private unsafe int CommandInputCallback(ImGuiInputTextCallbackData* data) + private int CommandInputCallback(ref ImGuiInputTextCallbackData data) { - var ptr = new ImGuiInputTextCallbackDataPtr(data); - - switch (data->EventFlag) + switch (data.EventFlag) { case ImGuiInputTextFlags.CallbackEdit: this.completionZipText = null; @@ -847,9 +845,7 @@ internal class ConsoleWindow : Window, IDisposable break; case ImGuiInputTextFlags.CallbackCompletion: - var textBytes = new byte[data->BufTextLen]; - Marshal.Copy((IntPtr)data->Buf, textBytes, 0, data->BufTextLen); - var text = Encoding.UTF8.GetString(textBytes); + var text = Encoding.UTF8.GetString(data.BufTextSpan); var words = text.Split(); @@ -894,8 +890,8 @@ internal class ConsoleWindow : Window, IDisposable if (toComplete != null) { - ptr.DeleteChars(0, ptr.BufTextLen); - ptr.InsertChars(0, toComplete); + data.DeleteChars(0, data.BufTextLen); + data.InsertChars(0, toComplete); } } @@ -904,14 +900,14 @@ internal class ConsoleWindow : Window, IDisposable case ImGuiInputTextFlags.CallbackHistory: var prevPos = this.historyPos; - if (ptr.EventKey == ImGuiKey.UpArrow) + if (data.EventKey == ImGuiKey.UpArrow) { if (this.historyPos == -1) this.historyPos = this.configuration.LogCommandHistory.Count - 1; else if (this.historyPos > 0) this.historyPos--; } - else if (data->EventKey == ImGuiKey.DownArrow) + else if (data.EventKey == ImGuiKey.DownArrow) { if (this.historyPos != -1) { @@ -926,8 +922,8 @@ internal class ConsoleWindow : Window, IDisposable { var historyStr = this.historyPos >= 0 ? this.configuration.LogCommandHistory[this.historyPos] : string.Empty; - ptr.DeleteChars(0, ptr.BufTextLen); - ptr.InsertChars(0, historyStr); + data.DeleteChars(0, data.BufTextLen); + data.InsertChars(0, historyStr); } break; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/DataShareWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/DataShareWidget.cs index 534911708..965d4dd24 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/DataShareWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/DataShareWidget.cs @@ -120,23 +120,13 @@ internal class DataShareWidget : IDataWindowWidget ImGui.SameLine(); if (ImGui.Button("Copy")) - { - fixed (byte* pData = data) - ImGui.SetClipboardText(pData); - } + ImGui.SetClipboardText(data); - fixed (byte* pLabel = "text"u8) - fixed (byte* pData = data) - { - ImGui.InputTextMultiline( - pLabel, - pData, - (uint)data.Length, - ImGui.GetContentRegionAvail(), - ImGuiInputTextFlags.ReadOnly, - null, - null); - } + ImGui.InputTextMultiline( + "text"u8, + data, + ImGui.GetContentRegionAvail(), + ImGuiInputTextFlags.ReadOnly); } this.nextTab = -1; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/FontAwesomeTestWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/FontAwesomeTestWidget.cs index 3b8c29d9e..b12d5261b 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/FontAwesomeTestWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/FontAwesomeTestWidget.cs @@ -69,7 +69,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget ImGui.SetNextItemWidth(160f); var categoryIndex = this.selectedIconCategory; - if (ImGui.Combo("####FontAwesomeCategorySearch", ref categoryIndex, this.iconCategories, this.iconCategories.Length)) + if (ImGui.Combo("####FontAwesomeCategorySearch", ref categoryIndex, this.iconCategories)) { this.selectedIconCategory = categoryIndex; this.iconSearchChanged = true; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/GamePrebakedFontsTestWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/GamePrebakedFontsTestWidget.cs index 617e3ce19..6e2aca3ff 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/GamePrebakedFontsTestWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/GamePrebakedFontsTestWidget.cs @@ -61,7 +61,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable public unsafe void Draw() { ImGui.AlignTextToFramePadding(); - if (ImGui.Combo("Global Scale per Font"u8, ref this.fontScaleMode, FontScaleModes, FontScaleModes.Length)) + if (ImGui.Combo("Global Scale per Font"u8, ref this.fontScaleMode, FontScaleModes)) this.ClearAtlas(); if (ImGui.Checkbox("Global Scale for Atlas"u8, ref this.atlasScaleMode)) this.ClearAtlas(); @@ -182,12 +182,8 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable { if (ImGui.InputTextMultiline( labelPtr, - this.testStringBuffer.Data, - (uint)this.testStringBuffer.Capacity, - new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3), - 0, - null, - null)) + this.testStringBuffer.StorageSpan, + new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3))) { var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0); if (len + 4 >= this.testStringBuffer.Capacity) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs index f7b14769f..1ddcb8cb6 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/ImGuiWidget.cs @@ -73,17 +73,9 @@ internal class ImGuiWidget : IDataWindowWidget ImGui.Checkbox("##manualType", ref this.notificationTemplate.ManualType); ImGui.SameLine(); - ImGui.Combo( - "Type##type", - ref this.notificationTemplate.TypeInt, - NotificationTemplate.TypeTitles, - NotificationTemplate.TypeTitles.Length); + ImGui.Combo("Type##type", ref this.notificationTemplate.TypeInt, NotificationTemplate.TypeTitles); - ImGui.Combo( - "Icon##iconCombo", - ref this.notificationTemplate.IconInt, - NotificationTemplate.IconTitles, - NotificationTemplate.IconTitles.Length); + ImGui.Combo("Icon##iconCombo", ref this.notificationTemplate.IconInt, NotificationTemplate.IconTitles); switch (this.notificationTemplate.IconInt) { case 1 or 2: @@ -96,8 +88,7 @@ internal class ImGuiWidget : IDataWindowWidget ImGui.Combo( "Asset##iconAssetCombo", ref this.notificationTemplate.IconAssetInt, - NotificationTemplate.AssetSources, - NotificationTemplate.AssetSources.Length); + NotificationTemplate.AssetSources); break; case 3 or 7: ImGui.InputText( @@ -116,20 +107,17 @@ internal class ImGuiWidget : IDataWindowWidget ImGui.Combo( "Initial Duration", ref this.notificationTemplate.InitialDurationInt, - NotificationTemplate.InitialDurationTitles, - NotificationTemplate.InitialDurationTitles.Length); + NotificationTemplate.InitialDurationTitles); ImGui.Combo( "Extension Duration", ref this.notificationTemplate.HoverExtendDurationInt, - NotificationTemplate.HoverExtendDurationTitles, - NotificationTemplate.HoverExtendDurationTitles.Length); + NotificationTemplate.HoverExtendDurationTitles); ImGui.Combo( "Progress", ref this.notificationTemplate.ProgressMode, - NotificationTemplate.ProgressModeTitles, - NotificationTemplate.ProgressModeTitles.Length); + NotificationTemplate.ProgressModeTitles); ImGui.Checkbox("Respect UI Hidden", ref this.notificationTemplate.RespectUiHidden); diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/NounProcessorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/NounProcessorWidget.cs index e041d020b..ec1b298fc 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/NounProcessorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/NounProcessorWidget.cs @@ -89,7 +89,7 @@ internal class NounProcessorWidget : IDataWindowWidget var language = this.languages[this.selectedLanguageIndex]; ImGui.SetNextItemWidth(300); - if (ImGui.Combo("###SelectedSheetName", ref this.selectedSheetNameIndex, NounSheets.Select(t => t.Name).ToArray(), NounSheets.Length)) + if (ImGui.Combo("###SelectedSheetName", ref this.selectedSheetNameIndex, NounSheets.Select(t => t.Name).ToArray())) { this.rowId = 1; } @@ -97,7 +97,7 @@ internal class NounProcessorWidget : IDataWindowWidget ImGui.SameLine(); ImGui.SetNextItemWidth(120); - if (ImGui.Combo("###SelectedLanguage", ref this.selectedLanguageIndex, this.languageNames, this.languageNames.Length)) + if (ImGui.Combo("###SelectedLanguage", ref this.selectedLanguageIndex, this.languageNames)) { language = this.languages[this.selectedLanguageIndex]; this.rowId = 1; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index 11c10e515..b9902f388 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -568,7 +568,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget } }).OrderBy(sheetName => sheetName, StringComparer.InvariantCulture).ToArray(); - var sheetChanged = ImGui.Combo("Sheet Name", ref this.importSelectedSheetName, this.validImportSheetNames, this.validImportSheetNames.Length); + var sheetChanged = ImGui.Combo("Sheet Name", ref this.importSelectedSheetName, this.validImportSheetNames); try { @@ -683,7 +683,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget ImGui.TableNextColumn(); // Type var type = (int)entry.Type; ImGui.SetNextItemWidth(-1); - if (ImGui.Combo($"##Type{i}", ref type, ["String", "Macro", "Fixed"], 3)) + if (ImGui.Combo($"##Type{i}", ref type, ["String", "Macro", "Fixed"])) { entry.Type = (TextEntryType)type; updateString |= true; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringRendererTestWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringRendererTestWidget.cs index 418eac80d..8a675f2e7 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringRendererTestWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringRendererTestWidget.cs @@ -115,7 +115,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget ImGui.SameLine(); var t4 = this.style.ThemeIndex ?? AtkStage.Instance()->AtkUIColorHolder->ActiveColorThemeType; ImGui.PushItemWidth(ImGui.CalcTextSize("WWWWWWWWWWWWWW").X); - if (ImGui.Combo("##theme", ref t4, ThemeNames, ThemeNames.Length)) + if (ImGui.Combo("##theme", ref t4, ThemeNames)) this.style.ThemeIndex = t4; ImGui.SameLine(); @@ -265,12 +265,8 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget { if (ImGui.InputTextMultiline( labelPtr, - this.testStringBuffer.Data, - (uint)this.testStringBuffer.Capacity, - new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3), - 0, - null, - null)) + this.testStringBuffer.StorageSpan, + new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3))) { var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0); if (len + 4 >= this.testStringBuffer.Capacity) @@ -278,7 +274,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget if (len < this.testStringBuffer.Capacity) { this.testStringBuffer.LengthUnsafe = len; - this.testStringBuffer.StorageSpan[len] = default; + this.testStringBuffer.StorageSpan[len] = 0; } this.testString = string.Empty; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/TaskSchedulerWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/TaskSchedulerWidget.cs index adaff5496..2b07a2ec2 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/TaskSchedulerWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/TaskSchedulerWidget.cs @@ -243,8 +243,8 @@ internal class TaskSchedulerWidget : IDataWindowWidget if (ImGui.CollapsingHeader("Download")) { - ImGui.InputText("URL", ref this.url, (uint)this.url.Length); - ImGui.InputText("Local Path", ref this.localPath, (uint)this.localPath.Length); + ImGui.InputText("URL", ref this.url); + ImGui.InputText("Local Path", ref this.localPath); ImGui.SameLine(); if (ImGuiComponents.IconButton("##localpathpicker", FontAwesomeIcon.File)) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs index 710700710..34403fd16 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs @@ -709,8 +709,7 @@ internal class TexWidget : IDataWindowWidget if (ImGui.Combo( "Assembly", ref this.inputManifestResourceAssemblyIndex, - this.inputManifestResourceAssemblyCandidateNames, - this.inputManifestResourceAssemblyCandidateNames.Length)) + this.inputManifestResourceAssemblyCandidateNames)) { this.inputManifestResourceNameIndex = 0; this.inputManifestResourceNameCandidates = null; @@ -727,8 +726,7 @@ internal class TexWidget : IDataWindowWidget ImGui.Combo( "Name", ref this.inputManifestResourceNameIndex, - this.inputManifestResourceNameCandidates, - this.inputManifestResourceNameCandidates.Length); + this.inputManifestResourceNameCandidates); var name = this.inputManifestResourceNameIndex >= 0 @@ -844,8 +842,7 @@ internal class TexWidget : IDataWindowWidget ImGui.Combo( nameof(this.textureModificationArgs.DxgiFormat), ref this.renderTargetChoiceInt, - this.supportedRenderTargetFormatNames, - this.supportedRenderTargetFormatNames.Length); + this.supportedRenderTargetFormatNames); Span wh = stackalloc int[2]; wh[0] = this.textureModificationArgs.NewWidth; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/ToastWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/ToastWidget.cs index c9d3c119d..c667b6282 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/ToastWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/ToastWidget.cs @@ -41,9 +41,9 @@ internal class ToastWidget : IDataWindowWidget ImGui.InputText("Toast text", ref this.inputTextToast, 200); - ImGui.Combo("Toast Position", ref this.toastPosition, new[] { "Bottom", "Top", }, 2); - ImGui.Combo("Toast Speed", ref this.toastSpeed, new[] { "Slow", "Fast", }, 2); - ImGui.Combo("Quest Toast Position", ref this.questToastPosition, new[] { "Centre", "Right", "Left" }, 3); + ImGui.Combo("Toast Position", ref this.toastPosition, ["Bottom", "Top"]); + ImGui.Combo("Toast Speed", ref this.toastSpeed, ["Slow", "Fast"]); + ImGui.Combo("Quest Toast Position", ref this.questToastPosition, ["Centre", "Right", "Left"]); ImGui.Checkbox("Quest Checkmark", ref this.questToastCheckmark); ImGui.Checkbox("Quest Play Sound", ref this.questToastSound); ImGui.InputInt("Quest Icon ID", ref this.questToastIconId); diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs index f8d04e2cc..742530dd6 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/UldWidget.cs @@ -101,7 +101,7 @@ internal class UldWidget : IDataWindowWidget } var selectedUldPrev = this.selectedUld; - ImGui.Combo("##selectUld", ref this.selectedUld, uldNames, uldNames.Length); + ImGui.Combo("##selectUld", ref this.selectedUld, uldNames); ImGui.SameLine(); if (ImGuiComponents.IconButton("selectUldLeft", FontAwesomeIcon.AngleLeft)) this.selectedUld = ((this.selectedUld + uldNames.Length) - 1) % uldNames.Length; @@ -117,7 +117,7 @@ internal class UldWidget : IDataWindowWidget ClearTask(ref this.selectedUldFileTask); } - ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames, ThemeDisplayNames.Length); + ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames); ImGui.SameLine(); if (ImGuiComponents.IconButton("selectThemeLeft", FontAwesomeIcon.AngleLeft)) this.selectedTheme = ((this.selectedTheme + ThemeDisplayNames.Length) - 1) % ThemeDisplayNames.Length; diff --git a/Dalamud/Interface/Internal/Windows/Settings/Widgets/LanguageChooserSettingsEntry.cs b/Dalamud/Interface/Internal/Windows/Settings/Widgets/LanguageChooserSettingsEntry.cs index 6589a9d64..6d495ee2c 100644 --- a/Dalamud/Interface/Internal/Windows/Settings/Widgets/LanguageChooserSettingsEntry.cs +++ b/Dalamud/Interface/Internal/Windows/Settings/Widgets/LanguageChooserSettingsEntry.cs @@ -70,7 +70,7 @@ public sealed class LanguageChooserSettingsEntry : SettingsEntry public override void Draw() { ImGui.Text(this.Name); - ImGui.Combo("##XlLangCombo", ref this.langIndex, this.locLanguages, this.locLanguages.Length); + ImGui.Combo("##XlLangCombo", ref this.langIndex, this.locLanguages); ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsLanguageHint", "Select the language Dalamud will be displayed in.")); } } diff --git a/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs b/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs index 9f6dc3f32..dace259cf 100644 --- a/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs +++ b/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs @@ -84,7 +84,7 @@ public class StyleEditorWindow : Window var styleAry = config.SavedStyles.Select(x => x.Name).ToArray(); ImGui.Text(Loc.Localize("StyleEditorChooseStyle", "Choose Style:")); - if (ImGui.Combo("###styleChooserCombo", ref this.currentSel, styleAry, styleAry.Length)) + if (ImGui.Combo("###styleChooserCombo", ref this.currentSel, styleAry)) { var newStyle = config.SavedStyles[this.currentSel]; newStyle.Apply(); @@ -245,7 +245,7 @@ public class StyleEditorWindow : Window ImGui.Text("Alignment"); ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); var windowMenuButtonPosition = (int)style.WindowMenuButtonPosition + 1; - if (ImGui.Combo("WindowMenuButtonPosition", ref windowMenuButtonPosition, "None\0Left\0Right\0")) + if (ImGui.Combo("WindowMenuButtonPosition", ref windowMenuButtonPosition, ["None", "Left", "Right"])) style.WindowMenuButtonPosition = (ImGuiDir)(windowMenuButtonPosition - 1); ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui.SameLine(); diff --git a/Dalamud/Interface/Textures/TextureWraps/IDrawListTextureWrap.cs b/Dalamud/Interface/Textures/TextureWraps/IDrawListTextureWrap.cs index 4c351258a..55a0ca027 100644 --- a/Dalamud/Interface/Textures/TextureWraps/IDrawListTextureWrap.cs +++ b/Dalamud/Interface/Textures/TextureWraps/IDrawListTextureWrap.cs @@ -54,7 +54,7 @@ public interface IDrawListTextureWrap : IDalamudTextureWrap /// Resizes this texture and draws an ImGui window. /// Name and ID of the window to draw. Use the value that goes into - /// . + /// . /// Scale to apply to all draw commands in the draw list. void ResizeAndDrawWindow(ReadOnlySpan windowName, Vector2 scale); } diff --git a/Dalamud/Interface/Utility/ImGuiHelpers.cs b/Dalamud/Interface/Utility/ImGuiHelpers.cs index a65175993..b4cd269d7 100644 --- a/Dalamud/Interface/Utility/ImGuiHelpers.cs +++ b/Dalamud/Interface/Utility/ImGuiHelpers.cs @@ -666,16 +666,13 @@ public static partial class ImGuiHelpers /// /// The callback data. /// The new text. - internal static unsafe void SetTextFromCallback(ImGuiInputTextCallbackData* data, string s) + internal static void SetTextFromCallback(ref ImGuiInputTextCallbackData data, ImU8String s) { - if (data->BufTextLen != 0) - data->DeleteChars(0, data->BufTextLen); + if (data.BufTextLen != 0) + data.DeleteChars(0, data.BufTextLen); - var len = Encoding.UTF8.GetByteCount(s); - var buf = len < 1024 ? stackalloc byte[len] : new byte[len]; - Encoding.UTF8.GetBytes(s, buf); - data->InsertChars(0, buf); - data->SelectAll(); + data.InsertChars(0, s); + data.SelectAll(); } /// diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated.Functions.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated.Functions.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGui.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGui.gen.cs similarity index 99% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGui.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGui.gen.cs index 0066d8ef5..8336bbb40 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGui.gen.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGui.gen.cs @@ -8953,6 +8953,7 @@ public unsafe partial class ImGui // DISCARDED: internal static uint GetIDNative(byte* strIdBegin, byte* strIdEnd) // DISCARDED: internal static uint GetIDNative(void* ptrId) // DISCARDED: internal static int* GetIntRefNative(ImGuiStorage* self, uint key, int defaultVal) +// DISCARDED: internal static void** GetVoidPtrRefNative(ImGuiStorage* self, uint key, void* defaultVal) // DISCARDED: internal static ImGuiTextFilter* ImGuiTextFilterNative(byte* defaultFilter) // DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative() // DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative(byte* b, byte* e) diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNative.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGuiNative.gen.cs similarity index 99% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNative.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGuiNative.gen.cs index 9d0102c5e..22386e992 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNative.gen.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Functions/ImGuiNative.gen.cs @@ -3735,52 +3735,6 @@ public unsafe partial class ImGuiNative return ((delegate* unmanaged[Cdecl])ImGui.funcTable[473])(self, key, defaultVal); } - - /// - /// To be documented. - /// - public static void** GetVoidPtrRef(ImGuiStoragePtr self, uint key, void* defaultVal) - { - void** ret = GetVoidPtrRef(self, key, defaultVal); - return ret; - } - - /// - /// To be documented. - /// - public static void** GetVoidPtrRef(ImGuiStoragePtr self, uint key) - { - void** ret = GetVoidPtrRef(self, key, (void*)(default)); - return ret; - } - - /// - /// To be documented. - /// - public static void** GetVoidPtrRef(ref ImGuiStorage self, uint key, void* defaultVal) - { - fixed (ImGuiStorage* pself = &self) - { - void** ret = GetVoidPtrRef((ImGuiStorage*)pself, key, defaultVal); - return ret; - } - } - - /// - /// To be documented. - /// - public static void** GetVoidPtrRef(ref ImGuiStorage self, uint key) - { - fixed (ImGuiStorage* pself = &self) - { - void** ret = GetVoidPtrRef((ImGuiStorage*)pself, key, (void*)(default)); - return ret; - } - } - - /// - /// To be documented. - /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void SetAllInt(ImGuiStorage* self, int val) { diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated.Structs.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated.Structs.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitArrayImGuiKeyNamedKeyCOUNTLessImGuiKeyNamedKeyBEGIN.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitVector.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitVector.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitVector.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitVector.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitVectorPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitVectorPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImBitVectorPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImBitVectorPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImChunkStreamImGuiTableSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImChunkStreamImGuiTableSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImChunkStreamImGuiTableSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImChunkStreamImGuiTableSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImChunkStreamImGuiWindowSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImChunkStreamImGuiWindowSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImChunkStreamImGuiWindowSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImChunkStreamImGuiWindowSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImColor.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImColor.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImColor.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImColor.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImColorPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImColorPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImColorPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImColorPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawChannel.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawChannel.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawChannel.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawChannel.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawChannelPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawChannelPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawChannelPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawChannelPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmd.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmd.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmd.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmd.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmdHeader.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmdHeader.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmdHeader.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmdHeader.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmdPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmdPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawCmdPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawCmdPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataBuilder.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataBuilder.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataBuilder.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataBuilder.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataBuilderPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataBuilderPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataBuilderPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataBuilderPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawList.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawList.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawList.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawList.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListPtrPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListPtrPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListPtrPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListPtrPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSharedData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSharedData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSharedData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSharedData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSharedDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSharedDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSharedDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSharedDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSplitter.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSplitter.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSplitter.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSplitter.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSplitterPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSplitterPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawListSplitterPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawListSplitterPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawVert.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawVert.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawVert.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawVert.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawVertPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawVertPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImDrawVertPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImDrawVertPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFont.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFont.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFont.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFont.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlas.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlas.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlas.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlas.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasCustomRect.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasCustomRect.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasCustomRect.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasCustomRect.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasCustomRectPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasCustomRectPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasCustomRectPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasCustomRectPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasTexture.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasTexture.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasTexture.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasTexture.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasTexturePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasTexturePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontAtlasTexturePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontAtlasTexturePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontBuilderIO.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontBuilderIO.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontBuilderIO.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontBuilderIO.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontBuilderIOPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontBuilderIOPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontBuilderIOPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontBuilderIOPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontConfig.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontConfig.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontConfig.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontConfig.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontConfigPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontConfigPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontConfigPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontConfigPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyph.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyph.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyph.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyph.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphHotData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphHotData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphHotData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphHotData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphHotDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphHotDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphHotDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphHotDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphRangesBuilder.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphRangesBuilder.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphRangesBuilder.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphRangesBuilder.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphRangesBuilderPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphRangesBuilderPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontGlyphRangesBuilderPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontGlyphRangesBuilderPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontKerningPair.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontKerningPair.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontKerningPair.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontKerningPair.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontKerningPairPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontKerningPairPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontKerningPairPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontKerningPairPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontPtrPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontPtrPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImFontPtrPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImFontPtrPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiColorMod.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiColorMod.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiColorMod.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiColorMod.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiColorModPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiColorModPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiColorModPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiColorModPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiComboPreviewData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiComboPreviewData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiComboPreviewData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiComboPreviewData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiComboPreviewDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiComboPreviewDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiComboPreviewDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiComboPreviewDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContext.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContext.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContext.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContext.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextHook.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextHook.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextHook.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextHook.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextHookPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextHookPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextHookPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextHookPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiContextPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiContextPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeInfo.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeInfo.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeInfo.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeInfo.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeInfoPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeInfoPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeInfoPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeInfoPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeTempStorage.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeTempStorage.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDataTypeTempStorage.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDataTypeTempStorage.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockContext.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockContext.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockContext.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockContext.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockContextPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockContextPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockContextPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockContextPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNode.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNode.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNode.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNode.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodeSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodeSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodeSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodeSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodeSettingsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodeSettingsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockNodeSettingsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockNodeSettingsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockRequest.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockRequest.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockRequest.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockRequest.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockRequestPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockRequestPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiDockRequestPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiDockRequestPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiGroupData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiGroupData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiGroupData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiGroupData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiGroupDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiGroupDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiGroupDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiGroupDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiIO.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiIO.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiIO.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiIO.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiIOPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiIOPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiIOPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiIOPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEvent.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEvent.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEvent.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEvent.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventAppFocused.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventAppFocused.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventAppFocused.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventAppFocused.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventKey.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventKey.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventKey.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventKey.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseButton.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseButton.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseButton.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseButton.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMousePos.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMousePos.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMousePos.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMousePos.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseViewport.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseViewport.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseViewport.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseViewport.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseWheel.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseWheel.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventMouseWheel.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventMouseWheel.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventText.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventText.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputEventText.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputEventText.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextCallbackData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextCallbackData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextCallbackData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextCallbackData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextCallbackDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextCallbackDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextCallbackDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextCallbackDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextState.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextState.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextState.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextState.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextStatePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextStatePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiInputTextStatePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiInputTextStatePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiKeyData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiKeyData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiKeyData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiKeyData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiKeyDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiKeyDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiKeyDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiKeyDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiLastItemData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiLastItemData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiLastItemData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiLastItemData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiLastItemDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiLastItemDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiLastItemDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiLastItemDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipper.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipper.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipper.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipper.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperRange.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperRange.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperRange.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperRange.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperRangePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperRangePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiListClipperRangePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiListClipperRangePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMenuColumns.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMenuColumns.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMenuColumns.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMenuColumns.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMenuColumnsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMenuColumnsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMenuColumnsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMenuColumnsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMetricsConfig.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMetricsConfig.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMetricsConfig.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMetricsConfig.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMetricsConfigPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMetricsConfigPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiMetricsConfigPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiMetricsConfigPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNavItemData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNavItemData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNavItemData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNavItemData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNavItemDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNavItemDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNavItemDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNavItemDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextItemData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextItemData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextItemData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextItemData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextItemDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextItemDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextItemDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextItemDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextWindowData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextWindowData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextWindowData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextWindowData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextWindowDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextWindowDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiNextWindowDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiNextWindowDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumns.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumns.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumns.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumns.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOldColumnsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOldColumnsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOnceUponAFrame.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOnceUponAFrame.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOnceUponAFrame.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOnceUponAFrame.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOnceUponAFramePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOnceUponAFramePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiOnceUponAFramePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiOnceUponAFramePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPayload.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPayload.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPayload.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPayload.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPayloadPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPayloadPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPayloadPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPayloadPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformIO.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformIO.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformIO.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformIO.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformIOPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformIOPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformIOPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformIOPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformImeData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformImeData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformImeData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformImeData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformImeDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformImeDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformImeDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformImeDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformMonitor.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformMonitor.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformMonitor.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformMonitor.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformMonitorPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformMonitorPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPlatformMonitorPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPlatformMonitorPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPopupData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPopupData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPopupData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPopupData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPopupDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPopupDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPopupDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPopupDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPtrOrIndex.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPtrOrIndex.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPtrOrIndex.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPtrOrIndex.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPtrOrIndexPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPtrOrIndexPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPtrOrIndexPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiPtrOrIndexPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSettingsHandler.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSettingsHandler.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSettingsHandler.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSettingsHandler.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSettingsHandlerPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSettingsHandlerPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSettingsHandlerPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSettingsHandlerPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiShrinkWidthItem.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiShrinkWidthItem.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiShrinkWidthItem.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiShrinkWidthItem.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiShrinkWidthItemPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiShrinkWidthItemPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiShrinkWidthItemPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiShrinkWidthItemPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSizeCallbackData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSizeCallbackData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiSizeCallbackData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiSizeCallbackData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackLevelInfo.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackLevelInfo.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackLevelInfo.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackLevelInfo.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackLevelInfoPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackLevelInfoPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackLevelInfoPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackLevelInfoPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackSizes.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackSizes.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackSizes.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackSizes.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackSizesPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackSizesPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackSizesPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackSizesPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackTool.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackTool.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackTool.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackTool.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackToolPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackToolPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStackToolPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStackToolPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStorage.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStorage.gen.cs similarity index 98% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStorage.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStorage.gen.cs index 77a14cfe2..dd22118e0 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStorage.gen.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStorage.gen.cs @@ -120,4 +120,5 @@ public unsafe partial struct ImGuiStorage // DISCARDED: GetBoolRef // DISCARDED: GetFloatRef // DISCARDED: GetIntRef +// DISCARDED: GetVoidPtrRef diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePair.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePair.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePair.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePair.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePairPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePairPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePairPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePairPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePtr.gen.cs similarity index 98% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePtr.gen.cs index 91c3d5663..8ce6b61e9 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStoragePtr.gen.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStoragePtr.gen.cs @@ -78,4 +78,5 @@ public unsafe partial struct ImGuiStoragePtr // DISCARDED: GetBoolRef // DISCARDED: GetFloatRef // DISCARDED: GetIntRef +// DISCARDED: GetVoidPtrRef diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyle.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyle.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyle.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyle.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyleMod.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyleMod.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyleMod.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyleMod.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyleModPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyleModPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStyleModPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStyleModPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStylePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStylePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiStylePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiStylePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabBar.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabBar.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabBar.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabBar.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabBarPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabBarPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabBarPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabBarPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabItem.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabItem.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabItem.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabItem.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabItemPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabItemPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTabItemPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTabItemPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTable.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTable.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTable.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTable.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableCellData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableCellData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableCellData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableCellData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableCellDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableCellDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableCellDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableCellDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumn.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumn.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumn.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumn.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSettingsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSettingsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSettingsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSettingsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSortSpecs.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSortSpecs.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSortSpecs.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSortSpecs.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSortSpecsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSortSpecsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnSortSpecsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnSortSpecsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnsSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnsSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableColumnsSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableColumnsSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableInstanceData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableInstanceData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableInstanceData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableInstanceData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableInstanceDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableInstanceDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableInstanceDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableInstanceDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTablePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTablePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTablePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTablePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSettingsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSettingsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSettingsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSettingsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSortSpecs.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSortSpecs.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSortSpecs.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSortSpecs.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSortSpecsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSortSpecsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableSortSpecsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableSortSpecsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableTempData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableTempData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableTempData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableTempData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableTempDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableTempDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTableTempDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTableTempDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextBuffer.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextBuffer.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextBuffer.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextBuffer.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextBufferPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextBufferPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextBufferPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextBufferPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextFilter.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextFilter.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextFilter.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextFilter.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextFilterPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextFilterPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextFilterPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextFilterPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextRange.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextRange.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextRange.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextRange.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextRangePtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextRangePtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiTextRangePtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiTextRangePtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewport.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewport.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewport.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewport.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportP.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportP.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportP.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportP.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPPtrPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPPtrPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPPtrPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPPtrPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPtrPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPtrPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiViewportPtrPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiViewportPtrPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindow.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindow.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindow.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindow.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowClass.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowClass.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowClass.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowClass.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowClassPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowClassPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowClassPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowClassPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowDockStyle.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowDockStyle.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowDockStyle.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowDockStyle.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowPtrPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowPtrPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowPtrPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowPtrPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowSettings.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowSettings.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowSettings.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowSettings.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowSettingsPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowSettingsPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowSettingsPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowSettingsPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowStackData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowStackData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowStackData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowStackData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowStackDataPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowStackDataPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowStackDataPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowStackDataPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowTempData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowTempData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiWindowTempData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImGuiWindowTempData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImPoolImGuiTabBar.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImPoolImGuiTabBar.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImPoolImGuiTabBar.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImPoolImGuiTabBar.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImPoolImGuiTable.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImPoolImGuiTable.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImPoolImGuiTable.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImPoolImGuiTable.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImRect.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImRect.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImRect.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImRect.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImRectPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImRectPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImRectPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImRectPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableCellData.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableCellData.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableCellData.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableCellData.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableColumn.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableColumn.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableColumn.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableColumn.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableColumnIdx.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableColumnIdx.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImSpanImGuiTableColumnIdx.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImSpanImGuiTableColumnIdx.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec1.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec1.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec1.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec1.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec1Ptr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec1Ptr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec1Ptr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec1Ptr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec2Ih.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec2Ih.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec2Ih.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec2Ih.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec2IhPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec2IhPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImVec2IhPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/ImVec2IhPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/STBTexteditState.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/STBTexteditState.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/STBTexteditState.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/STBTexteditState.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbTexteditRow.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbTexteditRow.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbTexteditRow.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbTexteditRow.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbUndoRecord.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbUndoRecord.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbUndoRecord.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbUndoRecord.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbUndoState.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbUndoState.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbUndoState.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbUndoState.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbttPackContext.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbttPackContext.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbttPackContext.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbttPackContext.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbttPackContextPtr.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbttPackContextPtr.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/StbttPackContextPtr.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Generated/Structs/StbttPackContextPtr.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals.Functions.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals.Functions.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiP.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions/ImGuiP.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiP.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions/ImGuiP.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPNative.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions/ImGuiPNative.gen.cs similarity index 100% rename from imgui/Dalamud.Bindings.ImGui/Custom/Generated/ImGuiPNative.gen.cs rename to imgui/Dalamud.Bindings.ImGui/Custom/Generated/Internals/Functions/ImGuiPNative.gen.cs diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions.gen.cs new file mode 100644 index 000000000..aa67c41a1 --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions.gen.cs @@ -0,0 +1,51 @@ +// + +using HexaGen.Runtime; +using System; +using System.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +/* Functions.000.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} +/* Functions.001.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} +/* Functions.002.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} +/* Functions.003.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} +/* Functions.004.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} +/* Functions.005.cs */ +namespace Dalamud.Bindings.ImGui +{ + public unsafe partial class ImGui + { + } +} diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGui.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGui.gen.cs new file mode 100644 index 000000000..02a8e833b --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGui.gen.cs @@ -0,0 +1,27 @@ +// + +using HexaGen.Runtime; +using System; +using System.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Dalamud.Bindings.ImGui; + +public unsafe partial class ImGui +{ +} +// DISCARDED: internal static int DataTypeFormatStringNative(byte* buf, int bufSize, ImGuiDataType dataType, void* pData, byte* format) +// DISCARDED: internal static int ImFormatStringNative(byte* buf, nuint bufSize, byte* fmt) +// DISCARDED: internal static int ImFormatStringVNative(byte* buf, nuint bufSize, byte* fmt, nuint args) +// DISCARDED: internal static byte* ImParseFormatTrimDecorationsNative(byte* format, byte* buf, nuint bufSize) +// DISCARDED: ImParseFormatTrimDecorationsS +// DISCARDED: internal static int ImTextStrFromUtf8Native(ushort* outBuf, int outBufSize, byte* inText, byte* inTextEnd, byte** inRemaining) +// DISCARDED: internal static int ImTextStrToUtf8Native(byte* outBuf, int outBufSize, ushort* inText, ushort* inTextEnd) +// DISCARDED: internal static byte InputTextNative(byte* label, byte* buf, nuint bufSize, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) +// DISCARDED: internal static byte InputTextExNative(byte* label, byte* hint, byte* buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) +// DISCARDED: internal static byte InputTextMultilineNative(byte* label, byte* buf, nuint bufSize, Vector2 size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) +// DISCARDED: internal static byte InputTextWithHintNative(byte* label, byte* hint, byte* buf, nuint bufSize, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) +// DISCARDED: internal static byte TempInputTextNative(ImRect bb, uint id, byte* label, byte* buf, int bufSize, ImGuiInputTextFlags flags) + diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGuiNative.gen.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGuiNative.gen.cs new file mode 100644 index 000000000..92632fb9e --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/Generated/Manual/Functions/ImGuiNative.gen.cs @@ -0,0 +1,92 @@ +// + +using HexaGen.Runtime; +using System; +using System.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Dalamud.Bindings.ImGui; + +public unsafe partial class ImGuiNative +{ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte InputText(byte* label, byte* buf, nuint bufSize, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) + { + + return ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1268])(label, buf, bufSize, flags, (delegate*)Utils.GetFunctionPointerForDelegate(callback), userData); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte InputTextMultiline(byte* label, byte* buf, nuint bufSize, Vector2 size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) + { + + return ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1269])(label, buf, bufSize, size, flags, (delegate*)Utils.GetFunctionPointerForDelegate(callback), userData); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte InputTextWithHint(byte* label, byte* hint, byte* buf, nuint bufSize, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) + { + + return ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1270])(label, hint, buf, bufSize, flags, (delegate*)Utils.GetFunctionPointerForDelegate(callback), userData); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ImFormatString(byte* buf, nuint bufSize, byte* fmt) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1271])(buf, bufSize, fmt); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ImFormatStringV(byte* buf, nuint bufSize, byte* fmt, nuint args) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1272])(buf, bufSize, fmt, args); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte* ImParseFormatTrimDecorations(byte* format, byte* buf, nuint bufSize) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1273])(format, buf, bufSize); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ImTextStrToUtf8(byte* outBuf, int outBufSize, ushort* inText, ushort* inTextEnd) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1274])(outBuf, outBufSize, inText, inTextEnd); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ImTextStrFromUtf8(ushort* outBuf, int outBufSize, byte* inText, byte* inTextEnd, byte** inRemaining) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1275])(outBuf, outBufSize, inText, inTextEnd, inRemaining); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int DataTypeFormatString(byte* buf, int bufSize, ImGuiDataType dataType, void* pData, byte* format) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1276])(buf, bufSize, dataType, pData, format); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte InputTextEx(byte* label, byte* hint, byte* buf, int bufSize, Vector2 sizeArg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) + { + + return ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1277])(label, hint, buf, bufSize, sizeArg, flags, (delegate*)Utils.GetFunctionPointerForDelegate(callback), userData); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte TempInputText(ImRect bb, uint id, byte* label, byte* buf, int bufSize, ImGuiInputTextFlags flags) + { + + return ((delegate* unmanaged[Cdecl])ImGui.funcTable[1278])(bb, id, label, buf, bufSize, flags); + + } +} + diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImDrawList.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImDrawList.Custom.cs index b26774588..97087aa82 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImDrawList.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImDrawList.Custom.cs @@ -4,14 +4,14 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImDrawList { - public void AddText(Vector2 pos, uint col, Utf8Buffer text) + public void AddText(Vector2 pos, uint col, ImU8String text) { fixed (ImDrawList* thisPtr = &this) ImGui.AddText(thisPtr, pos, col, text); } public void AddText( - ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, float wrapWidth, + ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth, scoped in Vector4 cpuFineClipRect) { fixed (ImDrawList* thisPtr = &this) @@ -19,7 +19,7 @@ public unsafe partial struct ImDrawList } public void AddText( - ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, float wrapWidth = 0f) + ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth = 0f) { fixed (ImDrawList* thisPtr = &this) ImGui.AddText(thisPtr, font, fontSize, pos, col, text, wrapWidth); @@ -28,10 +28,10 @@ public unsafe partial struct ImDrawList public partial struct ImDrawListPtr { - public void AddText(Vector2 pos, uint col, Utf8Buffer text) => ImGui.AddText(this, pos, col, text); + public void AddText(Vector2 pos, uint col, ImU8String text) => ImGui.AddText(this, pos, col, text); public void AddText( - ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, float wrapWidth, + ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth, scoped in Vector4 cpuFineClipRect) => ImGui.AddText( this, font, @@ -43,6 +43,6 @@ public partial struct ImDrawListPtr cpuFineClipRect); public void AddText( - ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, float wrapWidth = 0f) => + ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth = 0f) => ImGui.AddText(this, font, fontSize, pos, col, text, wrapWidth); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImFont.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImFont.Custom.cs index 83c86515f..4d0368018 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImFont.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImFont.Custom.cs @@ -10,7 +10,7 @@ public unsafe partial struct ImFont } public readonly void RenderText( - ImDrawListPtr drawList, float size, Vector2 pos, uint col, Vector4 clipRect, Utf8Buffer text, + ImDrawListPtr drawList, float size, Vector2 pos, uint col, Vector4 clipRect, ImU8String text, float wrapWidth = 0.0f, bool cpuFineClip = false) { fixed (ImFont* thisPtr = @@ -20,11 +20,11 @@ public unsafe partial struct ImFont public partial struct ImFontPtr { - public readonly int CalcWordWrapPositionA(float scale, Utf8Buffer text, float wrapWidth) => + public readonly int CalcWordWrapPositionA(float scale, ImU8String text, float wrapWidth) => ImGui.CalcWordWrapPositionA(this, scale, text, wrapWidth); public readonly void RenderText( - ImDrawListPtr drawList, float size, Vector2 pos, uint col, Vector4 clipRect, Utf8Buffer text, + ImDrawListPtr drawList, float size, Vector2 pos, uint col, Vector4 clipRect, ImU8String text, float wrapWidth = 0.0f, bool cpuFineClip = false) => ImGui.RenderText( this, drawList, diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImFontAtlas.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImFontAtlas.Custom.cs index 27c8098bc..f6295ccd5 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImFontAtlas.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImFontAtlas.Custom.cs @@ -3,14 +3,14 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImFontAtlas { public ImFontPtr AddFontFromFileTTF( - Utf8Buffer filename, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) + ImU8String filename, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) { fixed (ImFontAtlas* thisPtr = &this) return ImGui.AddFontFromFileTTF(thisPtr, filename, sizePixels, fontCfg, glyphRanges); } public ImFontPtr AddFontFromMemoryCompressedBase85TTF( - Utf8Buffer compressedFontDatabase85, float sizePixels, ImFontConfigPtr fontCfg = default, + ImU8String compressedFontDatabase85, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) { fixed (ImFontAtlas* thisPtr = &this) @@ -58,11 +58,11 @@ public unsafe partial struct ImFontAtlas public unsafe partial struct ImFontAtlasPtr { public ImFontPtr AddFontFromFileTTF( - Utf8Buffer filename, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) => + ImU8String filename, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) => ImGui.AddFontFromFileTTF(this, filename, sizePixels, fontCfg, glyphRanges); public ImFontPtr AddFontFromMemoryCompressedBase85TTF( - Utf8Buffer compressedFontDatabase85, float sizePixels, ImFontConfigPtr fontCfg = default, + ImU8String compressedFontDatabase85, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) => ImGui.AddFontFromMemoryCompressedBase85TTF(this, compressedFontDatabase85, sizePixels, fontCfg, glyphRanges); diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImFontGlyphRangesBuilder.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImFontGlyphRangesBuilder.Custom.cs index 48e6a8735..196a61c76 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImFontGlyphRangesBuilder.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImFontGlyphRangesBuilder.Custom.cs @@ -2,7 +2,7 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImFontGlyphRangesBuilder { - public void AddText(Utf8Buffer text) + public void AddText(ImU8String text) { fixed (ImFontGlyphRangesBuilder* thisPtr = &this) ImGui.AddText(thisPtr, text); } @@ -10,5 +10,5 @@ public unsafe partial struct ImFontGlyphRangesBuilder public partial struct ImFontGlyphRangesBuilderPtr { - public void AddText(Utf8Buffer text) => ImGui.AddText(this, text); + public void AddText(ImU8String text) => ImGui.AddText(this, text); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ColorEditPicker.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ColorEditPicker.cs index e2a5a8219..655083627 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ColorEditPicker.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ColorEditPicker.cs @@ -7,7 +7,7 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGui { public static bool ColorEdit3( - Utf8Buffer label, scoped ref Vector3 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) + ImU8String label, scoped ref Vector3 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector3* colPtr = &col) @@ -19,7 +19,7 @@ public static unsafe partial class ImGui } public static bool ColorEdit4( - Utf8Buffer label, scoped ref Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) + ImU8String label, scoped ref Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector4* colPtr = &col) @@ -31,7 +31,7 @@ public static unsafe partial class ImGui } public static bool ColorPicker3( - Utf8Buffer label, scoped ref Vector3 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) + ImU8String label, scoped ref Vector3 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector3* colPtr = &col) @@ -43,7 +43,7 @@ public static unsafe partial class ImGui } public static bool ColorPicker4( - Utf8Buffer label, scoped ref Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) + ImU8String label, scoped ref Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector4* colPtr = &col) @@ -55,7 +55,7 @@ public static unsafe partial class ImGui } public static bool ColorPicker4( - Utf8Buffer label, scoped ref Vector4 col, ImGuiColorEditFlags flags, scoped in Vector4 refCol) + ImU8String label, scoped ref Vector4 col, ImGuiColorEditFlags flags, scoped in Vector4 refCol) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector4* colPtr = &col) @@ -67,7 +67,7 @@ public static unsafe partial class ImGui } } - public static bool ColorPicker4(Utf8Buffer label, scoped ref Vector4 col, scoped in Vector4 refCol) + public static bool ColorPicker4(ImU8String label, scoped ref Vector4 col, scoped in Vector4 refCol) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (Vector4* colPtr = &col) diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ComboAndList.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ComboAndList.cs index eaf7fbf11..603019d7d 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ComboAndList.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.ComboAndList.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace Dalamud.Bindings.ImGui; @@ -6,41 +7,92 @@ namespace Dalamud.Bindings.ImGui; [SuppressMessage("ReSharper", "InconsistentNaming")] public static unsafe partial class ImGui { - public delegate bool PopulateAutoUtf8BufferDelegate(int index, out Utf8Buffer outText); + public delegate ImU8String PopulateAutoUtf8BufferDelegate(int index); - public delegate bool PopulateAutoUtf8BufferDelegate(scoped in T context, int index, out Utf8Buffer outText); + public delegate ImU8String PopulateAutoUtf8BufferInContextDelegate(scoped in T context, int index) + where T : allows ref struct; + public delegate ImU8String PopulateAutoUtf8BufferRefContextDelegate(scoped ref T context, int index) + where T : allows ref struct; + + [OverloadResolutionPriority(2)] + public static bool Combo( + ImU8String label, ref int currentItem, ReadOnlySpan items, int popupMaxHeightInItems = -1) => + Combo( + label, + ref currentItem, + static (scoped in ReadOnlySpan items, int index) => items[index], + items, + items.Length, + popupMaxHeightInItems); + + [OverloadResolutionPriority(3)] public static bool Combo( - Utf8Buffer label, ref int currentItem, scoped in T items, int popupMaxHeightInItems = -1) + ImU8String label, ref int currentItem, scoped in T items, int popupMaxHeightInItems = -1) where T : IList => Combo( label, ref currentItem, - static (scoped in T items, int index, out Utf8Buffer outText) => - { - outText = items[index]; - return true; - }, + static (scoped in T items, int index) => items[index], items, items.Count, popupMaxHeightInItems); + [OverloadResolutionPriority(4)] public static bool Combo( - Utf8Buffer label, ref int currentItem, IReadOnlyList items, int popupMaxHeightInItems = -1) => + ImU8String label, ref int currentItem, IReadOnlyList items, int popupMaxHeightInItems = -1) => Combo( label, ref currentItem, - static (scoped in IReadOnlyList items, int index, out Utf8Buffer outText) => - { - outText = items[index]; - return true; - }, + static (scoped in IReadOnlyList items, int index) => items[index], items, items.Count, popupMaxHeightInItems); + [OverloadResolutionPriority(5)] + public static bool Combo( + ImU8String label, ref int currentItem, ReadOnlySpan items, Func toString, + int popupMaxHeightInItems = -1) + { + var tmp = PointerTuple.CreateFixed(ref items, ref toString); + return Combo( + label, + ref currentItem, + static (scoped in PointerTuple, Func> items, int index) => + items.Item2(items.Item1[index]), + tmp, + items.Length, + popupMaxHeightInItems); + } + + [OverloadResolutionPriority(6)] + public static bool Combo( + ImU8String label, ref int currentItem, scoped in TList items, Func toString, + int popupMaxHeightInItems = -1) + where TList : IList => + Combo( + label, + ref currentItem, + static (scoped in (TList, Func) items, int index) => items.Item2(items.Item1[index]), + (items, toString), + items.Count, + popupMaxHeightInItems); + + [OverloadResolutionPriority(7)] + public static bool Combo( + ImU8String label, ref int currentItem, IReadOnlyList items, Func toString, + int popupMaxHeightInItems = -1) => + Combo( + label, + ref currentItem, + static (scoped in (IReadOnlyList, Func) items, int index) => items.Item2(items.Item1[index]), + (items, toString), + items.Count, + popupMaxHeightInItems); + + [OverloadResolutionPriority(1)] public static bool Combo( - Utf8Buffer label, ref int currentItem, Utf8Buffer itemsSeparatedByZeros, int popupMaxHeightInItems = -1) + ImU8String label, ref int currentItem, ImU8String itemsSeparatedByZeros, int popupMaxHeightInItems = -1) { if (!itemsSeparatedByZeros.Span.EndsWith("\0\0"u8)) itemsSeparatedByZeros.AppendFormatted("\0\0"u8); @@ -57,26 +109,51 @@ public static unsafe partial class ImGui } public static bool Combo( - Utf8Buffer label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferInContextDelegate itemsGetter, scoped in TContext context, int itemsCount, int popupMaxHeightInItems = -1) + where TContext : allows ref struct { - Utf8Buffer textBuffer = default; - var dataBuffer = stackalloc void*[3]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (int* currentItemPtr = ¤tItem) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type fixed (TContext* contextPtr = &context) { - dataBuffer[0] = &textBuffer; - dataBuffer[1] = &itemsGetter; - dataBuffer[2] = contextPtr; + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer, contextPtr); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type var r = ImGuiNative.Combo( labelPtr, currentItemPtr, (delegate*, void*, int, int, bool>) - (nint)(delegate* unmanaged)&PopulateUtf8BufferDelegateWithContext, - dataBuffer, + (nint)(delegate* unmanaged)&PopulateUtf8BufferInContextStatic, + &dataBuffer, + itemsCount, + popupMaxHeightInItems) != 0; + label.Dispose(); + textBuffer.Dispose(); + return r; + } + } + + public static bool Combo( + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferRefContextDelegate itemsGetter, + scoped ref TContext context, int itemsCount, int popupMaxHeightInItems = -1) + where TContext : allows ref struct + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (int* currentItemPtr = ¤tItem) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer, contextPtr); +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = ImGuiNative.Combo( + labelPtr, + currentItemPtr, + (delegate*, void*, int, int, bool>) + (nint)(delegate* unmanaged)&PopulateUtf8BufferRefContextStatic, + &dataBuffer, itemsCount, popupMaxHeightInItems) != 0; label.Dispose(); @@ -86,24 +163,22 @@ public static unsafe partial class ImGui } public static bool Combo( - Utf8Buffer label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, int itemsCount, + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, int itemsCount, int popupMaxHeightInItems = -1) { - Utf8Buffer textBuffer = default; - var dataBuffer = stackalloc void*[2]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (int* currentItemPtr = ¤tItem) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type { - dataBuffer[0] = &textBuffer; - dataBuffer[1] = &itemsGetter; + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type var r = ImGuiNative.Combo( labelPtr, currentItemPtr, (delegate*, void*, int, int, bool>) - (nint)(delegate* unmanaged)&PopulateUtf8BufferDelegateWithoutContext, - dataBuffer, + (nint)(delegate* unmanaged)&PopulateUtf8BufferStatic, + &dataBuffer, itemsCount, popupMaxHeightInItems) != 0; label.Dispose(); @@ -112,58 +187,128 @@ public static unsafe partial class ImGui } } - public static bool ListBox( - Utf8Buffer label, ref int currentItem, scoped in T items, int popupMaxHeightInItems = -1) + [OverloadResolutionPriority(2)] + public static bool ListBox( + ImU8String label, ref int currentItem, ReadOnlySpan items, int heightInItems = -1) => + ListBox( + label, + ref currentItem, + static (scoped in ReadOnlySpan items, int index) => items[index], + items, + items.Length, + heightInItems); + + [OverloadResolutionPriority(3)] + public static bool ListBox(ImU8String label, ref int currentItem, scoped in T items, int heightInItems = -1) where T : IList => ListBox( label, ref currentItem, - static (scoped in T items, int index, out Utf8Buffer outText) => - { - outText = items[index]; - return true; - }, + static (scoped in T items, int index) => items[index], items, items.Count, - popupMaxHeightInItems); + heightInItems); + [OverloadResolutionPriority(4)] public static bool ListBox( - Utf8Buffer label, ref int currentItem, IReadOnlyList items, int popupMaxHeightInItems = -1) => + ImU8String label, ref int currentItem, IReadOnlyList items, int heightInItems = -1) => ListBox( label, ref currentItem, - static (scoped in IReadOnlyList items, int index, out Utf8Buffer outText) => - { - outText = items[index]; - return true; - }, + static (scoped in IReadOnlyList items, int index) => items[index], items, items.Count, - popupMaxHeightInItems); + heightInItems); + + [OverloadResolutionPriority(5)] + public static bool ListBox( + ImU8String label, ref int currentItem, ReadOnlySpan items, Func toString, + int heightInItems = -1) + { + var tmp = PointerTuple.CreateFixed(ref items, ref toString); + return ListBox( + label, + ref currentItem, + static (scoped in PointerTuple, Func> items, int index) => + items.Item2(items.Item1[index]), + tmp, + items.Length, + heightInItems); + } + + [OverloadResolutionPriority(6)] + public static bool ListBox( + ImU8String label, ref int currentItem, scoped in TList items, Func toString, + int heightInItems = -1) + where TList : IList => + ListBox( + label, + ref currentItem, + static (scoped in (TList, Func) items, int index) => items.Item2(items.Item1[index]), + (items, toString), + items.Count, + heightInItems); + + [OverloadResolutionPriority(7)] + public static bool ListBox( + ImU8String label, ref int currentItem, IReadOnlyList items, Func toString, + int heightInItems = -1) => + ListBox( + label, + ref currentItem, + static (scoped in (IReadOnlyList, Func) items, int index) => items.Item2(items.Item1[index]), + (items, toString), + items.Count, + heightInItems); public static bool ListBox( - Utf8Buffer label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, - scoped in TContext context, int itemsCount, int popupMaxHeightInItems = -1) + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferRefContextDelegate itemsGetter, + scoped ref TContext context, int itemsCount, int heightInItems = -1) + where TContext : allows ref struct { - Utf8Buffer textBuffer = default; - var dataBuffer = stackalloc void*[3]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (int* currentItemPtr = ¤tItem) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type fixed (TContext* contextPtr = &context) { - dataBuffer[0] = &textBuffer; - dataBuffer[1] = &itemsGetter; - dataBuffer[2] = contextPtr; + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer, contextPtr); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type var r = ImGuiNative.ListBox( labelPtr, currentItemPtr, (delegate*, void*, int, int, bool>) - (nint)(delegate* unmanaged)&PopulateUtf8BufferDelegateWithContext, - dataBuffer, + (nint)(delegate* unmanaged)&PopulateUtf8BufferRefContextStatic, + &dataBuffer, itemsCount, - popupMaxHeightInItems) != 0; + heightInItems) != 0; + label.Dispose(); + textBuffer.Dispose(); + return r; + } + } + + public static bool ListBox( + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferInContextDelegate itemsGetter, + scoped in TContext context, int itemsCount, int heightInItems = -1) + where TContext : allows ref struct + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (int* currentItemPtr = ¤tItem) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer, contextPtr); +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = ImGuiNative.ListBox( + labelPtr, + currentItemPtr, + (delegate*, void*, int, int, bool>) + (nint)(delegate* unmanaged)&PopulateUtf8BufferInContextStatic, + &dataBuffer, + itemsCount, + heightInItems) != 0; label.Dispose(); textBuffer.Dispose(); return r; @@ -171,26 +316,24 @@ public static unsafe partial class ImGui } public static bool ListBox( - Utf8Buffer label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, int itemsCount, - int popupMaxHeightInItems = -1) + ImU8String label, ref int currentItem, PopulateAutoUtf8BufferDelegate itemsGetter, int itemsCount, + int heightInItems = -1) { - Utf8Buffer textBuffer = default; - var dataBuffer = stackalloc void*[2]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (int* currentItemPtr = ¤tItem) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type { - dataBuffer[0] = &textBuffer; - dataBuffer[1] = &itemsGetter; + ImU8String textBuffer = default; + var dataBuffer = PointerTuple.Create(&itemsGetter, &textBuffer); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type var r = ImGuiNative.ListBox( labelPtr, currentItemPtr, (delegate*, void*, int, int, bool>) - (nint)(delegate* unmanaged)&PopulateUtf8BufferDelegateWithoutContext, - dataBuffer, + (nint)(delegate* unmanaged)&PopulateUtf8BufferStatic, + &dataBuffer, itemsCount, - popupMaxHeightInItems) != 0; + heightInItems) != 0; label.Dispose(); textBuffer.Dispose(); return r; @@ -198,25 +341,44 @@ public static unsafe partial class ImGui } [UnmanagedCallersOnly] - private static bool PopulateUtf8BufferDelegateWithContext(void* data, int index, byte** text) + private static bool PopulateUtf8BufferRefContextStatic(void* data, int index, byte** text) { #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type - ref var textBuffer = ref *(Utf8Buffer*)((void**)data)[0]; - return ((PopulateAutoUtf8BufferDelegate*)((void**)data)[1])->Invoke( - *(object*)((void**)data)[2], - index, - out textBuffer); + ref var s = ref PointerTuple.From, ImU8String, object>(data); + s.Item2.Dispose(); + s.Item2 = s.Item1.Invoke(ref s.Item3, index); + if (s.Item2.IsNull) + return false; + *text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0])); + return true; #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type } [UnmanagedCallersOnly] - private static bool PopulateUtf8BufferDelegateWithoutContext(void* data, int index, byte** text) + private static bool PopulateUtf8BufferInContextStatic(void* data, int index, byte** text) { #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type - ref var textBuffer = ref *(Utf8Buffer*)((void**)data)[0]; - return ((PopulateAutoUtf8BufferDelegate*)((void**)data)[1])->Invoke( - index, - out textBuffer); + ref var s = ref PointerTuple.From, ImU8String, object>(data); + s.Item2.Dispose(); + s.Item2 = s.Item1.Invoke(s.Item3, index); + if (s.Item2.IsNull) + return false; + *text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0])); + return true; +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + } + + [UnmanagedCallersOnly] + private static bool PopulateUtf8BufferStatic(void* data, int index, byte** text) + { +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + ref var s = ref PointerTuple.From(data); + s.Item2.Dispose(); + s.Item2 = s.Item1.Invoke(index); + if (s.Item2.IsNull) + return false; + *text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0])); + return true; #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type } } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Custom.cs new file mode 100644 index 000000000..faf6859a3 --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Custom.cs @@ -0,0 +1,69 @@ +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Dalamud.Bindings.ImGui; + +public unsafe partial class ImGui +{ + public static int GetImGuiDataTypeSize(ImGuiDataType dataType) => dataType switch + { + ImGuiDataType.S8 => sizeof(sbyte), + ImGuiDataType.U8 => sizeof(byte), + ImGuiDataType.S16 => sizeof(short), + ImGuiDataType.U16 => sizeof(ushort), + ImGuiDataType.S32 => sizeof(int), + ImGuiDataType.U32 => sizeof(uint), + ImGuiDataType.S64 => sizeof(long), + ImGuiDataType.U64 => sizeof(ulong), + ImGuiDataType.Float => sizeof(float), + ImGuiDataType.Double => sizeof(double), + _ => throw new ArgumentOutOfRangeException(nameof(dataType), dataType, null) + }; + + public static ImGuiDataType GetImGuiDataType(Type type) + { + if (type == typeof(sbyte)) return ImGuiDataType.S8; + if (type == typeof(byte)) return ImGuiDataType.U8; + if (type == typeof(short)) return ImGuiDataType.S16; + if (type == typeof(ushort)) return ImGuiDataType.U16; + if (type == typeof(int)) return ImGuiDataType.S32; + if (type == typeof(uint)) return ImGuiDataType.U32; + if (type == typeof(long)) return ImGuiDataType.S64; + if (type == typeof(ulong)) return ImGuiDataType.U64; + if (type == typeof(float)) return ImGuiDataType.Float; + if (type == typeof(double)) return ImGuiDataType.Double; + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } + + public static ImGuiDataType GetImGuiDataType() => GetImGuiDataType(typeof(T)); + + public static string GetFormatSpecifier(ImGuiDataType dataType) => dataType switch + { + ImGuiDataType.S8 => "%hhd", + ImGuiDataType.U8 => "%hhu", + ImGuiDataType.S16 => "%hd", + ImGuiDataType.U16 => "%hu", + ImGuiDataType.S32 => "%d", + ImGuiDataType.U32 => "%u", + ImGuiDataType.S64 => "%I64d", + ImGuiDataType.U64 => "%I64u", + ImGuiDataType.Float => "%f", + ImGuiDataType.Double => "%lf", + _ => throw new ArgumentOutOfRangeException(nameof(dataType), dataType, null) + }; + + public static ReadOnlySpan GetFormatSpecifierU8(ImGuiDataType dataType) => dataType switch + { + ImGuiDataType.S8 => "%hhd"u8, + ImGuiDataType.U8 => "%hhu"u8, + ImGuiDataType.S16 => "%hd"u8, + ImGuiDataType.U16 => "%hu"u8, + ImGuiDataType.S32 => "%d"u8, + ImGuiDataType.U32 => "%u"u8, + ImGuiDataType.S64 => "%I64d"u8, + ImGuiDataType.U64 => "%I64u"u8, + ImGuiDataType.Float => "%f"u8, + ImGuiDataType.Double => "%lf"u8, + _ => throw new ArgumentOutOfRangeException(nameof(dataType), dataType, null) + }; +} diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.DragScalar.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.DragScalar.cs index d039fda31..a0d929ec8 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.DragScalar.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.DragScalar.cs @@ -8,8 +8,8 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGui { public static bool DragSByte( - Utf8Buffer label, scoped ref sbyte v, float vSpeed = 1.0f, sbyte vMin = 0, sbyte vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, scoped ref sbyte v, float vSpeed = 1.0f, sbyte vMin = 0, sbyte vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S8, ref v, @@ -20,8 +20,8 @@ public static unsafe partial class ImGui flags); public static bool DragSByte( - Utf8Buffer label, Span v, float vSpeed = 1.0f, sbyte vMin = 0, sbyte vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, Span v, float vSpeed = 1.0f, sbyte vMin = 0, sbyte vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S8, v, @@ -32,8 +32,8 @@ public static unsafe partial class ImGui flags); public static bool DragByte( - Utf8Buffer label, scoped ref byte v, float vSpeed = 1.0f, byte vMin = 0, byte vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, scoped ref byte v, float vSpeed = 1.0f, byte vMin = 0, byte vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U8, ref v, @@ -44,8 +44,8 @@ public static unsafe partial class ImGui flags); public static bool DragByte( - Utf8Buffer label, Span v, float vSpeed = 1.0f, byte vMin = 0, byte vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, Span v, float vSpeed = 1.0f, byte vMin = 0, byte vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U8, v, @@ -56,8 +56,8 @@ public static unsafe partial class ImGui flags); public static bool DragShort( - Utf8Buffer label, scoped ref short v, float vSpeed = 1.0f, short vMin = 0, short vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, scoped ref short v, float vSpeed = 1.0f, short vMin = 0, short vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S16, ref v, @@ -68,8 +68,8 @@ public static unsafe partial class ImGui flags); public static bool DragShort( - Utf8Buffer label, Span v, float vSpeed = 1.0f, short vMin = 0, short vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, Span v, float vSpeed = 1.0f, short vMin = 0, short vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S16, v, @@ -80,8 +80,8 @@ public static unsafe partial class ImGui flags); public static bool DragUShort( - Utf8Buffer label, scoped ref ushort v, float vSpeed = 1.0f, ushort vMin = 0, ushort vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, scoped ref ushort v, float vSpeed = 1.0f, ushort vMin = 0, ushort vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U16, ref v, @@ -92,8 +92,8 @@ public static unsafe partial class ImGui flags); public static bool DragUShort( - Utf8Buffer label, Span v, float vSpeed = 1.0f, ushort vMin = 0, ushort vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, Span v, float vSpeed = 1.0f, ushort vMin = 0, ushort vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U16, v, @@ -104,8 +104,8 @@ public static unsafe partial class ImGui flags); public static bool DragInt( - Utf8Buffer label, scoped ref int v, float vSpeed = 1.0f, int vMin = 0, int vMax = 0, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( + ImU8String label, scoped ref int v, float vSpeed = 1.0f, int vMin = 0, int vMax = 0, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S32, ref v, @@ -116,8 +116,8 @@ public static unsafe partial class ImGui flags); public static bool DragInt( - Utf8Buffer label, Span v, float vSpeed = 1.0f, int vMin = 0, - int vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, int vMin = 0, + int vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S32, @@ -129,8 +129,8 @@ public static unsafe partial class ImGui flags); public static bool DragUInt( - Utf8Buffer label, scoped ref uint v, float vSpeed = 1.0f, uint vMin = 0, - uint vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref uint v, float vSpeed = 1.0f, uint vMin = 0, + uint vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U32, @@ -142,8 +142,8 @@ public static unsafe partial class ImGui flags); public static bool DragUInt( - Utf8Buffer label, Span v, float vSpeed = 1.0f, uint vMin = 0, - uint vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, uint vMin = 0, + uint vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U32, @@ -155,8 +155,8 @@ public static unsafe partial class ImGui flags); public static bool DragLong( - Utf8Buffer label, scoped ref long v, float vSpeed = 1.0f, long vMin = 0, - long vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref long v, float vSpeed = 1.0f, long vMin = 0, + long vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S64, @@ -168,8 +168,8 @@ public static unsafe partial class ImGui flags); public static bool DragLong( - Utf8Buffer label, Span v, float vSpeed = 1.0f, long vMin = 0, - long vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, long vMin = 0, + long vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.S64, @@ -181,8 +181,8 @@ public static unsafe partial class ImGui flags); public static bool DragULong( - Utf8Buffer label, scoped ref ulong v, float vSpeed = 1.0f, - ulong vMin = 0, ulong vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref ulong v, float vSpeed = 1.0f, + ulong vMin = 0, ulong vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U64, @@ -194,8 +194,8 @@ public static unsafe partial class ImGui flags); public static bool DragULong( - Utf8Buffer label, Span v, float vSpeed = 1.0f, ulong vMin = 0, - ulong vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, ulong vMin = 0, + ulong vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.U64, @@ -207,8 +207,8 @@ public static unsafe partial class ImGui flags); public static bool DragFloat( - Utf8Buffer label, scoped ref float v, float vSpeed = 1.0f, - float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref float v, float vSpeed = 1.0f, + float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Float, @@ -220,8 +220,8 @@ public static unsafe partial class ImGui flags); public static bool DragFloat( - Utf8Buffer label, Span v, float vSpeed = 1.0f, float vMin = 0.0f, - float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, float vMin = 0.0f, + float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Float, @@ -233,8 +233,8 @@ public static unsafe partial class ImGui flags); public static bool DragFloat2( - Utf8Buffer label, scoped ref Vector2 v, float vSpeed = 1.0f, - float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref Vector2 v, float vSpeed = 1.0f, + float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Float, @@ -246,8 +246,8 @@ public static unsafe partial class ImGui flags); public static bool DragFloat3( - Utf8Buffer label, scoped ref Vector3 v, float vSpeed = 1.0f, - float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref Vector3 v, float vSpeed = 1.0f, + float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Float, @@ -259,8 +259,8 @@ public static unsafe partial class ImGui flags); public static bool DragFloat4( - Utf8Buffer label, scoped ref Vector4 v, float vSpeed = 1.0f, - float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref Vector4 v, float vSpeed = 1.0f, + float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Float, @@ -272,8 +272,8 @@ public static unsafe partial class ImGui flags); public static bool DragDouble( - Utf8Buffer label, scoped ref double v, float vSpeed = 1.0f, - double vMin = 0.0f, double vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref double v, float vSpeed = 1.0f, + double vMin = 0.0f, double vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Double, @@ -285,8 +285,8 @@ public static unsafe partial class ImGui flags); public static bool DragDouble( - Utf8Buffer label, Span v, float vSpeed = 1.0f, - double vMin = 0.0f, double vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, Span v, float vSpeed = 1.0f, + double vMin = 0.0f, double vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar( label, ImGuiDataType.Double, @@ -298,8 +298,8 @@ public static unsafe partial class ImGui flags); public static bool DragScalar( - Utf8Buffer label, ImGuiDataType dataType, scoped ref T v, float vSpeed, - scoped in T vMin, scoped in T vMax, Utf8Buffer format = default, + ImU8String label, ImGuiDataType dataType, scoped ref T v, float vSpeed, + scoped in T vMin, scoped in T vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) where T : unmanaged, INumber, IBinaryNumber { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -316,8 +316,8 @@ public static unsafe partial class ImGui } public static bool DragScalar( - Utf8Buffer label, ImGuiDataType dataType, Span v, float vSpeed, - scoped in T vMin, scoped in T vMax, Utf8Buffer format = default, + ImU8String label, ImGuiDataType dataType, Span v, float vSpeed, + scoped in T vMin, scoped in T vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) where T : unmanaged, INumber, IBinaryNumber { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -343,10 +343,10 @@ public static unsafe partial class ImGui } public static bool DragFloatRange2( - Utf8Buffer label, scoped ref float vCurrentMin, + ImU8String label, scoped ref float vCurrentMin, scoped ref float vCurrentMax, float vSpeed = 1.0f, float vMin = 0.0f, float vMax = 0.0f, - Utf8Buffer format = default, - Utf8Buffer formatMax = default, + ImU8String format = default, + ImU8String formatMax = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -373,10 +373,10 @@ public static unsafe partial class ImGui } public static bool DragIntRange2( - Utf8Buffer label, scoped ref int vCurrentMin, + ImU8String label, scoped ref int vCurrentMin, scoped ref int vCurrentMax, float vSpeed = 1.0f, int vMin = 0, int vMax = 0, - Utf8Buffer format = default, - Utf8Buffer formatMax = default, + ImU8String format = default, + ImU8String formatMax = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.InputScalar.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.InputScalar.cs index fe9016e9d..1f8bef6ed 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.InputScalar.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.InputScalar.cs @@ -8,8 +8,8 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGui { public static bool InputSByte( - Utf8Buffer label, scoped ref sbyte data, sbyte step = 0, sbyte stepFast = 0, - Utf8Buffer format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( + ImU8String label, scoped ref sbyte data, sbyte step = 0, sbyte stepFast = 0, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S8, ref data, @@ -19,7 +19,7 @@ public static unsafe partial class ImGui flags); public static bool InputSByte( - Utf8Buffer label, Span data, sbyte step = 0, sbyte stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, sbyte step = 0, sbyte stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S8, @@ -30,7 +30,7 @@ public static unsafe partial class ImGui flags); public static bool InputByte( - Utf8Buffer label, scoped ref byte data, byte step = 0, byte stepFast = 0, Utf8Buffer format = default, + ImU8String label, scoped ref byte data, byte step = 0, byte stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U8, @@ -41,7 +41,7 @@ public static unsafe partial class ImGui flags); public static bool InputByte( - Utf8Buffer label, Span data, byte step = 0, byte stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, byte step = 0, byte stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U8, @@ -52,8 +52,8 @@ public static unsafe partial class ImGui flags); public static bool InputShort( - Utf8Buffer label, scoped ref short data, short step = 0, short stepFast = 0, - Utf8Buffer format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( + ImU8String label, scoped ref short data, short step = 0, short stepFast = 0, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S16, ref data, @@ -63,7 +63,7 @@ public static unsafe partial class ImGui flags); public static bool InputShort( - Utf8Buffer label, Span data, short step = 0, short stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, short step = 0, short stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S16, @@ -74,8 +74,8 @@ public static unsafe partial class ImGui flags); public static bool InputUShort( - Utf8Buffer label, scoped ref ushort data, ushort step = 0, ushort stepFast = 0, - Utf8Buffer format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( + ImU8String label, scoped ref ushort data, ushort step = 0, ushort stepFast = 0, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U16, ref data, @@ -85,7 +85,7 @@ public static unsafe partial class ImGui flags); public static bool InputUShort( - Utf8Buffer label, Span data, ushort step = 0, ushort stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, ushort step = 0, ushort stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U16, @@ -96,7 +96,7 @@ public static unsafe partial class ImGui flags); public static bool InputInt( - Utf8Buffer label, scoped ref int data, int step = 0, int stepFast = 0, Utf8Buffer format = default, + ImU8String label, scoped ref int data, int step = 0, int stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S32, @@ -107,7 +107,7 @@ public static unsafe partial class ImGui flags); public static bool InputInt( - Utf8Buffer label, Span data, int step = 0, int stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, int step = 0, int stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S32, @@ -118,7 +118,7 @@ public static unsafe partial class ImGui flags); public static bool InputUInt( - Utf8Buffer label, scoped ref uint data, uint step = 0, uint stepFast = 0, Utf8Buffer format = default, + ImU8String label, scoped ref uint data, uint step = 0, uint stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U32, @@ -129,7 +129,7 @@ public static unsafe partial class ImGui flags); public static bool InputUInt( - Utf8Buffer label, Span data, uint step = 0, uint stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, uint step = 0, uint stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U32, @@ -140,7 +140,7 @@ public static unsafe partial class ImGui flags); public static bool InputLong( - Utf8Buffer label, scoped ref long data, long step = 0, long stepFast = 0, Utf8Buffer format = default, + ImU8String label, scoped ref long data, long step = 0, long stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S64, @@ -151,7 +151,7 @@ public static unsafe partial class ImGui flags); public static bool InputLong( - Utf8Buffer label, Span data, long step = 0, long stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, long step = 0, long stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.S64, @@ -162,8 +162,8 @@ public static unsafe partial class ImGui flags); public static bool InputULong( - Utf8Buffer label, scoped ref ulong data, ulong step = 0, ulong stepFast = 0, - Utf8Buffer format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( + ImU8String label, scoped ref ulong data, ulong step = 0, ulong stepFast = 0, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U64, ref data, @@ -173,7 +173,7 @@ public static unsafe partial class ImGui flags); public static bool InputULong( - Utf8Buffer label, Span data, ulong step = 0, ulong stepFast = 0, Utf8Buffer format = default, + ImU8String label, Span data, ulong step = 0, ulong stepFast = 0, ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, ImGuiDataType.U64, @@ -184,23 +184,23 @@ public static unsafe partial class ImGui flags); public static bool InputFloat( - Utf8Buffer label, scoped ref float data, float step = 0.0f, + ImU8String label, scoped ref float data, float step = 0.0f, float stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar(label, ImGuiDataType.Float, ref data, step, stepFast, format.MoveOrDefault("%.3f"u8), flags); public static bool InputFloat( - Utf8Buffer label, Span data, float step = 0.0f, + ImU8String label, Span data, float step = 0.0f, float stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar(label, ImGuiDataType.Float, data, step, stepFast, format.MoveOrDefault("%.3f"u8), flags); public static bool InputFloat2( - Utf8Buffer label, scoped ref Vector2 data, float step = 0.0f, + ImU8String label, scoped ref Vector2 data, float step = 0.0f, float stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, @@ -212,9 +212,9 @@ public static unsafe partial class ImGui flags); public static bool InputFloat3( - Utf8Buffer label, scoped ref Vector3 data, float step = 0.0f, + ImU8String label, scoped ref Vector3 data, float step = 0.0f, float stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, @@ -226,9 +226,9 @@ public static unsafe partial class ImGui flags); public static bool InputFloat4( - Utf8Buffer label, scoped ref Vector4 data, float step = 0.0f, + ImU8String label, scoped ref Vector4 data, float step = 0.0f, float stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar( label, @@ -240,23 +240,23 @@ public static unsafe partial class ImGui flags); public static bool InputDouble( - Utf8Buffer label, scoped ref double data, double step = 0.0f, + ImU8String label, scoped ref double data, double step = 0.0f, double stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar(label, ImGuiDataType.Double, ref data, step, stepFast, format.MoveOrDefault("%.3f"u8), flags); public static bool InputDouble( - Utf8Buffer label, Span data, double step = 0.0f, + ImU8String label, Span data, double step = 0.0f, double stepFast = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) => InputScalar(label, ImGuiDataType.Double, data, step, stepFast, format.MoveOrDefault("%.3f"u8), flags); public static bool InputScalar( - Utf8Buffer label, ImGuiDataType dataType, scoped ref T data, + ImU8String label, ImGuiDataType dataType, scoped ref T data, scoped in T step, scoped in T stepFast, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) where T : unmanaged, IBinaryNumber { @@ -281,9 +281,9 @@ public static unsafe partial class ImGui } public static bool InputScalar( - Utf8Buffer label, ImGuiDataType dataType, Span data, + ImU8String label, ImGuiDataType dataType, Span data, scoped in T step, scoped in T stepFast, - Utf8Buffer format = default, + ImU8String format = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) where T : unmanaged, INumber, IBinaryNumber { diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Manual.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Manual.cs new file mode 100644 index 000000000..376b5cafc --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Manual.cs @@ -0,0 +1,468 @@ +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace Dalamud.Bindings.ImGui; + +public unsafe partial class ImGui +{ + public static Span DataTypeFormatString( + Span buf, ImGuiDataType dataType, T data, ImU8String format = default) + where T : unmanaged, IBinaryNumber + { + if (format.IsEmpty) + format = GetFormatSpecifierU8(dataType); + + if (sizeof(T) != GetImGuiDataTypeSize(dataType)) + { + throw new ArgumentOutOfRangeException( + nameof(dataType), + dataType, + $"Type indicated by {nameof(dataType)} does not match the type of {nameof(data)}."); + } + + fixed (byte* bufPtr = buf) + fixed (byte* formatPtr = &format.GetPinnableNullTerminatedReference()) + { + var len = ImGuiNative.DataTypeFormatString(bufPtr, buf.Length, dataType, &data, formatPtr); + format.Dispose(); + return buf[..len]; + } + } + + public static Span DataTypeFormatString(Span buf, T data, ImU8String format = default) + where T : unmanaged, IBinaryNumber => DataTypeFormatString(buf, GetImGuiDataType(), data, format); + + public static Span ImParseFormatTrimDecorations(ImU8String format, Span buf) + { + fixed (byte* formatPtr = &format.GetPinnableNullTerminatedReference()) + fixed (byte* bufPtr = buf) + ImGuiNative.ImParseFormatTrimDecorations(formatPtr, bufPtr, (nuint)buf.Length); + format.Dispose(); + var nul = buf.IndexOf((byte)0); + return nul == -1 ? buf : buf[..nul]; + } + + public static int ImTextStrFromUtf8( + Span outBuf, ReadOnlySpan inText, out ReadOnlySpan inRemaining) + { + fixed (char* outBufPtr = outBuf) + fixed (byte* inTextPtr = inText) + { + byte* inRemainingPtr; + var r = ImGuiNative.ImTextStrFromUtf8( + (ushort*)outBufPtr, + outBuf.Length, + inTextPtr, + inTextPtr + inText.Length, + &inRemainingPtr); + inRemaining = inText[(int)(inRemainingPtr - inTextPtr)..]; + return r; + } + } + + public static Span ImTextStrToUtf8(Span outBuf, ReadOnlySpan inText) + { + fixed (byte* outBufPtr = outBuf) + fixed (char* inTextPtr = inText) + { + return outBuf[..ImGuiNative.ImTextStrToUtf8( + outBufPtr, + outBuf.Length, + (ushort*)inTextPtr, + (ushort*)inTextPtr + inText.Length)]; + } + } + + public delegate int ImGuiInputTextCallbackDelegate(scoped ref ImGuiInputTextCallbackData data); + + public delegate int ImGuiInputTextCallbackRefContextDelegate( + scoped ref ImGuiInputTextCallbackData data, scoped ref TContext context); + + public delegate int ImGuiInputTextCallbackInContextDelegate( + scoped ref ImGuiInputTextCallbackData data, scoped in TContext context); + + public static bool InputText( + ImU8String label, Span buf, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, default, buf, default, flags, callback); + } + + public static bool InputText( + ImU8String label, Span buf, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, default, buf, default, flags, callback, ref context); + } + + public static bool InputText( + ImU8String label, Span buf, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, default, buf, default, flags, callback, in context); + } + + public static bool InputText( + ImU8String label, scoped ref string buf, int maxLength = ImU8String.AllocFreeBufferSize, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputText( + ImU8String label, scoped ref string buf, int maxLength, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback, ref context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputText( + ImU8String label, scoped ref string buf, int maxLength, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback, in context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, Span buf, Vector2 sizeArg = default, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, ImGuiInputTextCallbackDelegate? callback = null) + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* hintPtr = &hint.GetPinnableNullTerminatedReference()) + fixed (byte* bufPtr = buf) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + { + var dataBuffer = PointerTuple.Create(&callback); +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = + ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1277])( + labelPtr, + hintPtr, + bufPtr, + buf.Length, + sizeArg, + flags, + callback == null ? null : &InputTextCallbackStatic, + callback == null ? null : &dataBuffer) != 0; + label.Dispose(); + hint.Dispose(); + return r; + } + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, Span buf, Vector2 sizeArg, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* hintPtr = &hint.GetPinnableNullTerminatedReference()) + fixed (byte* bufPtr = buf) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + var dataBuffer = PointerTuple.Create(&callback, contextPtr); +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = + ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1277])( + labelPtr, + hintPtr, + bufPtr, + buf.Length, + sizeArg, + flags, + &InputTextCallbackRefContextStatic, + &dataBuffer) != 0; + label.Dispose(); + hint.Dispose(); + return r; + } + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, Span buf, Vector2 sizeArg, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* hintPtr = &hint.GetPinnableNullTerminatedReference()) + fixed (byte* bufPtr = buf) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + var dataBuffer = PointerTuple.Create(&callback, contextPtr); +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = + ((delegate* unmanaged[Cdecl], void*, byte>)ImGui.funcTable[1277])( + labelPtr, + hintPtr, + bufPtr, + buf.Length, + sizeArg, + flags, + &InputTextCallbackInContextStatic, + &dataBuffer) != 0; + label.Dispose(); + hint.Dispose(); + return r; + } + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength = ImU8String.AllocFreeBufferSize, + Vector2 sizeArg = default, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength, Vector2 sizeArg, + ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback, ref context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextEx( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength, Vector2 sizeArg, + ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback, in context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextMultiline( + ImU8String label, Span buf, Vector2 size = default, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) => + InputTextEx( + label, + default, + buf, + size, + flags | (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline, + callback); + + public static bool InputTextMultiline( + ImU8String label, Span buf, Vector2 size, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) => + InputTextEx( + label, + default, + buf, + size, + flags | (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline, + callback, + ref context); + + public static bool InputTextMultiline( + ImU8String label, Span buf, Vector2 size, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) => + InputTextEx( + label, + default, + buf, + size, + flags | (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline, + callback, + in context); + + public static bool InputTextMultiline( + ImU8String label, scoped ref string buf, int maxLength = ImU8String.AllocFreeBufferSize, Vector2 size = default, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextMultiline( + ImU8String label, scoped ref string buf, int maxLength, Vector2 size, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback, ref context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextMultiline( + ImU8String label, scoped ref string buf, int maxLength, Vector2 size, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback, in context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, Span buf, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, hint, buf, default, flags, callback); + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, Span buf, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, hint, buf, default, flags, callback, ref context); + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, Span buf, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + if ((flags & (ImGuiInputTextFlags)ImGuiInputTextFlagsPrivate.Multiline) != ImGuiInputTextFlags.None) + throw new ArgumentOutOfRangeException(nameof(flags), flags, "Multiline must not be set"); + return InputTextEx(label, hint, buf, default, flags, callback, in context); + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength = ImU8String.AllocFreeBufferSize, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None, + ImGuiInputTextCallbackDelegate? callback = null) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackRefContextDelegate callback, scoped ref TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback, ref context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool InputTextWithHint( + ImU8String label, ImU8String hint, scoped ref string buf, int maxLength, ImGuiInputTextFlags flags, + ImGuiInputTextCallbackInContextDelegate callback, scoped in TContext context) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback, in context); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + public static bool TempInputText( + ImRect bb, uint id, ImU8String label, Span buf, ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* bufPtr = buf) + { + var r = ImGuiNative.TempInputText(bb, id, labelPtr, bufPtr, buf.Length, flags) != 0; + label.Dispose(); + return r; + } + } + + public static bool TempInputText( + ImRect bb, uint id, ImU8String label, scoped ref string buf, int maxLength = ImU8String.AllocFreeBufferSize, + ImGuiInputTextFlags flags = ImGuiInputTextFlags.None) + { + var t = new ImU8String(buf); + t.Reserve(maxLength + 1); + var r = TempInputText(bb, id, label, t.Buffer[..(maxLength + 1)], flags); + var i = t.Buffer.IndexOf((byte)0); + buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]); + t.Dispose(); + return r; + } + + [UnmanagedCallersOnly] + private static int InputTextCallbackStatic(ImGuiInputTextCallbackData* data) + { + ref var dvps = ref PointerTuple.From(data->UserData); + return dvps.Item1.Invoke(ref *data); + } + + [UnmanagedCallersOnly] + private static int InputTextCallbackRefContextStatic(ImGuiInputTextCallbackData* data) + { + ref var dvps = ref PointerTuple.From, object>(data->UserData); + return dvps.Item1.Invoke(ref *data, ref dvps.Item2); + } + + [UnmanagedCallersOnly] + private static int InputTextCallbackInContextStatic(ImGuiInputTextCallbackData* data) + { + ref var dvps = ref PointerTuple.From, object>(data->UserData); + return dvps.Item1.Invoke(ref *data, in dvps.Item2); + } +} diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Misc.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Misc.cs index 457f27bcf..a2a138626 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Misc.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Misc.cs @@ -7,7 +7,7 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGui { public static ImGuiPayloadPtr AcceptDragDropPayload( - Utf8Buffer type, ImGuiDragDropFlags flags = ImGuiDragDropFlags.None) + ImU8String type, ImGuiDragDropFlags flags = ImGuiDragDropFlags.None) { fixed (byte* typePtr = &type.GetPinnableNullTerminatedReference()) { @@ -18,7 +18,7 @@ public static unsafe partial class ImGui } public static ImFontPtr AddFontFromFileTTF( - ImFontAtlasPtr self, Utf8Buffer filename, float sizePixels, ImFontConfigPtr fontCfg = default, + ImFontAtlasPtr self, ImU8String filename, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) { fixed (byte* filenamePtr = &filename.GetPinnableNullTerminatedReference()) @@ -30,7 +30,7 @@ public static unsafe partial class ImGui } public static ImFontPtr AddFontFromMemoryCompressedBase85TTF( - ImFontAtlasPtr self, Utf8Buffer compressedFontDatabase85, float sizePixels, + ImFontAtlasPtr self, ImU8String compressedFontDatabase85, float sizePixels, ImFontConfigPtr fontCfg = default, ushort* glyphRanges = null) { fixed (byte* compressedFontDatabase85Ptr = &compressedFontDatabase85.GetPinnableNullTerminatedReference()) @@ -76,7 +76,7 @@ public static unsafe partial class ImGui public static void AddInputCharacter(ImGuiIOPtr self, char c) => ImGuiNative.AddInputCharacter(self, c); public static void AddInputCharacter(ImGuiIOPtr self, Rune c) => ImGuiNative.AddInputCharacter(self, (uint)c.Value); - public static void AddInputCharacters(ImGuiIOPtr self, Utf8Buffer str) + public static void AddInputCharacters(ImGuiIOPtr self, ImU8String str) { fixed (byte* strPtr = &str.GetPinnableNullTerminatedReference()) ImGuiNative.AddInputCharactersUTF8(self.Handle, strPtr); @@ -104,7 +104,7 @@ public static unsafe partial class ImGui return ref *(T*)ImGuiNative.GetVoidPtrRef(self.Handle, key, *(void**)&defaultValue); } - public static uint GetID(Utf8Buffer strId) + public static uint GetID(ImU8String strId) { fixed (byte* strIdPtr = strId.Span) { @@ -118,7 +118,7 @@ public static unsafe partial class ImGui public static uint GetID(nuint ptrId) => ImGuiNative.GetID((void*)ptrId); public static uint GetID(void* ptrId) => ImGuiNative.GetID(ptrId); - public static void PushID(Utf8Buffer strId) + public static void PushID(ImU8String strId) { fixed (byte* strIdPtr = strId.Span) { diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Plot.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Plot.cs index 3e715cc1e..69b3b7dbe 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Plot.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Plot.cs @@ -9,10 +9,12 @@ public static unsafe partial class ImGui { public delegate float GetFloatDelegate(int index); - public delegate float GetFloatDelegate(scoped in T context, int index); + public delegate float GetFloatInContextDelegate(scoped in T context, int index) where T : allows ref struct; + + public delegate float GetFloatRefContextDelegate(scoped ref T context, int index) where T : allows ref struct; public static void PlotHistogram( - Utf8Buffer label, ReadOnlySpan values, int valuesOffset = 0, Utf8Buffer overlayText = default, + ImU8String label, ReadOnlySpan values, int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default, int stride = sizeof(float)) { @@ -37,8 +39,9 @@ public static unsafe partial class ImGui } public static void PlotHistogram( - Utf8Buffer label, GetFloatDelegate valuesGetter, scoped in TContext context, int valuesCount, - int valuesOffset = 0, Utf8Buffer overlayText = default, float scaleMin = float.MaxValue, + ImU8String label, GetFloatRefContextDelegate valuesGetter, scoped ref TContext context, + int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default) { var dataBuffer = stackalloc void*[2]; @@ -53,7 +56,38 @@ public static unsafe partial class ImGui ImGuiNative.PlotHistogram( labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithContext, + (nint)(delegate* unmanaged)&GetFloatRefContextStatic, + dataBuffer, + valuesCount, + valuesOffset, + overlayTextPtr, + scaleMin, + scaleMax, + graphSize); + } + + label.Dispose(); + overlayText.Dispose(); + } + + public static void PlotHistogram( + ImU8String label, GetFloatInContextDelegate valuesGetter, scoped in TContext context, int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, + float scaleMax = float.MaxValue, Vector2 graphSize = default) + { + var dataBuffer = stackalloc void*[2]; + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* overlayTextPtr = &overlayText.GetPinnableNullTerminatedReference()) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + dataBuffer[0] = &valuesGetter; + dataBuffer[1] = contextPtr; +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + ImGuiNative.PlotHistogram( + labelPtr, + (delegate*, void*, int, int, byte*, float, float, Vector2, float>) + (nint)(delegate* unmanaged)&GetFloatInContextStatic, dataBuffer, valuesCount, valuesOffset, @@ -68,8 +102,8 @@ public static unsafe partial class ImGui } public static void PlotHistogram( - Utf8Buffer label, GetFloatDelegate valuesGetter, int valuesCount, - int valuesOffset = 0, Utf8Buffer overlayText = default, float scaleMin = float.MaxValue, + ImU8String label, GetFloatDelegate valuesGetter, int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default) { var dataBuffer = stackalloc void*[1]; @@ -82,7 +116,7 @@ public static unsafe partial class ImGui ImGuiNative.PlotHistogram( labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithContext, + (nint)(delegate* unmanaged)&GetFloatStatic, dataBuffer, valuesCount, valuesOffset, @@ -97,7 +131,7 @@ public static unsafe partial class ImGui } public static void PlotLines( - Utf8Buffer label, ReadOnlySpan values, int valuesOffset = 0, Utf8Buffer overlayText = default, + ImU8String label, ReadOnlySpan values, int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default, int stride = sizeof(float)) { @@ -122,8 +156,8 @@ public static unsafe partial class ImGui } public static void PlotLines( - Utf8Buffer label, GetFloatDelegate valuesGetter, scoped in TContext context, int valuesCount, - int valuesOffset = 0, Utf8Buffer overlayText = default, float scaleMin = float.MaxValue, + ImU8String label, GetFloatInContextDelegate valuesGetter, scoped in TContext context, int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default) { var dataBuffer = stackalloc void*[2]; @@ -138,7 +172,39 @@ public static unsafe partial class ImGui ImGuiNative.PlotLines( labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithContext, + (nint)(delegate* unmanaged)&GetFloatInContextStatic, + dataBuffer, + valuesCount, + valuesOffset, + overlayTextPtr, + scaleMin, + scaleMax, + graphSize); + } + + label.Dispose(); + overlayText.Dispose(); + } + + public static void PlotLines( + ImU8String label, GetFloatRefContextDelegate valuesGetter, scoped in TContext context, + int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, + float scaleMax = float.MaxValue, Vector2 graphSize = default) + { + var dataBuffer = stackalloc void*[2]; + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* overlayTextPtr = &overlayText.GetPinnableNullTerminatedReference()) +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + fixed (TContext* contextPtr = &context) + { + dataBuffer[0] = &valuesGetter; + dataBuffer[1] = contextPtr; +#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + ImGuiNative.PlotLines( + labelPtr, + (delegate*, void*, int, int, byte*, float, float, Vector2, float>) + (nint)(delegate* unmanaged)&GetFloatRefContextStatic, dataBuffer, valuesCount, valuesOffset, @@ -153,8 +219,8 @@ public static unsafe partial class ImGui } public static void PlotLines( - Utf8Buffer label, GetFloatDelegate valuesGetter, int valuesCount, - int valuesOffset = 0, Utf8Buffer overlayText = default, float scaleMin = float.MaxValue, + ImU8String label, GetFloatDelegate valuesGetter, int valuesCount, + int valuesOffset = 0, ImU8String overlayText = default, float scaleMin = float.MaxValue, float scaleMax = float.MaxValue, Vector2 graphSize = default) { var dataBuffer = stackalloc void*[1]; @@ -167,7 +233,7 @@ public static unsafe partial class ImGui ImGuiNative.PlotLines( labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithContext, + (nint)(delegate* unmanaged)&GetFloatStatic, dataBuffer, valuesCount, valuesOffset, @@ -183,11 +249,20 @@ public static unsafe partial class ImGui #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type [UnmanagedCallersOnly] - private static float GetFloatWithContext(void* data, int index) => - ((GetFloatDelegate*)((void**)data)[0])->Invoke(*(object*)((void**)data)[1], index); + internal static float GetFloatRefContextStatic(void* data, int index) + { + ref var pt = ref PointerTuple.From, object>(data); + return pt.Item1.Invoke(ref pt.Item2, index); + } [UnmanagedCallersOnly] - private static float GetFloatWithoutContext(void* data, int index) => - ((GetFloatDelegate*)((void**)data)[0])->Invoke(index); -#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + internal static float GetFloatInContextStatic(void* data, int index) + { + ref var pt = ref PointerTuple.From, object>(data); + return pt.Item1.Invoke(pt.Item2, index); + } + + [UnmanagedCallersOnly] + internal static float GetFloatStatic(void* data, int index) => + PointerTuple.From(data).Item1.Invoke(index); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.SliderScalar.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.SliderScalar.cs index f94df875b..c0e727b69 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.SliderScalar.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.SliderScalar.cs @@ -8,7 +8,7 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGui { public static bool SliderSByte( - Utf8Buffer label, scoped ref sbyte v, sbyte vMin = 0, sbyte vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref sbyte v, sbyte vMin = 0, sbyte vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S8, @@ -19,7 +19,7 @@ public static unsafe partial class ImGui flags); public static bool SliderSByte( - Utf8Buffer label, Span v, sbyte vMin = 0, sbyte vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, sbyte vMin = 0, sbyte vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S8, @@ -30,7 +30,7 @@ public static unsafe partial class ImGui flags); public static bool SliderByte( - Utf8Buffer label, scoped ref byte v, byte vMin = 0, byte vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref byte v, byte vMin = 0, byte vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U8, @@ -41,7 +41,7 @@ public static unsafe partial class ImGui flags); public static bool SliderByte( - Utf8Buffer label, Span v, byte vMin = 0, byte vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, byte vMin = 0, byte vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U8, @@ -52,7 +52,7 @@ public static unsafe partial class ImGui flags); public static bool SliderShort( - Utf8Buffer label, scoped ref short v, short vMin = 0, short vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref short v, short vMin = 0, short vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S16, @@ -63,7 +63,7 @@ public static unsafe partial class ImGui flags); public static bool SliderShort( - Utf8Buffer label, Span v, short vMin = 0, short vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, short vMin = 0, short vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S16, @@ -74,7 +74,7 @@ public static unsafe partial class ImGui flags); public static bool SliderUShort( - Utf8Buffer label, scoped ref ushort v, ushort vMin = 0, ushort vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref ushort v, ushort vMin = 0, ushort vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U16, @@ -85,7 +85,7 @@ public static unsafe partial class ImGui flags); public static bool SliderUShort( - Utf8Buffer label, Span v, ushort vMin = 0, ushort vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, ushort vMin = 0, ushort vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U16, @@ -96,7 +96,7 @@ public static unsafe partial class ImGui flags); public static bool SliderInt( - Utf8Buffer label, scoped ref int v, int vMin = 0, int vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref int v, int vMin = 0, int vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S32, @@ -107,7 +107,7 @@ public static unsafe partial class ImGui flags); public static bool SliderInt( - Utf8Buffer label, Span v, int vMin = 0, int vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, int vMin = 0, int vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S32, @@ -118,7 +118,7 @@ public static unsafe partial class ImGui flags); public static bool SliderUInt( - Utf8Buffer label, scoped ref uint v, uint vMin = 0, uint vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref uint v, uint vMin = 0, uint vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U32, @@ -129,7 +129,7 @@ public static unsafe partial class ImGui flags); public static bool SliderUInt( - Utf8Buffer label, Span v, uint vMin = 0, uint vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, uint vMin = 0, uint vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U32, @@ -140,7 +140,7 @@ public static unsafe partial class ImGui flags); public static bool SliderLong( - Utf8Buffer label, scoped ref long v, long vMin = 0, long vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref long v, long vMin = 0, long vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S64, @@ -151,7 +151,7 @@ public static unsafe partial class ImGui flags); public static bool SliderLong( - Utf8Buffer label, Span v, long vMin = 0, long vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, long vMin = 0, long vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.S64, @@ -162,7 +162,7 @@ public static unsafe partial class ImGui flags); public static bool SliderULong( - Utf8Buffer label, scoped ref ulong v, ulong vMin = 0, ulong vMax = 0, Utf8Buffer format = default, + ImU8String label, scoped ref ulong v, ulong vMin = 0, ulong vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U64, @@ -173,7 +173,7 @@ public static unsafe partial class ImGui flags); public static bool SliderULong( - Utf8Buffer label, Span v, ulong vMin = 0, ulong vMax = 0, Utf8Buffer format = default, + ImU8String label, Span v, ulong vMin = 0, ulong vMax = 0, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.U64, @@ -184,7 +184,7 @@ public static unsafe partial class ImGui flags); public static bool SliderFloat( - Utf8Buffer label, scoped ref float v, float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, scoped ref float v, float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.Float, @@ -195,7 +195,7 @@ public static unsafe partial class ImGui flags); public static bool SliderFloat( - Utf8Buffer label, Span v, float vMin = 0.0f, float vMax = 0.0f, Utf8Buffer format = default, + ImU8String label, Span v, float vMin = 0.0f, float vMax = 0.0f, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.Float, @@ -206,8 +206,8 @@ public static unsafe partial class ImGui flags); public static bool SliderFloat2( - Utf8Buffer label, scoped ref Vector2 v, float vMin = 0.0f, float vMax = 0.0f, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( + ImU8String label, scoped ref Vector2 v, float vMin = 0.0f, float vMax = 0.0f, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.Float, MemoryMarshal.Cast(new(ref v)), @@ -217,8 +217,8 @@ public static unsafe partial class ImGui flags); public static bool SliderFloat3( - Utf8Buffer label, scoped ref Vector3 v, float vMin = 0.0f, float vMax = 0.0f, - Utf8Buffer format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => + ImU8String label, scoped ref Vector3 v, float vMin = 0.0f, float vMax = 0.0f, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, ImGuiDataType.Float, @@ -229,9 +229,9 @@ public static unsafe partial class ImGui flags); public static bool SliderFloat4( - Utf8Buffer label, scoped ref Vector4 v, float vMin = 0.0f, + ImU8String label, scoped ref Vector4 v, float vMin = 0.0f, float vMax = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar( label, @@ -243,23 +243,23 @@ public static unsafe partial class ImGui flags); public static bool SliderDouble( - Utf8Buffer label, scoped ref double v, double vMin = 0.0f, + ImU8String label, scoped ref double v, double vMin = 0.0f, double vMax = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar(label, ImGuiDataType.Double, ref v, vMin, vMax, format.MoveOrDefault("%.3f"u8), flags); public static bool SliderDouble( - Utf8Buffer label, Span v, double vMin = 0.0f, + ImU8String label, Span v, double vMin = 0.0f, double vMax = 0.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar(label, ImGuiDataType.Double, v, vMin, vMax, format.MoveOrDefault("%.3f"u8), flags); public static bool SliderScalar( - Utf8Buffer label, ImGuiDataType dataType, scoped ref T v, + ImU8String label, ImGuiDataType dataType, scoped ref T v, scoped in T vMin, scoped in T vMax, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) where T : unmanaged, IBinaryNumber { @@ -284,9 +284,9 @@ public static unsafe partial class ImGui } public static bool SliderScalar( - Utf8Buffer label, ImGuiDataType dataType, Span v, scoped in T vMin, + ImU8String label, ImGuiDataType dataType, Span v, scoped in T vMin, scoped in T vMax, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) where T : unmanaged, INumber, IBinaryNumber { @@ -312,9 +312,9 @@ public static unsafe partial class ImGui } public static bool SliderAngle( - Utf8Buffer label, ref float vRad, float vDegreesMin = -360.0f, + ImU8String label, ref float vRad, float vDegreesMin = -360.0f, float vDegreesMax = +360.0f, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -335,71 +335,71 @@ public static unsafe partial class ImGui } public static bool VSliderSByte( - Utf8Buffer label, Vector2 size, scoped ref sbyte v, sbyte vMin, - sbyte vMax, Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref sbyte v, sbyte vMin, + sbyte vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.S8, ref v, vMin, vMax, format.MoveOrDefault("%hhd"), flags); public static bool VSliderByte( - Utf8Buffer label, Vector2 size, scoped ref byte v, byte vMin, byte vMax, - Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref byte v, byte vMin, byte vMax, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.U8, ref v, vMin, vMax, format.MoveOrDefault("%hhu"), flags); public static bool VSliderShort( - Utf8Buffer label, Vector2 size, scoped ref short v, short vMin, - short vMax, Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref short v, short vMin, + short vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.S16, ref v, vMin, vMax, format.MoveOrDefault("%hd"), flags); public static bool VSliderUShort( - Utf8Buffer label, Vector2 size, scoped ref ushort v, ushort vMin, + ImU8String label, Vector2 size, scoped ref ushort v, ushort vMin, ushort vMax, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.U16, ref v, vMin, vMax, format.MoveOrDefault("%hu"), flags); public static bool VSliderInt( - Utf8Buffer label, Vector2 size, scoped ref int v, int vMin, int vMax, - Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref int v, int vMin, int vMax, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.S32, ref v, vMin, vMax, format.MoveOrDefault("%d"), flags); public static bool VSliderUInt( - Utf8Buffer label, Vector2 size, scoped ref uint v, uint vMin, uint vMax, - Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref uint v, uint vMin, uint vMax, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.U32, ref v, vMin, vMax, format.MoveOrDefault("%u"), flags); public static bool VSliderLong( - Utf8Buffer label, Vector2 size, scoped ref long v, long vMin, long vMax, - Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref long v, long vMin, long vMax, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.S32, ref v, vMin, vMax, format.MoveOrDefault("%I64d"), flags); public static bool VSliderULong( - Utf8Buffer label, Vector2 size, scoped ref ulong v, ulong vMin, - ulong vMax, Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref ulong v, ulong vMin, + ulong vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.U32, ref v, vMin, vMax, format.MoveOrDefault("%I64u"), flags); public static bool VSliderFloat( - Utf8Buffer label, Vector2 size, scoped ref float v, float vMin, - float vMax, Utf8Buffer format = default, + ImU8String label, Vector2 size, scoped ref float v, float vMin, + float vMax, ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.Float, ref v, vMin, vMax, format.MoveOrDefault("%.03f"), flags); public static bool VSliderDouble( - Utf8Buffer label, Vector2 size, scoped ref double v, double vMin, + ImU8String label, Vector2 size, scoped ref double v, double vMin, double vMax, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => VSliderScalar(label, size, ImGuiDataType.Double, ref v, vMin, vMax, format.MoveOrDefault("%.03f"), flags); public static bool VSliderScalar( - Utf8Buffer label, Vector2 size, ImGuiDataType dataType, + ImU8String label, Vector2 size, ImGuiDataType dataType, scoped ref T data, scoped in T min, scoped in T max, - Utf8Buffer format = default, + ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) where T : unmanaged, IBinaryNumber { diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Text.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Text.cs index b6fcdb20c..959369c5c 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Text.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Text.cs @@ -6,20 +6,20 @@ namespace Dalamud.Bindings.ImGui; [SuppressMessage("ReSharper", "InconsistentNaming")] public static unsafe partial class ImGui { - public static void AddText(ImFontGlyphRangesBuilderPtr self, Utf8Buffer text) + public static void AddText(ImFontGlyphRangesBuilderPtr self, ImU8String text) { fixed (byte* textPtr = text.Span) ImGuiNative.AddText(self.Handle, textPtr, textPtr + text.Length); text.Dispose(); } - public static void AddText(ImDrawListPtr self, Vector2 pos, uint col, Utf8Buffer text) + public static void AddText(ImDrawListPtr self, Vector2 pos, uint col, ImU8String text) { fixed (byte* textPtr = text.Span) ImGuiNative.AddText(self.Handle, pos, col, textPtr, textPtr + text.Length); text.Dispose(); } public static void AddText( - ImDrawListPtr self, ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, float wrapWidth, + ImDrawListPtr self, ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth, scoped in Vector4 cpuFineClipRect) { fixed (byte* textPtr = text.Span) @@ -38,7 +38,7 @@ public static unsafe partial class ImGui } public static void AddText( - ImDrawListPtr self, ImFontPtr font, float fontSize, Vector2 pos, uint col, Utf8Buffer text, + ImDrawListPtr self, ImFontPtr font, float fontSize, Vector2 pos, uint col, ImU8String text, float wrapWidth = 0f) { fixed (byte* textPtr = text.Span) @@ -46,13 +46,13 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void append(ImGuiTextBufferPtr self, Utf8Buffer str) + public static void append(ImGuiTextBufferPtr self, ImU8String str) { fixed (byte* strPtr = str.Span) ImGuiNative.append(self.Handle, strPtr, strPtr + str.Length); str.Dispose(); } - public static void BulletText(Utf8Buffer text) + public static void BulletText(ImU8String text) { ImGuiWindow* window = ImGuiP.GetCurrentWindow(); if (window->SkipItems != 0) return; @@ -79,7 +79,7 @@ public static unsafe partial class ImGui } public static Vector2 CalcTextSize( - Utf8Buffer text, bool hideTextAfterDoubleHash = false, float wrapWidth = -1.0f) + ImU8String text, bool hideTextAfterDoubleHash = false, float wrapWidth = -1.0f) { var @out = Vector2.Zero; fixed (byte* textPtr = text.Span) @@ -94,7 +94,7 @@ public static unsafe partial class ImGui } public static Vector2 CalcTextSizeA( - ImFontPtr self, float size, float maxWidth, float wrapWidth, Utf8Buffer text, out int remaining) + ImFontPtr self, float size, float maxWidth, float wrapWidth, ImU8String text, out int remaining) { var @out = Vector2.Zero; fixed (byte* textPtr = text.Span) @@ -117,7 +117,7 @@ public static unsafe partial class ImGui } public static int CalcWordWrapPositionA( - ImFontPtr font, float scale, Utf8Buffer text, float wrapWidth) + ImFontPtr font, float scale, ImU8String text, float wrapWidth) { fixed (byte* ptr = text.Span) { @@ -129,7 +129,7 @@ public static unsafe partial class ImGui } public static void InsertChars( - ImGuiInputTextCallbackDataPtr self, int pos, Utf8Buffer text) + ImGuiInputTextCallbackDataPtr self, int pos, ImU8String text) { fixed (byte* ptr = text.Span) ImGuiNative.InsertChars(self.Handle, pos, ptr, ptr + text.Length); @@ -137,8 +137,8 @@ public static unsafe partial class ImGui } public static void LabelText( - Utf8Buffer label, - Utf8Buffer text) + ImU8String label, + ImU8String text) { var window = ImGuiP.GetCurrentWindow().Handle; if (window->SkipItems != 0) @@ -183,7 +183,7 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void LogText(Utf8Buffer text) + public static void LogText(ImU8String text) { var g = GetCurrentContext(); if (!g.LogFile.IsNull) @@ -201,7 +201,7 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void PassFilter(ImGuiTextFilterPtr self, Utf8Buffer text) + public static void PassFilter(ImGuiTextFilterPtr self, ImU8String text) { fixed (byte* textPtr = text.Span) ImGuiNative.PassFilter(self.Handle, textPtr, textPtr + text.Length); @@ -210,7 +210,7 @@ public static unsafe partial class ImGui public static void RenderText( ImFontPtr self, ImDrawListPtr drawList, float size, Vector2 pos, uint col, Vector4 clipRect, - Utf8Buffer text, float wrapWidth = 0.0f, bool cpuFineClip = false) + ImU8String text, float wrapWidth = 0.0f, bool cpuFineClip = false) { fixed (byte* textPtr = text.Span) ImGuiNative.RenderText( @@ -227,7 +227,7 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void SetTooltip(Utf8Buffer text) + public static void SetTooltip(ImU8String text) { ImGuiP.BeginTooltipEx(ImGuiTooltipFlags.OverridePreviousTooltip, ImGuiWindowFlags.None); Text(text.Span); @@ -235,14 +235,14 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void Text(Utf8Buffer text) + public static void Text(ImU8String text) { fixed (byte* ptr = text.Span) ImGuiNative.TextUnformatted(ptr, ptr + text.Length); text.Dispose(); } - public static void TextColored(uint col, Utf8Buffer text) + public static void TextColored(uint col, ImU8String text) { PushStyleColor(ImGuiCol.Text, col); Text(text.Span); @@ -250,7 +250,7 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void TextColored(scoped in Vector4 col, Utf8Buffer text) + public static void TextColored(scoped in Vector4 col, ImU8String text) { PushStyleColor(ImGuiCol.Text, col); Text(text.Span); @@ -258,19 +258,19 @@ public static unsafe partial class ImGui text.Dispose(); } - public static void TextDisabled(Utf8Buffer text) + public static void TextDisabled(ImU8String text) { TextColored(*GetStyleColorVec4(ImGuiCol.TextDisabled), text.Span); text.Dispose(); } - public static void TextUnformatted(Utf8Buffer text) + public static void TextUnformatted(ImU8String text) { Text(text.Span); text.Dispose(); } - public static void TextWrapped(Utf8Buffer text) + public static void TextWrapped(ImU8String text) { scoped ref var g = ref *GetCurrentContext().Handle; var needBackup = g.CurrentWindow->DC.TextWrapPos < 0.0f; // Keep existing wrap position if one is already set @@ -282,7 +282,7 @@ public static unsafe partial class ImGui text.Dispose(); } - public static bool TreeNode(Utf8Buffer label) + public static bool TreeNode(ImU8String label) { var window = ImGuiP.GetCurrentWindow(); if (window.SkipItems) @@ -300,8 +300,8 @@ public static unsafe partial class ImGui } public static bool TreeNodeEx( - Utf8Buffer id, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None, - Utf8Buffer label = default) + ImU8String id, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None, + ImU8String label = default) { var window = ImGuiP.GetCurrentWindow(); bool res; diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Widgets.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Widgets.cs index 79767cc98..b72e96a63 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Widgets.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGui.Widgets.cs @@ -6,7 +6,7 @@ namespace Dalamud.Bindings.ImGui; [SuppressMessage("ReSharper", "InconsistentNaming")] public static unsafe partial class ImGui { - public static bool Begin(Utf8Buffer name, ref bool open, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + public static bool Begin(ImU8String name, ref bool open, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) fixed (bool* openPtr = &open) @@ -17,7 +17,7 @@ public static unsafe partial class ImGui } } - public static bool Begin(Utf8Buffer name, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + public static bool Begin(ImU8String name, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -27,7 +27,7 @@ public static unsafe partial class ImGui } } - public static bool BeginChild(Utf8Buffer strId, Vector2 size = default, bool border = false, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + public static bool BeginChild(ImU8String strId, Vector2 size = default, bool border = false, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -40,7 +40,7 @@ public static unsafe partial class ImGui public static bool BeginChild(uint id, Vector2 size = default, bool border = false, ImGuiWindowFlags flags = ImGuiWindowFlags.None) => ImGuiNative.BeginChild(id, size, border ? (byte)1 : (byte)0, flags) != 0; - public static bool BeginCombo(Utf8Buffer label, Utf8Buffer previewValue, ImGuiComboFlags flags = ImGuiComboFlags.None) + public static bool BeginCombo(ImU8String label, ImU8String previewValue, ImGuiComboFlags flags = ImGuiComboFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* previewValuePtr = &previewValue.GetPinnableNullTerminatedReference()) @@ -52,7 +52,7 @@ public static unsafe partial class ImGui } } - public static bool BeginListBox(Utf8Buffer label, Vector2 size = default) + public static bool BeginListBox(ImU8String label, Vector2 size = default) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -62,7 +62,7 @@ public static unsafe partial class ImGui } } - public static bool BeginMenu(Utf8Buffer label, bool enabled = true) + public static bool BeginMenu(ImU8String label, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -72,7 +72,7 @@ public static unsafe partial class ImGui } } - public static bool BeginPopup(Utf8Buffer strId, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + public static bool BeginPopup(ImU8String strId, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -82,7 +82,7 @@ public static unsafe partial class ImGui } } - public static bool BeginPopupContextItem(Utf8Buffer strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) + public static bool BeginPopupContextItem(ImU8String strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -92,7 +92,7 @@ public static unsafe partial class ImGui } } - public static bool BeginPopupContextWindow(Utf8Buffer strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) + public static bool BeginPopupContextWindow(ImU8String strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -102,7 +102,7 @@ public static unsafe partial class ImGui } } - public static bool BeginPopupContextVoid(Utf8Buffer strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) + public static bool BeginPopupContextVoid(ImU8String strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -113,7 +113,7 @@ public static unsafe partial class ImGui } public static bool BeginPopupModal( - Utf8Buffer name, ref bool open, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + ImU8String name, ref bool open, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) fixed (bool* openPtr = &open) @@ -124,7 +124,7 @@ public static unsafe partial class ImGui } } - public static bool BeginPopupModal(Utf8Buffer name, ImGuiWindowFlags flags = ImGuiWindowFlags.None) + public static bool BeginPopupModal(ImU8String name, ImGuiWindowFlags flags = ImGuiWindowFlags.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -134,7 +134,7 @@ public static unsafe partial class ImGui } } - public static bool BeginTabBar(Utf8Buffer strId, ImGuiTabBarFlags flags = ImGuiTabBarFlags.None) + public static bool BeginTabBar(ImU8String strId, ImGuiTabBarFlags flags = ImGuiTabBarFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -145,7 +145,7 @@ public static unsafe partial class ImGui } public static bool BeginTabItem( - Utf8Buffer label, ref bool pOpen, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) + ImU8String label, ref bool pOpen, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* pOpenPtr = &pOpen) @@ -156,7 +156,7 @@ public static unsafe partial class ImGui } } - public static bool BeginTabItem(Utf8Buffer label, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) + public static bool BeginTabItem(ImU8String label, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -167,7 +167,7 @@ public static unsafe partial class ImGui } public static bool BeginTable( - Utf8Buffer strId, int column, ImGuiTableFlags flags = ImGuiTableFlags.None, Vector2 outerSize = default, + ImU8String strId, int column, ImGuiTableFlags flags = ImGuiTableFlags.None, Vector2 outerSize = default, float innerWidth = 0.0f) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) @@ -178,7 +178,7 @@ public static unsafe partial class ImGui } } - public static bool Button(Utf8Buffer label, Vector2 size = default) + public static bool Button(ImU8String label, Vector2 size = default) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -188,7 +188,7 @@ public static unsafe partial class ImGui } } - public static bool Checkbox(Utf8Buffer label, ref bool v) + public static bool Checkbox(ImU8String label, ref bool v) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* vPtr = &v) @@ -199,7 +199,7 @@ public static unsafe partial class ImGui } } - public static bool CheckboxFlags(Utf8Buffer label, ref T flags, T flagsValue) + public static bool CheckboxFlags(ImU8String label, ref T flags, T flagsValue) where T : IBinaryInteger { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -234,7 +234,7 @@ public static unsafe partial class ImGui } public static bool CollapsingHeader( - Utf8Buffer label, ref bool visible, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) + ImU8String label, ref bool visible, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* visiblePtr = &visible) @@ -245,7 +245,7 @@ public static unsafe partial class ImGui } } - public static bool CollapsingHeader(Utf8Buffer label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) + public static bool CollapsingHeader(ImU8String label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -256,7 +256,7 @@ public static unsafe partial class ImGui } public static bool ColorButton( - Utf8Buffer descId, in Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None, + ImU8String descId, in Vector4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None, Vector2 size = default) { fixed (byte* descIdPtr = &descId.GetPinnableNullTerminatedReference()) @@ -267,7 +267,7 @@ public static unsafe partial class ImGui } } - public static void Columns(int count = 1, Utf8Buffer id = default, bool border = true) + public static void Columns(int count = 1, ImU8String id = default, bool border = true) { fixed (byte* idPtr = &id.GetPinnableNullTerminatedReference()) ImGuiNative.Columns(count, idPtr, border ? (byte)1 : (byte)0); @@ -275,7 +275,7 @@ public static unsafe partial class ImGui } public static bool DebugCheckVersionAndDataLayout( - Utf8Buffer versionStr, nuint szIo, nuint szStyle, nuint szVec2, nuint szVec4, nuint szDrawVert, + ImU8String versionStr, nuint szIo, nuint szStyle, nuint szVec2, nuint szVec4, nuint szDrawVert, nuint szDrawIdx) { fixed (byte* versionPtr = &versionStr.GetPinnableNullTerminatedReference()) @@ -286,7 +286,7 @@ public static unsafe partial class ImGui } } - public static void DebugTextEncoding(Utf8Buffer text) + public static void DebugTextEncoding(ImU8String text) { fixed (byte* textPtr = &text.GetPinnableNullTerminatedReference()) { @@ -295,7 +295,7 @@ public static unsafe partial class ImGui } } - public static bool Draw(ImGuiTextFilterPtr self, Utf8Buffer label = default, float width = 0.0f) + public static bool Draw(ImGuiTextFilterPtr self, ImU8String label = default, float width = 0.0f) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference("Filter (inc,-exc)"u8)) { @@ -305,7 +305,7 @@ public static unsafe partial class ImGui } } - public static ImGuiTextFilterPtr ImGuiTextFilter(Utf8Buffer defaultFilter = default) + public static ImGuiTextFilterPtr ImGuiTextFilter(ImU8String defaultFilter = default) { fixed (byte* defaultFilterPtr = &defaultFilter.GetPinnableNullTerminatedReference("\0"u8)) { @@ -324,7 +324,7 @@ public static unsafe partial class ImGui } public static bool InvisibleButton( - Utf8Buffer strId, Vector2 size, ImGuiButtonFlags flags = ImGuiButtonFlags.None) + ImU8String strId, Vector2 size, ImGuiButtonFlags flags = ImGuiButtonFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -334,7 +334,7 @@ public static unsafe partial class ImGui } } - public static bool IsDataType(ImGuiPayloadPtr self, Utf8Buffer type) + public static bool IsDataType(ImGuiPayloadPtr self, ImU8String type) { fixed (byte* typePtr = &type.GetPinnableNullTerminatedReference()) { @@ -344,7 +344,7 @@ public static unsafe partial class ImGui } } - public static bool IsPopupOpen(Utf8Buffer strId, ImGuiPopupFlags flags = ImGuiPopupFlags.None) + public static bool IsPopupOpen(ImU8String strId, ImGuiPopupFlags flags = ImGuiPopupFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -354,21 +354,21 @@ public static unsafe partial class ImGui } } - public static void LoadIniSettingsFromDisk(Utf8Buffer iniFilename) + public static void LoadIniSettingsFromDisk(ImU8String iniFilename) { fixed (byte* iniFilenamePtr = &iniFilename.GetPinnableNullTerminatedReference()) ImGuiNative.LoadIniSettingsFromDisk(iniFilenamePtr); iniFilename.Dispose(); } - public static void LoadIniSettingsFromMemory(Utf8Buffer iniData) + public static void LoadIniSettingsFromMemory(ImU8String iniData) { fixed (byte* iniDataPtr = iniData.Span) ImGuiNative.LoadIniSettingsFromMemory(iniDataPtr, (nuint)iniData.Length); iniData.Dispose(); } - public static void LogToFile(int autoOpenDepth = -1, Utf8Buffer filename = default) + public static void LogToFile(int autoOpenDepth = -1, ImU8String filename = default) { fixed (byte* filenamePtr = &filename.GetPinnableNullTerminatedReference()) ImGuiNative.LogToFile(autoOpenDepth, filenamePtr); @@ -376,7 +376,7 @@ public static unsafe partial class ImGui } public static bool MenuItem( - Utf8Buffer label, Utf8Buffer shortcut, bool selected = false, bool enabled = true) + ImU8String label, ImU8String shortcut, bool selected = false, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* shortcutPtr = &shortcut.GetPinnableNullTerminatedReference()) @@ -388,7 +388,7 @@ public static unsafe partial class ImGui } } - public static bool MenuItem(Utf8Buffer label, Utf8Buffer shortcut, ref bool selected, bool enabled = true) + public static bool MenuItem(ImU8String label, ImU8String shortcut, ref bool selected, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* shortcutPtr = &shortcut.GetPinnableNullTerminatedReference()) @@ -401,7 +401,7 @@ public static unsafe partial class ImGui } } - public static bool MenuItem(Utf8Buffer label, ref bool selected, bool enabled = true) + public static bool MenuItem(ImU8String label, ref bool selected, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* selectedPtr = &selected) @@ -412,7 +412,7 @@ public static unsafe partial class ImGui } } - public static bool MenuItem(Utf8Buffer label, bool enabled = true) + public static bool MenuItem(ImU8String label, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -422,7 +422,7 @@ public static unsafe partial class ImGui } } - public static void OpenPopup(Utf8Buffer strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.None) + public static void OpenPopup(ImU8String strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) ImGuiNative.OpenPopup(strIdPtr, popupFlags); @@ -432,28 +432,28 @@ public static unsafe partial class ImGui public static void OpenPopup(uint id, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.None) => ImGuiNative.OpenPopup(id, popupFlags); public static void OpenPopupOnItemClick( - Utf8Buffer strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) + ImU8String strId, ImGuiPopupFlags popupFlags = ImGuiPopupFlags.MouseButtonDefault) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) ImGuiNative.OpenPopupOnItemClick(strIdPtr, popupFlags); strId.Dispose(); } - public static void ProgressBar(float fraction, Vector2 sizeArg, Utf8Buffer overlay = default) + public static void ProgressBar(float fraction, Vector2 sizeArg, ImU8String overlay = default) { fixed (byte* overlayPtr = &overlay.GetPinnableNullTerminatedReference()) ImGuiNative.ProgressBar(fraction, sizeArg, overlayPtr); overlay.Dispose(); } - public static void ProgressBar(float fraction, Utf8Buffer overlay = default) + public static void ProgressBar(float fraction, ImU8String overlay = default) { fixed (byte* overlayPtr = &overlay.GetPinnableNullTerminatedReference()) ImGuiNative.ProgressBar(fraction, new(-float.MinValue, 0), overlayPtr); overlay.Dispose(); } - public static bool RadioButton(Utf8Buffer label, bool active) + public static bool RadioButton(ImU8String label, bool active) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -463,7 +463,7 @@ public static unsafe partial class ImGui } } - public static bool RadioButton(Utf8Buffer label, ref T v, T vButton) + public static bool RadioButton(ImU8String label, ref T v, T vButton) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -476,14 +476,14 @@ public static unsafe partial class ImGui } } - public static void SaveIniSettingsToDisk(Utf8Buffer iniFilename) + public static void SaveIniSettingsToDisk(ImU8String iniFilename) { fixed (byte* iniPtr = &iniFilename.GetPinnableNullTerminatedReference()) ImGuiNative.SaveIniSettingsToDisk(iniPtr); } public static bool Selectable( - Utf8Buffer label, bool selected = false, ImGuiSelectableFlags flags = ImGuiSelectableFlags.None, Vector2 size = default) + ImU8String label, bool selected = false, ImGuiSelectableFlags flags = ImGuiSelectableFlags.None, Vector2 size = default) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -493,7 +493,7 @@ public static unsafe partial class ImGui } } - public static bool Selectable(Utf8Buffer label, ref bool selected, ImGuiSelectableFlags flags = ImGuiSelectableFlags.None, Vector2 size = default) + public static bool Selectable(ImU8String label, ref bool selected, ImGuiSelectableFlags flags = ImGuiSelectableFlags.None, Vector2 size = default) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* selectedPtr = &selected) @@ -504,14 +504,14 @@ public static unsafe partial class ImGui } } - public static void SetClipboardText(Utf8Buffer text) + public static void SetClipboardText(ImU8String text) { fixed (byte* textPtr = &text.GetPinnableNullTerminatedReference()) ImGuiNative.SetClipboardText(textPtr); text.Dispose(); } - public static bool SetDragDropPayload(Utf8Buffer type, ReadOnlySpan data, ImGuiCond cond) + public static bool SetDragDropPayload(ImU8String type, ReadOnlySpan data, ImGuiCond cond) { fixed (byte* typePtr = &type.GetPinnableNullTerminatedReference()) fixed (byte* dataPtr = data) @@ -522,7 +522,7 @@ public static unsafe partial class ImGui } } - public static void SetTabItemClosed(Utf8Buffer tabOrDockedWindowLabel) + public static void SetTabItemClosed(ImU8String tabOrDockedWindowLabel) { fixed (byte* tabItemPtr = &tabOrDockedWindowLabel.GetPinnableNullTerminatedReference()) ImGuiNative.SetTabItemClosed(tabItemPtr); @@ -531,7 +531,7 @@ public static unsafe partial class ImGui public static void SetWindowCollapsed(bool collapsed, ImGuiCond cond = ImGuiCond.None) => ImGuiNative.SetWindowCollapsed(collapsed ? (byte)1 : (byte)0, cond); - public static void SetWindowCollapsed(Utf8Buffer name, bool collapsed, ImGuiCond cond = ImGuiCond.None) + public static void SetWindowCollapsed(ImU8String name, bool collapsed, ImGuiCond cond = ImGuiCond.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) ImGuiNative.SetWindowCollapsed(namePtr, collapsed ? (byte)1 : (byte)0, cond); @@ -540,7 +540,7 @@ public static unsafe partial class ImGui public static void SetWindowFocus() => ImGuiNative.SetWindowFocus(); - public static void SetWindowFocus(Utf8Buffer name) + public static void SetWindowFocus(ImU8String name) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) ImGuiNative.SetWindowFocus(namePtr); @@ -549,7 +549,7 @@ public static unsafe partial class ImGui public static void SetWindowPos(Vector2 pos, ImGuiCond cond = ImGuiCond.None) => ImGuiNative.SetWindowPos(pos, cond); - public static void SetWindowPos(Utf8Buffer name, Vector2 pos, ImGuiCond cond = ImGuiCond.None) + public static void SetWindowPos(ImU8String name, Vector2 pos, ImGuiCond cond = ImGuiCond.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) ImGuiNative.SetWindowPos(namePtr, pos, cond); @@ -558,21 +558,21 @@ public static unsafe partial class ImGui public static void SetWindowSize(Vector2 size, ImGuiCond cond = ImGuiCond.None) => ImGuiNative.SetWindowSize(size, cond); - public static void SetWindowSize(Utf8Buffer name, Vector2 size, ImGuiCond cond = ImGuiCond.None) + public static void SetWindowSize(ImU8String name, Vector2 size, ImGuiCond cond = ImGuiCond.None) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) ImGuiNative.SetWindowSize(namePtr, size, cond); name.Dispose(); } - public static void ShowFontSelector(Utf8Buffer label) + public static void ShowFontSelector(ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiNative.ShowFontSelector(labelPtr); label.Dispose(); } - public static bool ShowStyleSelector(Utf8Buffer label) + public static bool ShowStyleSelector(ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -582,7 +582,7 @@ public static unsafe partial class ImGui } } - public static bool SmallButton(Utf8Buffer label) + public static bool SmallButton(ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -592,7 +592,7 @@ public static unsafe partial class ImGui } } - public static bool TabItemButton(Utf8Buffer label, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) + public static bool TabItemButton(ImU8String label, ImGuiTabItemFlags flags = ImGuiTabItemFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -602,7 +602,7 @@ public static unsafe partial class ImGui } } - public static void TableHeader(Utf8Buffer label) + public static void TableHeader(ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiNative.TableHeader(labelPtr); @@ -610,7 +610,7 @@ public static unsafe partial class ImGui } public static void TableSetupColumn( - Utf8Buffer label, ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.None, float initWidthOrWeight = 0.0f, + ImU8String label, ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.None, float initWidthOrWeight = 0.0f, uint userId = 0) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -618,7 +618,7 @@ public static unsafe partial class ImGui label.Dispose(); } - public static void TreePush(Utf8Buffer strId) + public static void TreePush(ImU8String strId) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) ImGuiNative.TreePush(strIdPtr); @@ -628,7 +628,7 @@ public static unsafe partial class ImGui public static void TreePush(nint ptrId) => ImGuiNative.TreePush((void*)ptrId); public static void TreePush(void* ptrId) => ImGuiNative.TreePush(ptrId); - public static void Value(Utf8Buffer prefix, in T value) + public static void Value(ImU8String prefix, in T value) { prefix.AppendLiteral(": "); prefix.AppendFormatted(value); @@ -641,7 +641,7 @@ public static unsafe partial class ImGui // public static void Value(AutoUtf8Buffer prefix, float value) => Value(prefix, value, default); - public static void Value(Utf8Buffer prefix, float value, Utf8Buffer floatFormat = default) + public static void Value(ImU8String prefix, float value, ImU8String floatFormat = default) { fixed (byte* prefixPtr = &prefix.GetPinnableNullTerminatedReference()) fixed (byte* floatPtr = &floatFormat.GetPinnableNullTerminatedReference()) diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiIO.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiIO.Custom.cs index d3bdb65ca..12e623eeb 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiIO.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiIO.Custom.cs @@ -16,7 +16,7 @@ public unsafe partial struct ImGuiIO ImGui.AddInputCharacter(thisPtr, c); } - public void AddInputCharacters(Utf8Buffer str) + public void AddInputCharacters(ImU8String str) { fixed (ImGuiIO* thisPtr = &this) ImGui.AddInputCharacters(thisPtr, str); @@ -29,5 +29,5 @@ public partial struct ImGuiIOPtr public void AddInputCharacter(Rune c) => ImGui.AddInputCharacter(this, c); - public void AddInputCharacters(Utf8Buffer str) => ImGui.AddInputCharacters(this, str); + public void AddInputCharacters(ImU8String str) => ImGui.AddInputCharacters(this, str); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiInputTextCallbackData.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiInputTextCallbackData.Custom.cs index 2607e2445..9d910e6d7 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiInputTextCallbackData.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiInputTextCallbackData.Custom.cs @@ -2,14 +2,20 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImGuiInputTextCallbackData { - public void InsertChars(int pos, Utf8Buffer text) + public readonly Span BufSpan => new(this.Buf, this.BufSize); + public readonly Span BufTextSpan => new(this.Buf, this.BufTextLen); + + public void InsertChars(int pos, ImU8String text) { fixed (ImGuiInputTextCallbackData* thisPtr = &this) ImGui.InsertChars(thisPtr, pos, text); } } -public partial struct ImGuiInputTextCallbackDataPtr +public unsafe partial struct ImGuiInputTextCallbackDataPtr { - public void InsertChars(int pos, Utf8Buffer text) => ImGui.InsertChars(this, pos, text); + public readonly Span BufSpan => this.Handle->BufSpan; + public readonly Span BufTextSpan => this.Handle->BufTextSpan; + + public void InsertChars(int pos, ImU8String text) => ImGui.InsertChars(this, pos, text); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Misc.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Misc.cs index 644558d7f..8e61f8f07 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Misc.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Misc.cs @@ -7,7 +7,7 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial class ImGuiP { public static bool ArrowButtonEx( - Utf8Buffer strId, ImGuiDir dir, Vector2 sizeArg, ImGuiButtonFlags flags = ImGuiButtonFlags.None) + ImU8String strId, ImGuiDir dir, Vector2 sizeArg, ImGuiButtonFlags flags = ImGuiButtonFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -17,7 +17,7 @@ public unsafe partial class ImGuiP } } - public static bool BeginChildEx(Utf8Buffer name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags) + public static bool BeginChildEx(ImU8String name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -27,14 +27,14 @@ public unsafe partial class ImGuiP } } - public static void BeginColumns(Utf8Buffer strId, int count, ImGuiOldColumnFlags flags = ImGuiOldColumnFlags.None) + public static void BeginColumns(ImU8String strId, int count, ImGuiOldColumnFlags flags = ImGuiOldColumnFlags.None) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) ImGuiPNative.BeginColumns(strIdPtr, count, flags); strId.Dispose(); } - public static bool BeginMenuEx(Utf8Buffer label, Utf8Buffer icon = default, bool enabled = true) + public static bool BeginMenuEx(ImU8String label, ImU8String icon = default, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* iconPtr = &icon.GetPinnableNullTerminatedReference()) @@ -47,7 +47,7 @@ public unsafe partial class ImGuiP } public static bool BeginTableEx( - Utf8Buffer name, uint id, int columnsCount, ImGuiTableFlags flags = ImGuiTableFlags.None, + ImU8String name, uint id, int columnsCount, ImGuiTableFlags flags = ImGuiTableFlags.None, Vector2 outerSize = default, float innerWidth = 0.0f) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) @@ -59,7 +59,7 @@ public unsafe partial class ImGuiP } public static bool BeginViewportSideBar( - Utf8Buffer name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags) + ImU8String name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -70,7 +70,7 @@ public unsafe partial class ImGuiP } public static bool ButtonEx( - Utf8Buffer label, Vector2 sizeArg = default, ImGuiButtonFlags flags = ImGuiButtonFlags.None) + ImU8String label, Vector2 sizeArg = default, ImGuiButtonFlags flags = ImGuiButtonFlags.None) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -92,7 +92,7 @@ public unsafe partial class ImGuiP ImGuiPNative.ColorPickerOptionsPopup(refColPtr, flags); } - public static void ColorTooltip(Utf8Buffer text, ReadOnlySpan col, ImGuiColorEditFlags flags) + public static void ColorTooltip(ImU8String text, ReadOnlySpan col, ImGuiColorEditFlags flags) { fixed (byte* textPtr = &text.GetPinnableNullTerminatedReference()) fixed (float* colPtr = col) @@ -100,7 +100,7 @@ public unsafe partial class ImGuiP text.Dispose(); } - public static ImGuiWindowSettingsPtr CreateNewWindowSettings(Utf8Buffer name) + public static ImGuiWindowSettingsPtr CreateNewWindowSettings(ImU8String name) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -116,7 +116,7 @@ public unsafe partial class ImGuiP public static void Custom_StbTextUndo(ImGuiInputTextStatePtr str) => ImGuiPNative.Custom_StbTextUndo(str); - public static bool DataTypeApplyFromText(Utf8Buffer buf, ImGuiDataType dataType, T data, Utf8Buffer format) + public static bool DataTypeApplyFromText(ImU8String buf, ImGuiDataType dataType, T data, ImU8String format) where T : unmanaged, IBinaryNumber { fixed (byte* bufPtr = &buf.GetPinnableNullTerminatedReference()) @@ -129,7 +129,7 @@ public unsafe partial class ImGuiP } } - public static void DebugNodeDockNode(ImGuiDockNodePtr node, Utf8Buffer label) + public static void DebugNodeDockNode(ImGuiDockNodePtr node, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiPNative.DebugNodeDockNode(node, labelPtr); @@ -137,35 +137,35 @@ public unsafe partial class ImGuiP } public static void DebugNodeDrawList( - ImGuiWindowPtr window, ImGuiViewportPPtr viewport, ImDrawListPtr drawList, Utf8Buffer label) + ImGuiWindowPtr window, ImGuiViewportPPtr viewport, ImDrawListPtr drawList, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiPNative.DebugNodeDrawList(window, viewport, drawList, labelPtr); label.Dispose(); } - public static void DebugNodeStorage(ImGuiStoragePtr storage, Utf8Buffer label) + public static void DebugNodeStorage(ImGuiStoragePtr storage, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiPNative.DebugNodeStorage(storage, labelPtr); label.Dispose(); } - public static void DebugNodeTabBar(ImGuiTabBarPtr tabBar, Utf8Buffer label) + public static void DebugNodeTabBar(ImGuiTabBarPtr tabBar, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiPNative.DebugNodeTabBar(tabBar, labelPtr); label.Dispose(); } - public static void DebugNodeWindow(ImGuiWindowPtr window, Utf8Buffer label) + public static void DebugNodeWindow(ImGuiWindowPtr window, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) ImGuiPNative.DebugNodeWindow(window, labelPtr); label.Dispose(); } - public static void DebugNodeWindowsList(scoped in ImVector windows, Utf8Buffer label) + public static void DebugNodeWindowsList(scoped in ImVector windows, ImU8String label) { fixed (ImVector* windowsPtr = &windows) fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -173,7 +173,7 @@ public unsafe partial class ImGuiP label.Dispose(); } - public static void DockBuilderCopyWindowSettings(Utf8Buffer srcName, Utf8Buffer dstName) + public static void DockBuilderCopyWindowSettings(ImU8String srcName, ImU8String dstName) { fixed (byte* srcNamePtr = &srcName.GetPinnableNullTerminatedReference()) fixed (byte* dstNamePtr = &dstName.GetPinnableNullTerminatedReference()) @@ -182,7 +182,7 @@ public unsafe partial class ImGuiP dstName.Dispose(); } - public static void DockBuilderDockWindow(Utf8Buffer windowName, uint nodeId) + public static void DockBuilderDockWindow(ImU8String windowName, uint nodeId) { fixed (byte* windowNamePtr = &windowName.GetPinnableNullTerminatedReference()) ImGuiPNative.DockBuilderDockWindow(windowNamePtr, nodeId); @@ -190,7 +190,7 @@ public unsafe partial class ImGuiP } public static bool DragBehavior( - uint id, ImGuiDataType dataType, void* pV, float vSpeed, void* pMin, void* pMax, Utf8Buffer format, + uint id, ImGuiDataType dataType, void* pV, float vSpeed, void* pMin, void* pMax, ImU8String format, ImGuiSliderFlags flags) { fixed (byte* formatPtr = &format.GetPinnableNullTerminatedReference()) @@ -201,7 +201,7 @@ public unsafe partial class ImGuiP } } - public static ImGuiWindowSettingsPtr FindOrCreateWindowSettings(Utf8Buffer name) + public static ImGuiWindowSettingsPtr FindOrCreateWindowSettings(ImU8String name) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -211,7 +211,7 @@ public unsafe partial class ImGuiP } } - public static ImGuiSettingsHandlerPtr FindSettingsHandler(Utf8Buffer typeName) + public static ImGuiSettingsHandlerPtr FindSettingsHandler(ImU8String typeName) { fixed (byte* typeNamePtr = &typeName.GetPinnableNullTerminatedReference()) { @@ -221,7 +221,7 @@ public unsafe partial class ImGuiP } } - public static ImGuiWindowPtr FindWindowByName(Utf8Buffer name) + public static ImGuiWindowPtr FindWindowByName(ImU8String name) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -231,7 +231,7 @@ public unsafe partial class ImGuiP } } - public static uint GetColumnsID(Utf8Buffer strId, int count) + public static uint GetColumnsID(ImU8String strId, int count) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -241,7 +241,7 @@ public unsafe partial class ImGuiP } } - public static uint GetIDWithSeed(Utf8Buffer strId, uint seed) + public static uint GetIDWithSeed(ImU8String strId, uint seed) { fixed (byte* strIdPtr = &strId.GetPinnableNullTerminatedReference()) { @@ -252,7 +252,7 @@ public unsafe partial class ImGuiP } public static void* ImFileLoadToMemory( - Utf8Buffer filename, Utf8Buffer mode, out nuint outFileSize, int paddingBytes = 0) + ImU8String filename, ImU8String mode, out nuint outFileSize, int paddingBytes = 0) { fixed (byte* filenamePtr = &filename.GetPinnableNullTerminatedReference()) fixed (byte* modePtr = &mode.GetPinnableNullTerminatedReference()) @@ -265,7 +265,7 @@ public unsafe partial class ImGuiP } } - public static void* ImFileLoadToMemory(Utf8Buffer filename, Utf8Buffer mode, int paddingBytes = 0) + public static void* ImFileLoadToMemory(ImU8String filename, ImU8String mode, int paddingBytes = 0) { fixed (byte* filenamePtr = &filename.GetPinnableNullTerminatedReference()) fixed (byte* modePtr = &mode.GetPinnableNullTerminatedReference()) @@ -277,7 +277,7 @@ public unsafe partial class ImGuiP } } - public static ImFileHandle ImFileOpen(Utf8Buffer filename, Utf8Buffer mode) + public static ImFileHandle ImFileOpen(ImU8String filename, ImU8String mode) { fixed (byte* filenamePtr = &filename.GetPinnableNullTerminatedReference()) fixed (byte* modePtr = &mode.GetPinnableNullTerminatedReference()) @@ -335,14 +335,14 @@ public unsafe partial class ImGuiP } } - public static void ImFormatStringToTempBuffer(byte** outBuf, byte** outBufEnd, Utf8Buffer fmt) + public static void ImFormatStringToTempBuffer(byte** outBuf, byte** outBufEnd, ImU8String fmt) { fixed (byte* fmtPtr = &fmt.GetPinnableNullTerminatedReference()) ImGuiPNative.ImFormatStringToTempBuffer(outBuf, outBufEnd, fmtPtr); fmt.Dispose(); } - public static ImGuiWindowPtr ImGuiWindow(ImGuiContextPtr context, Utf8Buffer name) + public static ImGuiWindowPtr ImGuiWindow(ImGuiContextPtr context, ImU8String name) { fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) { @@ -373,7 +373,7 @@ public unsafe partial class ImGuiP ImGuiPNative.LogSetNextTextDecoration(prefix, suffix); public static bool MenuItemEx( - Utf8Buffer label, Utf8Buffer icon = default, Utf8Buffer shortcut = default, bool selected = false, + ImU8String label, ImU8String icon = default, ImU8String shortcut = default, bool selected = false, bool enabled = true) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -393,7 +393,7 @@ public unsafe partial class ImGuiP } } - public static void RemoveSettingsHandler(Utf8Buffer typeName) + public static void RemoveSettingsHandler(ImU8String typeName) { fixed (byte* typeNamePtr = &typeName.GetPinnableNullTerminatedReference()) ImGuiPNative.RemoveSettingsHandler(typeNamePtr); @@ -401,7 +401,7 @@ public unsafe partial class ImGuiP } public static bool SliderBehavior( - ImRect bb, uint id, ImGuiDataType dataType, scoped ref T value, T min, T max, Utf8Buffer format, + ImRect bb, uint id, ImGuiDataType dataType, scoped ref T value, T min, T max, ImU8String format, ImGuiSliderFlags flags, ImRectPtr outGrabBb) where T : unmanaged, IBinaryNumber { @@ -423,7 +423,7 @@ public unsafe partial class ImGuiP } } - public static Vector2 TabItemCalcSize(Utf8Buffer label, bool hasCloseButton) + public static Vector2 TabItemCalcSize(ImU8String label, bool hasCloseButton) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { @@ -434,7 +434,7 @@ public unsafe partial class ImGuiP } public static bool TabItemEx( - ImGuiTabBarPtr tabBar, Utf8Buffer label, ref bool open, ImGuiTabItemFlags flags, ImGuiWindowPtr dockedWindow) + ImGuiTabBarPtr tabBar, ImU8String label, ref bool open, ImGuiTabItemFlags flags, ImGuiWindowPtr dockedWindow) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (bool* openPtr = &open) @@ -446,7 +446,7 @@ public unsafe partial class ImGuiP } public static void TabItemLabelAndCloseButton( - ImDrawListPtr drawList, ImRect bb, ImGuiTabItemFlags flags, Vector2 framePadding, Utf8Buffer label, uint tabId, + ImDrawListPtr drawList, ImRect bb, ImGuiTabItemFlags flags, Vector2 framePadding, ImU8String label, uint tabId, uint closeButtonId, bool isContentsVisible, out bool justClosed, out bool textClipped) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) @@ -470,7 +470,7 @@ public unsafe partial class ImGuiP } public static bool TempInputScalar( - ImRect bb, uint id, Utf8Buffer label, ImGuiDataType dataType, scoped ref T data, Utf8Buffer format, T min, + ImRect bb, uint id, ImU8String label, ImGuiDataType dataType, scoped ref T data, ImU8String format, T min, T max) where T : unmanaged, IBinaryNumber { @@ -484,7 +484,7 @@ public unsafe partial class ImGuiP } } - public static bool TreeNodeBehavior(uint id, ImGuiTreeNodeFlags flags, Utf8Buffer label) + public static bool TreeNodeBehavior(uint id, ImGuiTreeNodeFlags flags, ImU8String label) { fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) { diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Plot.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Plot.cs index 9fac88c3c..8f552d4fb 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Plot.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Plot.cs @@ -1,34 +1,26 @@ using System.Diagnostics.CodeAnalysis; using System.Numerics; -using System.Runtime.InteropServices; namespace Dalamud.Bindings.ImGui; [SuppressMessage("ReSharper", "InconsistentNaming")] public static unsafe partial class ImGuiP { - public delegate float GetFloatDelegate(int index); - - public delegate float GetFloatDelegate(scoped in T context, int index); - public static int PlotEx( - ImGuiPlotType plotType, Utf8Buffer label, GetFloatDelegate valuesGetter, - int valuesCount, int valuesOffset, Utf8Buffer overlayText, float scaleMin, float scaleMax, Vector2 frameSize) + ImGuiPlotType plotType, ImU8String label, ImGui.GetFloatDelegate valuesGetter, + int valuesCount, int valuesOffset, ImU8String overlayText, float scaleMin, float scaleMax, Vector2 frameSize) { - var dataBuffer = stackalloc void*[1]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* overlayTextPtr = &overlayText.GetPinnableNullTerminatedReference()) -#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type { - dataBuffer[0] = &valuesGetter; -#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var dataBuffer = PointerTuple.CreateFixed(ref valuesGetter); var r = ImGuiPNative.PlotEx( plotType, labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithoutContext, - dataBuffer, + (nint)(delegate* unmanaged)&ImGui.GetFloatStatic, + &dataBuffer, valuesCount, valuesOffset, overlayTextPtr, @@ -42,25 +34,25 @@ public static unsafe partial class ImGuiP } public static int PlotEx( - ImGuiPlotType plotType, Utf8Buffer label, GetFloatDelegate valuesGetter, scoped in TContext context, - int valuesCount, int valuesOffset, Utf8Buffer overlayText, float scaleMin, float scaleMax, Vector2 frameSize) + ImGuiPlotType plotType, ImU8String label, ImGui.GetFloatInContextDelegate valuesGetter, + scoped in TContext context, + int valuesCount, int valuesOffset, ImU8String overlayText, float scaleMin, float scaleMax, Vector2 frameSize) + where TContext : allows ref struct { - var dataBuffer = stackalloc void*[2]; fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) fixed (byte* overlayTextPtr = &overlayText.GetPinnableNullTerminatedReference()) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type fixed (TContext* contextPtr = &context) { - dataBuffer[0] = &valuesGetter; - dataBuffer[1] = contextPtr; + var dataBuffer = PointerTuple.Create(&valuesGetter, contextPtr); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type var r = ImGuiPNative.PlotEx( plotType, labelPtr, (delegate*, void*, int, int, byte*, float, float, Vector2, float>) - (nint)(delegate* unmanaged)&GetFloatWithContext, - dataBuffer, + (nint)(delegate* unmanaged)&ImGui.GetFloatInContextStatic, + &dataBuffer, valuesCount, valuesOffset, overlayTextPtr, @@ -73,13 +65,35 @@ public static unsafe partial class ImGuiP } } + public static int PlotEx( + ImGuiPlotType plotType, ImU8String label, ImGui.GetFloatRefContextDelegate valuesGetter, + scoped in TContext context, + int valuesCount, int valuesOffset, ImU8String overlayText, float scaleMin, float scaleMax, Vector2 frameSize) + where TContext: allows ref struct + { + fixed (byte* labelPtr = &label.GetPinnableNullTerminatedReference()) + fixed (byte* overlayTextPtr = &overlayText.GetPinnableNullTerminatedReference()) #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type - [UnmanagedCallersOnly] - private static float GetFloatWithContext(void* data, int index) => - ((GetFloatDelegate*)((void**)data)[0])->Invoke(*(object*)((void**)data)[1], index); - - [UnmanagedCallersOnly] - private static float GetFloatWithoutContext(void* data, int index) => - ((GetFloatDelegate*)((void**)data)[0])->Invoke(index); + fixed (TContext* contextPtr = &context) + { + var dataBuffer = PointerTuple.Create(&valuesGetter, contextPtr); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type + var r = ImGuiPNative.PlotEx( + plotType, + labelPtr, + (delegate*, void*, int, int, byte*, float, float, + Vector2, float>) + (nint)(delegate* unmanaged)&ImGui.GetFloatRefContextStatic, + &dataBuffer, + valuesCount, + valuesOffset, + overlayTextPtr, + scaleMin, + scaleMax, + frameSize); + label.Dispose(); + overlayText.Dispose(); + return r; + } + } } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Text.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Text.cs index 039d1649a..2f12a55c1 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Text.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiP.Text.cs @@ -6,7 +6,7 @@ namespace Dalamud.Bindings.ImGui; public static unsafe partial class ImGuiP { - public static void DebugLog(Utf8Buffer text) + public static void DebugLog(ImU8String text) { var g = ImGui.GetCurrentContext().Handle; ImGui.append(&g->DebugLogBuf, $"[{g->FrameCount:00000}] "); @@ -31,7 +31,7 @@ public static unsafe partial class ImGuiP public static int FindRenderedTextEnd( ReadOnlySpan text, out ReadOnlySpan before, out ReadOnlySpan after) { - var textBuf = new Utf8Buffer(text); + var textBuf = new ImU8String(text); FindRenderedTextEnd(textBuf.Span, out var beforeBytes, out var afterBytes); before = text[..Encoding.UTF8.GetCharCount(beforeBytes)]; after = text[before.Length..]; @@ -39,7 +39,7 @@ public static unsafe partial class ImGuiP return before.Length; } - public static uint GetID(ImGuiWindowPtr self, Utf8Buffer str) + public static uint GetID(ImGuiWindowPtr self, ImU8String str) { fixed (byte* strPtr = str.Span) { @@ -61,7 +61,7 @@ public static unsafe partial class ImGuiP fixed (byte* ptr = data) return ImGuiPNative.ImHashData(ptr, (nuint)data.Length, seed); } - public static uint ImHashStr(Utf8Buffer data, uint seed = 0) + public static uint ImHashStr(ImU8String data, uint seed = 0) { fixed (byte* ptr = data.Span) { @@ -130,7 +130,7 @@ public static unsafe partial class ImGuiP return i; } - public static void LogRenderedText(scoped in Vector2 refPos, Utf8Buffer text) + public static void LogRenderedText(scoped in Vector2 refPos, ImU8String text) { fixed (Vector2* refPosPtr = &refPos) fixed (byte* textPtr = text.Span) @@ -138,7 +138,7 @@ public static unsafe partial class ImGuiP text.Dispose(); } - public static void RenderText(Vector2 pos, Utf8Buffer text, bool hideTextAfterHash = true) + public static void RenderText(Vector2 pos, ImU8String text, bool hideTextAfterHash = true) { fixed (byte* textPtr = text.Span) ImGuiPNative.RenderText(pos, textPtr, textPtr + text.Length, hideTextAfterHash ? (byte)1 : (byte)0); @@ -146,7 +146,7 @@ public static unsafe partial class ImGuiP } public static void RenderTextWrapped( - Vector2 pos, Utf8Buffer text, float wrapWidth) + Vector2 pos, ImU8String text, float wrapWidth) { fixed (byte* textPtr = text.Span) ImGuiPNative.RenderTextWrapped(pos, textPtr, textPtr + text.Length, wrapWidth); @@ -154,7 +154,7 @@ public static unsafe partial class ImGuiP } public static void RenderTextClipped( - scoped in Vector2 posMin, scoped in Vector2 posMax, Utf8Buffer text, + scoped in Vector2 posMin, scoped in Vector2 posMax, ImU8String text, scoped in Vector2? textSizeIfKnown = null, scoped in Vector2 align = default, scoped in ImRect? clipRect = null) { @@ -174,7 +174,7 @@ public static unsafe partial class ImGuiP public static void RenderTextClippedEx( ImDrawListPtr drawList, scoped in Vector2 posMin, scoped in Vector2 posMax, - Utf8Buffer text, + ImU8String text, scoped in Vector2? textSizeIfKnown = null, scoped in Vector2 align = default, scoped in ImRect? clipRect = null) { var textSizeIfKnownOrDefault = textSizeIfKnown ?? default; @@ -194,7 +194,7 @@ public static unsafe partial class ImGuiP public static void RenderTextEllipsis( ImDrawListPtr drawList, scoped in Vector2 posMin, scoped in Vector2 posMax, float clipMaxX, float ellipsisMaxX, - Utf8Buffer text, scoped in Vector2? textSizeIfKnown = null) + ImU8String text, scoped in Vector2? textSizeIfKnown = null) { var textSizeIfKnownOrDefault = textSizeIfKnown ?? default; fixed (byte* textPtr = text.Span) diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiPayload.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiPayload.Custom.cs index 0bb8c7a0d..48819292d 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiPayload.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiPayload.Custom.cs @@ -4,7 +4,7 @@ public unsafe partial struct ImGuiPayload { public readonly Span DataSpan => new(this.Data, this.DataSize); - public readonly bool IsDataType(Utf8Buffer type) + public readonly bool IsDataType(ImU8String type) { fixed (ImGuiPayload* ptr = &this) return ImGui.IsDataType(ptr, type); @@ -13,5 +13,5 @@ public unsafe partial struct ImGuiPayload public partial struct ImGuiPayloadPtr { - public readonly bool IsDataType(Utf8Buffer type) => ImGui.IsDataType(this, type); + public readonly bool IsDataType(ImU8String type) => ImGui.IsDataType(this, type); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextBuffer.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextBuffer.Custom.cs index cd7fe202c..a8633d5ae 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextBuffer.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextBuffer.Custom.cs @@ -2,7 +2,7 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImGuiTextBuffer { - public void append(Utf8Buffer str) + public void append(ImU8String str) { fixed (ImGuiTextBuffer* thisPtr = &this) ImGui.append(thisPtr, str); @@ -11,5 +11,5 @@ public unsafe partial struct ImGuiTextBuffer public partial struct ImGuiTextBufferPtr { - public void append(Utf8Buffer str) => ImGui.append(this, str); + public void append(ImU8String str) => ImGui.append(this, str); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextFilter.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextFilter.Custom.cs index b01774cf9..03795d5e7 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextFilter.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiTextFilter.Custom.cs @@ -2,13 +2,13 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImGuiTextFilter { - public void Draw(Utf8Buffer label = default, float width = 0.0f) + public void Draw(ImU8String label = default, float width = 0.0f) { fixed (ImGuiTextFilter* thisPtr = &this) ImGui.Draw(thisPtr, label, width); } - public void PassFilter(Utf8Buffer text) + public void PassFilter(ImU8String text) { fixed (ImGuiTextFilter* thisPtr = &this) ImGui.PassFilter(thisPtr, text); @@ -17,6 +17,6 @@ public unsafe partial struct ImGuiTextFilter public partial struct ImGuiTextFilterPtr { - public void Draw(Utf8Buffer label = default, float width = 0.0f) => ImGui.Draw(this, label, width); - public void PassFilter(Utf8Buffer text) => ImGui.PassFilter(this, text); + public void Draw(ImU8String label = default, float width = 0.0f) => ImGui.Draw(this, label, width); + public void PassFilter(ImU8String text) => ImGui.PassFilter(this, text); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiWindow.Custom.cs b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiWindow.Custom.cs index de1651b97..b80ca9c0b 100644 --- a/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiWindow.Custom.cs +++ b/imgui/Dalamud.Bindings.ImGui/Custom/ImGuiWindow.Custom.cs @@ -2,7 +2,7 @@ namespace Dalamud.Bindings.ImGui; public unsafe partial struct ImGuiWindow { - public readonly uint GetID(Utf8Buffer str) + public readonly uint GetID(ImU8String str) { fixed (ImGuiWindow* thisPtr = &this) return ImGuiP.GetID(thisPtr, str); } @@ -20,7 +20,7 @@ public unsafe partial struct ImGuiWindow public unsafe partial struct ImGuiWindowPtr { - public readonly uint GetID(Utf8Buffer str) => ImGuiP.GetID(this.Handle, str); + public readonly uint GetID(ImU8String str) => ImGuiP.GetID(this.Handle, str); public readonly uint GetID(void* ptr) => ImGuiP.GetID(this.Handle, ptr); public readonly uint GetID(int n) => ImGuiP.GetID(this.Handle, n); } diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/PointerTuple.cs b/imgui/Dalamud.Bindings.ImGui/Custom/PointerTuple.cs new file mode 100644 index 000000000..096ec47ce --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/Custom/PointerTuple.cs @@ -0,0 +1,116 @@ +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Dalamud.Bindings.ImGui; + +#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type +internal static unsafe class PointerTuple +{ + public static ref PointerTuple From(void* ptr) + where T1 : allows ref struct + => ref *(PointerTuple*)ptr; + + public static PointerTuple Create(T1* item1Ptr) + where T1 : allows ref struct + => new() + { + Item1Ptr = item1Ptr, + }; + + public static PointerTuple CreateFixed(ref T1 item1) + where T1 : allows ref struct + => new() + { + Item1Ptr = (T1*)Unsafe.AsPointer(ref item1), + }; + + public static ref PointerTuple From(void* ptr) + where T1 : allows ref struct + where T2 : allows ref struct + => ref *(PointerTuple*)ptr; + + public static PointerTuple Create(T1* item1Ptr, T2* item2Ptr) + where T1 : allows ref struct + where T2 : allows ref struct + => new() + { + Item1Ptr = item1Ptr, + Item2Ptr = item2Ptr, + }; + + public static PointerTuple CreateFixed(ref T1 item1, ref T2 item2) + where T1 : allows ref struct + where T2 : allows ref struct + => new() + { + Item1Ptr = (T1*)Unsafe.AsPointer(ref item1), + Item2Ptr = (T2*)Unsafe.AsPointer(ref item2), + }; + + public static ref PointerTuple From(void* ptr) + where T1 : allows ref struct + where T2 : allows ref struct + where T3 : allows ref struct + => ref *(PointerTuple*)ptr; + + public static PointerTuple Create(T1* item1Ptr, T2* item2Ptr, T3* item3Ptr) + where T1 : allows ref struct + where T2 : allows ref struct + where T3 : allows ref struct + => new() + { + Item1Ptr = item1Ptr, + Item2Ptr = item2Ptr, + Item3Ptr = item3Ptr, + }; + + public static PointerTuple CreateFixed(ref T1 item1, ref T2 item2, ref T3 item3) + where T1 : allows ref struct + where T2 : allows ref struct + where T3 : allows ref struct + => new() + { + Item1Ptr = (T1*)Unsafe.AsPointer(ref item1), + Item2Ptr = (T2*)Unsafe.AsPointer(ref item2), + Item3Ptr = (T3*)Unsafe.AsPointer(ref item3), + }; +} + +[StructLayout(LayoutKind.Sequential)] +internal unsafe struct PointerTuple + where T1 : allows ref struct +{ + public T1* Item1Ptr; + + public readonly ref T1 Item1 => ref *this.Item1Ptr; +} + +[StructLayout(LayoutKind.Sequential)] +internal unsafe struct PointerTuple + where T1 : allows ref struct + where T2 : allows ref struct +{ + public T1* Item1Ptr; + public T2* Item2Ptr; + + public readonly ref T1 Item1 => ref *this.Item1Ptr; + + public readonly ref T2 Item2 => ref *this.Item2Ptr; +} + +[StructLayout(LayoutKind.Sequential)] +internal unsafe struct PointerTuple + where T1 : allows ref struct + where T2 : allows ref struct + where T3 : allows ref struct +{ + public T1* Item1Ptr; + public T2* Item2Ptr; + public T3* Item3Ptr; + + public readonly ref T1 Item1 => ref *this.Item1Ptr; + + public readonly ref T2 Item2 => ref *this.Item2Ptr; + + public readonly ref T3 Item3 => ref *this.Item3Ptr; +} diff --git a/imgui/Dalamud.Bindings.ImGui/Custom/Utf8Buffer.cs b/imgui/Dalamud.Bindings.ImGui/Custom/Utf8Buffer.cs deleted file mode 100644 index aca0c5cf3..000000000 --- a/imgui/Dalamud.Bindings.ImGui/Custom/Utf8Buffer.cs +++ /dev/null @@ -1,334 +0,0 @@ -using System.Buffers; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Text.Unicode; - -namespace Dalamud.Bindings.ImGui; - -[StructLayout(LayoutKind.Sequential, Size = TotalBufferSize)] -[InterpolatedStringHandler] -public ref struct Utf8Buffer : IDisposable -{ - private const int TotalBufferSize = 1024; - private const int FixedBufferSize = TotalBufferSize - 8 - 8 - 8 - 1; - private const int MinimumRentSize = TotalBufferSize * 2; - private byte[]? rentedBuffer; - private ReadOnlySpan span; - private IFormatProvider? formatProvider; - private State state; - private unsafe fixed byte fixedBuffer[FixedBufferSize]; - - [Flags] - private enum State : byte - { - None = 0, - Initialized = 1 << 0, - NullTerminated = 1 << 1, - Interpolation = 1 << 2, - OwnedSpan = 1 << 3, - } - - public Utf8Buffer(int literalLength, int formattedCount) : this(ReadOnlySpan.Empty) - { - this.state |= State.Interpolation; - literalLength += formattedCount * 4; - if (literalLength >= FixedBufferSize) - IncreaseBuffer(out _, literalLength); - } - - public Utf8Buffer(int literalLength, int formattedCount, IFormatProvider? formatProvider) : this( - literalLength, - formattedCount) - { - this.formatProvider = formatProvider; - } - - public unsafe Utf8Buffer(ReadOnlySpan text) - { - this.state = State.Initialized; - if (text.IsEmpty) - { - this.span = MemoryMarshal.CreateSpan(ref this.fixedBuffer[0], 0); - this.fixedBuffer[0] = 0; - this.state |= State.NullTerminated | State.OwnedSpan; - } - else - { - this.span = text; - if (Unsafe.Add(ref Unsafe.AsRef(in text[0]), text.Length) == 0) this.state |= State.NullTerminated; - } - } - - public Utf8Buffer(ReadOnlyMemory text) : this(text.Span) - { - } - - public unsafe Utf8Buffer(ReadOnlySpan text) - { - this.state = State.Initialized | State.NullTerminated; - var cb = Encoding.UTF8.GetByteCount(text); - if (cb + 1 < FixedBufferSize) - { - var newSpan = MemoryMarshal.CreateSpan(ref this.fixedBuffer[0], cb); - this.span = newSpan; - Encoding.UTF8.GetBytes(text, newSpan); - this.fixedBuffer[cb] = 0; - this.state |= State.OwnedSpan; - } - else - { - this.rentedBuffer = ArrayPool.Shared.Rent(cb + 1); - var newSpan = this.rentedBuffer.AsSpan(0, cb); - this.span = newSpan; - Encoding.UTF8.GetBytes(text, newSpan); - this.rentedBuffer[cb] = 0; - } - } - - public Utf8Buffer(ReadOnlyMemory text) : this(text.Span) - { - } - - public Utf8Buffer(string? text) : this(text.AsSpan()) - { - } - - public unsafe Utf8Buffer(byte* text) : this(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(text)) - { - this.state |= State.NullTerminated; - } - - public unsafe Utf8Buffer(char* text) : this(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(text)) - { - } - - public static Utf8Buffer Empty => default; - - public readonly unsafe ReadOnlySpan Span => - (this.state & State.OwnedSpan) != 0 - ? MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.fixedBuffer[0]), this.span.Length) - : this.span; - - public readonly int Length => this.span.Length; - - public readonly bool IsNull => (this.state & State.Initialized) == 0; - - public readonly bool IsEmpty => this.span.IsEmpty; - - public unsafe ref readonly byte GetPinnableNullTerminatedReference(ReadOnlySpan defaultValue = default) - { - if (this.IsNull) - return ref defaultValue.GetPinnableReference(); - - if (this.IsEmpty) - { - this.fixedBuffer[0] = 0; - return ref this.fixedBuffer[0]; - } - - if ((this.state & State.OwnedSpan) != 0) - this.span = MemoryMarshal.CreateSpan(ref this.fixedBuffer[0], this.span.Length); - - if ((this.state & State.NullTerminated) == 0) - { - if (this.span.Length + 1 < FixedBufferSize) - { - var newSpan = MemoryMarshal.CreateSpan(ref this.fixedBuffer[0], this.span.Length); - this.span.CopyTo(newSpan); - this.fixedBuffer[newSpan.Length] = 0; - this.span = newSpan; - } - else - { - this.rentedBuffer = ArrayPool.Shared.Rent(this.span.Length + 1); - var newSpan = this.rentedBuffer.AsSpan(0, this.span.Length); - this.span.CopyTo(newSpan); - this.rentedBuffer[newSpan.Length] = 0; - } - - this.state |= State.NullTerminated; - } - - return ref this.span[0]; - } - - private unsafe Span EffectiveBuffer => - this.rentedBuffer is { } buf - ? buf.AsSpan() - : MemoryMarshal.CreateSpan(ref this.fixedBuffer[0], FixedBufferSize); - - private Span RemainingBuffer => this.EffectiveBuffer[this.span.Length..]; - - public static implicit operator Utf8Buffer(ReadOnlySpan text) => new(text); - public static implicit operator Utf8Buffer(ReadOnlyMemory text) => new(text); - public static implicit operator Utf8Buffer(Span text) => new(text); - public static implicit operator Utf8Buffer(Memory text) => new(text); - public static implicit operator Utf8Buffer(byte[]? text) => new(text.AsSpan()); - public static implicit operator Utf8Buffer(ReadOnlySpan text) => new(text); - public static implicit operator Utf8Buffer(ReadOnlyMemory text) => new(text); - public static implicit operator Utf8Buffer(Span text) => new(text); - public static implicit operator Utf8Buffer(Memory text) => new(text); - public static implicit operator Utf8Buffer(char[]? text) => new(text.AsSpan()); - public static implicit operator Utf8Buffer(string? text) => new(text); - public static unsafe implicit operator Utf8Buffer(byte* text) => new(text); - public static unsafe implicit operator Utf8Buffer(char* text) => new(text); - - public void Dispose() - { - if (this.rentedBuffer is { } buf) - { - this.rentedBuffer = null; - this.span = default; - ArrayPool.Shared.Return(buf); - } - - this.state = State.None; - } - - public Utf8Buffer MoveOrDefault(Utf8Buffer other) - { - if (!this.IsNull) - { - other.Dispose(); - var res = this; - this = default; - return res; - } - - return other; - } - - public override readonly string ToString() => Encoding.UTF8.GetString(this.Span); - - public void AppendLiteral(string value) - { - if (string.IsNullOrEmpty(value)) - return; - - var remaining = this.RemainingBuffer; - var len = Encoding.UTF8.GetByteCount(value); - if (remaining.Length <= len) - this.IncreaseBuffer(out remaining, this.span.Length + len + 1); - Encoding.UTF8.GetBytes(value.AsSpan(), remaining); - var newSpan = this.EffectiveBuffer[..(this.span.Length + len + 1)]; - newSpan[^1] = 0; - this.span = newSpan[..^1]; - } - - public void AppendFormatted(ReadOnlySpan value) => this.AppendFormatted(value, null); - - public void AppendFormatted(ReadOnlySpan value, string? format) - { - var remaining = this.RemainingBuffer; - if (remaining.Length < value.Length + 1) - this.IncreaseBuffer(out remaining, this.span.Length + value.Length + 1); - value.CopyTo(remaining); - var newSpan = this.EffectiveBuffer[..(this.span.Length + value.Length + 1)]; - newSpan[^1] = 0; - this.span = newSpan[..^1]; - } - - public void AppendFormatted(ReadOnlySpan value, int alignment) => this.AppendFormatted(value, alignment, null); - - public void AppendFormatted(ReadOnlySpan value, int alignment, string? format) - { - var startingPos = this.span.Length; - this.AppendFormatted(value, format); - FixAlignment(startingPos, alignment); - } - - public void AppendFormatted(ReadOnlySpan value) => this.AppendFormatted(value, null); - - public void AppendFormatted(ReadOnlySpan value, string? format) - { - var remaining = this.RemainingBuffer; - var len = Encoding.UTF8.GetByteCount(value); - if (remaining.Length < len + 1) - this.IncreaseBuffer(out remaining, this.span.Length + len + 1); - Encoding.UTF8.GetBytes(value, remaining); - - var newSpan = this.EffectiveBuffer[..(this.span.Length + len + 1)]; - newSpan[^1] = 0; - this.span = newSpan[..^1]; - } - - public void AppendFormatted(ReadOnlySpan value, int alignment) => this.AppendFormatted(value, alignment, null); - - public void AppendFormatted(ReadOnlySpan value, int alignment, string? format) - { - var startingPos = this.span.Length; - this.AppendFormatted(value, format); - FixAlignment(startingPos, alignment); - } - - public void AppendFormatted(T value) => this.AppendFormatted(value, null); - - public void AppendFormatted(T value, string? format) - { - var remaining = this.RemainingBuffer; - int written; - while (!Utf8.TryWrite(remaining, this.formatProvider, $"{value}\0", out written)) - this.IncreaseBuffer(out remaining); - - this.span = this.EffectiveBuffer[..(this.span.Length + written - 1)]; - } - - public void AppendFormatted(T value, int alignment) => this.AppendFormatted(value, alignment, null); - - public void AppendFormatted(T value, int alignment, string? format) - { - var startingPos = this.span.Length; - this.AppendFormatted(value, format); - FixAlignment(startingPos, alignment); - } - - private void FixAlignment(int startingPos, int alignment) - { - var appendedLength = this.span.Length - startingPos; - - var leftAlign = alignment < 0; - if (leftAlign) - alignment = -alignment; - - var fillLength = alignment - appendedLength; - if (fillLength <= 0) - return; - - var destination = this.EffectiveBuffer; - if (fillLength > destination.Length - this.span.Length) - { - this.IncreaseBuffer(out _, fillLength + 1); - destination = this.EffectiveBuffer; - } - - if (leftAlign) - { - destination.Slice(this.span.Length, fillLength).Fill((byte)' '); - } - else - { - destination.Slice(startingPos, appendedLength).CopyTo(destination[(startingPos + fillLength)..]); - destination.Slice(startingPos, fillLength).Fill((byte)' '); - } - - var newSpan = destination[..(this.span.Length + fillLength + 1)]; - newSpan[^1] = 0; - this.span = newSpan[..^1]; - } - - private void IncreaseBuffer(out Span remaining, int minCapacity = 0) - { - minCapacity = Math.Max(minCapacity, Math.Max(this.EffectiveBuffer.Length * 2, MinimumRentSize)); - var newBuffer = ArrayPool.Shared.Rent(minCapacity); - this.Span.CopyTo(newBuffer); - newBuffer[this.span.Length] = 0; - this.span = newBuffer.AsSpan(0, this.span.Length); - if (this.rentedBuffer is not null) - ArrayPool.Shared.Return(this.rentedBuffer); - - this.rentedBuffer = newBuffer; - this.state &= ~State.OwnedSpan; - remaining = newBuffer.AsSpan(this.span.Length); - } -} diff --git a/imgui/Dalamud.Bindings.ImGui/Dalamud.Bindings.ImGui.csproj b/imgui/Dalamud.Bindings.ImGui/Dalamud.Bindings.ImGui.csproj index 86a43a8e4..fc5894857 100644 --- a/imgui/Dalamud.Bindings.ImGui/Dalamud.Bindings.ImGui.csproj +++ b/imgui/Dalamud.Bindings.ImGui/Dalamud.Bindings.ImGui.csproj @@ -16,23 +16,26 @@ + + + - + diff --git a/imgui/Dalamud.Bindings.ImGui/ImU8String.cs b/imgui/Dalamud.Bindings.ImGui/ImU8String.cs new file mode 100644 index 000000000..d1b9ae6c2 --- /dev/null +++ b/imgui/Dalamud.Bindings.ImGui/ImU8String.cs @@ -0,0 +1,378 @@ +using System.Buffers; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Text.Unicode; + +namespace Dalamud.Bindings.ImGui; + +[InterpolatedStringHandler] +public ref struct ImU8String : IDisposable +{ + public const int AllocFreeBufferSize = 512; + private const int MinimumRentSize = AllocFreeBufferSize * 2; + + private IFormatProvider? formatProvider; + private byte[]? rentedBuffer; + private ref readonly byte externalFirstByte; + private State state; + private FixedBufferContainer fixedBuffer; + + [Flags] + private enum State : byte + { + None = 0, + Initialized = 1 << 0, + NullTerminated = 1 << 1, + Interpolation = 1 << 2, + } + + public ImU8String() + { + Unsafe.SkipInit(out this.fixedBuffer); + this.FixedBufferByteRef = 0; + } + + public ImU8String(int literalLength, int formattedCount) + : this(ReadOnlySpan.Empty) + { + this.state |= State.Interpolation; + literalLength += formattedCount * 4; + this.Reserve(literalLength); + } + + public ImU8String(int literalLength, int formattedCount, IFormatProvider? formatProvider) + : this(literalLength, formattedCount) + { + this.formatProvider = formatProvider; + } + + public ImU8String(ReadOnlySpan text, bool ensureNullTermination = false) + : this() + { + this.state = State.Initialized; + if (text.IsEmpty) + { + this.state |= State.NullTerminated; + } + else if (ensureNullTermination) + { + this.Reserve(text.Length + 1); + var buffer = this.Buffer; + text.CopyTo(buffer); + buffer[^1] = 0; + this.Length = text.Length; + this.state |= State.NullTerminated; + } + else + { + this.externalFirstByte = ref text[0]; + this.Length = text.Length; + if (Unsafe.Add(ref Unsafe.AsRef(in this.externalFirstByte), this.Length) == 0) + this.state |= State.NullTerminated; + } + } + + public ImU8String(ReadOnlyMemory text, bool ensureNullTermination = false) + : this(text.Span, ensureNullTermination) + { + } + + public ImU8String(ReadOnlySpan text) + : this() + { + this.state = State.Initialized | State.NullTerminated; + this.Length = Encoding.UTF8.GetByteCount(text); + if (this.Length + 1 < AllocFreeBufferSize) + { + var newSpan = this.FixedBufferSpan[..this.Length]; + Encoding.UTF8.GetBytes(text, newSpan); + this.FixedBufferSpan[this.Length] = 0; + } + else + { + this.rentedBuffer = ArrayPool.Shared.Rent(this.Length + 1); + var newSpan = this.rentedBuffer.AsSpan(0, this.Length); + Encoding.UTF8.GetBytes(text, newSpan); + this.rentedBuffer[this.Length] = 0; + } + } + + public ImU8String(ReadOnlyMemory text) + : this(text.Span) + { + } + + public ImU8String(string? text) + : this(text.AsSpan()) + { + } + + public unsafe ImU8String(byte* text) + : this(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(text)) + { + this.state |= State.NullTerminated; + } + + public unsafe ImU8String(char* text) + : this(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(text)) + { + } + + public static ImU8String Empty => default; + + public readonly ReadOnlySpan Span => + !Unsafe.IsNullRef(in this.externalFirstByte) + ? MemoryMarshal.CreateReadOnlySpan(in this.externalFirstByte, this.Length) + : this.rentedBuffer is { } rented + ? rented.AsSpan(0, this.Length) + : Unsafe.AsRef(in this).FixedBufferSpan[..this.Length]; + + public int Length { get; private set; } + + public readonly bool IsNull => (this.state & State.Initialized) == 0; + + public readonly bool IsEmpty => this.Length == 0; + + internal Span Buffer + { + get + { + if (Unsafe.IsNullRef(in this.externalFirstByte)) + this.ConvertToOwned(); + + return this.rentedBuffer is { } buf + ? buf.AsSpan() + : MemoryMarshal.Cast(new(ref Unsafe.AsRef(ref this.fixedBuffer))); + } + } + + private Span RemainingBuffer => this.Buffer[this.Length..]; + + private ref byte FixedBufferByteRef => ref this.FixedBufferSpan[0]; + + private Span FixedBufferSpan => + MemoryMarshal.Cast(new(ref Unsafe.AsRef(ref this.fixedBuffer))); + + public static implicit operator ImU8String(ReadOnlySpan text) => new(text); + public static implicit operator ImU8String(ReadOnlyMemory text) => new(text); + public static implicit operator ImU8String(Span text) => new(text); + public static implicit operator ImU8String(Memory text) => new(text); + public static implicit operator ImU8String(byte[]? text) => new(text.AsSpan()); + public static implicit operator ImU8String(ReadOnlySpan text) => new(text); + public static implicit operator ImU8String(ReadOnlyMemory text) => new(text); + public static implicit operator ImU8String(Span text) => new(text); + public static implicit operator ImU8String(Memory text) => new(text); + public static implicit operator ImU8String(char[]? text) => new(text.AsSpan()); + public static implicit operator ImU8String(string? text) => new(text); + public static unsafe implicit operator ImU8String(byte* text) => new(text); + public static unsafe implicit operator ImU8String(char* text) => new(text); + + public ref readonly byte GetPinnableNullTerminatedReference(ReadOnlySpan defaultValue = default) + { + if (this.IsNull) + return ref defaultValue.GetPinnableReference(); + + if (this.IsEmpty) + { + ref var t = ref this.FixedBufferSpan[0]; + t = 0; + return ref t; + } + + if ((this.state & State.NullTerminated) == 0) + this.ConvertToOwned(); + + return ref this.Span[0]; + } + + private void ConvertToOwned() + { + if (Unsafe.IsNullRef(in this.externalFirstByte)) + return; + + Debug.Assert(this.rentedBuffer is null); + + if (this.Length + 1 < AllocFreeBufferSize) + { + var fixedBufferSpan = this.FixedBufferSpan; + this.Span.CopyTo(fixedBufferSpan); + fixedBufferSpan[this.Length] = 0; + } + else + { + var newBuffer = ArrayPool.Shared.Rent(this.Length + 1); + this.Span.CopyTo(newBuffer); + + newBuffer[this.Length] = 0; + this.rentedBuffer = newBuffer; + } + + this.state |= State.NullTerminated; + this.externalFirstByte = ref Unsafe.NullRef(); + } + + public void Dispose() + { + if (this.rentedBuffer is { } buf) + { + this.rentedBuffer = null; + ArrayPool.Shared.Return(buf); + } + } + + public ImU8String MoveOrDefault(ImU8String other) + { + if (!this.IsNull) + { + other.Dispose(); + var res = this; + this = default; + return res; + } + + return other; + } + + public override readonly string ToString() => Encoding.UTF8.GetString(this.Span); + + public void AppendLiteral(string value) + { + if (string.IsNullOrEmpty(value)) + return; + + var remaining = this.RemainingBuffer; + var len = Encoding.UTF8.GetByteCount(value); + if (remaining.Length <= len) + this.IncreaseBuffer(out remaining, this.Length + len + 1); + this.Buffer[this.Length += Encoding.UTF8.GetBytes(value.AsSpan(), remaining)] = 0; + } + + public void AppendFormatted(ReadOnlySpan value) => this.AppendFormatted(value, null); + + public void AppendFormatted(ReadOnlySpan value, string? format) + { + var remaining = this.RemainingBuffer; + if (remaining.Length < value.Length + 1) + this.IncreaseBuffer(out remaining, this.Length + value.Length + 1); + value.CopyTo(remaining); + this.Buffer[this.Length += value.Length] = 0; + } + + public void AppendFormatted(ReadOnlySpan value, int alignment) => + this.AppendFormatted(value, alignment, null); + + public void AppendFormatted(ReadOnlySpan value, int alignment, string? format) + { + var startingPos = this.Length; + this.AppendFormatted(value, format); + FixAlignment(startingPos, alignment); + } + + public void AppendFormatted(ReadOnlySpan value) => this.AppendFormatted(value, null); + + public void AppendFormatted(ReadOnlySpan value, string? format) + { + var remaining = this.RemainingBuffer; + var len = Encoding.UTF8.GetByteCount(value); + if (remaining.Length < len + 1) + this.IncreaseBuffer(out remaining, this.Length + len + 1); + this.Buffer[this.Length += Encoding.UTF8.GetBytes(value, remaining)] = 0; + } + + public void AppendFormatted(ReadOnlySpan value, int alignment) => + this.AppendFormatted(value, alignment, null); + + public void AppendFormatted(ReadOnlySpan value, int alignment, string? format) + { + var startingPos = this.Length; + this.AppendFormatted(value, format); + FixAlignment(startingPos, alignment); + } + + public void AppendFormatted(T value) => this.AppendFormatted(value, null); + + public void AppendFormatted(T value, string? format) + { + var remaining = this.RemainingBuffer; + if (remaining.Length < 1) + this.IncreaseBuffer(out remaining); + + int written; + while (true) + { + var handler = new Utf8.TryWriteInterpolatedStringHandler(1, 1, remaining[..^1], this.formatProvider, out _); + handler.AppendFormatted(value, format); + if (Utf8.TryWrite(remaining, this.formatProvider, ref handler, out written)) + break; + this.IncreaseBuffer(out remaining); + } + + this.Buffer[this.Length += written] = 0; + } + + public void AppendFormatted(T value, int alignment) => this.AppendFormatted(value, alignment, null); + + public void AppendFormatted(T value, int alignment, string? format) + { + var startingPos = this.Length; + this.AppendFormatted(value, format); + FixAlignment(startingPos, alignment); + } + + public void Reserve(int length) + { + if (length >= AllocFreeBufferSize) + IncreaseBuffer(out _, length); + } + + private void FixAlignment(int startingPos, int alignment) + { + var appendedLength = this.Length - startingPos; + + var leftAlign = alignment < 0; + if (leftAlign) + alignment = -alignment; + + var fillLength = alignment - appendedLength; + if (fillLength <= 0) + return; + + var destination = this.Buffer; + if (fillLength > destination.Length - this.Length) + { + this.IncreaseBuffer(out _, fillLength + 1); + destination = this.Buffer; + } + + if (leftAlign) + { + destination.Slice(this.Length, fillLength).Fill((byte)' '); + } + else + { + destination.Slice(startingPos, appendedLength).CopyTo(destination[(startingPos + fillLength)..]); + destination.Slice(startingPos, fillLength).Fill((byte)' '); + } + + this.Buffer[this.Length += fillLength] = 0; + } + + private void IncreaseBuffer(out Span remaining, int minCapacity = 0) + { + minCapacity = Math.Max(minCapacity, Math.Max(this.Buffer.Length * 2, MinimumRentSize)); + var newBuffer = ArrayPool.Shared.Rent(minCapacity); + this.Span.CopyTo(newBuffer); + newBuffer[this.Length] = 0; + if (this.rentedBuffer is not null) + ArrayPool.Shared.Return(this.rentedBuffer); + + this.rentedBuffer = newBuffer; + this.externalFirstByte = ref Unsafe.NullRef(); + remaining = newBuffer.AsSpan(this.Length); + } + + [StructLayout(LayoutKind.Sequential, Size = AllocFreeBufferSize)] + private struct FixedBufferContainer; +} diff --git a/imgui/Dalamud.Bindings.ImGui/ImVector.cs b/imgui/Dalamud.Bindings.ImGui/ImVector.cs index 7772871e8..9a10c1d6b 100644 --- a/imgui/Dalamud.Bindings.ImGui/ImVector.cs +++ b/imgui/Dalamud.Bindings.ImGui/ImVector.cs @@ -1,238 +1,237 @@ using System.Runtime.CompilerServices; -namespace Dalamud.Bindings.ImGui +namespace Dalamud.Bindings.ImGui; + +public unsafe struct ImVector { - public unsafe struct ImVector + public readonly int Size; + public readonly int Capacity; + public readonly void* Data; + + public ImVector(int size, int capacity, void* data) { - public readonly int Size; - public readonly int Capacity; - public readonly void* Data; + Size = size; + Capacity = capacity; + Data = data; + } - public ImVector(int size, int capacity, void* data) + public ref T Ref(int index) + { + return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); + } + + public IntPtr Address(int index) + { + return (IntPtr)((byte*)Data + index * Unsafe.SizeOf()); + } +} + +/// +/// A structure representing a dynamic array for unmanaged types. +/// +/// The type of elements in the vector, must be unmanaged. +public unsafe struct ImVector where T : unmanaged +{ + /// + /// Initializes a new instance of the struct with the specified size, capacity, and data pointer. + /// + /// The initial size of the vector. + /// The initial capacity of the vector. + /// Pointer to the initial data. + 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; + + + /// + /// Gets or sets the element at the specified index. + /// + /// The zero-based index of the element to get or set. + /// The element at the specified index. + /// Thrown when the index is out of range. + public T this[int index] + { + get { - Size = size; - Capacity = capacity; - Data = data; + if (index < 0 || index >= size) + { + throw new IndexOutOfRangeException(); + } + return data[index]; } - - public ref T Ref(int index) + set { - return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); - } - - public IntPtr Address(int index) - { - return (IntPtr)((byte*)Data + index * Unsafe.SizeOf()); + if (index < 0 || index >= size) + { + throw new IndexOutOfRangeException(); + } + data[index] = value; } } /// - /// A structure representing a dynamic array for unmanaged types. + /// Gets a pointer to the first element of the vector. /// - /// The type of elements in the vector, must be unmanaged. - public unsafe struct ImVector where T : unmanaged + public readonly T* Data => data; + + /// + /// Gets a pointer to the first element of the vector. + /// + public readonly T* Front => data; + + /// + /// Gets a pointer to the last element of the vector. + /// + public readonly T* Back => size > 0 ? data + size - 1 : null; + + /// + /// Gets or sets the capacity of the vector. + /// + public int Capacity { - /// - /// Initializes a new instance of the struct with the specified size, capacity, and data pointer. - /// - /// The initial size of the vector. - /// The initial capacity of the vector. - /// Pointer to the initial data. - public ImVector(int size, int capacity, T* data) + readonly get => capacity; + set { - this.size = size; - this.capacity = capacity; - this.data = data; - } - - private int size; - private int capacity; - private unsafe T* data; - - - /// - /// Gets or sets the element at the specified index. - /// - /// The zero-based index of the element to get or set. - /// The element at the specified index. - /// Thrown when the index is out of range. - public T this[int index] - { - get + if (capacity == value) { - if (index < 0 || index >= size) - { - throw new IndexOutOfRangeException(); - } - return data[index]; + return; } - set + + if (data == null) { - if (index < 0 || index >= size) - { - throw new IndexOutOfRangeException(); - } - data[index] = value; + data = (T*)ImGui.MemAlloc((nuint)(value * sizeof(T))); } - } - - /// - /// Gets a pointer to the first element of the vector. - /// - public readonly T* Data => data; - - /// - /// Gets a pointer to the first element of the vector. - /// - public readonly T* Front => data; - - /// - /// Gets a pointer to the last element of the vector. - /// - public readonly T* Back => size > 0 ? data + size - 1 : null; - - /// - /// Gets or sets the capacity of the vector. - /// - 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; - } - } - } - - /// - /// Gets the number of elements in the vector. - /// - public readonly int Size => size; - - /// - /// Grows the capacity of the vector to at least the specified value. - /// - /// The new capacity. - public void Grow(int newCapacity) - { - if (newCapacity > capacity) - { - Capacity = newCapacity * 2; - } - } - - /// - /// Ensures that the vector has at least the specified capacity. - /// - /// The minimum capacity required. - public void EnsureCapacity(int size) - { - if (size > capacity) - { - Grow(size); - } - } - - /// - /// Resizes the vector to the specified size. - /// - /// The new size of the vector. - public void Resize(int newSize) - { - EnsureCapacity(newSize); - size = newSize; - } - - /// - /// Clears all elements from the vector. - /// - public void Clear() - { - size = 0; - } - - /// - /// Adds an element to the end of the vector. - /// - /// The value to add. - public void PushBack(T value) - { - EnsureCapacity(size + 1); - data[size++] = value; - } - - /// - /// Removes the last element from the vector. - /// - public void PopBack() - { - if (size > 0) - { - size--; - } - } - - /// - /// Frees the memory allocated for the vector. - /// - public void Free() - { - if (data != null) + 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 = null; - size = 0; - capacity = 0; + data = newData; + size = newSize; } - } - public ref T Ref(int index) - { - return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); - } + capacity = value; - public ref TCast Ref(int index) - { - return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); - } - - public void* Address(int index) - { - return (byte*)Data + index * Unsafe.SizeOf(); - } - - public void* Address(int index) - { - return (byte*)Data + index * Unsafe.SizeOf(); - } - - public ImVector* ToUntyped() - { - return (ImVector*)Unsafe.AsPointer(ref this); + // Clear the rest of the data + for (int i = size; i < capacity; i++) + { + data[i] = default; + } } } + + /// + /// Gets the number of elements in the vector. + /// + public readonly int Size => size; + + /// + /// Grows the capacity of the vector to at least the specified value. + /// + /// The new capacity. + public void Grow(int newCapacity) + { + if (newCapacity > capacity) + { + Capacity = newCapacity * 2; + } + } + + /// + /// Ensures that the vector has at least the specified capacity. + /// + /// The minimum capacity required. + public void EnsureCapacity(int size) + { + if (size > capacity) + { + Grow(size); + } + } + + /// + /// Resizes the vector to the specified size. + /// + /// The new size of the vector. + public void Resize(int newSize) + { + EnsureCapacity(newSize); + size = newSize; + } + + /// + /// Clears all elements from the vector. + /// + public void Clear() + { + size = 0; + } + + /// + /// Adds an element to the end of the vector. + /// + /// The value to add. + public void PushBack(T value) + { + EnsureCapacity(size + 1); + data[size++] = value; + } + + /// + /// Removes the last element from the vector. + /// + public void PopBack() + { + if (size > 0) + { + size--; + } + } + + /// + /// Frees the memory allocated for the vector. + /// + 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((byte*)Data + index * Unsafe.SizeOf()); + } + + public ref TCast Ref(int index) + { + return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); + } + + public void* Address(int index) + { + return (byte*)Data + index * Unsafe.SizeOf(); + } + + public void* Address(int index) + { + return (byte*)Data + index * Unsafe.SizeOf(); + } + + public ImVector* ToUntyped() + { + return (ImVector*)Unsafe.AsPointer(ref this); + } } diff --git a/test.ps1 b/test.ps1 index b6c87705e..5d5089fb5 100644 --- a/test.ps1 +++ b/test.ps1 @@ -3,35 +3,33 @@ $ErrorActionPreference = "Stop" Set-StrictMode -Version Latest -$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False -$lines = New-Object -TypeName "System.Collections.Generic.List[string]" $namespaceDefPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^\s*)namespace\s+(?[\w.]+)\b', 'Compiled,Multiline,Singleline' $usingPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^|;)\s*using\s+(?\w+)\s*;', 'Compiled,Multiline,Singleline' $classDefPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?^\s*)(?public\s+|internal\s+|protected\s+|private\s+)?(?static\s+)?(?unsafe\s+)?(?partial\s+)?(?class\s+|struct\s+)(?\w+)\b', 'Compiled,Multiline,Singleline' -$methodPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^\s+?\[.*?\](?:\r\n|\r|\n))?(?^\s*)(?(?public\s+|internal\s+|protected\s+|private\s+)?(?static\s+)?(?unsafe\s+)?(?(?!public|internal|protected|private|static|unsafe)\w+(?:\s*<\s*\w+?(?:<\s*\w+\s*>?)?\s*>)?(?:\s*\*)?\s+)(?\w+)(?\s*\([^)]*\)))(?:\r\n|\r|\n)[\s\S]+?(?:^\k}(?:\r\n|\r|\n))', 'Compiled,Multiline,Singleline' -$emptyClassPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^\s+?\[.*?\](?:\r\n|\r|\n))?(?^\s*)(?public\s+|internal\s+|protected\s+|private\s+)?(?static\s+)?(?unsafe\s+)?(?partial\s+)?(?class\s+|struct\s+)(?\w+)\s*\{\s*\}', 'Compiled,Multiline,Singleline' -$emptyNamespacePattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^\s*)namespace\s+(?\w+)\b\s*\{\s*\}', 'Compiled,Multiline,Singleline' +$methodPattern = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?:^\s+?\[.*?\](?:\r\n|\r|\n))?(?^\s*)(?(?public\s+|internal\s+|protected\s+|private\s+)?(?static\s+)?(?unsafe\s+)?(?(?!public|internal|protected|private|static|unsafe)\w+(?:\s*<\s*\w+?(?:<\s*\w+\s*>?)?\s*>)?(?:\s*\*+)?\s+)(?\w+)(?\s*\([^)]*\)))(?:\r\n|\r|\n)[\s\S]+?(?:^\k}(?:\r\n|\r|\n))', 'Compiled,Multiline,Singleline' $referNativeFunction = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList '(?`r`n`r`nusing $([string]::Join(";`r`nusing ", $imports) );`r`n`r`n$husks" - $husks | Set-Content -Path "$( Split-Path $( Split-Path $targetPath ) )/Custom/Generated/$( Split-Path $( Split-Path $targetPath ) -Leaf ).$( Split-Path $targetPath -Leaf ).gen.cs" -Encoding ascii + $husks | Set-Content -Path "$targetPath.gen.cs" -Encoding ascii } $husks = "// `r`n`r`nusing $([string]::Join(";`r`nusing ", $imports) );`r`n`r`nnamespace $namespace;`r`n`r`n" @@ -256,6 +254,6 @@ foreach ($targetPath in $targetPaths) $null = $sb.Append("// DISCARDED: $methodName`r`n") } - $sb.ToString() | Set-Content -Path "$( Split-Path $( Split-Path $targetPath ) )/Custom/Generated/$className.gen.cs" -Encoding ascii + $sb.ToString() | Set-Content -Path "$targetPath/$className.gen.cs" -Encoding ascii } }