Gary Talent
ae51a42278
2db79d086 Merge branch 'master' into docking 00ad3c65b Version 1.90.7 f814ef816 Commented out CaptureKeyboardFromApp(), CaptureMouseFromApp(). Commented out obsolete IsKeyPressedMap() from imgui_internal.h (can call IsKeyPressed). Comments b9084949b Fixed typo in IsMouseDragging and GetMouseDragDelta's documentation. (#7620) 86931393a Shortcuts: Revert "SetShortcutRouting: require explicit routing. (#456) 975beafaf Merge branch 'master' into docking 7832e6a70 Shortcuts: Routing: fixed mixed keys<>chars filtering not applying on global routes. (#456, #7618) 85d982011 Shortcuts: fixed priority of route calculation (higher first). (#456, #7618) fee021059 Merge branch 'master' into docking ce4e210dc Shotcuts: renamed ImGuiInputFlags_RouteGlobalOverFocused -> ImGuiInputFlags_RouteOverFocused, ImGuiInputFlags_RouteGlobalOverActive -> ImGuiInputFlags_RouteOverActive in previsiion of using them with a Hovered route. (#456) 5ce3d2995 Shortcuts: rename ImGuiInputFlags_RouteGlobalHighest to ImGuiInputFlags_RouteGlobalOverActive, made ImGuiInputFlags_RouteGlobalOverFocused and ImGuiInputFlags_RouteGlobalOverActive flags. (#456) 650cb51bf Shortcuts: renamed ImGuiInputFlags_RouteActiveItem to ImGuiInputFlags_RouteActive. (#456, #7618) ef9d525f0 Shortcuts: added ImGuiInputFlags_RouteActiveItem. (#456, #7618) + rearrange Changelog 16b72f2d2 Comments 29439bdd2 Windows: BeginChild(): fixed auto-fit calculation when using either (not both) ResizeX/ResizeY and double-clicking on a border. (#1710) 374b9a7fb Demo: Documents: refactor + add Renaming option. (#7233) c150ad50c Shortcuts: claim mods ownership once pressed. (#456, #2637, #2620, #2891, #3370, #3724, #4828, #5108, #5242, #5641) 1002cfa6d Demo, Shortcut(): amend Shortcuts demo. (#456) 7c71e6637 Shortcuts, SetShortcutRouting: move ImGuiInputFlags_RouteFromRootWindow evaluation to SetShortcutRouting() for now. (#456) 5ecef2f32 Merge branch 'master' into docking d5a600e9c Shortcuts, SetShortcutRouting: added ImGuiInputFlags_RouteFromRootWindow. Made it possible for SetShortcutRouting() to query for another location. 0eb025f48 Internals: move ItemHandleShortcut() next to Shortcut(), it's calling it anyhow. (#456) a689fa262 SetShortcutRouting: require explicit routing. (#456) c06e6340c Shortcuts: added ImGuiInputFlags_Tooltip. (#456) 77e417189 Shortcuts: added flags to SetNextItemShortcut(). (#456) 197f8904f Shortcuts, Nav: make SetNextItemShortcut() work when another item is active. Made NavCalcPreferredRefPos() take account for remote activation. (#456) dc5caa483 Demo: added "Shortcuts" section. (#456, #2637) fc512a247 Inputs: Added Shortcut(), SetNextItemShortcut(). Added ImGuiInputFlags, ImGuiInputFlags_RouteXXXX. (#456, #2637) 85513de24 Internals, Inputs: *Breaking* Swapped parameter order of owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(). (#456) 900b29055 Internals, Inputs: *Breaking* Swapped parameter order of Shortcut(). (#456) 55748cdbe Internals, Inputs: *Breaking* Renamed ImGuiKeyOwner_None to ImGuiKeyOwner_NoOwner: avoid confusion with non zero value, makes IsKeyPressed() calls using ImGuiKeyOwner_NoOwner more explicit. ec1d2be96 Examples: Win32+DX9,DX10,DX11,DX12: rework main loop to handle minimization and screen locking. (#2496, #3907, #6308, #7615) 6d1a6f1c7 Internals, Inputs: Comments, alignment. 4c3eac2c1 Backends: OpenGL3: Fixed zealous warning by initializing last_pixel_unpack_buffer. (#7614) 36ffdd69d Merge remote-tracking branch 'origin/master' into docking 9ebab255d Docking: *BREAKING* changed signature of DockSpaceOverViewport() to allow passing an explicit dockspace id if desired. (#7611) a1566c5e1 Tables: fixed 28a283b breaking PageDown on tables with no interactive items. aa725ca79 Inputs: moving ImGuiInputFlags_RouteAlways into ImGuiInputFlags_RouteTypeMask_ cd48059dc Tables: comments about skipping access to table data in coarse clipping path. 28a283b46 Windows: BeginChild(), Tables:fixed visibility of fully clipped child windows and tables to Test Engine. aa5a6098e Fixed typos in comments (#7599) d39ca33b6 Fixed false positive with PVS-Studio. ae8218a3e Inputs, Shortcut: fixes some edge cases for GetKeyChordName(), clarify that it is aimed at display. (#456) 25e279ee7 Inputs: Treat ctrl-left-click as right click when ConfigMacOSXBehaviors is set. (#2343) b4f564c1e Internals: Shortcuts: *Breaking* : rename ImGuiInputFlags_RouteGlobalLow -> ImGuiInputFlags_RouteGlobal, ImGuiInputFlags_RouteGlobal -> ImGuiInputFlags_RouteGlobalOverFocused, ImGuiInputFlags_RouteGlobalHigh -> ImGuiInputFlags_RouteGlobalHighest (#456) b39fc84f8 Merge branch 'master' into docking 5107e58b0 Inputs: amend changelog and clarify how the swap might be a breaking change for a minority of users. (#2343) 8bd5d1d42 Inputs: Fixed swapping of keys associated to mods. Fixed warnings. (#2343, #4084, #5923, #456) 774710664 Inputs: swap Ctrl and Cmd on macOS X, remove ImGuiMod_Shortcut. (#2343, #4084, #5923, #456) 07dbcf1f7 Fixed typos. (#7593) 93daf2322 Examples: SDL3: updates for latest SDL3 API changes. e45efa995 Backends: SDL3: Rename SDLK_QUOTE and SDLK_BACKQUOTE to SDLK_APOSTROPHE and SDLK_GRAVE. (#7580) 5d973a87d Backends: SDL_Renderer2/SDL_Renderer3: and ImGui_ImplSDLRenderer2_RenderDrawData() and ImGui_ImplSDLRenderer3_RenderDrawData() now takes a SDL_Renderer* parameter. af2fbf043 Backends/Internals: Don't use IME and clipboard default win32 functions when WINAPI_FAMILY_GAMES (#7585) 15d8d41f8 Examples: add missing ImGuiConfigFlags_DockingEnable flag in some examples. eabe98f6d Merge branch 'master' into docking (incl merge moved CurrentDpiScale field) e4576914c Internals: amend f806c76 to better match docking + fixed unused static forward declaration warning. d0524df88 Internals: slight refactor FindHoveredWindow() -> FindHoveredWindowEx() toward reducing far-away code duplication. f806c76e9 Tables, Dpi: added dummy g.DpiScale storage (to be altered in docking), using to scale tables border hit thickness. f0912833b Update FAQ.md (#7581) ac90e1bd5 Backends: Win32: replace bd != nullptr assert with early out. (#6275) 0a5d40a01 Update FAQ.md d06b8b58d Nav: fixed holding Ctrl or gamepad L1 from not slowing down keyboard/gamepad tweak speed. 5e2368045 Backends: all backends + demo now call IMGUI_CHECKVERSION() to verify ABI compatibility between caller code and compiled version of dear imgui. (#7568) 510eb8f48 Tables: fixed cell background of fully clipped row overlapping with header. (#7575, #7041) f48aae600 Version 1.90.7 WIP e391fe2e6 Merge branch 'master' into docking 6ccc561a2 Version 1.90.6 0d483a1c8 Backends: OpenGL3: Update loader for Linux to support EGL/GLVND. (#7562) 92df32d33 Backends: OpenGL3: minor update of generated loader to match latest downloaded glcorearb.h/khrplatform.h files. 1ab1af80c Backends: Win32: Facepalm revert part of d15574c + additional commentary (#6275) d15574ce2 Backends: Win32: Removed silent return when calling ImGui_ImplWin32_WndProcHandler() with no active context! (#6275) 8b2c6dd42 Backends: Vulkan: reworked swap-chain resize handling for secondary viewports to work with typical Linux setups. (#2626, #3390, #3758, #7508, #7513) d4495446d Windows, Internal: added experimental SkipRefresh mode. (#3515, #4763, #7556, #5116 , #4076, #2749, #2268) f5d185238 Viewports: fixed outer-right edge of MenuBar clipping rectangle off by one when window is located on a monitor with negative coordinates. (#6861, #2884) 2f2d5070f Merge branch 'master' into docking 0b309471f Windows: Changed default ClipRect to extend to windows' left and right borders. (#3312, #7540, #3756, #6170, #6365) 0c9c12c1b InnerClipRect use ImFloor() matching docking branch (fix c41868531 for #6861, #2884, followed by rename 94da5842) 6ebbecc6a Realign assignments. fc4d818e1 Tables: Angled headers: added TableAngledHeadersTextAlign, ImGuiStyleVar_TableAngledHeadersTextAlign. (#6917) 4bb756714 Tables: Angled headers: fixed multi-line label display when angle is flipped. (#6917) b30df8890 Table: Angled Headers: internal refactor to facilitate changing angled header bg and text colors per column. (#6917) ebb8d7810 Backends: Vulkan: Create a custom pipeline for secondary viewports. (#6325, #6305, #7398, #3459, #3253, #3522) 49e70e60a Backends: Vulkan: Stripped misleading leftover of ImGui_ImplVulkanH_Window::Pipeline (#6325, #6305, #7398, #3459, #3253, #3522) 9d6818d0c Docking: comments, clairfy why we store style override on dragged windows. Clarify why we don't need to store alpha. (#7535, #2771) 558c57a08 Fixed static analyzer warning "Pointer to local array 'overlay_buf' is stored outside the scope". Technically not used outside that scope, but best to play nice. 5717f0a33 Merge branch 'master' into docking 50b2ff0bf ImGuiIO: moved IMGUI_DISABLE_OBSOLETE_KEYIO block lower in the structure so other fields layout are not affected by it (#7534) 6ef4f67fa ImDrawList: moved cold fields lower in the structure so hot fields are closer to each others + better packed ImGuiNavItemData a60387a3c Backends: GLFW: Add define guards for glfw native defines. (#7536) 913151caa Demo: move progress bars to their own section. c895e987a ProgressBar: added indeterminate mode by passing an animated negative value. (#5316, #5370, #1901) b8a44b198 TreeNode: added ImGuiTreeNodeFlags_SpanTextWidth. (#6937) baaaaea9e Demo: tweak TreeNode demo. da18fcb7a Internals: ensure ButtonBehavior() is called with non 0 id. b720c0f54 Backends: Vulkan: Added convenience support for Volk via IMGUI_IMPL_VULKAN_USE_VOLK define. (#6582, #4854) 07e8ff9a8 Backends: Win32: Fixed a warning + moved header cruft below Changelog. b555984a9 Merge branch 'master' into docking fa0120ea5 Windows: Fixed subsequent Begin() append calls from setting last item information for title-bar. (#7506, #823) 361432a0b TreeNode: fixed layout so that TreeNode("") or TreeNode("##HiddenLabel") may properly be used with SameLine(0,0). (#7505, #282) eba46cb0d Drag and Drop: assert when nesting BeginDragDropSource() and BeginDragDropTarget() (#7504) + update Gallery links 9ec299ebe Backends: OpenGL: Detect ES3 contexts on desktop based on version string, (#7447) 4cb0fe3c7 Merge branch 'master' into docking 7b8107e7c Examples: GLFW+WebGPU: Rename example_emscripten_wgpu/ to example_glfw_wgpu/ (#7435, #7132) 648278cd6 Examples: GLFW+WebGPU: Amends. (#7435, #7132) 80a5fdb10 Examples: GLFW+WebGPU: Fixed condition for when to recreate swapchain. (#7435, #7132) f9df6bf66 Examples: GLFW+WebGPU: added support for WebGPU-native/Dawn (#7435, #7132) b475309fa Fonts: Fixed font ascent and descent calculation when a font hits exact integer values. (#7399, #7404) daecfffef Text, DrawList: Improved handling of long single-line wrapped text. (#7496, #5720) fab96a6e5 Backends: SDL3: Re-enable calling SDL_StartTextInput()/SDL_StopTextInput(). (#7452, #6306, #6071, #1953) dad1689bf Examples: SDL3: amend for removal of SDL_RENDERER_ACCELERATED. c1743eef4 Docking: when io.ConfigDockingWithShift is enabled, fixed help tooltip erroneously reading SetNextWindowXXX() data. (#6709, #4643, #7491) 3caa79c8a Version 1.90.6 WIP 76bc1b825 Extracted part of NewFrame() into SetupDrawListSharedData() for documentation purpose. (#7495, #6406) f790d5166 Silent zealous/stupid warning introduced by Clang 16 (shipping with VS2022) with -Weverything. Pointers are now illegal! 1db579d45 Merge branch 'master' into docking 231cbee0f Version 1.90.5 4f9ba19e5 Drags, Sliders, Inputs: Reactivated decimal point replacement for SliderScalar and DragScalar. (#7389, #6719, #2278) e7712ff10 Out of courtesy/consistency move all the DebugHookIdInfo compares into ifndef block. f959c417f Refactor moving ID stack functions to their own section (part 2) 0bf134a8e Refactor moving ID stack functions to their own section. 9a2b598ec ListBox: Fixed text-baseline offset when using SameLine()+Text() after a labeled ListBox(). d3c3514a5 Tables: Fixed auto-width columns when using synced-instances of same table. (#7218) 25a492f33 ProgressBar: Fixed passing fraction==NaN from leading to a crash. (#7451) 9638c2839 Internals: adding ImGuiNavMoveFlags_NoClearActiveId even though there's currently no satisfying way to take advantage of it. (#1418) 742e53434 Child Windows: adjust resizing limits to match window padding rather than inner clipping rectangle. (#7440) 515b437c0 Child windows: look at the parent window's flags to decide whether to clamp child resizes. (#7440, #1710) 976dc2396 Windows: extend outer resize borders to the edges when there are no corner grips. (#7440, #1710) 37b37fc2a DrawList: Allow AddText() to accept null ranges. (#3615, 7391) 5c5ae806a Comments cf4c10bef Style: added ImGuiStyleVar_TabBorderSize, ImGuiStyleVar_TableAngledHeadersAngle. (#7411) f0802287d Tables: Angled headers: fixed table contents overflowing when a list clipper is used. (#7416) 29ff159f9 Tables: Angled headers: fixed borders not moving back up after TableAngleHeadersRow stops being called. (#7416) 38ddfb24f Tables: Angled headers: fixed border hit box extending beyond non-scrollable tables. (#7416) 8be48a44f Backends: WebGPU: Avoid using -1u literal (#7436) 085781f5c Merge branch 'master' into docking 868facff9 ImDrawList: (Breaking) merge float radius_x/radius_y parameters into ImVec2 radius in PathEllipticalArcTo(), AddEllipse(), AddEllipseFilled(). (#2743, #7417) 0a1f5b94e Demo: Two minor fixes (unchecked BeginTooltip + incorrect height constraint) (#7410)l 40df3db1a Tweaking terminology adcc3217c Revert "Docking: Fix C++26 zealous warnings (#7383, #7089)" + Disable warnings 9d9ca37a8 Docking: Fix C++26 zealous warnings (#7383, #7089) da29b776e Backends: SDL3: Fix leak of SDL_GetGamepads() return value (#7381) 3c435c029 Inputs: (Breaking) More formally obsoleted GetKeyIndex() when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is set. (#4921) 286cd5bd4 Internals, InputText: removed ImGuiInputSource_Clipboard. (#4005) fc570ac92 Examples: WGPU: fixed initialization of WGPURenderPassColorAttachment (#7371) fd75685fb Merge branch 'master' into docking 65dc67f63 Windows: Double-click to collapse may be disabled via key-ownership mechanism. (#7369) 6b7358e9f InputText: adding clarifying note about ImGuiInputTextCallbackData::Buf. (#7363) fbf45ad14 ImDrawList: add PathFillConcave(), AddConcavePolyFilled(): amends (#760) 1ff90c52d ImDrawList: add PathFillConcave(), AddConcavePolyFilled() (#760) 04f40014a Docs: added a mini wiki index in main source files. c62366996 Added link to crawlable wiki 0573513d6 Windows: Scrollbar visibility decision uses current size when both size and contents size are submitted by API. (#7252) 77dff5a73 Backends: comments. 4e8c43f6b Backends: Win32: made it so that an appearing viewport showing up doesn't bring its parent viewport to front. (#7354) 44c7dfca0 Menus, Popup: Amend c3f8f4d for static analyzer warning ("condition always true"). (#7325) 1a487165b Merge branch 'master' into docking c3f8f4de2 Menus, Popups: Fixed an issue where sibling menu popups re-opening in successive frames would erroneously close the window. (#7325, #7287, #7063) 987794177 Popups, Menus: rename ImGuiPopupData::BackupNavWindow > RestoreNavWindow and minor tweaks. Should be functionally a no-op. 725f91922 Tables: fixed TableGetHoveredRow() with overlapping frozen rows (#7350, #6588, #6347, #6250) e46d1e69a Version 1.90.5 WIP c6aa05162 Merge branch 'master' into docking 277ae93c4 Version 1.90.4 f5be90523 Nav: Fixed SetKeyboardFocusHere() or programmatic tabbing API from not working on windows with the ImGuiWindowFlags_NoNavInputs flag. 13d91ff91 Nav: Fixed SetKeyboardFocusHere() or programmatic tabbing API from not working on windows with the ImGuiWindowFlags_NoNavInputs flag. 34965cf23 Modals: Temporary changes of ImGuiCol_ModalWindowDimBg are properly handled by BeginPopupModal(). (#7340) 659fb41d0 Debug Tools: moved DebugStartItemPicker() to public API. Added to Demo->Tools menu. (#2673) 198c38f0b Demo: Custom Rendering: better demonstrate PathArcTo(), PathBezierQuadraticCurveTo(), PathBezierCubicCurveTo(), PathStroke(), PathFillConvex() functions. 3b6d924ac ProgressBar: Fixed a minor tesselation issue when rendering rounded progress bars. 2b662b1ab Merge branch 'master' into docking d3f1a7165 Popups: allow Child Popups to be resizable if not explicitly disabling. e78ce72eb Popups: Fixed resizable popup minimum size being too small. Standardized CalcWindowMinSize() logic a bit more. (#73290 014e0ac8c Menus, Popups: Fixed an issue where hovering a parent-menu upward would erroneously close the window. (#7325, #7287, #7063) c16043c1d Tables: Angled headers: improve clipping of text since multi-line labels makes clipping issues visible. (#6917) 405e54ebd Tables: Angled Headers: fixed support for multi-line labels. various padding/layout fixes. (#6917) 6655ab2e4 Tables: Angled Headers: fixed TableAngledHeadersRow() incorrect background fill drawn too low. Fixed row geometry with non-small values of CellPadding. (#6917) 9159cd7b4 Updated invalid documentation link (#7331) ccc5347e4 Fix typos (#7332) 8a14b71f2 Version 1.90.4 WIP b19a4c5f2 Backends: OSX: remove legacy clearing of io.NavInputs in ImGui_ImplOSX_UpdateGamepads(). (#7320) 8048b5249 Backends: GLFW: enable ImGuiBackendFlags_HasMouseHoveredViewport support with GLFW 3.3.x. (#7316) c66a1e7d5 Backends: Vulkan: ImGui_ImplVulkan_CreateWindow() amend merge to take account of PipelineRenderingCreateInfo change. (#7166, #6855, #5446, #5037) d79514c40 Merge branch 'master' into docking 5b6f03213 Version 1.90.3 f80e65a40 Backends:,Examples: Vulkan: moved RenderPass parameter from ImGui_ImplVulkan_Init() function to ImGui_ImplVulkan_InitInfo structure. (#7308) 829f45df9 Backends: SDL2: removed obsolete ImGui_ImplSDL2_NewFrame(SDL_Window*) signature which was obsoleted in 1.84.. 3cc37170c Examples: GLFW+Metal: Add -I and -L paths for MacPorts. 891b81fc5 Backends: SDL3: Fixed gamepad. Added support for disconnection. Added support for multiple gamepads. Added ImGui_ImplSDL3_SetGamepadMode(). (#7180, #3884, #6559, #6890) 262e30e30 Backends: SDL2: rework new API as ImGui_ImplSDL2_SetGamepadMode(). (#3884, #6559, #6890, #7180) 9dfa2397d Internals: Fixed ImFileOpen not working before context is created. (#7314, #7315) d15e4100b Backends: SDL2: Amend new API, all support for multiple gamepads. (#3884, #6559, #6890) f966da1f8 Backends: SDL2: Gamepad handlng: amend bf1c96d. (#3884, #6559, #6890) bf1c96d4f Backends: SDL2: Handle gamepad disconnection + fixed increasing refcount. Added ImGui_ImplSDL2_SelectGamepadAuto()/ImGui_ImplSDL2_SelectGamepadExplicit(). (#3884, #6559, #6890) fd8d6dc5d Backends: SDL2,SDL3: tidying up. e0ba0d043 Backends: Vulkan: Fixes for building with pre Vulkan 1.3. Amend 8901931. (#7166) 11d73f03e Backends: Vulkan: Fix/amend 8901931 89019319d Backends: Vulkan: use PipelineRenderingCreateInfo for dynamic rendering (#7166, #6855, #5446, #5037) 1d6f0cea0 Backends: DX9: use RGBA texture to avoid conversion if supported 3af739a2d Menus, Popups: fixed menus and popups with child window flag erroneously not displaying a scrollbar when contents is over parent viewport size. (#7287, #7063) 2af01baff Backends: SDLRenderer3: query newly added SDL_RenderViewportSet() to not restore a wrong viewport if none was initially set. 915c6393a Version 1.90.3 WIP 8490a262c Debug Tools: Metrics: Improved Monitors and Viewports minimap display. Highlight on hover. (amends) 71bcf350b Merge branch 'master' into docking 536090303 Version 1.90.2 7b5357d81 Debug Tools: Metrics: Improved Monitors and Viewports minimap display. Highlight on hover. 30ba3c347 Viewports: Fixed moving accross monitors when io.ConfigWindowsMoveFromTitleBarOnly is set. (#7299, #3071) 59c8db69e Demo: reorder Demo->Configuration section with docking/viewports section. 70aa717a8 Combo: Fixed not reusing windows optimally when used inside a popup stack. 5cdc4a2a4 Demo: use ImGui::MemAlloc/MemFree for consistency. (#7300) 76e09c4b0 ClosePopupsOverWindow(): amend to remove _ChildWindow test. 3a078466a Nav: ImGuiWindowFlags_NoNavInputs is tested during scoring so NavFlattened windows can use it. 7d67623d1 InputText: Internal: ReloadUserBufXXX functions don't override revert value. (#2890) fix accidental comment. a5e0e90c1 Nav: tweak RenderNavHighlight() syntax. ImGuiNavHighlightFlags_TypeThin -> ImGuiNavHighlightFlags_Compact. 1e8fc01dd InputText: Internal: ReloadUserBufXXX functions don't override revert value. (#2890) + rename a06dd7a27 OpenPopup(): Added ImGuiPopupFlags_NoReopen. Nav, Menus: Fixed click on a BeginMenu() followed by right-arrow. (#1497, #1533) f104967c6 Comments 82eeafc19 Merge branch 'master' into docking 06ce31274 InputText: Internal: added reload from user-buf feature. (#2890) f50ddc431 Fixed some typos. (#7282) 6172c22c5 CI: Update to `actions/checkout` `v4` from `v3`. (#7281) 96839b445 Nav: Improve handling of Alt key to toggle menu so that key ownership may be claimed on indiviudal left/right alt key without intefering with the other. 719475637 Shortcut: fixed single mod-key Shortcut from working e.g. Shortcut(ImGuiKey_LeftCtrl) f1960b60c Added "nop" to IM_DEBUG_BREAK macro on GCC to work around GDB bug (#7266) 8491cf36a Inputs: g.ActiveIdUsingManyKeys[] prevent routes from being claimed. 9176eedf2 Internals: SetShortcutRouting() move code so next commit is easier to read. Should be no-op. 150984210 Backends: OpenGL3: Shallow tweak of compile-time extensions detection. 1ce41f621 Backends: OpenGL3: Backup and restore GL_PIXEL_UNPACK_BUFFER. (#7253) 54ef4092a Backends: OSX: Fixed not submitting Monitors info when viewports are not enabled. (#7257) 81e0be856 Fixed strict-aliasing violation in FormatTextureIDForDebugDisplay(). (#7090, #7256) eb42e164d Merge branch 'master' into docking a201af735 Added SetNextItemShortcut() wip function. (#456) 4c2c09450 Nav: keyboard/gamepad activation feedback properly timed instead of frame buffer. (#456) 5b5e9bd0c Internals: Tweak shallow compaction as Clang complains about MS ABI signage of enums. 7c3fa7d04 Refactor: moved section in imgui_internal.h 9266c0d2d Backends: WebGPU: Avoid leaking pipeline layout. (#7245) 595eb8662 Changelog, comment, minor data compaction 6850194f6 CI: Fixes WGPU example build. 5fc0a361b Backends: WebGPU: added ImGui_ImplWGPU_InitInfo::PipelineMultisampleState. (#7240) 831d42c1a Backends: WebGPU: ImGui_ImplWGPU_Init() now takes a ImGui_ImplWGPU_InitInfo structure instead of variety of parameters, allowing for easier further changes. (#7240) e3c7ff944 Examples: Emscripten+WebGPU: slightly refactor like other Emscripten compatible Desktop examples, as aiming to make this suppot desktop eventually. 15908502e Backends: Vulkan: Define NOMINMAX when VK_USE_PLATFORM_WIN32_KHR is defined. (#7250) 788747f86 Examples: Emscripten+WebGPU: Remove use of deprecated ObjectBase<...>::Release in favor of ::MoveToCHandle (#7251) 763100b38 Nav: Fixed pressing Escape while in a child window with _NavFlattened flag. (#7237) c7edb446c Shortcut(): always test ownership. 1844f903d Nav: space/enter poll check ownership. InputText: declare ownership of Enter key as it doesn't go through Shortcut 5ddfbb80d Backends: Vulkan: Fixed vkAcquireNextImageKHR() validation errors in VulkanSDK 1.3.275 by allocating one extra semaphore than in-flight frames. (#7236) 01b99a974 Backends: Vulkan: Fixed vkAcquireNextImageKHR() validation errors in VulkanSDK 1.3.275 by allocating one extra semaphore than in-flight frames. (#7236) 2f4833733 Examples: Vulkan: Rename compile-time defies for the examples to remove misleading IMGUI_ prefixes. cab7edd13 Merge branch 'master' into docking d7c2a0e38 Shortcut(): fixed 8323a06 adding _Repeat to all Shortcut() calls. 3b828d370 Refactor: moving ItemAdd() into a section abote ItemSize(). No logic change (part 2) ff5f3aa38 Refactor: moving ItemAdd() into a section abote ItemSize(). No logic change (part 1) 1a48a6344 Enclosed a few more remaining sections in ifndef IMGUI_DISABLE_DEBUG_TOOLS for completeness. 33fabdf39 Scrollbar() doesn't forcefully mark itself as hovered when held. d431d8583 Internals: removed obsolete ImPool::GetSize() (last used by implot 0.10, changed in implot 0.11) f0d1f61fa Internals: commented out long-time obsoleted FocusableItemRegister()/FocusableItemUnregister() documentaton-only leftovers. + 095665977 Nav: marking NavId as hovered in ButtonBehavior() doesn't check for ActiveId. d10641b04 Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback. 03417cc77 Backends: WebGPU: Filling all WGPUDepthStencilState fields explicitly as a recent Dawn update stopped setting default values. (#7232) 5fdcdf708 Shortcut: ImGuiInputFlags_RouteFocused policy can filter Shortcuts conflicting with character input when an item is active. (#456) 80d5cb1ab Comments around ImGuiInputFlags. 80c83a427 Docking: added ImGuiDockNodeFlags_DockedWindowsInFocusRoute to configure a dock node to automatically set ParentWindowForFocusRoute on its docked windows. (#6798, #2637, #456) cceff4684 Docking: added ImGuiWindowClass::FocusRouteParentWindowId as a public facing version of SetWindowParentWindowForFocusRoute() (#6798, #2637, #456) 1cc0eb4d3 Internals: Rename NavFocusScopePath to NavFocusRoute + fixed a static analyzer warning. 69b64e2b7 Internals: Docking: revert 32a3c61 in favor of user explicitely calling SetWindowParentWindowForFocusRoute(). (#6798) a27f22f0e Merge branch 'master' into docking 46e5f44ec Shortcut()/SetShortcutRouting(): use mixed current window focus scope + ParentWindowForFocusRoute. (#6798, #2637, #456) e0c8c80ad Shortcut()/SetShortcutRouting(): focus route testing now use ParentWindowForFocusRoute. Automatically set on child-window, manually configurable otherwise. (#6798, #2637, #456) 4b20a0217 Internals: add window to FocusScopeStack. (#6798) 2156db7a0 Debug Log: added InputRouting logging. Made GetKeyChordName() use its own buffer. Fixed debug break in SetShortcutRouting(). (#6798, #2637, #456) dd0efdc63 Fixed SetKeyboardFocusHere() not working when current nav focus is in different scope. (#7226) 8a3dfda8d Commented out obsolete ImGuiIO::ImeWindowHandle marked obsolete in 1.87, favor of writing to 'void* ImGuiViewport::PlatformHandleRaw'. 6228c2e1e Backends: Vulkan: moved ImGui_ImplVulkanH_DestroyFrameRenderBuffers/ImGui_ImplVulkanH_DestroyWindowRenderBuffers as they are always used in a state where backend data is available. 32a3c61d0 Internals: Shortcut() follow docking chain (until we formalize a more general focus scope stack). (#456) 70bb6d1e7 Backends: Vulkan: Fixed vkMapMemory() calls unnecessarily using full buffer size. (#3957) 82df7c8bf Backends: Vulkan: Fixed handling of ImGui_ImplVulkan_InitInfo::MinAllocationSize field. (#7189, #4238) 29809d722 Version 1.90.2 WIP db049db86 Docs: tweak, fixed misplaced changelog entry. (#7084) 2dc85e6e4 Merge branch 'master' into docking d6cb3c923 Version 1.90.1 6470e2279 Debug Tools: DebugRenderKeyboardPreview() scales better. fdf8d02be Debug Tools: Added io.ConfigDebugIsDebuggerPresent and Debug Break buttons. (#2673) 788bb58b6 Metrics: Tweak, reorganize tools menu. a5dec4286 Debug Tools: Debug Log: Clicking any filter with SHIFT held enables it for 2 frames only. (#5855) a3eea8a75 Backends: OpenGL3: Update GL3W based imgui_impl_opengl3_loader.h to load "libGL.so" and variants, fixing regression on distros missing a symlink. (#6983) cf0202356 Internals, Inputs: Fix for ImGuiInputFlags_RepeatUntilXXX logic when #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO is not set. 69bf3291d Internals, Inputs: Fix for ImGuiInputFlags_RepeatUntilXXX logic when #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO is not set. ebcfcd8da Merge branch 'master' into docking 8deb1007c Backends: OSX: Fixed IME position in multi-monitor/multi-viewports setups. (#7028) a683033e4 Backends: OSX: Fixed monitor and window position by correctly transforming Y origin on multi-monitor setups. (#7028, #7101, #6009, #6432) af00b182e Examples: SDL3: Minor fixes following changes to API (SDL_WindowFlags -> Uint32). fc2e532f9 Shortcut: do not return true on mods changes. Internals: added ImGuiInputFlags_RepeatUntilKeyModsChange, ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone, ImGuiInputFlags_RepeatUntilOtherKeyPress. (#456, #2637) 8323a06e6 Inputs: passing ImGuiInputFlags_RepeatXXX options automatically adds ImGuiInputFlags_Repeat. 58261dbe9 Internals: alter ImGuiInputFlags values to leave room + indent. f1ae47c4b Docs: update links to Proggy Fonts. (#7211) 7f9533b84 ColorPicker: Fixed saturation/value cursor radius not scaling properly. 27e83c295 Add comment about how ImGuiKey values are named after US keyboard keys. (#7205) 278cf1a7b Readme: updated binaries. (#7193) edeb8ee3a More compact issue_template.yml c6716f5e9 Fixed typo (#7197) a1b06823f Windows: BeginChild(): Resize borders rendered even when ImGuiWindowFlags_NoBackground is specified. (#1710, #7194) 0461ade24 Reworked issue template (amends) (#5927, #5915) c528b688c Reworked issue template. (#5927, #5915) 26eef4df8 Update issue_template.md 7938550d5 Comments and some extra line-wrapping in demo (#3193) 4758f7467 imgui_freetype: fix nullptr to ImTextureID cast (#7192) e3d7cd665 Merge branch 'master' into docking 6f10cef2a Backends: Vulkan: moved structure declarations. 33d18c580 Misc: During shutdown, check that io.BackendPlatformUserData and io.BackendRendererUserData are NULL. (#7175) 0ea99132c Backends: Vulkan: Stop creating command pools with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT as we don't reset them. 4778560e6 Backends: Vulkan: Added MinAllocationSize field in ImGui_ImplVulkan_InitInfo to workaround zealous validation layer. (#7189, #4238) e8dd47eff Backends: WebGPU: Fixing an issue when opening a popup in the wgpu backend (#7191) 718fa0eec Happy new year! 2523c197b Fixed title bar background alpha being used to render viewport-owned windows. (#7184, #7181) 240ab5890 Backends: GLFW, Input: Use Unicode version of WndProc for get correct input for text in utf-8 code page. (#7174) 4a2426449 Drags, Sliders, Inputs: removed all attempts to filter non-numerical characters during text editing. (#6810, #7096) 20e1caec8 Backends: DX12: Changed swapchain scaling mode to `DXGI_SCALING_NONE`. (#7152, #7153) f039e69b9 Settings: Fixed an issue marking settings as dirty when merely clicking on a border or resize grip without moving it. 4aa81116a Merge branch 'master' into docking 8340a30d2 Debug: move debug assertion in post-clip code to reduce overhead. (#4796 and more). 1e1013085 Debug Tools: Debug Log: Hide its own clipper log to reduce noise in the output. 036a6c875 ColorEdit4: Further tweaks for very small sizes. (#7120, #7121) 0bd648972 DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: fixed multi-components width in tight space (#7120, #7121) 0000739c0 Internals: Fixed function name typo. 33d426842 Backends: Vulkan: ImGui_ImplVulkan_CreateFontsTexture() calls vkQueueWaitIdle() instead of vkDeviceWaitIdle(). (#7148, #6943, #6715, #6327, #3743, #4618) 3cb805489 Backends: GLFW, Emscripten: fixes for canvas resizing, amends. (#6751) 22a7d241f Backends: GLFW, Emscripten: fixes for canvas resizing. (#6751) b4c5a83cf Commented out obsolete ImGuiKey_KeyPadEnter redirection to ImGuiKey_KeypadEnter. (#2625, #7143) 70f2aaff4 Nav: tabbing happen within FocusScope. ImGuiWindowFlags_NavFlattened make window inherit focus scope from parent. 55073aa7a Examples; SDL: added missing return values checks from SDL_CreateWindow() calls. (#7147) 8764a1b7c Backends: Vulkan: free FontCommandBuffer explicitely (not actually required in normal code path, unless ImGui_ImplVulkan_DestroyDeviceObjects is declared directly). (#7104) 089ed3032 Replace usages of ImGuiKey_KeyPadEnter with ImGuiKey_KeypadEnter. (#7143) e265610a0 Fixes for MSVC code analyzer. f59b54c6f Nav: Activation can also be performed with Keypad Enter. (#5606) 0d582dabf Fixed warning (amend 54c1bde) 8add6bcb9 Merge remote-tracking branch 'origin/master' into docking 6cfe3ddf5 InputTextMultiline: Tabbing through a multi-line text editor using ImGuiInputTextFlags_AllowTabInput doesn't activate it. (#3092, #5759, #787) 54c1bdece Internals: removed unused ImGuiItemStatusFlags_FocusedByTabbing. (#4449) 4afffa36e InputTextMultiline: Fixed Tab character input not repeating f6836ff37 Misc: Rework debug display of texture id in Metrics window (amend) (#7090) 07dbd46dd Misc: Rework debug display of texture id in Metrics window to avoid compile-error when ImTextureID is defined to be larger than 64-bits. (#7090) 34646627a ColorEdit4: improve components width computation to better distribute the error (#7120) (#7123) 86512eac0 DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: improve multi-components width computation to better distribute the error. (#7120, #7121) 03298fe87 Windows: Fixed some auto-resizing path using style.WindowMinSize.x (instead of x/y). (#7106) 69f524ba9 DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: Added when component <= 0. (#7095) 9d8de4531 Image(): comment and minor refactor to resurface the fact that a border size may be added. (#2118) 5366bd09b Scrolling: internal scrolling value is rounded instead of truncated. (#6677) c58d2c89c Tabs: Added ImGuiTabItemFlags_NoAssumedClosure to enable app to react on closure attempt. (#7084) 1fade3515 DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: Fixed incorrect pushes into ItemWidth stack when number of components is 1. [#7095] 58ca5f642 Shortcut(): clearer early out in SetShortcutRouting() -> CalcRoutingScore() path. d72e1563d Removed CalcListClipping() marked obsolete in 1.86. (#3841) + comments 9a2985611 Backend: Android: Remove Redundant Check (#7093) 0b77980ca Moved Tables API related declarations to their own section in imgui.h aaf157cfd Commented out ImGuiFreeType::BuildFontAtlas() obsoleted in 1.81. Commented out legacy ImGuiColumnsFlags_XXX symbols redirecting to ImGuiOldColumnsFlags_XXX, obsoleted in 1.80. 96b5b1724 Merge branch 'master' into docking 1fd5ff715 Avoid C++26 removed deprecated arithmetic conversion on enumerations. (#7088, #7089. #2983, #3040) 52886872f Misc: Added IMGUI_USER_H_FILENAME to change the path included when using IMGUI_INCLUDE_IMGUI_USER_H. (#7039) 5768de79e InputText, ColorEdit, ColorPicker: better support for undocumented ImGuiItemFlags_ReadOnly flag. (#7079, #211) b112d73ed Menus: amend to clarify/fix static analyzer warning. (#6671, #6926) 2ee40d3cf Menus: Tweaked hover slack logic, adding a timer to avoid situations where a slow vertical movements toward another parent BeginMenu() can keep the wrong child menu open. (#6671, #6926) b4b864e40 Backends: Vulkan: Fixed mismatching allocator passed to vkCreateCommandPool() vs vkDestroyCommandPool(). (#7075) d2b016761 Fixed link error when using IMGUI_DISABLE_DEBUG_TOOLS 7965494ff Debug Tools: Added DebugFlashStyleColor() to identify a style color. Added to Style Editor. c1a3c7f44 Fixed Clang zealous warnings c6ec69c7c Using nullptr in remaining examples/backends locations. (#6313, #7071, #4537) 888834c63 Backends: Android: Fixed build breaking typo. (#7060) 077e4db77 Misc: Added extra courtesy ==/!= operators when IMGUI_DEFINE_MATH_OPERATORS is defined. f6253b87d Merge branch 'master' into docking 6f171a066 Nav, IO: SetNextFrameWantCaptureKeyboard(false) calls are not overrided back to true when navigation is enabled. (#6997) e07663d9a Docking: transform `ImGuiContext* ctx = GImGui` to `ImGuiContext& g = *GImGui` for consistency (#5856) 1f3090a48 Backends: SDL3: Fix indent (#7062) 86891b098 Backends: Android: ImGui_ImplAndroid_HandleInputEvent() takes a const AInputEvent* (#7060) f37f6f67f Windows: BeginChild(): Fixed auto-resizing erroneously limiting size to host viewport minus padding. (#7063) bce4db00b Drag and Drop: Fixed drop target highlight on items temporarily pushing a widened clip rect. (#7049, #4281, #3272) 65a10410e Docs: Add suggestion to turn of char8_t behavior for C++20 (#7025) 61b819794 Misc: Renamed some defines in imstb_textedit.h to avoid conflicts when using unity/jumbo builds. 3733b5064 Backends: SDL3: Fixed unused variable warning on master on some targets. (#7000) c5c1c4134 Backends: OpenGL3: imgui_impl_opengl3_loader.h: change #define ARRAY_SIZE to GL3W_ARRAY_SIZE to avoid external conflicts (#7017, #7018) 7bb0a525c Fixed text functions fast-path for handling "%s" and "%.*s" to handle null pointers gracefully. (#7016, #3466, #6846) 3d083dbe1 Version 1.90.1 WIP ce0d0ac82 Merge branch 'master' into docking b81bd7ed9 Version 1.90.0 6695006be Backends: Vulkan: use specified ColorAttachmentFormat when creating a secondary window when enabling UseDynamicRendering. (#6999, #5446, #5037) 623bff23c Windows: WindowMinSize not applied on AlwaysAutoResize window. (amend e2035a5) f298491a8 Docs: amend/tweak details about using io.WantCaptureMouse. (#7012) 5de1312e1 SplitterBehavior: tweak to not assert due to floating point precision. afadf74a5 BeginChild: undo child name simplification as it reveal an issue with handling of ### in child names. 46843b683 Fonts: minor/shallow amends (#6925) ade4d0e08 Fonts: added support for RasterizerDensity to FreeType based atlas generator. (#6925) ed29ff08b Fonts: added support for RasterizerDensity in built-in atlas generator. (#6925) abfb9269b Fonts: added RasterizerDensity to ImFontConfig. (#6925) 0941adc93 Backends: SDL3: Updates for recent API changes. (#7000) (w/ multi-viewports version) add915bdc Backends: SDL3: Updates for recent API changes. (#7000) 4ad5817aa Update backends/language lists 75c46a393 Demo: Partly fix resizing constraint demo. (#6210, #5627) fe6544622 SetNextWindowSizeConstraints() clarified parameters, fixed comments. (#1139, #3186, #3270) 454f36d2a Removed 'bool border' legacy versions of BeginChild() as they seemingly have no value other than confusing user and IDE. 9d950444a Backends: Vulkan: Fixes for VK_NO_PROTOTYPES (docking merge + reorder docking only bits) 44dbad64d Backends: Vulkan: Fixes for VK_NO_PROTOTYPES. 450f1d7e7 Merge branch 'master' into docking 79a9e2fdf Backends: Vulkan: (Breaking) full font upload is performed by ImGui_ImplVulkan_CreateFontsTexture(), no need for user code to create or provide a command-buffer. Removed ImGui_ImplVulkan_DestroyFontUploadObjects(). (#6943, #6715, #6327, #3743, #4618) 6e7b43b6c Backends: Vulkan: Added ImGui_ImplVulkan_DestroyFontsTexture(), made ImGui_ImplVulkan_CreateFontsTexture() destroy previous one. (#6943, #6715, #6327, #3743, #4618) d0da79c57 Defining IMGUI_DISABLE_OBSOLETE_FUNCTIONS now automaticaly define IMGUI_DISABLE_OBSOLETE_KEYIO. (#4921) ab522dd18 Removed IM_OFFSETOF() macro in favor of using offsetof() available in C++11. Kept redirection define. (#4537) 0f50b52da Backends: OpenGL3: Update GL3W based imgui_impl_opengl3_loader.h to load "libGL.so" instead of "libGL.so.1". (#6983) 5170a9d6d Tables: Internals: renamed TableDrawContextMenu() to TableDrawDefaultContextMenu() for clarify. fea52e29a Tables: added flags to TableDrawContextMenu() in order to display selected sections + added internal table->DisableDefaultContextMenu = true way to submit your own contents. 37ea320b9 Merge branch 'master' into docking 0d3b468cb BeginChild(): added ImGuiChildFlags_AutoResizeX, ImGuiChildFlags_AutoResizeY, ImGuiChildFlags_AlwaysAutoResize + support for SetNextWindowSizeConstraints(). (#1666, #1395, #1496, #1710) + Demo 44345c210 Better documented the difference between BeginListBox() and BeginChild() w/ ImGuiChildFlags_FrameStyle. fa4c49b4a BeginChild(): resizing is only clamped on axis where there's no scrollbar. Added an extra ResizeX in Demo->Simple Layout. cdbc21a19 BeginChild(): Added ImGuiChildFlags_FrameStyle as a replacement for BeginChildFrame(). (#1666, #1496, #1395, #1710, #462, #503, #263) ab47efd9a Bits / comments 561af15d6 Internal: Added owner aware variant of IsMouseDoubleClicked() for consistency. 376035fd0 Nav: fixed programmatic nav calls (e.g. SetKeyboardFocusHere() from storing io.KeyMods) cfc71ab7c Made ImDrawCallback_ResetRenderState special value -8 instead of -1 so it is pointer aligned (#6969) 208b8242b Docking: Settings: Fix for loss of settings caused by 9298e31 yesterday. (#6982) 1ab63d925 Undid some of the changes done by c95fbb4 because they are not compatible with docking code. 4cde40dbe Undid some of the changes done by c95fbb4 because they are not compatible with docking code. 9298e310b Merge branch 'master' into docking (note: won't build as-is, see next commit) c0bc43ccf Offset values for ImGuiWindowFlags_NoNavInputs, ImGuiWindowFlags_NoNavFocus, ImGuiWindowFlags_UnsavedDocument. f1d1a8d32 Windows: use relative mouse movement for border resize when the border geometry has moved. (#1710) 923535240 BeginChild: Added ImGuiChildFlags_ResizeX and ImGuiChildFlags_ResizeY. (#1710) 34a0bc456 BeginChild: Added ImGuiChildFlags_AlwaysUseWindowPadding, obsoleted ImGuiWindowFlags_AlwaysUseWindowPadding. (#462, (toward #1666, #1496, #1395, #1710) 7713c2925 BeginChild: Upgraded 'bool border = true' parameter to use a ImGuiChildFlags type and the ImGuiChildFlags_Border value. (toward #1666, #1496, #1395, #1710) 04e9a2fac Backends: SDL3: rename SDL_EVENT_DISPLAY (#6974) 88fec0971 ColorPicker4(): Fixed ImGuiColorEditFlags_NoTooltip when ImGuiColorEditFlags_NoSidePreview is also set. (#6957) 313676d20 Settings: omit outputing Collapsed=0 in .ini file. Changelog + docs tweaks 8ee85137d BeginChild(): Internal name used by child windows now omits the hash/id if the child window is submitted in root of id stack of parent window. 4e4042bc3 Windows: tidying up skipitems logic at end of Begin(), normally should be no meaningful side-effect. bc3c6e74e Windows: fixed double-clicked border from showing highlighted at the new position. e2035a514 Windows: shared code for CalcWindowMinSize(). c95fbb446 Windows: Double-clicking bottom or right window border auto-resize on a singles axis. ade2acfd1 Inputs: Added IsKeyChordPressed() public helper function. 2a6d7b1ea Merge branch 'master' into docking 1b9cb52d7 BeginChild(): rename parameters to reduce diff of upcoming patches. f8dc03d70 Windows: Can also auto-resize by double-clicking lower-left resize grip (not only lower-right one). 56f7e853b Demo: expose more Combo flags + misc tidying up. 9a5da2355 Changelog formatting d6d00b4fc Moved BeginChild() above BeginChildEx() as it is more readable. 99913b505 Internals: added IsKeyChordPressed() for consistency. a8bdbfddf Tables: Fixed top-most and left-most outer border overlapping inner clip-rect when scrolling. (#6765) 8db02ef8d Tables: Fixed an issue with ScrollX enabled where an extraneous draw command would be created. 51d1a72e9 Docking: Revised undocking logic to reduce accidental whole-node undocking: 4521dec85 Docking: Fixed DockNodeBeginAmendTabBar() asserting on first call since ef8ff1b 947255c3d Tooltips: made it possible to use ImGuiHoveredFlags_ForTooltip + a ImGuiHoveredFlags_DelayXXXX override. (#1485) 0b8c6b9bc Internals: removed seemingly unused AutoFitChildAxises. 12a3c77c2 Demo: Minor tweak to angled headers demo. 83c433682 Tables: fixed angled headers with frozen columns. f96c5443b Tables: fixed angled headers with frozen columns. f7fc18640 Merge branch 'master' into docking 32228d8ad Tables: added Angled headers support. Added ImGuiTableColumnFlags_AngledHeader, ImGui::TableHeadersAngledRow(), style.TableAngledHeadersAngle. (#2957) 9f851ebfe Tables: added ImGuiTableFlags_HighlightHoveredColumn. be1311cfc Tables: fixed double-clicking on a column from clearing HoveredColumnBorder for a frame. 08606714a Fixed incorrect assert in FocusTopMostWindowUnderOne() preventing child+popup from being used. (#6915, #718) 5053d79a2 Tables: Internal: rework so stacked headers height may be used. b9ebb8e06 Tables: fixed right-clicking right-most section (past right-most column) from highlighting right-most column. feddcf303 Combo: amends for ImGuiComboFlags_WidthFitPreview. (#6881) 112d8fc41 Combo: added ImGuiComboFlags_WidthFitPreview. (#6881) 001f102f3 IO, Backends: added ImGuiKey_AppBack, ImGuiKey_AppForward. (#6891, #4921) 7bbd75868 Backends: Win32: revert oops chunk. b0758c86d Backends: Added support for extra ImGuiKey values: F13 to F24 function keys. (#6891, #4921) 73346e434 IO: Add extra keys to ImGuiKey enumerator: ImGuiKey_F13 to ImGuiKey_F24. (#6891, #4921) 0312a29e4 ImageButton(): clarify purpose of size. (#6901, #5533, #4471, #2464, #1390). 1107bffe8 Popups: clarified meaning of 'p_open != NULL' in BeginPopupModal() + set back user value to false when popup is closed in ways other than clicking the close button. (#6900) 72ebd9156 Merge branch 'master' into docking 2c07d581d TreeNode: Added ImGuiTreeNodeFlags_SpanAllColumns for use in tables. (#3151, #3565, #2451, #2438) 085ed7bfb Drag and Drop: Rework drop target highlight. (#4281, #3272) 0dd756bce Moved GetCursorScreenPos/SetCursorScreenPos on top of its section. a63e2f0a3 Drag and Drop: Fixed submitting a tooltip from drop target location. Added demo. 64b1aeebf Backends: OpenGL3: rename gl3w's loader symbols to allow LTO compilation with another copy of gl3w. (#6875, #6668, #4445) 28b237f94 Separator(): Altered end-points to use more standard boundaries. (#205, #4787, #1643, #759) 330d76347 Separator: clarified setting the ImGuiSeparatorFlags_SpanAllColumns flag. (#759) 9064dbd40 Backends: DX9: Fixed incorrect assert triggering on reopening session with minimized windows. (#3424) a61438740 Debug Tools: Metrics: Added "Show groups rectangles" in tools. d27b4ad36 Backends: GLFW: support for case where secondary viewport WndProc is not the same as main viewport one. (#6889) 17bfafda5 Backends: GLFW: moved WndProc hook to bottom of file + rename a field. (#6889) ff534b0d0 Docking: Fixed a bug where ClassId compare tests (when using SetNextWindowClass) on success would prevent further filter from running. (#6882) f8aed6499 Debug Tools: Rename ShowIdStackToolWindow() -> ShowIDStackToolWindow(). (#4631) 701a047ac Fonts: Fix clang compiling warning & error with freetype + lunasvg (#6873, #6842, #6591) 03e2a7f58 Debug Tools: Rename ShowIdStackToolWindow() -> ShowIDStackToolWindow(). (#4631) c21278eea Debug Tools: Rename ShowIdStackToolWindow() -> ShowIDStackToolWindow(). (#4631) b7c250925 Merge branch 'master' into docking 2f431a948 IO: removed io.MetricsActiveAllocations introduced in 1.63. Same as 'g.DebugMemAllocCount - g.DebugMemFreeCount' (still displayed in Metrics. f1519efb1 BeginGroup(): fix/amend 9ece0bd. 456aa3bc0 Menus: Fixed a bug where activating an item in a child-menu and dragging mouse over the parent-menu would erroneously close the child-menu. (#6869) 9ece0bdc0 BeginGroup(): Fixed a bug pushing line lower extent too far down when called after a call to SameLine() followed by manual cursor manipulation. 8175a4788 Debug Tools: Renamed ShowStackToolWindow() ("Stack Tool") to ShowIdStackToolWindow() ("ID Stack Tool"). (#4631) 204ae8a40 Internals: added ImRect::ContainsWithPad() bb2fb7464 Merge branch 'master' into docking 94da5842e Renamed ImFloor() to ImTrunc(). Renamed ImFloorSigned() to ImFloor(). (#6861) c41868531 Fixed window inner clipping rectangle off by one when window is located on a monitor with negative coordinates. (#6861, #2884) e5ca5351d TabBar: Fixed position of unsaved document marker (ImGuiTabItemFlags_UnsavedDocument) which was accidentally offset in 1.89.9. (#6862) 72ae6f520 Fixed MousePosPrev with has never been valid outside of NewFrame(). 12ee2dd78 Backends: Win32: Synthesize key-down event on key-up for VK_SNAPSHOT / ImGuiKey_PrintScreen as Windows doesn't emit it. (#6859) d4869207e Misc: Most text functions also treat "%.*s" (along with "%s") specially to avoid formatting. (#3466, #6846) f4790f6f6 BeginItemTooltip: Rename flag in comment (#6853) daf49e9d8 Made ImFileOpen reuse a memory buffer so .ini saving doesn't allocate once every time. Added commented out MemAlloc/MemFree debug log. 2c0007731 Docking: fixed calling DockContextCalcDropPosForDocking() with window in node without passing its node. 61acb34e3 Docking: Fixed an issue leading to incorrect restoration of selected tab in dock nodes that don't carry the currently focused window. (#2304) 3ce6b06fe Merge branch 'master' into docking d6360c1ba Fonts, imgui_freetype: Fixed a warning and leak in IMGUI_ENABLE_FREETYPE_LUNASVG support. (#6842, #6591) 6c022f9bf IO, Inputs: rename SetMousePos() to TeleportMousePos(). (#6837, #228) ff36fe365 IO, Inputs: setting io.WantSetMousePos ignores incoming MousePos events. (#6837, #228) ef8ff1b5d TabBar, Style: added style.TabBarBorderSize and associated ImGuiStyleVar_TabBarBorderSize. (#6820, #4859, #5022, #5239) 64b1e448d TabBar, Style: added style.TabBarBorderSize and associated ImGuiStyleVar_TabBarBorderSize. (#6820, #4859, #5022, #5239) ac3bc73c1 Docking: Fixed node tab-bar not having a filled value for tab-bar which is required for claiming moue wheel ownership in (unenabled) ImGuiTabBarFlags_FittingPolicyScroll mode. afd0d3fca Docking: made ImGuiDockNodeFlags_NoUndocking public. (#2999, #6823, #6780, #3492) 72d760ba0 Docking: (Breaking) renamed ImGuiDockNodeFlags_NoDockingInCentralNode -> ImGuiDockNodeFlags_NoDockingOverCentralNode, ImGuiDockNodeFlags_NoSplit -> ImGuiDockNodeFlags_NoDockingSplit. f693c3d80 Docking: made "ImGuiDockNodeFlags_NoDocking" a combination of all others ImGuiDockNodeFlags_NoDockingXXX flags. (#2999, #6823, #6780, #3492) 7e246a7bb Merge branch 'master' into docking 6addf28c4 Fonts: Ensure calling AddFontXXX function doesn't invalidates ImFont's ConfigData pointers prior to building again. (#6825) 161281311 Docking: Internals: added ImGuiDockNodeFlags_NoUndocking. (#2999, #6823, #6780) 14f8b76c1 Docking: Comments. Removed misleading shared/local identicators. (#6823, #2999) b101cf46b ListBox, Combo: Changed signature of "name getter" callback in old one-liner ListBox()/Combo() apis. 8a2cd8109 TypingSelect: always enable nav highlight. 223b19f11 Fixed warning when builidng with IMGUI_DISABLE_DEBUG_TOOLS. 779568bb3 TypingSelect: tidy up some more + split ino functions to make reuse simpler. 661a70fc7 TypingSelect: fast switch between characters in + debug, internal renames. 32171a8b0 Fonts: Better assert during load when passing truncated font data or wrong data size. (#6822) c32db3c72 Tables: Fixed an edge-case when no columns are visible + table scrollbar is visible + user code is always testing return value of TableSetColumnIndex() to coarse clip. c86ce7096 Internal: Nav,MultiSelect: import ImGuiSelectionUserData, SetNextItemSelectionUserData() from MultiSelect. Track NavLastValidSelectionUserData as a convenience. f336e639e TypingSelect: rework GetTypingSelectRequest(), provide TypingSelectFindResult(). 9714594c3 Tooltips: made using SetItemTooltip()/IsItemHovered(ImGuiHoveredFlags_ForTooltip) defaults to activate tooltips on disabled items.. (#1485) 6eb2681c0 Internals: InitOrLoadWindowSettings() clear Size again for better data nuking in tests. Debug Log: added ImGuiDebugLogFlags_OutputToTestEngine flag. bed492da7 Tables: amend support for auto-resize. (#6807) 556a1397a Tables: Remove comment referencing removed field SortSign (#6807) 3aceb6105 Tables: Request user to submit contents when outer host-window is requesting auto-resize. (#6510) da21b7431 Tables: Fixed subtle drawing overlap between borders in some situations. (#2957, #6765) 5a483c2ff Tables: Fixed top-most outer border being drawn with both TableBorderLight and TableBorderStrong in some situations, causing the earlier to be visible underneath when alpha is not 1.0f. a34071876 Tables: Fixed bottom-most and right-most outer border offset by one. (#6765, #3752) 357f752be Docs: add more links to the top of every examples and backends files. b9ab6e201 Nav: Tabbing always enable nav highlight when ImGuiConfigFlags_NavEnableKeyboard is set. (#6802, #3092, #5759, #787) 0e1ce76ea InputTextMultiline: Fixed Tabbing cycle leading to a situation where Enter key wouldn't be accepted by the widget when navigation highlight is visible. (#6802, #3092, #5759, #787) bd63a9f05 Fonts: 'float size_pixels' passed to AddFontXXX() functions is now rounded to lowest integer. (#3164, #3309, #6800) 72dbe45ad Merge branch 'master' into docking 0962c9fb7 TypingSelect: Added first version of GetTypingSelectRequest() API. 781203940 ImVector: Added find_index() helper. 44a6b493e Commented out obsolete ImDrawCornerFlags_XXX. Commented out runtime support for hardcoded ~0 or 0x01..0x0F rounding flags values for AddRect()/AddRectFilled()/PathRect()/AddImageRounded() becd75676 Commented out obsolete redirecting function: GetWindowContentRegionWidth(). 727c46206 Internals: Added ImTextFindPreviousUtf8Codepoint() helper + comments. c9d3c29aa Backend: Win32: support keyboard codepage conversion for when compiling in MBCS mode and creating a non-Unicode window. (#6785, #6782, #5725) e3d9b875c ImDrawList: added PathEllipticalArcTo(), AddEllipse(), AddEllipseFilled(). (#2743) fa2e5710a MenuBar: Fixed an issue where layouting an item in the menu-bar would erroneously egister contents size. (#6789) 56a7b8b72 Backends: GLFW: Clear emscripten's MouseWheel callback before shutdown. (#6790, #6096, #4019) d8ef864b0 InputTextMultiline: Fixed a crash pressing Down on last empty line of a multiline buffer. (#6783, #6000) cf1c4a0cb BeginListBox(): fixed not consuming SetNextWindowXXX data when returning false. fb9b00686 Version 1.90 WIP f24387fa2 Version 1.89.9 (fixed changelog header) c4dc8fd10 Docs: Update FONTS.md (#6781, #6632, #6339, #5763, #5330, #2234, #2042, #1259, #951, #220) c6e0284ac Fixed minor warning. 1d8e48c16 Using range-based for where it makes sense. (#4537) a1b60fc1f Merge branch 'master' into docking fef338915 Version 1.89.9 7b5fb3329 Tables: Internals: renamed CellPaddingY to RowCellPaddingY. bdc4dfebf Tables: Amend support for cross-cell SameLine() for first column. Amend 9a93fb5 + 8f5ce73. 9a93fb571 Tables: Fixed support for cross-cell SameLine() by preserving Line Y1 position. Amend 8f5ce73. e8a5c9e1b Tables: Made it possible to change style.CellPadding.y between rows. Added demo. 3816d478d ImDrawList: small debug-mode optimization when calling AddRect() without rounding + Selectable: small debug-mode optimization. 8c497793f Demo: Tweak table sorting demo code. 303dc091b Revert "IO: ImGuiMod_Shortcut (Ctrl/Cmd depending on platform) is reflected in io.KeyMods. (#5923, #456)" b8f93a8fe IO: ImGuiMod_Shortcut (Ctrl/Cmd depending on platform) is reflected in io.KeyMods. (#5923, #456) a06607405 Clipper: Fixed a bug if attempt to force-include a range which matches an already included range. (#3841) bdd9b96fa Demo: Reorganized "Examples" menu. Tweak Property Editor. 300464a48 Docking: when io.ConfigDockingWithShift is enabled, staying stationary while moving a window displays an help tooltip to increase affordance. (#6709, #4643) 7d6e83efc Docking: Fixed non-root dockspace not having their background rendered properly. 08b3a1a34 ImDrawList: Automatically calling ChannelsMerge() if not done after a split. f93d0befa Slider: fixed support for ImGuiItemFlags_ReadOnly/ImGuiSliderFlags_ReadOnly although it is technically unused/undocumented. (#6758) d6e9fad60 Tables: Fix typo in TableGetSortSpecs comment + amend comment. (#6755) 82d177ccb Using range-based for where it makes sense. (#4537) 762ec445e Docking: Fixed bad bug, dock node host wouldn't merge background. (#6753, #6716) 33ea1e8b7 ColorEdit, ColorPicker: Manipulating options popup don't mark item as edited. (#6722) 475453668 Backends: SDL2/SDL3: Fixed bad merge in docking branch (#6735) f617fe789 Clipper: Renamed IncludeRangeByIndices()/ForceDisplayRangeByIndices() to IncludeItemsByIndex(). (#6424, #3841) 200053771 Clipper: Added IncludeIndex() helper to include a single item. (#6424, #3841) 4a7810e99 Update README.md 981abb461 Examples: Emscripten+webgpu: Fixed WGPUInstance creation process + use preferred framebuffer format. (#6640, #6748) 61d35972e CloseButton, CollapseButton: don't include FramePadding into size. Use ItemInnerSpacing.x between title bar buttons. Amend for Docking. (#6749) 676497fe0 Merge branch 'master' into docking 4a8142449 CloseButton, CollapseButton: don't include FramePadding into size. Use ItemInnerSpacing.x between title bar buttons. (#6749) b41811a68 CollapseButton: handle clipping better + align circle like in docking branch. 040e818d7 Fix typo in SameLine comment (#6745) 162f8e01a Backends: SDL3: fixed typo in 1e17d59 (#6735) ba1fa904a IO: Exposed io.PlatformLocaleDecimalPoint to configure decimal point ('.' or ','). (#6719, #2278) a1a7a1bc0 InputFloat, SliderFloat, DragFloat: always turn both '.' and ',' into the current decimal point character. (#6719, #2278) a6857ede0 IO: fix writing to incorrect union section for MouseSource in AddMousePosEvent and AddMouseButtonEvent. (#6727, #2702) c06c79624 TreeNode: added note about ImGuiTreeNodeFlags_Bullet. 116130138 Backends: amend "Missing features" sections for multi-viewports support. 1e17d5996 Backends: SDL2,SDL3: added ImGui_ImplSDL2_InitForOther() / ImGui_ImplSDL3_InitForOther(). 983b95bc8 Demo: tweak explanation about static keyword. (#6718) d2c7cbcbf Misc: Made multiple calls to Render() during the same frame early out faster. ac64b6563 Render: draw dimmed background earlier to match docking code. (#6716) f422e7826 ImDrawData: Fixed an issue where TotalVtxCount/TotalIdxCount does not match the sum of individual ImDrawList's buffer sizes. (#6716) 8f5ce7314 Tables: Made it possible to use SameLine(0,0) after TableNextColumn() or TableSetColumnIndex() in order to reuse line height from previous cell. 1362fc0c5 Debug, Internals: Added DebugDrawCursorPos(), DebugDrawLineExtents() helpers. 63b6300c3 Merge branch 'master' into docking bc3c0ce77 Nav, TreeNode: Pressing Left with ImGuiTreeNodeFlags_NavLeftJumpsBackHere now goes through proper navigation logic: honor scrolling and selection. (#1079, #1131) edebb90a9 Demo: amend/fix for MinGW 4d6fbaff1 Demo: define standard PRI names we use (if missing) instead of defininig IM_PRId64, IM_PRIu64. 226923fa7 Metrics: Fixed "Drawlists" section and per-viewport equivalent appearing empty (regression from c649aca). 2b1fc6f76 Demo: Demonstrate out-of-order rendering using ImDrawListSplitter. cf3726bcb Internals: rename bg/fg drawlist holders in structs to reduce confusion. 52587c28d ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively large radius to AddCircle(). (#6657, #5317) f8c768760 Typo fix: _NoHostExtenY -> _NoHostExtendY (#6687) c00e68102 Docs: update CONTRIBUTING.md b7a7d673b Fixed an integer overflow and div-by-zero in SliderInt() when v_max is INT_MAX (#6675, #6679) d6d94d90b Version 1.89.9 WIP f8704cd08 Merge branch 'master' into docking f7eea6387 Version v1.89.8 30594c37d Merge branch 'master' into docking ab490dc7b Fonts: Amends for support for OpenType SVG fonts using lunasvg (#6591, #6607) 2ad8c60ab Fonts: Added support for OpenType SVG fonts using lunasvg (#6591, #6607) 19ae142bd Mark alternative ImColor constructors as constexpr, second attempt (#6656) dc2b0a282 Disable -Wreserved-identifier warning on Clang (applying to member fields seems excessively weird). 88a330ebe Revert "Mark alternative ImColor constructors as constexpr (#6656)" fa2f1bfbb Examples: Vulkan: Fixed Vulkan descriptor pools. (#6642) 7c5b0e829 Mark alternative ImColor constructors as constexpr (#6656) eefc9035f Fonts: ImFontConfig::OversampleH now defaults to 2 instead of 3. c87b9fdb1 Docs update. Improved Fonts troubleshooting section. 556ce9f54 imgui_stdlib: Fix warning (#6658) 79d6f4e21 Misc: Avoid stb_textedit.h reincluding string.h while in a namespace. (#6653, #4791) f1781c20a Added IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION config macro to disable stb_sprintf implementation (#6626) f8f805f04 Merge branch 'master' into docking 1109de382 Tooltips: fixed ImGuiHoveredFlags_ForTooltip conflicting with ImGuiHoveredFlags_NoNavOverride since 10c7709f. (#6622, #1485) db66e33e9 Tables: fixed GetContentRegionAvail().y report not taking account of lower cell padding or of using ImGuiTableFlags_NoHostExtendY. (#6619) 2bc5d17ac Tables: fixed calculation of multi-instance shared decoration/scrollbar width of scrolling tables. (#5920, #6619) e5977f05d Backends: GLFW: revert support for GLFW_CURSOR_DISABLED, let user use ImGuiConfigFlags_NoMouse. (#5625, #6609) d342ec10c Overlap, IsItemHovered: clarification on using IsItemHovered() on a non-reactive item after a reactive overlappable one. (#6610) 52125a54a Tables: added TableGetHoveredRow() in imgui_internal.h. (#6250, #6347, #6588, #3740) 77eba4d0d CI: resume using latest Emscripten 3dc3aef8a Backends: WebGPU: fix webgpu changes for Dawn. (#6602, #6188) 0e8eb8c48 Removed _MSC_VER <= 1500 checks for Visual Studio 2008 or earlier. 863ac31f0 Doc: various tweaks + tweak imconfig comments. 07d1709ca Doc: removed "generic" docking/viewport branch section of changelog since this is misleading. Will add formally when we reelase. (#2109, #1542) 33e13c85e Backends: Made all backends sources files support global IMGUI_DISABLE. (#6601) 023e59a5f ImDrawData: call _PopUnusedDrawCmd() later. as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch). (#6406, #4879, #1878) 6888e6cdf ImDrawData: call _PopUnusedDrawCmd() later. as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch). (#6406, #4879, #1878) 0110f4c8c Merge branch 'master' into docking dbeeeae59 ImDrawData: Slight refactor so internal logic uses same logic as AddDrawList(). (#6406, #4879, #1878) 1a9ddd239 ImDrawData: added AddDrawList() helper function. (#6406, #4879, #1878) c649aca20 ImDrawData: changed CmdLists from raw array to ImVector<> owned by ImDrawData itself. Faclitate user-manipulation of the array (#6406, #4879, #1878) + deep swap. (#6597, #6475, #6167, #5776, #5109, #4763, #3515, #1860) cc4c37dba Nav: PageUp/PageDown always set NavJustMovedTo even when landing on same spot (which can trigger a selection). 51b348095 Docking, Style: resizing separators use same colors as window borders. (#2522) b7cdb5a31 Scrollbar: layout needs to take account of window border size, so a border size will slightly reduce scrollbar size. (#2522) f4942bca3 Docking: follow to 27c735e to fix rendering of docked-window scrollbar above outer border. (#2522) 27c735e3e Scrollbar: layout needs to take account of window border size, so a border size will slightly reduce scrollbar size. (#2522) f6feddd1e Merge branch 'master' into docking b79751eba Docking: Added DockingSeparatorSize to style: amends (#3481, #4721, #2522) a5aff5fd3 Docking: Added DockingSeparatorSize to style (#3481, #4721, #2522) 5ce636b0b Tweak to accomodate for build* directories anywhere. 140726d23 Fixed CTRL+Tab dimming background assert when target window has a callback in the last ImDrawCmd. (#4857, #5937) b32ef809c InputText: Fixed a case where deactivation frame would write to underlying buffer or call CallbackResize although unnecessary, in a frame where the return value was false. 334929637 InputText: Tweak ImGuiInputTextFlags_EscapeClearsAll handling so decision is taken on input buffer + Showcase a few more InputText() flags. (#5688, #2620) 6aa408c6a IO: Added io.ClearEventsQueue(). Obsoleted io.ClearInputCharacters(). (#4921) 9a15730c2 Demo: better showcase use of SetNextItemAllowOverlap(). (#6574, #6512, #3909, #517) 3fe431931 Version 1.89.8 WIP 8566fec66 Backends: SDL3: Changing SDL_WINDOW_SKIP_TASKBAR to SDL_WINDOW_UTILITY for SDL3 (#6573) dc3e531ff Merge branch 'master' into docking d4ddc46e7 InputText: Fixed a crash on deactivating a ReadOnly buffer. (#6570, #6292, #4714) 40aac5875 Changelog amends ac8573884 Backends: Vulkan: Amends for docking branch. (#5446, #5037) 677c7b225 Merge branch 'master' into docking cb9015e25 Version 1.89.7 121072cfe Backends: Vulkan: Amend for support for dynamic_rendering (#5446, #5037) 7812e836e Backends: Vulkan: Support for dynamic_rendering (#5446, #5037) dcdb14571 Docs: Fix outdated link in freetype docs (#6568) 1029f57b8 Inputs, Tooltip: Rework stationary timer logic as it broke on high-framerates with lower rate of mouse inputs. (#1485) 64172685d InputText: ImGuiInputTextCallbackData::InsertChars() accept (NULL,NULL) range, in order to conform to common idioms. (#6565, #6566, #3615) 655aae591 Comments + docs: tidying up todo list + demo tweak for tooltips. a02315e1c Combo: Made simple/legacy Combo() function not returns true when picking already selected item. (#1182) a88e5be7f Merge branch 'master' into docking 6137443d2 Overlap: moved ImGuiItemflags_AllowOverlap handling from ButtoBehavior() to ItemHoverable() now that it is possible. (#6512, #3909, #517) 4dee919bc (Breaking) Internals: added ImGuiItemFlags param to ItemHoverable(), so it can be called from ButtonBehavior() not following an ItemAdd(). 10c7709f3 Overlap: IsItemHovered: Changed behavior to return false when querying an item using AllowOverlap mode. Added ImGuiHoveredFlags_AllowWhenOverlappedByItem, ImGuiHoveredFlags_AllowWhenOverlappedByWindow., (#6512, #3909, #517) 8439a7364 Overlap: Added 'SetNextItemAllowOverlap()' as a replacement for 'SetItemAllowOverlap()'. (#6512, #3909, #517) a9a5cbf43 Overlap: Internals: add NextItemData.ItemFlags to facilitate implementation of SetNextItemAllowOverlap() + potentially remove extra_flags from ItemAdd(). (#6512, #3909) 07e24b405 ButtonBehavior: pull ImGuiButtonFlags_Repeat from ImGuiItemFlags_ButtonRepeat, matching ItemHoverable() logic. So more widgets can take advantage of Repeat logic. 51f564eea (Breaking) Overlap: Renamed 'ImGuiTreeNodeFlags_AllowItemOverlap' to 'ImGuiTreeNodeFlags_AllowOverlap', 'ImGuiSelectableFlags_AllowItemOverlap' to 'ImGuiSelectableFlags_AllowOverlap'. Kept redirecting enums (will obsolete). (#6512, #3909, #517) 06f5b4613 Overlap: Fixed first frame of an overlap highlighting underlying item if previous frame didn't hover anything. (#6512, #3909, #517) b03a4993b Internals: reorder tests in ItemHoverable() so most likely early out are taken first. 836aff346 Drag and Drop: Amend ItemHoverable() logic for item with no identifier. d5d4d709c Drag and Drop: moved "drag souce doesn't report as hovered" from ButtonBehavior() to ItemHoverable(). a2f658117 Selectable: Fixed bad manual cherry-pick/merge (fixes 3ec128c) 3ec128c5f Selectable, TreeNode: When using ImGuiSelectableFlags_AllowOverlap/ImGuiTreeNodeFlags_AllowOverlap and holding item held, overlapping widgets won't appear as hovered. (#6512, #3909) cada78917 Tables: removed misleading, seemingy useless use of ImGuiButtonFlags_AllowtemOverlap in TableUpdateBorders(). (#6512, #3909) 0a53b4585 CollapsingHeader/TreeNode: Fixed text padding when using _Framed+_Leaf flags. (#6549) 6b0111405 Merge branch 'master' into docking 057fcae30 Docking+Viewports: Fixed extraneous viewport+platform-window recreation. Part 4. 35b41949f Docking+Viewports: Fixed extraneous viewport+platform-window recreation. Part 3. 099e8533e Docking+Viewports: Fixed extraneous viewport+platform-window recreation. Part 2. 66c09fc05 Docking+Viewports: Fixed extraneous viewport+platform-window recreation. Part 1. 7d81a166f Docking: Fixed one-frame flickering on reappearing windows binding to a dock node where a later-submitted window was already bound. 6b2e03c5b GetKeyName(): Fixed assert with ImGuiMod_XXX values when IMGUI_DISABLE_OBSOLETE_KEYIO is set. e4aeef4b9 Viewports: Closing a viewport via OS/platform means (e.g. OS close button or task-bar menu), mark all windows in this viewport as closed. 94c46d748 InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) cb5542bce Backends: OpenGL3: Fixed erroneous use glGetIntegerv(GL_CONTEXT_PROFILE_MASK) on contexts lower than 3.2. (#6539, #6333) 959a9c79b TreeNode: Added support for ImGuiTreeNodeFlags_UpsideDownArrow in frameless tree nodes (#6517, #6538) e0583975c Demo: Fix typo (amusingly had no side effect). 1450d23b6 Merge branch 'master' into docking 9214c28aa IsWindowHovered, IsItemHovered: Assert when passed any unsupported flags. e7a4327eb IsWindowHovered: Added support for ImGuiHoveredFlags_Stationary. b60acfa87 Tooltips: Added SetItemTooltip(), BeginItemTooltip(). Improved Demo section. 0f72652c2 IsItemHovered, Tooltips: Added io.HoveredFlagsForTooltipMouse, io.HoveredFlagsForTooltipNav now pulled by ImGuiHoveredFlags_Tooltip. (#1485) b3b8cbd00 IsItemHovered, Tooltips: Added ImGuiHoveredFlags_ForTooltip, ImGuiHoveredFlags_Stationary. (#1485) d4b94bd65 (Breaking) Moved io.HoverDelayShort/io.HoverDelayNormal to style.HoverDelayShort/style.HoverDelayNormal. (#1485) f09ef23ae IsItemHovered, Tooltips: Tweak default delay again. (#1485) d96bbf0aa TreeNode: Added undocumented ImGuiTreeNodeFlags_UpsideDownArrow flag. (#6517) 194916135 Internals: renamed HoverDelay fields. 15d74bad1 Internals: Tooltips: renamed internal flags (expecting to expose later when we publish priority stuff). b9db5c566 Backends: Win32: Added support for updating ParentViewportID after viewport creation. 89d3dabf2 Modals: In the case of nested modal, made sure that focused or appearing windows are moved below the lowest blocking modal (rather than the highest one). (#4317) eec344cc1 Tweak HoverDelayClearTimer. Not exposing since I am unsure logic is viable (and is rather complex with upcoming addition of stationary logic). (#1485) 6cabad6e7 Encode version string in binary to facilitate identification when demo/tools are striped + amend About window. 534340cd8 Tooltips: Tweak default offset for non-drag and drop tooltips. e95d66faa Clipper: Rework inner logic to allow functioning with a zero-clear constructor. (#5856) ef07ddf08 Debug Tools: Added 'io.ConfigDebugIniSettings' option to save .ini data with extra comments. 9c1697674 Debug Tools: Added 'io.ConfigDebugIniSettings' option to save .ini data with extra comments. fa5d2656b Docking: DockBuilderDockWindow() API calls don't clear docking order if the target node is same as existing one 3cc9d2051 Examples: Win32+OpenGL3: Fixed not calling DefWindowProcW() as with other Win32 examples. (#6516, #5725, #5961, #5975) 3f63cee4c Docking: Fixed dragging from title-bar empty space (#5181, #2645) 884e3fd21 Backends: GLFW: Accept glfwGetTime() not returning a monotonically increasing value. (#6491, #6189, #6114) dec082ff9 Backends: OpenGL3: Fixed support for glBindSampler() backup/restore on ES3. (#6375, #6508) 066487799 Merge branch 'master' into docking 4fab72b40 BeginChild/Tables: Fixed BeginChild temporary activation id collision. Fixes regression in 1.89.6 leading to the first column of tables with either ScrollX or ScrollY flags from being impossible to resize. (#6503) a134892a3 BeginComboPreview: fix when part of preview rect is clipped by parent window. (#6501, #1658) 666b93e98 Demo: fixed a misuse of EndChildFrame(). (#6496) 956a1a17f Internals: add ImGuiNavMoveFlags_NoSelect and use in FocusItem(). 31f11cf30 Internals: Added FocusItem(). Made activation explicit/opt-in via ImGuiNavMoveFlags_Activate. Rename ActivateItem() to ActivateItemByID(). 8fd0a0413 Backends: SDL3: Fix backend in docking/multi-viewports branch. (#6483) 61ebb3784 Version 1.89.7 WIP f1777f951 Demo: fix casing swap demo inserting garbage characters when typing lowercase letters (#6482) 823a1385a Merge branch 'master' into docking 5319d1cff Version 1.89.6 075b975fe Fonts: Fixed crash when manually specifying an EllipsisChar that doesn't exist. (#6480) b47618457 Backends: SDLRenderer3: Amend/finish SDL_Renderer3 patch + add example. (#6286) 0b57c07c7 Backends: SDL3: Add SDL_Renderer for SDL3 implementation. (#6286) b709b02e9 Backends: SDL_Renderer2: renamed all functions accordingly. (#6286) 88e7d773d Backends: SDL_Renderer2: Renamed 'imgui_impl_sdlrenderer.h/cpp' to 'imgui_impl_sdlrenderer2.h/cpp' (#6286) 216ae7db5 Examples: SDL3: Added clues that Emscripten doesn't support SDL3 yet. (#6386) 3418d5094 Viewports: Fixes erroneous popup closure on closing a previous popup. (#6462, #6299) f0f3b927e Backends: GLFW: Avoid linking with GLFW function for homebrew switch (#6473) 6cc967a12 Backends: GLFW: Only enable Vulkan support if not building with Emscripten (#6468) 2e810d575 Backends: GLFW: Fix breaking typo 19b436f68 (#5683, #6459) 19b436f68 Backends: GLFW: Preserve monitor list when there are no monitor. (#5683) 7e03ae324 Window: Fixed resizing from upper border when io.ConfigWindowsMoveFromTitleBarOnly is set. (#6390) 7947f327d Demo: added casing swap demo to clarify use of ImGuiInputTextFlags_CallbackCharFilter. (#6457) + Metrics: simplified some code. 47579f8a4 Nav: set NavJustMovedToXXX fields on NavInit result + BeginChild() clears ActiveId on N+1 on entering instead of waiting for ID to elapse on N+2. 52e19113f Backends: OpenGL3: Added more explicit comments about using GL ES2/3 on targets where it's not automatic. (#6450) 08145bc45 Fonts: Fixed crash when merging fonts and the first font has no valid glyph. (#6446) 54c1ac3e3 Merge branch 'master' into docking 45c8c3b61 Listbox: commented out obsolete/redirecting functions that were marked obsolete more than two years ago: ListBoxHeader(), ListBoxFooter(). df8667b18 Comments/typos tweaks 2c558d574 Internals: SeparatorEx(): expose thickness + add misc comments relating to Separators. e590b5114 Viewports: Fixed loss of imgui-side focus when dragging a secondary viewport back in main viewport. (#6299) c8579abb4 Examples: DX9: Fix WM_SIZE handling bug introduced in 031e152d2. (#6374) 7348e9926 CI: temporarily use Emscripten 3.1.37 because 3.1.18 has a regression. e489e40a8 Clipper: Amend ecb0aaa (#6424, #3841) ecb0aaa7c Clipper: Renamed ForceDisplayRangeByIndices() to IncludeRangeByIndices(). (#6424, #3841) + commented out obsolete ImGuiListClipper() constructor. a550263d6 Misc: made ErrorCheckEndWindowRecover() handle font stack. (#6431, #1651) bcfc1ad8f Nav: Forwarded (wrap/loop) request don't mistakenly wreck reference pos. 530134d12 Merge branch 'master' into docking 430c05991 Docs: added more detailed information about UTF-8 encoding. 513af1efc Examples: Updated all Visual Studio project file to use /utf-8 option, so string literals are UTF-8 encoded by default. 0397321be Debug Tools: Added 'io.ConfigDebugIgnoreFocusLoss' option. (#4388, #4921) 6656553fa Nav: Record/restore preferred position on each given axis. 39f7248d4 Backends: OpenGL3: Add glBindSampler for GL ES 3.0. (#6375) dd9db5e88 Backends: OpenGL3: Added runtime flags for ES2/ES3 to simplify coding-style. (#6375) 6cdedf583 Drag, Sliders: if the format string doesn't contain any %, when using CTRL+Click to input we use a default format. (#6405) 70cca1eac Backends: avoid null dereference in metal and osx shutdown (#6385, #6334) 5dc601371 Backends: SDL3: Fixed build on Emscripten/iOS/Android. (#6391) 7c291ba31 Tables: Fixed command merging when compiling with VS2013. (#6377) 085fa42b7 Adedd workaround for GCC erroneous/zealous warning (#5343) 031e152d2 Examples: DX9, DX10, DX11: Queue framebuffer resize instead of processing in WM_SIZE. (#6374) 15da1a9ab Fixed misleading local name (#4493) + minor typo (#6369) 031148dc5 Fixed bad merge. fd943182b ImVec2: Added unary minus operator (#6368) 594cc4793 Merge branch 'master' into docking d3ad2f357 Menus: Fixed an issue when opening a menu hierarchy in a given menu-bar would allow opening another via simple hovering. (#3496, #4797) b47507951 Nav: Fixed CTRL+Tab into a root window with only childs with _NavFlattened flags erroneously initializing default nav layer to menu layer. eed7b0e9c Nav: remove other-axis clamping, now that columns themselves are clamped. (#2221) da3d7e158 Focus: added an early out in FocusWindow() for the common case. 565aa0b76 Examples: Vulkan: pick integrated GPU if nothing else is available. (#6359) 0fbf2888e Examples: example_glut_opengl2: Fixed compilation issue (#6361) d2291df55 Viewports: Fixed setting focus from platform decoration from accidentally closing modals (#6299, #6357) bba39762d Merge branch 'master' into docking 4d42450a7 Focus: amend ImGuiFocusRequestFlags_UnlessBelowModal to bring to front-most below the modal, simplify code in Begin(). (#6357, #4317) 01ca19653 Focus: move focused child restore code in FocusWindow() with ImGuiFocusRequestFlags_RestoreFocusedChild flag. (#6357) 30eceaf95 Focus: start moving modal check into FocusWindow(), add ImGuiFocusRequestFlags_UnlessBelowModal (currently opt-in, should try to make opt-out). (#6357, #4317) f0fe1957a Focus: merge extra param for FocusTopMostWindowUnderOne() from docking branch to facilitate merge. ac38c8e6f IO: removed ImGuiBackendFlags_HasMouseHoveredViewport assert in AddMouseViewportEvent(). c11128891 Backends: SDL2/SDL3: Update monitor list when receiving a display event. (#6348) adf693c06 Viewports: added void* ImGuiPlatformMonitor::PlatformHandle field (backend-dependant). 00d3f9295 Nav: Fixed navigation within tables/columns where item boundaries goes beyond columns limits. (#2221) 8d9e50c80 Nav: fixed IMGUI_DEBUG_NAV_SCORING not setting NavMoveClipDir, leading to debug result not matching real results. 662ce4697 Debug Log: Fixed not parsing 0xXXXXXXXX values when the identifier is at the end of the line. 07e07030a Backends: Win32: revert accidental deletion of ImGui_ImplWin32_EnableAlphaCompositing() in a566ecc (#3218) a89590b42 Backends: Win32: revert accidental deletion of ImGui_ImplWin32_EnableAlphaCompositing() in a566ecc (#3218) 88ac2ced7 Backends: DX10: Fixed typo in previous commit. f498f084d Examples: Amend Win32/Winapi + OpenGL example for multi-viewport. (#3218, #5170 and #6086, #2772, #2600, #2359, #2022, #1553) 4bc51c6ff Examples: Extend Win32/Winapi + OpenGL example for multi-viewport. (#3218, #5170 and #6086, #2772, #2600, #2359, #2022, #1553) 1f2b84a65 Backends: clear viewport specific bits in io.BackendFlags on backend Shutdown(). (#6334) 4f692ba84 Merge branch 'master' into docking 9308cfdcf Examples: Amend Win32/Winapi + OpenGL example. (#3218, #5170 and #6086, #2772, #2600, #2359, #2022, #1553) a566ecc58 Examples: Add Win32/Winapi + OpenGL example. (#3218, #5170 and #6086, #2772, #2600, #2359, #2022, #1553) a338b78eb Backends: OpenGL3: amend reset GL_POLYGON_MODE separately for front and back when possible. (#6333) d0836aa89 Backends: OpenGL3: reset GL_POLYGON_MODE separately for front and back when possible. (#6333) d6a7aca2f Nav: Debug: tweak debug facilities. 0948cfc19 InputText: do not set WantTextInputNextFrame during the frame InputText is deactivated. (#6341) e49d31a1c Tables: do not show empty tooltip when user submits TableHeader with no label to display. (#6342) f94a8344f Fix minor typos in FAQ (#6328) 055e71518 Backends: clear bits set in io.BackendFlags on backend Shutdown(). Clear BackendPlatformName. (#6334, #6335) f304603e1 Backends: GLUT: remove call to ImGui::NewFrame() from ImGui_ImplGLUT_NewFrame(). (#6337) 064153fca Version 1.89.6 WIP 0ea3b87bd Merge branch 'master' into docking 1ebb91382 Version 1.89.5 ba98667c6 Examples: Vulkan: further work for device extensions + tentative use o fVK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME. (#6109, #6172, #6101) 632428043 Examples: Vulkan: rework extensions setup + enable some to avoid validation layer errors. (#6109, #6172, #6101) 995f92a45 Nav: Made PageUp/PageDown/Home/End navigation also scroll parent windows. bed11b35d Fix typos and use nullptr in backends. Amend 506f7e0 aec062a8a Merge branch 'master' into docking d81f2ae4f Backends: WebGPU: Use WGSL shaders instead of precompiled SPIR-V + add Gamma uniform. (#6188) e67f2f479 Backends: WebGPU: Align buffer sizes upon creation. (#6188) cbdac1e15 Backends: WebGPU: Reorganized to store data in io.BackendRendererUserData like other backends. 18d72a914 Inputs: added a unique event identifier in ImGuiInputEvent. 506f7e007 Using nullptr in locations where warning disable is not convenient. (#6313, #4537) 9203883bb Comments + Metal using SetTexID(0) for consistency. e92b29ad5 Backends: OSX: Added support for io.AddMouseSourceEvent(). (#6314) db4c4e332 Backends: Android: Added support for io.AddMouseSourceEvent(). (#6315, #6318, #2702, #4921) 1668693bc Backends: SDL2/SDL3: Fixed IME text input rectangle position with viewports. (#6071, #1953) ec461c6cc Merge branch 'master' into docking a7703fe6f Backends: SDL2/SDL3: Avoid callng SDL_StartTextInput()/SDL_StopTextInput(). (#6306, #6071, #1953) 8738ed88f Fixed FindWindowSettingsByID() being able to return a deleted setting. 63370be0e Viewports: fix/amend dcb6335 to (1) avoid refocusing when focus action was actionned from a click within imgui boundaries and (2) restore a null focus as well. (#6299) 1f0b46b93 Viewports: moved Platform_GetWindowFocus queries in UpdateViewportsNewFrame(). Added ImGuiViewportFlags_IsFocused status flag. (#1542) ed72fcd12 Viewports: Internal: rename LastFrontMostStampCount -> LastFocusedStampCount. Rename ImGuiViewportFlags_Minimized -> ImGuiViewportFlags_IsMinimized dcb6335bf Viewports: Setting focus from Platform/OS sets corresponding focus at Dear ImGui level. (#6299) 47a07d847 ButtonBehavior: Fixed an edge case where changing widget type/behavior while active and using same id could lead to an assert. (#6304) ee5ce3674 Merge branch 'master' into docking, including specific merge for imgui_impl_glfw.cpp for f070497 c9fe7ebc7 IO: Input queue trickling adjustment for touch screens. (#2702, #4921) f070497cb Backends: Win32/SDL2/SDL3/GLFW: Added support for io.AddMouseSourceEvent(). (#2334, #2702) a16f99c6a IO: Added io.AddMouseSourceEvent() and ImGuiMouseSource enum. (#2702, #2334, #2372, #3453, #5693) 9a1e09eb1 Fixed ImVec2 operator[] warning.in Clang. (#6272) 13931fd85 Redirecting domain name e8206db82 InputText: Fixed crash introduced by 5a2b1e848 (#6292, #4714) 4fdafef54 Merge branch 'master' into docking 5f301914a TabBar: Tab-bars with ImGuiTabBarFlags_FittingPolicyScroll can be scrolled with horizontal mouse-wheel (or Shift + WheelY). (#2702) 84fd0c7ff Inputs, IO: record MouseWheelRequestAxisSwap information. Apply in UpdateMouseWheel() before legacy ctrl+wheel. a38e3c222 Fixed ImVec2 operator[] violating aliasing rules causing issue with Intel C++ compiler. (#6272) f65bcf481 Docs: added details and link to wiki from imgui_stdlib to increase discoverability. 8a6911b89 Backends: Fixes zealous warnings (#5760) 7dcf129b3 Backends: OpenGL3: Properly restoring "no shader program bound". (#6267, #6220, #6224) 821814b45 InputText: Reworked prev/next-word behavior . Include period as delimiter and tweak prev/next words logic. (#6067) bf87fbcbc Docking: Fixed using GetItemXXX() or IsItemXXX() functions after a DockSpace(). (#6217) 89d09070e Nav: Made Ctrl+Tab/Ctrl+Shift+Tab windowing register ownership to held modifier. (#4828, #3255, #5641) c98bad042 ColorEdit, RadioButton, Windows: Using adaptative tesselation for preview circles. 9ac94ff00 ColorPicker: Fixed shading of S/V triangle in Hue Wheel mode. (#6254, #5200) ad44f5831 Merge branch 'master' into docking d885094be Demo: stop relying on internal function. e55a0ef10 IO: avoid changing context in AddKeyAnalogEvent(). Amend 7269498. (#6199, #6256, #4921, #5856) 7269498ec IO: actually fixed adding events from inactive context (#6199, #6256, #4921, #5856) 5320a6ebd Backends: Made SDL3 backend compatible with commit 698dbd8. (#6255, #6146) cac76b275 Slider, Drags: skip %+ and %# format flags for scanning. (#6259) 5a2b1e848 InputText: Fixed a tricky edge case, ensuring value is always written back on the frame where IsItemDeactivated() returns true (#4714) 314e6443c Internals: removed ImGuiInputSource_Nav enum, 5d4a8978b Docs: added all older versions to Changelog. c501c2d4c Internals: inverted a block in InputScalar() to facilitate reading/stepping in common case. 6b3435a2d Merge branch 'master' into docking 91577c7f5 Backends: GLFW: Fixed key modifiers handling on secondary viewports. (#6248, #6034) 301c95603 Examples: Windows: Added 'misc/debuggers/imgui.natstepfilter' file to all Visual Studio projects. (#3038) 8b6e021f3 Demo: Fixed typos. (#6247) ae4dad09b Examples: SDL3: Updated for latest WIP SDL3 branch. (#6243) 85beda96d Backends: GLFW: Fix Emscripten erroneously enabling multi-viewport support, leading to assert. (#5683) 0d606968d Backend: OpenGL3: Amend b0c18166 fix cases where glGetString(GL_VERSION) returns NULL. (#6154, #4445, #3530) 24a44b9ab Version 1.89.5 WIP 9e30fb0ec Merge branch 'master' into docking f3f6295d5 Version 1.89.4 e39c2552a Backends: GLFW: Avoid using glfwGetError() and glfwGetGamepadState() on Emscripten. (#6240) cc2177de1 Debug Tools: Added io.ConfigDebugBeginReturnValueOnce / io.ConfigDebugBeginReturnValueLoop options. 552969e33 BeginTooltip: correctly testing return value of BeginTooltipEx() even though it always return true in current code. c426e3224 Tables: Fixed an issue where user's Y cursor movement within a hidden column would have side-effects. 6ca1556d0 Nav: Fixed SetItemDefaultFocus() from not scrolling when item is partially visible. (#2814, #2812) 9937660b1 Merge branch 'master' into docking bb224c8aa Examples: Updated all examples application to enable ImGuiConfigFlags_NavEnableKeyboard and ImGuiConfigFlags_NavEnableGamepad by default. 2bb9e35a4 Nav: Tabbing now cycles through all items when ImGuiConfigFlags_NavEnableKeyboard is set. (#3092, #5759, #787) e83fb468c Renamed PushAllowKeyboardFocus()/PopAllowKeyboardFocus() to PushTabStop()/PopTabStop(). (#3092) a322122f7 InputText: Fixed not being able to use CTRL+Tab while an InputText() using Tab for completion or textinput is active. 3b2f61765 BeginTooltip: Added 'bool' return value to BeginTooltip() for API consistency. Updated demo. e2cede654 Merge branch 'master' into docking b5f938103 Made internal clipboard/IME handlers not rely on implicit GImGui context (#5856) c8ad25caa Make classes not depend on the implicit GImGui context (#5856, #6199): ImGuiWindow, ImGuiInputTextCallbackData, ImGuiListClipper, ImGuiStackSizes 10ace228b Make classes not depend on the implicit GImGui context (#6199, #5856, #6199): ImGuiIO 5a1e6b60a Nav: Fixed an issue with Gamepad navigation when the movement lead to a scroll and frame time > repeat rate. (#6171) c9a53aa74 Nav: Made Enter key submit the same type of Activation event as Space key. (#5606) b4b79584d Internals: added GetStyleVarInfo(). exposed previously .cpp only ImGuiStyleVarInfo as ImGuiDataVarInfo. 57d0fcd02 Examples: Fix Android example build for Gradle 8. (#6229) b6586bb06 TestEngine: update IMGUI_TEST_ENGINE_ITEM_ADD() hooks to support passing item in flags. 1c29a8ed1 Debug Log: auto-disable ImGuiDebugLogFlags_EventClipper to reduce spam. f5c5a710a Docking: exposed DockNodeWindowMenuHandler_Default() in imgui_internal.h to facilitate reuse. 4078abe14 Merge branch 'master' into docking 702626dd8 Docking: storing window menu handler in a function pointer to allow customizing menu (undocumented) 66b762577 Backends: OpenGL3: Fixed restoration of a potentially deleted OpenGL program. (#6220, #6224) bfce7750b Simpified code in GetKeyData() and used ImGuiKey_KeysData_OFFSET for consistency. Rework demo, Comments. Moved ImGuiKey_KeysData_OFFSET to internal.h (#4921, #6191) 2496b973f Backends: SDL2,SDL3: Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. (#6189, #6114, #3644) e9743d85d Drag and Drop: Clear state on EndDragDropTarget() with delivery + fixed handling of overlapping targets when smaller one is submitted before and can accept the same data type. (#6183, #5817) 2ee77aa6b Missing closing parenthesis in debug popup log (#6177) 696a53353 TestEngine: added ImGuiItemStatusFlags_Inputable flag report to facilitate fuzzing. 752603bc7 Fixed imgui_single_file.h for IMGUI_DEFINE_MATH_OPERATORS change. (#6164, #6137, #5966, #2832) a1b8457cb Moved the optional "courtesy maths operators" (#define IMGUI_DEFINE_MATH_OPERATORS) implementation from imgui_internal.h in imgui.h. (#6164, #6137, #5966, #2832) e25e4526c Merge branch 'master' into docking 5d7489128 Backends: Win32: Use WM_NCMOUSEMOVE / WM_NCMOUSELEAVE to track mouse positions over non-client area (OS decorations) when app is not focused. (#6045, #6162) 4f630b044 imgui_freetype: fixed non-ASCII characters in sources. (#6166) 204cb4d22 Version 1.89.4 WIP 192196711 Merge branch 'master' into docking 458a10903 Version 1.89.3 b0c181666 Backends: OpenGL3: Fixed loader compatibility with GL_VERSION for GL 2.x (#6154, #4445, #3530) fa0852f9e ColorEdit, ColorPicker: Fixed hue/saturation preservation logic from interfering with the displayed value (but not stored value) of others widgets instances. (#6155) 092b6825a Fonts: Assert that in each GlyphRanges[] pairs first is <= second. 345184330 Internals: Settings: amend ClearWindowSettings() for Docking. ea4565368 Merge branch 'master' into docking f0ac68ad3 Internal: Settings: amend 0b86513 revert to use FindWindowSettingsByID(). 082b20e46 Internals: Settings: added ClearWindowSettings(). Extract part of CreateNewWindow() into InitOrLoadWindowSettings(). b2ebd03b1 Internals: Settings: moved Windows setting to their sub-section. 0b865136e Internals: Settings: Added FindWindowSettingsByName() (replacing old version by ID) FindWindowSettingsByWindow() + remove unnecessary FindOrCreateWindowSettings(). 0d7d877cb Backends: SDL3: Update for latest. 99c0bd65d Added SeparatorText() widget. (#1643) 85395b76b CI: Update versions. fac19e188 Backends: SDL2:+SDL3 Implement SetPlatformImeDataFn (amends). (#6071, #1953) + fix SDL3 setting PlatformHandleRaw. (#6146) 734c6af18 Backends: SDL2: Implement SetPlatformImeDataFn. (#6071, #1953) 95412ad3a Backends: SDL3: Removed unnecessary #ifdef. a526ff8c3 Backends: SDL3: Added multi-viewports support. (#6146) e4233c6fb Merge branch 'master' into docking (doesn't include viewports-related changes for new SDL3 backend) 13fbd9949 Backends: SDL3: update to run with SDL3. Examples: Add SDL3+Gl example. Remove some version checks. (#6146) d9bf80f65 Backends: SDL3: copied imgui_impl_sdl2 into imgui_impl_sdl3 and ONLY replaced strings (1/2). (#6146) e816bc672 Merge misc changes from docking branch to reduce small drift. 1b27ac982 Backends+Examples: SDL2: renamed imgui_impl_sdl.cpp/.h to imgui_impl_sdl2.cpp/.h. (#6146) c807192ab Tables: amend f799a29 with a better solution + fix potential overflow (#6140) d6ea56dfd Tables: amend f799a29 with a better solution + fix potential overflow (#6140) ea39841fc Examples: (Again, but better) made SDL+GL and GLFW+GL examples build with Emscripten. (#2492, #2494, #3699, #3705) b0a936e5d Merge branch 'master' into docking (incl revert of examples refactor) 97a1f761c Examples: (Again, but better) made SDL+GL and GLFW+GL examples build with Emscripten. (#2492, #2494, #3699, #3705) f43c6ea6a Revert most of "Examples: refactor all examples with a MainLoopStep() function..." (#2492, #3699)" f799a293c Tables: Solved an ID conflict issue with multiple-instances of a same table. Storing instance id for convenience. (#6140) c75410e72 Debug: fix display order of InputText's data CurLenA/CurLenW (#6143) a08558105 Backends: GLFW: added ImGui_ImplGlfw_SetCallbacksChainForAllWindows(). (#6142) 265b88273 Backends: Fixed pragma warning with old GCC. d0b1aaa07 Backends: GLFW: Registering custom low-level mouse wheel handler to get more accurate scrolling impulses on Emscripten. (#4019, #6096) 6584de4a7 Backends: SDL: Avoid calling SDL_SetCursor() when cursor has not changed. (#6113) 5ebb6a295 Merge branch 'master' into docking 46efed8b7 CI: Fix Emscripten build. 1f1861dae Backends: Added support for SDL 2.0.18+ preciseX/preciseY mouse wheel data for smooth scrolling + scaling for Emscripten. (#4019, #6096) 5386ddcd0 Merge branch 'master' into docking 624c057ae Backends: GLFW: revert flipping mouse-wheel axis for Emscripten. (#4019) ce6e6da51 Examples: Made example_sdl_opengl3 and example_glfw_opengl3 build with Emscripten. Removed dedicated examples. (#2492, #2494, #3699, #3705) 96ab68eee Examples: refactor all examples with a MainLoopStep() function, to facilitate use with Emscripten. (#2492, #3699) b51919dce Examples: Emscripten+GLFW: revert to use a shell_minimal.html closer to vanilla one, as our fullscreen + misc tweaks to Emscripten+SDL example to match other version. 0370856d7 Backends: GLFW: Removed mouse-wheel value scaling for Emscripten. (#4019, #6096, #6081) f822e07d7 Backends: SDL: Removed SDL_MOUSEWHEEL value clamping. (#4019, #6096, #6081) 887abe957 Merge branch 'master' into docking 3617a9637 Backends, Inputs: Made horizontal scroll wheel and horizontal scroll direction consistent accross backends/os. (#4019, #6096, #1463) 8d29665ae Backends: OSX: Fixed scroll wheel scaling for devices emitting events with hasPreciseScrollingDeltas==false (e.g. non-Apple mices). 2efebe331 ShowFontAtlas, Demo: optionally use style text color for tint. (#6129) 5a3f82e2f Examples: SDL+SDL_Renderer: Added call to SDL_RenderSetScale() to display is correct on a Retina display (albeit lower-res as our other unmodified examples). (#6121, #6065, #5931). 867bdbecb Text: fixed issue in RenderText() leading to IM_ASSERT_PARANOID() triggering if enabled. (#6132, #5720, #5919) d71977646 Internals: added 'ImGuiButtonFlags flags' to ImageButtonEx(). (#6126) f14288708 Combo: Allow SetNextWindowSize() to alter combo popup size. (#6130) 259560aa2 Demo: moved sections around in prevision for adding nicer separators. 27f2dd56d Internals: move "%s" skip-formatting logic to ImFormatStringToTempBuffer() function, meaning Text() and all the *V() functions can also benefit from it. (#3466) d73e3285d Backends: WebGU: Revert the implicit render pipeline layout generation as introduced in 83bdfef (#6117, #4116, #3632) fc5053221 InputText: On OSX, inhibit usage of Alt key to toggle menu when active (used for work skip). 5741cbae4 Internals: ImFileOpen: fixed misleading use of ImWchar (would allocate more when ImWchar=ImWchar32) + update version for previous changes namely tab bar ones. f4ef420c0 InputText: Added support for Ctrl+Delete to delete up to end of word. (#6067) 07490618a Misc: Tolerate zero delta-time under Emscripten. (#6114, #3644) fe0a24f38 Examples: Win32: Fixed examples using RegisterClassW() since 1.89 to also call DefWindowProcW(). (#5725, #5961, #5975) 3d8885cbb TabBar: Internals: add GetCurrentTabBar(), TabBarFindTabByOrder(), TabBarGetCurrentTab(), TabBarGetTabOrder(), TabBarGetTabName(), TabBarQueueFocus() + clear LastTabItemIdx on EndTabBar(). (#5853, #5997) 739a79b1e ImDrawList: Added missing early-out in AddPolyline() and AddConvexPolyFilled() when color alpha is zero. Window: Avoid rendering shapes for hidden resize grips. f6db9e2f3 Menus: Fixed layout of MenuItem()/BeginMenu() when label contains a '\n'. (#6116) e8421de23 imgui_single_file: include imgui_freetype.cpp if the define is set. 8f907bc9a imgui_freetype: fix warnings (#6104), fix typos. (#6079) 88dfd85e9 Merge branch 'master' into docking 91667430a Tables: increase table columns limit from 64 to 512 using bit array allocated in contiguous memory +. (#6094, #5305, #4876, #3572) 14908cba8 Internals: ImBitArray, ImBitVector: using macro helper for common op + disable stack checks on MSVC agressive debug builds. db5542287 Tables: removed hot RequestOutputMaskByIndex bit-array as majority of code-paths are already touching the cold parts. 6342275bb Backends: GLFW: Handle unsupported glfwGetVideoMode() for Emscripten. (#6096) 3482d4ecc Text: Fixed layouting of wrapped-text block skipping successive empty lines. (#5720, #5919) 0359f6e94 Internals: ImDrawList: shallow tweaks to RenderText(). 51c97a41a PlotHistogram, PlotLines: Passing negative sizes honor alignment like other widgets. 82fdd7018 Update FAQ.md ccf94e2e6 Strip seemingly unecessary tests, as UTF-8 decoder can not return null since 9cca1b2e9 55b8ce9b2 Reword ImTextCharFromUtf8() to avoid a warning + marked UTF-8 functions with IM_MSVC_RUNTIME_CHECKS_OFF. (#5987) 1297a2be5 Text: Tweaked rendering of three-dots "..." ellipsis variant. Baking more data. (#2775, #4269) 8801f0294 Text: Fix clipping of single-character "..." ellipsis when font is scaled. (#2775 482ac70a0 Version 1.89.3 WIP 46b9c09e4 Update .gitignore a218d3a82 Update information in ImFontAtlas::GetGlyphRangesJapanese (#6066) d822c6531 Merge branch 'master' into docking d7c8516a4 Version 1.89.2 e06bbe05e Revert most/part of "Shortcut: added Shortcut() function and ImGuiInputFlags in public API + Demo." (#456, #2637) 83429abf4 Internals: simplify ButtonBehavior(), also to allow easily adding a mouse_button_down thing. 03add24ac Selectable: Internals: removed unused ImGuiSelectableFlags_DrawHoveredWhenHeld flag. 57a5b73a4 InputText: fixed cursor navigation when pressing Up Arrow on the last character of a multiline buffer which doesn't end with a carriage return. (#6000) 1f6e62a4a Backends: GLFW: Fixed mods state on Linux with Alt-GR text input (e.g. German keyboard layout), (#6034) 9150c23c0 imgui_freetype: fixed a packing issue which in some occurrences would prevent large amount of glyphs from being packed correctly. (#5788, #5829) 9c1dac3ff Examples: DirectX10, DirectX11: try WARP software driver if hardware driver is not available. (#5924, #5562) fc3815bfe Merge branch 'master' into docking 4b39c1f65 Docs: adding Tests badge + more references to Test Engine. 824baa6a4 Docking: fixed DockSpace() with ImGuiDockNodeFlags_KeepAliveOnly marking current window as written to,. (#6037) 42e166089 Backends: Metal: fixed secondary viewport rendering. (#6015, #4821, #2778) 156e0a807 Demo: amend Selectable() + BeginPopupContextItem() demo to maintain and update selection state when popup is open. (#6032) 693967637 Docking: fixed DockBuilderCopyDockSpace() crashing when windows not in the remapping list are docked on the left or top side of a split. (#6035) e5d51866c Backends; Vulkan: do not set VkDescriptorSetLayoutBinding::pImmutableSamplers, allow changing sampler. (#6001, #5502, #914) c9aef1606 Backends: Vulkan: Remove duplicated and dead code in Vulkan backend (#6001) 328695bd4 Provide a non-empty definition for IMGUI_DEBUG_PRINTF when disabled. (#5978) 16aaf6069 Backends: OSX: fixed ImGui_ImplOSX_GetWindowSize and ConvertNSRect. (#6009) 90de83944 Backends: SDL: fix build on WinRT (#6019, #5974) - version for docking branch da832532c Backends: SDL: fix build on WinRT (#6019, #5974) 52c61deaf Happy new year! e57871bb9 imstb_truetype: Add missing `return` keyword in error case of `stbtt__cid_get_glyph_subrs` (#6007) f1ddf6302 ScrollToRectEx: Fix bug where scrolling horizontally to an always-centered element that is not visible but could be would take the item's Y coordinate into account. 91b356cf8 Examples: Allegro: Fixed compilation instructions. (#5973) c191faf0b Merge branch 'master' into docking 59b63defe Misc shallow merge/sync from docking designed to faciliate cross-merging between docking and string_view. 317b33d64 Tables: fixed matching width of synchronized tables when only some (not all) instances have a vertical scrollbar. (#5920) 0949acb6e Shortcut: added Shortcut() function and ImGuiInputFlags in public API + Demo. (#456, #2637) 1dae7df26 Misc: added GetItemID() in public API. 48215231f Demo: moved WantCapture overrides items + various comments related to ImGuiKey, ImGuiMod d3025cde3 Merge branch 'master' into docking 9d08506dc Tables, Nav: frozen columns are not part of menu layer and can be crossed over. (#5143, #3692) fd0b3734d Tables, Nav, Scrolling: fixed scrolling functions and focus tracking with frozen rows and columns. (#5143, #4868, #3692) 16cee3d00 Internals: tidying up and standardizing outer decoration size storage. (toward #5143, #4868, #3692, #3518) 820b1e651 Internals: reduced duplicate code in CalcNextScrollFromScrollTargetAndClamp() by looping through axiees. 24b873a74 Internals: renaming inside ScrollToRectEx() + fixed misplaced changelog entry. 5eda547e6 Merge branch 'master' into docking ed54e14f1 Refactor: moved UpdateAliasKey(), GetMergedModsFromKeys(), UpdateKeyboardInputs(), UpdateMouseInputs() to INPUTS section. f83da768b Refactor: moved LockWheelingWindow(), FindBestWheelingWindow(), UpdateMouseWheel() to INPUTS section f9ab2a0e9 Refactor: moved UpdateKeyRoutingTable() to INPUTS section. renamed GetKeyVector2d() -> GetKeyMagnitude2d() 38a0d7ceb Refactor: added INPUTS section index, moved IsMouseHoveringRect() to INPUTS section. b5883c1cf Refactor: moved bits into Initialization section. 713e034d9 Backends: OpenGL3: Fix for zealous warning. (#5947) 3ea0fad20 Merge branch 'master' into docking 844e0ae68 Fixes/amend 9825f7f + amend Changelog (#4857, #5937) 0e2a167bd Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by applications using multiple font atlases. 9825f7fa8 Fixed cases where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with zero triangles. (#4857, #5937) 66ad2ad53 Properly detect SSE instruction support in 32-bit MSVC build. (#5943) a5e96ff99 Make ImGuiInputTextState not depend on the implicit GImGui context. (#5856) 45736443b Debug Tools: Metrics: added "Inputs" section, moved from Demo for consistency. 87caf27ac Inputs, Scrolling: better selection of scrolling window when hovering nested windows and backend/OS is emitting dual-axis wheeling inputs. (#3795, #4559) a5f3596e6 Backends: Allegro5: use al_draw_indexed_prim() or al_draw_prim() depending on version. (#5937) 50aeeff96 Backends: Allegro5: Brough back al_draw_indexed_prim when available. (#5937) bf4c2e00c Docs: retroactively update 1.89 changelog/docs to clarify that strong typing ImGuiKey was technically a breaking change for users of legacy indices. (#4921) cc3a2200a Internals: invert logic of mods key<>bool translation to facilitate other experiments and put emphasis on new API. (#5923, #4921) 1a497c249 Inputs, IO: reworked ImGuiMod_Shortcut to redirect to Ctrl/Super at runtime instead of compile-time. (#5923, #456) 969af7c77 Internal: Disable debug logs macro if IMGUI_DISABLE_DEBUG_TOOLS is defined. (#5901) bd96f6eac Text: Fixed layouting of wrapped-text block when the last source line is above the clipping region. Regression added in 1.89. (#5720, #5919) 540909bdd Fixed version string for consistency (#5918) 6af38b1a4 Fixed version string for consistency (#5918) fad8afd62 Docking: amend to allow localizing docking specific user facing string. (#5895) 595a428ba Merge branch 'master' into docking a8df192df Version 1.89.1 27c58c394 Scrolling, Focus, Combo: fixed SetKeyboardFocusHere()/SetItemDefaultFocus()/ScrollToRectEx() during an appearing form not centering item. (#5902, #2812, #4242, #2900) d2f9c5dfb Viewports: moving PlatformWindowCreated field to public structure. (#5882) 233d7ad3f Backends: WebGPU: fixed validation error with default depth buffer settings. (#5869, #5914) 856c6314e Drag and Drop: fixed GetDragDropPayload() returning a non-NULL value before payload is submitted. (#5910, #143) ffe0abbfc Internals: added basic localization system (#5895) c3d9f8ee7 Layout: fixed End()/EndChild() incorrectly asserting if users manipulates cursor position inside a collapsed/culled window and IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. (#5548, #5911) 3a685749c ColorEdit: fixed label overlapping when using style.ColorButtonPosition == ImGuiDir_Left. (#5912) 16476f99f Backends: GLFW: cancel out errors emitted by glfwGetKeyName() when a name is missing. (#5908) 9964740a4 Viewport: Fixed collapsed windows setting ImGuiViewportFlags_NoRendererClear without making title bar color opaque. 38cfe22b8 Merge branch 'master' into docking 5bb287494 Version 1.89.1 WIP 7bee9a8f9 Inputs: fixed moving a window or drag and dropping from preventing input-owner-unaware code from accessing keys. (#5888, #4921, #456) d60985df7 Inputs: fix moving a window or drag and dropping from capture mods. (#5888, #4921, #456) 83cee9e09 InputText: replaced some uses of SetKeyOwner() + IsKeyPressed() with Shortcut() 94e850fd6 Merge branch 'master' into docking 81160fee5 Version 1.89 a582d92c3 Inputs: modulate wheel lock timer for small amount of wheeling. Slightly lower timer. (#3795) 03d3343e2 Docs: Update FAQ.md explaining how to enable hidpi for Windows app. (#5880) 00b637084 Backends: WebGPU: fixed rendering when a depth buffer is enabled. (#5869) d7aca168e Backends: SDL: Fixed drag'n drop crossing a viewport border losing mouse coordinates. (#5710, #5012) 7380b9816 Scrolling: Exposed SetNextWindowScroll() in public API. (#1526) cda26635c Inputs: refacotr/extract CalcRoutingScore() out of SetShortcutRouting(), easier to follow with early returns. a571933f8 Merge branch 'master' into docking b8b0f9d02 Backends: OpenGL3: Reverted use of glBufferSubData(). (#4468, #4504, #3381, #2981, #4825, #4832, #5127) f0ad81055 Inputs: tweak comments, typos. 4d5da74c7 Merge branch 'master' into docking 637ddfce0 Inputs, Nav: made it possible to remap CTRL+Tab (#4828, #3255, #5641) 6c9c4879d Inputs: made Shortcut() routing id defaults to current FocusScope ID. (#456, #2637, #3724) d576724bf Inputs: made ImGuiInputFlags_RouteFocused the default for Shortcut(). (#456, #2637, #3724) 4d6a9ef93 Inputs: added routing priorities. (#456, #2637, #3724) 7ff2d3353 Inputs: added wip/experiment routing system: Shortcut(), RoutingFocused policy, SetShortcutRouting(). (#456, #2637, #3724) c59ebb2d7 Inputs: added basic Shortcut() function - no routing yet. (#456) 8c95c084c Inputs: changed specs of SetKeyOwner() to alter OwnerCurr immediately. 4448d975d Inputs: added wip/internal Input Owner system. (#456, #2637, #2620, #2891, #3370, #4828, #5108, #5242, #5641) 5728f2e15 Fix build with IMGUI_DISABLE_DEBUG_TOOLS 44d98bfd6 Fix build with IMGUI_DISABLE_DEBUG_TOOLS 849c8052b Merge branch 'master' into docking 529cba19b Debug Tools: Added DebugLocateItem()/DebugLocateItemOnHover() to visually locate items when hovering a 0xXXXXXXXX value. (#5855, #2673, #4631) 7109f32f9 Internals: tidying up and stripping more of focus scope code. 9f66a3a9e Internals: rework FocusScope system, current scope doesn't need to be in window + child doesn't inherit. 1eac0024c InputText: copy and select all shortcuts don't need repeat (tho it was harmless0 90e9465fa Window: Fixed position not being clamped while auto-resizing (#5843) 6e9dfe1de Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843) 86f2af2bc Backends: OSX: Fixed mouse coordinate before clicking on the host window. (#5842) ced92d9c5 Inputs, Viewports: fix UpdateViewportsNewFrame() running before UpdateInputEvents(), leading to MouseViewport lagging by a frame on transitions. (#5837, #4921) c2694ef75 Examples: Android: Using LoadIniSettingsFromMemory() / SaveIniSettingsToMemory() to save in appropriate location for Android. (#5836) 22bcfca70 IO: Clear AppFocusLost in EndFrame() in order to allow backend or application code to poll and react to it a241dc799 IO: Fixed AddFocusEvent(false) to also clear MouseDown[] state. (#4921) a61bbdc23 Commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79. 9db6b1a0d Backends: Win32: minor tidying up. (#5819) baea25e65 Drag and Drop: extracted a RenderDragDropTargetRect() function (#1603) 375ae5dce Merge branch 'master' into docking (incl glfw use of GLFW_VERSION_COMBINED) 431fc6a7f Internals: using ItemAdd() consistently for internal items: windows & tables resize grips/borders, ScrollbarEx(). 178aee4b1 Debug Tools: Debug Log: add and use ImGuiTextLineIndex. 50c4234ac Docking: Further fixes for highlight of nested nodes. (#5702) 5370b46c4 Docking: Made spacing between dock nodes not a dropping gap. 578df14f2 CI: Remove left-over discord stuff. f6bd7c8e5 Debug Tools: Item Picker: remove IMGUI_DEBUG_TOOL_ITEM_PICKER_EX since it doesn't work on non-ItemHoverable() items anyway. (#2673) bc918404f Internals: using ImToUpper() since std one does too many things. 9a35bfea3 Internals: added temporary ImGuiItemStatusFlags_Visible (used internally - please do not use). de1593d5c Backends: DX12: Fixed stale comments. (#5798) e3fa56ae0 BeginMenu(): Menus: Fixed a one-frame issue where SetNextWindowXXX data are not consumed by a BeginMenu(). 5ac94ad89 Window: Fixed an issue where uncollapsed a window would show a scrollbar for a frame. ab6e48b83 Backends: GLFW: Perform a dummy glfwGetError() read to cancel missing mouse cursors errors. (#5785) f87e891f1 Merge branch 'master' into docking 08752b372 Menus, Popups: Experimental fix for issue where clicking on an open BeginMenu() item called from a window which is neither a popup neither a menu used to incorrectly close and reopen the menu. (#5775) 81176737f Menus: Fixed using IsItemHovered()/IsItemClicked() on BeginMenu(). (#5775) 3920b1c76 Removed commented out old flags from when Tables was a branch. b15347cb7 Tables: activating an ID (e.g. clicking button inside) column doesn't prevent columns output flags from having ImGuiTableColumnFlags_IsHovered set. (#2957) 3e8d19813 Removed runtime patching of obsolete/invalid "%f"/"%.0f" types of format strings for DragInt()/SliderInt(). 5196bd15e Docs: Update outdated code sample (#5766) edf522b58 Merge branch 'master' into docking + amends change to nullptr (#5760) c54230d14 Backends: Using nullptr instead of NULL. (#5760, #4537) + fix additional warnings. 8a44c31c9 Scrolling: Further reduce unrelease mouse-wheel locked window timer + misc refactor (#2604, #3795, #4559) dfa1bb0ac Backends: OSX: Fixed mouse inputs on flipped views. (#5756) cb04326b4 Fixed ImGuiWindowFlags_UnsavedDocument clipping label in docked windows with no close button. [changes for docking] (#5745) 85a368b58 Fixed ImGuiWindowFlags_UnsavedDocument clipping label in docked windows with no close button. (#5745) c7d3d22ae Scrolling: Mitigated issue where multi-axis mouse-wheel inputs (usually from touch pad events) are incorrectly locking scrolling in a parent window. (#4559, #3795, #2604) 80a870a3e Scrolling: Tweak mouse-wheel locked window timer so it is shorter but also gets reset whenever scrolling again (#2604) + small refactor 282b2b5af Backends: Vulkan: Fix building with VK_NO_PROTOTYPES. (#914, #5738). a588f00f7 Backends: Vulkan: Added experimental ImGui_ImplVulkan_RemoveTexture() for api symetry. (#914, #5738). fb0b9c716 Docking: Fixed missing highlight when using dock node host window borders. (#5702) 588421986 imgui_freetype: Assert if bitmap size exceed chunk size to avoid buffer overflow. (#5731) f2a522d70 ImDrawList: Not using alloca() anymore, lift single polygon size limits. (#5704, #1811) 69beaa1d0 Viewports: Fix AddMouseViewportEvent() to honor AppAcceptingEvents, filter duplicate, add to debug log. d91211f9f Merge branch 'master' into docking cc5058e5d IO: Filter duplicate input events during the AddXXX() calls. (#5599, #4921) fac8295d6 IO: remove ImGuiInputEvent::IgnoredAsSame (revert part of 839c3100), will filter earlier in next commit. (#5599) 9e7f460c0 Fixed GetKeyName() for ImGuiMod_XXX values, made invalid MousePos display in log nicer. (#4921, #456) 074945335 Menus, Nav: Fixed not being able to close a menu with Left arrow when parent is not a popup. (#5730) 9f6aae3bf Nav: Fixed race condition pressing Esc during popup opening frame causing crash. bd2355a04 Menus, Nav: Fixed using left/right navigation when appending to an existing menu (multiple BeginMenu() call with same names). (#1207) 3532ed162 Menus, Nav: Fixed keyboard/gamepad navigation occasionally erroneously landing on menu-item in parent when the parent is not a popup. (#5730) d5d705069 Various comments e74a50f52 Added GetGlyphRangesGreek() helper for Greek & Coptic glyph range. (#5676, #5727) d17627b9c InputText: leave state->Flags uncleared for the purpose of backends emitting an on-screen keyboard for passwords. (#5724) 0a7054c7e Backends: Win32: Convert WM_CHAR values with MultiByteToWideChar() when window class was registered as MBCS (not Unicode). (#5725, #1807, #471, #2815, #1060) a229a7f39 Examples: Win32: Always use RegisterClassW() to ensure windows are Unicode. (#5725) e0330c169 Fonts, Text: Fixed wrapped-text not doing a fast-forward on lines above the clipping region. (#5720) 4d4889bf1 Refactor CalcWordWrapPositionA() to take on the responsability of minimum character display. Add CalcWordWrapNextLineStartA(), simplify caller code. 5c4426c5b Demo: Fixed Log & Console from losing scrolling position with Auto-Scroll when child is clipped. (#5721) 12c024689 Removed support for 1.42-era IMGUI_DISABLE_INCLUDE_IMCONFIG_H / IMGUI_INCLUDE_IMCONFIG_H. (#255) 73efcec56 Examples: disable GL related warnings on Mac + amend to ignore list. a725db17b Comments for flags discoverability + add to debug log (#3795, #4559) 11f5be0ca Backends: OpenGL: Add ability to #define IMGUI_IMPL_OPENGL_DEBUG. (#4468, #4825, #4832, #5127, #5655, #5709) 325299f94 Backends: OpenGL: Add ability to #define IMGUI_IMPL_OPENGL_DEBUG. (#4468, #4825, #4832, #5127, #5655, #5709) 56c3eaed2 ImDrawList: asserting on incorrect value for CurveTessellationTol (#5713) 04316bd22 ColorEdit3: fixed id collision leading to an assertion. (#5707) 8f434874c Docking: Fixed incorrect focus highlight on docking node when focusing a menu. (#5702) 6fd2ee941 Merge branch 'master' into docking c261dac02 Demo: moved ShowUserGuide() lower in the file, to make main demo entry point more visible + fix using IMGUI_DEBUG_LOG() macros in if/else. 51bbc7065 Backends: SDL: Disable SDL 2.0.22 new "auto capture" which prevents drag and drop across windows, and don't capture mouse when drag and dropping. (#5710) 7a9045dd7 Backends: WGPU: removed Emscripten version check (currently failing on CI, ensure why, and tbh its redundant/unnecessary with changes of wgpu api nowadays) 1dc7d0e63 Merge branch 'master' into docking 83a0030c0 Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456) fd408c979 Renamed and merged keyboard modifiers key enums and flags into a same set:. ImGuiKey_ModXXX -> ImGuiMod_XXX and ImGuiModFlags_XXX -> ImGuiMod_XXX. (#4921, #456) f359dca0d Misc input related changes to facilitate upcoming merges. 85f327d8d InputText: added ImGuiInputTextFlags_EscapeClearsAll (#5688) 60ab8a94a InputText: fixed minor one-frame selection glitch when reverting with Escape + disable cursor rendering on revert frame. (#3008) 4b522e145 Experiment: ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. (#4921, #4537) 5c8041b4d Update gif in README + font names in examples 2736af6b6 Minor optimization of ImFontAtlasBuildMultiplyRectAlpha8() + README tweaks. efe4a3722 Fix typo (#5691) 3af9ac320 Merge branch 'master' into docking 1dd964f87 Popups & Modals: Fix (amended) somehow undocumented Popup+Child behavior (useful for e.g. #718, #4461 and probably other things) 440f25768 Popups & Modals: fixed nested Begin() being erroneously input-inhibited. (useful for e.g. #718, #4461 and probably other things) 472f8013b Moved version number higher up in imgui.h to increase visibility 2b1d8e3ea Fix more typos in sources and docs (#5681) 44e3ba115 Demo: moved "Mouse Cursors" section. moved "Filtering" section. 673df6191 More compact README 1816c5241 Examples: updated VS projects with .natvis file under imgui/ e8178bf8a Update README.md a0e1591ac Fix more typos (#5679) 6c3c9cea7 Fix typos in source comments (#5675) 091445a4a Examples: added all SDL examples to VS solution. 513c1ba99 Removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)' (#1057) 64b88da21 Merge branch 'master' into docking cb48c81a4 Tabs: Fix initial tab state. Amend 3e6f948( (#5572) 52d9ee0dc Tabs: Fixed ShrinkWidths() redistribution of remainder leading to infinite bug (second fix). (#5652, #5262) caf4b7f1e Backends: SDL: Fixed building backend under non-OSX Apple targets (e.g. iPhone). (#5665) 3e6f94885 Tabs: Enforcing minimum size of 1.0f, fixed asserting on zero-tab widths. (#5572) b137f31b8 Tabs: Fixed ShrinkWidths() redistribution of remainder leading to infinite bug + over redistribution. (#5652) 2171375f9 InputText: clarified that callbacks cannot modify buffer when using the ReadOnly flag. 9e7c0f985 Fix typos in docs (#5649) b87e58fab ImGui::InputText: added support for shift+click style selection. (#5619) fe62927bd Backends: OpenGL: Update comments. (#4445, #5642, #4649) 9e1ccf8fa Commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): (#3361) aceab9a87 Obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries. (#5548) edcd5b113 Obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries. (#5548) bc2002ab9 Merge branch 'master' into docking 5867a43dc Backends: GLFW: Honor GLFW_CURSOR_DISABLED by not setting mouse position. (#5625) 9445776d6 Nav: Fixed an issue opening a menu with Right key from a non-menu window. 03fc9a0b1 Menus: Fixed gaps in closing logic. (#5614) b3ea01d86 Menus: Fix sub-menu inhibition stopping working in some cases. (Amend WIP) (#2517, #5614, noticed in #5546) a502ceb07 Added commented out older obsolete names (1.42 to 1.52) 2569c6474 Demo: Improved "Constrained-resizing window" example, more clearly showcase aspect-ratio. (#5627, #5618) 7f2514397 Better error reporting for PopStyleColor()/PopStyleVar() + easier to recover. (#1651) 747c9a7ad IsKeyPressed(), IsMouseClicked(), GetKeyPressedAmount(): add a (normally unnecessary) test for ->Down next to ->DownDuration tests, facilitating the use of key eating mechanism. e13913ed5 IsItemHovered: Added ImGuiHoveredFlags_DelayNormal, ImGuiHoveredFlags_DelayShort, ImGuiHoveredFlags_NoSharedDelay. (#1485) 71a070192 Nav: Fixed regression in e99c4fc preventing CTR+Tab to work without NavEnableKeyboard (#5504, #4023); b3b3a0713 Nav: Fixed regression in e99c4fc preventing CTR+Tab to work without NavEnableKeyboard (#5504, #4023); 2c1262b43 ImVector: fix undefined behaviour during copy operator if source vector is null. (#5608) db798fd5b Merge branch 'master' into docking 72096bf69 Clipper: simplify code and remove cases where true is returned with empty display range as an extra step. 07b9999de Debug Log: added 'Clipper' events logging. 4eb906699 Clipper: extract code into a ImGuiListClipper_StepInternal() to facilitate debugging. Moved clipper End() call to outer layer, stopped heretic use of comma operator. 21b5fac57 Backends: Metal: Update deprecated property 'sampleCount'->'rasterSampleCount' (#5603) b78738ff2 Internals: Docking: rename HoveredDockNode to DebugHoveredDockNode to clarify that it isn't usable for much other than debugging. d357e8504 TestEngine: revert part of 5b0510c as IMGUI_TEST_ENGINE_ITEM_ADD() woul see an erreneous hierarchy. 7f4b477d2 CI: Update ubuntu version (#5598) cdebd70e1 Fix PVS-Studio static analyzer warning for "buffer underflow" 5b0510c5b TestEngine: facilitate aiming at InputScalar() using wildcards + removed unnecessary IDStack.size hack (require TestEngine latest) ef6ba0d84 Misc: allowing override of IM_TABSIZE (#5593) 268565079 InputText: numerical fields automatically accept full-width characters (U+FF01..U+FF5E) by converting them to half-width (U+0021..U+007E). 8cbd391f0 Docking: Add source dock node parameter DockContextCalcDropPosForDocking() to facilitate test engine (un)docking nodes before they are split out to their own window. Metrics: Display dock_node->Windows in node metrics. a396233cb Platform IME: Windows: Revert 133bbafa and 29a8ee08 as regression until new results comes. (#2589, #5535, #5264, #4972) 839c31006 Debug Log: Added IO events logging. 133bbafa3 Platform IME: Windows: Fixed a call to ImmAssociateContextEx() leading to freeze on some setups. (#2589, #5535, #5264, #4972) ff1567e24 Docking: Simplify logic of moving tabs between nodes. Amends 0abe7d. (#5515) c911901b5 Fix ImGuiIO docs and default values (#5540) e9f50fb87 Merge branch 'master' into docking 0a4ddd724 Fix being unable to mouse wheel while dragging a payload (fix 1480bc5, #4921, #2891) 4a2ae06ca Changed signature of ImageButton() function: Added 'const char* str_id' parameter + removed 'int frame_padding = -1' parameter. (#5533, #4471, #2464, #1390). f573ebf31 Docking+Viewports: Fix undocking window node causing parent viewport to become unresponsive. (#5503) b12e056c2 Docking: Fixed amending into an existing tab bar from rendering invisible items. (#5515, amend b16f738d #2700, #2539) 0abe7d1cc Docking: Fixed splitting/docking into a node that has buttons amended into tab bar. Windows were not moved correctly. (#5515) e21f462f6 Merge branch 'master' into docking 28a123ca4 Internals: Docking: make DockContextFindNodeByID() more visible (instead of DockBuilderGetNode) 0e95cf0de Fix appending to windows causing a child window to be inserted to g.WindowsFocusOrder which eventually causes a crash. (#5515, #3496, #4797) e926a664d TabBar: Allow closing entire TabBar (possible docking only) when it contains user-appended buttons. (#5515) e99c4fc66 Nav: fixes keyboard/gamepad nav actions running without the corresponding config flags (#5504). Fixes 8b8a61b. #4921, #4858, #787, #1599, #323) 2d38bc99b Internals: renamed recently added ImGuiInputReadFlags to ImGuiInputFlags. (Amend 8b8a61b) cb8ead1f7 Docking: Fix docked window contents not rendering when switching with CTRL+Tab. 6ab5fd1da Tables,Columns: fixed a layout issue where SameLine() prior to a row change would set the next row in such state where subsequent SameLine() would move back to previous row. 77637fd93 Docking, Nav: Fixed using gamepad/keyboard navigation not being able enter menu layer (#5463, #4792) 8731cc291 Examples: Vulkan: Add c++ version to CMakeLists (#5459) 1480bc5d4 Added ImGuiKey_MouseXXX aliases. (#4921) Reworked SetItemUsingMouseWheel() to use this for ActiveId. (#2891) 105bb3ef8 Legacy: clear g.ActiveIdUsingNavInputMask when active id is clear + Internals: added helpers GetKeyChordName(), ImGuiModFlags_All. 21fc57f2c Merge branch 'master' into docking 8b8a61bdf Removed io.NavInputs[] and ImGuiNavInput enum. Kept inline redirection code. (#4921, #4858, #787, #1599, #323) a7a25ee19 Tools: Item Picker: Mouse button can be changed by holding Ctrl+Shift. (#2673) 92d0924b8 Fixed build with IMGUI_DISABLE_OBSOLETE_KEYIO + made all examples comments refer to StyleColorsLight(). 4711b9b05 Add trailing commas to enum (to simplify the diff/patch of further additions) (#4537) 90ef32788 Reordered keys representing directions to follow a consistent L/R/U/D order everywhere. (#2625, #4921, #3724) f9ccdba35 Nav: Fix regression 93f02ee + Internals: Remove ImGuiNavReadMode_Pressed, ImGuiNavReadMode_Released. 93f02ee0c Nav: Fixed moving window with gamepad or keyboard when running at very high framerate + removed ImGuiNavDirSourceFlags_RawKeyboard. 82e10f1b6 Backends: Metal: Add dispatch synchronization. (#5447) 0b2da6791 Internals: clarified that GetInputTextState(0) can not return a pointer. Replaced a use of __APPLE__ with io.ConfigMacOSXBehaviors. 467a1cd4a Misc: io.Framerate moving average now converge in 60 frames instead of 120. (#5236, #4138) ad5aa5416 Backends, Viewport: Metal: Pull format from shared context. (#5403, #5437) 5d0deebba Merge branch 'master' into docking 67410d53f Backends: Metal, OSX: Various fixes (ARC / Autorelease fixes with metal-cpp and extensions). (#5403) 609b935a8 InputText: added experimental io.ConfigInputTextEnterKeepActive feature to make pressing Enter keep the input active and select all text. 0afc6cd31 Internals: InputTextEx() renames for correctness. enter_pressed -> validated, is_validate_enter -> is_enter_pressed 58eb40db7 Backends: GLFW: Fixed leftover static variable preventing from changing or reinitializing backend while application is running. (#4616, #5434) 873e9d35a Internals: renamed TreeNodeBehaviorIsOpen() to TreeNodeUpdateNextOpen(). Added internal TreeNodeSetOpen(id). (#5423) 24dfe6db8 Version 1.89 WIP 088ddef98 Tables: extracted some code into TableBeginContextMenuPopup() for easier reuse for appending into context menu. 9cd9c2eff Merge branch 'master' into docking 9aae45eb4 Version 1.88 d51e5d289 TabItem: revert support for SetNextItemOpen(true) at it creates too much ambiguity with p_open/close button vs Selected state. (#5262) c4b910175 TabBar: Tweak shrinking policy so that while resizing tabs that don't need shrinking keep their initial width more precisely. 4b9729614 TabBar: TabItem() now reacts to SetNextItemWidth() and SetNextItemOpen(true). (#5262) d3fd2630b Sliders: An initial click within the knob/grab doesn't shift its position. (#1946, #5328) + Adjust default GrabMinSize. f27af1b20 Internals: SliderBehaviorT: Minor refactor, clearer 0.0/1.0 early out. Should be no-op from user's point of view. 90e8404a7 Update README.md 9764adc7b Docking: Amend 24dfebf. Fixed incorrect focus highlight on docking node with nested hierarchies. 37a07858a Nav: Fixed inability to cancel nav in modal popups. (#5400) 506717390 Docking, Modal: Fixed a crash when opening popup from a parent which is being docked on the same frame. (#5401) 101aec95d Backends: SDL+GLFW, Examples: SDL+Metal, GLFW+Metal: Fix viewport support with Metal backend. 07efd7cc2 Renamed IMGUI_DISABLE_METRICS_WINDOW to IMGUI_DISABLE_DEBUG_TOOLS. e135cdbc2 Merge branch 'master' into docking + update for IMGUI_DEBUG_LOG calls. 08572189f MovingWindow auto-cancelled if active id is stolen (instead of ill-defined bahavior + assert in docking). 27343efb0 Nav, Focus: Changed SetKeyboardFocusHere() to not behave if a drag or window moving is in progress + move KeepAliveID() call from Scrollbar() to ScrollbarEx() ddcff1034 Settings: Fixed some SetNextWindowPos/SetNextWindowSize API calls not marking settings as dirty. 6cac48df3 Drag, Slider: rework slightly or CTRL+Click or SetKeyboardFocusHere() will show 1 change of active id in the log (rather than a set,clear,set sequence) dd2850083 Debug: Add more log. Reworked IMGUI_DEBUG_PRINT IMGUI_DEBUG_PRINTF. Added internal IsDragDropActive() helper. 24dfebf45 Docking: Fixed incorrect focus highlight on docking node when focusing empty central node or a child window which was manually injected into a dockspace window. 2ed9e21eb Nav, Internals: wrap changes to g.NavWindow into a helper function to help track/log changes. 1d6e34f3f Debug: Added ShowDebugLogWindow(). ec2c805e4 Backends: support for unity builds for dx10/dx11/dx12 backends (#5387) e900ca355 Merge branch 'master' into docking 076d8fc86 Nav: Fixed issues with nav request being transferred to another window when calling SetKeyboardFocusHere() and simultaneous changing window focus. (#4449) 0b1bcfcc2 Menus: Separate menu sets by nav layer. (#3496, #4797) + Demo: Remove incorrect and useless suggestion to use PushID(). a35e87697 InputText: Amends and tidying up: Fixed undo/redo state corruption when editing buffer in user callback. (#4947, #4949) 530332dfb InputText: Fixed undo/redo state corruption when editing buffer in user callback. (#4947, #4949) 23a785aeb Internals: wrapped used of g.TempBuffer into ImFormatStringToTempBuffer/ImFormatStringToTempBufferV helpers. 64d6c3056 InputText: Fixed an undo-state corruption issue when editing buffer before reactivating item. (#4947) + Metrics: Added "InputText" section. 74f02703e Misc comments + Demo: use IsItemVisible() when using direct ImDrawList calls. 4789c7e48 Misc: Fix custom assertion macro failing to compile imgui.cpp (#5378) 65c4c0a49 IO: Added SetAppAcceptingEvents() function (#4921, #4858) 17b8c3b6e Demo: Removed redundant window flag (#5367) 7354009a7 Backends: Metal: Fixed null dereference inside command buffer completion handler. (#5363, #5365) 74f7ac04a Misc: Fix font compressor utility warnings. (#5359) f58bd817e Tables: Fix drawcall merging of last column. (#4843, #4844) 7b5a8e4f2 Merge branch 'master' into docking (wanted for #4468, #3381, #2981, #4825, #4832, #5127) e23c5edd5 Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#5351) 697ce2d67 InputText: Fixed a one-frame display glitch where pressing Escape to revert after a deletion would lead to small garbage being displayed for one frame. (#3008) 5139fb7e1 Docs: Add index ae2fb557f Docs: Update templates with link to Contributing guidelines. Add numerical version number in demo. Moved. (#5337) 814ecedd1 Docs: creates CONTRIBUTING.md (#5337) e5b2286ca Backends: OpenGL3: Fix apple TARGET_OS_* not defined warning. (#5321) ca222d30c Backends: OpenGL: Partially revert 1.86 change of using glBufferSubData(): now only done on Intel GPUs. (#4468, #3381, #2981, #4825, #4832, #5127) 7bf07d252 Renamed CaptureMouseFromApp() and CaptureKeyboardFromApp() to SetNextFrameWantCaptureMouse() and SetNextFrameWantCaptureKeyboard(). Added demo. (#5304, #4831, #4480, #533) cb56b0b23 Removed leftover KeepAliveID() call in GetIDWithSeed() variant. (#5181) + doc tweaks. 250333d89 Docking: Fix unhiding tab bar regression. (#5325, #5181) 36055213c Docking: Fixed moving window being interrupted when undocing a window with "io.ConfigDockingAlwaysTabBar = true". (#5324) e346059ee IO: Fixed input queue trickling of mouse wheel events. (#4921, #4821) 6b5a2426d Merge branch 'master' into docking 60bea052a Backends: OpenGL3: Fix state corruption on OpenGL ES 2.0 due to not preserving GL_ELEMENT_ARRAY_BUFFER_BINDING and vertex attribute states. (amends) b7686a88e Backends: OpenGL3: Fix state corruption on OpenGL ES 2.0 due to not preserving GL_ELEMENT_ARRAY_BUFFER_BINDING and vertex attribute states. 507a87354 DrawList: Circles disappear when using a radius < 0.5f (#3491) 9e0517a13 DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491) 2fa60bec2 Examples: Apple+OpenGL: Fix build. 693b4c57f Backends: OSX: Implement ImGui_ImplOSX_ShowWindow(). (#5299) 9779cc2fe Internals: shallow changes to simplify diff of upcoming commits. Should have no side-effect. 4db55f88e Changed FONT.md edit to blob (#5290) d768b8c81 Backends: Metal: Align code more closely with other backends. OSX: Add missing return for mouse pos events. 55f898939 Docs update, binaries link + Backend: Allegro: fix warning (#5281) 6d27fecce Debug: added DebugTextEncoding() to help diagnose between text encoding issues and font loading issues. Simplified code + extracted DebugNodeFontGlyph(). e66889083 Debug: added encoding viewer in Metrics. d666a1d47 Backends: OSX, Metal: Amend d111133, tidying up, remove unused, misc tweaks. . (#4821, #2778) 6868d1166 Backends: OSX, Metal: Added multi-viewports support. (#4821, #2778) 414165d23 Merge branch 'master' into docking e66fc2205 Backends: OSX: Removed ImGui_ImplOSX_HandleEvent() from backend API. Move event tracking (desktop only) to OSX backend. (#4821) 26f817807 Backends: Vulkan: Don't use VK_PRESENT_MODE_MAX_ENUM_KHR as specs state it isn't part of the API. (#5254) d58b8414b Backends: OSX, Metal: Tweaks. Use preferred method of obtaining a timestamp. (#4821) 3e5dde9a2 Tables: Fixed incorrect auto-fit of parent windows when using non-resizable weighted columns. (#5276) 709bc03d6 Backends: GLFW: fixed ImGui_ImplGlfw_TranslateUntranslatedKey() for lower case letters on OSX (#5260, #5261) 314c7bd12 Internals: renamed ImGuiInputReadMode to ImGuiNavReadMode (internals) to avoid ambiguity with upcoming flags. + minor tweak e54db4ee7 Backends: OSX, Metal: Store backend data in a per-context struct, allowing to use these backends with multiple contexts. (#5203, #5221, #4141) 04689979b Examples: Emscripten+WebGPU: Fix for latest spec rename of WGPURenderPassColorAttachment::clearColor to ::clearValue (#3632) ec4868145 Windows: Fixed first-time windows appearing in negative coordinates. (#5215, #3414) b5b704d37 Windows: Fixed first-time windows appearing in negative coordinates. (#5215, #3414) 8dd542518 Merge branch 'master' into docking 5b29d1478 Layout: Fixed mixing up SameLine() and SetCursorPos() together. SameLine() is a stateful. eda7792b1 Internals: swapped blocks in TextEx() to make it easier to step through common cases. Tweak demo. 28b2089ee Internals: moved ItemSize() variant to inline + comment. + Tidying up todo list (#5191) 14ca75d4e Backends: SDL, OpenGL3: Small fixes for AmigaOS4. (#5190) + Allow redefining IM_COL32_XXX layout macros. (#5190, #767, #844) 088487a3d Nav: Fixed nav movement in a scope with only one disabled item from focusing the disabled item. (#5189) fc203c7d7 Minor fix to sastisfy PVS-Studio warning. (amend, 3nd attempt: this is a false positive from PVS studio) 6d15a506f Internals: removed GetIDNoKeepAlive() now that it is the same as GetID(). (#5181) 90386780e Misc: Fixed calling GetID("label") _before_ a widget emitting this item inside a group (such as InputInt()) from causing an assertion when closing the group. (#5181). 937d07332 Updated comment about Edit.NavigateTo to Edit.GoToAll. (#5179) f7f30476d Added comments about requirement for bilinear filtering. (#5156, #3245) + Backends: SDL_Renderer: Explicitely call SDL_SetTextureScaleMode(). (#4927) 505f19e3b Merge branch 'master' into docking 2c03aac6d Renamed ImGuiKeyModFlags to ImGuiModFlags (Breaking but technically never advertised type) a472e8834 InputScalar: Automatically allow hexadecimal/scientific input when format is adequate. c521883be Sliders, Drags: Fixed manual input when using hexadecimal display format string. (#5165, #3133) 508c9aaf6 Sliders, Drags: Fixed using hexadecimal display format strings (pretty much never worked). (#5165, #3133) f5c5926fb Internals: remove obsolete variants of RenderArrow(), RenderBullet(), ImHash() + misc comments. 88fbc31ee stb_truetype: fix a division by zero (unused chain of result, but triggering debuggers). (#5139, #5075) 2747a8ca4 Turned ImVec2 to const ref to RenderChar(), RenderText(), ColorButton(), PushClipRect(). for consistency. Comments about polygon filling winding order. 0dec43070 Menus: Adjusted BeginMenu() closing logic so hovering void or non-MenuItem() in parent window always lead to menu closure. 2d76b09d2 Backends: Metal: Conditional check, amend 7602277 (#5122, #5123) 1ba290501 Update README, quote, mission statement 3587ee492 Viewports: store Viewport field in ImGuiWindow to facilitate using code accross branches + fix PVS warnings. dfbe938e5 InputText: Fixed pressing Tab emitting two tabs characters. (#2467, #1336) 16ddc1698 Fixed creating multiple-context (regression in 28ba54a). (#5135) 377b864bb Merge branch 'master' into docking 1ad8ad623 Backends: GLFW: Fixed keyboard modifiers events being reported incorrectly on Linux/X11. 7d7bf993b ImDrawList: Fix texture-based anti-aliasing with RGBA textures (#5132, #3245) 3c0787950 Backends: OSX: Inputs: Monitor NSKeyUp events to catch missing keyUp for key when user press Cmd + key (#5128) 9b0c26b0b Backends: SDL: Fix more dragging issues. SDL_CaptureMouse() is essentially broken. (#5012, #5082) c5f67218b Backends: SDL: Fix multi-viewport dragging issue with SDL on some systems. (v2 for master, using bd->MouseButtonsDown == 0) (#5012, #5082) 7602277c8 Backends: Metal: Remove weak ref (#5122, #5123) 31e77eacd Backends: SDL: Add extra mouse buttons handling (#5125) 6fae29679 Examples: Emscripten: Fix build. (#3632) 28ba54a32 Internals: add AddSettingsHandler(), RemoveSettingsHandler(). fd06ed833 Misc: tweaks + fix warnings on backends withtout -wno-memaccess (#4995, #5104) 0cff5ac5a Updated stb_textedit.h from 1.20 to 1.26 (many fixes). (#5075) de451d447 Updated stb_textedit.h from 1.13 to 1.14. (#5075) 279db5584 Updated stb_rect_pack.h from 1.00 to 1.01. (#5075) 3deb92c2c Add IMGUI_STB_SPRINTF_FILENAME to support custom stb_printf.h include path (#5068, #2954) 0f1493357 Tables: Fixed incorrect border height used for logic when resizing one of several synchronized instance of a same table ID, when instances have a different height. (#3955, #3565) 6315716f2 Backends: Glut: Fix comparison operator precedence. 1e18da5c3 Backends, Examples: Add comments about using WndProc handler and WantCaptureXXX flags. (#5061) 54fb051e5 ColorEdit: Fixed text baseline alignment after a SameLine() after a ColorEdit() with visible label. git-subtree-dir: deps/imgui git-subtree-split: 2db79d0868f7b02d26f7557a72504a0b6f844937
3907 lines
284 KiB
C++
3907 lines
284 KiB
C++
// dear imgui, v1.90.7
|
|
// (internal structures/api)
|
|
|
|
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
|
|
|
|
/*
|
|
|
|
Index of this file:
|
|
|
|
// [SECTION] Header mess
|
|
// [SECTION] Forward declarations
|
|
// [SECTION] Context pointer
|
|
// [SECTION] STB libraries includes
|
|
// [SECTION] Macros
|
|
// [SECTION] Generic helpers
|
|
// [SECTION] ImDrawList support
|
|
// [SECTION] Widgets support: flags, enums, data structures
|
|
// [SECTION] Data types support
|
|
// [SECTION] Popup support
|
|
// [SECTION] Inputs support
|
|
// [SECTION] Clipper support
|
|
// [SECTION] Navigation support
|
|
// [SECTION] Typing-select support
|
|
// [SECTION] Columns support
|
|
// [SECTION] Multi-select support
|
|
// [SECTION] Docking support
|
|
// [SECTION] Viewport support
|
|
// [SECTION] Settings support
|
|
// [SECTION] Localization support
|
|
// [SECTION] Metrics, Debug tools
|
|
// [SECTION] Generic context hooks
|
|
// [SECTION] ImGuiContext (main imgui context)
|
|
// [SECTION] ImGuiWindowTempData, ImGuiWindow
|
|
// [SECTION] Tab bar, Tab item support
|
|
// [SECTION] Table support
|
|
// [SECTION] ImGui internal API
|
|
// [SECTION] ImFontAtlas internal API
|
|
// [SECTION] Test Engine specific hooks (imgui_test_engine)
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
#ifndef IMGUI_DISABLE
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Header mess
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef IMGUI_VERSION
|
|
#include "imgui.h"
|
|
#endif
|
|
|
|
#include <stdio.h> // FILE*, sscanf
|
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi, atof
|
|
#include <math.h> // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf
|
|
#include <limits.h> // INT_MIN, INT_MAX
|
|
|
|
// Enable SSE intrinsics if available
|
|
#if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE)
|
|
#define IMGUI_ENABLE_SSE
|
|
#include <immintrin.h>
|
|
#endif
|
|
|
|
// Visual Studio warnings
|
|
#ifdef _MSC_VER
|
|
#pragma warning (push)
|
|
#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
|
|
#pragma warning (disable: 26812) // The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
|
#pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6).
|
|
#if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later
|
|
#pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types
|
|
#endif
|
|
#endif
|
|
|
|
// Clang/GCC warnings with -Weverything
|
|
#if defined(__clang__)
|
|
#pragma clang diagnostic push
|
|
#if __has_warning("-Wunknown-warning-option")
|
|
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
|
|
#endif
|
|
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
|
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloor()
|
|
#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
|
|
#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
|
|
#pragma clang diagnostic ignored "-Wold-style-cast"
|
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
|
#pragma clang diagnostic ignored "-Wdouble-promotion"
|
|
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
|
|
#pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn'
|
|
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
|
|
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
|
|
#elif defined(__GNUC__)
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
|
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
|
#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
|
|
#endif
|
|
|
|
// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h
|
|
// As they are frequently requested, we do not want to encourage to many people using imgui_internal.h
|
|
#if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED)
|
|
#error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h!
|
|
#endif
|
|
|
|
// Legacy defines
|
|
#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74
|
|
#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
#endif
|
|
#ifdef IMGUI_DISABLE_MATH_FUNCTIONS // Renamed in 1.74
|
|
#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
|
|
#endif
|
|
|
|
// Enable stb_truetype by default unless FreeType is enabled.
|
|
// You can compile with both by defining both IMGUI_ENABLE_FREETYPE and IMGUI_ENABLE_STB_TRUETYPE together.
|
|
#ifndef IMGUI_ENABLE_FREETYPE
|
|
#define IMGUI_ENABLE_STB_TRUETYPE
|
|
#endif
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Forward declarations
|
|
//-----------------------------------------------------------------------------
|
|
|
|
struct ImBitVector; // Store 1-bit per value
|
|
struct ImRect; // An axis-aligned rectangle (2 points)
|
|
struct ImDrawDataBuilder; // Helper to build a ImDrawData instance
|
|
struct ImDrawListSharedData; // Data shared between all ImDrawList instances
|
|
struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it
|
|
struct ImGuiContext; // Main Dear ImGui context
|
|
struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine
|
|
struct ImGuiDataVarInfo; // Variable information (e.g. to access style variables from an enum)
|
|
struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum
|
|
struct ImGuiDockContext; // Docking system context
|
|
struct ImGuiDockRequest; // Docking system dock/undock queued request
|
|
struct ImGuiDockNode; // Docking system node (hold a list of Windows OR two child dock nodes)
|
|
struct ImGuiDockNodeSettings; // Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
|
|
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
|
|
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
|
|
struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id
|
|
struct ImGuiLastItemData; // Status storage for last submitted items
|
|
struct ImGuiLocEntry; // A localization entry.
|
|
struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
|
|
struct ImGuiNavItemData; // Result of a gamepad/keyboard directional navigation move query result
|
|
struct ImGuiNavTreeNodeData; // Temporary storage for last TreeNode() being a Left arrow landing candidate.
|
|
struct ImGuiMetricsConfig; // Storage for ShowMetricsWindow() and DebugNodeXXX() functions
|
|
struct ImGuiNextWindowData; // Storage for SetNextWindow** functions
|
|
struct ImGuiNextItemData; // Storage for SetNextItem** functions
|
|
struct ImGuiOldColumnData; // Storage data for a single column for legacy Columns() api
|
|
struct ImGuiOldColumns; // Storage data for a columns set for legacy Columns() api
|
|
struct ImGuiPopupData; // Storage for current popup stack
|
|
struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file
|
|
struct ImGuiStackSizes; // Storage of stack sizes for debugging/asserting
|
|
struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it
|
|
struct ImGuiTabBar; // Storage for a tab bar
|
|
struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
|
|
struct ImGuiTable; // Storage for a table
|
|
struct ImGuiTableHeaderData; // Storage for TableAngledHeadersRow()
|
|
struct ImGuiTableColumn; // Storage for one column of a table
|
|
struct ImGuiTableInstanceData; // Storage for one instance of a same table
|
|
struct ImGuiTableTempData; // Temporary storage for one table (one per table in the stack), shared between tables.
|
|
struct ImGuiTableSettings; // Storage for a table .ini settings
|
|
struct ImGuiTableColumnsSettings; // Storage for a column .ini settings
|
|
struct ImGuiTypingSelectState; // Storage for GetTypingSelectRequest()
|
|
struct ImGuiTypingSelectRequest; // Storage for GetTypingSelectRequest() (aimed to be public)
|
|
struct ImGuiWindow; // Storage for one window
|
|
struct ImGuiWindowDockStyle; // Storage for window-style data which needs to be stored for docking purpose
|
|
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
|
|
struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
|
|
|
|
// Enumerations
|
|
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
|
|
enum ImGuiLocKey : int; // -> enum ImGuiLocKey // Enum: a localization entry for translation.
|
|
typedef int ImGuiDataAuthority; // -> enum ImGuiDataAuthority_ // Enum: for storing the source authority (dock node vs window) of a field
|
|
typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
|
|
|
|
// Flags
|
|
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
|
|
typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
|
|
typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow();
|
|
typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), g.LastItemData.InFlags
|
|
typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags
|
|
typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
|
|
typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
|
|
typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
|
|
typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
|
|
typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
|
|
typedef int ImGuiScrollFlags; // -> enum ImGuiScrollFlags_ // Flags: for ScrollToItem() and navigation requests
|
|
typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx()
|
|
typedef int ImGuiTextFlags; // -> enum ImGuiTextFlags_ // Flags: for TextEx()
|
|
typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx()
|
|
typedef int ImGuiTypingSelectFlags; // -> enum ImGuiTypingSelectFlags_ // Flags: for GetTypingSelectRequest()
|
|
typedef int ImGuiWindowRefreshFlags; // -> enum ImGuiWindowRefreshFlags_ // Flags: for SetNextWindowRefreshPolicy()
|
|
|
|
typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Context pointer
|
|
// See implementation of this variable in imgui.cpp for comments and details.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef GImGui
|
|
extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
|
#endif
|
|
|
|
//-------------------------------------------------------------------------
|
|
// [SECTION] STB libraries includes
|
|
//-------------------------------------------------------------------------
|
|
|
|
namespace ImStb
|
|
{
|
|
|
|
#undef IMSTB_TEXTEDIT_STRING
|
|
#undef IMSTB_TEXTEDIT_CHARTYPE
|
|
#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
|
|
#define IMSTB_TEXTEDIT_CHARTYPE ImWchar
|
|
#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
|
|
#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
|
|
#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
|
|
#include "imstb_textedit.h"
|
|
|
|
} // namespace ImStb
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Macros
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Internal Drag and Drop payload types. String starting with '_' are reserved for Dear ImGui.
|
|
#define IMGUI_PAYLOAD_TYPE_WINDOW "_IMWINDOW" // Payload == ImGuiWindow*
|
|
|
|
// Debug Printing Into TTY
|
|
// (since IMGUI_VERSION_NUM >= 18729: IMGUI_DEBUG_LOG was reworked into IMGUI_DEBUG_PRINTF (and removed framecount from it). If you were using a #define IMGUI_DEBUG_LOG please rename)
|
|
#ifndef IMGUI_DEBUG_PRINTF
|
|
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
|
|
#else
|
|
#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
|
|
#endif
|
|
#endif
|
|
|
|
// Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam.
|
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
|
#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
|
|
#else
|
|
#define IMGUI_DEBUG_LOG(...) ((void)0)
|
|
#endif
|
|
#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_DOCKING(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventDocking) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
#define IMGUI_DEBUG_LOG_VIEWPORT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventViewport) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
|
|
// Static Asserts
|
|
#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
|
|
|
|
// "Paranoid" Debug Asserts are meant to only be enabled during specific debugging/work, otherwise would slow down the code too much.
|
|
// We currently don't have many of those so the effect is currently negligible, but onward intent to add more aggressive ones in the code.
|
|
//#define IMGUI_DEBUG_PARANOID
|
|
#ifdef IMGUI_DEBUG_PARANOID
|
|
#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
|
|
#else
|
|
#define IM_ASSERT_PARANOID(_EXPR)
|
|
#endif
|
|
|
|
// Error handling
|
|
// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults.
|
|
#ifndef IM_ASSERT_USER_ERROR
|
|
#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error
|
|
#endif
|
|
|
|
// Misc Macros
|
|
#define IM_PI 3.14159265358979323846f
|
|
#ifdef _WIN32
|
|
#define IM_NEWLINE "\r\n" // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!)
|
|
#else
|
|
#define IM_NEWLINE "\n"
|
|
#endif
|
|
#ifndef IM_TABSIZE // Until we move this to runtime and/or add proper tab support, at least allow users to compile-time override
|
|
#define IM_TABSIZE (4)
|
|
#endif
|
|
#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8
|
|
#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose
|
|
#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
|
|
#define IM_TRUNC(_VAL) ((float)(int)(_VAL)) // ImTrunc() is not inlined in MSVC debug builds
|
|
#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) //
|
|
#define IM_STRINGIFY_HELPER(_X) #_X
|
|
#define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X) // Preprocessor idiom to stringify e.g. an integer.
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#define IM_FLOOR IM_TRUNC
|
|
#endif
|
|
|
|
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
|
|
#ifdef _MSC_VER
|
|
#define IMGUI_CDECL __cdecl
|
|
#else
|
|
#define IMGUI_CDECL
|
|
#endif
|
|
|
|
// Warnings
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
#define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX))
|
|
#else
|
|
#define IM_MSVC_WARNING_SUPPRESS(XXXX)
|
|
#endif
|
|
|
|
// Debug Tools
|
|
// Use 'Metrics/Debugger->Tools->Item Picker' to break into the call-stack of a specific item.
|
|
// This will call IM_DEBUG_BREAK() which you may redefine yourself. See https://github.com/scottt/debugbreak for more reference.
|
|
#ifndef IM_DEBUG_BREAK
|
|
#if defined (_MSC_VER)
|
|
#define IM_DEBUG_BREAK() __debugbreak()
|
|
#elif defined(__clang__)
|
|
#define IM_DEBUG_BREAK() __builtin_debugtrap()
|
|
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
#define IM_DEBUG_BREAK() __asm__ volatile("int3;nop")
|
|
#elif defined(__GNUC__) && defined(__thumb__)
|
|
#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
|
|
#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
|
|
#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0")
|
|
#else
|
|
#define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger!
|
|
#endif
|
|
#endif // #ifndef IM_DEBUG_BREAK
|
|
|
|
// Format specifiers, printing 64-bit hasn't been decently standardized...
|
|
// In a real application you should be using PRId64 and PRIu64 from <inttypes.h> (non-windows) and on Windows define them yourself.
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
#define IM_PRId64 "I64d"
|
|
#define IM_PRIu64 "I64u"
|
|
#define IM_PRIX64 "I64X"
|
|
#else
|
|
#define IM_PRId64 "lld"
|
|
#define IM_PRIu64 "llu"
|
|
#define IM_PRIX64 "llX"
|
|
#endif
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Generic helpers
|
|
// Note that the ImXXX helpers functions are lower-level than ImGui functions.
|
|
// ImGui functions or the ImGui context are never called/used from other ImXXX functions.
|
|
//-----------------------------------------------------------------------------
|
|
// - Helpers: Hashing
|
|
// - Helpers: Sorting
|
|
// - Helpers: Bit manipulation
|
|
// - Helpers: String
|
|
// - Helpers: Formatting
|
|
// - Helpers: UTF-8 <> wchar conversions
|
|
// - Helpers: ImVec2/ImVec4 operators
|
|
// - Helpers: Maths
|
|
// - Helpers: Geometry
|
|
// - Helper: ImVec1
|
|
// - Helper: ImVec2ih
|
|
// - Helper: ImRect
|
|
// - Helper: ImBitArray
|
|
// - Helper: ImBitVector
|
|
// - Helper: ImSpan<>, ImSpanAllocator<>
|
|
// - Helper: ImPool<>
|
|
// - Helper: ImChunkStream<>
|
|
// - Helper: ImGuiTextIndex
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Helpers: Hashing
|
|
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);
|
|
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);
|
|
|
|
// Helpers: Sorting
|
|
#ifndef ImQsort
|
|
static inline void ImQsort(void* base, size_t count, size_t size_of_element, int(IMGUI_CDECL *compare_func)(void const*, void const*)) { if (count > 1) qsort(base, count, size_of_element, compare_func); }
|
|
#endif
|
|
|
|
// Helpers: Color Blending
|
|
IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
|
|
|
|
// Helpers: Bit manipulation
|
|
static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; }
|
|
static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 && (v & (v - 1)) == 0; }
|
|
static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
|
|
|
|
// Helpers: String
|
|
IMGUI_API int ImStricmp(const char* str1, const char* str2); // Case insensitive compare.
|
|
IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); // Case insensitive compare to a certain count.
|
|
IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); // Copy to a certain count and always zero terminate (strncpy doesn't).
|
|
IMGUI_API char* ImStrdup(const char* str); // Duplicate a string.
|
|
IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str); // Copy in provided buffer, recreate buffer if needed.
|
|
IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); // Find first occurrence of 'c' in string range.
|
|
IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line
|
|
IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); // Find a substring in a string range.
|
|
IMGUI_API void ImStrTrimBlanks(char* str); // Remove leading and trailing blanks from a buffer.
|
|
IMGUI_API const char* ImStrSkipBlank(const char* str); // Find first non-blank character.
|
|
IMGUI_API int ImStrlenW(const ImWchar* str); // Computer string length (ImWchar string)
|
|
IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line (ImWchar string)
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
static inline char ImToUpper(char c) { return (c >= 'a' && c <= 'z') ? c &= ~32 : c; }
|
|
static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
|
|
static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; }
|
|
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
|
|
|
// Helpers: Formatting
|
|
IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3);
|
|
IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3);
|
|
IMGUI_API void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...) IM_FMTARGS(3);
|
|
IMGUI_API void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) IM_FMTLIST(3);
|
|
IMGUI_API const char* ImParseFormatFindStart(const char* format);
|
|
IMGUI_API const char* ImParseFormatFindEnd(const char* format);
|
|
IMGUI_API const char* ImParseFormatTrimDecorations(const char* format, char* buf, size_t buf_size);
|
|
IMGUI_API void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t fmt_out_size);
|
|
IMGUI_API const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size);
|
|
IMGUI_API int ImParseFormatPrecision(const char* format, int default_value);
|
|
|
|
// Helpers: UTF-8 <> wchar conversions
|
|
IMGUI_API const char* ImTextCharToUtf8(char out_buf[5], unsigned int c); // return out_buf
|
|
IMGUI_API int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
|
|
IMGUI_API int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // read one character. return input UTF-8 bytes count
|
|
IMGUI_API int ImTextStrFromUtf8(ImWchar* out_buf, int out_buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count
|
|
IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count)
|
|
IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8
|
|
IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8
|
|
IMGUI_API const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr); // return previous UTF-8 code-point.
|
|
IMGUI_API int ImTextCountLines(const char* in_text, const char* in_text_end); // return number of lines taken by text. trailing carriage return doesn't count as an extra line.
|
|
|
|
// Helpers: File System
|
|
#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
|
|
#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
|
|
typedef void* ImFileHandle;
|
|
static inline ImFileHandle ImFileOpen(const char*, const char*) { return NULL; }
|
|
static inline bool ImFileClose(ImFileHandle) { return false; }
|
|
static inline ImU64 ImFileGetSize(ImFileHandle) { return (ImU64)-1; }
|
|
static inline ImU64 ImFileRead(void*, ImU64, ImU64, ImFileHandle) { return 0; }
|
|
static inline ImU64 ImFileWrite(const void*, ImU64, ImU64, ImFileHandle) { return 0; }
|
|
#endif
|
|
#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
|
|
typedef FILE* ImFileHandle;
|
|
IMGUI_API ImFileHandle ImFileOpen(const char* filename, const char* mode);
|
|
IMGUI_API bool ImFileClose(ImFileHandle file);
|
|
IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
|
|
IMGUI_API ImU64 ImFileRead(void* data, ImU64 size, ImU64 count, ImFileHandle file);
|
|
IMGUI_API ImU64 ImFileWrite(const void* data, ImU64 size, ImU64 count, ImFileHandle file);
|
|
#else
|
|
#define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions
|
|
#endif
|
|
IMGUI_API void* ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_file_size = NULL, int padding_bytes = 0);
|
|
|
|
// Helpers: Maths
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
// - Wrapper for standard libs functions. (Note that imgui_demo.cpp does _not_ use them to keep the code easy to copy)
|
|
#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
|
|
#define ImFabs(X) fabsf(X)
|
|
#define ImSqrt(X) sqrtf(X)
|
|
#define ImFmod(X, Y) fmodf((X), (Y))
|
|
#define ImCos(X) cosf(X)
|
|
#define ImSin(X) sinf(X)
|
|
#define ImAcos(X) acosf(X)
|
|
#define ImAtan2(Y, X) atan2f((Y), (X))
|
|
#define ImAtof(STR) atof(STR)
|
|
#define ImCeil(X) ceilf(X)
|
|
static inline float ImPow(float x, float y) { return powf(x, y); } // DragBehaviorT/SliderBehaviorT uses ImPow with either float/double and need the precision
|
|
static inline double ImPow(double x, double y) { return pow(x, y); }
|
|
static inline float ImLog(float x) { return logf(x); } // DragBehaviorT/SliderBehaviorT uses ImLog with either float/double and need the precision
|
|
static inline double ImLog(double x) { return log(x); }
|
|
static inline int ImAbs(int x) { return x < 0 ? -x : x; }
|
|
static inline float ImAbs(float x) { return fabsf(x); }
|
|
static inline double ImAbs(double x) { return fabs(x); }
|
|
static inline float ImSign(float x) { return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; } // Sign operator - returns -1, 0 or 1 based on sign of argument
|
|
static inline double ImSign(double x) { return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
|
|
#ifdef IMGUI_ENABLE_SSE
|
|
static inline float ImRsqrt(float x) { return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
|
|
#else
|
|
static inline float ImRsqrt(float x) { return 1.0f / sqrtf(x); }
|
|
#endif
|
|
static inline double ImRsqrt(double x) { return 1.0 / sqrt(x); }
|
|
#endif
|
|
// - ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support variety of types: signed/unsigned int/long long float/double
|
|
// (Exceptionally using templates here but we could also redefine them for those types)
|
|
template<typename T> static inline T ImMin(T lhs, T rhs) { return lhs < rhs ? lhs : rhs; }
|
|
template<typename T> static inline T ImMax(T lhs, T rhs) { return lhs >= rhs ? lhs : rhs; }
|
|
template<typename T> static inline T ImClamp(T v, T mn, T mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
|
|
template<typename T> static inline T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); }
|
|
template<typename T> static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
|
|
template<typename T> static inline T ImAddClampOverflow(T a, T b, T mn, T mx) { if (b < 0 && (a < mn - b)) return mn; if (b > 0 && (a > mx - b)) return mx; return a + b; }
|
|
template<typename T> static inline T ImSubClampOverflow(T a, T b, T mn, T mx) { if (b > 0 && (a < mn + b)) return mn; if (b < 0 && (a > mx + b)) return mx; return a - b; }
|
|
// - Misc maths helpers
|
|
static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); }
|
|
static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); }
|
|
static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); }
|
|
static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); }
|
|
static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
|
|
static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); }
|
|
static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
|
|
static inline float ImLengthSqr(const ImVec2& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
|
|
static inline float ImLengthSqr(const ImVec4& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
|
|
static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = (lhs.x * lhs.x) + (lhs.y * lhs.y); if (d > 0.0f) return ImRsqrt(d); return fail_value; }
|
|
static inline float ImTrunc(float f) { return (float)(int)(f); }
|
|
static inline ImVec2 ImTrunc(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }
|
|
static inline float ImFloor(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
|
|
static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
|
|
static inline int ImModPositive(int a, int b) { return (a + b) % b; }
|
|
static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
|
|
static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
|
|
static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; }
|
|
static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
|
|
static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) { return f <= -16777216 || f >= 16777216; }
|
|
static inline float ImExponentialMovingAverage(float avg, float sample, int n) { avg -= avg / n; avg += sample / n; return avg; }
|
|
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
|
|
|
// Helpers: Geometry
|
|
IMGUI_API ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t);
|
|
IMGUI_API ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments); // For curves with explicit number of segments
|
|
IMGUI_API ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol);// For auto-tessellated curves you can use tess_tol = style.CurveTessellationTol
|
|
IMGUI_API ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t);
|
|
IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);
|
|
IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
|
|
IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
|
|
IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);
|
|
inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
|
|
inline bool ImTriangleIsClockwise(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ((b.x - a.x) * (c.y - b.y)) - ((c.x - b.x) * (b.y - a.y)) > 0.0f; }
|
|
|
|
// Helper: ImVec1 (1D vector)
|
|
// (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
struct ImVec1
|
|
{
|
|
float x;
|
|
constexpr ImVec1() : x(0.0f) { }
|
|
constexpr ImVec1(float _x) : x(_x) { }
|
|
};
|
|
|
|
// Helper: ImVec2ih (2D vector, half-size integer, for long-term packed storage)
|
|
struct ImVec2ih
|
|
{
|
|
short x, y;
|
|
constexpr ImVec2ih() : x(0), y(0) {}
|
|
constexpr ImVec2ih(short _x, short _y) : x(_x), y(_y) {}
|
|
constexpr explicit ImVec2ih(const ImVec2& rhs) : x((short)rhs.x), y((short)rhs.y) {}
|
|
};
|
|
|
|
// Helper: ImRect (2D axis aligned bounding-box)
|
|
// NB: we can't rely on ImVec2 math operators being available here!
|
|
struct IMGUI_API ImRect
|
|
{
|
|
ImVec2 Min; // Upper-left
|
|
ImVec2 Max; // Lower-right
|
|
|
|
constexpr ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
|
|
constexpr ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
|
|
constexpr ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
|
|
constexpr ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}
|
|
|
|
ImVec2 GetCenter() const { return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
|
|
ImVec2 GetSize() const { return ImVec2(Max.x - Min.x, Max.y - Min.y); }
|
|
float GetWidth() const { return Max.x - Min.x; }
|
|
float GetHeight() const { return Max.y - Min.y; }
|
|
float GetArea() const { return (Max.x - Min.x) * (Max.y - Min.y); }
|
|
ImVec2 GetTL() const { return Min; } // Top-left
|
|
ImVec2 GetTR() const { return ImVec2(Max.x, Min.y); } // Top-right
|
|
ImVec2 GetBL() const { return ImVec2(Min.x, Max.y); } // Bottom-left
|
|
ImVec2 GetBR() const { return Max; } // Bottom-right
|
|
bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
|
|
bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; }
|
|
bool ContainsWithPad(const ImVec2& p, const ImVec2& pad) const { return p.x >= Min.x - pad.x && p.y >= Min.y - pad.y && p.x < Max.x + pad.x && p.y < Max.y + pad.y; }
|
|
bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
|
|
void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; }
|
|
void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; }
|
|
void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
|
|
void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
|
|
void Translate(const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
|
|
void TranslateX(float dx) { Min.x += dx; Max.x += dx; }
|
|
void TranslateY(float dy) { Min.y += dy; Max.y += dy; }
|
|
void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
|
|
void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped.
|
|
void Floor() { Min.x = IM_TRUNC(Min.x); Min.y = IM_TRUNC(Min.y); Max.x = IM_TRUNC(Max.x); Max.y = IM_TRUNC(Max.y); }
|
|
bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; }
|
|
ImVec4 ToVec4() const { return ImVec4(Min.x, Min.y, Max.x, Max.y); }
|
|
};
|
|
|
|
// Helper: ImBitArray
|
|
#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly!
|
|
#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly!
|
|
inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount) { return (size_t)((bitcount + 31) >> 5) << 2; }
|
|
inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
|
|
inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; }
|
|
inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
|
|
inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
|
|
inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on range [n..n2)
|
|
{
|
|
n2--;
|
|
while (n <= n2)
|
|
{
|
|
int a_mod = (n & 31);
|
|
int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
|
|
ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
|
|
arr[n >> 5] |= mask;
|
|
n = (n + 32) & ~31;
|
|
}
|
|
}
|
|
|
|
typedef ImU32* ImBitArrayPtr; // Name for use in structs
|
|
|
|
// Helper: ImBitArray class (wrapper over ImBitArray functions)
|
|
// Store 1-bit per value.
|
|
template<int BITCOUNT, int OFFSET = 0>
|
|
struct ImBitArray
|
|
{
|
|
ImU32 Storage[(BITCOUNT + 31) >> 5];
|
|
ImBitArray() { ClearAllBits(); }
|
|
void ClearAllBits() { memset(Storage, 0, sizeof(Storage)); }
|
|
void SetAllBits() { memset(Storage, 255, sizeof(Storage)); }
|
|
bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
|
|
void SetBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
|
|
void ClearBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
|
|
void SetBitRange(int n, int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); } // Works on range [n..n2)
|
|
bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
|
|
};
|
|
|
|
// Helper: ImBitVector
|
|
// Store 1-bit per value.
|
|
struct IMGUI_API ImBitVector
|
|
{
|
|
ImVector<ImU32> Storage;
|
|
void Create(int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
|
|
void Clear() { Storage.clear(); }
|
|
bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return IM_BITARRAY_TESTBIT(Storage.Data, n); }
|
|
void SetBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
|
|
void ClearBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
|
|
};
|
|
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
|
|
|
// Helper: ImSpan<>
|
|
// Pointing to a span of data we don't own.
|
|
template<typename T>
|
|
struct ImSpan
|
|
{
|
|
T* Data;
|
|
T* DataEnd;
|
|
|
|
// Constructors, destructor
|
|
inline ImSpan() { Data = DataEnd = NULL; }
|
|
inline ImSpan(T* data, int size) { Data = data; DataEnd = data + size; }
|
|
inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
|
|
|
|
inline void set(T* data, int size) { Data = data; DataEnd = data + size; }
|
|
inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
|
|
inline int size() const { return (int)(ptrdiff_t)(DataEnd - Data); }
|
|
inline int size_in_bytes() const { return (int)(ptrdiff_t)(DataEnd - Data) * (int)sizeof(T); }
|
|
inline T& operator[](int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd); return *p; }
|
|
inline const T& operator[](int i) const { const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd); return *p; }
|
|
|
|
inline T* begin() { return Data; }
|
|
inline const T* begin() const { return Data; }
|
|
inline T* end() { return DataEnd; }
|
|
inline const T* end() const { return DataEnd; }
|
|
|
|
// Utilities
|
|
inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it < DataEnd); const ptrdiff_t off = it - Data; return (int)off; }
|
|
};
|
|
|
|
// Helper: ImSpanAllocator<>
|
|
// Facilitate storing multiple chunks into a single large block (the "arena")
|
|
// - Usage: call Reserve() N times, allocate GetArenaSizeInBytes() worth, pass it to SetArenaBasePtr(), call GetSpan() N times to retrieve the aligned ranges.
|
|
template<int CHUNKS>
|
|
struct ImSpanAllocator
|
|
{
|
|
char* BasePtr;
|
|
int CurrOff;
|
|
int CurrIdx;
|
|
int Offsets[CHUNKS];
|
|
int Sizes[CHUNKS];
|
|
|
|
ImSpanAllocator() { memset(this, 0, sizeof(*this)); }
|
|
inline void Reserve(int n, size_t sz, int a=4) { IM_ASSERT(n == CurrIdx && n < CHUNKS); CurrOff = IM_MEMALIGN(CurrOff, a); Offsets[n] = CurrOff; Sizes[n] = (int)sz; CurrIdx++; CurrOff += (int)sz; }
|
|
inline int GetArenaSizeInBytes() { return CurrOff; }
|
|
inline void SetArenaBasePtr(void* base_ptr) { BasePtr = (char*)base_ptr; }
|
|
inline void* GetSpanPtrBegin(int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS); return (void*)(BasePtr + Offsets[n]); }
|
|
inline void* GetSpanPtrEnd(int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS); return (void*)(BasePtr + Offsets[n] + Sizes[n]); }
|
|
template<typename T>
|
|
inline void GetSpan(int n, ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
|
|
};
|
|
|
|
// Helper: ImPool<>
|
|
// Basic keyed storage for contiguous instances, slow/amortized insertion, O(1) indexable, O(Log N) queries by ID over a dense/hot buffer,
|
|
// Honor constructor/destructor. Add/remove invalidate all pointers. Indexes have the same lifetime as the associated object.
|
|
typedef int ImPoolIdx;
|
|
template<typename T>
|
|
struct ImPool
|
|
{
|
|
ImVector<T> Buf; // Contiguous data
|
|
ImGuiStorage Map; // ID->Index
|
|
ImPoolIdx FreeIdx; // Next free idx to use
|
|
ImPoolIdx AliveCount; // Number of active/alive items (for display purpose)
|
|
|
|
ImPool() { FreeIdx = AliveCount = 0; }
|
|
~ImPool() { Clear(); }
|
|
T* GetByKey(ImGuiID key) { int idx = Map.GetInt(key, -1); return (idx != -1) ? &Buf[idx] : NULL; }
|
|
T* GetByIndex(ImPoolIdx n) { return &Buf[n]; }
|
|
ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size); return (ImPoolIdx)(p - Buf.Data); }
|
|
T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Buf[*p_idx]; *p_idx = FreeIdx; return Add(); }
|
|
bool Contains(const T* p) const { return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
|
|
void Clear() { for (int n = 0; n < Map.Data.Size; n++) { int idx = Map.Data[n].val_i; if (idx != -1) Buf[idx].~T(); } Map.Clear(); Buf.clear(); FreeIdx = AliveCount = 0; }
|
|
T* Add() { int idx = FreeIdx; if (idx == Buf.Size) { Buf.resize(Buf.Size + 1); FreeIdx++; } else { FreeIdx = *(int*)&Buf[idx]; } IM_PLACEMENT_NEW(&Buf[idx]) T(); AliveCount++; return &Buf[idx]; }
|
|
void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); }
|
|
void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
|
|
void Reserve(int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
|
|
|
|
// To iterate a ImPool: for (int n = 0; n < pool.GetMapSize(); n++) if (T* t = pool.TryGetMapData(n)) { ... }
|
|
// Can be avoided if you know .Remove() has never been called on the pool, or AliveCount == GetMapSize()
|
|
int GetAliveCount() const { return AliveCount; } // Number of active/alive items in the pool (for display purpose)
|
|
int GetBufSize() const { return Buf.Size; }
|
|
int GetMapSize() const { return Map.Data.Size; } // It is the map we need iterate to find valid items, since we don't have "alive" storage anywhere
|
|
T* TryGetMapData(ImPoolIdx n) { int idx = Map.Data[n].val_i; if (idx == -1) return NULL; return GetByIndex(idx); }
|
|
};
|
|
|
|
// Helper: ImChunkStream<>
|
|
// Build and iterate a contiguous stream of variable-sized structures.
|
|
// This is used by Settings to store persistent data while reducing allocation count.
|
|
// We store the chunk size first, and align the final size on 4 bytes boundaries.
|
|
// The tedious/zealous amount of casting is to avoid -Wcast-align warnings.
|
|
template<typename T>
|
|
struct ImChunkStream
|
|
{
|
|
ImVector<char> Buf;
|
|
|
|
void clear() { Buf.clear(); }
|
|
bool empty() const { return Buf.Size == 0; }
|
|
int size() const { return Buf.Size; }
|
|
T* alloc_chunk(size_t sz) { size_t HDR_SZ = 4; sz = IM_MEMALIGN(HDR_SZ + sz, 4u); int off = Buf.Size; Buf.resize(off + (int)sz); ((int*)(void*)(Buf.Data + off))[0] = (int)sz; return (T*)(void*)(Buf.Data + off + (int)HDR_SZ); }
|
|
T* begin() { size_t HDR_SZ = 4; if (!Buf.Data) return NULL; return (T*)(void*)(Buf.Data + HDR_SZ); }
|
|
T* next_chunk(T* p) { size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(void*)((char*)(void*)p + chunk_size(p)); if (p == (T*)(void*)((char*)end() + HDR_SZ)) return (T*)0; IM_ASSERT(p < end()); return p; }
|
|
int chunk_size(const T* p) { return ((const int*)p)[-1]; }
|
|
T* end() { return (T*)(void*)(Buf.Data + Buf.Size); }
|
|
int offset_from_ptr(const T* p) { IM_ASSERT(p >= begin() && p < end()); const ptrdiff_t off = (const char*)p - Buf.Data; return (int)off; }
|
|
T* ptr_from_offset(int off) { IM_ASSERT(off >= 4 && off < Buf.Size); return (T*)(void*)(Buf.Data + off); }
|
|
void swap(ImChunkStream<T>& rhs) { rhs.Buf.swap(Buf); }
|
|
};
|
|
|
|
// Helper: ImGuiTextIndex<>
|
|
// Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.
|
|
struct ImGuiTextIndex
|
|
{
|
|
ImVector<int> LineOffsets;
|
|
int EndOffset = 0; // Because we don't own text buffer we need to maintain EndOffset (may bake in LineOffsets?)
|
|
|
|
void clear() { LineOffsets.clear(); EndOffset = 0; }
|
|
int size() { return LineOffsets.Size; }
|
|
const char* get_line_begin(const char* base, int n) { return base + LineOffsets[n]; }
|
|
const char* get_line_end(const char* base, int n) { return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
|
|
void append(const char* base, int old_size, int new_size);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] ImDrawList support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// ImDrawList: Helper function to calculate a circle's segment count given its radius and a "maximum error" value.
|
|
// Estimation of number of circle segment based on error is derived using method described in https://stackoverflow.com/a/2244088/15194693
|
|
// Number of segments (N) is calculated using equation:
|
|
// N = ceil ( pi / acos(1 - error / r) ) where r > 0, error <= r
|
|
// Our equation is significantly simpler that one in the post thanks for choosing segment that is
|
|
// perpendicular to X axis. Follow steps in the article from this starting condition and you will
|
|
// will get this result.
|
|
//
|
|
// Rendering circles with an odd number of segments, while mathematically correct will produce
|
|
// asymmetrical results on the raster grid. Therefore we're rounding N to next even number (7->8, 8->8, 9->10 etc.)
|
|
#define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
|
|
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
|
|
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
|
|
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(_RAD,_MAXERROR) ImClamp(IM_ROUNDUP_TO_EVEN((int)ImCeil(IM_PI / ImAcos(1 - ImMin((_MAXERROR), (_RAD)) / (_RAD)))), IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX)
|
|
|
|
// Raw equation from IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC rewritten for 'r' and 'error'.
|
|
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))))
|
|
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD))
|
|
|
|
// ImDrawList: Lookup table size for adaptive arc drawing, cover full circle.
|
|
#ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE
|
|
#define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48 // Number of samples in lookup table.
|
|
#endif
|
|
#define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE // Sample index _PathArcToFastEx() for 360 angle.
|
|
|
|
// Data shared between all ImDrawList instances
|
|
// You may want to create your own instance of this if you want to use ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.
|
|
struct IMGUI_API ImDrawListSharedData
|
|
{
|
|
ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas
|
|
ImFont* Font; // Current/default font (optional, for simplified AddText overload)
|
|
float FontSize; // Current/default font size (optional, for simplified AddText overload)
|
|
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
|
|
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
|
|
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
|
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
|
|
|
// [Internal] Temp write buffer
|
|
ImVector<ImVec2> TempBuffer;
|
|
|
|
// [Internal] Lookup tables
|
|
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
|
|
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
|
|
ImU8 CircleSegmentCounts[64]; // Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead)
|
|
const ImVec4* TexUvLines; // UV of anti-aliased lines in the atlas
|
|
|
|
ImDrawListSharedData();
|
|
void SetCircleTessellationMaxError(float max_error);
|
|
};
|
|
|
|
struct ImDrawDataBuilder
|
|
{
|
|
ImVector<ImDrawList*>* Layers[2]; // Pointers to global layers for: regular, tooltip. LayersP[0] is owned by DrawData.
|
|
ImVector<ImDrawList*> LayerData1;
|
|
|
|
ImDrawDataBuilder() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Widgets support: flags, enums, data structures
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Flags used by upcoming items
|
|
// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags.
|
|
// - output: stored in g.LastItemData.InFlags
|
|
// Current window shared by all windows.
|
|
// This is going to be exposed in imgui.h when stabilized enough.
|
|
enum ImGuiItemFlags_
|
|
{
|
|
// Controlled by user
|
|
ImGuiItemFlags_None = 0,
|
|
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
|
|
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
|
ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211
|
|
ImGuiItemFlags_NoNav = 1 << 3, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls)
|
|
ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items)
|
|
ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window
|
|
ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
|
|
ImGuiItemFlags_ReadOnly = 1 << 7, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
|
|
ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8, // false // Disable hoverable check in ItemHoverable()
|
|
ImGuiItemFlags_AllowOverlap = 1 << 9, // false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
|
|
|
|
// Controlled by widget code
|
|
ImGuiItemFlags_Inputable = 1 << 10, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
|
|
ImGuiItemFlags_HasSelectionUserData = 1 << 11, // false // Set by SetNextItemSelectionUserData()
|
|
};
|
|
|
|
// Status flags for an already submitted item
|
|
// - output: stored in g.LastItemData.StatusFlags
|
|
enum ImGuiItemStatusFlags_
|
|
{
|
|
ImGuiItemStatusFlags_None = 0,
|
|
ImGuiItemStatusFlags_HoveredRect = 1 << 0, // Mouse position is within item rectangle (does NOT mean that the window is in correct z-order and can be hovered!, this is only one part of the most-common IsItemHovered test)
|
|
ImGuiItemStatusFlags_HasDisplayRect = 1 << 1, // g.LastItemData.DisplayRect is valid
|
|
ImGuiItemStatusFlags_Edited = 1 << 2, // Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
|
|
ImGuiItemStatusFlags_ToggledSelection = 1 << 3, // Set when Selectable(), TreeNode() reports toggling a selection. We can't report "Selected", only state changes, in order to easily handle clipping with less issues.
|
|
ImGuiItemStatusFlags_ToggledOpen = 1 << 4, // Set when TreeNode() reports toggling their open state.
|
|
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
|
|
ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
|
|
ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing.
|
|
ImGuiItemStatusFlags_Visible = 1 << 8, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
|
|
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
|
|
ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
|
|
|
|
// Additional status + semantic for ImGuiTestEngine
|
|
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
ImGuiItemStatusFlags_Openable = 1 << 20, // Item is an openable (e.g. TreeNode)
|
|
ImGuiItemStatusFlags_Opened = 1 << 21, // Opened status
|
|
ImGuiItemStatusFlags_Checkable = 1 << 22, // Item is a checkable (e.g. CheckBox, MenuItem)
|
|
ImGuiItemStatusFlags_Checked = 1 << 23, // Checked status
|
|
ImGuiItemStatusFlags_Inputable = 1 << 24, // Item is a text-inputable (e.g. InputText, SliderXXX, DragXXX)
|
|
#endif
|
|
};
|
|
|
|
// Extend ImGuiHoveredFlags_
|
|
enum ImGuiHoveredFlagsPrivate_
|
|
{
|
|
ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
|
|
ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
|
|
ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
|
|
};
|
|
|
|
// Extend ImGuiInputTextFlags_
|
|
enum ImGuiInputTextFlagsPrivate_
|
|
{
|
|
// [Internal]
|
|
ImGuiInputTextFlags_Multiline = 1 << 26, // For internal use by InputTextMultiline()
|
|
ImGuiInputTextFlags_NoMarkEdited = 1 << 27, // For internal use by functions using InputText() before reformatting data
|
|
ImGuiInputTextFlags_MergedItem = 1 << 28, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
|
|
ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 29, // For internal use by InputScalar() and TempInputScalar()
|
|
};
|
|
|
|
// Extend ImGuiButtonFlags_
|
|
enum ImGuiButtonFlagsPrivate_
|
|
{
|
|
ImGuiButtonFlags_PressedOnClick = 1 << 4, // return true on click (mouse down event)
|
|
ImGuiButtonFlags_PressedOnClickRelease = 1 << 5, // [Default] return true on click + release on same item <-- this is what the majority of Button are using
|
|
ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6, // return true on click + release even if the release event is not done while hovering the item
|
|
ImGuiButtonFlags_PressedOnRelease = 1 << 7, // return true on release (default requires click+release)
|
|
ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8, // return true on double-click (default requires click+release)
|
|
ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9, // return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
|
|
ImGuiButtonFlags_Repeat = 1 << 10, // hold to repeat
|
|
ImGuiButtonFlags_FlattenChildren = 1 << 11, // allow interactions even if a child window is overlapping
|
|
ImGuiButtonFlags_AllowOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable.
|
|
ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press // [UNUSED]
|
|
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled
|
|
ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
|
|
ImGuiButtonFlags_NoKeyModifiers = 1 << 16, // disable mouse interaction if a key modifier is held
|
|
ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
|
|
ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.InFlags)
|
|
ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, // don't report as hovered when nav focus is on this item
|
|
ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, // don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
|
ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, // don't test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
|
ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
|
|
ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
|
|
};
|
|
|
|
// Extend ImGuiComboFlags_
|
|
enum ImGuiComboFlagsPrivate_
|
|
{
|
|
ImGuiComboFlags_CustomPreview = 1 << 20, // enable BeginComboPreview()
|
|
};
|
|
|
|
// Extend ImGuiSliderFlags_
|
|
enum ImGuiSliderFlagsPrivate_
|
|
{
|
|
ImGuiSliderFlags_Vertical = 1 << 20, // Should this slider be orientated vertically?
|
|
ImGuiSliderFlags_ReadOnly = 1 << 21, // Consider using g.NextItemData.ItemFlags |= ImGuiItemFlags_ReadOnly instead.
|
|
};
|
|
|
|
// Extend ImGuiSelectableFlags_
|
|
enum ImGuiSelectableFlagsPrivate_
|
|
{
|
|
// NB: need to be in sync with last value of ImGuiSelectableFlags_
|
|
ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
|
|
ImGuiSelectableFlags_SelectOnNav = 1 << 21, // (WIP) Auto-select when moved into. This is not exposed in public API as to handle multi-select and modifiers we will need user to explicitly control focus scope. May be replaced with a BeginSelection() API.
|
|
ImGuiSelectableFlags_SelectOnClick = 1 << 22, // Override button behavior to react on Click (default is Click+Release)
|
|
ImGuiSelectableFlags_SelectOnRelease = 1 << 23, // Override button behavior to react on Release (default is Click+Release)
|
|
ImGuiSelectableFlags_SpanAvailWidth = 1 << 24, // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus)
|
|
ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25, // Set Nav/Focus ID on mouse hover (used by MenuItem)
|
|
ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26, // Disable padding each side with ItemSpacing * 0.5f
|
|
ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
|
};
|
|
|
|
// Extend ImGuiTreeNodeFlags_
|
|
enum ImGuiTreeNodeFlagsPrivate_
|
|
{
|
|
ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20,
|
|
ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 21,// (FIXME-WIP) Turn Down arrow into an Up arrow, but reversed trees (#6517)
|
|
};
|
|
|
|
enum ImGuiSeparatorFlags_
|
|
{
|
|
ImGuiSeparatorFlags_None = 0,
|
|
ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
|
|
ImGuiSeparatorFlags_Vertical = 1 << 1,
|
|
ImGuiSeparatorFlags_SpanAllColumns = 1 << 2, // Make separator cover all columns of a legacy Columns() set.
|
|
};
|
|
|
|
// Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags.
|
|
// FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf()
|
|
// and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in.
|
|
enum ImGuiFocusRequestFlags_
|
|
{
|
|
ImGuiFocusRequestFlags_None = 0,
|
|
ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0, // Find last focused child (if any) and focus it instead.
|
|
ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1, // Do not set focus if the window is below a modal.
|
|
};
|
|
|
|
enum ImGuiTextFlags_
|
|
{
|
|
ImGuiTextFlags_None = 0,
|
|
ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
|
|
};
|
|
|
|
enum ImGuiTooltipFlags_
|
|
{
|
|
ImGuiTooltipFlags_None = 0,
|
|
ImGuiTooltipFlags_OverridePrevious = 1 << 1, // Clear/ignore previously submitted tooltip (defaults to append)
|
|
};
|
|
|
|
// FIXME: this is in development, not exposed/functional as a generic feature yet.
|
|
// Horizontal/Vertical enums are fixed to 0/1 so they may be used to index ImVec2
|
|
enum ImGuiLayoutType_
|
|
{
|
|
ImGuiLayoutType_Horizontal = 0,
|
|
ImGuiLayoutType_Vertical = 1
|
|
};
|
|
|
|
enum ImGuiLogType
|
|
{
|
|
ImGuiLogType_None = 0,
|
|
ImGuiLogType_TTY,
|
|
ImGuiLogType_File,
|
|
ImGuiLogType_Buffer,
|
|
ImGuiLogType_Clipboard,
|
|
};
|
|
|
|
// X/Y enums are fixed to 0/1 so they may be used to index ImVec2
|
|
enum ImGuiAxis
|
|
{
|
|
ImGuiAxis_None = -1,
|
|
ImGuiAxis_X = 0,
|
|
ImGuiAxis_Y = 1
|
|
};
|
|
|
|
enum ImGuiPlotType
|
|
{
|
|
ImGuiPlotType_Lines,
|
|
ImGuiPlotType_Histogram,
|
|
};
|
|
|
|
// Stacked color modifier, backup of modified data so we can restore it
|
|
struct ImGuiColorMod
|
|
{
|
|
ImGuiCol Col;
|
|
ImVec4 BackupValue;
|
|
};
|
|
|
|
// Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
|
|
struct ImGuiStyleMod
|
|
{
|
|
ImGuiStyleVar VarIdx;
|
|
union { int BackupInt[2]; float BackupFloat[2]; };
|
|
ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; }
|
|
ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; }
|
|
ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
|
|
};
|
|
|
|
// Storage data for BeginComboPreview()/EndComboPreview()
|
|
struct IMGUI_API ImGuiComboPreviewData
|
|
{
|
|
ImRect PreviewRect;
|
|
ImVec2 BackupCursorPos;
|
|
ImVec2 BackupCursorMaxPos;
|
|
ImVec2 BackupCursorPosPrevLine;
|
|
float BackupPrevLineTextBaseOffset;
|
|
ImGuiLayoutType BackupLayout;
|
|
|
|
ImGuiComboPreviewData() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
// Stacked storage data for BeginGroup()/EndGroup()
|
|
struct IMGUI_API ImGuiGroupData
|
|
{
|
|
ImGuiID WindowID;
|
|
ImVec2 BackupCursorPos;
|
|
ImVec2 BackupCursorMaxPos;
|
|
ImVec2 BackupCursorPosPrevLine;
|
|
ImVec1 BackupIndent;
|
|
ImVec1 BackupGroupOffset;
|
|
ImVec2 BackupCurrLineSize;
|
|
float BackupCurrLineTextBaseOffset;
|
|
ImGuiID BackupActiveIdIsAlive;
|
|
bool BackupActiveIdPreviousFrameIsAlive;
|
|
bool BackupHoveredIdIsAlive;
|
|
bool BackupIsSameLine;
|
|
bool EmitItem;
|
|
};
|
|
|
|
// Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper.
|
|
struct IMGUI_API ImGuiMenuColumns
|
|
{
|
|
ImU32 TotalWidth;
|
|
ImU32 NextTotalWidth;
|
|
ImU16 Spacing;
|
|
ImU16 OffsetIcon; // Always zero for now
|
|
ImU16 OffsetLabel; // Offsets are locked in Update()
|
|
ImU16 OffsetShortcut;
|
|
ImU16 OffsetMark;
|
|
ImU16 Widths[4]; // Width of: Icon, Label, Shortcut, Mark (accumulators for current frame)
|
|
|
|
ImGuiMenuColumns() { memset(this, 0, sizeof(*this)); }
|
|
void Update(float spacing, bool window_reappearing);
|
|
float DeclColumns(float w_icon, float w_label, float w_shortcut, float w_mark);
|
|
void CalcNextTotalWidth(bool update_offsets);
|
|
};
|
|
|
|
// Internal temporary state for deactivating InputText() instances.
|
|
struct IMGUI_API ImGuiInputTextDeactivatedState
|
|
{
|
|
ImGuiID ID; // widget id owning the text state (which just got deactivated)
|
|
ImVector<char> TextA; // text buffer
|
|
|
|
ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); }
|
|
void ClearFreeMemory() { ID = 0; TextA.clear(); }
|
|
};
|
|
// Internal state of the currently focused/edited text input box
|
|
// For a given item ID, access with ImGui::GetInputTextState()
|
|
struct IMGUI_API ImGuiInputTextState
|
|
{
|
|
ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
|
|
ImGuiID ID; // widget id owning the text state
|
|
int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
|
|
ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
|
|
ImVector<char> TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
|
|
ImVector<char> InitialTextA; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
|
|
bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
|
|
int BufCapacityA; // end-user buffer capacity
|
|
float ScrollX; // horizontal scrolling/offset
|
|
ImStb::STB_TexteditState Stb; // state for stb_textedit.h
|
|
float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately
|
|
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
|
|
bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection
|
|
bool Edited; // edited this frame
|
|
ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
|
|
bool ReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version.
|
|
int ReloadSelectionStart; // POSITIONS ARE IN IMWCHAR units *NOT* UTF-8 this is why this is not exposed yet.
|
|
int ReloadSelectionEnd;
|
|
|
|
ImGuiInputTextState() { memset(this, 0, sizeof(*this)); }
|
|
void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
|
|
void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
|
|
int GetUndoAvailCount() const { return Stb.undostate.undo_point; }
|
|
int GetRedoAvailCount() const { return IMSTB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
|
|
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
|
|
|
|
// Cursor & Selection
|
|
void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
|
|
void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
|
|
bool HasSelection() const { return Stb.select_start != Stb.select_end; }
|
|
void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
|
|
int GetCursorPos() const { return Stb.cursor; }
|
|
int GetSelectionStart() const { return Stb.select_start; }
|
|
int GetSelectionEnd() const { return Stb.select_end; }
|
|
void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
|
|
|
|
// Reload user buf (WIP #2890)
|
|
// If you modify underlying user-passed const char* while active you need to call this (InputText V2 may lift this)
|
|
// strcpy(my_buf, "hello");
|
|
// if (ImGuiInputTextState* state = ImGui::GetInputTextState(id)) // id may be ImGui::GetItemID() is last item
|
|
// state->ReloadUserBufAndSelectAll();
|
|
void ReloadUserBufAndSelectAll() { ReloadUserBuf = true; ReloadSelectionStart = 0; ReloadSelectionEnd = INT_MAX; }
|
|
void ReloadUserBufAndKeepSelection() { ReloadUserBuf = true; ReloadSelectionStart = Stb.select_start; ReloadSelectionEnd = Stb.select_end; }
|
|
void ReloadUserBufAndMoveToEnd() { ReloadUserBuf = true; ReloadSelectionStart = ReloadSelectionEnd = INT_MAX; }
|
|
|
|
};
|
|
|
|
enum ImGuiWindowRefreshFlags_
|
|
{
|
|
ImGuiWindowRefreshFlags_None = 0,
|
|
ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0, // [EXPERIMENTAL] Try to keep existing contents, USER MUST NOT HONOR BEGIN() RETURNING FALSE AND NOT APPEND.
|
|
ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1, // [EXPERIMENTAL] Always refresh on hover
|
|
ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2, // [EXPERIMENTAL] Always refresh on focus
|
|
// Refresh policy/frequency, Load Balancing etc.
|
|
};
|
|
|
|
enum ImGuiNextWindowDataFlags_
|
|
{
|
|
ImGuiNextWindowDataFlags_None = 0,
|
|
ImGuiNextWindowDataFlags_HasPos = 1 << 0,
|
|
ImGuiNextWindowDataFlags_HasSize = 1 << 1,
|
|
ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
|
|
ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
|
|
ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
|
|
ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
|
|
ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
|
|
ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
|
|
ImGuiNextWindowDataFlags_HasChildFlags = 1 << 8,
|
|
ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 9,
|
|
ImGuiNextWindowDataFlags_HasViewport = 1 << 10,
|
|
ImGuiNextWindowDataFlags_HasDock = 1 << 11,
|
|
ImGuiNextWindowDataFlags_HasWindowClass = 1 << 12,
|
|
};
|
|
|
|
// Storage for SetNexWindow** functions
|
|
struct ImGuiNextWindowData
|
|
{
|
|
ImGuiNextWindowDataFlags Flags;
|
|
ImGuiCond PosCond;
|
|
ImGuiCond SizeCond;
|
|
ImGuiCond CollapsedCond;
|
|
ImGuiCond DockCond;
|
|
ImVec2 PosVal;
|
|
ImVec2 PosPivotVal;
|
|
ImVec2 SizeVal;
|
|
ImVec2 ContentSizeVal;
|
|
ImVec2 ScrollVal;
|
|
ImGuiChildFlags ChildFlags;
|
|
bool PosUndock;
|
|
bool CollapsedVal;
|
|
ImRect SizeConstraintRect;
|
|
ImGuiSizeCallback SizeCallback;
|
|
void* SizeCallbackUserData;
|
|
float BgAlphaVal; // Override background alpha
|
|
ImGuiID ViewportId;
|
|
ImGuiID DockId;
|
|
ImGuiWindowClass WindowClass;
|
|
ImVec2 MenuBarOffsetMinVal; // (Always on) This is not exposed publicly, so we don't clear it and it doesn't have a corresponding flag (could we? for consistency?)
|
|
ImGuiWindowRefreshFlags RefreshFlagsVal;
|
|
|
|
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
|
|
inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
|
|
};
|
|
|
|
// Multi-Selection item index or identifier when using SetNextItemSelectionUserData()/BeginMultiSelect()
|
|
// (Most users are likely to use this store an item INDEX but this may be used to store a POINTER as well.)
|
|
typedef ImS64 ImGuiSelectionUserData;
|
|
|
|
enum ImGuiNextItemDataFlags_
|
|
{
|
|
ImGuiNextItemDataFlags_None = 0,
|
|
ImGuiNextItemDataFlags_HasWidth = 1 << 0,
|
|
ImGuiNextItemDataFlags_HasOpen = 1 << 1,
|
|
ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
|
|
};
|
|
|
|
struct ImGuiNextItemData
|
|
{
|
|
ImGuiNextItemDataFlags Flags;
|
|
ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap.
|
|
// Non-flags members are NOT cleared by ItemAdd() meaning they are still valid during NavProcessItem()
|
|
ImGuiSelectionUserData SelectionUserData; // Set by SetNextItemSelectionUserData() (note that NULL/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values)
|
|
float Width; // Set by SetNextItemWidth()
|
|
ImGuiKeyChord Shortcut; // Set by SetNextItemShortcut()
|
|
ImGuiInputFlags ShortcutFlags; // Set by SetNextItemShortcut()
|
|
bool OpenVal; // Set by SetNextItemOpen()
|
|
ImGuiCond OpenCond : 8;
|
|
|
|
ImGuiNextItemData() { memset(this, 0, sizeof(*this)); SelectionUserData = -1; }
|
|
inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
|
|
};
|
|
|
|
// Status storage for the last submitted item
|
|
struct ImGuiLastItemData
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiItemFlags InFlags; // See ImGuiItemFlags_
|
|
ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_
|
|
ImRect Rect; // Full rectangle
|
|
ImRect NavRect; // Navigation scoring rectangle (not displayed)
|
|
// Rarely used fields are not explicitly cleared, only valid when the corresponding ImGuiItemStatusFlags ar set.
|
|
ImRect DisplayRect; // Display rectangle. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) is set.
|
|
ImRect ClipRect; // Clip rectangle at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasClipRect) is set..
|
|
ImGuiKeyChord Shortcut; // Shortcut at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasShortcut) is set..
|
|
|
|
ImGuiLastItemData() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
// Store data emitted by TreeNode() for usage by TreePop() to implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere.
|
|
// This is the minimum amount of data that we need to perform the equivalent of NavApplyItemToResult() and which we can't infer in TreePop()
|
|
// Only stored when the node is a potential candidate for landing on a Left arrow jump.
|
|
struct ImGuiNavTreeNodeData
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiItemFlags InFlags;
|
|
ImRect NavRect;
|
|
};
|
|
|
|
struct IMGUI_API ImGuiStackSizes
|
|
{
|
|
short SizeOfIDStack;
|
|
short SizeOfColorStack;
|
|
short SizeOfStyleVarStack;
|
|
short SizeOfFontStack;
|
|
short SizeOfFocusScopeStack;
|
|
short SizeOfGroupStack;
|
|
short SizeOfItemFlagsStack;
|
|
short SizeOfBeginPopupStack;
|
|
short SizeOfDisabledStack;
|
|
|
|
ImGuiStackSizes() { memset(this, 0, sizeof(*this)); }
|
|
void SetToContextState(ImGuiContext* ctx);
|
|
void CompareWithContextState(ImGuiContext* ctx);
|
|
};
|
|
|
|
// Data saved for each window pushed into the stack
|
|
struct ImGuiWindowStackData
|
|
{
|
|
ImGuiWindow* Window;
|
|
ImGuiLastItemData ParentLastItemDataBackup;
|
|
ImGuiStackSizes StackSizesOnBegin; // Store size of various stacks for asserting
|
|
};
|
|
|
|
struct ImGuiShrinkWidthItem
|
|
{
|
|
int Index;
|
|
float Width;
|
|
float InitialWidth;
|
|
};
|
|
|
|
struct ImGuiPtrOrIndex
|
|
{
|
|
void* Ptr; // Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool.
|
|
int Index; // Usually index in a main pool.
|
|
|
|
ImGuiPtrOrIndex(void* ptr) { Ptr = ptr; Index = -1; }
|
|
ImGuiPtrOrIndex(int index) { Ptr = NULL; Index = index; }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Data types support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
struct ImGuiDataVarInfo
|
|
{
|
|
ImGuiDataType Type;
|
|
ImU32 Count; // 1+
|
|
ImU32 Offset; // Offset in parent structure
|
|
void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); }
|
|
};
|
|
|
|
struct ImGuiDataTypeTempStorage
|
|
{
|
|
ImU8 Data[8]; // Can fit any data up to ImGuiDataType_COUNT
|
|
};
|
|
|
|
// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
|
|
struct ImGuiDataTypeInfo
|
|
{
|
|
size_t Size; // Size in bytes
|
|
const char* Name; // Short descriptive name for the type, for debugging
|
|
const char* PrintFmt; // Default printf format for the type
|
|
const char* ScanFmt; // Default scanf format for the type
|
|
};
|
|
|
|
// Extend ImGuiDataType_
|
|
enum ImGuiDataTypePrivate_
|
|
{
|
|
ImGuiDataType_String = ImGuiDataType_COUNT + 1,
|
|
ImGuiDataType_Pointer,
|
|
ImGuiDataType_ID,
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Popup support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
enum ImGuiPopupPositionPolicy
|
|
{
|
|
ImGuiPopupPositionPolicy_Default,
|
|
ImGuiPopupPositionPolicy_ComboBox,
|
|
ImGuiPopupPositionPolicy_Tooltip,
|
|
};
|
|
|
|
// Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack)
|
|
struct ImGuiPopupData
|
|
{
|
|
ImGuiID PopupId; // Set on OpenPopup()
|
|
ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
|
|
ImGuiWindow* RestoreNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close
|
|
int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
|
|
int OpenFrameCount; // Set on OpenPopup()
|
|
ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
|
|
ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
|
|
ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup
|
|
|
|
ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Inputs support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Bit array for named keys
|
|
typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitArrayForNamedKeys;
|
|
|
|
// [Internal] Key ranges
|
|
#define ImGuiKey_LegacyNativeKey_BEGIN 0
|
|
#define ImGuiKey_LegacyNativeKey_END 512
|
|
#define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
|
|
#define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
|
|
#define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
|
|
#define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
|
|
#define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
|
|
#define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
|
|
#define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
|
|
#define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
|
|
|
|
// [Internal] Named shortcuts for Navigation
|
|
#define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
|
|
#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
|
|
#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
|
|
#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
|
|
#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
|
|
#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
|
|
#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
|
|
#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
|
|
|
|
enum ImGuiInputEventType
|
|
{
|
|
ImGuiInputEventType_None = 0,
|
|
ImGuiInputEventType_MousePos,
|
|
ImGuiInputEventType_MouseWheel,
|
|
ImGuiInputEventType_MouseButton,
|
|
ImGuiInputEventType_MouseViewport,
|
|
ImGuiInputEventType_Key,
|
|
ImGuiInputEventType_Text,
|
|
ImGuiInputEventType_Focus,
|
|
ImGuiInputEventType_COUNT
|
|
};
|
|
|
|
enum ImGuiInputSource
|
|
{
|
|
ImGuiInputSource_None = 0,
|
|
ImGuiInputSource_Mouse, // Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them.
|
|
ImGuiInputSource_Keyboard,
|
|
ImGuiInputSource_Gamepad,
|
|
ImGuiInputSource_COUNT
|
|
};
|
|
|
|
// FIXME: Structures in the union below need to be declared as anonymous unions appears to be an extension?
|
|
// Using ImVec2() would fail on Clang 'union member 'MousePos' has a non-trivial default constructor'
|
|
struct ImGuiInputEventMousePos { float PosX, PosY; ImGuiMouseSource MouseSource; };
|
|
struct ImGuiInputEventMouseWheel { float WheelX, WheelY; ImGuiMouseSource MouseSource; };
|
|
struct ImGuiInputEventMouseButton { int Button; bool Down; ImGuiMouseSource MouseSource; };
|
|
struct ImGuiInputEventMouseViewport { ImGuiID HoveredViewportID; };
|
|
struct ImGuiInputEventKey { ImGuiKey Key; bool Down; float AnalogValue; };
|
|
struct ImGuiInputEventText { unsigned int Char; };
|
|
struct ImGuiInputEventAppFocused { bool Focused; };
|
|
|
|
struct ImGuiInputEvent
|
|
{
|
|
ImGuiInputEventType Type;
|
|
ImGuiInputSource Source;
|
|
ImU32 EventId; // Unique, sequential increasing integer to identify an event (if you need to correlate them to other data).
|
|
union
|
|
{
|
|
ImGuiInputEventMousePos MousePos; // if Type == ImGuiInputEventType_MousePos
|
|
ImGuiInputEventMouseWheel MouseWheel; // if Type == ImGuiInputEventType_MouseWheel
|
|
ImGuiInputEventMouseButton MouseButton; // if Type == ImGuiInputEventType_MouseButton
|
|
ImGuiInputEventMouseViewport MouseViewport; // if Type == ImGuiInputEventType_MouseViewport
|
|
ImGuiInputEventKey Key; // if Type == ImGuiInputEventType_Key
|
|
ImGuiInputEventText Text; // if Type == ImGuiInputEventType_Text
|
|
ImGuiInputEventAppFocused AppFocused; // if Type == ImGuiInputEventType_Focus
|
|
};
|
|
bool AddedByTestEngine;
|
|
|
|
ImGuiInputEvent() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
// Input function taking an 'ImGuiID owner_id' argument defaults to (ImGuiKeyOwner_Any == 0) aka don't test ownership, which matches legacy behavior.
|
|
#define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
|
|
#define ImGuiKeyOwner_NoOwner ((ImGuiID)-1) // Require key to have no owner.
|
|
//#define ImGuiKeyOwner_None ImGuiKeyOwner_NoOwner // We previously called this 'ImGuiKeyOwner_None' but it was inconsistent with our pattern that _None values == 0 and quite dangerous. Also using _NoOwner makes the IsKeyPressed() calls more explicit.
|
|
|
|
typedef ImS16 ImGuiKeyRoutingIndex;
|
|
|
|
// Routing table entry (sizeof() == 16 bytes)
|
|
struct ImGuiKeyRoutingData
|
|
{
|
|
ImGuiKeyRoutingIndex NextEntryIndex;
|
|
ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits.
|
|
ImU8 RoutingCurrScore; // [DEBUG] For debug display
|
|
ImU8 RoutingNextScore; // Lower is better (0: perfect score)
|
|
ImGuiID RoutingCurr;
|
|
ImGuiID RoutingNext;
|
|
|
|
ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
|
|
};
|
|
|
|
// Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching.
|
|
// Stored in main context (1 instance)
|
|
struct ImGuiKeyRoutingTable
|
|
{
|
|
ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT]; // Index of first entry in Entries[]
|
|
ImVector<ImGuiKeyRoutingData> Entries;
|
|
ImVector<ImGuiKeyRoutingData> EntriesNext; // Double-buffer to avoid reallocation (could use a shared buffer)
|
|
|
|
ImGuiKeyRoutingTable() { Clear(); }
|
|
void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
|
|
};
|
|
|
|
// This extends ImGuiKeyData but only for named keys (legacy keys don't support the new features)
|
|
// Stored in main context (1 per named key). In the future it might be merged into ImGuiKeyData.
|
|
struct ImGuiKeyOwnerData
|
|
{
|
|
ImGuiID OwnerCurr;
|
|
ImGuiID OwnerNext;
|
|
bool LockThisFrame; // Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame.
|
|
bool LockUntilRelease; // Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is true LockThisFrame is always true as well.
|
|
|
|
ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease = false; }
|
|
};
|
|
|
|
// Extend ImGuiInputFlags_
|
|
// Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
|
|
// Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)
|
|
enum ImGuiInputFlagsPrivate_
|
|
{
|
|
// Flags for IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(), Shortcut()
|
|
// - Repeat mode: Repeat rate selection
|
|
ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
|
|
ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast
|
|
ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster
|
|
// - Repeat mode: Specify when repeating key pressed can be interrupted.
|
|
// - In theory ImGuiInputFlags_RepeatUntilOtherKeyPress may be a desirable default, but it would break too many behavior so everything is opt-in.
|
|
ImGuiInputFlags_RepeatUntilRelease = 1 << 4, // Stop repeating when released (default for all functions except Shortcut). This only exists to allow overriding Shortcut() default behavior.
|
|
ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5, // Stop repeating when released OR if keyboard mods are changed (default for Shortcut)
|
|
ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6, // Stop repeating when released OR if keyboard mods are leaving the None state. Allows going from Mod+Key to Key by releasing Mod.
|
|
ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7, // Stop repeating when released OR if any other keyboard key is pressed during the repeat
|
|
|
|
// Flags for SetKeyOwner(), SetItemKeyOwner()
|
|
// - Locking key away from non-input aware code. Locking is useful to make input-owner-aware code steal keys from non-input-owner-aware code. If all code is input-owner-aware locking would never be necessary.
|
|
ImGuiInputFlags_LockThisFrame = 1 << 20, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame.
|
|
ImGuiInputFlags_LockUntilRelease = 1 << 21, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released.
|
|
|
|
// - Condition for SetItemKeyOwner()
|
|
ImGuiInputFlags_CondHovered = 1 << 22, // Only set if item is hovered (default to both)
|
|
ImGuiInputFlags_CondActive = 1 << 23, // Only set if item is active (default to both)
|
|
ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
|
|
|
|
// [Internal] Mask of which function support which flags
|
|
ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
|
|
ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
|
|
ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
|
|
ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
|
|
ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
|
|
ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
|
|
ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
|
|
ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
|
|
ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
|
|
ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
|
|
ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
|
|
ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Clipper support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Note that Max is exclusive, so perhaps should be using a Begin/End convention.
|
|
struct ImGuiListClipperRange
|
|
{
|
|
int Min;
|
|
int Max;
|
|
bool PosToIndexConvert; // Begin/End are absolute position (will be converted to indices later)
|
|
ImS8 PosToIndexOffsetMin; // Add to Min after converting to indices
|
|
ImS8 PosToIndexOffsetMax; // Add to Min after converting to indices
|
|
|
|
static ImGuiListClipperRange FromIndices(int min, int max) { ImGuiListClipperRange r = { min, max, false, 0, 0 }; return r; }
|
|
static ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max) { ImGuiListClipperRange r = { (int)y1, (int)y2, true, (ImS8)off_min, (ImS8)off_max }; return r; }
|
|
};
|
|
|
|
// Temporary clipper data, buffers shared/reused between instances
|
|
struct ImGuiListClipperData
|
|
{
|
|
ImGuiListClipper* ListClipper;
|
|
float LossynessOffset;
|
|
int StepNo;
|
|
int ItemsFrozen;
|
|
ImVector<ImGuiListClipperRange> Ranges;
|
|
|
|
ImGuiListClipperData() { memset(this, 0, sizeof(*this)); }
|
|
void Reset(ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Navigation support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
enum ImGuiActivateFlags_
|
|
{
|
|
ImGuiActivateFlags_None = 0,
|
|
ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key.
|
|
ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used.
|
|
ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
|
|
ImGuiActivateFlags_FromTabbing = 1 << 3, // Activation requested by a tabbing request
|
|
ImGuiActivateFlags_FromShortcut = 1 << 4, // Activation requested by an item shortcut via SetNextItemShortcut() function.
|
|
};
|
|
|
|
// Early work-in-progress API for ScrollToItem()
|
|
enum ImGuiScrollFlags_
|
|
{
|
|
ImGuiScrollFlags_None = 0,
|
|
ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0, // If item is not visible: scroll as little as possible on X axis to bring item back into view [default for X axis]
|
|
ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1, // If item is not visible: scroll as little as possible on Y axis to bring item back into view [default for Y axis for windows that are already visible]
|
|
ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2, // If item is not visible: scroll to make the item centered on X axis [rarely used]
|
|
ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3, // If item is not visible: scroll to make the item centered on Y axis
|
|
ImGuiScrollFlags_AlwaysCenterX = 1 << 4, // Always center the result item on X axis [rarely used]
|
|
ImGuiScrollFlags_AlwaysCenterY = 1 << 5, // Always center the result item on Y axis [default for Y axis for appearing window)
|
|
ImGuiScrollFlags_NoScrollParent = 1 << 6, // Disable forwarding scrolling to parent window if required to keep item/rect visible (only scroll window the function was applied to).
|
|
ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
|
|
ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
|
|
};
|
|
|
|
enum ImGuiNavHighlightFlags_
|
|
{
|
|
ImGuiNavHighlightFlags_None = 0,
|
|
ImGuiNavHighlightFlags_Compact = 1 << 1, // Compact highlight, no padding
|
|
ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
|
|
ImGuiNavHighlightFlags_NoRounding = 1 << 3,
|
|
};
|
|
|
|
enum ImGuiNavMoveFlags_
|
|
{
|
|
ImGuiNavMoveFlags_None = 0,
|
|
ImGuiNavMoveFlags_LoopX = 1 << 0, // On failed request, restart from opposite side
|
|
ImGuiNavMoveFlags_LoopY = 1 << 1,
|
|
ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
|
|
ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful but provided for completeness
|
|
ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
|
|
ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place)
|
|
ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown)
|
|
ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary
|
|
ImGuiNavMoveFlags_Forwarded = 1 << 7,
|
|
ImGuiNavMoveFlags_DebugNoResult = 1 << 8, // Dummy scoring for debug purpose, don't apply result
|
|
ImGuiNavMoveFlags_FocusApi = 1 << 9, // Requests from focus API can land/focus/activate items even if they are marked with _NoTabStop (see NavProcessItemForTabbingRequest() for details)
|
|
ImGuiNavMoveFlags_IsTabbing = 1 << 10, // == Focus + Activate if item is Inputable + DontChangeNavHighlight
|
|
ImGuiNavMoveFlags_IsPageMove = 1 << 11, // Identify a PageDown/PageUp request.
|
|
ImGuiNavMoveFlags_Activate = 1 << 12, // Activate/select target item.
|
|
ImGuiNavMoveFlags_NoSelect = 1 << 13, // Don't trigger selection by not setting g.NavJustMovedTo
|
|
ImGuiNavMoveFlags_NoSetNavHighlight = 1 << 14, // Do not alter the visible state of keyboard vs mouse nav highlight
|
|
ImGuiNavMoveFlags_NoClearActiveId = 1 << 15, // (Experimental) Do not clear active id when applying move result
|
|
};
|
|
|
|
enum ImGuiNavLayer
|
|
{
|
|
ImGuiNavLayer_Main = 0, // Main scrolling layer
|
|
ImGuiNavLayer_Menu = 1, // Menu layer (access with Alt)
|
|
ImGuiNavLayer_COUNT
|
|
};
|
|
|
|
struct ImGuiNavItemData
|
|
{
|
|
ImGuiWindow* Window; // Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window)
|
|
ImGuiID ID; // Init,Move // Best candidate item ID
|
|
ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID
|
|
ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space
|
|
ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags
|
|
float DistBox; // Move // Best candidate box distance to current NavId
|
|
float DistCenter; // Move // Best candidate center distance to current NavId
|
|
float DistAxial; // Move // Best candidate axial distance to current NavId
|
|
ImGuiSelectionUserData SelectionUserData;//I+Mov // Best candidate SetNextItemSelectionData() value.
|
|
|
|
ImGuiNavItemData() { Clear(); }
|
|
void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
|
};
|
|
|
|
struct ImGuiFocusScopeData
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiID WindowID;
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Typing-select support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Flags for GetTypingSelectRequest()
|
|
enum ImGuiTypingSelectFlags_
|
|
{
|
|
ImGuiTypingSelectFlags_None = 0,
|
|
ImGuiTypingSelectFlags_AllowBackspace = 1 << 0, // Backspace to delete character inputs. If using: ensure GetTypingSelectRequest() is not called more than once per frame (filter by e.g. focus state)
|
|
ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1, // Allow "single char" search mode which is activated when pressing the same character multiple times.
|
|
};
|
|
|
|
// Returned by GetTypingSelectRequest(), designed to eventually be public.
|
|
struct IMGUI_API ImGuiTypingSelectRequest
|
|
{
|
|
ImGuiTypingSelectFlags Flags; // Flags passed to GetTypingSelectRequest()
|
|
int SearchBufferLen;
|
|
const char* SearchBuffer; // Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize).
|
|
bool SelectRequest; // Set when buffer was modified this frame, requesting a selection.
|
|
bool SingleCharMode; // Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication.
|
|
ImS8 SingleCharSize; // Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input.
|
|
};
|
|
|
|
// Storage for GetTypingSelectRequest()
|
|
struct IMGUI_API ImGuiTypingSelectState
|
|
{
|
|
ImGuiTypingSelectRequest Request; // User-facing data
|
|
char SearchBuffer[64]; // Search buffer: no need to make dynamic as this search is very transient.
|
|
ImGuiID FocusScope;
|
|
int LastRequestFrame = 0;
|
|
float LastRequestTime = 0.0f;
|
|
bool SingleCharModeLock = false; // After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing.
|
|
|
|
ImGuiTypingSelectState() { memset(this, 0, sizeof(*this)); }
|
|
void Clear() { SearchBuffer[0] = 0; SingleCharModeLock = false; } // We preserve remaining data for easier debugging
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Columns support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Flags for internal's BeginColumns(). This is an obsolete API. Prefer using BeginTable() nowadays!
|
|
enum ImGuiOldColumnFlags_
|
|
{
|
|
ImGuiOldColumnFlags_None = 0,
|
|
ImGuiOldColumnFlags_NoBorder = 1 << 0, // Disable column dividers
|
|
ImGuiOldColumnFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers
|
|
ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns
|
|
ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window
|
|
ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
|
|
|
|
// Obsolete names (will be removed)
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
//ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
|
|
//ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
|
|
//ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
|
|
//ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
|
|
//ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
|
|
//ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
|
|
#endif
|
|
};
|
|
|
|
struct ImGuiOldColumnData
|
|
{
|
|
float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
|
|
float OffsetNormBeforeResize;
|
|
ImGuiOldColumnFlags Flags; // Not exposed
|
|
ImRect ClipRect;
|
|
|
|
ImGuiOldColumnData() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
struct ImGuiOldColumns
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiOldColumnFlags Flags;
|
|
bool IsFirstFrame;
|
|
bool IsBeingResized;
|
|
int Current;
|
|
int Count;
|
|
float OffMinX, OffMaxX; // Offsets from HostWorkRect.Min.x
|
|
float LineMinY, LineMaxY;
|
|
float HostCursorPosY; // Backup of CursorPos at the time of BeginColumns()
|
|
float HostCursorMaxPosX; // Backup of CursorMaxPos at the time of BeginColumns()
|
|
ImRect HostInitialClipRect; // Backup of ClipRect at the time of BeginColumns()
|
|
ImRect HostBackupClipRect; // Backup of ClipRect during PushColumnsBackground()/PopColumnsBackground()
|
|
ImRect HostBackupParentWorkRect;//Backup of WorkRect at the time of BeginColumns()
|
|
ImVector<ImGuiOldColumnData> Columns;
|
|
ImDrawListSplitter Splitter;
|
|
|
|
ImGuiOldColumns() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Multi-select support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// We always assume that -1 is an invalid value (which works for indices and pointers)
|
|
#define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1)
|
|
|
|
#ifdef IMGUI_HAS_MULTI_SELECT
|
|
// <this is filled in 'range_select' branch>
|
|
#endif // #ifdef IMGUI_HAS_MULTI_SELECT
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Docking support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#define DOCKING_HOST_DRAW_CHANNEL_BG 0 // Dock host: background fill
|
|
#define DOCKING_HOST_DRAW_CHANNEL_FG 1 // Dock host: decorations and contents
|
|
|
|
#ifdef IMGUI_HAS_DOCK
|
|
|
|
// Extend ImGuiDockNodeFlags_
|
|
enum ImGuiDockNodeFlagsPrivate_
|
|
{
|
|
// [Internal]
|
|
ImGuiDockNodeFlags_DockSpace = 1 << 10, // Saved // A dockspace is a node that occupy space within an existing user window. Otherwise the node is floating and create its own window.
|
|
ImGuiDockNodeFlags_CentralNode = 1 << 11, // Saved // The central node has 2 main properties: stay visible when empty, only use "remaining" spaces from its neighbor.
|
|
ImGuiDockNodeFlags_NoTabBar = 1 << 12, // Saved // Tab bar is completely unavailable. No triangle in the corner to enable it back.
|
|
ImGuiDockNodeFlags_HiddenTabBar = 1 << 13, // Saved // Tab bar is hidden, with a triangle in the corner to show it again (NB: actual tab-bar instance may be destroyed as this is only used for single-window tab bar)
|
|
ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14, // Saved // Disable window/docking menu (that one that appears instead of the collapse button)
|
|
ImGuiDockNodeFlags_NoCloseButton = 1 << 15, // Saved // Disable close button
|
|
ImGuiDockNodeFlags_NoResizeX = 1 << 16, // //
|
|
ImGuiDockNodeFlags_NoResizeY = 1 << 17, // //
|
|
ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18, // // Any docked window will be automatically be focus-route chained (window->ParentWindowForFocusRoute set to this) so Shortcut() in this window can run when any docked window is focused.
|
|
// Disable docking/undocking actions in this dockspace or individual node (existing docked nodes will be preserved)
|
|
// Those are not exposed in public because the desirable sharing/inheriting/copy-flag-on-split behaviors are quite difficult to design and understand.
|
|
// The two public flags ImGuiDockNodeFlags_NoDockingOverCentralNode/ImGuiDockNodeFlags_NoDockingSplit don't have those issues.
|
|
ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 19, // // Disable this node from splitting other windows/nodes.
|
|
ImGuiDockNodeFlags_NoDockingOverMe = 1 << 20, // // Disable other windows/nodes from being docked over this node.
|
|
ImGuiDockNodeFlags_NoDockingOverOther = 1 << 21, // // Disable this node from being docked over another window or non-empty node.
|
|
ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 22, // // Disable this node from being docked over an empty node (e.g. DockSpace with no other windows)
|
|
ImGuiDockNodeFlags_NoDocking = ImGuiDockNodeFlags_NoDockingOverMe | ImGuiDockNodeFlags_NoDockingOverOther | ImGuiDockNodeFlags_NoDockingOverEmpty | ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoDockingSplitOther,
|
|
// Masks
|
|
ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0,
|
|
ImGuiDockNodeFlags_NoResizeFlagsMask_ = ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeY,
|
|
// When splitting, those local flags are moved to the inheriting child, never duplicated
|
|
ImGuiDockNodeFlags_LocalFlagsTransferMask_ = ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
|
|
ImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
|
|
};
|
|
|
|
// Store the source authority (dock node vs window) of a field
|
|
enum ImGuiDataAuthority_
|
|
{
|
|
ImGuiDataAuthority_Auto,
|
|
ImGuiDataAuthority_DockNode,
|
|
ImGuiDataAuthority_Window,
|
|
};
|
|
|
|
enum ImGuiDockNodeState
|
|
{
|
|
ImGuiDockNodeState_Unknown,
|
|
ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow,
|
|
ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing,
|
|
ImGuiDockNodeState_HostWindowVisible,
|
|
};
|
|
|
|
// sizeof() 156~192
|
|
struct IMGUI_API ImGuiDockNode
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiDockNodeFlags SharedFlags; // (Write) Flags shared by all nodes of a same dockspace hierarchy (inherited from the root node)
|
|
ImGuiDockNodeFlags LocalFlags; // (Write) Flags specific to this node
|
|
ImGuiDockNodeFlags LocalFlagsInWindows; // (Write) Flags specific to this node, applied from windows
|
|
ImGuiDockNodeFlags MergedFlags; // (Read) Effective flags (== SharedFlags | LocalFlagsInNode | LocalFlagsInWindows)
|
|
ImGuiDockNodeState State;
|
|
ImGuiDockNode* ParentNode;
|
|
ImGuiDockNode* ChildNodes[2]; // [Split node only] Child nodes (left/right or top/bottom). Consider switching to an array.
|
|
ImVector<ImGuiWindow*> Windows; // Note: unordered list! Iterate TabBar->Tabs for user-order.
|
|
ImGuiTabBar* TabBar;
|
|
ImVec2 Pos; // Current position
|
|
ImVec2 Size; // Current size
|
|
ImVec2 SizeRef; // [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
|
|
ImGuiAxis SplitAxis; // [Split node only] Split axis (X or Y)
|
|
ImGuiWindowClass WindowClass; // [Root node only]
|
|
ImU32 LastBgColor;
|
|
|
|
ImGuiWindow* HostWindow;
|
|
ImGuiWindow* VisibleWindow; // Generally point to window which is ID is == SelectedTabID, but when CTRL+Tabbing this can be a different window.
|
|
ImGuiDockNode* CentralNode; // [Root node only] Pointer to central node.
|
|
ImGuiDockNode* OnlyNodeWithWindows; // [Root node only] Set when there is a single visible node within the hierarchy.
|
|
int CountNodeWithWindows; // [Root node only]
|
|
int LastFrameAlive; // Last frame number the node was updated or kept alive explicitly with DockSpace() + ImGuiDockNodeFlags_KeepAliveOnly
|
|
int LastFrameActive; // Last frame number the node was updated.
|
|
int LastFrameFocused; // Last frame number the node was focused.
|
|
ImGuiID LastFocusedNodeId; // [Root node only] Which of our child docking node (any ancestor in the hierarchy) was last focused.
|
|
ImGuiID SelectedTabId; // [Leaf node only] Which of our tab/window is selected.
|
|
ImGuiID WantCloseTabId; // [Leaf node only] Set when closing a specific tab/window.
|
|
ImGuiID RefViewportId; // Reference viewport ID from visible window when HostWindow == NULL.
|
|
ImGuiDataAuthority AuthorityForPos :3;
|
|
ImGuiDataAuthority AuthorityForSize :3;
|
|
ImGuiDataAuthority AuthorityForViewport :3;
|
|
bool IsVisible :1; // Set to false when the node is hidden (usually disabled as it has no active window)
|
|
bool IsFocused :1;
|
|
bool IsBgDrawnThisFrame :1;
|
|
bool HasCloseButton :1; // Provide space for a close button (if any of the docked window has one). Note that button may be hidden on window without one.
|
|
bool HasWindowMenuButton :1;
|
|
bool HasCentralNodeChild :1;
|
|
bool WantCloseAll :1; // Set when closing all tabs at once.
|
|
bool WantLockSizeOnce :1;
|
|
bool WantMouseMove :1; // After a node extraction we need to transition toward moving the newly created host window
|
|
bool WantHiddenTabBarUpdate :1;
|
|
bool WantHiddenTabBarToggle :1;
|
|
|
|
ImGuiDockNode(ImGuiID id);
|
|
~ImGuiDockNode();
|
|
bool IsRootNode() const { return ParentNode == NULL; }
|
|
bool IsDockSpace() const { return (MergedFlags & ImGuiDockNodeFlags_DockSpace) != 0; }
|
|
bool IsFloatingNode() const { return ParentNode == NULL && (MergedFlags & ImGuiDockNodeFlags_DockSpace) == 0; }
|
|
bool IsCentralNode() const { return (MergedFlags & ImGuiDockNodeFlags_CentralNode) != 0; }
|
|
bool IsHiddenTabBar() const { return (MergedFlags & ImGuiDockNodeFlags_HiddenTabBar) != 0; } // Hidden tab bar can be shown back by clicking the small triangle
|
|
bool IsNoTabBar() const { return (MergedFlags & ImGuiDockNodeFlags_NoTabBar) != 0; } // Never show a tab bar
|
|
bool IsSplitNode() const { return ChildNodes[0] != NULL; }
|
|
bool IsLeafNode() const { return ChildNodes[0] == NULL; }
|
|
bool IsEmpty() const { return ChildNodes[0] == NULL && Windows.Size == 0; }
|
|
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
|
|
|
void SetLocalFlags(ImGuiDockNodeFlags flags) { LocalFlags = flags; UpdateMergedFlags(); }
|
|
void UpdateMergedFlags() { MergedFlags = SharedFlags | LocalFlags | LocalFlagsInWindows; }
|
|
};
|
|
|
|
// List of colors that are stored at the time of Begin() into Docked Windows.
|
|
// We currently store the packed colors in a simple array window->DockStyle.Colors[].
|
|
// A better solution may involve appending into a log of colors in ImGuiContext + store offsets into those arrays in ImGuiWindow,
|
|
// but it would be more complex as we'd need to double-buffer both as e.g. drop target may refer to window from last frame.
|
|
enum ImGuiWindowDockStyleCol
|
|
{
|
|
ImGuiWindowDockStyleCol_Text,
|
|
ImGuiWindowDockStyleCol_Tab,
|
|
ImGuiWindowDockStyleCol_TabHovered,
|
|
ImGuiWindowDockStyleCol_TabActive,
|
|
ImGuiWindowDockStyleCol_TabUnfocused,
|
|
ImGuiWindowDockStyleCol_TabUnfocusedActive,
|
|
ImGuiWindowDockStyleCol_COUNT
|
|
};
|
|
|
|
// We don't store style.Alpha: dock_node->LastBgColor embeds it and otherwise it would only affect the docking tab, which intuitively I would say we don't want to.
|
|
struct ImGuiWindowDockStyle
|
|
{
|
|
ImU32 Colors[ImGuiWindowDockStyleCol_COUNT];
|
|
};
|
|
|
|
struct ImGuiDockContext
|
|
{
|
|
ImGuiStorage Nodes; // Map ID -> ImGuiDockNode*: Active nodes
|
|
ImVector<ImGuiDockRequest> Requests;
|
|
ImVector<ImGuiDockNodeSettings> NodesSettings;
|
|
bool WantFullRebuild;
|
|
ImGuiDockContext() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
#endif // #ifdef IMGUI_HAS_DOCK
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Viewport support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
|
|
// Every instance of ImGuiViewport is in fact a ImGuiViewportP.
|
|
struct ImGuiViewportP : public ImGuiViewport
|
|
{
|
|
ImGuiWindow* Window; // Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
|
|
int Idx;
|
|
int LastFrameActive; // Last frame number this viewport was activated by a window
|
|
int LastFocusedStampCount; // Last stamp number from when a window hosted by this viewport was focused (by comparing this value between two viewport we have an implicit viewport z-order we use as fallback)
|
|
ImGuiID LastNameHash;
|
|
ImVec2 LastPos;
|
|
float Alpha; // Window opacity (when dragging dockable windows/viewports we make them transparent)
|
|
float LastAlpha;
|
|
bool LastFocusedHadNavWindow;// Instead of maintaining a LastFocusedWindow (which may harder to correctly maintain), we merely store weither NavWindow != NULL last time the viewport was focused.
|
|
short PlatformMonitor;
|
|
int BgFgDrawListsLastFrame[2]; // Last frame number the background (0) and foreground (1) draw lists were used
|
|
ImDrawList* BgFgDrawLists[2]; // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
|
|
ImDrawData DrawDataP;
|
|
ImDrawDataBuilder DrawDataBuilder; // Temporary data while building final ImDrawData
|
|
ImVec2 LastPlatformPos;
|
|
ImVec2 LastPlatformSize;
|
|
ImVec2 LastRendererSize;
|
|
ImVec2 WorkOffsetMin; // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
|
|
ImVec2 WorkOffsetMax; // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
|
|
ImVec2 BuildWorkOffsetMin; // Work Area: Offset being built during current frame. Generally >= 0.0f.
|
|
ImVec2 BuildWorkOffsetMax; // Work Area: Offset being built during current frame. Generally <= 0.0f.
|
|
|
|
ImGuiViewportP() { Window = NULL; Idx = -1; LastFrameActive = BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = LastFocusedStampCount = -1; LastNameHash = 0; Alpha = LastAlpha = 1.0f; LastFocusedHadNavWindow = false; PlatformMonitor = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; LastPlatformPos = LastPlatformSize = LastRendererSize = ImVec2(FLT_MAX, FLT_MAX); }
|
|
~ImGuiViewportP() { if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]); if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
|
|
void ClearRequestFlags() { PlatformRequestClose = PlatformRequestMove = PlatformRequestResize = false; }
|
|
|
|
// Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)
|
|
ImVec2 CalcWorkRectPos(const ImVec2& off_min) const { return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); }
|
|
ImVec2 CalcWorkRectSize(const ImVec2& off_min, const ImVec2& off_max) const { return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); }
|
|
void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); } // Update public fields
|
|
|
|
// Helpers to retrieve ImRect (we don't need to store BuildWorkRect as every access tend to change it, hence the code asymmetry)
|
|
ImRect GetMainRect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
|
ImRect GetWorkRect() const { return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
|
|
ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Settings support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Windows data saved in imgui.ini file
|
|
// Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily.
|
|
// (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)
|
|
struct ImGuiWindowSettings
|
|
{
|
|
ImGuiID ID;
|
|
ImVec2ih Pos; // NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
|
|
ImVec2ih Size;
|
|
ImVec2ih ViewportPos;
|
|
ImGuiID ViewportId;
|
|
ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
|
|
ImGuiID ClassId; // ID of window class if specified
|
|
short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
|
|
bool Collapsed;
|
|
bool IsChild;
|
|
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
|
|
bool WantDelete; // Set to invalidate/delete the settings entry
|
|
|
|
ImGuiWindowSettings() { memset(this, 0, sizeof(*this)); DockOrder = -1; }
|
|
char* GetName() { return (char*)(this + 1); }
|
|
};
|
|
|
|
struct ImGuiSettingsHandler
|
|
{
|
|
const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']'
|
|
ImGuiID TypeHash; // == ImHashStr(TypeName)
|
|
void (*ClearAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); // Clear all settings data
|
|
void (*ReadInitFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); // Read: Called before reading (in registration order)
|
|
void* (*ReadOpenFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); // Read: Called when entering into a new ini entry e.g. "[Window][Name]"
|
|
void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); // Read: Called for every line of text within an ini entry
|
|
void (*ApplyAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); // Read: Called after reading (in registration order)
|
|
void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); // Write: Output every entries into 'out_buf'
|
|
void* UserData;
|
|
|
|
ImGuiSettingsHandler() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Localization support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// This is experimental and not officially supported, it'll probably fall short of features, if/when it does we may backtrack.
|
|
enum ImGuiLocKey : int
|
|
{
|
|
ImGuiLocKey_VersionStr,
|
|
ImGuiLocKey_TableSizeOne,
|
|
ImGuiLocKey_TableSizeAllFit,
|
|
ImGuiLocKey_TableSizeAllDefault,
|
|
ImGuiLocKey_TableResetOrder,
|
|
ImGuiLocKey_WindowingMainMenuBar,
|
|
ImGuiLocKey_WindowingPopup,
|
|
ImGuiLocKey_WindowingUntitled,
|
|
ImGuiLocKey_DockingHideTabBar,
|
|
ImGuiLocKey_DockingHoldShiftToDock,
|
|
ImGuiLocKey_DockingDragToUndockOrMoveNode,
|
|
ImGuiLocKey_COUNT
|
|
};
|
|
|
|
struct ImGuiLocEntry
|
|
{
|
|
ImGuiLocKey Key;
|
|
const char* Text;
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Metrics, Debug Tools
|
|
//-----------------------------------------------------------------------------
|
|
|
|
enum ImGuiDebugLogFlags_
|
|
{
|
|
// Event types
|
|
ImGuiDebugLogFlags_None = 0,
|
|
ImGuiDebugLogFlags_EventActiveId = 1 << 0,
|
|
ImGuiDebugLogFlags_EventFocus = 1 << 1,
|
|
ImGuiDebugLogFlags_EventPopup = 1 << 2,
|
|
ImGuiDebugLogFlags_EventNav = 1 << 3,
|
|
ImGuiDebugLogFlags_EventClipper = 1 << 4,
|
|
ImGuiDebugLogFlags_EventSelection = 1 << 5,
|
|
ImGuiDebugLogFlags_EventIO = 1 << 6,
|
|
ImGuiDebugLogFlags_EventInputRouting = 1 << 7,
|
|
ImGuiDebugLogFlags_EventDocking = 1 << 8,
|
|
ImGuiDebugLogFlags_EventViewport = 1 << 9,
|
|
|
|
ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
|
|
ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY
|
|
ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21, // Also send output to Test Engine
|
|
};
|
|
|
|
struct ImGuiDebugAllocEntry
|
|
{
|
|
int FrameCount;
|
|
ImS16 AllocCount;
|
|
ImS16 FreeCount;
|
|
};
|
|
|
|
struct ImGuiDebugAllocInfo
|
|
{
|
|
int TotalAllocCount; // Number of call to MemAlloc().
|
|
int TotalFreeCount;
|
|
ImS16 LastEntriesIdx; // Current index in buffer
|
|
ImGuiDebugAllocEntry LastEntriesBuf[6]; // Track last 6 frames that had allocations
|
|
|
|
ImGuiDebugAllocInfo() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
struct ImGuiMetricsConfig
|
|
{
|
|
bool ShowDebugLog = false;
|
|
bool ShowIDStackTool = false;
|
|
bool ShowWindowsRects = false;
|
|
bool ShowWindowsBeginOrder = false;
|
|
bool ShowTablesRects = false;
|
|
bool ShowDrawCmdMesh = true;
|
|
bool ShowDrawCmdBoundingBoxes = true;
|
|
bool ShowTextEncodingViewer = false;
|
|
bool ShowAtlasTintedWithTextColor = false;
|
|
bool ShowDockingNodes = false;
|
|
int ShowWindowsRectsType = -1;
|
|
int ShowTablesRectsType = -1;
|
|
int HighlightMonitorIdx = -1;
|
|
ImGuiID HighlightViewportID = 0;
|
|
};
|
|
|
|
struct ImGuiStackLevelInfo
|
|
{
|
|
ImGuiID ID;
|
|
ImS8 QueryFrameCount; // >= 1: Query in progress
|
|
bool QuerySuccess; // Obtained result from DebugHookIdInfo()
|
|
ImGuiDataType DataType : 8;
|
|
char Desc[57]; // Arbitrarily sized buffer to hold a result (FIXME: could replace Results[] with a chunk stream?) FIXME: Now that we added CTRL+C this should be fixed.
|
|
|
|
ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
// State for ID Stack tool queries
|
|
struct ImGuiIDStackTool
|
|
{
|
|
int LastActiveFrame;
|
|
int StackLevel; // -1: query stack and resize Results, >= 0: individual stack level
|
|
ImGuiID QueryId; // ID to query details for
|
|
ImVector<ImGuiStackLevelInfo> Results;
|
|
bool CopyToClipboardOnCtrlC;
|
|
float CopyToClipboardLastTime;
|
|
|
|
ImGuiIDStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Generic context hooks
|
|
//-----------------------------------------------------------------------------
|
|
|
|
typedef void (*ImGuiContextHookCallback)(ImGuiContext* ctx, ImGuiContextHook* hook);
|
|
enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
|
|
|
|
struct ImGuiContextHook
|
|
{
|
|
ImGuiID HookId; // A unique ID assigned by AddContextHook()
|
|
ImGuiContextHookType Type;
|
|
ImGuiID Owner;
|
|
ImGuiContextHookCallback Callback;
|
|
void* UserData;
|
|
|
|
ImGuiContextHook() { memset(this, 0, sizeof(*this)); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] ImGuiContext (main Dear ImGui context)
|
|
//-----------------------------------------------------------------------------
|
|
|
|
struct ImGuiContext
|
|
{
|
|
bool Initialized;
|
|
bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
|
|
ImGuiIO IO;
|
|
ImGuiPlatformIO PlatformIO;
|
|
ImGuiStyle Style;
|
|
ImGuiConfigFlags ConfigFlagsCurrFrame; // = g.IO.ConfigFlags at the time of NewFrame()
|
|
ImGuiConfigFlags ConfigFlagsLastFrame;
|
|
ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
|
|
float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
|
|
float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height.
|
|
float CurrentDpiScale; // Current window/viewport DpiScale == CurrentViewport->DpiScale
|
|
ImDrawListSharedData DrawListSharedData;
|
|
double Time;
|
|
int FrameCount;
|
|
int FrameCountEnded;
|
|
int FrameCountPlatformEnded;
|
|
int FrameCountRendered;
|
|
bool WithinFrameScope; // Set by NewFrame(), cleared by EndFrame()
|
|
bool WithinFrameScopeWithImplicitWindow; // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
|
|
bool WithinEndChild; // Set within EndChild()
|
|
bool GcCompactAll; // Request full GC
|
|
bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
|
|
void* TestEngine; // Test engine user data
|
|
|
|
// Inputs
|
|
ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be trickled/written into IO structure.
|
|
ImVector<ImGuiInputEvent> InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
|
|
ImGuiMouseSource InputEventsNextMouseSource;
|
|
ImU32 InputEventsNextEventId;
|
|
|
|
// Windows state
|
|
ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
|
|
ImVector<ImGuiWindow*> WindowsFocusOrder; // Root windows, sorted in focus order, back to front.
|
|
ImVector<ImGuiWindow*> WindowsTempSortBuffer; // Temporary buffer used in EndFrame() to reorder windows so parents are kept before their child
|
|
ImVector<ImGuiWindowStackData> CurrentWindowStack;
|
|
ImGuiStorage WindowsById; // Map window's ImGuiID to ImGuiWindow*
|
|
int WindowsActiveCount; // Number of unique windows submitted by frame
|
|
ImVec2 WindowsHoverPadding; // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING).
|
|
ImGuiID DebugBreakInWindow; // Set to break in Begin() call.
|
|
ImGuiWindow* CurrentWindow; // Window being drawn into
|
|
ImGuiWindow* HoveredWindow; // Window the mouse is hovering. Will typically catch mouse inputs.
|
|
ImGuiWindow* HoveredWindowUnderMovingWindow; // Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
|
|
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindowDockTree.
|
|
ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
|
|
ImVec2 WheelingWindowRefMousePos;
|
|
int WheelingWindowStartFrame; // This may be set one frame before WheelingWindow is != NULL
|
|
int WheelingWindowScrolledFrame;
|
|
float WheelingWindowReleaseTimer;
|
|
ImVec2 WheelingWindowWheelRemainder;
|
|
ImVec2 WheelingAxisAvg;
|
|
|
|
// Item/widgets state and tracking information
|
|
ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
|
|
ImGuiID HoveredId; // Hovered widget, filled during the frame
|
|
ImGuiID HoveredIdPreviousFrame;
|
|
bool HoveredIdAllowOverlap;
|
|
bool HoveredIdDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0.
|
|
float HoveredIdTimer; // Measure contiguous hovering time
|
|
float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
|
|
ImGuiID ActiveId; // Active widget
|
|
ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
|
|
float ActiveIdTimer;
|
|
bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
|
|
bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
|
|
bool ActiveIdNoClearOnFocusLoss; // Disable losing active id if the active id window gets unfocused.
|
|
bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch.
|
|
bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state.
|
|
bool ActiveIdHasBeenEditedThisFrame;
|
|
bool ActiveIdFromShortcut;
|
|
int ActiveIdMouseButton : 8;
|
|
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
|
|
ImGuiWindow* ActiveIdWindow;
|
|
ImGuiInputSource ActiveIdSource; // Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad
|
|
ImGuiID ActiveIdPreviousFrame;
|
|
bool ActiveIdPreviousFrameIsAlive;
|
|
bool ActiveIdPreviousFrameHasBeenEditedBefore;
|
|
ImGuiWindow* ActiveIdPreviousFrameWindow;
|
|
ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation.
|
|
float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
|
|
|
|
// Key/Input Ownership + Shortcut Routing system
|
|
// - The idea is that instead of "eating" a given key, we can link to an owner.
|
|
// - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID.
|
|
// - Routing is requested ahead of time for a given chord (Key + Mods) and granted in NewFrame().
|
|
double LastKeyModsChangeTime; // Record the last time key mods changed (affect repeat delay when using shortcut logic)
|
|
double LastKeyModsChangeFromNoneTime; // Record the last time key mods changed away from being 0 (affect repeat delay when using shortcut logic)
|
|
double LastKeyboardKeyPressTime; // Record the last time a keyboard key (ignore mouse/gamepad ones) was pressed.
|
|
ImBitArrayForNamedKeys KeysMayBeCharInput; // Lookup to tell if a key can emit char input, see IsKeyChordPotentiallyCharInput(). sizeof() = 20 bytes
|
|
ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT];
|
|
ImGuiKeyRoutingTable KeysRoutingTable;
|
|
ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
|
|
bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (FIXME: This is a shortcut for not taking ownership of 100+ keys but perhaps best to not have the inconsistency)
|
|
ImGuiKeyChord DebugBreakInShortcutRouting; // Set to break in SetShortcutRouting()/Shortcut() calls.
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
|
|
ImU32 ActiveIdUsingNavInputMask; // If you used this. Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);'
|
|
#endif
|
|
|
|
// Next window/item data
|
|
ImGuiID CurrentFocusScopeId; // Value for currently appending items == g.FocusScopeStack.back(). Not to be mistaken with g.NavFocusScopeId.
|
|
ImGuiItemFlags CurrentItemFlags; // Value for currently appending items == g.ItemFlagsStack.back()
|
|
ImGuiID DebugLocateId; // Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location
|
|
ImGuiNextItemData NextItemData; // Storage for SetNextItem** functions
|
|
ImGuiLastItemData LastItemData; // Storage for last submitted item (setup by ItemAdd)
|
|
ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions
|
|
bool DebugShowGroupRects;
|
|
|
|
// Shared stacks
|
|
ImGuiCol DebugFlashStyleColorIdx; // (Keep close to ColorStack to share cache line)
|
|
ImVector<ImGuiColorMod> ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin()
|
|
ImVector<ImGuiStyleMod> StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin()
|
|
ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont() - inherited by Begin()
|
|
ImVector<ImGuiFocusScopeData> FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin()
|
|
ImVector<ImGuiItemFlags> ItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin()
|
|
ImVector<ImGuiGroupData> GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin()
|
|
ImVector<ImGuiPopupData> OpenPopupStack; // Which popups are open (persistent)
|
|
ImVector<ImGuiPopupData> BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
|
|
ImVector<ImGuiNavTreeNodeData> NavTreeNodeStack; // Stack for TreeNode() when a NavLeft requested is emitted.
|
|
|
|
// Viewports
|
|
ImVector<ImGuiViewportP*> Viewports; // Active viewports (always 1+, and generally 1 unless multi-viewports are enabled). Each viewports hold their copy of ImDrawData.
|
|
ImGuiViewportP* CurrentViewport; // We track changes of viewport (happening in Begin) so we can call Platform_OnChangedViewport()
|
|
ImGuiViewportP* MouseViewport;
|
|
ImGuiViewportP* MouseLastHoveredViewport; // Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag.
|
|
ImGuiID PlatformLastFocusedViewportId;
|
|
ImGuiPlatformMonitor FallbackMonitor; // Virtual monitor used as fallback if backend doesn't provide monitor information.
|
|
ImRect PlatformMonitorsFullWorkRect; // Bounding box of all platform monitors
|
|
int ViewportCreatedCount; // Unique sequential creation counter (mostly for testing/debugging)
|
|
int PlatformWindowsCreatedCount; // Unique sequential creation counter (mostly for testing/debugging)
|
|
int ViewportFocusedStampCount; // Every time the front-most window changes, we stamp its viewport with an incrementing counter
|
|
|
|
// Gamepad/keyboard Navigation
|
|
ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
|
|
ImGuiID NavId; // Focused item for navigation
|
|
ImGuiID NavFocusScopeId; // Focused focus scope (e.g. selection code often wants to "clear other items" when landing on an item of the same scope)
|
|
ImVector<ImGuiFocusScopeData> NavFocusRoute; // Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain.
|
|
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
|
|
ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
|
|
ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
|
|
ImGuiActivateFlags NavActivateFlags;
|
|
ImGuiID NavHighlightActivatedId;
|
|
float NavHighlightActivatedTimer;
|
|
ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest).
|
|
ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
|
|
ImGuiKeyChord NavJustMovedToKeyMods;
|
|
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame.
|
|
ImGuiActivateFlags NavNextActivateFlags;
|
|
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
|
|
ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
|
|
ImGuiSelectionUserData NavLastValidSelectionUserData; // Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data.
|
|
bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
|
|
bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
|
|
bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
|
|
bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
|
|
|
|
// Navigation: Init & Move Requests
|
|
bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
|
|
bool NavInitRequest; // Init request for appearing window to select first item
|
|
bool NavInitRequestFromMove;
|
|
ImGuiNavItemData NavInitResult; // Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
|
|
bool NavMoveSubmitted; // Move request submitted, will process result on next NewFrame()
|
|
bool NavMoveScoringItems; // Move request submitted, still scoring incoming items
|
|
bool NavMoveForwardToNextFrame;
|
|
ImGuiNavMoveFlags NavMoveFlags;
|
|
ImGuiScrollFlags NavMoveScrollFlags;
|
|
ImGuiKeyChord NavMoveKeyMods;
|
|
ImGuiDir NavMoveDir; // Direction of the move request (left/right/up/down)
|
|
ImGuiDir NavMoveDirForDebug;
|
|
ImGuiDir NavMoveClipDir; // FIXME-NAV: Describe the purpose of this better. Might want to rename?
|
|
ImRect NavScoringRect; // Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
|
|
ImRect NavScoringNoClipRect; // Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
|
|
int NavScoringDebugCount; // Metrics for debugging
|
|
int NavTabbingDir; // Generally -1 or +1, 0 when tabbing without a nav id
|
|
int NavTabbingCounter; // >0 when counting items for tabbing
|
|
ImGuiNavItemData NavMoveResultLocal; // Best move request candidate within NavWindow
|
|
ImGuiNavItemData NavMoveResultLocalVisible; // Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
|
|
ImGuiNavItemData NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
|
|
ImGuiNavItemData NavTabbingResultFirst; // First tabbing request candidate within NavWindow and flattened hierarchy
|
|
|
|
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
|
|
ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). For reconfiguration (see #4828)
|
|
ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab on OS X)
|
|
ImGuiWindow* NavWindowingTarget; // Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
|
|
ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f, so the fade-out can stay on it.
|
|
ImGuiWindow* NavWindowingListWindow; // Internal window actually listing the CTRL+Tab contents
|
|
float NavWindowingTimer;
|
|
float NavWindowingHighlightAlpha;
|
|
bool NavWindowingToggleLayer;
|
|
ImGuiKey NavWindowingToggleKey;
|
|
ImVec2 NavWindowingAccumDeltaPos;
|
|
ImVec2 NavWindowingAccumDeltaSize;
|
|
|
|
// Render
|
|
float DimBgRatio; // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
|
|
|
|
// Drag and Drop
|
|
bool DragDropActive;
|
|
bool DragDropWithinSource; // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source.
|
|
bool DragDropWithinTarget; // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target.
|
|
ImGuiDragDropFlags DragDropSourceFlags;
|
|
int DragDropSourceFrameCount;
|
|
int DragDropMouseButton;
|
|
ImGuiPayload DragDropPayload;
|
|
ImRect DragDropTargetRect; // Store rectangle of current target candidate (we favor small targets when overlapping)
|
|
ImRect DragDropTargetClipRect; // Store ClipRect at the time of item's drawing
|
|
ImGuiID DragDropTargetId;
|
|
ImGuiDragDropFlags DragDropAcceptFlags;
|
|
float DragDropAcceptIdCurrRectSurface; // Target item surface (we resolve overlapping targets by prioritizing the smaller surface)
|
|
ImGuiID DragDropAcceptIdCurr; // Target item id (set at the time of accepting the payload)
|
|
ImGuiID DragDropAcceptIdPrev; // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
|
|
int DragDropAcceptFrameCount; // Last time a target expressed a desire to accept the source
|
|
ImGuiID DragDropHoldJustPressedId; // Set when holding a payload just made ButtonBehavior() return a press.
|
|
ImVector<unsigned char> DragDropPayloadBufHeap; // We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size
|
|
unsigned char DragDropPayloadBufLocal[16]; // Local buffer for small payloads
|
|
|
|
// Clipper
|
|
int ClipperTempDataStacked;
|
|
ImVector<ImGuiListClipperData> ClipperTempData;
|
|
|
|
// Tables
|
|
ImGuiTable* CurrentTable;
|
|
ImGuiID DebugBreakInTable; // Set to break in BeginTable() call.
|
|
int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
|
|
ImVector<ImGuiTableTempData> TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting)
|
|
ImPool<ImGuiTable> Tables; // Persistent table data
|
|
ImVector<float> TablesLastTimeActive; // Last used timestamp of each tables (SOA, for efficient GC)
|
|
ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer;
|
|
|
|
// Tab bars
|
|
ImGuiTabBar* CurrentTabBar;
|
|
ImPool<ImGuiTabBar> TabBars;
|
|
ImVector<ImGuiPtrOrIndex> CurrentTabBarStack;
|
|
ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
|
|
|
|
// Hover Delay system
|
|
ImGuiID HoverItemDelayId;
|
|
ImGuiID HoverItemDelayIdPreviousFrame;
|
|
float HoverItemDelayTimer; // Currently used by IsItemHovered()
|
|
float HoverItemDelayClearTimer; // Currently used by IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared.
|
|
ImGuiID HoverItemUnlockedStationaryId; // Mouse has once been stationary on this item. Only reset after departing the item.
|
|
ImGuiID HoverWindowUnlockedStationaryId; // Mouse has once been stationary on this window. Only reset after departing the window.
|
|
|
|
// Mouse state
|
|
ImGuiMouseCursor MouseCursor;
|
|
float MouseStationaryTimer; // Time the mouse has been stationary (with some loose heuristic)
|
|
ImVec2 MouseLastValidPos;
|
|
|
|
// Widget state
|
|
ImGuiInputTextState InputTextState;
|
|
ImGuiInputTextDeactivatedState InputTextDeactivatedState;
|
|
ImFont InputTextPasswordFont;
|
|
ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc.
|
|
int BeginMenuDepth;
|
|
int BeginComboDepth;
|
|
ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
|
|
ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others).
|
|
ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for
|
|
float ColorEditSavedHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
|
|
float ColorEditSavedSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
|
|
ImU32 ColorEditSavedColor; // RGB value with alpha set to 0.
|
|
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
|
|
ImGuiComboPreviewData ComboPreviewData;
|
|
ImRect WindowResizeBorderExpectedRect; // Expected border rect, switch to relative edit if moving
|
|
bool WindowResizeRelativeMode;
|
|
float SliderGrabClickOffset;
|
|
float SliderCurrentAccum; // Accumulated slider delta when using navigation controls.
|
|
bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it?
|
|
bool DragCurrentAccumDirty;
|
|
float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
|
|
float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
|
|
float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
|
|
float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled()
|
|
short DisabledStackSize;
|
|
short LockMarkEdited;
|
|
short TooltipOverrideCount;
|
|
ImVector<char> ClipboardHandlerData; // If no custom clipboard handler is defined
|
|
ImVector<ImGuiID> MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once
|
|
ImGuiTypingSelectState TypingSelectState; // State for GetTypingSelectRequest()
|
|
|
|
// Platform support
|
|
ImGuiPlatformImeData PlatformImeData; // Data updated by current frame
|
|
ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data (when changing we will call io.SetPlatformImeDataFn
|
|
ImGuiID PlatformImeViewport;
|
|
|
|
// Extensions
|
|
// FIXME: We could provide an API to register one slot in an array held in ImGuiContext?
|
|
ImGuiDockContext DockContext;
|
|
void (*DockNodeWindowMenuHandler)(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);
|
|
|
|
// Settings
|
|
bool SettingsLoaded;
|
|
float SettingsDirtyTimer; // Save .ini Settings to memory when time reaches zero
|
|
ImGuiTextBuffer SettingsIniData; // In memory .ini settings
|
|
ImVector<ImGuiSettingsHandler> SettingsHandlers; // List of .ini settings handlers
|
|
ImChunkStream<ImGuiWindowSettings> SettingsWindows; // ImGuiWindow .ini settings entries
|
|
ImChunkStream<ImGuiTableSettings> SettingsTables; // ImGuiTable .ini settings entries
|
|
ImVector<ImGuiContextHook> Hooks; // Hooks for extensions (e.g. test engine)
|
|
ImGuiID HookIdNext; // Next available HookId
|
|
|
|
// Localization
|
|
const char* LocalizationTable[ImGuiLocKey_COUNT];
|
|
|
|
// Capture/Logging
|
|
bool LogEnabled; // Currently capturing
|
|
ImGuiLogType LogType; // Capture target
|
|
ImFileHandle LogFile; // If != NULL log to stdout/ file
|
|
ImGuiTextBuffer LogBuffer; // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
|
|
const char* LogNextPrefix;
|
|
const char* LogNextSuffix;
|
|
float LogLinePosY;
|
|
bool LogLineFirstItem;
|
|
int LogDepthRef;
|
|
int LogDepthToExpand;
|
|
int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
|
|
|
|
// Debug Tools
|
|
// (some of the highly frequently used data are interleaved in other structures above: DebugBreakXXX fields, DebugHookIdInfo, DebugLocateId etc.)
|
|
ImGuiDebugLogFlags DebugLogFlags;
|
|
ImGuiTextBuffer DebugLogBuf;
|
|
ImGuiTextIndex DebugLogIndex;
|
|
ImGuiDebugLogFlags DebugLogAutoDisableFlags;
|
|
ImU8 DebugLogAutoDisableFrames;
|
|
ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
|
|
bool DebugBreakInLocateId; // Debug break in ItemAdd() call for g.DebugLocateId.
|
|
ImGuiKeyChord DebugBreakKeyChord; // = ImGuiKey_Pause
|
|
ImS8 DebugBeginReturnValueCullDepth; // Cycle between 0..9 then wrap around.
|
|
bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker())
|
|
ImU8 DebugItemPickerMouseButton;
|
|
ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
|
|
float DebugFlashStyleColorTime;
|
|
ImVec4 DebugFlashStyleColorBackup;
|
|
ImGuiMetricsConfig DebugMetricsConfig;
|
|
ImGuiIDStackTool DebugIDStackTool;
|
|
ImGuiDebugAllocInfo DebugAllocInfo;
|
|
ImGuiDockNode* DebugHoveredDockNode; // Hovered dock node.
|
|
|
|
// Misc
|
|
float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames..
|
|
int FramerateSecPerFrameIdx;
|
|
int FramerateSecPerFrameCount;
|
|
float FramerateSecPerFrameAccum;
|
|
int WantCaptureMouseNextFrame; // Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1.
|
|
int WantCaptureKeyboardNextFrame; // "
|
|
int WantTextInputNextFrame;
|
|
ImVector<char> TempBuffer; // Temporary text buffer
|
|
char TempKeychordName[64];
|
|
|
|
ImGuiContext(ImFontAtlas* shared_font_atlas)
|
|
{
|
|
IO.Ctx = this;
|
|
InputTextState.Ctx = this;
|
|
|
|
Initialized = false;
|
|
ConfigFlagsCurrFrame = ConfigFlagsLastFrame = ImGuiConfigFlags_None;
|
|
FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
|
Font = NULL;
|
|
FontSize = FontBaseSize = CurrentDpiScale = 0.0f;
|
|
IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
|
|
Time = 0.0f;
|
|
FrameCount = 0;
|
|
FrameCountEnded = FrameCountPlatformEnded = FrameCountRendered = -1;
|
|
WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
|
|
GcCompactAll = false;
|
|
TestEngineHookItems = false;
|
|
TestEngine = NULL;
|
|
|
|
InputEventsNextMouseSource = ImGuiMouseSource_Mouse;
|
|
InputEventsNextEventId = 1;
|
|
|
|
WindowsActiveCount = 0;
|
|
CurrentWindow = NULL;
|
|
HoveredWindow = NULL;
|
|
HoveredWindowUnderMovingWindow = NULL;
|
|
MovingWindow = NULL;
|
|
WheelingWindow = NULL;
|
|
WheelingWindowStartFrame = WheelingWindowScrolledFrame = -1;
|
|
WheelingWindowReleaseTimer = 0.0f;
|
|
|
|
DebugHookIdInfo = 0;
|
|
HoveredId = HoveredIdPreviousFrame = 0;
|
|
HoveredIdAllowOverlap = false;
|
|
HoveredIdDisabled = false;
|
|
HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
|
|
ActiveId = 0;
|
|
ActiveIdIsAlive = 0;
|
|
ActiveIdTimer = 0.0f;
|
|
ActiveIdIsJustActivated = false;
|
|
ActiveIdAllowOverlap = false;
|
|
ActiveIdNoClearOnFocusLoss = false;
|
|
ActiveIdHasBeenPressedBefore = false;
|
|
ActiveIdHasBeenEditedBefore = false;
|
|
ActiveIdHasBeenEditedThisFrame = false;
|
|
ActiveIdFromShortcut = false;
|
|
ActiveIdClickOffset = ImVec2(-1, -1);
|
|
ActiveIdWindow = NULL;
|
|
ActiveIdSource = ImGuiInputSource_None;
|
|
ActiveIdMouseButton = -1;
|
|
ActiveIdPreviousFrame = 0;
|
|
ActiveIdPreviousFrameIsAlive = false;
|
|
ActiveIdPreviousFrameHasBeenEditedBefore = false;
|
|
ActiveIdPreviousFrameWindow = NULL;
|
|
LastActiveId = 0;
|
|
LastActiveIdTimer = 0.0f;
|
|
|
|
LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0;
|
|
|
|
ActiveIdUsingNavDirMask = 0x00;
|
|
ActiveIdUsingAllKeyboardKeys = false;
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
|
|
ActiveIdUsingNavInputMask = 0x00;
|
|
#endif
|
|
|
|
CurrentFocusScopeId = 0;
|
|
CurrentItemFlags = ImGuiItemFlags_None;
|
|
DebugShowGroupRects = false;
|
|
|
|
CurrentViewport = NULL;
|
|
MouseViewport = MouseLastHoveredViewport = NULL;
|
|
PlatformLastFocusedViewportId = 0;
|
|
ViewportCreatedCount = PlatformWindowsCreatedCount = 0;
|
|
ViewportFocusedStampCount = 0;
|
|
|
|
NavWindow = NULL;
|
|
NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0;
|
|
NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
|
|
NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
|
|
NavHighlightActivatedId = 0;
|
|
NavHighlightActivatedTimer = 0.0f;
|
|
NavJustMovedToKeyMods = ImGuiMod_None;
|
|
NavInputSource = ImGuiInputSource_Keyboard;
|
|
NavLayer = ImGuiNavLayer_Main;
|
|
NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
|
|
NavIdIsAlive = false;
|
|
NavMousePosDirty = false;
|
|
NavDisableHighlight = true;
|
|
NavDisableMouseHover = false;
|
|
NavAnyRequest = false;
|
|
NavInitRequest = false;
|
|
NavInitRequestFromMove = false;
|
|
NavMoveSubmitted = false;
|
|
NavMoveScoringItems = false;
|
|
NavMoveForwardToNextFrame = false;
|
|
NavMoveFlags = ImGuiNavMoveFlags_None;
|
|
NavMoveScrollFlags = ImGuiScrollFlags_None;
|
|
NavMoveKeyMods = ImGuiMod_None;
|
|
NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
|
|
NavScoringDebugCount = 0;
|
|
NavTabbingDir = 0;
|
|
NavTabbingCounter = 0;
|
|
|
|
// All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac...
|
|
// FIXME: Because this value is stored, it annoyingly interfere with toggling io.ConfigMacOSXBehaviors updating this..
|
|
ConfigNavWindowingKeyNext = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiKey_Tab);
|
|
ConfigNavWindowingKeyPrev = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab);
|
|
NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
|
|
NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
|
|
NavWindowingToggleLayer = false;
|
|
NavWindowingToggleKey = ImGuiKey_None;
|
|
|
|
DimBgRatio = 0.0f;
|
|
|
|
DragDropActive = DragDropWithinSource = DragDropWithinTarget = false;
|
|
DragDropSourceFlags = ImGuiDragDropFlags_None;
|
|
DragDropSourceFrameCount = -1;
|
|
DragDropMouseButton = -1;
|
|
DragDropTargetId = 0;
|
|
DragDropAcceptFlags = ImGuiDragDropFlags_None;
|
|
DragDropAcceptIdCurrRectSurface = 0.0f;
|
|
DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
|
|
DragDropAcceptFrameCount = -1;
|
|
DragDropHoldJustPressedId = 0;
|
|
memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
|
|
|
|
ClipperTempDataStacked = 0;
|
|
|
|
CurrentTable = NULL;
|
|
TablesTempDataStacked = 0;
|
|
CurrentTabBar = NULL;
|
|
|
|
HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0;
|
|
HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f;
|
|
|
|
MouseCursor = ImGuiMouseCursor_Arrow;
|
|
MouseStationaryTimer = 0.0f;
|
|
|
|
TempInputId = 0;
|
|
BeginMenuDepth = BeginComboDepth = 0;
|
|
ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
|
|
ColorEditCurrentID = ColorEditSavedID = 0;
|
|
ColorEditSavedHue = ColorEditSavedSat = 0.0f;
|
|
ColorEditSavedColor = 0;
|
|
WindowResizeRelativeMode = false;
|
|
SliderGrabClickOffset = 0.0f;
|
|
SliderCurrentAccum = 0.0f;
|
|
SliderCurrentAccumDirty = false;
|
|
DragCurrentAccumDirty = false;
|
|
DragCurrentAccum = 0.0f;
|
|
DragSpeedDefaultRatio = 1.0f / 100.0f;
|
|
ScrollbarClickDeltaToGrabCenter = 0.0f;
|
|
DisabledAlphaBackup = 0.0f;
|
|
DisabledStackSize = 0;
|
|
LockMarkEdited = 0;
|
|
TooltipOverrideCount = 0;
|
|
|
|
PlatformImeData.InputPos = ImVec2(0.0f, 0.0f);
|
|
PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission
|
|
PlatformImeViewport = 0;
|
|
|
|
DockNodeWindowMenuHandler = NULL;
|
|
|
|
SettingsLoaded = false;
|
|
SettingsDirtyTimer = 0.0f;
|
|
HookIdNext = 0;
|
|
|
|
memset(LocalizationTable, 0, sizeof(LocalizationTable));
|
|
|
|
LogEnabled = false;
|
|
LogType = ImGuiLogType_None;
|
|
LogNextPrefix = LogNextSuffix = NULL;
|
|
LogFile = NULL;
|
|
LogLinePosY = FLT_MAX;
|
|
LogLineFirstItem = false;
|
|
LogDepthRef = 0;
|
|
LogDepthToExpand = LogDepthToExpandDefault = 2;
|
|
|
|
DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
|
|
DebugLocateId = 0;
|
|
DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None;
|
|
DebugLogAutoDisableFrames = 0;
|
|
DebugLocateFrames = 0;
|
|
DebugBeginReturnValueCullDepth = -1;
|
|
DebugItemPickerActive = false;
|
|
DebugItemPickerMouseButton = ImGuiMouseButton_Left;
|
|
DebugItemPickerBreakId = 0;
|
|
DebugFlashStyleColorTime = 0.0f;
|
|
DebugFlashStyleColorIdx = ImGuiCol_COUNT;
|
|
DebugHoveredDockNode = NULL;
|
|
|
|
// Same as DebugBreakClearData(). Those fields are scattered in their respective subsystem to stay in hot-data locations
|
|
DebugBreakInWindow = 0;
|
|
DebugBreakInTable = 0;
|
|
DebugBreakInLocateId = false;
|
|
DebugBreakKeyChord = ImGuiKey_Pause;
|
|
DebugBreakInShortcutRouting = ImGuiKey_None;
|
|
|
|
memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
|
|
FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
|
|
FramerateSecPerFrameAccum = 0.0f;
|
|
WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
|
|
memset(TempKeychordName, 0, sizeof(TempKeychordName));
|
|
}
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] ImGuiWindowTempData, ImGuiWindow
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow.
|
|
// (That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered..)
|
|
// (This doesn't need a constructor because we zero-clear it as part of ImGuiWindow and all frame-temporary data are setup on Begin)
|
|
struct IMGUI_API ImGuiWindowTempData
|
|
{
|
|
// Layout
|
|
ImVec2 CursorPos; // Current emitting position, in absolute coordinates.
|
|
ImVec2 CursorPosPrevLine;
|
|
ImVec2 CursorStartPos; // Initial position after Begin(), generally ~ window position + WindowPadding.
|
|
ImVec2 CursorMaxPos; // Used to implicitly calculate ContentSize at the beginning of next frame, for scrolling range and auto-resize. Always growing during the frame.
|
|
ImVec2 IdealMaxPos; // Used to implicitly calculate ContentSizeIdeal at the beginning of next frame, for auto-resize only. Always growing during the frame.
|
|
ImVec2 CurrLineSize;
|
|
ImVec2 PrevLineSize;
|
|
float CurrLineTextBaseOffset; // Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added).
|
|
float PrevLineTextBaseOffset;
|
|
bool IsSameLine;
|
|
bool IsSetPos;
|
|
ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
|
|
ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
|
|
ImVec1 GroupOffset;
|
|
ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area.
|
|
|
|
// Keyboard/Gamepad navigation
|
|
ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
|
|
short NavLayersActiveMask; // Which layers have been written to (result from previous frame)
|
|
short NavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame)
|
|
bool NavIsScrollPushableX; // Set when current work location may be scrolled horizontally when moving left / right. This is generally always true UNLESS within a column.
|
|
bool NavHideHighlightOneFrame;
|
|
bool NavWindowHasScrollY; // Set per window when scrolling can be used (== ScrollMax.y > 0.0f)
|
|
|
|
// Miscellaneous
|
|
bool MenuBarAppending; // FIXME: Remove this
|
|
ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
|
|
ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items measurement
|
|
int TreeDepth; // Current tree depth.
|
|
ImU32 TreeJumpToParentOnPopMask; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
|
|
ImVector<ImGuiWindow*> ChildWindows;
|
|
ImGuiStorage* StateStorage; // Current persistent per-window storage (store e.g. tree node open/close state)
|
|
ImGuiOldColumns* CurrentColumns; // Current columns set
|
|
int CurrentTableIdx; // Current table index (into g.Tables)
|
|
ImGuiLayoutType LayoutType;
|
|
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
|
|
ImU32 ModalDimBgColor;
|
|
|
|
// Local parameters stacks
|
|
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
|
|
float ItemWidth; // Current item width (>0.0: width in pixels, <0.0: align xx pixels to the right of window).
|
|
float TextWrapPos; // Current text wrap pos.
|
|
ImVector<float> ItemWidthStack; // Store item widths to restore (attention: .back() is not == ItemWidth)
|
|
ImVector<float> TextWrapPosStack; // Store text wrap pos to restore (attention: .back() is not == TextWrapPos)
|
|
};
|
|
|
|
// Storage for one window
|
|
struct IMGUI_API ImGuiWindow
|
|
{
|
|
ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
|
|
char* Name; // Window name, owned by the window.
|
|
ImGuiID ID; // == ImHashStr(Name)
|
|
ImGuiWindowFlags Flags, FlagsPreviousFrame; // See enum ImGuiWindowFlags_
|
|
ImGuiChildFlags ChildFlags; // Set when window is a child window. See enum ImGuiChildFlags_
|
|
ImGuiWindowClass WindowClass; // Advanced users only. Set with SetNextWindowClass()
|
|
ImGuiViewportP* Viewport; // Always set in Begin(). Inactive windows may have a NULL value here if their viewport was discarded.
|
|
ImGuiID ViewportId; // We backup the viewport id (since the viewport may disappear or never be created if the window is inactive)
|
|
ImVec2 ViewportPos; // We backup the viewport position (since the viewport may disappear or never be created if the window is inactive)
|
|
int ViewportAllowPlatformMonitorExtend; // Reset to -1 every frame (index is guaranteed to be valid between NewFrame..EndFrame), only used in the Appearing frame of a tooltip/popup to enforce clamping to a given monitor
|
|
ImVec2 Pos; // Position (always rounded-up to nearest pixel)
|
|
ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
|
|
ImVec2 SizeFull; // Size when non collapsed
|
|
ImVec2 ContentSize; // Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding.
|
|
ImVec2 ContentSizeIdeal;
|
|
ImVec2 ContentSizeExplicit; // Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
|
|
ImVec2 WindowPadding; // Window padding at the time of Begin().
|
|
float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
|
|
float WindowBorderSize; // Window border size at the time of Begin().
|
|
float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
|
|
float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
|
|
float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
|
|
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
|
|
ImGuiID MoveId; // == window->GetID("#MOVE")
|
|
ImGuiID TabId; // == window->GetID("#TAB")
|
|
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
|
|
ImVec2 Scroll;
|
|
ImVec2 ScrollMax;
|
|
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
|
|
ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
|
|
ImVec2 ScrollTargetEdgeSnapDist; // 0.0f = no snapping, >0.0f snapping threshold
|
|
ImVec2 ScrollbarSizes; // Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar.
|
|
bool ScrollbarX, ScrollbarY; // Are scrollbars visible?
|
|
bool ViewportOwned;
|
|
bool Active; // Set to true on Begin(), unless Collapsed
|
|
bool WasActive;
|
|
bool WriteAccessed; // Set to true when any widget access the current window
|
|
bool Collapsed; // Set when collapsing window to become only title-bar
|
|
bool WantCollapseToggle;
|
|
bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed)
|
|
bool SkipRefresh; // [EXPERIMENTAL] Reuse previous frame drawn contents, Begin() returns false.
|
|
bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
|
|
bool Hidden; // Do not display (== HiddenFrames*** > 0)
|
|
bool IsFallbackWindow; // Set on the "Debug##Default" window.
|
|
bool IsExplicitChild; // Set when passed _ChildWindow, left to false by BeginDocked()
|
|
bool HasCloseButton; // Set when the window has a close button (p_open != NULL)
|
|
signed char ResizeBorderHovered; // Current border being hovered for resize (-1: none, otherwise 0-3)
|
|
signed char ResizeBorderHeld; // Current border being held for resize (-1: none, otherwise 0-3)
|
|
short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
|
|
short BeginCountPreviousFrame; // Number of Begin() during the previous frame
|
|
short BeginOrderWithinParent; // Begin() order within immediate parent window, if we are a child window. Otherwise 0.
|
|
short BeginOrderWithinContext; // Begin() order within entire imgui context. This is mostly used for debugging submission order related issues.
|
|
short FocusOrder; // Order within WindowsFocusOrder[], altered when windows are focused.
|
|
ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
|
|
ImS8 AutoFitFramesX, AutoFitFramesY;
|
|
bool AutoFitOnlyGrows;
|
|
ImGuiDir AutoPosLastDirection;
|
|
ImS8 HiddenFramesCanSkipItems; // Hide the window for N frames
|
|
ImS8 HiddenFramesCannotSkipItems; // Hide the window for N frames while allowing items to be submitted so we can measure their size
|
|
ImS8 HiddenFramesForRenderOnly; // Hide the window until frame N at Render() time only
|
|
ImS8 DisableInputsFrames; // Disable window interactions for N frames
|
|
ImGuiCond SetWindowPosAllowFlags : 8; // store acceptable condition flags for SetNextWindowPos() use.
|
|
ImGuiCond SetWindowSizeAllowFlags : 8; // store acceptable condition flags for SetNextWindowSize() use.
|
|
ImGuiCond SetWindowCollapsedAllowFlags : 8; // store acceptable condition flags for SetNextWindowCollapsed() use.
|
|
ImGuiCond SetWindowDockAllowFlags : 8; // store acceptable condition flags for SetNextWindowDock() use.
|
|
ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
|
|
ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0, 0) when positioning from top-left corner; ImVec2(0.5f, 0.5f) for centering; ImVec2(1, 1) for bottom right.
|
|
|
|
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure)
|
|
ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
|
|
|
|
// The best way to understand what those rectangles are is to use the 'Metrics->Tools->Show Windows Rectangles' viewer.
|
|
// The main 'OuterRect', omitted as a field, is window->Rect().
|
|
ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
|
|
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar)
|
|
ImRect InnerClipRect; // == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect.
|
|
ImRect WorkRect; // Initially covers the whole scrolling region. Reduced by containers e.g columns/tables when active. Shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward).
|
|
ImRect ParentWorkRect; // Backup of WorkRect before entering a container such as columns/tables. Used by e.g. SpanAllColumns functions to easily access. Stacked containers are responsible for maintaining this. // FIXME-WORKRECT: Could be a stack?
|
|
ImRect ClipRect; // Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back().
|
|
ImRect ContentRegionRect; // FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on.
|
|
ImVec2ih HitTestHoleSize; // Define an optional rectangular hole where mouse will pass-through the window.
|
|
ImVec2ih HitTestHoleOffset;
|
|
|
|
int LastFrameActive; // Last frame number the window was Active.
|
|
int LastFrameJustFocused; // Last frame number the window was made Focused.
|
|
float LastTimeActive; // Last timestamp the window was Active (using float as we don't need high precision there)
|
|
float ItemWidthDefault;
|
|
ImGuiStorage StateStorage;
|
|
ImVector<ImGuiOldColumns> ColumnsStorage;
|
|
float FontWindowScale; // User scale multiplier per-window, via SetWindowFontScale()
|
|
float FontDpiScale;
|
|
int SettingsOffset; // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back)
|
|
|
|
ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
|
|
ImDrawList DrawListInst;
|
|
ImGuiWindow* ParentWindow; // If we are a child _or_ popup _or_ docked window, this is pointing to our parent. Otherwise NULL.
|
|
ImGuiWindow* ParentWindowInBeginStack;
|
|
ImGuiWindow* RootWindow; // Point to ourself or first ancestor that is not a child window. Doesn't cross through popups/dock nodes.
|
|
ImGuiWindow* RootWindowPopupTree; // Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child.
|
|
ImGuiWindow* RootWindowDockTree; // Point to ourself or first ancestor that is not a child window. Cross through dock nodes.
|
|
ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
|
|
ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag.
|
|
ImGuiWindow* ParentWindowForFocusRoute; // Set to manual link a window to its logical parent so that Shortcut() chain are honoerd (e.g. Tool linked to Document)
|
|
|
|
ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
|
|
ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1)
|
|
ImRect NavRectRel[ImGuiNavLayer_COUNT]; // Reference rectangle, in window relative space
|
|
ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT]; // Preferred X/Y position updated when moving on a given axis, reset to FLT_MAX.
|
|
ImGuiID NavRootFocusScopeId; // Focus Scope ID at the time of Begin()
|
|
|
|
int MemoryDrawListIdxCapacity; // Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
|
|
int MemoryDrawListVtxCapacity;
|
|
bool MemoryCompacted; // Set when window extraneous data have been garbage collected
|
|
|
|
// Docking
|
|
bool DockIsActive :1; // When docking artifacts are actually visible. When this is set, DockNode is guaranteed to be != NULL. ~~ (DockNode != NULL) && (DockNode->Windows.Size > 1).
|
|
bool DockNodeIsVisible :1;
|
|
bool DockTabIsVisible :1; // Is our window visible this frame? ~~ is the corresponding tab selected?
|
|
bool DockTabWantClose :1;
|
|
short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
|
|
ImGuiWindowDockStyle DockStyle;
|
|
ImGuiDockNode* DockNode; // Which node are we docked into. Important: Prefer testing DockIsActive in many cases as this will still be set when the dock node is hidden.
|
|
ImGuiDockNode* DockNodeAsHost; // Which node are we owning (for parent windows)
|
|
ImGuiID DockId; // Backup of last valid DockNode->ID, so single window remember their dock node id even when they are not bound any more
|
|
ImGuiItemStatusFlags DockTabItemStatusFlags;
|
|
ImRect DockTabItemRect;
|
|
|
|
public:
|
|
ImGuiWindow(ImGuiContext* context, const char* name);
|
|
~ImGuiWindow();
|
|
|
|
ImGuiID GetID(const char* str, const char* str_end = NULL);
|
|
ImGuiID GetID(const void* ptr);
|
|
ImGuiID GetID(int n);
|
|
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
|
|
|
|
// We don't use g.FontSize because the window may be != g.CurrentWindow.
|
|
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
|
float CalcFontSize() const { ImGuiContext& g = *Ctx; float scale = g.FontBaseSize * FontWindowScale * FontDpiScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
|
|
float TitleBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
|
|
ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
|
|
float MenuBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
|
|
ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Tab bar, Tab item support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Extend ImGuiTabBarFlags_
|
|
enum ImGuiTabBarFlagsPrivate_
|
|
{
|
|
ImGuiTabBarFlags_DockNode = 1 << 20, // Part of a dock node [we don't use this in the master branch but it facilitate branch syncing to keep this around]
|
|
ImGuiTabBarFlags_IsFocused = 1 << 21,
|
|
ImGuiTabBarFlags_SaveSettings = 1 << 22, // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
|
|
};
|
|
|
|
// Extend ImGuiTabItemFlags_
|
|
enum ImGuiTabItemFlagsPrivate_
|
|
{
|
|
ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
|
|
ImGuiTabItemFlags_NoCloseButton = 1 << 20, // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout)
|
|
ImGuiTabItemFlags_Button = 1 << 21, // Used by TabItemButton, change the tab item behavior to mimic a button
|
|
ImGuiTabItemFlags_Unsorted = 1 << 22, // [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.
|
|
};
|
|
|
|
// Storage for one active tab item (sizeof() 48 bytes)
|
|
struct ImGuiTabItem
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiTabItemFlags Flags;
|
|
ImGuiWindow* Window; // When TabItem is part of a DockNode's TabBar, we hold on to a window.
|
|
int LastFrameVisible;
|
|
int LastFrameSelected; // This allows us to infer an ordered list of the last activated tabs with little maintenance
|
|
float Offset; // Position relative to beginning of tab
|
|
float Width; // Width currently displayed
|
|
float ContentWidth; // Width of label, stored during BeginTabItem() call
|
|
float RequestedWidth; // Width optionally requested by caller, -1.0f is unused
|
|
ImS32 NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
|
|
ImS16 BeginOrder; // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
|
|
ImS16 IndexDuringLayout; // Index only used during TabBarLayout(). Tabs gets reordered so 'Tabs[n].IndexDuringLayout == n' but may mismatch during additions.
|
|
bool WantClose; // Marked as closed by SetTabItemClosed()
|
|
|
|
ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
|
|
};
|
|
|
|
// Storage for a tab bar (sizeof() 152 bytes)
|
|
struct IMGUI_API ImGuiTabBar
|
|
{
|
|
ImVector<ImGuiTabItem> Tabs;
|
|
ImGuiTabBarFlags Flags;
|
|
ImGuiID ID; // Zero for tab-bars used by docking
|
|
ImGuiID SelectedTabId; // Selected tab/window
|
|
ImGuiID NextSelectedTabId; // Next selected tab/window. Will also trigger a scrolling animation
|
|
ImGuiID VisibleTabId; // Can occasionally be != SelectedTabId (e.g. when previewing contents for CTRL+TAB preview)
|
|
int CurrFrameVisible;
|
|
int PrevFrameVisible;
|
|
ImRect BarRect;
|
|
float CurrTabsContentsHeight;
|
|
float PrevTabsContentsHeight; // Record the height of contents submitted below the tab bar
|
|
float WidthAllTabs; // Actual width of all tabs (locked during layout)
|
|
float WidthAllTabsIdeal; // Ideal width if all tabs were visible and not clipped
|
|
float ScrollingAnim;
|
|
float ScrollingTarget;
|
|
float ScrollingTargetDistToVisibility;
|
|
float ScrollingSpeed;
|
|
float ScrollingRectMinX;
|
|
float ScrollingRectMaxX;
|
|
float SeparatorMinX;
|
|
float SeparatorMaxX;
|
|
ImGuiID ReorderRequestTabId;
|
|
ImS16 ReorderRequestOffset;
|
|
ImS8 BeginCount;
|
|
bool WantLayout;
|
|
bool VisibleTabWasSubmitted;
|
|
bool TabsAddedNew; // Set to true when a new tab item or button has been added to the tab bar during last frame
|
|
ImS16 TabsActiveCount; // Number of tabs submitted this frame.
|
|
ImS16 LastTabItemIdx; // Index of last BeginTabItem() tab for use by EndTabItem()
|
|
float ItemSpacingY;
|
|
ImVec2 FramePadding; // style.FramePadding locked at the time of BeginTabBar()
|
|
ImVec2 BackupCursorPos;
|
|
ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer.
|
|
|
|
ImGuiTabBar();
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Table support
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
|
|
#define IMGUI_TABLE_MAX_COLUMNS 512 // May be further lifted
|
|
|
|
// Our current column maximum is 64 but we may raise that in the future.
|
|
typedef ImS16 ImGuiTableColumnIdx;
|
|
typedef ImU16 ImGuiTableDrawChannelIdx;
|
|
|
|
// [Internal] sizeof() ~ 112
|
|
// We use the terminology "Enabled" to refer to a column that is not Hidden by user/api.
|
|
// We use the terminology "Clipped" to refer to a column that is out of sight because of scrolling/clipping.
|
|
// This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
|
|
struct ImGuiTableColumn
|
|
{
|
|
ImGuiTableColumnFlags Flags; // Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_
|
|
float WidthGiven; // Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space.
|
|
float MinX; // Absolute positions
|
|
float MaxX;
|
|
float WidthRequest; // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
|
|
float WidthAuto; // Automatic width
|
|
float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
|
|
float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
|
|
ImRect ClipRect; // Clipping rectangle for the column
|
|
ImGuiID UserID; // Optional, value passed to TableSetupColumn()
|
|
float WorkMinX; // Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column
|
|
float WorkMaxX; // Contents region max ~(MaxX - CellPaddingX - CellSpacingX2)
|
|
float ItemWidth; // Current item width for the column, preserved across rows
|
|
float ContentMaxXFrozen; // Contents maximum position for frozen rows (apart from headers), from which we can infer content width.
|
|
float ContentMaxXUnfrozen;
|
|
float ContentMaxXHeadersUsed; // Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
|
|
float ContentMaxXHeadersIdeal;
|
|
ImS16 NameOffset; // Offset into parent ColumnsNames[]
|
|
ImGuiTableColumnIdx DisplayOrder; // Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
|
|
ImGuiTableColumnIdx IndexWithinEnabledSet; // Index within enabled/visible set (<= IndexToDisplayOrder)
|
|
ImGuiTableColumnIdx PrevEnabledColumn; // Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
|
|
ImGuiTableColumnIdx NextEnabledColumn; // Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
|
|
ImGuiTableColumnIdx SortOrder; // Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
|
|
ImGuiTableDrawChannelIdx DrawChannelCurrent; // Index within DrawSplitter.Channels[]
|
|
ImGuiTableDrawChannelIdx DrawChannelFrozen; // Draw channels for frozen rows (often headers)
|
|
ImGuiTableDrawChannelIdx DrawChannelUnfrozen; // Draw channels for unfrozen rows
|
|
bool IsEnabled; // IsUserEnabled && (Flags & ImGuiTableColumnFlags_Disabled) == 0
|
|
bool IsUserEnabled; // Is the column not marked Hidden by the user? (unrelated to being off view, e.g. clipped by scrolling).
|
|
bool IsUserEnabledNextFrame;
|
|
bool IsVisibleX; // Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled).
|
|
bool IsVisibleY;
|
|
bool IsRequestOutput; // Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not.
|
|
bool IsSkipItems; // Do we want item submissions to this column to be completely ignored (no layout will happen).
|
|
bool IsPreserveWidthAuto;
|
|
ImS8 NavLayerCurrent; // ImGuiNavLayer in 1 byte
|
|
ImU8 AutoFitQueue; // Queue of 8 values for the next 8 frames to request auto-fit
|
|
ImU8 CannotSkipItemsQueue; // Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
|
|
ImU8 SortDirection : 2; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
|
|
ImU8 SortDirectionsAvailCount : 2; // Number of available sort directions (0 to 3)
|
|
ImU8 SortDirectionsAvailMask : 4; // Mask of available sort directions (1-bit each)
|
|
ImU8 SortDirectionsAvailList; // Ordered list of available sort directions (2-bits each, total 8-bits)
|
|
|
|
ImGuiTableColumn()
|
|
{
|
|
memset(this, 0, sizeof(*this));
|
|
StretchWeight = WidthRequest = -1.0f;
|
|
NameOffset = -1;
|
|
DisplayOrder = IndexWithinEnabledSet = -1;
|
|
PrevEnabledColumn = NextEnabledColumn = -1;
|
|
SortOrder = -1;
|
|
SortDirection = ImGuiSortDirection_None;
|
|
DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
|
|
}
|
|
};
|
|
|
|
// Transient cell data stored per row.
|
|
// sizeof() ~ 6 bytes
|
|
struct ImGuiTableCellData
|
|
{
|
|
ImU32 BgColor; // Actual color
|
|
ImGuiTableColumnIdx Column; // Column number
|
|
};
|
|
|
|
// Parameters for TableAngledHeadersRowEx()
|
|
// This may end up being refactored for more general purpose.
|
|
// sizeof() ~ 12 bytes
|
|
struct ImGuiTableHeaderData
|
|
{
|
|
ImGuiTableColumnIdx Index; // Column index
|
|
ImU32 TextColor;
|
|
ImU32 BgColor0;
|
|
ImU32 BgColor1;
|
|
};
|
|
|
|
// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?)
|
|
// sizeof() ~ 24 bytes
|
|
struct ImGuiTableInstanceData
|
|
{
|
|
ImGuiID TableInstanceID;
|
|
float LastOuterHeight; // Outer height from last frame
|
|
float LastTopHeadersRowHeight; // Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set)
|
|
float LastFrozenHeight; // Height of frozen section from last frame
|
|
int HoveredRowLast; // Index of row which was hovered last frame.
|
|
int HoveredRowNext; // Index of row hovered this frame, set after encountering it.
|
|
|
|
ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
|
|
};
|
|
|
|
// sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory()
|
|
struct IMGUI_API ImGuiTable
|
|
{
|
|
ImGuiID ID;
|
|
ImGuiTableFlags Flags;
|
|
void* RawData; // Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
|
|
ImGuiTableTempData* TempData; // Transient data while table is active. Point within g.CurrentTableStack[]
|
|
ImSpan<ImGuiTableColumn> Columns; // Point within RawData[]
|
|
ImSpan<ImGuiTableColumnIdx> DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
|
|
ImSpan<ImGuiTableCellData> RowCellData; // Point within RawData[]. Store cells background requests for current row.
|
|
ImBitArrayPtr EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map
|
|
ImBitArrayPtr EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
|
|
ImBitArrayPtr VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
|
|
ImGuiTableFlags SettingsLoadedFlags; // Which data were loaded from the .ini file (e.g. when order is not altered we won't save order)
|
|
int SettingsOffset; // Offset in g.SettingsTables
|
|
int LastFrameActive;
|
|
int ColumnsCount; // Number of columns declared in BeginTable()
|
|
int CurrentRow;
|
|
int CurrentColumn;
|
|
ImS16 InstanceCurrent; // Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched.
|
|
ImS16 InstanceInteracted; // Mark which instance (generally 0) of the same ID is being interacted with
|
|
float RowPosY1;
|
|
float RowPosY2;
|
|
float RowMinHeight; // Height submitted to TableNextRow()
|
|
float RowCellPaddingY; // Top and bottom padding. Reloaded during row change.
|
|
float RowTextBaseline;
|
|
float RowIndentOffsetX;
|
|
ImGuiTableRowFlags RowFlags : 16; // Current row flags, see ImGuiTableRowFlags_
|
|
ImGuiTableRowFlags LastRowFlags : 16;
|
|
int RowBgColorCounter; // Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don't increase this.
|
|
ImU32 RowBgColor[2]; // Background color override for current row.
|
|
ImU32 BorderColorStrong;
|
|
ImU32 BorderColorLight;
|
|
float BorderX1;
|
|
float BorderX2;
|
|
float HostIndentX;
|
|
float MinColumnWidth;
|
|
float OuterPaddingX;
|
|
float CellPaddingX; // Padding from each borders. Locked in BeginTable()/Layout.
|
|
float CellSpacingX1; // Spacing between non-bordered cells. Locked in BeginTable()/Layout.
|
|
float CellSpacingX2;
|
|
float InnerWidth; // User value passed to BeginTable(), see comments at the top of BeginTable() for details.
|
|
float ColumnsGivenWidth; // Sum of current column width
|
|
float ColumnsAutoFitWidth; // Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
|
|
float ColumnsStretchSumWeights; // Sum of weight of all enabled stretching columns
|
|
float ResizedColumnNextWidth;
|
|
float ResizeLockMinContentsX2; // Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table.
|
|
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
|
|
float AngledHeadersHeight; // Set by TableAngledHeadersRow(), used in TableUpdateLayout()
|
|
float AngledHeadersSlope; // Set by TableAngledHeadersRow(), used in TableUpdateLayout()
|
|
ImRect OuterRect; // Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
|
|
ImRect InnerRect; // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is
|
|
ImRect WorkRect;
|
|
ImRect InnerClipRect;
|
|
ImRect BgClipRect; // We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries
|
|
ImRect Bg0ClipRectForDrawCmd; // Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
|
|
ImRect Bg2ClipRectForDrawCmd; // Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect.
|
|
ImRect HostClipRect; // This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
|
|
ImRect HostBackupInnerClipRect; // Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground()
|
|
ImGuiWindow* OuterWindow; // Parent window for the table
|
|
ImGuiWindow* InnerWindow; // Window holding the table data (== OuterWindow or a child window)
|
|
ImGuiTextBuffer ColumnsNames; // Contiguous buffer holding columns names
|
|
ImDrawListSplitter* DrawSplitter; // Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly
|
|
ImGuiTableInstanceData InstanceDataFirst;
|
|
ImVector<ImGuiTableInstanceData> InstanceDataExtra; // FIXME-OPT: Using a small-vector pattern would be good.
|
|
ImGuiTableColumnSortSpecs SortSpecsSingle;
|
|
ImVector<ImGuiTableColumnSortSpecs> SortSpecsMulti; // FIXME-OPT: Using a small-vector pattern would be good.
|
|
ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs()
|
|
ImGuiTableColumnIdx SortSpecsCount;
|
|
ImGuiTableColumnIdx ColumnsEnabledCount; // Number of enabled columns (<= ColumnsCount)
|
|
ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns using fixed width (<= ColumnsCount)
|
|
ImGuiTableColumnIdx DeclColumnsCount; // Count calls to TableSetupColumn()
|
|
ImGuiTableColumnIdx AngledHeadersCount; // Count columns with angled headers
|
|
ImGuiTableColumnIdx HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
|
|
ImGuiTableColumnIdx HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing).
|
|
ImGuiTableColumnIdx HighlightColumnHeader; // Index of column which should be highlighted.
|
|
ImGuiTableColumnIdx AutoFitSingleColumn; // Index of single column requesting auto-fit.
|
|
ImGuiTableColumnIdx ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0.
|
|
ImGuiTableColumnIdx LastResizedColumn; // Index of column being resized from previous frame.
|
|
ImGuiTableColumnIdx HeldHeaderColumn; // Index of column header being held.
|
|
ImGuiTableColumnIdx ReorderColumn; // Index of column being reordered. (not cleared)
|
|
ImGuiTableColumnIdx ReorderColumnDir; // -1 or +1
|
|
ImGuiTableColumnIdx LeftMostEnabledColumn; // Index of left-most non-hidden column.
|
|
ImGuiTableColumnIdx RightMostEnabledColumn; // Index of right-most non-hidden column.
|
|
ImGuiTableColumnIdx LeftMostStretchedColumn; // Index of left-most stretched column.
|
|
ImGuiTableColumnIdx RightMostStretchedColumn; // Index of right-most stretched column.
|
|
ImGuiTableColumnIdx ContextPopupColumn; // Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
|
|
ImGuiTableColumnIdx FreezeRowsRequest; // Requested frozen rows count
|
|
ImGuiTableColumnIdx FreezeRowsCount; // Actual frozen row count (== FreezeRowsRequest, or == 0 when no scrolling offset)
|
|
ImGuiTableColumnIdx FreezeColumnsRequest; // Requested frozen columns count
|
|
ImGuiTableColumnIdx FreezeColumnsCount; // Actual frozen columns count (== FreezeColumnsRequest, or == 0 when no scrolling offset)
|
|
ImGuiTableColumnIdx RowCellDataCurrent; // Index of current RowCellData[] entry in current row
|
|
ImGuiTableDrawChannelIdx DummyDrawChannel; // Redirect non-visible columns here.
|
|
ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent; // For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[]
|
|
ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
|
|
bool IsLayoutLocked; // Set by TableUpdateLayout() which is called when beginning the first row.
|
|
bool IsInsideRow; // Set when inside TableBeginRow()/TableEndRow().
|
|
bool IsInitializing;
|
|
bool IsSortSpecsDirty;
|
|
bool IsUsingHeaders; // Set when the first row had the ImGuiTableRowFlags_Headers flag.
|
|
bool IsContextPopupOpen; // Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
|
|
bool DisableDefaultContextMenu; // Disable default context menu contents. You may submit your own using TableBeginContextMenuPopup()/EndPopup()
|
|
bool IsSettingsRequestLoad;
|
|
bool IsSettingsDirty; // Set when table settings have changed and needs to be reported into ImGuiTableSetttings data.
|
|
bool IsDefaultDisplayOrder; // Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
|
|
bool IsResetAllRequest;
|
|
bool IsResetDisplayOrderRequest;
|
|
bool IsUnfrozenRows; // Set when we got past the frozen row.
|
|
bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable()
|
|
bool IsActiveIdAliveBeforeTable;
|
|
bool IsActiveIdInTable;
|
|
bool HasScrollbarYCurr; // Whether ANY instance of this table had a vertical scrollbar during the current frame.
|
|
bool HasScrollbarYPrev; // Whether ANY instance of this table had a vertical scrollbar during the previous.
|
|
bool MemoryCompacted;
|
|
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
|
|
|
|
ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
|
|
~ImGuiTable() { IM_FREE(RawData); }
|
|
};
|
|
|
|
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
|
|
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
|
|
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
|
|
// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs.
|
|
// sizeof() ~ 136 bytes.
|
|
struct IMGUI_API ImGuiTableTempData
|
|
{
|
|
int TableIndex; // Index in g.Tables.Buf[] pool
|
|
float LastTimeActive; // Last timestamp this structure was used
|
|
float AngledHeadersExtraWidth; // Used in EndTable()
|
|
ImVector<ImGuiTableHeaderData> AngledHeadersRequests; // Used in TableAngledHeadersRow()
|
|
|
|
ImVec2 UserOuterSize; // outer_size.x passed to BeginTable()
|
|
ImDrawListSplitter DrawSplitter;
|
|
|
|
ImRect HostBackupWorkRect; // Backup of InnerWindow->WorkRect at the end of BeginTable()
|
|
ImRect HostBackupParentWorkRect; // Backup of InnerWindow->ParentWorkRect at the end of BeginTable()
|
|
ImVec2 HostBackupPrevLineSize; // Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable()
|
|
ImVec2 HostBackupCurrLineSize; // Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable()
|
|
ImVec2 HostBackupCursorMaxPos; // Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
|
|
ImVec1 HostBackupColumnsOffset; // Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable()
|
|
float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
|
|
int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
|
|
|
|
ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
|
|
};
|
|
|
|
// sizeof() ~ 12
|
|
struct ImGuiTableColumnSettings
|
|
{
|
|
float WidthOrWeight;
|
|
ImGuiID UserID;
|
|
ImGuiTableColumnIdx Index;
|
|
ImGuiTableColumnIdx DisplayOrder;
|
|
ImGuiTableColumnIdx SortOrder;
|
|
ImU8 SortDirection : 2;
|
|
ImU8 IsEnabled : 1; // "Visible" in ini file
|
|
ImU8 IsStretch : 1;
|
|
|
|
ImGuiTableColumnSettings()
|
|
{
|
|
WidthOrWeight = 0.0f;
|
|
UserID = 0;
|
|
Index = -1;
|
|
DisplayOrder = SortOrder = -1;
|
|
SortDirection = ImGuiSortDirection_None;
|
|
IsEnabled = 1;
|
|
IsStretch = 0;
|
|
}
|
|
};
|
|
|
|
// This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
|
|
struct ImGuiTableSettings
|
|
{
|
|
ImGuiID ID; // Set to 0 to invalidate/delete the setting
|
|
ImGuiTableFlags SaveFlags; // Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
|
|
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
|
|
ImGuiTableColumnIdx ColumnsCount;
|
|
ImGuiTableColumnIdx ColumnsCountMax; // Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
|
|
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
|
|
|
|
ImGuiTableSettings() { memset(this, 0, sizeof(*this)); }
|
|
ImGuiTableColumnSettings* GetColumnSettings() { return (ImGuiTableColumnSettings*)(this + 1); }
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] ImGui internal API
|
|
// No guarantee of forward compatibility here!
|
|
//-----------------------------------------------------------------------------
|
|
|
|
namespace ImGui
|
|
{
|
|
// Windows
|
|
// We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
|
|
// If this ever crash because g.CurrentWindow is NULL it means that either
|
|
// - ImGui::NewFrame() has never been called, which is illegal.
|
|
// - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
|
|
inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; }
|
|
inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; }
|
|
IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id);
|
|
IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
|
|
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);
|
|
IMGUI_API void UpdateWindowSkipRefresh(ImGuiWindow* window);
|
|
IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);
|
|
IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy, bool dock_hierarchy);
|
|
IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
|
|
IMGUI_API bool IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below);
|
|
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);
|
|
IMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond = 0);
|
|
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);
|
|
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);
|
|
IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);
|
|
IMGUI_API void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window);
|
|
inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; } // You may also use SetNextWindowClass()'s FocusRouteParentWindowId field.
|
|
inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); }
|
|
inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); }
|
|
inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); }
|
|
|
|
// Windows: Display Order and Focus Order
|
|
IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
|
|
IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);
|
|
IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);
|
|
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);
|
|
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);
|
|
IMGUI_API void BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* above_window);
|
|
IMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window);
|
|
IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);
|
|
|
|
// Windows: Idle, Refresh Policies [EXPERIMENTAL]
|
|
IMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
|
|
|
|
// Fonts, drawing
|
|
IMGUI_API void SetCurrentFont(ImFont* font);
|
|
inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
|
|
inline ImDrawList* GetForegroundDrawList(ImGuiWindow* window) { return GetForegroundDrawList(window->Viewport); }
|
|
IMGUI_API void AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);
|
|
|
|
// Init
|
|
IMGUI_API void Initialize();
|
|
IMGUI_API void Shutdown(); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
|
|
|
|
// NewFrame
|
|
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);
|
|
IMGUI_API void UpdateHoveredWindowAndCaptureFlags();
|
|
IMGUI_API void FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window);
|
|
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
|
|
IMGUI_API void StartMouseMovingWindowOrNode(ImGuiWindow* window, ImGuiDockNode* node, bool undock);
|
|
IMGUI_API void UpdateMouseMovingWindowNewFrame();
|
|
IMGUI_API void UpdateMouseMovingWindowEndFrame();
|
|
|
|
// Generic context hooks
|
|
IMGUI_API ImGuiID AddContextHook(ImGuiContext* context, const ImGuiContextHook* hook);
|
|
IMGUI_API void RemoveContextHook(ImGuiContext* context, ImGuiID hook_to_remove);
|
|
IMGUI_API void CallContextHooks(ImGuiContext* context, ImGuiContextHookType type);
|
|
|
|
// Viewports
|
|
IMGUI_API void TranslateWindowsInViewport(ImGuiViewportP* viewport, const ImVec2& old_pos, const ImVec2& new_pos);
|
|
IMGUI_API void ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale);
|
|
IMGUI_API void DestroyPlatformWindow(ImGuiViewportP* viewport);
|
|
IMGUI_API void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);
|
|
IMGUI_API void SetCurrentViewport(ImGuiWindow* window, ImGuiViewportP* viewport);
|
|
IMGUI_API const ImGuiPlatformMonitor* GetViewportPlatformMonitor(ImGuiViewport* viewport);
|
|
IMGUI_API ImGuiViewportP* FindHoveredViewportFromPlatformWindowStack(const ImVec2& mouse_platform_pos);
|
|
|
|
// Settings
|
|
IMGUI_API void MarkIniSettingsDirty();
|
|
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
|
|
IMGUI_API void ClearIniSettings();
|
|
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);
|
|
IMGUI_API void RemoveSettingsHandler(const char* type_name);
|
|
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
|
|
|
|
// Settings - Windows
|
|
IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);
|
|
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id);
|
|
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);
|
|
IMGUI_API void ClearWindowSettings(const char* name);
|
|
|
|
// Localization
|
|
IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count);
|
|
inline const char* LocalizeGetMsg(ImGuiLocKey key) { ImGuiContext& g = *GImGui; const char* msg = g.LocalizationTable[key]; return msg ? msg : "*Missing Text*"; }
|
|
|
|
// Scrolling
|
|
IMGUI_API void SetScrollX(ImGuiWindow* window, float scroll_x);
|
|
IMGUI_API void SetScrollY(ImGuiWindow* window, float scroll_y);
|
|
IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio);
|
|
IMGUI_API void SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio);
|
|
|
|
// Early work-in-progress API (ScrollToItem() will become public)
|
|
IMGUI_API void ScrollToItem(ImGuiScrollFlags flags = 0);
|
|
IMGUI_API void ScrollToRect(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);
|
|
IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);
|
|
//#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
inline void ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
|
|
//#endif
|
|
|
|
// Basic Accessors
|
|
inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
|
|
inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
|
|
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
|
inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; }
|
|
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
|
|
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);
|
|
IMGUI_API void ClearActiveID();
|
|
IMGUI_API ImGuiID GetHoveredID();
|
|
IMGUI_API void SetHoveredID(ImGuiID id);
|
|
IMGUI_API void KeepAliveID(ImGuiID id);
|
|
IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
|
|
IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
|
|
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
|
|
IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);
|
|
|
|
// Basic Helpers for widget code
|
|
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
|
|
inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); } // FIXME: This is a misleading API since we expect CursorPos to be bb.Min.
|
|
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
|
|
IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags);
|
|
IMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
|
|
IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id);
|
|
IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);
|
|
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h);
|
|
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
|
|
IMGUI_API void PushMultiItemsWidths(int components, float width_full);
|
|
IMGUI_API bool IsItemToggledSelection(); // Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
|
|
IMGUI_API ImVec2 GetContentRegionMaxAbs();
|
|
IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess);
|
|
|
|
// Parameter stacks (shared)
|
|
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
|
|
IMGUI_API void PopItemFlag();
|
|
IMGUI_API const ImGuiDataVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);
|
|
|
|
// Logging/Capture
|
|
IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
|
|
IMGUI_API void LogToBuffer(int auto_open_depth = -1); // Start logging/capturing to internal buffer
|
|
IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL);
|
|
IMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix);
|
|
|
|
// Popups, Modals, Tooltips
|
|
IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
|
|
IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
|
|
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);
|
|
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);
|
|
IMGUI_API void ClosePopupsExceptModals();
|
|
IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);
|
|
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
|
|
IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
|
|
IMGUI_API bool BeginTooltipHidden();
|
|
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
|
|
IMGUI_API ImGuiWindow* GetTopMostPopupModal();
|
|
IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();
|
|
IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);
|
|
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);
|
|
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
|
|
|
|
// Menus
|
|
IMGUI_API bool BeginViewportSideBar(const char* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags window_flags);
|
|
IMGUI_API bool BeginMenuEx(const char* label, const char* icon, bool enabled = true);
|
|
IMGUI_API bool MenuItemEx(const char* label, const char* icon, const char* shortcut = NULL, bool selected = false, bool enabled = true);
|
|
|
|
// Combos
|
|
IMGUI_API bool BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags flags);
|
|
IMGUI_API bool BeginComboPreview();
|
|
IMGUI_API void EndComboPreview();
|
|
|
|
// Gamepad/Keyboard Navigation
|
|
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
|
|
IMGUI_API void NavInitRequestApplyResult();
|
|
IMGUI_API bool NavMoveRequestButNoResultYet();
|
|
IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
|
|
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
|
|
IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);
|
|
IMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiNavTreeNodeData* tree_node_data);
|
|
IMGUI_API void NavMoveRequestCancel();
|
|
IMGUI_API void NavMoveRequestApplyResult();
|
|
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
|
|
IMGUI_API void NavHighlightActivated(ImGuiID id);
|
|
IMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis);
|
|
IMGUI_API void NavRestoreHighlightAfterMove();
|
|
IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();
|
|
IMGUI_API void SetNavWindow(ImGuiWindow* window);
|
|
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);
|
|
IMGUI_API void SetNavFocusScope(ImGuiID focus_scope_id);
|
|
|
|
// Focus/Activation
|
|
// This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are
|
|
// much harder to design and implement than expected. I have a couple of private branches on this matter but it's not simple. For now implementing the easy ones.
|
|
IMGUI_API void FocusItem(); // Focus last item (no selection/activation).
|
|
IMGUI_API void ActivateItemByID(ImGuiID id); // Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again.
|
|
|
|
// Inputs
|
|
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
|
|
inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
|
|
inline bool IsNamedKeyOrMod(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; }
|
|
inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
|
|
inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
|
|
inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
|
|
inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
|
|
inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
|
|
inline bool IsModKey(ImGuiKey key) { return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
|
|
ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
|
|
inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
|
|
{
|
|
if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl;
|
|
if (key == ImGuiMod_Shift) return ImGuiKey_ReservedForModShift;
|
|
if (key == ImGuiMod_Alt) return ImGuiKey_ReservedForModAlt;
|
|
if (key == ImGuiMod_Super) return ImGuiKey_ReservedForModSuper;
|
|
return key;
|
|
}
|
|
|
|
IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
|
|
inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui; return GetKeyData(&g, key); }
|
|
IMGUI_API const char* GetKeyChordName(ImGuiKeyChord key_chord);
|
|
inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
|
|
IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);
|
|
IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
|
|
IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis);
|
|
IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);
|
|
IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate);
|
|
IMGUI_API void TeleportMousePos(const ImVec2& pos);
|
|
IMGUI_API void SetActiveIdUsingAllKeyboardKeys();
|
|
inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
|
|
|
|
// [EXPERIMENTAL] Low-Level: Key/Input Ownership
|
|
// - The idea is that instead of "eating" a given input, we can link to an owner id.
|
|
// - Ownership is most often claimed as a result of reacting to a press/down event (but occasionally may be claimed ahead).
|
|
// - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID.
|
|
// - Legacy input queries (without specifying an owner or _Any or _None) are equivalent to using ImGuiKeyOwner_Any (== 0).
|
|
// - Input ownership is automatically released on the frame after a key is released. Therefore:
|
|
// - for ownership registration happening as a result of a down/press event, the SetKeyOwner() call may be done once (common case).
|
|
// - for ownership registration happening ahead of a down/press event, the SetKeyOwner() call needs to be made every frame (happens if e.g. claiming ownership on hover).
|
|
// - SetItemKeyOwner() is a shortcut for common simple case. A custom widget will probably want to call SetKeyOwner() multiple times directly based on its interaction state.
|
|
// - This is marked experimental because not all widgets are fully honoring the Set/Test idioms. We will need to move forward step by step.
|
|
// Please open a GitHub Issue to submit your usage scenario or if there's a use case you need solved.
|
|
IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
|
|
IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
|
IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
|
IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
|
|
IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id'
|
|
inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
|
|
|
|
// [EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership
|
|
// - Important: legacy IsKeyPressed(ImGuiKey, bool repeat=true) _DEFAULTS_ to repeat, new IsKeyPressed() requires _EXPLICIT_ ImGuiInputFlags_Repeat flag.
|
|
// - Expected to be later promoted to public API, the prototypes are designed to replace existing ones (since owner_id can default to Any == 0)
|
|
// - Specifying a value for 'ImGuiID owner' will test that EITHER the key is NOT owned (UNLESS locked), EITHER the key is owned by 'owner'.
|
|
// Legacy functions use ImGuiKeyOwner_Any meaning that they typically ignore ownership, unless a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
|
|
// - Binding generators may want to ignore those for now, or suffix them with Ex() until we decide if this gets moved into public API.
|
|
IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
|
|
IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat.
|
|
IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
|
|
IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
|
|
IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
|
|
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
|
|
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
|
|
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
|
|
|
|
// Shortcut Testing & Routing
|
|
// - Set Shortcut() and SetNextItemShortcut() in imgui.h
|
|
// - When a policy (except for ImGuiInputFlags_RouteAlways *) is set, Shortcut() will register itself with SetShortcutRouting(),
|
|
// allowing the system to decide where to route the input among other route-aware calls.
|
|
// (* using ImGuiInputFlags_RouteAlways is roughly equivalent to calling IsKeyChordPressed(key) and bypassing route registration and check)
|
|
// - When using one of the routing option:
|
|
// - The default route is ImGuiInputFlags_RouteFocused (accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.)
|
|
// - Routes are requested given a chord (key + modifiers) and a routing policy.
|
|
// - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame.
|
|
// - Each route may be granted to a single owner. When multiple requests are made we have policies to select the winning route (e.g. deep most window).
|
|
// - Multiple read sites may use the same owner id can all access the granted route.
|
|
// - When owner_id is 0 we use the current Focus Scope ID as a owner ID in order to identify our location.
|
|
// - You can chain two unrelated windows in the focus stack using SetWindowParentWindowForFocusRoute()
|
|
// e.g. if you have a tool window associated to a document, and you want document shortcuts to run when the tool is focused.
|
|
IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
|
|
IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id); // owner_id needs to be explicit and cannot be 0
|
|
IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
|
|
IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);
|
|
|
|
// Docking
|
|
// (some functions are only declared in imgui.cpp, see Docking section)
|
|
IMGUI_API void DockContextInitialize(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextShutdown(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextClearNodes(ImGuiContext* ctx, ImGuiID root_id, bool clear_settings_refs); // Use root_id==0 to clear all
|
|
IMGUI_API void DockContextRebuildNodes(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextNewFrameUpdateUndocking(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextNewFrameUpdateDocking(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextEndFrame(ImGuiContext* ctx);
|
|
IMGUI_API ImGuiID DockContextGenNodeID(ImGuiContext* ctx);
|
|
IMGUI_API void DockContextQueueDock(ImGuiContext* ctx, ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload, ImGuiDir split_dir, float split_ratio, bool split_outer);
|
|
IMGUI_API void DockContextQueueUndockWindow(ImGuiContext* ctx, ImGuiWindow* window);
|
|
IMGUI_API void DockContextQueueUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);
|
|
IMGUI_API void DockContextProcessUndockWindow(ImGuiContext* ctx, ImGuiWindow* window, bool clear_persistent_docking_ref = true);
|
|
IMGUI_API void DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);
|
|
IMGUI_API bool DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload_window, ImGuiDockNode* payload_node, ImGuiDir split_dir, bool split_outer, ImVec2* out_pos);
|
|
IMGUI_API ImGuiDockNode*DockContextFindNodeByID(ImGuiContext* ctx, ImGuiID id);
|
|
IMGUI_API void DockNodeWindowMenuHandler_Default(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);
|
|
IMGUI_API bool DockNodeBeginAmendTabBar(ImGuiDockNode* node);
|
|
IMGUI_API void DockNodeEndAmendTabBar();
|
|
inline ImGuiDockNode* DockNodeGetRootNode(ImGuiDockNode* node) { while (node->ParentNode) node = node->ParentNode; return node; }
|
|
inline bool DockNodeIsInHierarchyOf(ImGuiDockNode* node, ImGuiDockNode* parent) { while (node) { if (node == parent) return true; node = node->ParentNode; } return false; }
|
|
inline int DockNodeGetDepth(const ImGuiDockNode* node) { int depth = 0; while (node->ParentNode) { node = node->ParentNode; depth++; } return depth; }
|
|
inline ImGuiID DockNodeGetWindowMenuButtonId(const ImGuiDockNode* node) { return ImHashStr("#COLLAPSE", 0, node->ID); }
|
|
inline ImGuiDockNode* GetWindowDockNode() { ImGuiContext& g = *GImGui; return g.CurrentWindow->DockNode; }
|
|
IMGUI_API bool GetWindowAlwaysWantOwnTabBar(ImGuiWindow* window);
|
|
IMGUI_API void BeginDocked(ImGuiWindow* window, bool* p_open);
|
|
IMGUI_API void BeginDockableDragDropSource(ImGuiWindow* window);
|
|
IMGUI_API void BeginDockableDragDropTarget(ImGuiWindow* window);
|
|
IMGUI_API void SetWindowDock(ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond);
|
|
|
|
// Docking - Builder function needs to be generally called before the node is used/submitted.
|
|
// - The DockBuilderXXX functions are designed to _eventually_ become a public API, but it is too early to expose it and guarantee stability.
|
|
// - Do not hold on ImGuiDockNode* pointers! They may be invalidated by any split/merge/remove operation and every frame.
|
|
// - To create a DockSpace() node, make sure to set the ImGuiDockNodeFlags_DockSpace flag when calling DockBuilderAddNode().
|
|
// You can create dockspace nodes (attached to a window) _or_ floating nodes (carry its own window) with this API.
|
|
// - DockBuilderSplitNode() create 2 child nodes within 1 node. The initial node becomes a parent node.
|
|
// - If you intend to split the node immediately after creation using DockBuilderSplitNode(), make sure
|
|
// to call DockBuilderSetNodeSize() beforehand. If you don't, the resulting split sizes may not be reliable.
|
|
// - Call DockBuilderFinish() after you are done.
|
|
IMGUI_API void DockBuilderDockWindow(const char* window_name, ImGuiID node_id);
|
|
IMGUI_API ImGuiDockNode*DockBuilderGetNode(ImGuiID node_id);
|
|
inline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id) { ImGuiDockNode* node = DockBuilderGetNode(node_id); if (!node) return NULL; return DockNodeGetRootNode(node)->CentralNode; }
|
|
IMGUI_API ImGuiID DockBuilderAddNode(ImGuiID node_id = 0, ImGuiDockNodeFlags flags = 0);
|
|
IMGUI_API void DockBuilderRemoveNode(ImGuiID node_id); // Remove node and all its child, undock all windows
|
|
IMGUI_API void DockBuilderRemoveNodeDockedWindows(ImGuiID node_id, bool clear_settings_refs = true);
|
|
IMGUI_API void DockBuilderRemoveNodeChildNodes(ImGuiID node_id); // Remove all split/hierarchy. All remaining docked windows will be re-docked to the remaining root node (node_id).
|
|
IMGUI_API void DockBuilderSetNodePos(ImGuiID node_id, ImVec2 pos);
|
|
IMGUI_API void DockBuilderSetNodeSize(ImGuiID node_id, ImVec2 size);
|
|
IMGUI_API ImGuiID DockBuilderSplitNode(ImGuiID node_id, ImGuiDir split_dir, float size_ratio_for_node_at_dir, ImGuiID* out_id_at_dir, ImGuiID* out_id_at_opposite_dir); // Create 2 child nodes in this parent node.
|
|
IMGUI_API void DockBuilderCopyDockSpace(ImGuiID src_dockspace_id, ImGuiID dst_dockspace_id, ImVector<const char*>* in_window_remap_pairs);
|
|
IMGUI_API void DockBuilderCopyNode(ImGuiID src_node_id, ImGuiID dst_node_id, ImVector<ImGuiID>* out_node_remap_pairs);
|
|
IMGUI_API void DockBuilderCopyWindowSettings(const char* src_name, const char* dst_name);
|
|
IMGUI_API void DockBuilderFinish(ImGuiID node_id);
|
|
|
|
// [EXPERIMENTAL] Focus Scope
|
|
// This is generally used to identify a unique input location (for e.g. a selection set)
|
|
// There is one per window (automatically set in Begin), but:
|
|
// - Selection patterns generally need to react (e.g. clear a selection) when landing on one item of the set.
|
|
// So in order to identify a set multiple lists in same window may each need a focus scope.
|
|
// If you imagine an hypothetical BeginSelectionGroup()/EndSelectionGroup() api, it would likely call PushFocusScope()/EndFocusScope()
|
|
// - Shortcut routing also use focus scope as a default location identifier if an owner is not provided.
|
|
// We don't use the ID Stack for this as it is common to want them separate.
|
|
IMGUI_API void PushFocusScope(ImGuiID id);
|
|
IMGUI_API void PopFocusScope();
|
|
inline ImGuiID GetCurrentFocusScope() { ImGuiContext& g = *GImGui; return g.CurrentFocusScopeId; } // Focus scope we are outputting into, set by PushFocusScope()
|
|
|
|
// Drag and Drop
|
|
IMGUI_API bool IsDragDropActive();
|
|
IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);
|
|
IMGUI_API void ClearDragDrop();
|
|
IMGUI_API bool IsDragDropPayloadBeingAccepted();
|
|
IMGUI_API void RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect);
|
|
|
|
// Typing-Select API
|
|
IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
|
|
IMGUI_API int TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
|
IMGUI_API int TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
|
IMGUI_API int TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data);
|
|
|
|
// Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API)
|
|
IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
|
|
IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiOldColumnFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
|
|
IMGUI_API void EndColumns(); // close columns
|
|
IMGUI_API void PushColumnClipRect(int column_index);
|
|
IMGUI_API void PushColumnsBackground();
|
|
IMGUI_API void PopColumnsBackground();
|
|
IMGUI_API ImGuiID GetColumnsID(const char* str_id, int count);
|
|
IMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id);
|
|
IMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns* columns, float offset_norm);
|
|
IMGUI_API float GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offset);
|
|
|
|
// Tables: Candidates for public API
|
|
IMGUI_API void TableOpenContextMenu(int column_n = -1);
|
|
IMGUI_API void TableSetColumnWidth(int column_n, float width);
|
|
IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);
|
|
IMGUI_API int TableGetHoveredColumn(); // May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
|
|
IMGUI_API int TableGetHoveredRow(); // Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
|
|
IMGUI_API float TableGetHeaderRowHeight();
|
|
IMGUI_API float TableGetHeaderAngledMaxLabelWidth();
|
|
IMGUI_API void TablePushBackgroundChannel();
|
|
IMGUI_API void TablePopBackgroundChannel();
|
|
IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);
|
|
|
|
// Tables: Internals
|
|
inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; return g.CurrentTable; }
|
|
IMGUI_API ImGuiTable* TableFindByID(ImGuiID id);
|
|
IMGUI_API bool BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0, 0), float inner_width = 0.0f);
|
|
IMGUI_API void TableBeginInitMemory(ImGuiTable* table, int columns_count);
|
|
IMGUI_API void TableBeginApplyRequests(ImGuiTable* table);
|
|
IMGUI_API void TableSetupDrawChannels(ImGuiTable* table);
|
|
IMGUI_API void TableUpdateLayout(ImGuiTable* table);
|
|
IMGUI_API void TableUpdateBorders(ImGuiTable* table);
|
|
IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
|
|
IMGUI_API void TableDrawBorders(ImGuiTable* table);
|
|
IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
|
|
IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);
|
|
IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);
|
|
inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
|
|
inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; }
|
|
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
|
|
IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
|
|
IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
|
|
IMGUI_API void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);
|
|
IMGUI_API float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);
|
|
IMGUI_API void TableBeginRow(ImGuiTable* table);
|
|
IMGUI_API void TableEndRow(ImGuiTable* table);
|
|
IMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);
|
|
IMGUI_API void TableEndCell(ImGuiTable* table);
|
|
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
|
|
IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
|
|
IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
|
|
IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n);
|
|
IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
|
|
IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
|
|
IMGUI_API void TableRemove(ImGuiTable* table);
|
|
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTable* table);
|
|
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTableTempData* table);
|
|
IMGUI_API void TableGcCompactSettings();
|
|
|
|
// Tables: Settings
|
|
IMGUI_API void TableLoadSettings(ImGuiTable* table);
|
|
IMGUI_API void TableSaveSettings(ImGuiTable* table);
|
|
IMGUI_API void TableResetSettings(ImGuiTable* table);
|
|
IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
|
|
IMGUI_API void TableSettingsAddSettingsHandler();
|
|
IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);
|
|
IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
|
|
|
|
// Tab Bars
|
|
inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui; return g.CurrentTabBar; }
|
|
IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);
|
|
IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);
|
|
IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order);
|
|
IMGUI_API ImGuiTabItem* TabBarFindMostRecentlySelectedTabForActiveWindow(ImGuiTabBar* tab_bar);
|
|
IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);
|
|
inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { return tab_bar->Tabs.index_from_ptr(tab); }
|
|
IMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
|
IMGUI_API void TabBarAddTab(ImGuiTabBar* tab_bar, ImGuiTabItemFlags tab_flags, ImGuiWindow* window);
|
|
IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
|
|
IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
|
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
|
IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);
|
|
IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);
|
|
IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);
|
|
IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);
|
|
IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
|
|
IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);
|
|
IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
|
|
IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped);
|
|
|
|
// Render helpers
|
|
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
|
|
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
|
|
IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
|
|
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
|
|
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
|
|
IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
|
|
IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known);
|
|
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
|
|
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
|
|
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);
|
|
IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_None); // Navigation highlight
|
|
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
|
|
IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
|
|
|
|
// Render helpers (those functions don't access any ImGui state!)
|
|
IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);
|
|
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
|
|
IMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);
|
|
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
|
|
IMGUI_API void RenderArrowDockMenu(ImDrawList* draw_list, ImVec2 p_min, float sz, ImU32 col);
|
|
IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
|
|
IMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding);
|
|
IMGUI_API ImDrawFlags CalcRoundingFlagsForRectInRect(const ImRect& r_in, const ImRect& r_outer, float threshold);
|
|
|
|
// Widgets
|
|
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);
|
|
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
|
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
|
|
IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
|
|
IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f);
|
|
IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);
|
|
IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
|
|
IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);
|
|
|
|
// Widgets: Window Decorations
|
|
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos);
|
|
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos, ImGuiDockNode* dock_node);
|
|
IMGUI_API void Scrollbar(ImGuiAxis axis);
|
|
IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
|
|
IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);
|
|
IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
|
|
IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n); // 0..3: corners
|
|
IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);
|
|
|
|
// Widgets low-level behaviors
|
|
IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
|
|
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags);
|
|
IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);
|
|
IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0);
|
|
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
|
|
IMGUI_API void TreePushOverrideID(ImGuiID id);
|
|
IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open);
|
|
IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging.
|
|
IMGUI_API void SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data);
|
|
|
|
// Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
|
|
// To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
|
|
// e.g. " extern template IMGUI_API float RoundScalarWithFormatT<float, float>(const char* format, ImGuiDataType data_type, float v); "
|
|
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API float ScaleRatioFromValueT(ImGuiDataType data_type, T v, T v_min, T v_max, bool is_logarithmic, float logarithmic_zero_epsilon, float zero_deadzone_size);
|
|
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API T ScaleValueFromRatioT(ImGuiDataType data_type, float t, T v_min, T v_max, bool is_logarithmic, float logarithmic_zero_epsilon, float zero_deadzone_size);
|
|
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool DragBehaviorT(ImGuiDataType data_type, T* v, float v_speed, T v_min, T v_max, const char* format, ImGuiSliderFlags flags);
|
|
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, T* v, T v_min, T v_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);
|
|
template<typename T> IMGUI_API T RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, T v);
|
|
template<typename T> IMGUI_API bool CheckboxFlagsT(const char* label, T* flags, T flags_value);
|
|
|
|
// Data type helpers
|
|
IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type);
|
|
IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format);
|
|
IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const void* arg_1, const void* arg_2);
|
|
IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format);
|
|
IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2);
|
|
IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max);
|
|
|
|
// InputText
|
|
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
IMGUI_API void InputTextDeactivateHook(ImGuiID id);
|
|
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags);
|
|
IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL);
|
|
inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); }
|
|
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
|
|
|
|
// Color
|
|
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
|
|
IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags);
|
|
IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);
|
|
|
|
// Plot
|
|
IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg);
|
|
|
|
// Shade functions (write over already created vertices)
|
|
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
|
|
IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
|
|
IMGUI_API void ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out);
|
|
|
|
// Garbage collection
|
|
IMGUI_API void GcCompactTransientMiscBuffers();
|
|
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);
|
|
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
|
|
|
|
// Debug Log
|
|
IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1);
|
|
IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1);
|
|
IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size); // size >= 0 : alloc, size = -1 : free
|
|
|
|
// Debug Tools
|
|
IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
|
IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
|
IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
|
IMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
IMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
IMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
IMGUI_API void DebugLocateItem(ImGuiID target_id); // Call sparingly: only 1 at the same time!
|
|
IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id); // Only call on reaction to a mouse Hover: because only 1 at the same time!
|
|
IMGUI_API void DebugLocateItemResolveWithLastItem();
|
|
IMGUI_API void DebugBreakClearData();
|
|
IMGUI_API bool DebugBreakButton(const char* label, const char* description_of_location);
|
|
IMGUI_API void DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location);
|
|
IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);
|
|
IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);
|
|
IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);
|
|
IMGUI_API void DebugNodeDockNode(ImGuiDockNode* node, const char* label);
|
|
IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label);
|
|
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);
|
|
IMGUI_API void DebugNodeFont(ImFont* font);
|
|
IMGUI_API void DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph);
|
|
IMGUI_API void DebugNodeStorage(ImGuiStorage* storage, const char* label);
|
|
IMGUI_API void DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);
|
|
IMGUI_API void DebugNodeTable(ImGuiTable* table);
|
|
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings);
|
|
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);
|
|
IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);
|
|
IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);
|
|
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);
|
|
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);
|
|
IMGUI_API void DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack);
|
|
IMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport);
|
|
IMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list);
|
|
IMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);
|
|
|
|
// Obsolete functions
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
|
|
inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
|
|
|
|
//inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity!
|
|
|
|
// Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets which used FocusableItemRegister():
|
|
// (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)'
|
|
// (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Focused) != 0'
|
|
// (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))'
|
|
//inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
|
|
//inline void FocusableItemUnregister(ImGuiWindow* window) // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem
|
|
#endif
|
|
|
|
} // namespace ImGui
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] ImFontAtlas internal API
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// This structure is likely to evolve as we add support for incremental atlas updates
|
|
struct ImFontBuilderIO
|
|
{
|
|
bool (*FontBuilder_Build)(ImFontAtlas* atlas);
|
|
};
|
|
|
|
// Helper for font builder
|
|
#ifdef IMGUI_ENABLE_STB_TRUETYPE
|
|
IMGUI_API const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
|
|
#endif
|
|
IMGUI_API void ImFontAtlasUpdateConfigDataPointers(ImFontAtlas* atlas);
|
|
IMGUI_API void ImFontAtlasBuildInit(ImFontAtlas* atlas);
|
|
IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent);
|
|
IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque);
|
|
IMGUI_API void ImFontAtlasBuildFinish(ImFontAtlas* atlas);
|
|
IMGUI_API void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned char in_marker_pixel_value);
|
|
IMGUI_API void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned int in_marker_pixel_value);
|
|
IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor);
|
|
IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride);
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// [SECTION] Test Engine specific hooks (imgui_test_engine)
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData* item_data); // item_data may be NULL
|
|
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
|
|
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
|
|
extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiID id);
|
|
|
|
// In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data);
|
|
#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box
|
|
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
|
#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
|
#else
|
|
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
|
|
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
|
|
#endif
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#if defined(__clang__)
|
|
#pragma clang diagnostic pop
|
|
#elif defined(__GNUC__)
|
|
#pragma GCC diagnostic pop
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning (pop)
|
|
#endif
|
|
|
|
#endif // #ifndef IMGUI_DISABLE
|