#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
#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 "-Wold-style-cast" // warning: use of old-style cast
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
#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
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
#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
structImGuiWindowTempData;// 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)
structImGuiWindowSettings;// Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
// (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)
// Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam.
#define IMGUI_DEBUG_LOG_ERROR(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g.DebugLogSkippedErrors++; } while (0)
#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_FONT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFont) 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)
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
IMGUI_APIintImTextCountLines(constchar*in_text,constchar*in_text_end);// return number of lines taken by text. trailing carriage return doesn't count as an extra line.
IMGUI_APIImVec2ImBezierCubicClosestPoint(constImVec2&p1,constImVec2&p2,constImVec2&p3,constImVec2&p4,constImVec2&p,intnum_segments);// For curves with explicit number of segments
IMGUI_APIImVec2ImBezierCubicClosestPointCasteljau(constImVec2&p1,constImVec2&p2,constImVec2&p3,constImVec2&p4,constImVec2&p,floattess_tol);// For auto-tessellated curves you can use tess_tol = style.CurveTessellationTol
voidClipWith(constImRect&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.
voidClipWithFull(constImRect&r){Min=ImClamp(Min,r.Min,r.Max);Max=ImClamp(Max,r.Min,r.Max);}// Full version, ensure both points are fully clipped.
#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!
voidSetBitRange(intn,intn2){n+=OFFSET;n2+=OFFSET;IM_ASSERT(n>=0&&n<BITCOUNT&&n2>n&&n2<=BITCOUNT);ImBitArraySetBitRange(Storage,n,n2);}// Works on range [n..n2)
// 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.
// 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
// Conceptually this could have been called e.g. ImDrawListSharedContext
// Typically one ImGui context would create and maintain one of this.
// You may want to create your own instance of you try to ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.
structIMGUI_APIImDrawListSharedData
{
ImVec2TexUvWhitePixel;// UV of white pixel in the atlas
constImVec4*TexUvLines;// UV of anti-aliased lines in the atlas
ImFont*Font;// Current/default font (optional, for simplified AddText overload)
floatFontSize;// Current/default font size (optional, for simplified AddText overload)
floatFontScale;// Current/default font scale (== FontSize / Font->FontSize)
floatCurveTessellationTol;// Tessellation tolerance when using PathBezierCurveTo()
floatCircleSegmentMaxError;// Number of circle segments to use per pixel of radius for AddCircle() etc
ImVec4ClipRectFullscreen;// Value for PushClipRectFullscreen()
ImDrawListFlagsInitialFlags;// Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
// - input: PushItemFlag() manipulates g.CurrentItemFlags, g.NextItemData.ItemFlags, ItemAdd() calls may add extra flags too.
// - output: stored in g.LastItemData.ItemFlags
enumImGuiItemFlagsPrivate_
{
// Controlled by user
ImGuiItemFlags_Disabled=1<<10,// false // Disable interactions (DOES NOT affect visuals. DO NOT mix direct use of this with BeginDisabled(). See BeginDisabled()/EndDisabled() for full disable feature, and github #211).
ImGuiItemFlags_ReadOnly=1<<11,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
ImGuiItemFlags_MixedValue=1<<12,// 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_NoWindowHoverableCheck=1<<13,// false // Disable hoverable check in ItemHoverable()
ImGuiItemFlags_AllowOverlap=1<<14,// false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
ImGuiItemFlags_NoNavDisableMouseHover=1<<15,// false // Nav keyboard/gamepad mode doesn't disable hover highlight (behave as if NavHighlightItemUnderNav==false).
ImGuiItemFlags_Inputable=1<<20,// 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<<21,// false // Set by SetNextItemSelectionUserData()
ImGuiItemFlags_IsMultiSelect=1<<22,// false // Set by SetNextItemSelectionUserData()
ImGuiItemFlags_Default_=ImGuiItemFlags_AutoClosePopups,// Please don't change, use PushItemFlag() instead.
// Obsolete
//ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can't have a redirect as we inverted the behavior
};
// Status flags for an already submitted item
// - output: stored in g.LastItemData.StatusFlags
enumImGuiItemStatusFlags_
{
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)
ImGuiInputTextFlags_Multiline=1<<26,// For internal use by InputTextMultiline()
ImGuiInputTextFlags_MergedItem=1<<27,// For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
ImGuiInputTextFlags_LocalizeDecimalPoint=1<<28,// For internal use by InputScalar() and TempInputScalar()
};
// Extend ImGuiButtonFlags_
enumImGuiButtonFlagsPrivate_
{
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 -> use ImGuiItemFlags_ButtonRepeat instead.
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_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_NoKeyModsAllowed=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.ItemFlags)
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!)
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_
enumImGuiTreeNodeFlagsPrivate_
{
ImGuiTreeNodeFlags_ClipLabelForTrailingButton=1<<28,// FIXME-WIP: Hard-coded for CollapsingHeader()
ImGuiTreeNodeFlags_UpsideDownArrow=1<<29,// FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517)
// Internal state of the currently focused/edited text input box
// For a given item ID, access with ImGui::GetInputTextState()
structIMGUI_APIImGuiInputTextState
{
ImGuiContext*Ctx;// parent UI context (needs to be set explicitly by parent).
ImStbTexteditState*Stb;// State for stb_textedit.h
ImGuiInputTextFlagsFlags;// copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
ImGuiIDID;// widget id owning the text state
intTextLen;// UTF-8 length of the string in TextA (in bytes)
constchar*TextSrc;// == TextA.Data unless read-only, in which case == buf passed to InputText(). Field only set and valid _inside_ the call InputText() call.
ImVector<char>TextA;// main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1).
ImVector<char>TextToRevertTo;// value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
ImVector<char>CallbackTextBackup;// temporary storage for callback to support automatic reconcile of undo-stack
intBufCapacity;// end-user buffer capacity (include zero terminator)
ImVec2Scroll;// horizontal offset (managed manually) + vertical scrolling (pulled from child window's own Scroll.y)
floatCursorAnim;// timer for cursor blink, reset on every user action so the cursor reappears immediately
boolCursorFollow;// set when we want scrolling to follow the current cursor position (not always!)
boolSelectedAllMouseLock;// after a double-click to select all, we ignore further mouse drags to update selection
boolEdited;// edited this frame
boolWantReloadUserBuf;// force a reload of user buf so it may be modified externally. may be automatic in future version.
voidOnKeyPressed(intkey);// Cannot be inline because we call in code in stb_textedit.h implementation
voidOnCharPressed(unsignedintc);
// Cursor & Selection
voidCursorAnimReset();
voidCursorClamp();
boolHasSelection()const;
voidClearSelection();
intGetCursorPos()const;
intGetSelectionStart()const;
intGetSelectionEnd()const;
voidSelectAll();
// 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();
voidReloadUserBufAndSelectAll();
voidReloadUserBufAndKeepSelection();
voidReloadUserBufAndMoveToEnd();
};
enumImGuiWindowRefreshFlags_
{
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.
};
enumImGuiNextWindowDataFlags_
{
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,
};
// Storage for SetNexWindow** functions
structImGuiNextWindowData
{
ImGuiNextWindowDataFlagsFlags;
ImGuiCondPosCond;
ImGuiCondSizeCond;
ImGuiCondCollapsedCond;
ImVec2PosVal;
ImVec2PosPivotVal;
ImVec2SizeVal;
ImVec2ContentSizeVal;
ImVec2ScrollVal;
ImGuiChildFlagsChildFlags;
boolCollapsedVal;
ImRectSizeConstraintRect;
ImGuiSizeCallbackSizeCallback;
void*SizeCallbackUserData;
floatBgAlphaVal;// Override background alpha
ImVec2MenuBarOffsetMinVal;// (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?)
ImGuiNextItemDataFlagsHasFlags;// Called HasFlags instead of Flags to avoid mistaking this
ImGuiItemFlagsItemFlags;// Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
// Non-flags members are NOT cleared by ItemAdd() meaning they are still valid during NavProcessItem()
ImGuiIDFocusScopeId;// Set by SetNextItemSelectionUserData()
ImGuiSelectionUserDataSelectionUserData;// Set by SetNextItemSelectionUserData() (note that NULL/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values)
floatWidth;// Set by SetNextItemWidth()
ImGuiKeyChordShortcut;// Set by SetNextItemShortcut()
ImGuiInputFlagsShortcutFlags;// Set by SetNextItemShortcut()
boolOpenVal;// Set by SetNextItemOpen()
ImU8OpenCond;// Set by SetNextItemOpen()
ImGuiDataTypeStorageRefVal;// Not exposed yet, for ImGuiInputTextFlags_ParseEmptyAsRefVal
// Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack)
structImGuiPopupData
{
ImGuiIDPopupId;// 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
intParentNavLayer;// 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
intOpenFrameCount;// Set on OpenPopup()
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
ImVec2OpenPopupPos;// Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
ImVec2OpenMousePos;// Set on OpenPopup(), copy of mouse position at the time of opening popup
// 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.
// 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.
structImGuiKeyOwnerData
{
ImGuiIDOwnerCurr;
ImGuiIDOwnerNext;
boolLockThisFrame;// Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame.
boolLockUntilRelease;// 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.
// - 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)
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()
enumImGuiScrollFlags_
{
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).
ImGuiNavRenderCursorFlags_Compact=1<<1,// Compact highlight, no padding/distance from focused item
ImGuiNavRenderCursorFlags_AlwaysDraw=1<<2,// Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == false, aka even when using the mouse.
ImGuiNavRenderCursorFlags_NoRounding=1<<3,
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGuiNavHighlightFlags_None=ImGuiNavRenderCursorFlags_None,// Renamed in 1.91.4
ImGuiNavHighlightFlags_Compact=ImGuiNavRenderCursorFlags_Compact,// Renamed in 1.91.4
ImGuiNavHighlightFlags_AlwaysDraw=ImGuiNavRenderCursorFlags_AlwaysDraw,// Renamed in 1.91.4
ImGuiNavHighlightFlags_NoRounding=ImGuiNavRenderCursorFlags_NoRounding,// Renamed in 1.91.4
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.
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.
ImGuiTypingSelectFlagsFlags;// Flags passed to GetTypingSelectRequest()
intSearchBufferLen;
constchar*SearchBuffer;// Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize).
boolSelectRequest;// Set when buffer was modified this frame, requesting a selection.
boolSingleCharMode;// Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication.
ImS8SingleCharSize;// Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input.
ImGuiTypingSelectRequestRequest;// User-facing data
charSearchBuffer[64];// Search buffer: no need to make dynamic as this search is very transient.
ImGuiIDFocusScope;
intLastRequestFrame=0;
floatLastRequestTime=0.0f;
boolSingleCharModeLock=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.
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.
ImGuiMultiSelectIOIO;// MUST BE FIRST FIELD. Requests are set and returned by BeginMultiSelect()/EndMultiSelect() + written to by user during the loop.
ImGuiMultiSelectState*Storage;
ImGuiIDFocusScopeId;// Copied from g.CurrentFocusScopeId (unless another selection scope was pushed manually)
ImGuiMultiSelectFlagsFlags;
ImVec2ScopeRectMin;
ImVec2BackupCursorMaxPos;
ImGuiSelectionUserDataLastSubmittedItem;// Copy of last submitted item data, used to merge output ranges.
ImGuiIDBoxSelectId;
ImGuiKeyChordKeyMods;
ImS8LoopRequestSetAll;// -1: no operation, 0: clear all, 1: select all.
boolIsEndIO;// Set when switching IO from BeginMultiSelect() to EndMultiSelect() state.
boolIsFocused;// Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection.
boolIsKeyboardSetRange;// Set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can't afford a frame of lag with Shift+Navigation.
boolNavIdPassedBy;
boolRangeSrcPassedBy;// Set by the item that matches RangeSrcItem.
boolRangeDstPassedBy;// Set by the item that matches NavJustMovedToId when IsSetRange is set.
ImGuiMultiSelectTempData(){Clear();}
voidClear(){size_tio_sz=sizeof(IO);ClearIO();memset((void*)(&IO+1),0,sizeof(*this)-io_sz);}// Zero-clear except IO as we preserve IO.Requests[] buffer allocation.
intBgFgDrawListsLastFrame[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.
ImDrawDataDrawDataP;
ImDrawDataBuilderDrawDataBuilder;// Temporary data while building final ImDrawData
// Per-viewport work area
// - Insets are >= 0.0f values, distance from viewport corners to work area.
// - BeginMainMenuBar() and DockspaceOverViewport() tend to use work area to avoid stepping over existing contents.
// - Generally 'safeAreaInsets' in iOS land, 'DisplayCutout' in Android land.
ImVec2WorkInsetMin;// Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect().
ImVec2WorkInsetMax;// "
ImVec2BuildWorkInsetMin;// Work Area inset accumulator for current frame, to become next frame's WorkInset
// 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)
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
// - See 'Demo->Configuration->Error Handling' and ImGuiIO definitions for details on error handling.
// - Read https://github.com/ocornut/imgui/wiki/Error-Handling for details on error handling.
#ifndef IM_ASSERT_USER_ERROR
#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
#endif
// The error callback is currently not public, as it is expected that only advanced users will rely on it.
typedefvoid(*ImGuiErrorCallback)(ImGuiContext*ctx,void*user_data,constchar*msg);// Function signature for g.ErrorCallback
boolQuerySuccess;// Obtained result from DebugHookIdInfo()
ImGuiDataTypeDataType:8;
charDesc[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.
boolWithinFrameScope;// Set by NewFrame(), cleared by EndFrame()
boolWithinFrameScopeWithImplicitWindow;// Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
boolGcCompactAll;// Request full GC
boolTestEngineHookItems;// Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
void*TestEngine;// Test engine user data
charContextName[16];// Storage for a context name (to facilitate debugging multi-context setups)
// 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.
ImGuiMouseSourceInputEventsNextMouseSource;
ImU32InputEventsNextEventId;
// 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;
ImGuiStorageWindowsById;// Map window's ImGuiID to ImGuiWindow*
intWindowsActiveCount;// Number of unique windows submitted by frame
ImVec2WindowsHoverPadding;// Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING).
ImGuiIDDebugBreakInWindow;// 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*HoveredWindowBeforeClear;// Window the mouse is hovering. Filled even with _NoMouse. This is currently useful for multi-context compositors.
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow.
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.
ImVec2WheelingWindowRefMousePos;
intWheelingWindowStartFrame;// This may be set one frame before WheelingWindow is != NULL
intWheelingWindowScrolledFrame;
floatWheelingWindowReleaseTimer;
ImVec2WheelingWindowWheelRemainder;
ImVec2WheelingAxisAvg;
// Item/widgets state and tracking information
ImGuiIDDebugDrawIdConflicts;// Set when we detect multiple items with the same identifier
ImGuiIDDebugHookIdInfo;// Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
ImGuiIDHoveredId;// Hovered widget, filled during the frame
intHoveredIdPreviousFrameItemCount;// Count numbers of items using the same ID as last frame's hovered id
floatHoveredIdTimer;// Measure contiguous hovering time
floatHoveredIdNotActiveTimer;// Measure contiguous hovering time where the item has not been active
boolHoveredIdAllowOverlap;
boolHoveredIdIsDisabled;// 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.
boolItemUnclipByLog;// Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled
boolActiveIdNoClearOnFocusLoss;// Disable losing active id if the active id window gets unfocused.
boolActiveIdHasBeenPressedBefore;// 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.
boolActiveIdHasBeenEditedBefore;// Was the value associated to the widget Edited over the course of the Active state.
ImGuiInputSourceActiveIdSource;// Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad
ImGuiIDActiveIdPreviousFrame;
ImGuiDeactivatedItemDataDeactivatedItemData;
ImGuiDataTypeStorageActiveIdValueOnActivation;// Backup of initial value at the time of activation. ONLY SET BY SPECIFIC WIDGETS: DragXXX and SliderXXX.
ImU32ActiveIdUsingNavDirMask;// Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
boolActiveIdUsingAllKeyboardKeys;// Active widget will want to read all keyboard keys inputs. (this is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations)
ImGuiKeyChordDebugBreakInShortcutRouting;// Set to break in SetShortcutRouting()/Shortcut() calls.
//bool NavDisableHighlight; // Old name for !g.NavCursorVisible before 1.91.4 (2024/10/18). OPPOSITE VALUE (g.NavDisableHighlight == !g.NavCursorVisible)
//bool NavDisableMouseHover; // Old name for g.NavHighlightItemUnderNav before 1.91.1 (2024/10/18) this was called When user starts using keyboard/gamepad, we hide mouse hovering highlight until mouse is touched again.
boolNavMousePosDirty;// When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default)
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRectRel is valid
ImVector<ImGuiFocusScopeData>NavFocusRoute;// Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain.
ImGuiIDNavHighlightActivatedId;
floatNavHighlightActivatedTimer;
ImGuiIDNavNextActivateId;// Set by ActivateItem(), queued until next frame.
ImGuiActivateFlagsNavNextActivateFlags;
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
ImGuiSelectionUserDataNavLastValidSelectionUserData;// Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data.
ImS8NavCursorHideFrames;
// Navigation: Init & Move Requests
boolNavAnyRequest;// ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
boolNavInitRequest;// Init request for appearing window to select first item
boolNavInitRequestFromMove;
ImGuiNavItemDataNavInitResult;// Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
boolNavMoveSubmitted;// Move request submitted, will process result on next NewFrame()
boolNavMoveScoringItems;// Move request submitted, still scoring incoming items
boolNavMoveForwardToNextFrame;
ImGuiNavMoveFlagsNavMoveFlags;
ImGuiScrollFlagsNavMoveScrollFlags;
ImGuiKeyChordNavMoveKeyMods;
ImGuiDirNavMoveDir;// Direction of the move request (left/right/up/down)
ImGuiDirNavMoveDirForDebug;
ImGuiDirNavMoveClipDir;// FIXME-NAV: Describe the purpose of this better. Might want to rename?
ImRectNavScoringRect;// Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
ImRectNavScoringNoClipRect;// Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
intNavScoringDebugCount;// Metrics for debugging
intNavTabbingDir;// Generally -1 or +1, 0 when tabbing without a nav id
intNavTabbingCounter;// >0 when counting items for tabbing
ImGuiNavItemDataNavMoveResultLocal;// Best move request candidate within NavWindow
ImGuiNavItemDataNavMoveResultLocalVisible;// Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavItemDataNavMoveResultOther;// Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
ImGuiNavItemDataNavTabbingResultFirst;// First tabbing request candidate within NavWindow and flattened hierarchy
// Navigation: record of last move request
ImGuiIDNavJustMovedFromFocusScopeId;// Just navigated from this focus scope id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToFocusScopeId;// Just navigated to this focus scope id (result of a successfully MoveRequest).
ImGuiKeyChordNavJustMovedToKeyMods;
boolNavJustMovedToIsTabbing;// Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
boolNavJustMovedToHasSelectionData;// Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
ImGuiKeyChordConfigNavWindowingKeyNext;// = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). For reconfiguration (see #4828)
ImGuiKeyChordConfigNavWindowingKeyPrev;// = 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
intMultiSelectTempDataStacked;// Temporary multi-select data size (because we leave previous instances undestructed, we generally don't use MultiSelectTempData.Size)
ImVec2CursorStartPos;// Initial position after Begin(), generally ~ window position + WindowPadding.
ImVec2CursorMaxPos;// Used to implicitly calculate ContentSize at the beginning of next frame, for scrolling range and auto-resize. Always growing during the frame.
ImVec2IdealMaxPos;// Used to implicitly calculate ContentSizeIdeal at the beginning of next frame, for auto-resize only. Always growing during the frame.
ImVec1Indent;// Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
ImVec1ColumnsOffset;// 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.
ImVec1GroupOffset;
ImVec2CursorStartPosLossyness;// 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
ImGuiNavLayerNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
shortNavLayersActiveMask;// Which layers have been written to (result from previous frame)
shortNavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame)
boolNavIsScrollPushableX;// Set when current work location may be scrolled horizontally when moving left / right. This is generally always true UNLESS within a column.
ImVec2MenuBarOffset;// 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.
// 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.
ImVec2ContentSize;// 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.
ImVec2ContentSizeIdeal;
ImVec2ContentSizeExplicit;// Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
ImVec2WindowPadding;// Window padding at the time of Begin().
floatWindowRounding;// Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
floatWindowBorderSize;// Window border size at the time of Begin().
floatTitleBarHeight,MenuBarHeight;// Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight.
floatDecoOuterSizeX1,DecoOuterSizeY1;// Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
floatDecoOuterSizeX2,DecoOuterSizeY2;// Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
floatDecoInnerSizeX1,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).
intNameBufLen;// Size of buffer storing Name. May be larger than strlen(Name)!
ImVec2ScrollTarget;// target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
ImVec2ScrollTargetCenterRatio;// 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
ImVec2ScrollTargetEdgeSnapDist;// 0.0f = no snapping, >0.0f snapping threshold
ImVec2ScrollbarSizes;// 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.
boolScrollbarX,ScrollbarY;// Are scrollbars visible?
ImVec2SetWindowPosPivot;// 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)
ImGuiWindowTempDataDC;// 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().
ImRectOuterRectClipped;// == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
ImRectInnerRect;// Inner rectangle (omit title bar, menu bar, scroll bar)
ImRectInnerClipRect;// == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect.
ImRectWorkRect;// 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).
ImRectParentWorkRect;// 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?
ImRectClipRect;// Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back().
ImRectContentRegionRect;// 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.
ImVec2ihHitTestHoleSize;// Define an optional rectangular hole where mouse will pass-through the window.
floatFontWindowScale;// User scale multiplier per-window, via SetWindowFontScale()
floatFontWindowScaleParents;
floatFontRefSize;// This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window.
intSettingsOffset;// Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back)
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.)
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
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_Invisible=1<<22,// To reserve space e.g. with ImGuiTabItemFlags_Leading
//ImGuiTabItemFlags_Unsorted = 1 << 23, // [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.
};
// Storage for one active tab item (sizeof() 40 bytes)
structImGuiTabItem
{
ImGuiIDID;
ImGuiTabItemFlagsFlags;
intLastFrameVisible;
intLastFrameSelected;// This allows us to infer an ordered list of the last activated tabs with little maintenance
floatOffset;// Position relative to beginning of tab
floatWidth;// Width currently displayed
floatContentWidth;// Width of label, stored during BeginTabItem() call
floatRequestedWidth;// Width optionally requested by caller, -1.0f is unused
ImS32NameOffset;// When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
ImS16BeginOrder;// BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
ImS16IndexDuringLayout;// Index only used during TabBarLayout(). Tabs gets reordered so 'Tabs[n].IndexDuringLayout == n' but may mismatch during additions.
boolWantClose;// Marked as closed by SetTabItemClosed()
#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.
typedefImS16ImGuiTableColumnIdx;
typedefImU16ImGuiTableDrawChannelIdx;
// [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".
structImGuiTableColumn
{
ImGuiTableColumnFlagsFlags;// Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_
floatWidthGiven;// 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.
floatMinX;// Absolute positions
floatMaxX;
floatWidthRequest;// Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
floatWidthAuto;// Automatic width
floatWidthMax;// Maximum width (FIXME: overwritten by each instance)
floatStretchWeight;// Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
floatInitStretchWeightOrWidth;// Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
ImRectClipRect;// Clipping rectangle for the column
ImGuiIDUserID;// Optional, value passed to TableSetupColumn()
floatWorkMinX;// Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column
floatWorkMaxX;// Contents region max ~(MaxX - CellPaddingX - CellSpacingX2)
floatItemWidth;// Current item width for the column, preserved across rows
floatContentMaxXFrozen;// Contents maximum position for frozen rows (apart from headers), from which we can infer content width.
floatContentMaxXUnfrozen;
floatContentMaxXHeadersUsed;// Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
floatContentMaxXHeadersIdeal;
ImS16NameOffset;// Offset into parent ColumnsNames[]
ImGuiTableColumnIdxDisplayOrder;// Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
ImGuiTableColumnIdxIndexWithinEnabledSet;// Index within enabled/visible set (<= IndexToDisplayOrder)
ImGuiTableColumnIdxPrevEnabledColumn;// Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
ImGuiTableColumnIdxNextEnabledColumn;// Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
ImGuiTableColumnIdxSortOrder;// Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
ImGuiTableDrawChannelIdxDrawChannelCurrent;// Index within DrawSplitter.Channels[]
ImGuiTableDrawChannelIdxDrawChannelFrozen;// Draw channels for frozen rows (often headers)
ImGuiTableDrawChannelIdxDrawChannelUnfrozen;// Draw channels for unfrozen rows
// This may end up being refactored for more general purpose.
// sizeof() ~ 12 bytes
structImGuiTableHeaderData
{
ImGuiTableColumnIdxIndex;// Column index
ImU32TextColor;
ImU32BgColor0;
ImU32BgColor1;
};
// 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
structImGuiTableInstanceData
{
ImGuiIDTableInstanceID;
floatLastOuterHeight;// Outer height from last frame
floatLastTopHeadersRowHeight;// Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set)
floatLastFrozenHeight;// Height of frozen section from last frame
intHoveredRowLast;// Index of row which was hovered last frame.
intHoveredRowNext;// Index of row hovered this frame, set after encountering it.
// sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory()
structIMGUI_APIImGuiTable
{
ImGuiIDID;
ImGuiTableFlagsFlags;
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.
ImBitArrayPtrEnabledMaskByIndex;// Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
ImBitArrayPtrVisibleMaskByIndex;// Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
ImGuiTableFlagsSettingsLoadedFlags;// Which data were loaded from the .ini file (e.g. when order is not altered we won't save order)
intSettingsOffset;// Offset in g.SettingsTables
intLastFrameActive;
intColumnsCount;// Number of columns declared in BeginTable()
intCurrentRow;
intCurrentColumn;
ImS16InstanceCurrent;// 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.
ImS16InstanceInteracted;// Mark which instance (generally 0) of the same ID is being interacted with
floatRowPosY1;
floatRowPosY2;
floatRowMinHeight;// Height submitted to TableNextRow()
floatRowCellPaddingY;// Top and bottom padding. Reloaded during row change.
floatRowTextBaseline;
floatRowIndentOffsetX;
ImGuiTableRowFlagsRowFlags:16;// Current row flags, see ImGuiTableRowFlags_
ImGuiTableRowFlagsLastRowFlags:16;
intRowBgColorCounter;// 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.
ImU32RowBgColor[2];// Background color override for current row.
ImU32BorderColorStrong;
ImU32BorderColorLight;
floatBorderX1;
floatBorderX2;
floatHostIndentX;
floatMinColumnWidth;
floatOuterPaddingX;
floatCellPaddingX;// Padding from each borders. Locked in BeginTable()/Layout.
floatCellSpacingX1;// Spacing between non-bordered cells. Locked in BeginTable()/Layout.
floatCellSpacingX2;
floatInnerWidth;// User value passed to BeginTable(), see comments at the top of BeginTable() for details.
floatColumnsGivenWidth;// Sum of current column width
floatColumnsAutoFitWidth;// Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
floatColumnsStretchSumWeights;// Sum of weight of all enabled stretching columns
floatResizedColumnNextWidth;
floatResizeLockMinContentsX2;// Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table.
floatRefScale;// Reference scale to be able to rescale columns on font/dpi changes.
floatAngledHeadersHeight;// Set by TableAngledHeadersRow(), used in TableUpdateLayout()
floatAngledHeadersSlope;// Set by TableAngledHeadersRow(), used in TableUpdateLayout()
ImRectOuterRect;// Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
ImRectInnerRect;// InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is
ImRectWorkRect;
ImRectInnerClipRect;
ImRectBgClipRect;// We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries
ImRectBg0ClipRectForDrawCmd;// Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
ImRectBg2ClipRectForDrawCmd;// 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.
ImRectHostClipRect;// This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
ImRectHostBackupInnerClipRect;// 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)
ImDrawListSplitter*DrawSplitter;// Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly
ImGuiTableInstanceDataInstanceDataFirst;
ImVector<ImGuiTableInstanceData>InstanceDataExtra;// FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableColumnSortSpecsSortSpecsSingle;
ImVector<ImGuiTableColumnSortSpecs>SortSpecsMulti;// FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableSortSpecsSortSpecs;// Public facing sorts specs, this is what we return in TableGetSortSpecs()
ImGuiTableColumnIdxSortSpecsCount;
ImGuiTableColumnIdxColumnsEnabledCount;// Number of enabled columns (<= ColumnsCount)
ImGuiTableColumnIdxColumnsEnabledFixedCount;// Number of enabled columns using fixed width (<= ColumnsCount)
ImGuiTableColumnIdxDeclColumnsCount;// Count calls to TableSetupColumn()
ImGuiTableColumnIdxAngledHeadersCount;// Count columns with angled headers
ImGuiTableColumnIdxHoveredColumnBody;// Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
ImGuiTableColumnIdxHoveredColumnBorder;// Index of column whose right-border is being hovered (for resizing).
ImGuiTableColumnIdxHighlightColumnHeader;// Index of column which should be highlighted.
ImGuiTableColumnIdxAutoFitSingleColumn;// Index of single column requesting auto-fit.
ImGuiTableColumnIdxResizedColumn;// Index of column being resized. Reset when InstanceCurrent==0.
ImGuiTableColumnIdxLastResizedColumn;// Index of column being resized from previous frame.
ImGuiTableColumnIdxHeldHeaderColumn;// Index of column header being held.
ImGuiTableColumnIdxReorderColumn;// Index of column being reordered. (not cleared)
ImGuiTableColumnIdxReorderColumnDir;// -1 or +1
ImGuiTableColumnIdxLeftMostEnabledColumn;// Index of left-most non-hidden column.
ImGuiTableColumnIdxRightMostEnabledColumn;// Index of right-most non-hidden column.
ImGuiTableColumnIdxLeftMostStretchedColumn;// Index of left-most stretched column.
ImGuiTableColumnIdxRightMostStretchedColumn;// Index of right-most stretched column.
ImGuiTableColumnIdxContextPopupColumn;// Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
ImGuiTableDrawChannelIdxBg2DrawChannelCurrent;// For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[]
ImGuiTableDrawChannelIdxBg2DrawChannelUnfrozen;
ImS8NavLayer;// ImGuiNavLayer at the time of BeginTable().
boolIsLayoutLocked;// Set by TableUpdateLayout() which is called when beginning the first row.
boolIsInsideRow;// Set when inside TableBeginRow()/TableEndRow().
boolIsInitializing;
boolIsSortSpecsDirty;
boolIsUsingHeaders;// Set when the first row had the ImGuiTableRowFlags_Headers flag.
boolIsContextPopupOpen;// Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
boolDisableDefaultContextMenu;// Disable default context menu contents. You may submit your own using TableBeginContextMenuPopup()/EndPopup()
boolIsSettingsRequestLoad;
boolIsSettingsDirty;// Set when table settings have changed and needs to be reported into ImGuiTableSetttings data.
boolIsDefaultDisplayOrder;// Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
boolIsResetAllRequest;
boolIsResetDisplayOrderRequest;
boolIsUnfrozenRows;// Set when we got past the frozen row.
boolIsDefaultSizingPolicy;// Set if user didn't explicitly set a sizing policy in BeginTable()
boolIsActiveIdAliveBeforeTable;
boolIsActiveIdInTable;
boolHasScrollbarYCurr;// Whether ANY instance of this table had a vertical scrollbar during the current frame.
boolHasScrollbarYPrev;// Whether ANY instance of this table had a vertical scrollbar during the previous.
boolMemoryCompacted;
boolHostSkipItems;// Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
// This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
structImGuiTableSettings
{
ImGuiIDID;// Set to 0 to invalidate/delete the setting
ImGuiTableFlagsSaveFlags;// Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
floatRefScale;// Reference scale to be able to rescale columns on font/dpi changes.
ImGuiTableColumnIdxColumnsCount;
ImGuiTableColumnIdxColumnsCountMax;// Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
boolWantApply;// Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
inlineImDrawList*GetForegroundDrawList(ImGuiWindow*window){IM_UNUSED(window);returnGetForegroundDrawList();}// This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches.
IMGUI_APIImDrawList*GetBackgroundDrawList(ImGuiViewport*viewport);// get background draw list for the given viewport. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
IMGUI_APIImDrawList*GetForegroundDrawList(ImGuiViewport*viewport);// get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
inlinevoidItemSize(constImRect&bb,floattext_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_APIvoidLogBegin(ImGuiLogFlagsflags,intauto_open_depth);// -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
IMGUI_APIvoidLogToBuffer(intauto_open_depth=-1);// Start logging/capturing to internal buffer
// 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_APIvoidFocusItem();// Focus last item (no selection/activation).
IMGUI_APIvoidActivateItemByID(ImGuiIDid);// 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.
// - 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_APIvoidSetItemKeyOwner(ImGuiKeykey,ImGuiInputFlagsflags);// Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
IMGUI_APIboolTestKeyOwner(ImGuiKeykey,ImGuiIDowner_id);// Test that key is either not owned, either owned by 'owner_id'
// [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_APIboolIsKeyPressed(ImGuiKeykey,ImGuiInputFlagsflags,ImGuiIDowner_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.
// - 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.
// (provide Windows Explorer style "select items by typing partial name" + "cycle through items by typing same letter" feature)
// (this is currently not documented nor used by main library, but should work. See "widgets_typingselect" in imgui_test_suite for usage code. Please let us know if you use this!)
IMGUI_APIvoidBeginColumns(constchar*str_id,intcount,ImGuiOldColumnFlagsflags=0);// setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
IMGUI_APIintTableGetHoveredRow();// Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
// 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)
inlinevoidRenderNavHighlight(constImRect&bb,ImGuiIDid,ImGuiNavRenderCursorFlagsflags=ImGuiNavRenderCursorFlags_None){RenderNavCursor(bb,id,flags);}// Renamed in 1.91.4
IMGUI_APIboolTreeNodeUpdateNextOpen(ImGuiIDstorage_id,ImGuiTreeNodeFlagsflags);// Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging.
// 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); "
inlineImGuiInputTextState*GetInputTextState(ImGuiIDid){ImGuiContext&g=*GImGui;return(id!=0&&g.InputTextState.ID==id)?&g.InputTextState:NULL;}// Get input text state if active