// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
#ifndef IMGUI_API
@ -72,6 +73,7 @@ struct ImGuiTextEditCallbackData; // Shared state of ImGui::InputText() when u
structImGuiSizeCallbackData;// Structure used to constraint window size in custom ways when using custom ImGuiSizeCallback (rare/advanced use)
structImGuiListClipper;// Helper to manually clip large list of items
structImGuiPayload;// User data payload for drag and drop operations
structImGuiViewport;// Viewport (generally ~1 per window to output to at the OS level. Need per-platform support to use multiple viewports)
structImGuiContext;// ImGui context (opaque)
// Typedefs and Enumerations (declared as int for compatibility and to not pollute the top of this file)
@ -90,6 +92,7 @@ typedef int ImDrawListFlags; // flags: for ImDrawList
typedefintImFontAtlasFlags;// flags: for ImFontAtlas // enum ImFontAtlasFlags_
typedefintImGuiColorEditFlags;// flags: for ColorEdit*(), ColorPicker*() // enum ImGuiColorEditFlags_
typedefintImGuiColumnsFlags;// flags: for *Columns*() // enum ImGuiColumnsFlags_
typedefintImGuiConfigFlags;// flags: for io.ConfigFlags // enum ImGuiConfigFlags_
typedefintImGuiDragDropFlags;// flags: for *DragDrop*() // enum ImGuiDragDropFlags_
typedefintImGuiComboFlags;// flags: for BeginCombo() // enum ImGuiComboFlags_
typedefintImGuiFocusedFlags;// flags: for IsWindowFocused() // enum ImGuiFocusedFlags_
@ -150,6 +153,7 @@ namespace ImGui
IMGUI_APIvoidNewFrame();// start a new ImGui frame, you can submit any command from this point until Render()/EndFrame().
IMGUI_APIvoidRender();// ends the ImGui frame, finalize the draw data. (Obsolete: optionally call io.RenderDrawListsFn if set. Nowadays, prefer calling your render function yourself.)
IMGUI_APIImDrawData*GetDrawData();// valid after Render() and until the next call to NewFrame(). this is what you have to render. (Obsolete: this used to be passed to your io.RenderDrawListsFn() function.)
IMGUI_APIImDrawData*GetDrawDataForViewport(ImGuiIDviewport_id);// ImDrawData filtered to hold only the ImDrawList covering a given viewport. valid after Render() and until the next call to NewFrame()
IMGUI_APIvoidEndFrame();// ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead!
// Demo, Debug, Informations
@ -259,8 +263,8 @@ namespace ImGui
IMGUI_APIvoidSetCursorPosX(floatx);// "
IMGUI_APIvoidSetCursorPosY(floaty);// "
IMGUI_APIImVec2GetCursorStartPos();// initial cursor position
IMGUI_APIImVec2GetCursorScreenPos();// cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API)
IMGUI_APIvoidSetCursorScreenPos(constImVec2&pos);// cursor position in absolute screen coordinates [0..io.DisplaySize]
IMGUI_APIImVec2GetCursorScreenPos();// cursor position in screen coordinates [0..io.DisplaySize] (or [io.ViewportPos..io.ViewportPos + io.ViewportSize] when using multiple viewport). useful to work with ImDrawList API.
IMGUI_APIvoidSetCursorScreenPos(constImVec2&pos);// cursor position in screen coordinates [0..io.DisplaySize] (or [io.ViewportPos..io.ViewportPos + io.ViewportSize] when using multiple viewport)
IMGUI_APIvoidAlignTextToFramePadding();// vertically align/lower upcoming text to FramePadding.y so that it will aligns to upcoming widgets (call if you have text on a line before regular widgets)
IMGUI_APIfloatGetTextLineHeight();// ~ FontSize
IMGUI_APIfloatGetTextLineHeightWithSpacing();// ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
@ -527,6 +531,10 @@ namespace ImGui
// Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard)
IMGUI_APIconstchar*GetClipboardText();
IMGUI_APIvoidSetClipboardText(constchar*text);
// Additional OS/Platform Windows (when ImGuiConfigFlags_MultiViewports is set)
// All those functions are not reliant on the current context.
@ -568,7 +576,8 @@ enum ImGuiWindowFlags_
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_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_FullViewport=1<<29// Don't use! For internal use by Begin() and viewports.
};
// Flags for ImGui::InputText()
@ -904,6 +913,46 @@ enum ImGuiCond_
#endif
};
// [BETA] Configuration flags, mostly setup by imgui back-end, stored in io.ConfigFlags
enumImGuiConfigFlags_
{
ImGuiConfigFlags_MultiViewports=1<<0,// User enable multiple viewports (require io.PlatformInterface + io.RendererInterface)
ImGuiConfigFlags_PlatformHasMouseHoveredViewport=1<<1,// Back-end knows how to set io.MouseHoveredViewport to the viewport directly under the mouse _IGNORING_ viewports with the ImGuiViewportFlags_NoInputs flag and _REGARDLESS_ of whether another viewport is focused and may have mouse capture. This info is not easy to provide correctly with most high-level engines.
ImGuiConfigFlags_PlatformHasWantMoveMouseSupport=1<<2,// Back-end honors io.WantMoveMouse request by updating the OS mouse cursor position (currently only used by ImGuiNavFlags_MoveMouse feature, will be useful for widgets teleporting/wrapping the cursor)
ImGuiConfigFlags_PlatformHasWindowAlpha=1<<3,// Back-end can have transparent windows
ImGuiConfigFlags_IsSRGB=1<<10,// Back-end is SRGB-aware (Storage flag to allow your back-end to communicate to shared widgets. Not used by core ImGui)
ImGuiConfigFlags_IsTouchScreen=1<<11,// Back-end is using a touch screen instead of a mouse (Storage flag to allow your back-end to communicate to shared widgets. Not used by core ImGui)
ImGuiConfigFlags_IsOnScreenKeyboard=1<<12// Back-end uses an on-screen keyboard when io.WantTextInput is set.
};
// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_EnableMultiViewport) is enabled
void(*RenderDrawData)(ImDrawData*draw_data);// Render a ImDrawList (collection of ImDrawList) for the area covering (io.DisplayPos) to (io.DisplayPos + io.DisplaySize)
// You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
// During the frame, prefer using ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
ImVec2DisplaySize;// <unset> // Display size, in pixels. For clamping windows positions.
ImVec2DisplaySize;// <unset> // Main display size. Used e.g. to clamp windows positions. This is the default viewport. Use BeginViewport() for other viewports.
floatDeltaTime;// = 1.0f/60.0f // Time elapsed since last frame, in seconds.
ImGuiConfigFlagsConfigFlags;// = 0 // Set ImGuiConfigFlags_. Features/options flags for ImGui back-ends.
ImGuiNavFlagsNavFlags;// = 0x00 // See ImGuiNavFlags_. Gamepad/keyboard navigation options.
floatIniSavingRate;// = 5.0f // Maximum time between saving positions/sizes to .ini file, in seconds.
constchar*IniFilename;// = "imgui.ini" // Path to .ini file. NULL to disable .ini saving.
// Optional: platform interface to use multiple viewports
ImGuiPlatformInterfacePlatformInterface;
ImGuiRendererInterfaceRendererInterface;
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
// (default to use native imm32 api on Windows)
void(*ImeSetInputScreenPosFn)(intx,inty);
@ -1004,6 +1058,8 @@ struct ImGuiIO
boolMouseDown[5];// Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
floatMouseWheel;// Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
floatMouseWheelH;// Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends.
ImGuiIDMousePosViewport;// (Optional) When using multiple viewports: viewport from which io.MousePos is based from (when dragging this is generally the captured/focused viewport, even though we can drag outside of it and then it's not hovered anymore). (0 == default viewport)
ImGuiIDMouseHoveredViewport;// (Optional) When using multiple viewports: viewport the OS mouse cursor is hovering. (0 == default viewport)
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
ImVec2DisplayPos;// Always ImVec2(0,0) for now. (In upcoming multiple viewports branch, this will be repositioned by API on a per-viewport basis). The display area goes from DisplayPos to DisplayPos+DisplaySize.
ImVec2DisplayPos;// Generally ImVec2(0,0). When using multiple viewports this can be repositioned by imgui. The display area goes from DisplayPos to DisplayPos+DisplaySize.
boolWantCaptureMouse;// When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application. This is set by ImGui when it wants to use your mouse (e.g. unclicked mouse is hovering a window, or a widget is active).
boolWantCaptureKeyboard;// When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application. This is set by ImGui when it wants to use your keyboard inputs.
boolWantTextInput;// Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
@ -1079,7 +1135,7 @@ namespace ImGui
boolBegin(constchar*name,bool*p_open,constImVec2&size_on_first_use,floatbg_alpha_override=-1.0f,ImGuiWindowFlagsflags=0);// Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead.
staticinlinevoidSetNextWindowPosCenter(ImGuiCondc=0){ImGuiIO&io=GetIO();SetNextWindowPos(ImVec2(io.DisplayPos.x+io.DisplaySize.x*0.5f,io.DisplayPos.y+io.DisplaySize.y*0.5f),c,ImVec2(0.5f,0.5f));}// FIXME-VIEWPORT: Select viewport based on mouse position
// OBSOLETED in 1.51 (between Jun 2017 and Aug 2017)
staticinlineboolIsPosHoveringAnyWindow(constImVec2&){IM_ASSERT(0);returnfalse;}// This was misleading and partly broken. You probably want to use the ImGui::GetIO().WantCaptureMouse flag instead.
voidClipWith(constImRect&r){Min=ImMax(Min,r.Min);Max=ImMin(Max,r.Max);}// Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
voidClipWithFull(constImRect&r){Min=ImClamp(Min,r.Min,r.Max);Max=ImClamp(Max,r.Min,r.Max);}// Full version, ensure both points are fully clipped.
ImGuiWindowFlagsFlags;// See enum ImGuiWindowFlags_
ImGuiWindowFlagsFlags,FlagsPreviousFrame;// See enum ImGuiWindowFlags_
ImGuiViewport*Viewport;// Always set in Begin(), only inactive windows may have a NULL value here
ImGuiIDViewportId;// Inactive windows preserve their last viewport id (since the viewport may disappear with the window inactivity)
ImVec2ViewportOsDesktopPos;
ImVec2PosFloat;
ImVec2Pos;// Position rounded-up to nearest pixel
ImVec2Size;// Current size (==SizeFull or collapsed title bar size)
@ -1032,6 +1085,15 @@ namespace ImGui
IMGUI_APIvoidInitialize(ImGuiContext*context);
IMGUI_APIvoidShutdown(ImGuiContext*context);// Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
// Viewports
IMGUI_APIImGuiViewport*Viewport(ImGuiIDid,ImGuiViewportFlagsflags,constImVec2&os_desktop_pos,constImVec2&size);// os_desktop_pos allows imgui to reposition windows relative to each order when moving from one viewport to the other.