// 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)
#pragma once
#ifndef IMGUI_VERSION
#error Must include imgui.h before imgui_internal.h
#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)
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
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
structImGuiColumnData;// Storage data for a single column
structImGuiColumnsSet;// Storage data for a columns set
structImGuiContext;// Main imgui context
structImGuiGroupData;// Stacked storage data for BeginGroup()/EndGroup()
structImGuiInputTextState;// Internal state of the currently focused/edited text input box
structImGuiItemHoveredDataBackup;// Backup and restore IsItemHovered() internal data
structImGuiMenuColumns;// Simple column measurement, currently used for MenuItem() only
structImGuiNavMoveResult;// Result of a directional navigation move query result
structImGuiNextWindowData;// Storage for SetNexWindow** functions
structImGuiPopupRef;// Storage for current popup stack
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
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)
structImGuiWindowSettings;// Storage for window settings stored in .ini file (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.
typedefintImGuiLayoutType;// -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
typedefintImGuiButtonFlags;// -> enum ImGuiButtonFlags_ // Flags: for ButtonEx(), ButtonBehavior()
typedefintImGuiItemFlags;// -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
typedefintImGuiItemStatusFlags;// -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
typedefintImGuiNavHighlightFlags;// -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
typedefintImGuiNavDirSourceFlags;// -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
typedefintImGuiNavMoveFlags;// -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
typedefintImGuiSeparatorFlags;// -> enum ImGuiSeparatorFlags_ // Flags: for Separator() - internal
typedefintImGuiSliderFlags;// -> enum ImGuiSliderFlags_ // Flags: for SliderBehavior()
#define IM_NEWLINE "\r\n" // Play it nice with Windows users (2018/05 news: Microsoft announced that Notepad will finally display Unix-style carriage returns!)
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
// 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.
staticinlinefloatImFloorStd(floatx){returnfloorf(x);}// we already uses our own ImFloor() { return (float)(int)v } internally so the standard one wrapper is named differently (it's used by stb_truetype)
staticinlinefloatImCeil(floatx){returnceilf(x);}
#endif
// - ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support for variety of types: signed/unsigned int/long long float/double, using templates here but we could also redefine them 6 times
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D and maintenance of some patches)
structImVec1
{
floatx;
ImVec1(){x=0.0f;}
ImVec1(float_x){x=_x;}
};
enumImGuiButtonFlags_
{
ImGuiButtonFlags_None=0,
ImGuiButtonFlags_Repeat=1<<0,// hold to repeat
ImGuiButtonFlags_PressedOnClickRelease=1<<1,// return true on click + release on same item [DEFAULT if no PressedOn* flag is set]
ImGuiButtonFlags_PressedOnClick=1<<2,// return true on click (default requires click+release)
ImGuiButtonFlags_PressedOnRelease=1<<3,// return true on release (default requires click+release)
ImGuiButtonFlags_PressedOnDoubleClick=1<<4,// return true on double-click (default requires click+release)
ImGuiButtonFlags_FlattenChildren=1<<5,// allow interactions even if a child window is overlapping
ImGuiButtonFlags_AllowItemOverlap=1<<6,// require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
ImGuiButtonFlags_DontClosePopups=1<<7,// disable automatically closing parent popup on press // [UNUSED]
ImGuiButtonFlags_AlignTextBaseLine=1<<9,// 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<<10,// disable interaction if a key modifier is held
ImGuiButtonFlags_NoHoldingActiveID=1<<11,// don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
ImGuiButtonFlags_PressedOnDragDropHold=1<<12,// press when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
ImGuiButtonFlags_NoNavFocus=1<<13// don't override navigation focus when activated
ImGuiColumnsFlags_NoResize=1<<1,// Disable resizing columns when clicking on the dividers
ImGuiColumnsFlags_NoPreserveWidths=1<<2,// Disable column width preservation when adjusting columns
ImGuiColumnsFlags_NoForceWithinWindow=1<<3,// Disable forcing columns to fit within window
ImGuiColumnsFlags_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.
};
enumImGuiSelectableFlagsPrivate_
{
// NB: need to be in sync with last value of ImGuiSelectableFlags_
ImGuiSelectableFlags_NoHoldingActiveID=1<<10,
ImGuiSelectableFlags_PressedOnClick=1<<11,
ImGuiSelectableFlags_PressedOnRelease=1<<12,
ImGuiSelectableFlags_DrawFillAvailWidth=1<<13
};
enumImGuiSeparatorFlags_
{
ImGuiSeparatorFlags_None=0,
ImGuiSeparatorFlags_Horizontal=1<<0,// Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
ImGuiSeparatorFlags_Vertical=1<<1
};
// Storage for LastItem data
enumImGuiItemStatusFlags_
{
ImGuiItemStatusFlags_None=0,
ImGuiItemStatusFlags_HoveredRect=1<<0,
ImGuiItemStatusFlags_HasDisplayRect=1<<1,
ImGuiItemStatusFlags_Edited=1<<2// Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
};
// FIXME: this is in development, not exposed/functional as a generic feature yet.
enumImGuiLayoutType_
{
ImGuiLayoutType_Vertical,
ImGuiLayoutType_Horizontal
};
enumImGuiAxis
{
ImGuiAxis_None=-1,
ImGuiAxis_X=0,
ImGuiAxis_Y=1
};
enumImGuiPlotType
{
ImGuiPlotType_Lines,
ImGuiPlotType_Histogram
};
enumImGuiInputSource
{
ImGuiInputSource_None=0,
ImGuiInputSource_Mouse,
ImGuiInputSource_Nav,
ImGuiInputSource_NavKeyboard,// Only used occasionally for storage, not tested/handled by most code
ImGuiInputSource_NavGamepad,// "
ImGuiInputSource_COUNT
};
// FIXME-NAV: Clarify/expose various repeat delay/rate
enumImGuiInputReadMode
{
ImGuiInputReadMode_Down,
ImGuiInputReadMode_Pressed,
ImGuiInputReadMode_Released,
ImGuiInputReadMode_Repeat,
ImGuiInputReadMode_RepeatSlow,
ImGuiInputReadMode_RepeatFast
};
enumImGuiNavHighlightFlags_
{
ImGuiNavHighlightFlags_None=0,
ImGuiNavHighlightFlags_TypeDefault=1<<0,
ImGuiNavHighlightFlags_TypeThin=1<<1,
ImGuiNavHighlightFlags_AlwaysDraw=1<<2,
ImGuiNavHighlightFlags_NoRounding=1<<3
};
enumImGuiNavDirSourceFlags_
{
ImGuiNavDirSourceFlags_None=0,
ImGuiNavDirSourceFlags_Keyboard=1<<0,
ImGuiNavDirSourceFlags_PadDPad=1<<1,
ImGuiNavDirSourceFlags_PadLStick=1<<2
};
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 for 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 NavMoveResultLocalVisibleSet that only comprise elements that are already fully visible.
};
enumImGuiNavForward
{
ImGuiNavForward_None,
ImGuiNavForward_ForwardQueued,
ImGuiNavForward_ForwardActive
};
enumImGuiPopupPositionPolicy
{
ImGuiPopupPositionPolicy_Default,
ImGuiPopupPositionPolicy_ComboBox
};
// 2D axis aligned bounding-box
// NB: we can't rely on ImVec2 math operators being available here
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.
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == ImHash(TypeName, 0, 0)
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(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*ParentWindow;// Set on OpenPopup()
intOpenFrameCount;// Set on OpenPopup()
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differenciate 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
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;
intFrameCountRendered;
ImVector<ImGuiWindow*>Windows;// Windows, sorted in display order, back to front
ImVector<ImGuiWindow*>WindowsFocusOrder;// Windows, sorted in focus order, back to front
ImVector<ImGuiWindow*>WindowsSortBuffer;
ImVector<ImGuiWindow*>CurrentWindowStack;
ImGuiStorageWindowsById;
intWindowsActiveCount;
ImGuiWindow*CurrentWindow;// Being drawn into
ImGuiWindow*HoveredWindow;// Will catch mouse inputs
ImGuiWindow*HoveredRootWindow;// Will catch mouse inputs (for focus/move only)
ImGuiIDHoveredId;// Hovered widget
boolHoveredIdAllowOverlap;
ImGuiIDHoveredIdPreviousFrame;
floatHoveredIdTimer;
ImGuiIDActiveId;// Active widget
ImGuiIDActiveIdPreviousFrame;
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)
boolActiveIdHasBeenEdited;// Was the value associated to the widget Edited over the course of the Active state.
boolActiveIdPreviousFrameIsAlive;
boolActiveIdPreviousFrameHasBeenEdited;
intActiveIdAllowNavDirFlags;// Active widget allows using directional navigation (e.g. can activate a button and move away from it)
ImVec2ActiveIdClickOffset;// Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
ImGuiWindow*ActiveIdWindow;
ImGuiWindow*ActiveIdPreviousFrameWindow;
ImGuiInputSourceActiveIdSource;// Activating with mouse or nav (gamepad/keyboard)
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.
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImVector<ImGuiColorMod>ColorModifiers;// Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiStyleMod>StyleModifiers;// Stack for PushStyleVar()/PopStyleVar()
ImVector<ImFont*>FontStack;// Stack for PushFont()/PopFont()
ImVector<ImGuiPopupRef>OpenPopupStack;// Which popups are open (persistent)
ImVector<ImGuiPopupRef>CurrentPopupStack;// Which level of BeginPopup() we are in (reset every frame)
ImGuiNextWindowDataNextWindowData;// Storage for SetNextWindow** functions
boolNextTreeNodeOpenVal;// Storage for SetNextTreeNode** functions
ImGuiCondNextTreeNodeOpenCond;
// Navigation data (for gamepad/keyboard)
ImGuiWindow*NavWindow;// Focused window for navigation. Could be called 'FocusWindow'
ImGuiIDNavId;// Focused item for navigation
ImGuiIDNavActivateId;// ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem()
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest)
ImGuiIDNavNextActivateId;// Set by ActivateItem(), queued until next frame
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode?
ImRectNavScoringRectScreen;// Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
intNavScoringCount;// Metrics for debugging
ImGuiWindow*NavWindowingTarget;// When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
ImGuiWindow*NavWindowingTargetAnim;// Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f
ImGuiWindow*NavWindowingList;
floatNavWindowingTimer;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
intNavLayer;// 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.
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRefRectRel 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.
boolNavInitRequest;// Init request for appearing window to select first item
boolNavInitRequestFromMove;
ImGuiIDNavInitResultId;
ImRectNavInitResultRectRel;
boolNavMoveFromClampedRefRect;// Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items
boolNavMoveRequest;// Move request for this frame
ImGuiNavMoveFlagsNavMoveRequestFlags;
ImGuiNavForwardNavMoveRequestForward;// None / ForwardQueued / ForwardActive (this is used to navigate sibling parent menus from a child menu)
ImGuiDirNavMoveDir,NavMoveDirLast;// Direction of the move request (left/right/up/down), direction of the previous move request
ImGuiDirNavMoveClipDir;
ImGuiNavMoveResultNavMoveResultLocal;// Best move request candidate within NavWindow
ImGuiNavMoveResultNavMoveResultLocalVisibleSet;// Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavMoveResultNavMoveResultOther;// Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
// Render
ImDrawDataDrawData;// Main ImDrawData instance to pass render information to the user
ImDrawDataBuilderDrawDataBuilder;
floatDimBgRatio;// 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
ImDrawListOverlayDrawList;// Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays
ImGuiMouseCursorMouseCursor;
// Drag and Drop
boolDragDropActive;
boolDragDropWithinSourceOrTarget;
ImGuiDragDropFlagsDragDropSourceFlags;
intDragDropSourceFrameCount;
intDragDropMouseButton;
ImGuiPayloadDragDropPayload;
ImRectDragDropTargetRect;
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
ImVector<unsignedchar>DragDropPayloadBufHeap;// We don't expose the ImVector<> directly
unsignedcharDragDropPayloadBufLocal[8];// Local buffer for small payloads
// Widget state
ImGuiInputTextStateInputTextState;
ImFontInputTextPasswordFont;
ImGuiIDScalarAsInputTextId;// Temporary text input when CTRL+clicking on a slider, etc.
ImGuiColorEditFlagsColorEditOptions;// Store user options for color edit widgets
ImVec4ColorPickerRef;
boolDragCurrentAccumDirty;
floatDragCurrentAccum;// Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
floatDragSpeedDefaultRatio;// If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
ImVec2ScrollbarClickDeltaToGrabCenter;// Distance between mouse and center of grab box, normalized in parent space. Use storage?
intTooltipOverrideCount;
ImVector<char>PrivateClipboard;// If no custom clipboard handler is defined
ImVec2PlatformImePos,PlatformImeLastPos;// Cursor position request & last passed to the OS Input Method Editor
// Settings
boolSettingsLoaded;
floatSettingsDirtyTimer;// Save .ini Settings to memory when time reaches zero
ImGuiTextBufferSettingsIniData;// In memory .ini settings
ImVector<ImGuiSettingsHandler>SettingsHandlers;// List of .ini settings handlers
ImVector<ImGuiWindowSettings>SettingsWindows;// ImGuiWindow .ini settings entries (parsed from the last loaded .ini file and maintained on saving)
// Logging
boolLogEnabled;
FILE*LogFile;// If != NULL log to stdout/ file
ImGuiTextBufferLogClipboard;// Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
intLogStartDepth;
intLogAutoExpandMaxDepth;
// Misc
floatFramerateSecPerFrame[120];// Calculate estimate of framerate for user over the last 2 seconds.
intFramerateSecPerFrameIdx;
floatFramerateSecPerFrameAccum;
intWantCaptureMouseNextFrame;// Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags
// 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_NoTabStop=1<<0,// false
ImGuiItemFlags_ButtonRepeat=1<<1,// false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
ImGuiItemFlags_Disabled=1<<2,// false // [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
ImGuiItemFlags_NoNav=1<<3,// false
ImGuiItemFlags_NoNavDefaultFocus=1<<4,// false
ImGuiItemFlags_SelectableDontClosePopup=1<<5,// false // MenuItem/Selectable() automatically closes current Popup window
ImGuiItemFlags_Default_=0
};
// Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow.
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
structIMGUI_APIImGuiWindowTempData
{
ImVec2CursorPos;
ImVec2CursorPosPrevLine;
ImVec2CursorStartPos;// Initial position in client area with padding
ImVec2CursorMaxPos;// Used to implicitly calculate the size of our contents, always growing during the frame. Turned into window->SizeContents at the beginning of next frame
ImVec2CurrentLineSize;
floatCurrentLineTextBaseOffset;
ImVec2PrevLineSize;
floatPrevLineTextBaseOffset;
floatLogLinePosY;
intTreeDepth;
ImU32TreeDepthMayJumpToParentOnPop;// Store a copy of !g.NavIdIsAlive for TreeDepth 0..31
ImGuiIDLastItemId;
ImGuiItemStatusFlagsLastItemStatusFlags;
ImRectLastItemRect;// Interaction rect
ImRectLastItemDisplayRect;// End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
intNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
intNavLayerCurrentMask;// = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
intNavLayerActiveMask;// Which layer have been written to (result from previous frame)
intNavLayerActiveMaskNext;// Which layer have been written to (buffer for current frame)
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.
ImVector<ImGuiWindow*>ChildWindows;
ImGuiStorage*StateStorage;
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
// 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.
intStackSizesBackup[6];// Store size of various stacks for asserting
ImVec1Indent;// Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
ImVec1GroupOffset;
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.
ImGuiWindowFlagsFlags;// See enum ImGuiWindowFlags_
ImVec2Pos;// Position (always rounded-up to nearest pixel)
ImVec2Size;// Current size (==SizeFull or collapsed title bar size)
ImVec2SizeFull;// Size when non collapsed
ImVec2SizeFullAtLastBegin;// Copy of SizeFull at the end of Begin. This is the reference value we'll use on the next frame to decide if we need scrollbars.
ImVec2SizeContents;// Size of contents (== extents reach of the drawing cursor) from previous frame. Include decoration, window title, border, menu, etc.
ImVec2SizeContentsExplicit;// Size of contents explicitly set by the user via SetNextWindowContentSize()
ImVec2WindowPadding;// Window padding at the time of begin.
floatWindowRounding;// Window rounding at the time of begin.
floatWindowBorderSize;// Window border size at the time of begin.
ImGuiIDMoveId;// == window->GetID("#MOVE")
ImGuiIDChildId;// ID of corresponding item in parent window (for navigation to return from child window to parent window)
ImVec2Scroll;
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
ImVec2ScrollbarSizes;// Size taken by scrollbars on each axis
boolScrollbarX,ScrollbarY;
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 (== (HiddenFramesForResize > 0) ||
boolHasCloseButton;// Set when the window has a close button (p_open != NULL)
intBeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
intBeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
intBeginOrderWithinContext;// Order within entire imgui context. This is mostly used for debugging submission order related issues.
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
intAutoFitFramesX,AutoFitFramesY;
boolAutoFitOnlyGrows;
intAutoFitChildAxises;
ImGuiDirAutoPosLastDirection;
intHiddenFramesRegular;// Hide the window for N frames
intHiddenFramesForResize;// Hide the window for N frames while allowing items to be submitted so we can measure their size
ImGuiCondSetWindowPosAllowFlags;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowSizeAllowFlags;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowCollapsedAllowFlags;// store acceptable condition flags for SetNextWindowCollapsed() 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.
ImGuiWindowTempDataDC;// Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
ImVector<ImGuiID>IDStack;// ID stack. ID are hashes seeded with the value at the top of the stack
ImRectOuterRectClipped;// = WindowRect just after setup in Begin(). == window->Rect() for root window.
ImRectInnerMainRect,InnerClipRect;
ImRectContentsRegionRect;// FIXME: This is currently confusing/misleading. Maximum visible content position ~~ Pos + (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis
intLastFrameActive;// Last frame number the window was Active.
floatItemWidthDefault;
ImGuiMenuColumnsMenuColumns;// Simplified columns storage for menu items
ImGuiStorageStateStorage;
ImVector<ImGuiColumnsSet>ColumnsStorage;
floatFontWindowScale;// User scale multiplier per-window
intSettingsIdx;// Index into SettingsWindow[] (indices 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 window, this is pointing to our parent. Otherwise NULL.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window.
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[2];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[2];// Reference rectangle, in window relative space
// Navigation / Focus
// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext
intFocusIdxAllCounter;// Start at -1 and increase as assigned via FocusItemRegister()
intFocusIdxTabCounter;// (same, but only count widgets which you can Tab through)
intFocusIdxAllRequestCurrent;// Item being requested for focus
intFocusIdxTabRequestCurrent;// Tab-able item being requested for focus
intFocusIdxAllRequestNext;// Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
IMGUI_APIvoidShutdown(ImGuiContext*context);// Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
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.
IMGUI_APIvoidBeginColumns(constchar*str_id,intcount,ImGuiColumnsFlagsflags=0);// setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
// 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_APIvoidVerticalSeparator();// Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout.
IMGUI_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
IMGUI_APIvoidTreePushRawID(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); "