| 24115 | } |
| 24116 | |
| 24117 | static int DebugItemPathQuery_FormatLevelInfo(ImGuiDebugItemPathQuery* query, int n, bool format_for_ui, char* buf, size_t buf_size) |
| 24118 | { |
| 24119 | ImGuiStackLevelInfo* info = &query->Results[n]; |
| 24120 | ImGuiWindow* window = (info->DescOffset == -1 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; |
| 24121 | if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked) |
| 24122 | return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", ImHashSkipUncontributingPrefix(window->Name)); |
| 24123 | if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id) |
| 24124 | return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", ImHashSkipUncontributingPrefix(&query->ResultsDescBuf.Buf[info->DescOffset])); |
| 24125 | if (query->Step < query->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers. |
| 24126 | return (*buf = 0); |
| 24127 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 24128 | if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo() |
| 24129 | return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", ImHashSkipUncontributingPrefix(label)); |
| 24130 | #endif |
| 24131 | return ImFormatString(buf, buf_size, "???"); |
| 24132 | } |
| 24133 | |
| 24134 | static const char* DebugItemPathQuery_GetResultAsPath(ImGuiDebugItemPathQuery* query, bool hex_encode_non_ascii_chars) |
| 24135 | { |
no test coverage detected