// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default bindings files (imgui_impl_xxx.h)
// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default bindings files (imgui_impl_xxx.h)
@ -114,6 +116,8 @@ typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: f
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
typedefintImGuiInputTextFlags;// -> enum ImGuiInputTextFlags_ // Flags: for InputText*()
typedefintImGuiInputTextFlags;// -> enum ImGuiInputTextFlags_ // Flags: for InputText*()
typedefintImGuiSelectableFlags;// -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedefintImGuiSelectableFlags;// -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedefintImGuiTabBarFlags;// -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
typedefintImGuiTabItemFlags;// -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem()
typedefintImGuiTreeNodeFlags;// -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode*(),CollapsingHeader()
typedefintImGuiTreeNodeFlags;// -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode*(),CollapsingHeader()
typedefintImGuiViewportFlags;// -> enum ImGuiViewportFlags_ // Flags: for ImGuiViewport
typedefintImGuiViewportFlags;// -> enum ImGuiViewportFlags_ // Flags: for ImGuiViewport
typedefintImGuiWindowFlags;// -> enum ImGuiWindowFlags_ // Flags: for Begin*()
typedefintImGuiWindowFlags;// -> enum ImGuiWindowFlags_ // Flags: for Begin*()
@ -211,6 +215,7 @@ namespace ImGui
IMGUI_APIboolIsWindowCollapsed();
IMGUI_APIboolIsWindowCollapsed();
IMGUI_APIboolIsWindowFocused(ImGuiFocusedFlagsflags=0);// is current window focused? or its root/child, depending on flags. see flags for options.
IMGUI_APIboolIsWindowFocused(ImGuiFocusedFlagsflags=0);// is current window focused? or its root/child, depending on flags. see flags for options.
IMGUI_APIboolIsWindowHovered(ImGuiHoveredFlagsflags=0);// is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
IMGUI_APIboolIsWindowHovered(ImGuiHoveredFlagsflags=0);// is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
IMGUI_APIboolIsWindowDocked();
IMGUI_APIImDrawList*GetWindowDrawList();// get draw list associated to the current window, to append your own drawing primitives
IMGUI_APIImDrawList*GetWindowDrawList();// get draw list associated to the current window, to append your own drawing primitives
IMGUI_APIfloatGetWindowDpiScale();// get DPI scale currently associated to the current window's viewport.
IMGUI_APIfloatGetWindowDpiScale();// get DPI scale currently associated to the current window's viewport.
IMGUI_APIImGuiViewport*GetWindowViewport();// get viewport currently associated to the current window.
IMGUI_APIImGuiViewport*GetWindowViewport();// get viewport currently associated to the current window.
@ -233,6 +238,7 @@ namespace ImGui
IMGUI_APIvoidSetNextWindowFocus();// set next window to be focused / front-most. call before Begin()
IMGUI_APIvoidSetNextWindowFocus();// set next window to be focused / front-most. call before Begin()
IMGUI_APIvoidSetNextWindowBgAlpha(floatalpha);// set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg.
IMGUI_APIvoidSetNextWindowBgAlpha(floatalpha);// set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg.
IMGUI_APIvoidSetNextWindowViewport(ImGuiIDviewport_id);// set next window viewport
IMGUI_APIvoidSetNextWindowViewport(ImGuiIDviewport_id);// set next window viewport
IMGUI_APIvoidSetNextWindowDock(ImGuiIDdock_id,ImGuiCondcond=0);// set next window dock id (FIXME-DOCK)
IMGUI_APIvoidSetWindowPos(constImVec2&pos,ImGuiCondcond=0);// (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_APIvoidSetWindowPos(constImVec2&pos,ImGuiCondcond=0);// (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_APIvoidSetWindowSize(constImVec2&size,ImGuiCondcond=0);// (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
IMGUI_APIvoidSetWindowSize(constImVec2&size,ImGuiCondcond=0);// (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
IMGUI_APIvoidSetWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
IMGUI_APIvoidSetWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
@ -502,6 +508,19 @@ namespace ImGui
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIintGetColumnsCount();
IMGUI_APIintGetColumnsCount();
// Tabs
// Note: Tabs are automatically created by the docking system. Use this to create tab bars/tabs yourself without docking being involved.
IMGUI_APIboolBeginTabBar(constchar*str_id,ImGuiTabBarFlagsflags=0);// create and append into a TabBar
IMGUI_APIvoidEndTabBar();
IMGUI_APIboolBeginTabItem(constchar*label,bool*p_open=NULL,ImGuiTabItemFlags=0);// create a Tab. Returns true if the Tab is selected.
IMGUI_APIvoidEndTabItem();// only call EndTabItem() if BeginTabItem() returns true!
IMGUI_APIvoidSetTabItemClosed(constchar*tab_or_docked_window_label);// notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.
// Docking
// [BETA API] Enable with io.ConfigFlags |= ImGuiConfigFlags_DockingEnable.
// Note: you DO NOT need to call DockSpace() to use most Docking facilities! You can hold SHIFT anywhere while moving windows. Use DockSpace() if you need to create an explicit docking space _within_ an existing window. See Docking demo for details)
ImGuiWindowFlags_UnsavedDocument=1<<20,// Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker.
ImGuiWindowFlags_NoDocking=1<<21,// Disable docking of this window
// [Internal]
// [Internal]
ImGuiWindowFlags_NavFlattened=1<<23,// [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
ImGuiWindowFlags_NavFlattened=1<<23,// [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
@ -648,7 +669,8 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_Tooltip=1<<25,// Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Tooltip=1<<25,// Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup=1<<26,// Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Popup=1<<26,// Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal=1<<27,// Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_Modal=1<<27,// Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu=1<<28// Don't use! For internal use by BeginMenu()
ImGuiWindowFlags_ChildMenu=1<<28,// Don't use! For internal use by BeginMenu()
ImGuiWindowFlags_DockNodeHost=1<<29// Don't use! For internal use by Begin()/NewFrame()
// [Obsolete]
// [Obsolete]
//ImGuiWindowFlags_ShowBorders = 1 << 7, // --> Set style.FrameBorderSize=1.0f / style.WindowBorderSize=1.0f to enable borders around windows and items
//ImGuiWindowFlags_ShowBorders = 1 << 7, // --> Set style.FrameBorderSize=1.0f / style.WindowBorderSize=1.0f to enable borders around windows and items
ImGuiTabBarFlags_Reorderable=1<<0,// Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
ImGuiTabBarFlags_AutoSelectNewTabs=1<<1,// Automatically select new tabs when they appear
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton=1<<2,// Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
ImGuiTabBarFlags_NoTabListPopupButton=1<<3,
ImGuiTabBarFlags_NoTabListScrollingButtons=1<<4,
ImGuiTabBarFlags_FittingPolicyResizeDown=1<<5,// Resize tabs when they don't fit
ImGuiTabBarFlags_FittingPolicyScroll=1<<6,// Add scroll buttons when tabs don't fit
ImGuiTabItemFlags_UnsavedDocument=1<<0,// Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. Also: tab is selected on closure and closure is deferred by one frame to allow code to undo it without flicker.
ImGuiTabItemFlags_SetSelected=1<<1,// Trigger flag to programatically make the tab selected when calling BeginTabItem()
ImGuiTabItemFlags_NoCloseWithMiddleMouseButton=1<<2,// Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
ImGuiTabItemFlags_NoPushId=1<<3// Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem()
};
// Flags for ImGui::IsWindowFocused()
// Flags for ImGui::IsWindowFocused()
enumImGuiFocusedFlags_
enumImGuiFocusedFlags_
{
{
@ -877,6 +924,9 @@ enum ImGuiConfigFlags_
ImGuiConfigFlags_NoMouse=1<<4,// Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the back-end.
ImGuiConfigFlags_NoMouse=1<<4,// Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the back-end.
ImGuiConfigFlags_NoMouseCursorChange=1<<5,// Instruct back-end to not alter mouse cursor shape and visibility. Use if the back-end cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
ImGuiConfigFlags_NoMouseCursorChange=1<<5,// Instruct back-end to not alter mouse cursor shape and visibility. Use if the back-end cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
// [BETA] Docking
ImGuiConfigFlags_DockingEnable=1<<6,// Docking enable flags. Use SHIFT to dock window into another (or without SHIFT if io.ConfigDockingWithKeyMod = false).
// [BETA] Viewports
// [BETA] Viewports
ImGuiConfigFlags_ViewportsEnable=1<<10,// Viewport enable flags (require both ImGuiConfigFlags_PlatformHasViewports + ImGuiConfigFlags_RendererHasViewports set by the respective back-ends)
ImGuiConfigFlags_ViewportsEnable=1<<10,// Viewport enable flags (require both ImGuiConfigFlags_PlatformHasViewports + ImGuiConfigFlags_RendererHasViewports set by the respective back-ends)
ImGuiConfigFlags_ViewportsNoTaskBarIcons=1<<11,// Disable task bars icons for all secondary viewports (will set ImGuiViewportFlags_NoTaskBarIcon on them)
ImGuiConfigFlags_ViewportsNoTaskBarIcons=1<<11,// Disable task bars icons for all secondary viewports (will set ImGuiViewportFlags_NoTaskBarIcon on them)
@ -938,6 +988,13 @@ enum ImGuiCol_
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripActive,
ImGuiCol_ResizeGripActive,
ImGuiCol_Tab,
ImGuiCol_TabHovered,
ImGuiCol_TabActive,
ImGuiCol_TabUnfocused,
ImGuiCol_TabUnfocusedActive,
ImGuiCol_DockingPreview,
ImGuiCol_DockingBg,// Empty node
ImGuiCol_PlotLines,
ImGuiCol_PlotLines,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogram,
@ -1081,6 +1138,7 @@ struct ImGuiStyle
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets).
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets).
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
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).
floatTabBorderSize;// Thickness of border around tabs.
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).
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!
@ -1134,6 +1192,7 @@ struct ImGuiIO
// Miscellaneous configuration options
// Miscellaneous configuration options
boolMouseDrawCursor;// = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by back-end implementations.
boolMouseDrawCursor;// = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by back-end implementations.
boolConfigDockingWithKeyMod;// = true // Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
boolConfigMacOSXBehaviors;// = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63)
boolConfigMacOSXBehaviors;// = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63)
boolConfigInputTextCursorBlink;// = true // Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
boolConfigInputTextCursorBlink;// = true // Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
boolConfigResizeWindowsFromEdges;// = false // [BETA] Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be the ImGuiWindowFlags_ResizeFromAnySide flag)
boolConfigResizeWindowsFromEdges;// = false // [BETA] Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be the ImGuiWindowFlags_ResizeFromAnySide flag)
if(show_app_dockspace)ShowExampleAppDockSpace(&show_app_dockspace);// Process the Docking app first, as explicit DockSpace() needs to be submitted early (read comments near the DockSpace function)
if(show_app_documents)ShowExampleAppDocuments(&show_app_documents);// Process the Document app next, as it may also use a DockSpace()
if(no_close)p_open=NULL;// Don't pass our bool* to Begin
if(no_close)p_open=NULL;// Don't pass our bool* to Begin
// We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming.
// We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming.
ImGui::SameLine();ShowHelpMarker("Toggling this at runtime is normally unsupported (most platform back-ends won't refresh the task bar icon state right away).");
ImGui::SameLine();ShowHelpMarker("Toggling this at runtime is normally unsupported (most platform back-ends won't refresh the task bar icon state right away).");
ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
// Demonstrate using DockSpace() to create an explicit docking spacing within an existing window.
// Note that you already dock windows into each others _without_ a DockSpace() by just holding SHIFT when moving a window.
// DockSpace() is only useful to construct to a central location for your application.
voidShowExampleAppDockSpace(bool*p_open)
{
staticboolopt_fullscreen_persistant=true;
boolopt_fullscreen=opt_fullscreen_persistant;
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into.
// Because 1) it would be confusing to have two docking targets within each others.
// and 2) we want our main DockSpace to always be visible (never hidden within a tab bar): if the DockSpace disappear its child windows will be orphaned.
"You can _always_ dock _any_ window into another by holding the SHIFT key while moving a window. Try it now!""\n"
"This demo app has nothing to do with it!""\n\n"
"This demo app only demonstrate the use of ImGui::DockSpace() which allows you to specify a docking spot _within_ another window. This is useful so you can decorate your main application window (e.g. with a menu bar).""\n\n"
"ImGui::DockSpace() comes with one hard constraint: it needs to be submitted _before_ any window which may be docked into it. Therefore, if you use a dock spot as the central point of your application, you'll probably want it to be part of the very first window you are submitting to imgui every frame.""\n\n"
"(NB: because of this constraint, the implicit \"Debug\" window can not be docked into an explicit DockSpace(), because that window is submitted as part of the NewFrame() call. An easy workaround is that you can create your own implicit \"Debug##2\" window after calling DockSpace() and leave it in the window stack for anyone to use.)"
//if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on.
//if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway..
@ -40,6 +40,9 @@ struct ImGuiColorMod; // Stacked color modifier, backup of modifie
structImGuiColumnData;// Storage data for a single column
structImGuiColumnData;// Storage data for a single column
structImGuiColumnsSet;// Storage data for a columns set
structImGuiColumnsSet;// Storage data for a columns set
structImGuiContext;// Main imgui context
structImGuiContext;// Main imgui context
structImGuiDockContext;// Docking system context
structImGuiDockNode;// Docking system node (hold a list of Windows OR two child dock nodes)
structImGuiDockNodeSettings;// Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
structImGuiGroupData;// Stacked storage data for BeginGroup()/EndGroup()
structImGuiGroupData;// Stacked storage data for BeginGroup()/EndGroup()
structImGuiInputTextState;// Internal state of the currently focused/edited text input box
structImGuiInputTextState;// Internal state of the currently focused/edited text input box
structImGuiItemHoveredDataBackup;// Backup and restore IsItemHovered() internal data
structImGuiItemHoveredDataBackup;// Backup and restore IsItemHovered() internal data
structImGuiPopupRef;// Storage for current popup stack
structImGuiPopupRef;// Storage for current popup stack
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiTabBar;// Storage for a tab bar
structImGuiTabItem;// Storage for a tab item (within a tab bar)
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)
structImGuiWindowSettings;// Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
structImGuiWindowSettings;// Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
@ -88,6 +93,9 @@ namespace ImGuiStb
externIMGUI_APIImGuiContext*GImGui;// Current implicit ImGui context pointer
externIMGUI_APIImGuiContext*GImGui;// Current implicit ImGui context pointer
#endif
#endif
// Internal Drag and Drop payload types. String starting with '_' are reserved for Dear ImGui.
// Helper: ImPool<>. Basic keyed storage for contiguous instances, slow/amortized insertion, O(1) indexable, O(Log N) queries by ID over a dense/hot buffer
// Creation/Erasure invalidate all pointers, but indexes are valid as long as the object lifetime.
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D and maintenance of some patches)
structImVec1
{
floatx;
ImVec1(){x=0.0f;}
ImVec1(float_x){x=_x;}
};
// 2D vector (half-size integer)
structImVec2ih
{
shortx,y;
ImVec2ih(){x=y=0;}
ImVec2ih(short_x,short_y){x=_x;y=_y;}
};
// 2D axis aligned bounding-box
// 2D axis aligned bounding-box
// NB: we can't rely on ImVec2 math operators being available here
// NB: we can't rely on ImVec2 math operators being available here
structIMGUI_APIImRect
structIMGUI_APIImRect
@ -482,19 +536,21 @@ struct ImGuiWindowSettings
{
{
char*Name;
char*Name;
ImGuiIDID;
ImGuiIDID;
ImVec2Pos;// NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
ImVec2Pos;// NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
ImVec2Size;
ImVec2Size;
ImVec2ViewportPos;
ImVec2ViewportPos;
ImGuiIDViewportId;
ImGuiIDViewportId;
ImGuiIDDockId;// ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
shortDockOrder;// Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == ImHash(TypeName, 0, 0)
ImGuiIDTypeHash;// == ImHash(TypeName, 0, 0)
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
@ -635,39 +691,92 @@ struct ImGuiNextWindowData
ImGuiCondFocusCond;
ImGuiCondFocusCond;
ImGuiCondBgAlphaCond;
ImGuiCondBgAlphaCond;
ImGuiCondViewportCond;
ImGuiCondViewportCond;
ImGuiCondDockCond;
ImVec2PosVal;
ImVec2PosVal;
ImVec2PosPivotVal;
ImVec2PosPivotVal;
ImVec2SizeVal;
ImVec2SizeVal;
ImVec2ContentSizeVal;
ImVec2ContentSizeVal;
boolPosUndock;
boolCollapsedVal;
boolCollapsedVal;
ImRectSizeConstraintRect;
ImRectSizeConstraintRect;
ImGuiSizeCallbackSizeCallback;
ImGuiSizeCallbackSizeCallback;
void*SizeCallbackUserData;
void*SizeCallbackUserData;
floatBgAlphaVal;
floatBgAlphaVal;
ImGuiIDViewportId;
ImGuiIDViewportId;
ImGuiIDDockId;
ImVec2MenuBarOffsetMinVal;// This is not exposed publicly, so we don't clear it.
ImVec2MenuBarOffsetMinVal;// This is not exposed publicly, so we don't clear it.
// Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow.
// Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow.
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
@ -1086,6 +1197,7 @@ struct IMGUI_API ImGuiWindow
ImGuiCondSetWindowPosAllowFlags;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowPosAllowFlags;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowSizeAllowFlags;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowSizeAllowFlags;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowCollapsedAllowFlags;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImGuiCondSetWindowCollapsedAllowFlags;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImGuiCondSetWindowDockAllowFlags;// store acceptable condition flags for SetNextWindowDock() use.
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
@ -1108,6 +1220,7 @@ struct IMGUI_API ImGuiWindow
ImDrawListDrawListInst;
ImDrawListDrawListInst;
ImGuiWindow*ParentWindow;// If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
ImGuiWindow*ParentWindow;// If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window.
ImGuiWindow*RootWindowDockStop;// Point to ourself or first ancestor that is not a child window. Doesn't cross through dock nodes. We use this so IsWindowFocused() can behave consistently regardless of docking state.
ImGuiWindow*RootWindowForTitleBarHighlight;// Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
ImGuiWindow*RootWindowForTitleBarHighlight;// Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
intFocusIdxAllRequestNext;// Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
intFocusIdxAllRequestNext;// Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
intFocusIdxTabRequestNext;// "
intFocusIdxTabRequestNext;// "
// Docking
ImGuiDockNode*DockNode;// Which node are we docked into
ImGuiDockNode*DockNodeAsHost;// Which node are we owning (for parent windows)
ImGuiIDDockId;// Backup of last valid DockNode->Id, so single value remember their dock node id
ImGuiItemStatusFlagsDockTabItemStatusFlags;
ImRectDockTabItemRect;
shortDockOrder;// Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
ImGuiTabBarFlags_DockNode=1<<20,// Part of a dock node
ImGuiTabBarFlags_DockNodeExplicitRoot=1<<21,// Part of an explicit dock node
ImGuiTabBarFlags_IsFocused=1<<22,
ImGuiTabBarFlags_SaveSettings=1<<23// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
};
enumImGuiTabItemFlagsPrivate_
{
ImGuiTabItemFlags_DockedWindow=1<<20,
ImGuiTabItemFlags_Preview=1<<21
};
// Storage for one active tab item (sizeof() 32~40 bytes)
structImGuiTabItem
{
ImGuiIDID;
ImGuiTabItemFlagsFlags;
ImGuiWindow*Window;// When TabItem is part of a DockNode's TabBar, we hold on to a window.
intLastFrameVisible;
intLastFrameSelected;// This allows us to infer an ordered list of the last activated tabs with little maintenance
floatOffset;// Position relative to beginning of tab
floatWidth;// Width currently displayed
floatWidthContents;// Width of actual contents, stored during BeginTabItem() call
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
// Restore the last visible height if no tab is visible, this reduce vertical flicker/movement when a tabs gets removed without calling SetTabItemClosed().
// Refresh tab width immediately if we can (for manual tab bar, WidthContent will lag by one frame which is mostly noticeable when changing style.FramePadding.x)
// Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet,
// and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.
floatmargin=g.FontSize*1.0f;// When to scroll to make Tab N+1 visible always make a bit of N visible to suggest more scrolling area (since we don't have a scrollbar)
tab_to_select=&tab_bar->Tabs[(target_order>=0&&target_order<tab_bar->Tabs.Size)?target_order:selected_order];// If we are at the end of the list, still scroll to make our tab visible
// If the user called us with *p_open == false, we early out and don't render. We make a dummy call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID.
// We don't have CPU clipping primitives to clip the CloseButton (until it becomes a texture), so need to add an extra draw call (temporary in the case of vertical animation)
if(pressed||((flags&ImGuiTabItemFlags_SetSelected)&&!tab_contents_visible))// SetSelected can only be passed on explicit tab bar, so we don't need to set WantFocusTabId
tab_bar->NextSelectedTabId=id;
// Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered)
// While rendering tabs, we trim 1 pixel off the top of our bounding box so they can fit within a regular frame height while looking "detached" from it.
// We are relying on a subtle and confusing distinction between 'hovered' and 'g.HoveredId' which happens because we are using ImGuiButtonFlags_AllowOverlapMode + SetItemAllowOverlap()
// 'hovered' will be true when hovering the Tab but NOT when hovering the close button
// 'g.HoveredId==id' will be true when hovering the Tab including when hovering the close button
// 'g.ActiveId==close_button_id' will be true when we are holding on the close button, in which case both hovered booleans are false