MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / WindowSettingsHandler_WriteAll

Function WindowSettingsHandler_WriteAll

Source/3rdParty/imgui/imgui.cpp:15738–15784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15736}
15737
15738static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
15739{
15740 // Gather data from windows that were active during this session
15741 // (if a window wasn't opened in this session we preserve its settings)
15742 ImGuiContext& g = *ctx;
15743 for (ImGuiWindow* window : g.Windows)
15744 {
15745 if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
15746 continue;
15747
15748 ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByWindow(window);
15749 if (!settings)
15750 {
15751 settings = ImGui::CreateNewWindowSettings(window->Name);
15752 window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
15753 }
15754 IM_ASSERT(settings->ID == window->ID);
15755 settings->Pos = ImVec2ih(window->Pos);
15756 settings->Size = ImVec2ih(window->SizeFull);
15757 settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0;
15758 settings->Collapsed = window->Collapsed;
15759 settings->WantDelete = false;
15760 }
15761
15762 // Write to text buffer
15763 buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
15764 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
15765 {
15766 if (settings->WantDelete)
15767 continue;
15768 const char* settings_name = settings->GetName();
15769 buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
15770 if (settings->IsChild)
15771 {
15772 buf->appendf("IsChild=1\n");
15773 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15774 }
15775 else
15776 {
15777 buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
15778 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15779 if (settings->Collapsed)
15780 buf->appendf("Collapsed=1\n");
15781 }
15782 buf->append("\n");
15783 }
15784}
15785
15786//-----------------------------------------------------------------------------
15787// [SECTION] LOCALIZATION

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected