MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / WindowSettingsHandler_WriteAll

Function WindowSettingsHandler_WriteAll

lib/imgui/imgui.cpp:9625–9659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9623}
9624
9625static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
9626{
9627 // Gather data from windows that were active during this session
9628 // (if a window wasn't opened in this session we preserve its settings)
9629 ImGuiContext& g = *ctx;
9630 for (int i = 0; i != g.Windows.Size; i++)
9631 {
9632 ImGuiWindow* window = g.Windows[i];
9633 if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
9634 continue;
9635
9636 ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID);
9637 if (!settings)
9638 {
9639 settings = ImGui::CreateNewWindowSettings(window->Name);
9640 window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
9641 }
9642 IM_ASSERT(settings->ID == window->ID);
9643 settings->Pos = ImVec2ih((short)window->Pos.x, (short)window->Pos.y);
9644 settings->Size = ImVec2ih((short)window->SizeFull.x, (short)window->SizeFull.y);
9645 settings->Collapsed = window->Collapsed;
9646 }
9647
9648 // Write to text buffer
9649 buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
9650 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
9651 {
9652 const char* settings_name = settings->GetName();
9653 buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
9654 buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
9655 buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
9656 buf->appendf("Collapsed=%d\n", settings->Collapsed);
9657 buf->append("\n");
9658 }
9659}
9660
9661
9662//-----------------------------------------------------------------------------

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