IM_ASSERT(io.Fonts->IsBuilt()&&"Font atlas not built! It is generally built by the renderer backend. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
IM_ASSERT(io.Fonts->IsBuilt()&&"Font atlas not built! It is generally built by the renderer backend. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
// Setup display size (every frame to accommodate for window resizing)
// Setup display size (every frame to accommodate for window resizing)
FrameBorderSize=0.0f;// Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
FrameBorderSize=0.0f;// Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
ItemSpacing=ImVec2(8,4);// Horizontal and vertical spacing between widgets/lines
ItemSpacing=ImVec2(8,4);// Horizontal and vertical spacing between widgets/lines
ItemInnerSpacing=ImVec2(4,4);// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
ItemInnerSpacing=ImVec2(4,4);// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
CellPadding=ImVec2(4,2);// Padding within a table cell
TouchExtraPadding=ImVec2(0,0);// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
TouchExtraPadding=ImVec2(0,0);// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
IndentSpacing=21.0f;// Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
IndentSpacing=21.0f;// Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
ColumnsMinSpacing=6.0f;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
ColumnsMinSpacing=6.0f;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
window->DC.CursorPosPrevLine.y=window->DC.CursorPos.y-line_height;// Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
window->DC.CursorPosPrevLine.y=window->DC.CursorPos.y-line_height;// Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
window->DC.PrevLineSize.y=(line_height-g.Style.ItemSpacing.y);// If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
window->DC.PrevLineSize.y=(line_height-g.Style.ItemSpacing.y);// If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
// In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user.
// In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user.
enum{TRT_OuterRect,TRT_WorkRect,TRT_HostClipRect,TRT_InnerClipRect,TRT_BackgroundClipRect,TRT_ColumnsRect,TRT_ColumnsClipRect,TRT_ColumnsContentHeadersUsed,TRT_ColumnsContentHeadersIdeal,TRT_ColumnsContentRowsFrozen,TRT_ColumnsContentRowsUnfrozen,TRT_Count};// Tables Rect Type
enum{TRT_OuterRect,TRT_WorkRect,TRT_HostClipRect,TRT_InnerClipRect,TRT_BackgroundClipRect,TRT_ColumnsRect,TRT_ColumnsClipRect,TRT_ColumnsContentHeadersUsed,TRT_ColumnsContentHeadersIdeal,TRT_ColumnsContentFrozen,TRT_ColumnsContentUnfrozen,TRT_Count};// Tables Rect Type
elseif(rect_type==TRT_ColumnsContentHeadersUsed){ImGuiTableColumn*c=&table->Columns[n];returnImRect(c->WorkMinX,table->InnerClipRect.Min.y,c->ContentMaxXHeadersUsed,table->InnerClipRect.Min.y+table->LastFirstRowHeight);}// Note: y1/y2 not always accurate
// Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
// Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
// Platform interface for multi-viewport support (ImGuiPlatformIO, ImGuiPlatformMonitor, ImGuiViewportFlags, ImGuiViewport)
// Platform interface for multi-viewport support (ImGuiPlatformIO, ImGuiPlatformMonitor, ImGuiViewportFlags, ImGuiViewport)
// FIXME-TABLE: Add ImGuiTableSortSpecs and ImGuiTableColumnSortSpecs in "Misc data structures" section above (we don't do it right now to facilitate merging various branches)
IMGUI_APIvoidEndTable();// only call EndTable() if BeginTable() returns true!
IMGUI_APIvoidTableNextRow(ImGuiTableRowFlagsrow_flags=0,floatmin_row_height=0.0f);// append into the first cell of a new row.
IMGUI_APIboolTableNextColumn();// append into the next column (or first column of next row if currently in last column). Return true when column is visible.
IMGUI_APIboolTableSetColumnIndex(intcolumn_n);// append into the specified column. Return true when column is visible.
IMGUI_APIintTableGetColumnIndex();// return current column index.
IMGUI_APIintTableGetRowIndex();// return current row index.
// Tables: Headers & Columns declaration
// - Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
// Important: this will not display anything! The name passed to TableSetupColumn() is used by TableHeadersRow() and context-menus.
// - Use TableHeadersRow() to create a row and automatically submit a TableHeader() for each column.
// Headers are required to perform: reordering, sorting, and opening the context menu (but context menu can also be available in columns body using ImGuiTableFlags_ContextMenuInBody).
// - You may manually submit headers using TableNextRow() + TableHeader() calls, but this is only useful in some advanced cases (e.g. adding custom widgets in header row).
// - Use TableSetupScrollFreeze() to lock columns (from the right) or rows (from the top) so they stay visible when scrolled.
IMGUI_APIvoidTableSetupScrollFreeze(intcols,introws);// lock columns/rows so they stay visible when scrolled.
IMGUI_APIvoidTableHeadersRow();// submit all headers cells based on data provided to TableSetupColumn() + submit context menu
IMGUI_APIvoidTableHeader(constchar*label);// submit one header cell manually (rarely used)
// Tables: Miscellaneous functions
// - Most functions taking 'int column_n' treat the default value of -1 as the same as passing the current column index
// - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. Return value will be NULL if no sorting.
// When 'SpecsDirty == true' you should sort your data. It will be true when sorting specs have changed since last call, or the first time.
// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
// Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
IMGUI_APIintTableGetColumnCount();// return number of columns (value passed to BeginTable)
IMGUI_APIconstchar*TableGetColumnName(intcolumn_n=-1);// return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
IMGUI_APIImGuiTableColumnFlagsTableGetColumnFlags(intcolumn_n=-1);// return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags.
IMGUI_APIImGuiTableSortSpecs*TableGetSortSpecs();// get latest sort specs for the table (NULL if not sorting).
IMGUI_APIvoidTableSetBgColor(ImGuiTableBgTargetbg_target,ImU32color,intcolumn_n=-1);// change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
// Legacy Columns API (2020: prefer using Tables!)
// - You can also use SameLine(pos_x) to mimic simplified columns.
// - You can also use SameLine(pos_x) to mimic simplified columns.
// - The columns API is work-in-progress and rather lacking (columns are arguably the worst part of dear imgui at the moment!)
// - There is a maximum of 64 columns.
// - Currently working on new 'Tables' api which will replace columns around Q2 2020 (see GitHub #2957).
ImGuiTableFlags_Reorderable=1<<1,// Allow reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
ImGuiTableFlags_Hideable=1<<2,// Allow hiding/disabling columns in context menu.
ImGuiTableFlags_Sortable=1<<3,// Allow sorting on one column (sort_specs_count will always be == 1). Call TableGetSortSpecs() to obtain sort specs.
ImGuiTableFlags_MultiSortable=1<<4,// Allow sorting on multiple columns by holding Shift (sort_specs_count may be > 1). Call TableGetSortSpecs() to obtain sort specs.
ImGuiTableFlags_NoSavedSettings=1<<5,// Disable persisting columns order, width and sort settings in the .ini file.
ImGuiTableFlags_ContextMenuInBody=1<<6,// Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
// Decorations
ImGuiTableFlags_RowBg=1<<7,// Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_BordersInnerH=1<<8,// Draw horizontal borders between rows.
ImGuiTableFlags_BordersOuterH=1<<9,// Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersInnerV=1<<10,// Draw vertical borders between columns.
ImGuiTableFlags_BordersOuterV=1<<11,// Draw vertical borders on the left and right sides.
ImGuiTableFlags_Borders=ImGuiTableFlags_BordersInner|ImGuiTableFlags_BordersOuter,// Draw all borders.
ImGuiTableFlags_NoBordersInBody=1<<12,// Disable vertical borders in columns Body (borders will always appears in Headers).
ImGuiTableFlags_NoBordersInBodyUntilResize=1<<13,// Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers).
// Sizing
ImGuiTableFlags_ColumnsWidthStretch=1<<14,// Default if ScrollX is off. Columns will default to use _WidthStretch. Read description above for more details.
ImGuiTableFlags_ColumnsWidthFixed=1<<15,// Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAutoResize policy (if Resizable is off). Read description above for more details.
ImGuiTableFlags_SameWidths=1<<16,// Make all columns the same widths which is useful with Fixed columns policy (but granted by default with Stretch policy + no resize). Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible and disable ImGuiTableFlags_Resizable.
ImGuiTableFlags_NoHeadersWidth=1<<17,// Disable headers' contribution to automatic width calculation.
ImGuiTableFlags_NoHostExtendY=1<<18,// Disable extending past the limit set by outer_size.y, only meaningful when neither of ScrollX|ScrollY are set (data below the limit will be clipped and not visible)
ImGuiTableFlags_NoKeepColumnsVisible=1<<19,// Disable keeping column always minimally visible when ScrollX is off and table gets too small.
ImGuiTableFlags_PreciseWidths=1<<20,// Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
ImGuiTableFlags_NoClip=1<<21,// Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
// Padding
ImGuiTableFlags_PadOuterX=1<<22,// Default if BordersOuterV is on. Enable outer-most padding.
ImGuiTableFlags_NoPadOuterX=1<<23,// Default if BordersOuterV is off. Disable outer-most padding.
ImGuiTableFlags_NoPadInnerX=1<<24,// Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
// Scrolling
ImGuiTableFlags_ScrollX=1<<25,// Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY=1<<26// Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
};
// Flags for ImGui::TableSetupColumn()
enumImGuiTableColumnFlags_
{
// Input configuration flags
ImGuiTableColumnFlags_None=0,
ImGuiTableColumnFlags_DefaultHide=1<<0,// Default as a hidden/disabled column.
ImGuiTableColumnFlags_DefaultSort=1<<1,// Default as a sorting column.
ImGuiTableColumnFlags_WidthStretch=1<<2,// Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _ColumnsWidthStretch).
ImGuiTableColumnFlags_WidthFixed=1<<3,// Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _ColumnsWidthFixed and table is resizable).
ImGuiTableColumnFlags_WidthAutoResize=1<<4,// Column will not stretch and keep resizing based on submitted contents (default if table sizing policy is _ColumnsWidthFixed and table is not resizable).
ImGuiTableColumnFlags_NoReorder=1<<6,// Disable manual reordering this column, this will also prevent other columns from crossing over this column.
ImGuiTableColumnFlags_NoHide=1<<7,// Disable ability to hide/disable this column.
ImGuiTableColumnFlags_NoClip=1<<8,// Disable clipping for this column (all NoClip columns will render in a same draw command).
ImGuiTableColumnFlags_NoSort=1<<9,// Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
ImGuiTableColumnFlags_NoSortAscending=1<<10,// Disable ability to sort in the ascending direction.
ImGuiTableColumnFlags_NoSortDescending=1<<11,// Disable ability to sort in the descending direction.
ImGuiTableColumnFlags_NoHeaderWidth=1<<12,// Header width don't contribute to automatic column width.
ImGuiTableColumnFlags_PreferSortAscending=1<<13,// Make the initial sort direction Ascending when first sorting on this column (default).
ImGuiTableColumnFlags_PreferSortDescending=1<<14,// Make the initial sort direction Descending when first sorting on this column.
ImGuiTableColumnFlags_IndentEnable=1<<15,// Use current Indent value when entering cell (default for column 0).
ImGuiTableColumnFlags_IndentDisable=1<<16,// Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored.
// Output status flags, read-only via TableGetColumnFlags()
ImGuiTableColumnFlags_IsEnabled=1<<20,// Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags.
ImGuiTableColumnFlags_IsVisible=1<<21,// Status: is visible == is enabled AND not clipped by scrolling.
ImGuiTableColumnFlags_IsSorted=1<<22,// Status: is currently part of the sort specs
ImGuiTableColumnFlags_IsHovered=1<<23,// Status: is hovered by mouse
ImGuiTableColumnFlags_NoDirectResize_=1<<30// [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
};
// Flags for ImGui::TableNextRow()
enumImGuiTableRowFlags_
{
ImGuiTableRowFlags_None=0,
ImGuiTableRowFlags_Headers=1<<0// Identify header row (set default background color + width of its contents accounted different for auto column width)
};
// Enum for ImGui::TableSetBgColor()
// Background colors are rendering in 3 layers:
// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
// - Layer 2: draw with CellBg color if set.
// The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color.
// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows.
// If you set the color of RowBg0 target, your color will override the existing RowBg0 color.
// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
enumImGuiTableBgTarget_
{
ImGuiTableBgTarget_None=0,
//ImGuiTableBgTarget_ColumnBg0 = 1, // FIXME-TABLE: Todo. Set column background color 0 (generally used for background
//ImGuiTableBgTarget_ColumnBg1 = 2, // FIXME-TABLE: Todo. Set column background color 1 (generally used for selection marking)
ImGuiTableBgTarget_RowBg0=3,// Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
ImGuiTableBgTarget_RowBg1=4,// Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_CellBg=5// Set cell background color (top-most color)
};
// Flags for ImGui::IsWindowFocused()
// Flags for ImGui::IsWindowFocused()
enumImGuiFocusedFlags_
enumImGuiFocusedFlags_
{
{
@ -1103,6 +1289,14 @@ enum ImGuiDir_
ImGuiDir_COUNT
ImGuiDir_COUNT
};
};
// A sorting direction
enumImGuiSortDirection_
{
ImGuiSortDirection_None=0,
ImGuiSortDirection_Ascending=1,// Ascending = 0->9, A->Z etc.
ImGuiSortDirection_Descending=2// Descending = 9->0, Z->A etc.
};
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
enumImGuiKey_
enumImGuiKey_
{
{
@ -1263,6 +1457,11 @@ enum ImGuiCol_
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogramHovered,
ImGuiCol_PlotHistogramHovered,
ImGuiCol_TableHeaderBg,// Table header background
ImGuiCol_TableBorderStrong,// Table outer and header borders (prefer using Alpha=1.0 here)
ImGuiCol_TableBorderLight,// Table inner borders (prefer using Alpha=1.0 here)
floatFrameBorderSize;// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
floatFrameBorderSize;// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines.
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines.
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2CellPadding;// Padding within a table cell
ImVec2TouchExtraPadding;// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
ImVec2TouchExtraPadding;// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
floatIndentSpacing;// Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
floatIndentSpacing;// Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
floatColumnsMinSpacing;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
floatColumnsMinSpacing;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
@ -1804,6 +2005,30 @@ struct ImGuiPayload
boolIsDelivery()const{returnDelivery;}
boolIsDelivery()const{returnDelivery;}
};
};
// Sorting specification for one column of a table (sizeof == 12 bytes)
structImGuiTableColumnSortSpecs
{
ImGuiIDColumnUserID;// User id of the column (if specified by a TableSetupColumn() call)
ImS16ColumnIndex;// Index of the column
ImS16SortOrder;// Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
ImGuiSortDirectionSortDirection:8;// ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
ImGuiStorage*StateStorage;// Current persistent per-window storage (store e.g. tree node open/close state)
ImGuiStorage*StateStorage;// Current persistent per-window storage (store e.g. tree node open/close state)
ImGuiOldColumns*CurrentColumns;// Current columns set
ImGuiOldColumns*CurrentColumns;// Current columns set
intCurrentTableIdx;// Current table index (into g.Tables)
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
intFocusCounterRegular;// (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign)
intFocusCounterRegular;// (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign)
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
#define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
#define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels()
// Our current column maximum is 64 but we may raise that in the future.
typedefImS8ImGuiTableColumnIdx;
typedefImU8ImGuiTableDrawChannelIdx;
// [Internal] sizeof() ~ 104
// We use the terminology "Enabled" to refer to a column that is not Hidden by user/api.
// We use the terminology "Clipped" to refer to a column that is out of sight because of scrolling/clipping.
// This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
structImGuiTableColumn
{
ImRectClipRect;// Clipping rectangle for the column
ImGuiIDUserID;// Optional, value passed to TableSetupColumn()
ImGuiTableColumnFlagsFlagsIn;// Flags as they were provided by user. See ImGuiTableColumnFlags_
ImGuiTableColumnFlagsFlags;// Effective flags. See ImGuiTableColumnFlags_
floatMinX;// Absolute positions
floatMaxX;
floatInitStretchWeightOrWidth;// Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
floatStretchWeight;// Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
floatWidthAuto;// Automatic width
floatWidthRequest;// Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
floatWidthGiven;// Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space.
floatWorkMinX;// Start position for the frame, currently ~(MinX + CellPaddingX)
floatWorkMaxX;
floatItemWidth;
floatContentMaxXFrozen;// Contents maximum position for frozen rows (apart from headers), from which we can infer content width.
floatContentMaxXUnfrozen;
floatContentMaxXHeadersUsed;// Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
floatContentMaxXHeadersIdeal;
ImS16NameOffset;// Offset into parent ColumnsNames[]
ImGuiTableColumnIdxDisplayOrder;// Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
ImGuiTableColumnIdxIndexWithinEnabledSet;// Index within enabled/visible set (<= IndexToDisplayOrder)
ImGuiTableColumnIdxPrevEnabledColumn;// Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
ImGuiTableColumnIdxNextEnabledColumn;// Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
ImGuiTableColumnIdxSortOrder;// Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
ImGuiTableDrawChannelIdxDrawChannelCurrent;// Index within DrawSplitter.Channels[]
ImGuiTableDrawChannelIdxDrawChannelFrozen;
ImGuiTableDrawChannelIdxDrawChannelUnfrozen;
boolIsEnabled;// Is the column not marked Hidden by the user? (even if off view, e.g. clipped by scrolling).
boolIsEnabledNextFrame;
boolIsVisibleX;// Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled).
boolIsVisibleY;
boolIsRequestOutput;// Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not.
boolIsSkipItems;// Do we want item submissions to this column to be completely ignored (no layout will happen).
boolIsPreserveWidthAuto;
ImS8NavLayerCurrent;// ImGuiNavLayer in 1 byte
ImS8SortDirection;// ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8AutoFitQueue;// Queue of 8 values for the next 8 frames to request auto-fit
ImU8CannotSkipItemsQueue;// Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
// FIXME-TABLES: transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
structImGuiTable
{
ImGuiIDID;
ImGuiTableFlagsFlags;
void*RawData;// Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
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<ImGuiTableCellData>RowCellData;// Point within RawData[]. Store cells background requests for current row.
ImU64EnabledMaskByIndex;// Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
ImU64VisibleMaskByIndex;// Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
ImU64RequestOutputMaskByIndex;// Column Index -> IsVisible || AutoFit (== expect user to submit items)
ImGuiTableFlagsSettingsLoadedFlags;// Which data were loaded from the .ini file (e.g. when order is not altered we won't save order)
intSettingsOffset;// Offset in g.SettingsTables
intLastFrameActive;
intColumnsCount;// Number of columns declared in BeginTable()
intCurrentRow;
intCurrentColumn;
ImS16InstanceCurrent;// Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched.
ImS16InstanceInteracted;// Mark which instance (generally 0) of the same ID is being interacted with
floatRowPosY1;
floatRowPosY2;
floatRowMinHeight;// Height submitted to TableNextRow()
floatRowTextBaseline;
floatRowIndentOffsetX;
ImGuiTableRowFlagsRowFlags:16;// Current row flags, see ImGuiTableRowFlags_
ImGuiTableRowFlagsLastRowFlags:16;
intRowBgColorCounter;// Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don't increase this.
ImU32RowBgColor[2];// Background color override for current row.
ImU32BorderColorStrong;
ImU32BorderColorLight;
floatBorderX1;
floatBorderX2;
floatHostIndentX;
floatOuterPaddingX;
floatCellPaddingX;// Padding from each borders
floatCellPaddingY;
floatCellSpacingX1;// Spacing between non-bordered cells
floatCellSpacingX2;
floatLastOuterHeight;// Outer height from last frame
floatLastFirstRowHeight;// Height of first row from last frame
floatInnerWidth;// User value passed to BeginTable(), see comments at the top of BeginTable() for details.
floatColumnsTotalWidth;// Sum of current column width
floatColumnsAutoFitWidth;// Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
floatResizedColumnNextWidth;
floatRefScale;// Reference scale to be able to rescale columns on font/dpi changes.
ImRectOuterRect;// Note: OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
ImRectWorkRect;
ImRectInnerClipRect;
ImRectBgClipRect;// We use this to cpu-clip cell background color fill
ImRectBgClipRectForDrawCmd;
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()
ImRectHostBackupClipRect;// 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()
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*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)
ImGuiTableColumnSortSpecsSortSpecsSingle;
ImVector<ImGuiTableColumnSortSpecs>SortSpecsMulti;// FIXME-OPT: Using a small-vector pattern would work be good.
ImGuiTableSortSpecsSortSpecs;// Public facing sorts specs, this is what we return in TableGetSortSpecs()
ImGuiTableColumnIdxSortSpecsCount;
ImGuiTableColumnIdxColumnsEnabledCount;// Number of enabled columns (<= ColumnsCount)
ImGuiTableColumnIdxColumnsEnabledFixedCount;// Number of enabled columns (<= ColumnsCount)
ImGuiTableColumnIdxDeclColumnsCount;// Count calls to TableSetupColumn()
ImGuiTableColumnIdxHoveredColumnBody;// Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
ImGuiTableColumnIdxHoveredColumnBorder;// Index of column whose right-border is being hovered (for resizing).
ImGuiTableColumnIdxAutoFitSingleStretchColumn;// Index of single stretch column requesting auto-fit.
ImGuiTableColumnIdxResizedColumn;// Index of column being resized. Reset when InstanceCurrent==0.
ImGuiTableColumnIdxLastResizedColumn;// Index of column being resized from previous frame.
ImGuiTableColumnIdxHeldHeaderColumn;// Index of column header being held.
ImGuiTableColumnIdxReorderColumn;// Index of column being reordered. (not cleared)
ImGuiTableColumnIdxReorderColumnDir;// -1 or +1
ImGuiTableColumnIdxRightMostEnabledColumn;// Index of right-most non-hidden column.
ImGuiTableColumnIdxLeftMostStretchedColumnDisplayOrder;// Display order of left-most stretched column.
ImGuiTableColumnIdxContextPopupColumn;// Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
ImGuiTableDrawChannelIdxBg1DrawChannelCurrent;// For Selectable() and other widgets drawing accross columns after the freezing line. Index within DrawSplitter.Channels[]
ImGuiTableDrawChannelIdxBg1DrawChannelUnfrozen;
boolIsLayoutLocked;// Set by TableUpdateLayout() which is called when beginning the first row.
boolIsInsideRow;// Set when inside TableBeginRow()/TableEndRow().
boolIsInitializing;
boolIsSortSpecsDirty;
boolIsUsingHeaders;// Set when the first row had the ImGuiTableRowFlags_Headers flag.
boolIsContextPopupOpen;// Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
boolIsSettingsRequestLoad;
boolIsSettingsDirty;// Set when table settings have changed and needs to be reported into ImGuiTableSetttings data.
boolIsDefaultDisplayOrder;// Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
boolIsResetAllRequest;
boolIsResetDisplayOrderRequest;
boolIsUnfrozen;// Set when we got past the frozen row.
boolMemoryCompacted;
boolHostSkipItems;// Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
IMGUI_APIImGuiTable();
IMGUI_API~ImGuiTable();
};
// sizeof() ~ 12
structImGuiTableColumnSettings
{
floatWidthOrWeight;
ImGuiIDUserID;
ImGuiTableColumnIdxIndex;
ImGuiTableColumnIdxDisplayOrder;
ImGuiTableColumnIdxSortOrder;
ImU8SortDirection:2;
ImU8IsEnabled:1;// "Visible" in ini file
ImU8IsStretch:1;
ImGuiTableColumnSettings()
{
WidthOrWeight=0.0f;
UserID=0;
Index=-1;
DisplayOrder=SortOrder=-1;
SortDirection=ImGuiSortDirection_None;
IsEnabled=1;
IsStretch=0;
}
};
// This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
structImGuiTableSettings
{
ImGuiIDID;// Set to 0 to invalidate/delete the setting
ImGuiTableFlagsSaveFlags;// Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
floatRefScale;// Reference scale to be able to rescale columns on font/dpi changes.
ImGuiTableColumnIdxColumnsCount;
ImGuiTableColumnIdxColumnsCountMax;// Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
boolWantApply;// Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
IMGUI_APIintTableGetHoveredColumn();// May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
#pragma warning (disable: 4127) // condition expression is constant
#pragma warning (disable: 4127) // condition expression is constant
@ -72,9 +77,9 @@ Index of this file:
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead