// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
// Set:
// #define IMGUI_DEFINE_MATH_OPERATORS
// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
/*
Indexofthisfile:
// [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] Inputs support
// [SECTION] Clipper support
// [SECTION] Navigation support
// [SECTION] Columns support
// [SECTION] Multi-select support
// [SECTION] Docking support
// [SECTION] Viewport support
// [SECTION] Settings 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)
#if (defined __SSE__ || defined __x86_64__ || defined _M_X64) && !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
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloorSigned()
#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
#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
#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.
structImRect;// An axis-aligned rectangle (2 points)
structImDrawDataBuilder;// Helper to build a ImDrawData instance
structImDrawListSharedData;// Data shared between all ImDrawList instances
structImGuiColorMod;// Stacked color modifier, backup of modified data so we can restore it
structImGuiContext;// Main Dear ImGui context
structImGuiContextHook;// Hook for extensions like ImGuiTestEngine
structImGuiDataTypeInfo;// Type information associated to a ImGuiDataType enum
structImGuiDockContext;// Docking system context
structImGuiDockRequest;// Docking system dock/undock queued request
structImGuiDockNode;// Docking system node (hold a list of Windows OR two child dock nodes)
structImGuiDockNodeSettings;// Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
structImGuiGroupData;// Stacked storage data for BeginGroup()/EndGroup()
structImGuiInputTextState;// Internal state of the currently focused/edited text input box
structImGuiLastItemData;// Status storage for last submitted items
structImGuiMenuColumns;// Simple column measurement, currently used for MenuItem() only
structImGuiNavItemData;// Result of a gamepad/keyboard directional navigation move query result
structImGuiMetricsConfig;// Storage for ShowMetricsWindow() and DebugNodeXXX() functions
structImGuiNextWindowData;// Storage for SetNextWindow** functions
structImGuiNextItemData;// Storage for SetNextItem** functions
structImGuiOldColumnData;// Storage data for a single column for legacy Columns() api
structImGuiOldColumns;// Storage data for a columns set for legacy Columns() api
structImGuiPopupData;// Storage for current popup stack
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiStackSizes;// Storage of stack sizes for debugging/asserting
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiTabBar;// Storage for a tab bar
structImGuiTabItem;// Storage for a tab item (within a tab bar)
structImGuiTable;// Storage for a table
structImGuiTableColumn;// Storage for one column of a table
structImGuiTableInstanceData;// Storage for one instance of a same table
structImGuiTableTempData;// Temporary storage for one table (one per table in the stack), shared between tables.
structImGuiTableSettings;// Storage for a table .ini settings
structImGuiTableColumnsSettings;// Storage for a column .ini settings
structImGuiWindow;// Storage for one window
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)
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
typedefintImGuiDataAuthority;// -> enum ImGuiDataAuthority_ // Enum: for storing the source authority (dock node vs window) of a field
typedefintImGuiLayoutType;// -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
typedefintImGuiActivateFlags;// -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
typedefintImGuiItemFlags;// -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
typedefintImGuiItemStatusFlags;// -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
typedefintImGuiOldColumnFlags;// -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
typedefintImGuiNavHighlightFlags;// -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
typedefintImGuiNavDirSourceFlags;// -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
typedefintImGuiNavMoveFlags;// -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
typedefintImGuiNextItemDataFlags;// -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
typedefintImGuiNextWindowDataFlags;// -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
typedefintImGuiScrollFlags;// -> enum ImGuiScrollFlags_ // Flags: for ScrollToItem() and navigation requests
typedefintImGuiSeparatorFlags;// -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx()
typedefintImGuiTextFlags;// -> enum ImGuiTextFlags_ // Flags: for TextEx()
typedefintImGuiTooltipFlags;// -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx()
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
IMGUI_APIintImTextCountCharsFromUtf8(constchar*in_text,constchar*in_text_end);// return number of UTF-8 code-points (NOT bytes count)
IMGUI_APIintImTextCountUtf8BytesFromChar(constchar*in_text,constchar*in_text_end);// return number of bytes to express one char in UTF-8
IMGUI_APIintImTextCountUtf8BytesFromStr(constImWchar*in_text,constImWchar*in_text_end);// return number of bytes to express string in UTF-8
// Helpers: ImVec2/ImVec4 operators
// We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.)
// We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself.
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.
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
// 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.
structIMGUI_APIImDrawListSharedData
{
ImVec2TexUvWhitePixel;// UV of white pixel in the atlas
ImFont*Font;// Current/default font (optional, for simplified AddText overload)
floatFontSize;// Current/default font size (optional, for simplified AddText overload)
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)
// [Internal] Lookup tables
ImVec2ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];// Sample points on the quarter of the circle.
floatArcFastRadiusCutoff;// Cutoff radius after which arc drawing will fallback to slower PathArcTo()
ImU8CircleSegmentCounts[64];// Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead)
constImVec4*TexUvLines;// UV of anti-aliased lines in the atlas
// Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
// This is going to be exposed in imgui.h when stabilized enough.
enumImGuiItemFlags_
{
ImGuiItemFlags_None=0,
ImGuiItemFlags_NoTabStop=1<<0,// false // Disable keyboard tabbing (FIXME: should merge with _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 keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop)
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_Inputable=1<<8// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
};
// Storage for LastItem data
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_FocusedByTabbing=1<<8// Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
#ifdef IMGUI_ENABLE_TEST_ENGINE
,// [imgui_tests only]
ImGuiItemStatusFlags_Openable=1<<20,// Item is an openable (e.g. TreeNode)
ImGuiItemStatusFlags_Opened=1<<21,//
ImGuiItemStatusFlags_Checkable=1<<22,// Item is a checkable (e.g. CheckBox, MenuItem)
ImGuiItemStatusFlags_Checked=1<<23//
#endif
};
// Extend ImGuiInputTextFlags_
enumImGuiInputTextFlagsPrivate_
{
// [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.
};
// 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
ImGuiButtonFlags_FlattenChildren=1<<11,// allow interactions even if a child window is overlapping
ImGuiButtonFlags_AllowItemOverlap=1<<12,// require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
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
ImGuiButtonFlags_NoHoveredOnFocus=1<<19,// don't report as hovered when nav focus is on this item
ImGuiSliderFlags_Vertical=1<<20,// Should this slider be orientated vertically?
ImGuiSliderFlags_ReadOnly=1<<21
};
// Extend ImGuiSelectableFlags_
enumImGuiSelectableFlagsPrivate_
{
// 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_DrawHoveredWhenHeld=1<<25,// Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow.
ImGuiSelectableFlags_SetNavIdOnHover=1<<26,// Set Nav/Focus ID on mouse hover (used by MenuItem)
ImGuiSelectableFlags_NoPadWithHalfSpacing=1<<27// Disable padding each side with ItemSpacing * 0.5f
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*SourceWindow;// Set on OpenPopup() copy of NavWindow at the time of opening the popup
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
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?)
ImGuiIDFocusScopeId;// Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging)
ImGuiActivateFlags_PreferInput=1<<0,// Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default if keyboard is available.
ImGuiActivateFlags_PreferTweak=1<<1,// Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default if keyboard is not available.
ImGuiActivateFlags_TryToPreserveState=1<<2// Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
};
// 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).
ImGuiNavHighlightFlags_AlwaysDraw=1<<2,// Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
ImGuiNavHighlightFlags_NoRounding=1<<3
};
enumImGuiNavDirSourceFlags_
{
ImGuiNavDirSourceFlags_None=0,
ImGuiNavDirSourceFlags_RawKeyboard=1<<0,// Raw keyboard (not pulled from nav), facilitate use of some functions before we can unify nav and keys
ImGuiNavDirSourceFlags_Keyboard=1<<1,
ImGuiNavDirSourceFlags_PadDPad=1<<2,
ImGuiNavDirSourceFlags_PadLStick=1<<3
};
enumImGuiNavMoveFlags_
{
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_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,
ImGuiNavMoveFlags_Tabbing=1<<10,// == Focus + Activate if item is Inputable + DontChangeNavHighlight
ImGuiNavMoveFlags_Activate=1<<11,
ImGuiNavMoveFlags_DontSetNavHighlight=1<<12// Do not alter the visible state of keyboard vs mouse nav highlight
};
enumImGuiNavLayer
{
ImGuiNavLayer_Main=0,// Main scrolling layer
ImGuiNavLayer_Menu=1,// Menu layer (access with Alt/ImGuiNavInput_Menu)
ImGuiNavLayer_COUNT
};
structImGuiNavItemData
{
ImGuiWindow*Window;// Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window)
ImGuiIDID;// Init,Move // Best candidate item ID
ImGuiIDFocusScopeId;// Init,Move // Best candidate focus scope ID
ImRectRectRel;// Init,Move // Best candidate bounding box in window relative space
ImGuiItemFlagsInFlags;// ????,Move // Best candidate item flags
floatDistBox;// Move // Best candidate box distance to current NavId
floatDistCenter;// Move // Best candidate center distance to current NavId
floatDistAxial;// Move // Best candidate axial distance to current NavId
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// (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
ImGuiDockNodeFlags_DockSpace=1<<10,// Local, 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,// Local, Saved // The central node has 2 main properties: stay visible when empty, only use "remaining" spaces from its neighbor.
ImGuiDockNodeFlags_NoTabBar=1<<12,// Local, Saved // Tab bar is completely unavailable. No triangle in the corner to enable it back.
ImGuiDockNodeFlags_HiddenTabBar=1<<13,// Local, 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,// Local, Saved // Disable window/docking menu (that one that appears instead of the collapse button)
ImGuiDockNodeFlags_NoDocking=1<<16,// Local, Saved // Disable any form of docking in this dockspace or individual node. (On a whole dockspace, this pretty much defeat the purpose of using a dockspace at all). Note: when turned on, existing docked nodes will be preserved.
ImGuiDockNodeFlags_NoDockingSplitMe=1<<17,// [EXPERIMENTAL] Prevent another window/node from splitting this node.
ImGuiDockNodeFlags_NoDockingSplitOther=1<<18,// [EXPERIMENTAL] Prevent this node from splitting another window/node.
ImGuiDockNodeFlags_NoDockingOverMe=1<<19,// [EXPERIMENTAL] Prevent another window/node to be docked over this node.
ImGuiDockNodeFlags_NoDockingOverOther=1<<20,// [EXPERIMENTAL] Prevent this node to be docked over another window or non-empty node.
ImGuiDockNodeFlags_NoDockingOverEmpty=1<<21,// [EXPERIMENTAL] Prevent this node to be docked over an empty node (e.g. DockSpace with no other windows)
ImGuiDockNodeFlags_LocalFlagsTransferMask_=ImGuiDockNodeFlags_LocalFlagsMask_&~ImGuiDockNodeFlags_DockSpace,// When splitting those flags are moved to the inheriting child, never duplicated
// ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
// Every instance of ImGuiViewport is in fact a ImGuiViewportP.
structImGuiViewportP:publicImGuiViewport
{
intIdx;
intLastFrameActive;// Last frame number this viewport was activated by a window
intLastFrontMostStampCount;// Last stamp number from when a window hosted by this viewport was made front-most (by comparing this value between two viewport we have an implicit viewport z-order
ImGuiIDLastNameHash;
ImVec2LastPos;
floatAlpha;// Window opacity (when dragging dockable windows/viewports we make them transparent)
floatLastAlpha;
shortPlatformMonitor;
boolPlatformWindowCreated;
ImGuiWindow*Window;// Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
intDrawListsLastFrame[2];// Last frame number the background (0) and foreground (1) draw lists were used
ImDrawList*DrawLists[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;
ImVec2LastPlatformPos;
ImVec2LastPlatformSize;
ImVec2LastRendererSize;
ImVec2WorkOffsetMin;// 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!)
ImVec2WorkOffsetMax;// Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
ImVec2BuildWorkOffsetMin;// Work Area: Offset being built during current frame. Generally >= 0.0f.
ImVec2BuildWorkOffsetMax;// Work Area: Offset being built during current frame. Generally <= 0.0f.
// 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)
// 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)
structImGuiWindowSettings
{
ImGuiIDID;
ImVec2ihPos;// NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
ImVec2ihSize;
ImVec2ihViewportPos;
ImGuiIDViewportId;
ImGuiIDDockId;// ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
ImGuiIDClassId;// ID of window class if specified
shortDockOrder;// 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.
boolCollapsed;
boolWantApply;// Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == 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,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
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'
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.
boolFontAtlasOwnedByContext;// IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
ImGuiIOIO;
ImGuiPlatformIOPlatformIO;
ImVector<ImGuiInputEvent>InputEventsQueue;// Input events which will be tricked/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.
ImGuiStyleStyle;
ImGuiConfigFlagsConfigFlagsCurrFrame;// = g.IO.ConfigFlags at the time of NewFrame()
floatFontSize;// (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
floatFontBaseSize;// (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height.
ImDrawListSharedDataDrawListSharedData;
doubleTime;
intFrameCount;
intFrameCountEnded;
intFrameCountPlatformEnded;
intFrameCountRendered;
boolWithinFrameScope;// Set by NewFrame(), cleared by EndFrame()
boolWithinFrameScopeWithImplicitWindow;// Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
boolWithinEndChild;// Set within EndChild()
boolGcCompactAll;// Request full GC
boolTestEngineHookItems;// Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
void*TestEngine;// Test engine user data
// 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)
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.
ImGuiDockNode*HoveredDockNode;// [Debug] Hovered dock node.
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.
ImVec2WheelingWindowRefMousePos;
floatWheelingWindowTimer;
// Item/widgets state and tracking information
ImGuiIDDebugHookIdInfo;// Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
ImGuiIDHoveredId;// Hovered widget, filled during the frame
ImGuiIDHoveredIdPreviousFrame;
boolHoveredIdAllowOverlap;
boolHoveredIdUsingMouseWheel;// Hovered widget will use mouse wheel. Blocks scrolling the underlying window.
boolHoveredIdPreviousFrameUsingMouseWheel;
boolHoveredIdDisabled;// 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.
floatHoveredIdTimer;// Measure contiguous hovering time
floatHoveredIdNotActiveTimer;// Measure contiguous hovering time where the item has not been active
ImGuiIDActiveId;// Active widget
ImGuiIDActiveIdIsAlive;// Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
floatActiveIdTimer;
boolActiveIdIsJustActivated;// Set at the time of activation for one frame
boolActiveIdAllowOverlap;// Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
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.
boolActiveIdHasBeenEditedThisFrame;
ImVec2ActiveIdClickOffset;// Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
ImGuiWindow*ActiveIdWindow;
ImGuiInputSourceActiveIdSource;// Activating with mouse or nav (gamepad/keyboard)
intActiveIdMouseButton;
ImGuiIDActiveIdPreviousFrame;
boolActiveIdPreviousFrameIsAlive;
boolActiveIdPreviousFrameHasBeenEditedBefore;
ImGuiWindow*ActiveIdPreviousFrameWindow;
ImGuiIDLastActiveId;// Store the last non-zero ActiveId, useful for animation.
floatLastActiveIdTimer;// Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
// Input Ownership
boolActiveIdUsingMouseWheel;// Active widget will want to read mouse wheel. Blocks scrolling the underlying window.
ImU32ActiveIdUsingNavDirMask;// Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
ImU32ActiveIdUsingNavInputMask;// Active widget will want to read those nav inputs.
ImBitArrayForNamedKeysActiveIdUsingKeyInputMask;// Active widget will want to read those key inputs. When we grow the ImGuiKey enum we'll need to either to order the enum to make useful keys come first, either redesign this into e.g. a small array.
ImGuiNextItemDataNextItemData;// Storage for SetNextItem** functions
ImGuiLastItemDataLastItemData;// Storage for last submitted item (setup by ItemAdd)
ImGuiNextWindowDataNextWindowData;// Storage for SetNextWindow** functions
// Shared stacks
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<ImGuiID>FocusScopeStack;// Stack for PushFocusScope()/PopFocusScope() - not inherited by Begin(), unless child window
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)
intBeginMenuCount;
// 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.
ImGuiIDPlatformLastFocusedViewportId;
ImGuiPlatformMonitorFallbackMonitor;// Virtual monitor used as fallback if backend doesn't provide monitor information.
intViewportFrontMostStampCount;// 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'
ImGuiIDNavId;// Focused item for navigation
ImGuiIDNavFocusScopeId;// Identify a selection scope (selection code often wants to "clear other items" when landing on an item of the selection set)
ImGuiIDNavActivateId;// ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem()
ImGuiIDNavActivateInputId;// ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
ImGuiActivateFlagsNavActivateFlags;
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToFocusScopeId;// Just navigated to this focus scope id (result of a successfully MoveRequest).
ImGuiModFlagsNavJustMovedToKeyMods;
ImGuiIDNavNextActivateId;// Set by ActivateItem(), queued until next frame.
ImGuiActivateFlagsNavNextActivateFlags;
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
ImGuiNavLayerNavLayer;// 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.
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRectRel is valid
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
boolNavDisableHighlight;// When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
boolNavDisableMouseHover;// When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
// 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;
ImGuiIDNavInitResultId;// Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
ImRectNavInitResultRectRel;// Init request result rectangle (relative to parent window)
boolNavMoveSubmitted;// Move request submitted, will process result on next NewFrame()
boolNavMoveScoringItems;// Move request submitted, still scoring incoming items
boolNavMoveForwardToNextFrame;
ImGuiNavMoveFlagsNavMoveFlags;
ImGuiScrollFlagsNavMoveScrollFlags;
ImGuiModFlagsNavMoveKeyMods;
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: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
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
floatNavWindowingTimer;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
// Render
floatDimBgRatio;// 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
ImGuiMouseCursorMouseCursor;
// Drag and Drop
boolDragDropActive;
boolDragDropWithinSource;// Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source.
boolDragDropWithinTarget;// Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target.
ImGuiDragDropFlagsDragDropSourceFlags;
intDragDropSourceFrameCount;
intDragDropMouseButton;
ImGuiPayloadDragDropPayload;
ImRectDragDropTargetRect;// Store rectangle of current target candidate (we favor small targets when overlapping)
ImGuiIDDragDropTargetId;
ImGuiDragDropFlagsDragDropAcceptFlags;
floatDragDropAcceptIdCurrRectSurface;// Target item surface (we resolve overlapping targets by prioritizing the smaller surface)
ImGuiIDDragDropAcceptIdCurr;// Target item id (set at the time of accepting the payload)
ImGuiIDDragDropAcceptIdPrev;// Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
intDragDropAcceptFrameCount;// Last time a target expressed a desire to accept the source
ImGuiIDDragDropHoldJustPressedId;// Set when holding a payload just made ButtonBehavior() return a press.
ImVector<unsignedchar>DragDropPayloadBufHeap;// We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size
unsignedcharDragDropPayloadBufLocal[16];// Local buffer for small payloads
// Clipper
intClipperTempDataStacked;
ImVector<ImGuiListClipperData>ClipperTempData;
// Tables
ImGuiTable*CurrentTable;
intTablesTempDataStacked;// 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)
// 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)
structIMGUI_APIImGuiWindowTempData
{
// Layout
ImVec2CursorPos;// Current emitting position, in absolute coordinates.
ImVec2CursorPosPrevLine;
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.
ImVec2CurrLineSize;
ImVec2PrevLineSize;
floatCurrLineTextBaseOffset;// Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added).
floatPrevLineTextBaseOffset;
boolIsSameLine;
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 compensentate 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)
ImGuiIDNavFocusScopeIdCurrent;// Current focus scope ID while appending
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
// Miscellaneous
boolMenuBarAppending;// FIXME: Remove this
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.
ImGuiMenuColumnsMenuColumns;// Simplified columns storage for menu items measurement
intTreeDepth;// Current tree depth.
ImU32TreeJumpToParentOnPopMask;// 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
intCurrentTableIdx;// Current table index (into g.Tables)
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
// 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.
floatItemWidth;// Current item width (>0.0: width in pixels, <0.0: align xx pixels to the right of window).
floatTextWrapPos;// 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
structIMGUI_APIImGuiWindow
{
char*Name;// Window name, owned by the window.
ImGuiIDID;// == ImHashStr(Name)
ImGuiWindowFlagsFlags,FlagsPreviousFrame;// See enum ImGuiWindowFlags_
ImGuiWindowClassWindowClass;// 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.
ImGuiIDViewportId;// We backup the viewport id (since the viewport may disappear or never be created if the window is inactive)
ImVec2ViewportPos;// We backup the viewport position (since the viewport may disappear or never be created if the window is inactive)
intViewportAllowPlatformMonitorExtend;// 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
ImVec2Pos;// Position (always rounded-up to nearest pixel)
ImVec2Size;// Current size (==SizeFull or collapsed title bar size)
ImVec2SizeFull;// Size when non collapsed
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().
intNameBufLen;// Size of buffer storing Name. May be larger than strlen(Name)!
ImGuiIDMoveId;// == window->GetID("#MOVE")
ImGuiIDTabId;// == window->GetID("#TAB")
ImGuiIDChildId;// ID of corresponding item in parent window (for navigation to return from child window to parent window)
ImVec2Scroll;
ImVec2ScrollMax;
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?
boolViewportOwned;
boolActive;// Set to true on Begin(), unless Collapsed
boolWasActive;
boolWriteAccessed;// Set to true when any widget access the current window
boolCollapsed;// Set when collapsing window to become only title-bar
boolWantCollapseToggle;
boolSkipItems;// Set when items can safely be all clipped (e.g. window not visible or collapsed)
boolAppearing;// Set during the frame where the window is appearing (or re-appearing)
boolHidden;// Do not display (== HiddenFrames*** > 0)
boolIsFallbackWindow;// Set on the "Debug##Default" window.
boolIsExplicitChild;// Set when passed _ChildWindow, left to false by BeginDocked()
boolHasCloseButton;// Set when the window has a close button (p_open != NULL)
signedcharResizeBorderHeld;// Current border being held for resize (-1: none, otherwise 0-3)
shortBeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
shortBeginOrderWithinParent;// Begin() order within immediate parent window, if we are a child window. Otherwise 0.
shortBeginOrderWithinContext;// Begin() order within entire imgui context. This is mostly used for debugging submission order related issues.
shortFocusOrder;// Order within WindowsFocusOrder[], altered when windows are focused.
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImS8AutoFitFramesX,AutoFitFramesY;
ImS8AutoFitChildAxises;
boolAutoFitOnlyGrows;
ImGuiDirAutoPosLastDirection;
ImS8HiddenFramesCanSkipItems;// Hide the window for N frames
ImS8HiddenFramesCannotSkipItems;// Hide the window for N frames while allowing items to be submitted so we can measure their size
ImS8HiddenFramesForRenderOnly;// Hide the window until frame N at Render() time only
ImS8DisableInputsFrames;// Disable window interactions for N frames
ImGuiCondSetWindowPosAllowFlags:8;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowSizeAllowFlags:8;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowCollapsedAllowFlags:8;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImGuiCondSetWindowDockAllowFlags:8;// store acceptable condition flags for SetNextWindowDock() use.
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
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.
ImVec2ihHitTestHoleOffset;
intLastFrameActive;// Last frame number the window was Active.
intLastFrameJustFocused;// Last frame number the window was made Focused.
floatLastTimeActive;// Last timestamp the window was Active (using float as we don't need high precision there)
floatItemWidthDefault;
ImGuiStorageStateStorage;
ImVector<ImGuiOldColumns>ColumnsStorage;
floatFontWindowScale;// User scale multiplier per-window, via SetWindowFontScale()
floatFontDpiScale;
intSettingsOffset;// 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)
ImDrawListDrawListInst;
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*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.)
ImGuiIDNavLastIds[ImGuiNavLayer_COUNT];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[ImGuiNavLayer_COUNT];// Reference rectangle, in window relative space
intMemoryDrawListIdxCapacity;// Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
intMemoryDrawListVtxCapacity;
boolMemoryCompacted;// Set when window extraneous data have been garbage collected
// Docking
boolDockIsActive:1;// When docking artifacts are actually visible. When this is set, DockNode is guaranteed to be != NULL. ~~ (DockNode != NULL) && (DockNode->Windows.Size > 1).
boolDockNodeIsVisible:1;
boolDockTabIsVisible:1;// Is our window visible this frame? ~~ is the corresponding tab selected?
boolDockTabWantClose:1;
shortDockOrder;// 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.
ImGuiWindowDockStyleDockStyle;
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)
ImGuiIDDockId;// Backup of last valid DockNode->ID, so single window remember their dock node id even when they are not bound any more
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_Unsorted=1<<22,// [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.
ImGuiTabItemFlags_Preview=1<<23// [Docking] Display tab shape for docking preview (height is adjusted slightly to compensate for the yet missing tab bar)
};
// Storage for one active tab item (sizeof() 48 bytes)
structImGuiTabItem
{
ImGuiIDID;
ImGuiTabItemFlagsFlags;
ImGuiWindow*Window;// When TabItem is part of a DockNode's TabBar, we hold on to a window.
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
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()
boolWantClose;// Marked as closed by SetTabItemClosed()
// 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
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
// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?)
structImGuiTableInstanceData
{
floatLastOuterHeight;// Outer height from last frame // FIXME: multi-instance issue (#3955)
floatLastFirstRowHeight;// Height of first row from last frame // FIXME: possible multi-instance issue?
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
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.
ImBitVectorEnabledMaskByIndex;// Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
ImBitVectorVisibleMaskByIndex;// Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
ImBitVectorRequestOutputMaskByIndex;// Column Index -> IsVisible || AutoFit (== expect user to submit items)
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()
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
floatCellPaddingY;
floatCellSpacingX1;// Spacing between non-bordered cells
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.
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 (<= ColumnsCount)
ImGuiTableColumnIdxDeclColumnsCount;// Count calls to TableSetupColumn()
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).
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;
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).
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()
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)
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_APIboolIsItemToggledSelection();// Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
// Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText()
inlineboolFocusableItemRegister(ImGuiWindow*window,ImGuiIDid){IM_ASSERT(0);IM_UNUSED(window);IM_UNUSED(id);returnfalse;}// -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
IMGUI_APIvoidLogBegin(ImGuiLogTypetype,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
IMGUI_APIvoidActivateItem(ImGuiIDid);// Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
// This is generally used to identify a selection set (multiple of which may be in the same window), as selection
// patterns generally need to react (e.g. clear selection) when landing on an item of the set.
IMGUI_APIvoidPushFocusScope(ImGuiIDid);
IMGUI_APIvoidPopFocusScope();
inlineImGuiIDGetFocusedFocusScope(){ImGuiContext&g=*GImGui;returng.NavFocusScopeId;}// Focus scope which is actually active
inlineImGuiIDGetFocusScope(){ImGuiContext&g=*GImGui;returng.CurrentWindow->DC.NavFocusScopeIdCurrent;}// Focus scope we are outputting into, set by PushFocusScope()
// Inputs
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
IMGUI_APIvoidDockBuilderRemoveNodeChildNodes(ImGuiIDnode_id);// Remove all split/hierarchy. All remaining docked windows will be re-docked to the remaining root node (node_id).
IMGUI_APIImGuiIDDockBuilderSplitNode(ImGuiIDnode_id,ImGuiDirsplit_dir,floatsize_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_APIvoidBeginColumns(constchar*str_id,intcount,ImGuiOldColumnFlagsflags=0);// setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
IMGUI_APIintTableGetHoveredColumn();// 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.
// 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_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextItemOpen() data, if any. May return true when logging
IMGUI_APIvoidTreePushOverrideID(ImGuiIDid);
// 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); "
inlineImGuiInputTextState*GetInputTextState(ImGuiIDid){ImGuiContext&g=*GImGui;return(g.InputTextState.ID==id)?&g.InputTextState:NULL;}// Get input text state if active
#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