| 15683 | } |
| 15684 | |
| 15685 | ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) |
| 15686 | { |
| 15687 | ImGuiContext& g = *GImGui; |
| 15688 | |
| 15689 | // Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier. |
| 15690 | if (g.IO.ConfigDebugIniSettings == false) |
| 15691 | name = ImHashSkipUncontributingPrefix(name); |
| 15692 | const size_t name_len = ImStrlen(name); |
| 15693 | |
| 15694 | // Allocate chunk |
| 15695 | const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; |
| 15696 | ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); |
| 15697 | IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); |
| 15698 | settings->ID = ImHashStr(name, name_len); |
| 15699 | memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator |
| 15700 | |
| 15701 | return settings; |
| 15702 | } |
| 15703 | |
| 15704 | // We don't provide a FindWindowSettingsByName() because Docking system doesn't always hold on names. |
| 15705 | // This is called once per window .ini entry + once per newly instantiated window. |
nothing calls this directly
no test coverage detected