| 12348 | } |
| 12349 | |
| 12350 | ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) |
| 12351 | { |
| 12352 | ImGuiContext& g = *GImGui; |
| 12353 | |
| 12354 | #if !IMGUI_DEBUG_INI_SETTINGS |
| 12355 | // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() |
| 12356 | // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier. |
| 12357 | if (const char* p = strstr(name, "###")) |
| 12358 | name = p; |
| 12359 | #endif |
| 12360 | const size_t name_len = strlen(name); |
| 12361 | |
| 12362 | // Allocate chunk |
| 12363 | const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; |
| 12364 | ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); |
| 12365 | IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); |
| 12366 | settings->ID = ImHashStr(name, name_len); |
| 12367 | memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator |
| 12368 | |
| 12369 | return settings; |
| 12370 | } |
| 12371 | |
| 12372 | ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id) |
| 12373 | { |
nothing calls this directly
no test coverage detected