|
@@ -3870,6 +3870,222 @@ static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
|
|
{ ImGuiLocKey_DockingDragToUndockOrMoveNode,"Click and drag to move or undock whole node." },
|
|
{ ImGuiLocKey_DockingDragToUndockOrMoveNode,"Click and drag to move or undock whole node." },
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
|
|
|
|
+{
|
|
|
|
+ IO.Ctx = this;
|
|
|
|
+ InputTextState.Ctx = this;
|
|
|
|
+
|
|
|
|
+ Initialized = false;
|
|
|
|
+ ConfigFlagsCurrFrame = ConfigFlagsLastFrame = ImGuiConfigFlags_None;
|
|
|
|
+ FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
|
|
|
+ Font = NULL;
|
|
|
|
+ FontSize = FontBaseSize = FontScale = CurrentDpiScale = 0.0f;
|
|
|
|
+ IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
|
|
|
|
+ Time = 0.0f;
|
|
|
|
+ FrameCount = 0;
|
|
|
|
+ FrameCountEnded = FrameCountPlatformEnded = FrameCountRendered = -1;
|
|
|
|
+ WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
|
|
|
|
+ GcCompactAll = false;
|
|
|
|
+ TestEngineHookItems = false;
|
|
|
|
+ TestEngine = NULL;
|
|
|
|
+ memset(ContextName, 0, sizeof(ContextName));
|
|
|
|
+
|
|
|
|
+ InputEventsNextMouseSource = ImGuiMouseSource_Mouse;
|
|
|
|
+ InputEventsNextEventId = 1;
|
|
|
|
+
|
|
|
|
+ WindowsActiveCount = 0;
|
|
|
|
+ CurrentWindow = NULL;
|
|
|
|
+ HoveredWindow = NULL;
|
|
|
|
+ HoveredWindowUnderMovingWindow = NULL;
|
|
|
|
+ HoveredWindowBeforeClear = NULL;
|
|
|
|
+ MovingWindow = NULL;
|
|
|
|
+ WheelingWindow = NULL;
|
|
|
|
+ WheelingWindowStartFrame = WheelingWindowScrolledFrame = -1;
|
|
|
|
+ WheelingWindowReleaseTimer = 0.0f;
|
|
|
|
+
|
|
|
|
+ DebugDrawIdConflicts = 0;
|
|
|
|
+ DebugHookIdInfo = 0;
|
|
|
|
+ HoveredId = HoveredIdPreviousFrame = 0;
|
|
|
|
+ HoveredIdPreviousFrameItemCount = 0;
|
|
|
|
+ HoveredIdAllowOverlap = false;
|
|
|
|
+ HoveredIdIsDisabled = false;
|
|
|
|
+ HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
|
|
|
|
+ ItemUnclipByLog = false;
|
|
|
|
+ ActiveId = 0;
|
|
|
|
+ ActiveIdIsAlive = 0;
|
|
|
|
+ ActiveIdTimer = 0.0f;
|
|
|
|
+ ActiveIdIsJustActivated = false;
|
|
|
|
+ ActiveIdAllowOverlap = false;
|
|
|
|
+ ActiveIdNoClearOnFocusLoss = false;
|
|
|
|
+ ActiveIdHasBeenPressedBefore = false;
|
|
|
|
+ ActiveIdHasBeenEditedBefore = false;
|
|
|
|
+ ActiveIdHasBeenEditedThisFrame = false;
|
|
|
|
+ ActiveIdFromShortcut = false;
|
|
|
|
+ ActiveIdClickOffset = ImVec2(-1, -1);
|
|
|
|
+ ActiveIdWindow = NULL;
|
|
|
|
+ ActiveIdSource = ImGuiInputSource_None;
|
|
|
|
+ ActiveIdMouseButton = -1;
|
|
|
|
+ ActiveIdPreviousFrame = 0;
|
|
|
|
+ ActiveIdPreviousFrameIsAlive = false;
|
|
|
|
+ ActiveIdPreviousFrameHasBeenEditedBefore = false;
|
|
|
|
+ ActiveIdPreviousFrameWindow = NULL;
|
|
|
|
+ LastActiveId = 0;
|
|
|
|
+ LastActiveIdTimer = 0.0f;
|
|
|
|
+
|
|
|
|
+ LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0;
|
|
|
|
+
|
|
|
|
+ ActiveIdUsingNavDirMask = 0x00;
|
|
|
|
+ ActiveIdUsingAllKeyboardKeys = false;
|
|
|
|
+
|
|
|
|
+ CurrentFocusScopeId = 0;
|
|
|
|
+ CurrentItemFlags = ImGuiItemFlags_None;
|
|
|
|
+ DebugShowGroupRects = false;
|
|
|
|
+
|
|
|
|
+ CurrentViewport = NULL;
|
|
|
|
+ MouseViewport = MouseLastHoveredViewport = NULL;
|
|
|
|
+ PlatformLastFocusedViewportId = 0;
|
|
|
|
+ ViewportCreatedCount = PlatformWindowsCreatedCount = 0;
|
|
|
|
+ ViewportFocusedStampCount = 0;
|
|
|
|
+
|
|
|
|
+ NavWindow = NULL;
|
|
|
|
+ NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0;
|
|
|
|
+ NavLayer = ImGuiNavLayer_Main;
|
|
|
|
+ NavNextActivateId = 0;
|
|
|
|
+ NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
|
|
|
|
+ NavHighlightActivatedId = 0;
|
|
|
|
+ NavHighlightActivatedTimer = 0.0f;
|
|
|
|
+ NavInputSource = ImGuiInputSource_Keyboard;
|
|
|
|
+ NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
|
|
|
|
+ NavIdIsAlive = false;
|
|
|
|
+ NavMousePosDirty = false;
|
|
|
|
+ NavDisableHighlight = true;
|
|
|
|
+ NavDisableMouseHover = false;
|
|
|
|
+
|
|
|
|
+ NavAnyRequest = false;
|
|
|
|
+ NavInitRequest = false;
|
|
|
|
+ NavInitRequestFromMove = false;
|
|
|
|
+ NavMoveSubmitted = false;
|
|
|
|
+ NavMoveScoringItems = false;
|
|
|
|
+ NavMoveForwardToNextFrame = false;
|
|
|
|
+ NavMoveFlags = ImGuiNavMoveFlags_None;
|
|
|
|
+ NavMoveScrollFlags = ImGuiScrollFlags_None;
|
|
|
|
+ NavMoveKeyMods = ImGuiMod_None;
|
|
|
|
+ NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
|
|
|
|
+ NavScoringDebugCount = 0;
|
|
|
|
+ NavTabbingDir = 0;
|
|
|
|
+ NavTabbingCounter = 0;
|
|
|
|
+
|
|
|
|
+ NavJustMovedFromFocusScopeId = NavJustMovedToId = NavJustMovedToFocusScopeId = 0;
|
|
|
|
+ NavJustMovedToKeyMods = ImGuiMod_None;
|
|
|
|
+ NavJustMovedToIsTabbing = false;
|
|
|
|
+ NavJustMovedToHasSelectionData = false;
|
|
|
|
+
|
|
|
|
+ // All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac...
|
|
|
|
+ // FIXME: Because this value is stored, it annoyingly interfere with toggling io.ConfigMacOSXBehaviors updating this..
|
|
|
|
+ ConfigNavWindowingKeyNext = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiKey_Tab);
|
|
|
|
+ ConfigNavWindowingKeyPrev = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab);
|
|
|
|
+ NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
|
|
|
|
+ NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
|
|
|
|
+ NavWindowingToggleLayer = false;
|
|
|
|
+ NavWindowingToggleKey = ImGuiKey_None;
|
|
|
|
+
|
|
|
|
+ DimBgRatio = 0.0f;
|
|
|
|
+
|
|
|
|
+ DragDropActive = DragDropWithinSource = DragDropWithinTarget = false;
|
|
|
|
+ DragDropSourceFlags = ImGuiDragDropFlags_None;
|
|
|
|
+ DragDropSourceFrameCount = -1;
|
|
|
|
+ DragDropMouseButton = -1;
|
|
|
|
+ DragDropTargetId = 0;
|
|
|
|
+ DragDropAcceptFlags = ImGuiDragDropFlags_None;
|
|
|
|
+ DragDropAcceptIdCurrRectSurface = 0.0f;
|
|
|
|
+ DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
|
|
|
|
+ DragDropAcceptFrameCount = -1;
|
|
|
|
+ DragDropHoldJustPressedId = 0;
|
|
|
|
+ memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
|
|
|
|
+
|
|
|
|
+ ClipperTempDataStacked = 0;
|
|
|
|
+
|
|
|
|
+ CurrentTable = NULL;
|
|
|
|
+ TablesTempDataStacked = 0;
|
|
|
|
+ CurrentTabBar = NULL;
|
|
|
|
+ CurrentMultiSelect = NULL;
|
|
|
|
+ MultiSelectTempDataStacked = 0;
|
|
|
|
+
|
|
|
|
+ HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0;
|
|
|
|
+ HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f;
|
|
|
|
+
|
|
|
|
+ MouseCursor = ImGuiMouseCursor_Arrow;
|
|
|
|
+ MouseStationaryTimer = 0.0f;
|
|
|
|
+
|
|
|
|
+ TempInputId = 0;
|
|
|
|
+ memset(&DataTypeZeroValue, 0, sizeof(DataTypeZeroValue));
|
|
|
|
+ BeginMenuDepth = BeginComboDepth = 0;
|
|
|
|
+ ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
|
|
|
|
+ ColorEditCurrentID = ColorEditSavedID = 0;
|
|
|
|
+ ColorEditSavedHue = ColorEditSavedSat = 0.0f;
|
|
|
|
+ ColorEditSavedColor = 0;
|
|
|
|
+ WindowResizeRelativeMode = false;
|
|
|
|
+ ScrollbarSeekMode = 0;
|
|
|
|
+ ScrollbarClickDeltaToGrabCenter = 0.0f;
|
|
|
|
+ SliderGrabClickOffset = 0.0f;
|
|
|
|
+ SliderCurrentAccum = 0.0f;
|
|
|
|
+ SliderCurrentAccumDirty = false;
|
|
|
|
+ DragCurrentAccumDirty = false;
|
|
|
|
+ DragCurrentAccum = 0.0f;
|
|
|
|
+ DragSpeedDefaultRatio = 1.0f / 100.0f;
|
|
|
|
+ DisabledAlphaBackup = 0.0f;
|
|
|
|
+ DisabledStackSize = 0;
|
|
|
|
+ LockMarkEdited = 0;
|
|
|
|
+ TooltipOverrideCount = 0;
|
|
|
|
+
|
|
|
|
+ PlatformImeData.InputPos = ImVec2(0.0f, 0.0f);
|
|
|
|
+ PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission
|
|
|
|
+ PlatformImeViewport = 0;
|
|
|
|
+
|
|
|
|
+ DockNodeWindowMenuHandler = NULL;
|
|
|
|
+
|
|
|
|
+ SettingsLoaded = false;
|
|
|
|
+ SettingsDirtyTimer = 0.0f;
|
|
|
|
+ HookIdNext = 0;
|
|
|
|
+
|
|
|
|
+ memset(LocalizationTable, 0, sizeof(LocalizationTable));
|
|
|
|
+
|
|
|
|
+ LogEnabled = false;
|
|
|
|
+ LogType = ImGuiLogType_None;
|
|
|
|
+ LogNextPrefix = LogNextSuffix = NULL;
|
|
|
|
+ LogFile = NULL;
|
|
|
|
+ LogLinePosY = FLT_MAX;
|
|
|
|
+ LogLineFirstItem = false;
|
|
|
|
+ LogDepthRef = 0;
|
|
|
|
+ LogDepthToExpand = LogDepthToExpandDefault = 2;
|
|
|
|
+
|
|
|
|
+ DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
|
|
|
|
+ DebugLocateId = 0;
|
|
|
|
+ DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None;
|
|
|
|
+ DebugLogAutoDisableFrames = 0;
|
|
|
|
+ DebugLocateFrames = 0;
|
|
|
|
+ DebugBeginReturnValueCullDepth = -1;
|
|
|
|
+ DebugItemPickerActive = false;
|
|
|
|
+ DebugItemPickerMouseButton = ImGuiMouseButton_Left;
|
|
|
|
+ DebugItemPickerBreakId = 0;
|
|
|
|
+ DebugFlashStyleColorTime = 0.0f;
|
|
|
|
+ DebugFlashStyleColorIdx = ImGuiCol_COUNT;
|
|
|
|
+ DebugHoveredDockNode = NULL;
|
|
|
|
+
|
|
|
|
+ // Same as DebugBreakClearData(). Those fields are scattered in their respective subsystem to stay in hot-data locations
|
|
|
|
+ DebugBreakInWindow = 0;
|
|
|
|
+ DebugBreakInTable = 0;
|
|
|
|
+ DebugBreakInLocateId = false;
|
|
|
|
+ DebugBreakKeyChord = ImGuiKey_Pause;
|
|
|
|
+ DebugBreakInShortcutRouting = ImGuiKey_None;
|
|
|
|
+
|
|
|
|
+ memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
|
|
|
|
+ FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
|
|
|
|
+ FramerateSecPerFrameAccum = 0.0f;
|
|
|
|
+ WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
|
|
|
|
+ memset(TempKeychordName, 0, sizeof(TempKeychordName));
|
|
|
|
+}
|
|
|
|
+
|
|
void ImGui::Initialize()
|
|
void ImGui::Initialize()
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
@@ -8298,9 +8514,8 @@ void ImGui::PopItemFlag()
|
|
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
|
|
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
|
|
// - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently.
|
|
// - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently.
|
|
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
|
|
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
|
|
-// - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions.
|
|
|
|
-// (as a micro-optimisation if you can avoid calling BeginDisabled(false)/EndDisabled() tens of thousands of times by doing a local check, it won't hurt)
|
|
|
|
-// - Optimized shortcuts instead of PushStyleVar() + PushItemFlag()
|
|
|
|
|
|
+// - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions.
|
|
|
|
+// (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls)
|
|
// - Note: mixing up BeginDisabled() and PushItemFlag(ImGuiItemFlags_Disabled) is currently NOT SUPPORTED.
|
|
// - Note: mixing up BeginDisabled() and PushItemFlag(ImGuiItemFlags_Disabled) is currently NOT SUPPORTED.
|
|
void ImGui::BeginDisabled(bool disabled)
|
|
void ImGui::BeginDisabled(bool disabled)
|
|
{
|
|
{
|
|
@@ -10908,7 +11123,6 @@ void ImGui::ErrorLogCallbackToDebugLog(void*, const char* fmt, ...)
|
|
// Must be called during or before EndFrame().
|
|
// Must be called during or before EndFrame().
|
|
// This is generally flawed as we are not necessarily End/Popping things in the right order.
|
|
// This is generally flawed as we are not necessarily End/Popping things in the right order.
|
|
// FIXME: Can't recover from inside BeginTabItem/EndTabItem yet.
|
|
// FIXME: Can't recover from inside BeginTabItem/EndTabItem yet.
|
|
-// FIXME: Can't recover from interleaved BeginTabBar/Begin
|
|
|
|
void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data)
|
|
void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data)
|
|
{
|
|
{
|
|
// PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations"
|
|
// PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations"
|
|
@@ -10939,7 +11153,7 @@ void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, voi
|
|
void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data)
|
|
void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data)
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
- while (g.CurrentTable && (g.CurrentTable->OuterWindow == g.CurrentWindow || g.CurrentTable->InnerWindow == g.CurrentWindow))
|
|
|
|
|
|
+ while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow)
|
|
{
|
|
{
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'\n", g.CurrentTable->OuterWindow->Name);
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'\n", g.CurrentTable->OuterWindow->Name);
|
|
EndTable();
|
|
EndTable();
|
|
@@ -10948,7 +11162,7 @@ void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, vo
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
ImGuiStackSizes* stack_sizes = &g.CurrentWindowStack.back().StackSizesOnBegin;
|
|
ImGuiStackSizes* stack_sizes = &g.CurrentWindowStack.back().StackSizesOnBegin;
|
|
IM_ASSERT(window != NULL);
|
|
IM_ASSERT(window != NULL);
|
|
- while (g.CurrentTabBar != NULL) //-V1044
|
|
|
|
|
|
+ while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044
|
|
{
|
|
{
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndTabBar() in '%s'\n", window->Name);
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndTabBar() in '%s'\n", window->Name);
|
|
EndTabBar();
|
|
EndTabBar();
|