MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / WindowSettingsHandler_WriteAll

Function WindowSettingsHandler_WriteAll

external/imgui/imgui.cpp:15790–15836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15788}
15789
15790static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
15791{
15792 // Gather data from windows that were active during this session
15793 // (if a window wasn't opened in this session we preserve its settings)
15794 ImGuiContext& g = *ctx;
15795 for (ImGuiWindow* window : g.Windows)
15796 {
15797 if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
15798 continue;
15799
15800 ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByWindow(window);
15801 if (!settings)
15802 {
15803 settings = ImGui::CreateNewWindowSettings(window->Name);
15804 window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
15805 }
15806 IM_ASSERT(settings->ID == window->ID);
15807 settings->Pos = ImVec2ih(window->Pos);
15808 settings->Size = ImVec2ih(window->SizeFull);
15809 settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0;
15810 settings->Collapsed = window->Collapsed;
15811 settings->WantDelete = false;
15812 }
15813
15814 // Write to text buffer
15815 buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
15816 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
15817 {
15818 if (settings->WantDelete)
15819 continue;
15820 const char* settings_name = settings->GetName();
15821 buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
15822 if (settings->IsChild)
15823 {
15824 buf->appendf("IsChild=1\n");
15825 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15826 }
15827 else
15828 {
15829 buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
15830 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
15831 if (settings->Collapsed)
15832 buf->appendf("Collapsed=1\n");
15833 }
15834 buf->append("\n");
15835 }
15836}
15837
15838//-----------------------------------------------------------------------------
15839// [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