|
|
@@ -251,8 +251,7 @@ enum ImGuiSelectableFlagsPrivate_
|
|
|
ImGuiSelectableFlags_NoHoldingActiveID = 1 << 10,
|
|
|
ImGuiSelectableFlags_PressedOnClick = 1 << 11,
|
|
|
ImGuiSelectableFlags_PressedOnRelease = 1 << 12,
|
|
|
- ImGuiSelectableFlags_Disabled = 1 << 13,
|
|
|
- ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 14
|
|
|
+ ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 13
|
|
|
};
|
|
|
|
|
|
enum ImGuiSeparatorFlags_
|
|
|
@@ -313,6 +312,7 @@ enum ImGuiInputReadMode
|
|
|
|
|
|
enum ImGuiNavHighlightFlags_
|
|
|
{
|
|
|
+ ImGuiNavHighlightFlags_None = 0,
|
|
|
ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
|
|
|
ImGuiNavHighlightFlags_TypeThin = 1 << 1,
|
|
|
ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2,
|
|
|
@@ -321,6 +321,7 @@ enum ImGuiNavHighlightFlags_
|
|
|
|
|
|
enum ImGuiNavDirSourceFlags_
|
|
|
{
|
|
|
+ ImGuiNavDirSourceFlags_None = 0,
|
|
|
ImGuiNavDirSourceFlags_Keyboard = 1 << 0,
|
|
|
ImGuiNavDirSourceFlags_PadDPad = 1 << 1,
|
|
|
ImGuiNavDirSourceFlags_PadLStick = 1 << 2
|
|
|
@@ -328,6 +329,7 @@ enum ImGuiNavDirSourceFlags_
|
|
|
|
|
|
enum ImGuiNavMoveFlags_
|
|
|
{
|
|
|
+ ImGuiNavMoveFlags_None = 0,
|
|
|
ImGuiNavMoveFlags_LoopX = 1 << 0, // On failed request, restart from opposite side
|
|
|
ImGuiNavMoveFlags_LoopY = 1 << 1,
|
|
|
ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
|
|
|
@@ -608,6 +610,7 @@ struct ImGuiNextWindowData
|
|
|
struct ImGuiContext
|
|
|
{
|
|
|
bool Initialized;
|
|
|
+ bool FrameScopeActive; // Set by NewFrame(), cleared by EndFrame()/Render()
|
|
|
bool FontAtlasOwnedByContext; // Io.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
|
|
|
ImGuiIO IO;
|
|
|
ImGuiStyle Style;
|
|
|
@@ -672,8 +675,9 @@ struct ImGuiContext
|
|
|
ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
|
|
|
int NavScoringCount; // Metrics for debugging
|
|
|
ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
|
|
|
+ ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f
|
|
|
ImGuiWindow* NavWindowingList;
|
|
|
- float NavWindowingHighlightTimer;
|
|
|
+ float NavWindowingTimer;
|
|
|
float NavWindowingHighlightAlpha;
|
|
|
bool NavWindowingToggleLayer;
|
|
|
int NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
|
|
|
@@ -708,6 +712,7 @@ struct ImGuiContext
|
|
|
bool DragDropActive;
|
|
|
bool DragDropWithinSourceOrTarget;
|
|
|
ImGuiDragDropFlags DragDropSourceFlags;
|
|
|
+ int DragDropSourceFrameCount;
|
|
|
int DragDropMouseButton;
|
|
|
ImGuiPayload DragDropPayload;
|
|
|
ImRect DragDropTargetRect;
|
|
|
@@ -760,6 +765,7 @@ struct ImGuiContext
|
|
|
ImGuiContext(ImFontAtlas* shared_font_atlas) : OverlayDrawList(NULL)
|
|
|
{
|
|
|
Initialized = false;
|
|
|
+ FrameScopeActive = false;
|
|
|
Font = NULL;
|
|
|
FontSize = FontBaseSize = 0.0f;
|
|
|
FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
|
|
@@ -801,8 +807,8 @@ struct ImGuiContext
|
|
|
NavInputSource = ImGuiInputSource_None;
|
|
|
NavScoringRectScreen = ImRect();
|
|
|
NavScoringCount = 0;
|
|
|
- NavWindowingTarget = NavWindowingList = NULL;
|
|
|
- NavWindowingHighlightTimer = NavWindowingHighlightAlpha = 0.0f;
|
|
|
+ NavWindowingTarget = NavWindowingTargetAnim = NavWindowingList = NULL;
|
|
|
+ NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
|
|
|
NavWindowingToggleLayer = false;
|
|
|
NavLayer = 0;
|
|
|
NavIdTabCounter = INT_MAX;
|
|
|
@@ -827,6 +833,7 @@ struct ImGuiContext
|
|
|
|
|
|
DragDropActive = DragDropWithinSourceOrTarget = false;
|
|
|
DragDropSourceFlags = 0;
|
|
|
+ DragDropSourceFrameCount = -1;
|
|
|
DragDropMouseButton = -1;
|
|
|
DragDropTargetId = 0;
|
|
|
DragDropAcceptFlags = 0;
|
|
|
@@ -978,9 +985,10 @@ struct IMGUI_API ImGuiWindow
|
|
|
bool WasActive;
|
|
|
bool WriteAccessed; // Set to true when any widget access the current window
|
|
|
bool Collapsed; // Set when collapsing window to become only title-bar
|
|
|
- bool CollapseToggleWanted;
|
|
|
+ bool WantCollapseToggle;
|
|
|
bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed)
|
|
|
bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
|
|
|
+ bool Hidden; // Do not display (== (HiddenFramesForResize > 0) ||
|
|
|
bool HasCloseButton; // Set when the window has a close button (p_open != NULL)
|
|
|
int BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0.
|
|
|
int BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues.
|
|
|
@@ -990,7 +998,8 @@ struct IMGUI_API ImGuiWindow
|
|
|
bool AutoFitOnlyGrows;
|
|
|
int AutoFitChildAxises;
|
|
|
ImGuiDir AutoPosLastDirection;
|
|
|
- int HiddenFrames;
|
|
|
+ int HiddenFramesRegular; // Hide the window for N frames
|
|
|
+ int HiddenFramesForResize; // Hide the window for N frames while allowing items to be submitted so we can measure their size
|
|
|
ImGuiCond SetWindowPosAllowFlags; // store acceptable condition flags for SetNextWindowPos() use.
|
|
|
ImGuiCond SetWindowSizeAllowFlags; // store acceptable condition flags for SetNextWindowSize() use.
|
|
|
ImGuiCond SetWindowCollapsedAllowFlags; // store acceptable condition flags for SetNextWindowCollapsed() use.
|
|
|
@@ -1038,6 +1047,7 @@ public:
|
|
|
ImGuiID GetID(const char* str, const char* str_end = NULL);
|
|
|
ImGuiID GetID(const void* ptr);
|
|
|
ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL);
|
|
|
+ ImGuiID GetIDNoKeepAlive(const void* ptr);
|
|
|
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
|
|
|
|
|
|
// We don't use g.FontSize because the window may be != g.CurrentWidow.
|
|
|
@@ -1079,24 +1089,28 @@ namespace ImGui
|
|
|
IMGUI_API void FocusWindow(ImGuiWindow* window);
|
|
|
IMGUI_API void BringWindowToFront(ImGuiWindow* window);
|
|
|
IMGUI_API void BringWindowToBack(ImGuiWindow* window);
|
|
|
+ IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);
|
|
|
IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
|
|
|
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);
|
|
|
-
|
|
|
IMGUI_API void SetCurrentFont(ImFont* font);
|
|
|
inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
|
|
|
|
|
|
+ // Init
|
|
|
IMGUI_API void Initialize(ImGuiContext* context);
|
|
|
IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
|
|
|
|
|
|
+ // NewFrame
|
|
|
IMGUI_API void UpdateHoveredWindowAndCaptureFlags();
|
|
|
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
|
|
|
IMGUI_API void UpdateMouseMovingWindow();
|
|
|
|
|
|
+ // Settings
|
|
|
IMGUI_API void MarkIniSettingsDirty();
|
|
|
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
|
|
|
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
|
|
|
IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id);
|
|
|
|
|
|
+ // Basic Accessors
|
|
|
inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.CurrentWindow->DC.LastItemId; }
|
|
|
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
|
|
inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; }
|
|
|
@@ -1108,6 +1122,7 @@ namespace ImGui
|
|
|
IMGUI_API void KeepAliveID(ImGuiID id);
|
|
|
IMGUI_API void MarkItemValueChanged(ImGuiID id);
|
|
|
|
|
|
+ // Basic Helpers for widget code
|
|
|
IMGUI_API void ItemSize(const ImVec2& size, float text_offset_y = 0.0f);
|
|
|
IMGUI_API void ItemSize(const ImRect& bb, float text_offset_y = 0.0f);
|
|
|
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL);
|
|
|
@@ -1121,6 +1136,7 @@ namespace ImGui
|
|
|
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
|
|
|
IMGUI_API void PopItemFlag();
|
|
|
|
|
|
+ // Popups, Modals, Tooltips
|
|
|
IMGUI_API void OpenPopupEx(ImGuiID id);
|
|
|
IMGUI_API void ClosePopup(ImGuiID id);
|
|
|
IMGUI_API void ClosePopupToLevel(int remaining);
|
|
|
@@ -1130,31 +1146,29 @@ namespace ImGui
|
|
|
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true);
|
|
|
IMGUI_API ImGuiWindow* GetFrontMostPopupModal();
|
|
|
|
|
|
+ // Navigation
|
|
|
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
|
|
|
IMGUI_API void NavMoveRequestCancel();
|
|
|
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect& bb_rel, ImGuiNavMoveFlags move_flags);
|
|
|
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
|
|
|
- IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
|
|
|
-
|
|
|
IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode);
|
|
|
IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f);
|
|
|
IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate);
|
|
|
-
|
|
|
- IMGUI_API void Scrollbar(ImGuiLayoutType direction);
|
|
|
- IMGUI_API void VerticalSeparator(); // Vertical separator, for menu bars (use current line height). not exposed because it is misleading what it doesn't have an effect on regular layout.
|
|
|
- IMGUI_API bool SplitterBehavior(ImGuiID id, const ImRect& bb, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f);
|
|
|
-
|
|
|
+ IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
|
|
|
+
|
|
|
+ // Drag and Drop
|
|
|
IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);
|
|
|
IMGUI_API void ClearDragDrop();
|
|
|
IMGUI_API bool IsDragDropPayloadBeingAccepted();
|
|
|
|
|
|
- // FIXME-WIP: New Columns API
|
|
|
+ // New Columns API (FIXME-WIP)
|
|
|
IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiColumnsFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
|
|
|
IMGUI_API void EndColumns(); // close columns
|
|
|
IMGUI_API void PushColumnClipRect(int column_index = -1);
|
|
|
|
|
|
- // NB: All position are in absolute pixels coordinates (never using window coordinates internally)
|
|
|
+ // Render helpers
|
|
|
// 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)
|
|
|
IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
|
|
|
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
|
|
|
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0,0), const ImRect* clip_rect = NULL);
|
|
|
@@ -1165,16 +1179,29 @@ namespace ImGui
|
|
|
IMGUI_API void RenderBullet(ImVec2 pos);
|
|
|
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col, float sz);
|
|
|
IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight
|
|
|
- IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
|
|
|
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
|
|
|
|
|
|
- IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
|
|
|
+ // Render helpers (those functions don't access any ImGui state!)
|
|
|
+ IMGUI_API void RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor = ImGuiMouseCursor_Arrow);
|
|
|
+ IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
|
|
|
+ IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
|
|
|
+
|
|
|
+ // Widgets
|
|
|
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0,0), ImGuiButtonFlags flags = 0);
|
|
|
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos, float radius);
|
|
|
+ IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos);
|
|
|
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags);
|
|
|
+ IMGUI_API void Scrollbar(ImGuiLayoutType direction);
|
|
|
+ IMGUI_API void VerticalSeparator(); // Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout.
|
|
|
|
|
|
+ // Widgets low-level behaviors
|
|
|
+ IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
|
|
|
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power);
|
|
|
IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power, ImGuiSliderFlags flags = 0);
|
|
|
+ IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f);
|
|
|
+ IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
|
|
|
+ IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
|
|
|
+ IMGUI_API void TreePushRawID(ImGuiID id);
|
|
|
|
|
|
IMGUI_API bool InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
|
|
|
IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* data_ptr, const char* format);
|
|
|
@@ -1182,15 +1209,11 @@ namespace ImGui
|
|
|
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
|
|
|
IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags);
|
|
|
|
|
|
- IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
|
|
|
- IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
|
|
|
- IMGUI_API void TreePushRawID(ImGuiID id);
|
|
|
-
|
|
|
IMGUI_API void PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size);
|
|
|
|
|
|
// Shade functions (write over already created vertices)
|
|
|
- IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawVert* vert_start, ImDrawVert* vert_end, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
|
|
|
- IMGUI_API void ShadeVertsLinearUV(ImDrawVert* vert_start, ImDrawVert* vert_end, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
|
|
|
+ IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
|
|
|
+ IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
|
|
|
|
|
|
} // namespace ImGui
|
|
|
|