MCPcopy Create free account
hub / github.com/cinder/Cinder / WindowSettingsHandler_WriteAll

Function WindowSettingsHandler_WriteAll

src/imgui/imgui.cpp:15387–15433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15385}
15386
15387static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
15388{
15389 // Gather data from windows that were active during this session
15390 // (if a window wasn't opened in this session we preserve its settings)
15391 ImGuiContext& g = *ctx;
15392 for (ImGuiWindow* window : g.Windows)
15393 {
15394 if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
15395 continue;
15396
15397 ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByWindow(window);
15398 if (!settings)
15399 {
15400 settings = ImGui::CreateNewWindowSettings(window->Name);
15401 window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
15402 }
15403 IM_ASSERT(settings->ID == window->ID);
15404 settings->Pos = ImVec2ih(window->Pos);
15405 settings->Size = ImVec2ih(window->SizeFull);
15406 settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0;
15407 settings->Collapsed = window->Collapsed;
15408 settings->WantDelete = false;
15409 }
15410
15411 // Write to text buffer
15412 buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
15413 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
15414 {
15415 if (settings->WantDelete)
15416 continue;
15417 const char* settings_name = settings->GetName();
15418 buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
15419 if (settings->IsChild)
15420 {
15421 buf->appendf("IsChild=1\n");
15422 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15423 }
15424 else
15425 {
15426 buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
15427 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15428 if (settings->Collapsed)
15429 buf->appendf("Collapsed=1\n");
15430 }
15431 buf->append("\n");
15432 }
15433}
15434
15435//-----------------------------------------------------------------------------
15436// [SECTION] LOCALIZATION

Callers

nothing calls this directly

Calls 9

ImVec2ihClass · 0.85
offset_from_ptrMethod · 0.80
next_chunkMethod · 0.80
GetNameMethod · 0.80
appendfMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected