@ -130,10 +130,11 @@ struct ImGuiTabBar; // Storage for a tab bar
structImGuiTabItem;// Storage for a tab item (within a tab bar)
structImGuiTabItem;// Storage for a tab item (within a tab bar)
structImGuiTable;// Storage for a table
structImGuiTable;// Storage for a table
structImGuiTableColumn;// Storage for one column of a table
structImGuiTableColumn;// Storage for one column of a table
structImGuiTableTempData;// Temporary storage for one table (one per table in the stack), shared between tables.
structImGuiTableSettings;// Storage for a table .ini settings
structImGuiTableSettings;// Storage for a table .ini settings
structImGuiTableColumnsSettings;// Storage for a column .ini settings
structImGuiTableColumnsSettings;// Storage for a column .ini settings
structImGuiWindow;// Storage for one window
structImGuiWindow;// Storage for one window
structImGuiWindowTempData;// Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame)
structImGuiWindowTempData;// Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
structImGuiWindowSettings;// Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
structImGuiWindowSettings;// Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
@ -1516,8 +1517,9 @@ struct ImGuiContext
// Table
// Table
ImGuiTable*CurrentTable;
ImGuiTable*CurrentTable;
intCurrentTableStackIdx;
ImPool<ImGuiTable>Tables;
ImPool<ImGuiTable>Tables;
ImVector<ImGuiPtrOrIndex>CurrentTableStack;
ImVector<ImGuiTableTempData>TablesTempDataStack;
ImVector<float>TablesLastTimeActive;// Last used timestamp of each tables (SOA, for efficient GC)
ImVector<float>TablesLastTimeActive;// Last used timestamp of each tables (SOA, for efficient GC)
// FIXME-TABLE: transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
structImGuiTable
structImGuiTable
{
{
ImGuiIDID;
ImGuiIDID;
ImGuiTableFlagsFlags;
ImGuiTableFlagsFlags;
void*RawData;// Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
void*RawData;// Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
ImGuiTableTempData*TempData;// Transient data while table is active. Point within g.CurrentTableStack[]
ImSpan<ImGuiTableColumn>Columns;// Point within RawData[]
ImSpan<ImGuiTableColumn>Columns;// Point within RawData[]
ImSpan<ImGuiTableColumnIdx>DisplayOrderToIndex;// Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
ImSpan<ImGuiTableColumnIdx>DisplayOrderToIndex;// Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
ImSpan<ImGuiTableCellData>RowCellData;// Point within RawData[]. Store cells background requests for current row.
ImSpan<ImGuiTableCellData>RowCellData;// Point within RawData[]. Store cells background requests for current row.
@ -2146,22 +2150,13 @@ struct ImGuiTable
ImRectBg0ClipRectForDrawCmd;// Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
ImRectBg0ClipRectForDrawCmd;// Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
ImRectBg2ClipRectForDrawCmd;// Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect.
ImRectBg2ClipRectForDrawCmd;// Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect.
ImRectHostClipRect;// This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
ImRectHostClipRect;// This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
ImRectHostBackupWorkRect;// Backup of InnerWindow->WorkRect at the end of BeginTable()
ImRectHostBackupParentWorkRect;// Backup of InnerWindow->ParentWorkRect at the end of BeginTable()
ImRectHostBackupInnerClipRect;// Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground()
ImRectHostBackupInnerClipRect;// Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground()
ImVec2HostBackupPrevLineSize;// Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable()
ImVec2HostBackupCurrLineSize;// Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable()
ImVec2HostBackupCursorMaxPos;// Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
ImVec2UserOuterSize;// outer_size.x passed to BeginTable()
ImVec1HostBackupColumnsOffset;// Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable()
floatHostBackupItemWidth;// Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
intHostBackupItemWidthStackSize;// Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
ImGuiWindow*OuterWindow;// Parent window for the table
ImGuiWindow*OuterWindow;// Parent window for the table
ImGuiWindow*InnerWindow;// Window holding the table data (== OuterWindow or a child window)
ImGuiWindow*InnerWindow;// Window holding the table data (== OuterWindow or a child window)
ImDrawListSplitterDrawSplitter;// We carry our own ImDrawList splitter to allow recursion (FIXME: could be stored outside, worst case we need 1 splitter per recursing table)
ImDrawListSplitterDrawSplitter;// We carry our own ImDrawList splitter to allow recursion (should move to ImGuiTableTempDataB)
ImGuiTableColumnSortSpecsSortSpecsSingle;
ImGuiTableColumnSortSpecsSortSpecsSingle;
ImVector<ImGuiTableColumnSortSpecs>SortSpecsMulti;// FIXME-OPT: Using a small-vector pattern would work be good.
ImVector<ImGuiTableColumnSortSpecs>SortSpecsMulti;// FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableSortSpecsSortSpecs;// Public facing sorts specs, this is what we return in TableGetSortSpecs()
ImGuiTableSortSpecsSortSpecs;// Public facing sorts specs, this is what we return in TableGetSortSpecs()
ImGuiTableColumnIdxSortSpecsCount;
ImGuiTableColumnIdxSortSpecsCount;
ImGuiTableColumnIdxColumnsEnabledCount;// Number of enabled columns (<= ColumnsCount)
ImGuiTableColumnIdxColumnsEnabledCount;// Number of enabled columns (<= ColumnsCount)
@ -2208,6 +2203,26 @@ struct ImGuiTable
IMGUI_API~ImGuiTable(){IM_FREE(RawData);}
IMGUI_API~ImGuiTable(){IM_FREE(RawData);}
};
};
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared.
// Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// FIXME-TABLE: more transient data could be stored here: DrawSplitter (!), SortSpecs? incoming RowData?
structImGuiTableTempData
{
intTableIndex;// Index in g.Tables.Buf[] pool
ImVec2UserOuterSize;// outer_size.x passed to BeginTable()
ImRectHostBackupWorkRect;// Backup of InnerWindow->WorkRect at the end of BeginTable()
ImRectHostBackupParentWorkRect;// Backup of InnerWindow->ParentWorkRect at the end of BeginTable()
ImVec2HostBackupPrevLineSize;// Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable()
ImVec2HostBackupCurrLineSize;// Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable()
ImVec2HostBackupCursorMaxPos;// Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
ImVec1HostBackupColumnsOffset;// Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable()
floatHostBackupItemWidth;// Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
intHostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()