MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / CreateNewWindowSettings

Method CreateNewWindowSettings

KBotExt/imgui/imgui.cpp:13071–13092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13069}
13070
13071ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
13072{
13073 ImGuiContext& g = *GImGui;
13074
13075 if (g.IO.ConfigDebugIniSettings == false)
13076 {
13077 // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
13078 // Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier.
13079 if (const char* p = strstr(name, "###"))
13080 name = p;
13081 }
13082 const size_t name_len = strlen(name);
13083
13084 // Allocate chunk
13085 const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
13086 ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
13087 IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
13088 settings->ID = ImHashStr(name, name_len);
13089 memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
13090
13091 return settings;
13092}
13093
13094// We don't provide a FindWindowSettingsByName() because Docking system doesn't always hold on names.
13095// This is called once per window .ini entry + once per newly instantiated window.

Callers

nothing calls this directly

Calls 4

ImGuiWindowSettingsClass · 0.85
ImHashStrFunction · 0.85
alloc_chunkMethod · 0.80
GetNameMethod · 0.80

Tested by

no test coverage detected