| 18200 | } |
| 18201 | |
| 18202 | static int DebugItemPathQuery_FormatLevelInfo(ImGuiDebugItemPathQuery* query, int n, bool format_for_ui, char* buf, size_t buf_size) |
| 18203 | { |
| 18204 | ImGuiStackLevelInfo* info = &query->Results[n]; |
| 18205 | ImGuiWindow* window = (info->DescOffset == -1 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; |
| 18206 | if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked) |
| 18207 | return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", ImHashSkipUncontributingPrefix(window->Name)); |
| 18208 | if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id) |
| 18209 | return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", ImHashSkipUncontributingPrefix(&query->ResultsDescBuf.Buf[info->DescOffset])); |
| 18210 | if (query->Step < query->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers. |
| 18211 | return (*buf = 0); |
| 18212 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 18213 | if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo() |
| 18214 | return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", ImHashSkipUncontributingPrefix(label)); |
| 18215 | #endif |
| 18216 | return ImFormatString(buf, buf_size, "???"); |
| 18217 | } |
| 18218 | |
| 18219 | static const char* DebugItemPathQuery_GetResultAsPath(ImGuiDebugItemPathQuery* query, bool hex_encode_non_ascii_chars) |
| 18220 | { |
no test coverage detected