|
|
@@ -1,4 +1,4 @@
|
|
|
-// dear imgui, v1.91.1 WIP
|
|
|
+// dear imgui, v1.91.4
|
|
|
// (internal structures/api)
|
|
|
|
|
|
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
|
|
|
@@ -28,6 +28,7 @@ Index of this file:
|
|
|
// [SECTION] Viewport support
|
|
|
// [SECTION] Settings support
|
|
|
// [SECTION] Localization support
|
|
|
+// [SECTION] Error handling, State recovery support
|
|
|
// [SECTION] Metrics, Debug tools
|
|
|
// [SECTION] Generic context hooks
|
|
|
// [SECTION] ImGuiContext (main imgui context)
|
|
|
@@ -94,6 +95,7 @@ Index of this file:
|
|
|
#pragma GCC diagnostic push
|
|
|
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
|
|
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
|
|
+#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
|
|
|
#endif
|
|
|
|
|
|
// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h
|
|
|
@@ -130,6 +132,7 @@ struct ImGuiContext; // Main Dear ImGui context
|
|
|
struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine
|
|
|
struct ImGuiDataVarInfo; // Variable information (e.g. to access style variables from an enum)
|
|
|
struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum
|
|
|
+struct ImGuiErrorRecoveryState; // Storage of stack sizes for error handling and recovery
|
|
|
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
|
|
|
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
|
|
|
struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id
|
|
|
@@ -138,7 +141,7 @@ struct ImGuiLocEntry; // A localization entry.
|
|
|
struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
|
|
|
struct ImGuiMultiSelectState; // Multi-selection persistent state (for focused selection).
|
|
|
struct ImGuiMultiSelectTempData; // Multi-selection temporary state (while traversing).
|
|
|
-struct ImGuiNavItemData; // Result of a gamepad/keyboard directional navigation move query result
|
|
|
+struct ImGuiNavItemData; // Result of a keyboard/gamepad directional navigation move query result
|
|
|
struct ImGuiMetricsConfig; // Storage for ShowMetricsWindow() and DebugNodeXXX() functions
|
|
|
struct ImGuiNextWindowData; // Storage for SetNextWindow** functions
|
|
|
struct ImGuiNextItemData; // Storage for SetNextItem** functions
|
|
|
@@ -146,7 +149,6 @@ struct ImGuiOldColumnData; // Storage data for a single column for lega
|
|
|
struct ImGuiOldColumns; // Storage data for a columns set for legacy Columns() api
|
|
|
struct ImGuiPopupData; // Storage for current popup stack
|
|
|
struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file
|
|
|
-struct ImGuiStackSizes; // Storage of stack sizes for debugging/asserting
|
|
|
struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it
|
|
|
struct ImGuiTabBar; // Storage for a tab bar
|
|
|
struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
|
|
|
@@ -172,10 +174,10 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E
|
|
|
// Flags
|
|
|
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
|
|
|
typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
|
|
|
-typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow();
|
|
|
+typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow()
|
|
|
typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags
|
|
|
typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
|
|
|
-typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
|
|
|
+typedef int ImGuiNavRenderCursorFlags; // -> enum ImGuiNavRenderCursorFlags_//Flags: for RenderNavCursor()
|
|
|
typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
|
|
|
typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
|
|
|
typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
|
|
|
@@ -186,8 +188,6 @@ typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // F
|
|
|
typedef int ImGuiTypingSelectFlags; // -> enum ImGuiTypingSelectFlags_ // Flags: for GetTypingSelectRequest()
|
|
|
typedef int ImGuiWindowRefreshFlags; // -> enum ImGuiWindowRefreshFlags_ // Flags: for SetNextWindowRefreshPolicy()
|
|
|
|
|
|
-typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
|
|
|
-
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] Context pointer
|
|
|
// See implementation of this variable in imgui.cpp for comments and details.
|
|
|
@@ -197,24 +197,6 @@ typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
|
|
|
extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
|
|
#endif
|
|
|
|
|
|
-//-------------------------------------------------------------------------
|
|
|
-// [SECTION] STB libraries includes
|
|
|
-//-------------------------------------------------------------------------
|
|
|
-
|
|
|
-namespace ImStb
|
|
|
-{
|
|
|
-
|
|
|
-#undef IMSTB_TEXTEDIT_STRING
|
|
|
-#undef IMSTB_TEXTEDIT_CHARTYPE
|
|
|
-#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
|
|
|
-#define IMSTB_TEXTEDIT_CHARTYPE ImWchar
|
|
|
-#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
|
|
|
-#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
|
|
|
-#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
|
|
|
-#include "imstb_textedit.h"
|
|
|
-
|
|
|
-} // namespace ImStb
|
|
|
-
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] Macros
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -235,6 +217,7 @@ namespace ImStb
|
|
|
#else
|
|
|
#define IMGUI_DEBUG_LOG(...) ((void)0)
|
|
|
#endif
|
|
|
+#define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0)
|
|
|
#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
|
#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
|
#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
|
|
@@ -256,12 +239,6 @@ namespace ImStb
|
|
|
#define IM_ASSERT_PARANOID(_EXPR)
|
|
|
#endif
|
|
|
|
|
|
-// Error handling
|
|
|
-// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults.
|
|
|
-#ifndef IM_ASSERT_USER_ERROR
|
|
|
-#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error
|
|
|
-#endif
|
|
|
-
|
|
|
// Misc Macros
|
|
|
#define IM_PI 3.14159265358979323846f
|
|
|
#ifdef _WIN32
|
|
|
@@ -383,7 +360,7 @@ IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end
|
|
|
IMGUI_API void ImStrTrimBlanks(char* str); // Remove leading and trailing blanks from a buffer.
|
|
|
IMGUI_API const char* ImStrSkipBlank(const char* str); // Find first non-blank character.
|
|
|
IMGUI_API int ImStrlenW(const ImWchar* str); // Computer string length (ImWchar string)
|
|
|
-IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line (ImWchar string)
|
|
|
+IMGUI_API const char* ImStrbol(const char* buf_mid_line, const char* buf_begin); // Find beginning-of-line
|
|
|
IM_MSVC_RUNTIME_CHECKS_OFF
|
|
|
static inline char ImToUpper(char c) { return (c >= 'a' && c <= 'z') ? c &= ~32 : c; }
|
|
|
static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
|
|
|
@@ -846,16 +823,18 @@ enum ImGuiDataTypePrivate_
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
// Extend ImGuiItemFlags
|
|
|
-// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags.
|
|
|
-// - output: stored in g.LastItemData.InFlags
|
|
|
+// - input: PushItemFlag() manipulates g.CurrentItemFlags, g.NextItemData.ItemFlags, ItemAdd() calls may add extra flags too.
|
|
|
+// - output: stored in g.LastItemData.ItemFlags
|
|
|
enum ImGuiItemFlagsPrivate_
|
|
|
{
|
|
|
// Controlled by user
|
|
|
- ImGuiItemFlags_Disabled = 1 << 10, // false // Disable interactions (DOES NOT affect visuals, see BeginDisabled()/EndDisabled() for full disable feature, and github #211).
|
|
|
+ ImGuiItemFlags_Disabled = 1 << 10, // false // Disable interactions (DOES NOT affect visuals. DO NOT mix direct use of this with BeginDisabled(). See BeginDisabled()/EndDisabled() for full disable feature, and github #211).
|
|
|
ImGuiItemFlags_ReadOnly = 1 << 11, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
|
|
|
ImGuiItemFlags_MixedValue = 1 << 12, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
|
|
|
ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13, // false // Disable hoverable check in ItemHoverable()
|
|
|
ImGuiItemFlags_AllowOverlap = 1 << 14, // false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
|
|
|
+ ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15, // false // Nav keyboard/gamepad mode doesn't disable hover highlight (behave as if NavHighlightItemUnderNav==false).
|
|
|
+ ImGuiItemFlags_NoMarkEdited = 1 << 16, // false // Skip calling MarkItemEdited()
|
|
|
|
|
|
// Controlled by widget code
|
|
|
ImGuiItemFlags_Inputable = 1 << 20, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
|
|
|
@@ -908,9 +887,8 @@ enum ImGuiInputTextFlagsPrivate_
|
|
|
{
|
|
|
// [Internal]
|
|
|
ImGuiInputTextFlags_Multiline = 1 << 26, // For internal use by InputTextMultiline()
|
|
|
- ImGuiInputTextFlags_NoMarkEdited = 1 << 27, // For internal use by functions using InputText() before reformatting data
|
|
|
- ImGuiInputTextFlags_MergedItem = 1 << 28, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
|
|
|
- ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 29, // For internal use by InputScalar() and TempInputScalar()
|
|
|
+ ImGuiInputTextFlags_MergedItem = 1 << 27, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
|
|
|
+ ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28, // For internal use by InputScalar() and TempInputScalar()
|
|
|
};
|
|
|
|
|
|
// Extend ImGuiButtonFlags_
|
|
|
@@ -922,15 +900,15 @@ enum ImGuiButtonFlagsPrivate_
|
|
|
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_Repeat = 1 << 10, // hold to repeat
|
|
|
ImGuiButtonFlags_FlattenChildren = 1 << 11, // allow interactions even if a child window is overlapping
|
|
|
ImGuiButtonFlags_AllowOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable.
|
|
|
- ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press // [UNUSED]
|
|
|
+ //ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press
|
|
|
//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_NoKeyModsAllowed = 1 << 16, // disable mouse interaction if a key modifier is held
|
|
|
ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
|
|
|
- ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.InFlags)
|
|
|
+ ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.ItemFlags)
|
|
|
ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, // don't report as hovered when nav focus is on this item
|
|
|
ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, // don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
|
|
ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, // don't test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
|
|
@@ -969,7 +947,7 @@ enum ImGuiSelectableFlagsPrivate_
|
|
|
enum ImGuiTreeNodeFlagsPrivate_
|
|
|
{
|
|
|
ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,// FIXME-WIP: Hard-coded for CollapsingHeader()
|
|
|
- ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,// FIXME-WIP: Turn Down arrow into an Up arrow, but reversed trees (#6517)
|
|
|
+ ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,// FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517)
|
|
|
ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
|
|
|
};
|
|
|
|
|
|
@@ -1109,20 +1087,31 @@ struct IMGUI_API ImGuiInputTextDeactivatedState
|
|
|
ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); }
|
|
|
void ClearFreeMemory() { ID = 0; TextA.clear(); }
|
|
|
};
|
|
|
+
|
|
|
+// Forward declare imstb_textedit.h structure + make its main configuration define accessible
|
|
|
+#undef IMSTB_TEXTEDIT_STRING
|
|
|
+#undef IMSTB_TEXTEDIT_CHARTYPE
|
|
|
+#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
|
|
|
+#define IMSTB_TEXTEDIT_CHARTYPE char
|
|
|
+#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
|
|
|
+#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
|
|
|
+#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
|
|
|
+namespace ImStb { struct STB_TexteditState; }
|
|
|
+typedef ImStb::STB_TexteditState ImStbTexteditState;
|
|
|
+
|
|
|
// Internal state of the currently focused/edited text input box
|
|
|
// For a given item ID, access with ImGui::GetInputTextState()
|
|
|
struct IMGUI_API ImGuiInputTextState
|
|
|
{
|
|
|
ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
|
|
|
+ ImStbTexteditState* Stb; // State for stb_textedit.h
|
|
|
ImGuiID ID; // widget id owning the text state
|
|
|
- int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
|
|
|
- ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
|
|
|
- ImVector<char> TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
|
|
|
+ int CurLenA; // UTF-8 length of the string in TextA (in bytes)
|
|
|
+ ImVector<char> TextA; // main UTF8 buffer.
|
|
|
ImVector<char> InitialTextA; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
|
|
|
- bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
|
|
|
+ ImVector<char> CallbackTextBackup; // temporary storage for callback to support automatic reconcile of undo-stack
|
|
|
int BufCapacityA; // end-user buffer capacity
|
|
|
ImVec2 Scroll; // horizontal offset (managed manually) + vertical scrolling (pulled from child window's own Scroll.y)
|
|
|
- ImStb::STB_TexteditState Stb; // state for stb_textedit.h
|
|
|
float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately
|
|
|
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
|
|
|
bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection
|
|
|
@@ -1132,32 +1121,31 @@ struct IMGUI_API ImGuiInputTextState
|
|
|
int ReloadSelectionStart; // POSITIONS ARE IN IMWCHAR units *NOT* UTF-8 this is why this is not exposed yet.
|
|
|
int ReloadSelectionEnd;
|
|
|
|
|
|
- ImGuiInputTextState() { memset(this, 0, sizeof(*this)); }
|
|
|
- void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
|
|
|
- void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
|
|
|
- int GetUndoAvailCount() const { return Stb.undostate.undo_point; }
|
|
|
- int GetRedoAvailCount() const { return IMSTB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
|
|
|
+ ImGuiInputTextState();
|
|
|
+ ~ImGuiInputTextState();
|
|
|
+ void ClearText() { CurLenA = 0; TextA[0] = 0; CursorClamp(); }
|
|
|
+ void ClearFreeMemory() { TextA.clear(); InitialTextA.clear(); }
|
|
|
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
|
|
|
+ void OnCharPressed(unsigned int c);
|
|
|
|
|
|
// Cursor & Selection
|
|
|
- void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
|
|
|
- void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
|
|
|
- bool HasSelection() const { return Stb.select_start != Stb.select_end; }
|
|
|
- void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
|
|
|
- int GetCursorPos() const { return Stb.cursor; }
|
|
|
- int GetSelectionStart() const { return Stb.select_start; }
|
|
|
- int GetSelectionEnd() const { return Stb.select_end; }
|
|
|
- void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
|
|
|
+ void CursorAnimReset();
|
|
|
+ void CursorClamp();
|
|
|
+ bool HasSelection() const;
|
|
|
+ void ClearSelection();
|
|
|
+ int GetCursorPos() const;
|
|
|
+ int GetSelectionStart() const;
|
|
|
+ int GetSelectionEnd() const;
|
|
|
+ void SelectAll();
|
|
|
|
|
|
// Reload user buf (WIP #2890)
|
|
|
// If you modify underlying user-passed const char* while active you need to call this (InputText V2 may lift this)
|
|
|
// strcpy(my_buf, "hello");
|
|
|
// if (ImGuiInputTextState* state = ImGui::GetInputTextState(id)) // id may be ImGui::GetItemID() is last item
|
|
|
// state->ReloadUserBufAndSelectAll();
|
|
|
- void ReloadUserBufAndSelectAll() { ReloadUserBuf = true; ReloadSelectionStart = 0; ReloadSelectionEnd = INT_MAX; }
|
|
|
- void ReloadUserBufAndKeepSelection() { ReloadUserBuf = true; ReloadSelectionStart = Stb.select_start; ReloadSelectionEnd = Stb.select_end; }
|
|
|
- void ReloadUserBufAndMoveToEnd() { ReloadUserBuf = true; ReloadSelectionStart = ReloadSelectionEnd = INT_MAX; }
|
|
|
-
|
|
|
+ void ReloadUserBufAndSelectAll();
|
|
|
+ void ReloadUserBufAndKeepSelection();
|
|
|
+ void ReloadUserBufAndMoveToEnd();
|
|
|
};
|
|
|
|
|
|
enum ImGuiWindowRefreshFlags_
|
|
|
@@ -1221,7 +1209,7 @@ enum ImGuiNextItemDataFlags_
|
|
|
|
|
|
struct ImGuiNextItemData
|
|
|
{
|
|
|
- ImGuiNextItemDataFlags Flags;
|
|
|
+ ImGuiNextItemDataFlags HasFlags; // Called HasFlags instead of Flags to avoid mistaking this
|
|
|
ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
|
|
|
// Non-flags members are NOT cleared by ItemAdd() meaning they are still valid during NavProcessItem()
|
|
|
ImGuiID FocusScopeId; // Set by SetNextItemSelectionUserData()
|
|
|
@@ -1235,14 +1223,14 @@ struct ImGuiNextItemData
|
|
|
ImGuiID StorageId; // Set by SetNextItemStorageID()
|
|
|
|
|
|
ImGuiNextItemData() { memset(this, 0, sizeof(*this)); SelectionUserData = -1; }
|
|
|
- inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
|
|
|
+ inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
|
|
|
};
|
|
|
|
|
|
// Status storage for the last submitted item
|
|
|
struct ImGuiLastItemData
|
|
|
{
|
|
|
ImGuiID ID;
|
|
|
- ImGuiItemFlags InFlags; // See ImGuiItemFlags_
|
|
|
+ ImGuiItemFlags ItemFlags; // See ImGuiItemFlags_
|
|
|
ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_
|
|
|
ImRect Rect; // Full rectangle
|
|
|
ImRect NavRect; // Navigation scoring rectangle (not displayed)
|
|
|
@@ -1262,13 +1250,16 @@ struct ImGuiTreeNodeStackData
|
|
|
{
|
|
|
ImGuiID ID;
|
|
|
ImGuiTreeNodeFlags TreeFlags;
|
|
|
- ImGuiItemFlags InFlags; // Used for nav landing
|
|
|
+ ImGuiItemFlags ItemFlags; // Used for nav landing
|
|
|
ImRect NavRect; // Used for nav landing
|
|
|
};
|
|
|
|
|
|
-struct IMGUI_API ImGuiStackSizes
|
|
|
+// sizeof() = 20
|
|
|
+struct IMGUI_API ImGuiErrorRecoveryState
|
|
|
{
|
|
|
+ short SizeOfWindowStack;
|
|
|
short SizeOfIDStack;
|
|
|
+ short SizeOfTreeStack;
|
|
|
short SizeOfColorStack;
|
|
|
short SizeOfStyleVarStack;
|
|
|
short SizeOfFontStack;
|
|
|
@@ -1278,18 +1269,16 @@ struct IMGUI_API ImGuiStackSizes
|
|
|
short SizeOfBeginPopupStack;
|
|
|
short SizeOfDisabledStack;
|
|
|
|
|
|
- ImGuiStackSizes() { memset(this, 0, sizeof(*this)); }
|
|
|
- void SetToContextState(ImGuiContext* ctx);
|
|
|
- void CompareWithContextState(ImGuiContext* ctx);
|
|
|
+ ImGuiErrorRecoveryState() { memset(this, 0, sizeof(*this)); }
|
|
|
};
|
|
|
|
|
|
// Data saved for each window pushed into the stack
|
|
|
struct ImGuiWindowStackData
|
|
|
{
|
|
|
- ImGuiWindow* Window;
|
|
|
- ImGuiLastItemData ParentLastItemDataBackup;
|
|
|
- ImGuiStackSizes StackSizesOnBegin; // Store size of various stacks for asserting
|
|
|
- bool DisabledOverrideReenable; // Non-child window override disabled flag
|
|
|
+ ImGuiWindow* Window;
|
|
|
+ ImGuiLastItemData ParentLastItemDataBackup;
|
|
|
+ ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
|
|
|
+ bool DisabledOverrideReenable; // Non-child window override disabled flag
|
|
|
};
|
|
|
|
|
|
struct ImGuiShrinkWidthItem
|
|
|
@@ -1557,12 +1546,18 @@ enum ImGuiScrollFlags_
|
|
|
ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
|
|
|
};
|
|
|
|
|
|
-enum ImGuiNavHighlightFlags_
|
|
|
+enum ImGuiNavRenderCursorFlags_
|
|
|
{
|
|
|
- ImGuiNavHighlightFlags_None = 0,
|
|
|
- ImGuiNavHighlightFlags_Compact = 1 << 1, // Compact highlight, no padding
|
|
|
- ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
|
|
|
- ImGuiNavHighlightFlags_NoRounding = 1 << 3,
|
|
|
+ ImGuiNavRenderCursorFlags_None = 0,
|
|
|
+ ImGuiNavRenderCursorFlags_Compact = 1 << 1, // Compact highlight, no padding/distance from focused item
|
|
|
+ ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == false, aka even when using the mouse.
|
|
|
+ ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None, // Renamed in 1.91.4
|
|
|
+ ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.91.4
|
|
|
+ ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw, // Renamed in 1.91.4
|
|
|
+ ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding, // Renamed in 1.91.4
|
|
|
+#endif
|
|
|
};
|
|
|
|
|
|
enum ImGuiNavMoveFlags_
|
|
|
@@ -1583,7 +1578,7 @@ enum ImGuiNavMoveFlags_
|
|
|
ImGuiNavMoveFlags_IsPageMove = 1 << 11, // Identify a PageDown/PageUp request.
|
|
|
ImGuiNavMoveFlags_Activate = 1 << 12, // Activate/select target item.
|
|
|
ImGuiNavMoveFlags_NoSelect = 1 << 13, // Don't trigger selection by not setting g.NavJustMovedTo
|
|
|
- ImGuiNavMoveFlags_NoSetNavHighlight = 1 << 14, // Do not alter the visible state of keyboard vs mouse nav highlight
|
|
|
+ ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14, // Do not alter the nav cursor visible state
|
|
|
ImGuiNavMoveFlags_NoClearActiveId = 1 << 15, // (Experimental) Do not clear active id when applying move result
|
|
|
};
|
|
|
|
|
|
@@ -1601,17 +1596,17 @@ struct ImGuiNavItemData
|
|
|
ImGuiID ID; // Init,Move // Best candidate item ID
|
|
|
ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID
|
|
|
ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space
|
|
|
- ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags
|
|
|
+ ImGuiItemFlags ItemFlags; // ????,Move // Best candidate item flags
|
|
|
float DistBox; // Move // Best candidate box distance to current NavId
|
|
|
float DistCenter; // Move // Best candidate center distance to current NavId
|
|
|
float DistAxial; // Move // Best candidate axial distance to current NavId
|
|
|
- ImGuiSelectionUserData SelectionUserData;//I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (InFlags & ImGuiItemFlags_HasSelectionUserData)
|
|
|
+ ImGuiSelectionUserData SelectionUserData;//I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (ItemFlags & ImGuiItemFlags_HasSelectionUserData)
|
|
|
|
|
|
ImGuiNavItemData() { Clear(); }
|
|
|
- void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
|
|
+ void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
|
|
};
|
|
|
|
|
|
-// Storage for PushFocusScope()
|
|
|
+// Storage for PushFocusScope(), g.FocusScopeStack[], g.NavFocusRoute[]
|
|
|
struct ImGuiFocusScopeData
|
|
|
{
|
|
|
ImGuiID ID;
|
|
|
@@ -1806,23 +1801,28 @@ struct ImGuiViewportP : public ImGuiViewport
|
|
|
ImDrawList* BgFgDrawLists[2]; // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
|
|
|
ImDrawData DrawDataP;
|
|
|
ImDrawDataBuilder DrawDataBuilder; // Temporary data while building final ImDrawData
|
|
|
- ImVec2 WorkOffsetMin; // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
|
|
|
- ImVec2 WorkOffsetMax; // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
|
|
|
- ImVec2 BuildWorkOffsetMin; // Work Area: Offset being built during current frame. Generally >= 0.0f.
|
|
|
- ImVec2 BuildWorkOffsetMax; // Work Area: Offset being built during current frame. Generally <= 0.0f.
|
|
|
+
|
|
|
+ // Per-viewport work area
|
|
|
+ // - Insets are >= 0.0f values, distance from viewport corners to work area.
|
|
|
+ // - BeginMainMenuBar() and DockspaceOverViewport() tend to use work area to avoid stepping over existing contents.
|
|
|
+ // - Generally 'safeAreaInsets' in iOS land, 'DisplayCutout' in Android land.
|
|
|
+ ImVec2 WorkInsetMin; // Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect().
|
|
|
+ ImVec2 WorkInsetMax; // "
|
|
|
+ ImVec2 BuildWorkInsetMin; // Work Area inset accumulator for current frame, to become next frame's WorkInset
|
|
|
+ ImVec2 BuildWorkInsetMax; // "
|
|
|
|
|
|
ImGuiViewportP() { BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; }
|
|
|
~ImGuiViewportP() { if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]); if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
|
|
|
|
|
|
// Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)
|
|
|
- ImVec2 CalcWorkRectPos(const ImVec2& off_min) const { return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); }
|
|
|
- ImVec2 CalcWorkRectSize(const ImVec2& off_min, const ImVec2& off_max) const { return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); }
|
|
|
- void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); } // Update public fields
|
|
|
+ ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const { return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
|
|
|
+ ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const { return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y - inset_max.y)); }
|
|
|
+ void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); } // Update public fields
|
|
|
|
|
|
// Helpers to retrieve ImRect (we don't need to store BuildWorkRect as every access tend to change it, hence the code asymmetry)
|
|
|
ImRect GetMainRect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
|
|
ImRect GetWorkRect() const { return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
|
|
|
- ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
|
|
|
+ ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkInsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkInsetMin, BuildWorkInsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
|
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -1876,6 +1876,7 @@ enum ImGuiLocKey : int
|
|
|
ImGuiLocKey_WindowingMainMenuBar,
|
|
|
ImGuiLocKey_WindowingPopup,
|
|
|
ImGuiLocKey_WindowingUntitled,
|
|
|
+ ImGuiLocKey_OpenLink_s,
|
|
|
ImGuiLocKey_CopyLink,
|
|
|
ImGuiLocKey_COUNT
|
|
|
};
|
|
|
@@ -1886,6 +1887,21 @@ struct ImGuiLocEntry
|
|
|
const char* Text;
|
|
|
};
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+// [SECTION] Error handling, State recovery support
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+// Macros used by Recoverable Error handling
|
|
|
+// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
|
|
|
+// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
|
|
|
+// - See 'Demo->Configuration->Error Handling' and ImGuiIO definitions for details on error handling.
|
|
|
+// - Read https://github.com/ocornut/imgui/wiki/Error-Handling for details on error handling.
|
|
|
+#ifndef IM_ASSERT_USER_ERROR
|
|
|
+#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
|
|
|
+#endif
|
|
|
+
|
|
|
+// The error callback is currently not public, as it is expected that only advanced users will rely on it.
|
|
|
+typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] Metrics, Debug Tools
|
|
|
@@ -1895,16 +1911,19 @@ enum ImGuiDebugLogFlags_
|
|
|
{
|
|
|
// Event types
|
|
|
ImGuiDebugLogFlags_None = 0,
|
|
|
- ImGuiDebugLogFlags_EventActiveId = 1 << 0,
|
|
|
- ImGuiDebugLogFlags_EventFocus = 1 << 1,
|
|
|
- ImGuiDebugLogFlags_EventPopup = 1 << 2,
|
|
|
- ImGuiDebugLogFlags_EventNav = 1 << 3,
|
|
|
- ImGuiDebugLogFlags_EventClipper = 1 << 4,
|
|
|
- ImGuiDebugLogFlags_EventSelection = 1 << 5,
|
|
|
- ImGuiDebugLogFlags_EventIO = 1 << 6,
|
|
|
- ImGuiDebugLogFlags_EventInputRouting = 1 << 7,
|
|
|
-
|
|
|
- ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting,
|
|
|
+ ImGuiDebugLogFlags_EventError = 1 << 0, // Error submitted by IM_ASSERT_USER_ERROR()
|
|
|
+ ImGuiDebugLogFlags_EventActiveId = 1 << 1,
|
|
|
+ ImGuiDebugLogFlags_EventFocus = 1 << 2,
|
|
|
+ ImGuiDebugLogFlags_EventPopup = 1 << 3,
|
|
|
+ ImGuiDebugLogFlags_EventNav = 1 << 4,
|
|
|
+ ImGuiDebugLogFlags_EventClipper = 1 << 5,
|
|
|
+ ImGuiDebugLogFlags_EventSelection = 1 << 6,
|
|
|
+ ImGuiDebugLogFlags_EventIO = 1 << 7,
|
|
|
+ ImGuiDebugLogFlags_EventInputRouting = 1 << 8,
|
|
|
+ ImGuiDebugLogFlags_EventDocking = 1 << 9, // Unused in this branch
|
|
|
+ ImGuiDebugLogFlags_EventViewport = 1 << 10, // Unused in this branch
|
|
|
+
|
|
|
+ ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
|
|
|
ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY
|
|
|
ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21, // Also send output to Test Engine
|
|
|
};
|
|
|
@@ -2043,9 +2062,11 @@ struct ImGuiContext
|
|
|
ImVec2 WheelingAxisAvg;
|
|
|
|
|
|
// Item/widgets state and tracking information
|
|
|
+ ImGuiID DebugDrawIdConflicts; // Set when we detect multiple items with the same identifier
|
|
|
ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
|
|
|
ImGuiID HoveredId; // Hovered widget, filled during the frame
|
|
|
ImGuiID HoveredIdPreviousFrame;
|
|
|
+ int HoveredIdPreviousFrameItemCount; // Count numbers of items using the same ID as last frame's hovered id
|
|
|
float HoveredIdTimer; // Measure contiguous hovering time
|
|
|
float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
|
|
|
bool HoveredIdAllowOverlap;
|
|
|
@@ -2111,9 +2132,15 @@ struct ImGuiContext
|
|
|
// Viewports
|
|
|
ImVector<ImGuiViewportP*> Viewports; // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData.
|
|
|
|
|
|
- // Gamepad/keyboard Navigation
|
|
|
- ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
|
|
|
+ // Keyboard/Gamepad Navigation
|
|
|
+ bool NavCursorVisible; // Nav focus cursor/rectangle is visible? We hide it after a mouse click. We show it after a nav move.
|
|
|
+ bool NavHighlightItemUnderNav; // Disable mouse hovering highlight. Highlight navigation focused item instead of mouse hovered item.
|
|
|
+ //bool NavDisableHighlight; // Old name for !g.NavCursorVisible before 1.91.4 (2024/10/18). OPPOSITE VALUE (g.NavDisableHighlight == !g.NavCursorVisible)
|
|
|
+ //bool NavDisableMouseHover; // Old name for g.NavHighlightItemUnderNav before 1.91.1 (2024/10/18) this was called When user starts using keyboard/gamepad, we hide mouse hovering highlight until mouse is touched again.
|
|
|
+ bool NavMousePosDirty; // When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default)
|
|
|
+ bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
|
|
|
ImGuiID NavId; // Focused item for navigation
|
|
|
+ ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
|
|
|
ImGuiID NavFocusScopeId; // Focused focus scope (e.g. selection code often wants to "clear other items" when landing on an item of the same scope)
|
|
|
ImGuiNavLayer NavLayer; // Focused layer (main scrolling layer, or menu/title bar layer)
|
|
|
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
|
|
|
@@ -2127,10 +2154,7 @@ struct ImGuiContext
|
|
|
ImGuiActivateFlags NavNextActivateFlags;
|
|
|
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
|
|
|
ImGuiSelectionUserData NavLastValidSelectionUserData; // Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data.
|
|
|
- bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
|
|
|
- bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
|
|
|
- bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
|
|
|
- bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
|
|
|
+ ImS8 NavCursorHideFrames;
|
|
|
|
|
|
// Navigation: Init & Move Requests
|
|
|
bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
|
|
|
@@ -2162,7 +2186,7 @@ struct ImGuiContext
|
|
|
ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
|
|
|
ImGuiKeyChord NavJustMovedToKeyMods;
|
|
|
bool NavJustMovedToIsTabbing; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
|
|
|
- bool NavJustMovedToHasSelectionData; // Copy of move result's InFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
|
|
|
+ bool NavJustMovedToHasSelectionData; // Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
|
|
|
|
|
|
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
|
|
|
ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). For reconfiguration (see #4828)
|
|
|
@@ -2257,8 +2281,8 @@ struct ImGuiContext
|
|
|
ImGuiComboPreviewData ComboPreviewData;
|
|
|
ImRect WindowResizeBorderExpectedRect; // Expected border rect, switch to relative edit if moving
|
|
|
bool WindowResizeRelativeMode;
|
|
|
- short ScrollbarSeekMode; // 0: relative, -1/+1: prev/next page.
|
|
|
- float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
|
|
|
+ short ScrollbarSeekMode; // 0: scroll to clicked location, -1/+1: prev/next page.
|
|
|
+ float ScrollbarClickDeltaToGrabCenter; // When scrolling to mouse location: distance between mouse and center of grab box, normalized in parent space.
|
|
|
float SliderGrabClickOffset;
|
|
|
float SliderCurrentAccum; // Accumulated slider delta when using navigation controls.
|
|
|
bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it?
|
|
|
@@ -2267,8 +2291,8 @@ struct ImGuiContext
|
|
|
float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
|
|
|
float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled()
|
|
|
short DisabledStackSize;
|
|
|
- short LockMarkEdited;
|
|
|
short TooltipOverrideCount;
|
|
|
+ ImGuiWindow* TooltipPreviousWindow; // Window of last tooltip submitted during the frame
|
|
|
ImVector<char> ClipboardHandlerData; // If no custom clipboard handler is defined
|
|
|
ImVector<ImGuiID> MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once
|
|
|
ImGuiTypingSelectState TypingSelectState; // State for GetTypingSelectRequest()
|
|
|
@@ -2303,11 +2327,22 @@ struct ImGuiContext
|
|
|
int LogDepthToExpand;
|
|
|
int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
|
|
|
|
|
|
+ // Error Handling
|
|
|
+ ImGuiErrorCallback ErrorCallback; // = NULL. May be exposed in public API eventually.
|
|
|
+ void* ErrorCallbackUserData; // = NULL
|
|
|
+ ImVec2 ErrorTooltipLockedPos;
|
|
|
+ bool ErrorFirst;
|
|
|
+ int ErrorCountCurrentFrame; // [Internal] Number of errors submitted this frame.
|
|
|
+ ImGuiErrorRecoveryState StackSizesInNewFrame; // [Internal]
|
|
|
+ ImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow; // [Internal]
|
|
|
+
|
|
|
// Debug Tools
|
|
|
// (some of the highly frequently used data are interleaved in other structures above: DebugBreakXXX fields, DebugHookIdInfo, DebugLocateId etc.)
|
|
|
+ int DebugDrawIdConflictsCount; // Locked count (preserved when holding CTRL)
|
|
|
ImGuiDebugLogFlags DebugLogFlags;
|
|
|
ImGuiTextBuffer DebugLogBuf;
|
|
|
ImGuiTextIndex DebugLogIndex;
|
|
|
+ int DebugLogSkippedErrors;
|
|
|
ImGuiDebugLogFlags DebugLogAutoDisableFlags;
|
|
|
ImU8 DebugLogAutoDisableFrames;
|
|
|
ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
|
|
|
@@ -2334,208 +2369,7 @@ struct ImGuiContext
|
|
|
ImVector<char> TempBuffer; // Temporary text buffer
|
|
|
char TempKeychordName[64];
|
|
|
|
|
|
- ImGuiContext(ImFontAtlas* shared_font_atlas)
|
|
|
- {
|
|
|
- IO.Ctx = this;
|
|
|
- InputTextState.Ctx = this;
|
|
|
-
|
|
|
- Initialized = false;
|
|
|
- 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 = 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;
|
|
|
-
|
|
|
- DebugHookIdInfo = 0;
|
|
|
- HoveredId = HoveredIdPreviousFrame = 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;
|
|
|
-
|
|
|
- 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
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- // 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));
|
|
|
- }
|
|
|
+ ImGuiContext(ImFontAtlas* shared_font_atlas);
|
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -2612,7 +2446,7 @@ struct IMGUI_API ImGuiWindow
|
|
|
ImVec2 WindowPadding; // Window padding at the time of Begin().
|
|
|
float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
|
|
|
float WindowBorderSize; // Window border size at the time of Begin().
|
|
|
- float TitleBarHeight, MenuBarHeight;
|
|
|
+ float TitleBarHeight, MenuBarHeight; // Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight.
|
|
|
float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
|
|
|
float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
|
|
|
float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
|
|
|
@@ -2709,6 +2543,7 @@ public:
|
|
|
ImGuiID GetID(const char* str, const char* str_end = NULL);
|
|
|
ImGuiID GetID(const void* ptr);
|
|
|
ImGuiID GetID(int n);
|
|
|
+ ImGuiID GetIDFromPos(const ImVec2& p_abs);
|
|
|
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
|
|
|
|
|
|
// We don't use g.FontSize because the window may be != g.CurrentWindow.
|
|
|
@@ -2757,9 +2592,10 @@ struct ImGuiTabItem
|
|
|
ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
|
|
|
};
|
|
|
|
|
|
-// Storage for a tab bar (sizeof() 152 bytes)
|
|
|
+// Storage for a tab bar (sizeof() 160 bytes)
|
|
|
struct IMGUI_API ImGuiTabBar
|
|
|
{
|
|
|
+ ImGuiWindow* Window;
|
|
|
ImVector<ImGuiTabItem> Tabs;
|
|
|
ImGuiTabBarFlags Flags;
|
|
|
ImGuiID ID; // Zero for tab-bars used by docking
|
|
|
@@ -2820,6 +2656,7 @@ struct ImGuiTableColumn
|
|
|
float MaxX;
|
|
|
float WidthRequest; // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
|
|
|
float WidthAuto; // Automatic width
|
|
|
+ float WidthMax; // Maximum width (FIXME: overwritten by each instance)
|
|
|
float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
|
|
|
float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
|
|
|
ImRect ClipRect; // Clipping rectangle for the column
|
|
|
@@ -3118,8 +2955,8 @@ namespace ImGui
|
|
|
inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
|
|
|
inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); }
|
|
|
inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); }
|
|
|
- inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); }
|
|
|
inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x - off.x, p.y - off.y); }
|
|
|
+ inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); }
|
|
|
|
|
|
// Windows: Display Order and Focus Order
|
|
|
IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
|
|
|
@@ -3196,7 +3033,7 @@ namespace ImGui
|
|
|
|
|
|
// Basic Accessors
|
|
|
inline ImGuiItemStatusFlags GetItemStatusFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
|
|
|
- inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
|
|
|
+ inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.ItemFlags; }
|
|
|
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
|
|
inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; }
|
|
|
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
|
|
|
@@ -3265,7 +3102,7 @@ namespace ImGui
|
|
|
IMGUI_API bool BeginComboPreview();
|
|
|
IMGUI_API void EndComboPreview();
|
|
|
|
|
|
- // Gamepad/Keyboard Navigation
|
|
|
+ // Keyboard/Gamepad Navigation
|
|
|
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
|
|
|
IMGUI_API void NavInitRequestApplyResult();
|
|
|
IMGUI_API bool NavMoveRequestButNoResultYet();
|
|
|
@@ -3278,7 +3115,7 @@ namespace ImGui
|
|
|
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
|
|
|
IMGUI_API void NavHighlightActivated(ImGuiID id);
|
|
|
IMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis);
|
|
|
- IMGUI_API void NavRestoreHighlightAfterMove();
|
|
|
+ IMGUI_API void SetNavCursorVisibleAfterMove();
|
|
|
IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();
|
|
|
IMGUI_API void SetNavWindow(ImGuiWindow* window);
|
|
|
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);
|
|
|
@@ -3395,6 +3232,8 @@ namespace ImGui
|
|
|
IMGUI_API void RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect);
|
|
|
|
|
|
// Typing-Select API
|
|
|
+ // (provide Windows Explorer style "select items by typing partial name" + "cycle through items by typing same letter" feature)
|
|
|
+ // (this is currently not documented nor used by main library, but should work. See "widgets_typingselect" in imgui_test_suite for usage code. Please let us know if you use this!)
|
|
|
IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
|
|
|
IMGUI_API int TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
|
|
IMGUI_API int TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
|
|
@@ -3463,7 +3302,7 @@ namespace ImGui
|
|
|
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
|
|
|
IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
|
|
|
IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
|
|
|
- IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n);
|
|
|
+ IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);
|
|
|
IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
|
|
|
IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
|
|
|
IMGUI_API void TableRemove(ImGuiTable* table);
|
|
|
@@ -3491,6 +3330,7 @@ namespace ImGui
|
|
|
IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
|
|
|
IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
|
|
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
|
|
+ IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name);
|
|
|
IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);
|
|
|
IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);
|
|
|
IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);
|
|
|
@@ -3511,7 +3351,10 @@ namespace ImGui
|
|
|
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders = true, float rounding = 0.0f);
|
|
|
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
|
|
|
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);
|
|
|
- IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_None); // Navigation highlight
|
|
|
+ IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None); // Navigation highlight
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
+ inline void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb, id, flags); } // Renamed in 1.91.4
|
|
|
+#endif
|
|
|
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
|
|
|
IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
|
|
|
|
|
|
@@ -3573,6 +3416,7 @@ namespace ImGui
|
|
|
IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty = NULL);
|
|
|
IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2);
|
|
|
IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max);
|
|
|
+ IMGUI_API bool DataTypeIsZero(ImGuiDataType data_type, const void* p_data);
|
|
|
|
|
|
// InputText
|
|
|
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
|
@@ -3601,11 +3445,18 @@ namespace ImGui
|
|
|
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);
|
|
|
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
|
|
|
|
|
|
+ // Error handling, State Recovery
|
|
|
+ IMGUI_API bool ErrorLog(const char* msg);
|
|
|
+ IMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);
|
|
|
+ IMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in);
|
|
|
+ IMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in);
|
|
|
+ IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
|
|
+ IMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip();
|
|
|
+ IMGUI_API bool BeginErrorTooltip();
|
|
|
+ IMGUI_API void EndErrorTooltip();
|
|
|
+
|
|
|
// Debug Tools
|
|
|
IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size); // size >= 0 : alloc, size = -1 : free
|
|
|
- IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
|
|
- IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
|
|
- IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
|
|
IMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
|
IMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
|
IMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
|
|
|
@@ -3640,9 +3491,8 @@ namespace ImGui
|
|
|
|
|
|
// Obsolete functions
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
- inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
|
|
|
- inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
|
|
|
-
|
|
|
+ //inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
|
|
|
+ //inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
|
|
|
//inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity!
|
|
|
|
|
|
// Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets which used FocusableItemRegister():
|
|
|
@@ -3693,7 +3543,7 @@ extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiI
|
|
|
// In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data);
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
|
|
-#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
|
|
+#define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
|
|
#else
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
|