| 13084 | } |
| 13085 | |
| 13086 | ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) |
| 13087 | { |
| 13088 | ImGuiContext& g = *GImGui; |
| 13089 | |
| 13090 | #if !IMGUI_DEBUG_INI_SETTINGS |
| 13091 | // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() |
| 13092 | // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier. |
| 13093 | if (const char* p = strstr(name, "###")) |
| 13094 | name = p; |
| 13095 | #endif |
| 13096 | const size_t name_len = strlen(name); |
| 13097 | |
| 13098 | // Allocate chunk |
| 13099 | const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; |
| 13100 | ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); |
| 13101 | IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); |
| 13102 | settings->ID = ImHashStr(name, name_len); |
| 13103 | memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator |
| 13104 | |
| 13105 | return settings; |
| 13106 | } |
| 13107 | |
| 13108 | ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id) |
| 13109 | { |
nothing calls this directly
no test coverage detected