|
|
@@ -1,4 +1,4 @@
|
|
|
-// dear imgui, v1.85 WIP
|
|
|
+// dear imgui, v1.86 WIP
|
|
|
// (internal structures/api)
|
|
|
|
|
|
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
|
|
|
@@ -24,7 +24,7 @@ Index of this file:
|
|
|
// [SECTION] Docking support
|
|
|
// [SECTION] Viewport support
|
|
|
// [SECTION] Settings support
|
|
|
-// [SECTION] Metrics, Debug
|
|
|
+// [SECTION] Metrics, Debug tools
|
|
|
// [SECTION] Generic context hooks
|
|
|
// [SECTION] ImGuiContext (main imgui context)
|
|
|
// [SECTION] ImGuiWindowTempData, ImGuiWindow
|
|
|
@@ -744,7 +744,7 @@ enum ImGuiItemFlags_
|
|
|
ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window
|
|
|
ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
|
|
|
ImGuiItemFlags_ReadOnly = 1 << 7, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
|
|
|
- ImGuiItemFlags_Inputable = 1 << 8 // false // [WIP] Auto-activate item when focused. Currently only used and supported by a few items before it becomes a generic feature.
|
|
|
+ ImGuiItemFlags_Inputable = 1 << 8 // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
|
|
|
};
|
|
|
|
|
|
// Storage for LastItem data
|
|
|
@@ -759,9 +759,7 @@ enum ImGuiItemStatusFlags_
|
|
|
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
|
|
|
ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
|
|
|
ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing.
|
|
|
- ImGuiItemStatusFlags_FocusedByCode = 1 << 8, // Set when the Focusable item just got focused from code.
|
|
|
- ImGuiItemStatusFlags_FocusedByTabbing = 1 << 9, // Set when the Focusable item just got focused by Tabbing.
|
|
|
- ImGuiItemStatusFlags_Focused = ImGuiItemStatusFlags_FocusedByCode | ImGuiItemStatusFlags_FocusedByTabbing
|
|
|
+ ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8 // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
|
|
|
|
|
|
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
|
, // [imgui_tests only]
|
|
|
@@ -1219,7 +1217,10 @@ enum ImGuiNavMoveFlags_
|
|
|
ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown)
|
|
|
ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary
|
|
|
ImGuiNavMoveFlags_Forwarded = 1 << 7,
|
|
|
- ImGuiNavMoveFlags_DebugNoResult = 1 << 8
|
|
|
+ ImGuiNavMoveFlags_DebugNoResult = 1 << 8, // Dummy scoring for debug purpose, don't apply result
|
|
|
+ ImGuiNavMoveFlags_Tabbing = 1 << 9, // == Focus + Activate if item is Inputable + DontChangeNavHighlight
|
|
|
+ ImGuiNavMoveFlags_Activate = 1 << 10,
|
|
|
+ ImGuiNavMoveFlags_DontSetNavHighlight = 1 << 11 // Do not alter the visible state of keyboard vs mouse nav highlight
|
|
|
};
|
|
|
|
|
|
enum ImGuiNavLayer
|
|
|
@@ -1235,12 +1236,13 @@ 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
|
|
|
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
|
|
|
|
|
|
ImGuiNavItemData() { Clear(); }
|
|
|
- void Clear() { Window = NULL; ID = FocusScopeId = 0; RectRel = ImRect(); DistBox = DistCenter = DistAxial = FLT_MAX; }
|
|
|
+ void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -1382,11 +1384,12 @@ struct ImGuiSettingsHandler
|
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
-// [SECTION] Metrics, Debug
|
|
|
+// [SECTION] Metrics, Debug Tools
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
struct ImGuiMetricsConfig
|
|
|
{
|
|
|
+ bool ShowStackTool;
|
|
|
bool ShowWindowsRects;
|
|
|
bool ShowWindowsBeginOrder;
|
|
|
bool ShowTablesRects;
|
|
|
@@ -1397,6 +1400,7 @@ struct ImGuiMetricsConfig
|
|
|
|
|
|
ImGuiMetricsConfig()
|
|
|
{
|
|
|
+ ShowStackTool = false;
|
|
|
ShowWindowsRects = false;
|
|
|
ShowWindowsBeginOrder = false;
|
|
|
ShowTablesRects = false;
|
|
|
@@ -1407,6 +1411,27 @@ struct ImGuiMetricsConfig
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+struct ImGuiStackLevelInfo
|
|
|
+{
|
|
|
+ ImGuiID ID;
|
|
|
+ ImS8 QueryFrameCount; // >= 1: Query in progress
|
|
|
+ bool QuerySuccess; // Obtained result from DebugHookIdInfo()
|
|
|
+ char Desc[58]; // Arbitrarily sized buffer to hold a result (FIXME: could replace Results[] with a chunk stream?)
|
|
|
+
|
|
|
+ ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); }
|
|
|
+};
|
|
|
+
|
|
|
+// State for Stack tool queries
|
|
|
+struct ImGuiStackTool
|
|
|
+{
|
|
|
+ int LastActiveFrame;
|
|
|
+ int StackLevel; // -1: query stack and resize Results, >= 0: individual stack level
|
|
|
+ ImGuiID QueryId; // ID to query details for
|
|
|
+ ImVector<ImGuiStackLevelInfo> Results;
|
|
|
+
|
|
|
+ ImGuiStackTool() { memset(this, 0, sizeof(*this)); }
|
|
|
+};
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] Generic context hooks
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -1448,7 +1473,6 @@ struct ImGuiContext
|
|
|
bool WithinEndChild; // Set within EndChild()
|
|
|
bool GcCompactAll; // Request full GC
|
|
|
bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
|
|
|
- ImGuiID TestEngineHookIdInfo; // Will call test engine hooks: ImGuiTestEngineHook_IdInfo() from GetID()
|
|
|
void* TestEngine; // Test engine user data
|
|
|
|
|
|
// Windows state
|
|
|
@@ -1468,6 +1492,7 @@ struct ImGuiContext
|
|
|
float WheelingWindowTimer;
|
|
|
|
|
|
// Item/widgets state and tracking information
|
|
|
+ ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
|
|
|
ImGuiID HoveredId; // Hovered widget, filled during the frame
|
|
|
ImGuiID HoveredIdPreviousFrame;
|
|
|
bool HoveredIdAllowOverlap;
|
|
|
@@ -1559,6 +1584,7 @@ struct ImGuiContext
|
|
|
ImGuiDir NavMoveClipDir; // FIXME-NAV: Describe the purpose of this better. Might want to rename?
|
|
|
ImRect NavScoringRect; // Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
|
|
|
int NavScoringDebugCount; // Metrics for debugging
|
|
|
+ int NavTabbingInputableRemaining; // >0 when counting items for tabbing
|
|
|
ImGuiNavItemData NavMoveResultLocal; // Best move request candidate within NavWindow
|
|
|
ImGuiNavItemData NavMoveResultLocalVisible; // Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
|
|
|
ImGuiNavItemData NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
|
|
|
@@ -1574,9 +1600,7 @@ struct ImGuiContext
|
|
|
// Legacy Focus/Tabbing system (older than Nav, active even if Nav is disabled, misnamed. FIXME-NAV: This needs a redesign!)
|
|
|
ImGuiWindow* TabFocusRequestCurrWindow; //
|
|
|
ImGuiWindow* TabFocusRequestNextWindow; //
|
|
|
- int TabFocusRequestCurrCounterRegular; // Any item being requested for focus, stored as an index (we on layout to be stable between the frame pressing TAB and the next frame, semi-ouch)
|
|
|
int TabFocusRequestCurrCounterTabStop; // Tab item being requested for focus, stored as an index
|
|
|
- int TabFocusRequestNextCounterRegular; // Stored for next frame
|
|
|
int TabFocusRequestNextCounterTabStop; // "
|
|
|
bool TabFocusPressed; // Set in NewFrame() when user pressed Tab
|
|
|
|
|
|
@@ -1605,9 +1629,9 @@ struct ImGuiContext
|
|
|
|
|
|
// Table
|
|
|
ImGuiTable* CurrentTable;
|
|
|
- int CurrentTableStackIdx;
|
|
|
- ImPool<ImGuiTable> Tables;
|
|
|
- ImVector<ImGuiTableTempData> TablesTempDataStack;
|
|
|
+ int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
|
|
|
+ ImVector<ImGuiTableTempData> TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting)
|
|
|
+ ImPool<ImGuiTable> Tables; // Persistent table data
|
|
|
ImVector<float> TablesLastTimeActive; // Last used timestamp of each tables (SOA, for efficient GC)
|
|
|
ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer;
|
|
|
|
|
|
@@ -1671,8 +1695,9 @@ struct ImGuiContext
|
|
|
|
|
|
// Debug Tools
|
|
|
bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker())
|
|
|
- ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this id
|
|
|
+ ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
|
|
|
ImGuiMetricsConfig DebugMetricsConfig;
|
|
|
+ ImGuiStackTool DebugStackTool;
|
|
|
|
|
|
// Misc
|
|
|
float FramerateSecPerFrame[120]; // Calculate estimate of framerate for user over the last 2 seconds.
|
|
|
@@ -1697,7 +1722,6 @@ struct ImGuiContext
|
|
|
WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
|
|
|
GcCompactAll = false;
|
|
|
TestEngineHookItems = false;
|
|
|
- TestEngineHookIdInfo = 0;
|
|
|
TestEngine = NULL;
|
|
|
|
|
|
WindowsActiveCount = 0;
|
|
|
@@ -1708,6 +1732,7 @@ struct ImGuiContext
|
|
|
WheelingWindow = NULL;
|
|
|
WheelingWindowTimer = 0.0f;
|
|
|
|
|
|
+ DebugHookIdInfo = 0;
|
|
|
HoveredId = HoveredIdPreviousFrame = 0;
|
|
|
HoveredIdAllowOverlap = false;
|
|
|
HoveredIdUsingMouseWheel = HoveredIdPreviousFrameUsingMouseWheel = false;
|
|
|
@@ -1763,14 +1788,15 @@ struct ImGuiContext
|
|
|
NavMoveKeyMods = ImGuiKeyModFlags_None;
|
|
|
NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
|
|
|
NavScoringDebugCount = 0;
|
|
|
+ NavTabbingInputableRemaining = 0;
|
|
|
|
|
|
NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
|
|
|
NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
|
|
|
NavWindowingToggleLayer = false;
|
|
|
|
|
|
TabFocusRequestCurrWindow = TabFocusRequestNextWindow = NULL;
|
|
|
- TabFocusRequestCurrCounterRegular = TabFocusRequestCurrCounterTabStop = INT_MAX;
|
|
|
- TabFocusRequestNextCounterRegular = TabFocusRequestNextCounterTabStop = INT_MAX;
|
|
|
+ TabFocusRequestCurrCounterTabStop = INT_MAX;
|
|
|
+ TabFocusRequestNextCounterTabStop = INT_MAX;
|
|
|
TabFocusPressed = false;
|
|
|
|
|
|
DimBgRatio = 0.0f;
|
|
|
@@ -1789,7 +1815,7 @@ struct ImGuiContext
|
|
|
memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
|
|
|
|
|
|
CurrentTable = NULL;
|
|
|
- CurrentTableStackIdx = -1;
|
|
|
+ TablesTempDataStacked = 0;
|
|
|
CurrentTabBar = NULL;
|
|
|
|
|
|
TempInputId = 0;
|
|
|
@@ -1877,7 +1903,6 @@ struct IMGUI_API ImGuiWindowTempData
|
|
|
int CurrentTableIdx; // Current table index (into g.Tables)
|
|
|
ImGuiLayoutType LayoutType;
|
|
|
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
|
|
|
- int FocusCounterRegular; // (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase when ImGuiItemFlags_Inputable (FIXME-NAV: Needs redesign)
|
|
|
int FocusCounterTabStop; // (Legacy Focus/Tabbing system) Same, but only count widgets which you can Tab through.
|
|
|
|
|
|
// Local parameters stacks
|
|
|
@@ -2167,7 +2192,7 @@ struct ImGuiTableCellData
|
|
|
};
|
|
|
|
|
|
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
|
|
|
-struct ImGuiTable
|
|
|
+struct IMGUI_API ImGuiTable
|
|
|
{
|
|
|
ImGuiID ID;
|
|
|
ImGuiTableFlags Flags;
|
|
|
@@ -2273,14 +2298,14 @@ struct ImGuiTable
|
|
|
bool MemoryCompacted;
|
|
|
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
|
|
|
|
|
|
- IMGUI_API ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
|
|
|
- IMGUI_API ~ImGuiTable() { IM_FREE(RawData); }
|
|
|
+ ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
|
|
|
+ ~ImGuiTable() { IM_FREE(RawData); }
|
|
|
};
|
|
|
|
|
|
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
|
|
|
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
|
|
|
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
|
|
|
-struct ImGuiTableTempData
|
|
|
+struct IMGUI_API ImGuiTableTempData
|
|
|
{
|
|
|
int TableIndex; // Index in g.Tables.Buf[] pool
|
|
|
float LastTimeActive; // Last timestamp this structure was used
|
|
|
@@ -2297,7 +2322,7 @@ struct ImGuiTableTempData
|
|
|
float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
|
|
|
int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
|
|
|
|
|
|
- IMGUI_API ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
|
|
|
+ ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
|
|
|
};
|
|
|
|
|
|
// sizeof() ~ 12
|
|
|
@@ -2363,6 +2388,8 @@ namespace ImGui
|
|
|
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);
|
|
|
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);
|
|
|
IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);
|
|
|
+ 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); }
|
|
|
|
|
|
// Windows: Display Order and Focus Order
|
|
|
IMGUI_API void FocusWindow(ImGuiWindow* window);
|
|
|
@@ -2454,9 +2481,9 @@ namespace ImGui
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
// Currently refactoring focus/nav/tabbing system
|
|
|
// If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
|
|
|
- // (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool focused = FocusableItemRegister(...)'
|
|
|
- // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
|
|
|
- // (New) IMGUI_VERSION_NUM >= 18411: using 'ItemAdd(..., ImGuiItemAddFlags_Inputable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
|
|
|
+ // (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)'
|
|
|
+ // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
|
|
|
+ // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || g.NavActivateInputId == id' (WIP)
|
|
|
// Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText()
|
|
|
inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(id); return false; } // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
|
|
|
inline void FocusableItemUnregister(ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); } // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem
|
|
|
@@ -2498,6 +2525,7 @@ namespace ImGui
|
|
|
IMGUI_API bool NavMoveRequestButNoResultYet();
|
|
|
IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
|
|
|
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
|
|
|
+ IMGUI_API void NavMoveRequestResolveWithLastItem();
|
|
|
IMGUI_API void NavMoveRequestCancel();
|
|
|
IMGUI_API void NavMoveRequestApplyResult();
|
|
|
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
|
|
|
@@ -2713,6 +2741,7 @@ namespace ImGui
|
|
|
inline void DebugStartItemPicker() { ImGuiContext& g = *GImGui; g.DebugItemPickerActive = true; }
|
|
|
|
|
|
IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);
|
|
|
+ IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);
|
|
|
IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);
|
|
|
IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list, const char* label);
|
|
|
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);
|
|
|
@@ -2758,14 +2787,12 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table
|
|
|
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
|
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
|
|
|
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
|
|
|
-extern void ImGuiTestEngineHook_IdInfo(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id);
|
|
|
-extern void ImGuiTestEngineHook_IdInfo(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id, const void* data_id_end);
|
|
|
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
|
|
|
+extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiID id);
|
|
|
+
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // 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_ID_INFO(_ID,_TYPE,_DATA) if (g.TestEngineHookIdInfo == _ID) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA));
|
|
|
-#define IMGUI_TEST_ENGINE_ID_INFO2(_ID,_TYPE,_DATA,_DATA2) if (g.TestEngineHookIdInfo == _ID) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA), (const void*)(_DATA2));
|
|
|
#else
|
|
|
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)0)
|
|
|
#endif
|