MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / WindowSettingsHandler_WriteAll

Function WindowSettingsHandler_WriteAll

core/src/imgui/imgui.cpp:10585–10619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10583}
10584
10585static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
10586{
10587 // Gather data from windows that were active during this session
10588 // (if a window wasn't opened in this session we preserve its settings)
10589 ImGuiContext& g = *ctx;
10590 for (int i = 0; i != g.Windows.Size; i++)
10591 {
10592 ImGuiWindow* window = g.Windows[i];
10593 if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
10594 continue;
10595
10596 ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID);
10597 if (!settings)
10598 {
10599 settings = ImGui::CreateNewWindowSettings(window->Name);
10600 window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
10601 }
10602 IM_ASSERT(settings->ID == window->ID);
10603 settings->Pos = ImVec2ih((short)window->Pos.x, (short)window->Pos.y);
10604 settings->Size = ImVec2ih((short)window->SizeFull.x, (short)window->SizeFull.y);
10605 settings->Collapsed = window->Collapsed;
10606 }
10607
10608 // Write to text buffer
10609 buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
10610 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
10611 {
10612 const char* settings_name = settings->GetName();
10613 buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
10614 buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
10615 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
10616 buf->appendf("Collapsed=%d\n", settings->Collapsed);
10617 buf->append("\n");
10618 }
10619}
10620
10621
10622//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected