Lines Matching +full:dozen +full:- +full:test +full:- +full:rules
7 // Releases change-log at https://github.com/ocornut/imgui/releases
8 // Technical Support for Getting Started https://discourse.dearimgui.org/c/getting-started
29 - MISSION STATEMENT
30 - END-USER GUIDE
31 - PROGRAMMER GUIDE (read me!)
32 - Read first.
33 - How to update to a newer version of Dear ImGui.
34 - Getting started with integrating Dear ImGui in your code/engine.
35 - This is how a simple application may look like (2 variations).
36 - This is how a simple rendering function may look like.
37 - Using gamepad/keyboard navigation controls.
38 - API BREAKING CHANGES (read me when you update!)
39 - FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
40 - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
41 - How can I display an image? What is ImTextureID, how does it works?
42 …- How can I have multiple widgets with the same label or with an empty label? A primer on labels a…
43 - How can I use my own math types instead of ImVec2/ImVec4?
44 - How can I load a different font than the default?
45 - How can I easily use icons in my application?
46 - How can I load multiple fonts?
47 - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
48 - How can I interact with standard C++ types (such as std::string and std::vector)?
49 - How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
50 …- How can I use Dear ImGui on a platform that doesn't have a mouse or a keyboard? (input share, re…
51 - I integrated Dear ImGui in my engine and the text or lines are blurry..
52 …- I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move …
53 - How can I help?
82 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
91 - Easy to use to create code-driven and data-driven tools.
92 - Easy to use to create ad hoc short-lived tools and long-lived, more elaborate tools.
93 - Easy to hack and improve.
94 - Minimize screen real-estate usage.
95 - Minimize setup and maintenance.
96 - Minimize state storage on user side.
97 - Portable, minimize dependencies, run on target (consoles, phones, etc.).
98 …- Efficient runtime and memory consumption (NB- we do allocate when "growing" content e.g. creatin…
101 …Designed for developers and content-creators, not the typical end-user! Some of the weaknesses inc…
102 - Doesn't look fancy, doesn't animate.
103 - Limited layout features, intricate layouts are typically crafted in code.
106 END-USER GUIDE
109 - Double-click on title bar to collapse window.
110 …- Click upper right corner to close a window, available when 'bool* p_open' is passed to ImGui::Be…
111 …- Click and drag on lower right corner to resize window (double-click to auto fit window to its co…
112 - Click and drag on any empty space to move window.
113 - TAB/SHIFT+TAB to cycle through keyboard editable fields.
114 - CTRL+Click on a slider or drag box to input value as text.
115 - Use mouse wheel to scroll.
116 - Text editor:
117 - Hold SHIFT or use mouse to select text.
118 - CTRL+Left/Right to word jump.
119 - CTRL+Shift+Left/Right to select words.
120 - CTRL+A our Double-Click to select all.
121 - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/
122 - CTRL+Z,CTRL+Y to undo/redo.
123 - ESCAPE to revert text to its original value.
124 …- You can apply arithmetic operators +,*,/ on numerical values. Use +- to subtract (because - woul…
125 - Controls are automatically adjusted for OSX to match standard OSX text editing operations.
126 - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard.
127 …- General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. See suggested mappings …
135 - Read the FAQ below this section!
136 …- Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic,…
138 - Call and read ImGui::ShowDemoWindow() for demo code demonstrating most features.
139 …- The library is designed to be built from sources. Avoid pre-compiled binaries and packaged versi…
140 …- Dear ImGui is an implementation of the IMGUI paradigm (immediate-mode graphical user interface, …
142 …- Dear ImGui is a "single pass" rasterizing implementation of the IMGUI paradigm, aimed at ease of…
145 …- Our origin are on the top-left. In axis aligned bounding boxes, Min = top-left, Max = bottom-rig…
146 …- This codebase is also optimized to yield decent performances with typical "Debug" builds setting…
147 …- Please make sure you have asserts enabled (IM_ASSERT redirects to assert() by default, but can b…
149 …- C++: this is a very C-ish codebase: we don't rely on C++11, we don't include any C++ headers, an…
150 …- C++: ImVec2/ImVec4 do not expose math operators by default, because it is expected that you use …
153 …- C++: pay attention that ImVector<> manipulates plain-old-data and does not honor construction/de…
157 …- Overwrite all the sources files except for imconfig.h (if you have made modification to your cop…
158 - Or maintain your own branch where you have imconfig.h modified.
159 …- Read the "API BREAKING CHANGES" section (below). This is where we list occasional API breaking c…
163 - Try to keep your copy of dear imgui reasonably up to date.
167 - Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
168 - Add the Dear ImGui source files to your projects or using your preferred build system.
170 …- You can later customize the imconfig.h file to tweak some compile-time behavior, such as integra…
171 …- When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables,…
172 …- Dear ImGui never touches or knows about your GPU state. The only function that knows about GPU i…
174 …phases of your own application. All rendering informatioe are stored into command-lists that you w…
175 …- Refer to the bindings and demo applications in the examples/ folder for instruction on how to se…
176 …- If you are running over a standard OS with a common graphics API, you should be able to use unmo…
206 g_pSwapChain->Present(1, 0);
228 io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
231 …exture, store its pointer/identifier (_in whichever format your engine uses_) in 'io.Fonts->TexID'.
234 io.Fonts->TexID = (void*)texture;
239 …// Setup low-level inputs, e.g. on Win32: calling GetKeyboardState(), or write to those fields fro…
273 …// TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor en…
274 …// TODO: Setup viewport covering draw_data->DisplayPos to draw_data->DisplayPos + draw_data->Displ…
275 …etup orthographic projection matrix cover draw_data->DisplayPos to draw_data->DisplayPos + draw_da…
277 for (int n = 0; n < draw_data->CmdListsCount; n++)
279 const ImDrawList* cmd_list = draw_data->CmdLists[n];
280 … const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; // vertex buffer generated by ImGui
281 … const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; // index buffer generated by ImGui
282 for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
284 const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
285 if (pcmd->UserCallback)
287 pcmd->UserCallback(cmd_list, pcmd);
291 // The texture for the draw call is specified by pcmd->TextureId.
293 MyEngineBindTexture((MyTexture*)pcmd->TextureId);
295 … // We are using scissoring to clip some objects. All low-level graphics API should supports it.
296 …// - If your engine doesn't support scissoring yet, you may ignore this at first. You will get som…
298 …// - Clipping coordinates are provided in imgui coordinates space (from draw_data->DisplayPos to d…
299 …// In a single viewport application, draw_data->DisplayPos will always be (0,0) and draw_data->D…
300 …// However, in the interest of supporting multi-viewport applications in the future (see 'viewpo…
301 …// always subtract draw_data->DisplayPos from clipping bounds to convert them to your viewport s…
302 …// - Note that pcmd->ClipRect contains Min+Max bounds. Some graphics API may use Min+Max, other ma…
303 ImVec2 pos = draw_data->DisplayPos;
304 …neScissor((int)(pcmd->ClipRect.x - pos.x), (int)(pcmd->ClipRect.y - pos.y), (int)(pcmd->ClipRect.z…
306 // Render 'pcmd->ElemCount/3' indexed triangles.
307 …ault the indices ImDrawIdx are 16-bits, you can change them to 32-bits in imconfig.h if your engin…
308 …MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSI…
310 idx_buffer += pcmd->ElemCount;
315 - The examples/ folders contains many actual implementation of the pseudo-codes above.
316 …- When calling NewFrame(), the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInp…
319 …- Please read the FAQ below!. Amusingly, it is called a FAQ because people frequently run into the…
323 - The gamepad/keyboard navigation is fairly functional and keeps being improved.
324 …- Gamepad support is particularly useful to use dear imgui on a console system (e.g. PS4, Switch, …
325 - You can ask questions and report issues at https://github.com/ocornut/imgui/issues/787
326 …- The initial focus was to support game controllers, but keyboard is becoming increasingly and dec…
327 - Gamepad:
328 - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
329 …- Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields be…
331 …- See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. For each entry of io.NavInputs…
333 - We uses a simple >0.0f test for activation testing, and won't attempt to test for a dead-zone.
335 …- You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://…
336 …- If you need to share inputs between your game and the imgui parts, the easiest approach is to go…
338 - Keyboard:
339 - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
341 …- When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.W…
343 …- io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs…
344 …- io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is …
345 …- or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused…
347 - Mouse:
348 …- PS4 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick a…
349 …- Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on y…
350 …- On a TV/console system where readability may be lower or mouse inputs may be awkward, you may wa…
353 …When that happens your back-end NEEDS to move the OS or underlying mouse cursor on the next frame.…
363 …Below is a change-log of API breaking changes only. If you are using one of the functions listed, …
367 …- 2019/02/14 (1.68) - made it illegal/assert when io.DisplayTime == 0.0f (with an exception for th…
368 …- 2019/02/01 (1.68) - removed io.DisplayVisibleMin/DisplayVisibleMax (which were marked obsolete a…
369 …- 2019/01/06 (1.67) - renamed io.InputCharacters[], marked internal as was always intended. Please…
370 …- 2019/01/06 (1.67) - renamed ImFontAtlas::GlyphRangesBuilder to ImFontGlyphRangesBuilder. Keep re…
371 …- 2018/12/20 (1.67) - made it illegal to call Begin("") with an empty string. This somehow half-wo…
372 …- 2018/12/10 (1.67) - renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges a…
373 …- 2018/10/12 (1.66) - renamed misc/stl/imgui_stl.* to misc/cpp/imgui_stdlib.* in prevision for oth…
374 …- 2018/09/28 (1.66) - renamed SetScrollHere() to SetScrollHereY(). Kept redirection function (will…
375 …- 2018/09/06 (1.65) - renamed stb_truetype.h to imstb_truetype.h, stb_textedit.h to imstb_textedit…
377 …- 2018/09/05 (1.65) - renamed io.OptCursorBlink/io.ConfigCursorBlink to io.ConfigInputTextCursorBl…
378 …- 2018/08/31 (1.64) - added imgui_widgets.cpp file, extracted and moved widgets code out of imgui.…
381 …- 2018/08/22 (1.63) - renamed IsItemDeactivatedAfterChange() to IsItemDeactivatedAfterEdit() for c…
382 …- 2018/08/21 (1.63) - renamed ImGuiTextEditCallback to ImGuiInputTextCallback, ImGuiTextEditCallba…
383 …- 2018/08/21 (1.63) - removed ImGuiInputTextCallbackData::ReadOnly since it is a duplication of (I…
384 …- 2018/08/01 (1.63) - removed per-window ImGuiWindowFlags_ResizeFromAnySide beta flag in favor of …
385 …- 2018/08/01 (1.63) - renamed io.OptCursorBlink to io.ConfigCursorBlink [-> io.ConfigInputTextCurs…
386 …- 2018/07/22 (1.63) - changed ImGui::GetTime() return value from float to double to avoid accumula…
387 …- 2018/07/08 (1.63) - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg fo…
388 …- 2018/06/08 (1.62) - examples: the imgui_impl_xxx files have been split to separate platform (Win…
389 …owever prefer using the separated bindings as they will be updated to be multi-viewport conformant.
391 …- 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguis…
392 …- 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader hel…
393 …- 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0…
394 …() with custom format strings, make sure you change them to use %d or an integer-compatible format.
395 …To honor backward-compatibility, the DragInt() code will currently parse and modify format strings…
396 …_OBSOLETE_FUNCTIONS enabled, the code will instead assert! You may run a reg-exp search on your co…
397 …- 2018/04/28 (1.61) - obsoleted InputFloat() functions taking an optional "int decimal_precision" …
399 …- 2018/04/09 (1.61) - IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ …
400 …- 2018/03/20 (1.60) - renamed io.WantMoveMouse to io.WantSetMousePos for consistency and ease of u…
401 …- 2018/03/12 (1.60) - removed ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButt…
402 …- 2018/03/08 (1.60) - changed ImFont::DisplayOffset.y to default to 0 instead of +1. Fixed roundin…
403 …- 2018/03/03 (1.60) - renamed ImGuiStyleVar_Count_ to ImGuiStyleVar_COUNT and ImGuiMouseCursor_Cou…
404 …- 2018/02/18 (1.60) - BeginDragDropSource(): temporarily removed the optional mouse_button=0 param…
405 …- 2018/02/16 (1.60) - obsoleted the io.RenderDrawListsFn callback, you can call your graphics engi…
406 - 2018/02/07 (1.60) - reorganized context handling to be more explicit,
407 …- YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::Destro…
408 - removed Shutdown() function, as DestroyContext() serve this purpose.
409 …- you may pass a ImFontAtlas* pointer to CreateContext() to share a font atlas between contexts. O…
410 …- removed allocator parameters from CreateContext(), they are now setup with SetAllocatorFunctions…
411 …- removed the default global context and font atlas instance, which were confusing for users of DL…
412 …- 2018/01/31 (1.60) - moved sample TTF files from extra_fonts/ to misc/fonts/. If you loaded files…
413 …- 2018/01/11 (1.60) - obsoleted IsAnyWindowHovered() in favor of IsWindowHovered(ImGuiHoveredFlags…
414 …- 2018/01/11 (1.60) - obsoleted IsAnyWindowFocused() in favor of IsWindowFocused(ImGuiFocusedFlags…
415 …- 2018/01/03 (1.60) - renamed ImGuiSizeConstraintCallback to ImGuiSizeCallback, ImGuiSizeConstrain…
416 …- 2017/12/29 (1.60) - removed CalcItemRectClosestPoint() which was weird and not really used by an…
417 …- 2017/12/24 (1.53) - renamed the emblematic ShowTestWindow() function to ShowDemoWindow(). Kept r…
418 …- 2017/12/21 (1.53) - ImDrawList: renamed style.AntiAliasedShapes to style.AntiAliasedFill for con…
419 …- 2017/12/21 (1.53) - ImDrawList: removed 'bool anti_aliased = true' final parameter of ImDrawList…
420 …- 2017/12/14 (1.53) - using the ImGuiWindowFlags_NoScrollWithMouse flag on a child window forwards…
421 …- 2017/12/13 (1.53) - renamed GetItemsLineHeightWithSpacing() to GetFrameHeightWithSpacing(). Kept…
422 …- 2017/12/13 (1.53) - obsoleted IsRootWindowFocused() in favor of using IsWindowFocused(ImGuiFocus…
423 …- obsoleted IsRootWindowOrAnyChildFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_Ro…
424 …- 2017/12/12 (1.53) - renamed ImGuiTreeNodeFlags_AllowOverlapMode to ImGuiTreeNodeFlags_AllowItemO…
425 …- 2017/12/10 (1.53) - removed SetNextWindowContentWidth(), prefer using SetNextWindowContentSize()…
426 …- 2017/11/27 (1.53) - renamed ImGuiTextBuffer::append() helper to appendf(), appendv() to appendfv…
427 …- 2017/11/18 (1.53) - Style, Begin: removed ImGuiWindowFlags_ShowBorders window flag. Borders are …
429 …- 2017/11/18 (1.53) - Style: removed ImGuiCol_ComboBg in favor of combo boxes using ImGuiCol_Popup…
430 - 2017/11/18 (1.53) - Style: renamed ImGuiCol_ChildWindowBg to ImGuiCol_ChildBg.
431 …- 2017/11/18 (1.53) - Style: renamed style.ChildWindowRounding to style.ChildRounding, ImGuiStyleV…
432 …- 2017/11/02 (1.53) - obsoleted IsRootWindowOrAnyChildHovered() in favor of using IsWindowHovered(…
433 …- 2017/10/24 (1.52) - renamed IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS/IMGUI_DISABLE_WIN32_DEFA…
434 …- 2017/10/20 (1.52) - changed IsWindowHovered() default parameters behavior to return false if an …
435 …- 2017/10/20 (1.52) - marked IsItemHoveredRect()/IsMouseHoveringWindow() as obsolete, in favor of …
437 …- 2017/10/17 (1.52) - marked the old 5-parameters version of Begin() as obsolete (still available)…
438 …- 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept i…
439 …- 2017/09/26 (1.52) - renamed ImFont::Glyph to ImFontGlyph. Keep redirection typedef (will obsolet…
440 …- 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the opti…
441 …- 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unava…
442 …- 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection …
443 …- renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirect…
444 …- renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirectio…
445 - 2017/08/20 (1.51) - renamed GetStyleColName() to GetStyleColorName() for consistency.
446 …- 2017/08/20 (1.51) - added PushStyleColor(ImGuiCol idx, ImU32 col) overload, which _might_ cause …
447 …- 2017/08/15 (1.51) - marked the weird IMGUI_ONCE_UPON_A_FRAME helper macro as obsolete. prefer us…
448 …- 2017/08/15 (1.51) - changed parameter order for BeginPopupContextWindow() from (const char*,int …
449 …- 2017/08/13 (1.51) - renamed ImGuiCol_Columns*** to ImGuiCol_Separator***. Kept redirection enums…
450 …- 2017/08/11 (1.51) - renamed ImGuiSetCond_*** types and flags to ImGuiCond_***. Kept redirection …
451 …- 2017/08/09 (1.51) - removed ValueColor() helpers, they are equivalent to calling Text(label) + S…
452 …- 2017/08/08 (1.51) - removed ColorEditMode() and ImGuiColorEditMode in favor of ImGuiColorEditFla…
453 …- changed prototype of 'ColorEdit4(const char* label, float col[4], bool show_alpha = true)' to 'C…
454 …- changed prototype of rarely used 'ColorButton(ImVec4 col, bool small_height = false, bool outlin…
455 …- 2017/07/20 (1.51) - removed IsPosHoveringAnyWindow(ImVec2), which was partly broken and misleadi…
456 …- 2017/05/26 (1.50) - removed ImFontConfig::MergeGlyphCenterV in favor of a more multipurpose ImFo…
457 …- 2017/05/01 (1.50) - renamed ImDrawList::PathFill() (rarely used directly) to ImDrawList::PathFil…
458 …- 2016/11/06 (1.50) - BeginChild(const char*) now applies the stack id to the provided label, cons…
459 …- 2016/10/15 (1.50) - avoid 'void* user_data' parameter to io.SetClipboardTextFn/io.GetClipboardTe…
460 …- 2016/09/25 (1.50) - style.WindowTitleAlign is now a ImVec2 (ImGuiAlign enum was removed). set to…
461 …- 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and …
462 …- 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rende…
468 …float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a;
472 …- 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInte…
473 - 2016/05/02 (1.49) - renamed SetNextTreeNodeOpened() to SetNextTreeNodeOpen(), no redirection.
474 …- 2016/05/01 (1.49) - obsoleted old signature of CollapsingHeader(const char* label, const char* s…
475 …- 2016/04/26 (1.49) - changed ImDrawList::PushClipRect(ImVec4 rect) to ImDrawList::PushClipRect(Im…
476 …- 2016/04/03 (1.48) - removed style.WindowFillAlphaDefault setting which was redundant. Bake defau…
477 …- 2016/04/03 (1.48) - renamed ImGuiCol_TooltipBg to ImGuiCol_PopupBg, used by popups/menus and too…
478 …- 2016/03/21 (1.48) - renamed GetWindowFont() to GetFont(), GetWindowFontSize() to GetFontSize(). …
479 …- 2016/03/02 (1.48) - InputText() completion/history/always callbacks: if you modify the text buff…
480 …- 2016/01/23 (1.48) - fixed not honoring exact width passed to PushItemWidth(), previously it woul…
481 …- 2015/12/27 (1.48) - fixed ImDrawList::AddRect() which used to render a rectangle 1 px too large …
482 …- 2015/12/04 (1.47) - renamed Color() helpers to ValueColor() - dangerously named, rarely used and…
483 …- 2015/08/29 (1.45) - with the addition of horizontal scrollbar we made various fixes to inconsist…
486 - 2015/08/29 (1.45) - renamed style.ScrollbarWidth to style.ScrollbarSize
487 …- 2015/08/05 (1.44) - split imgui.cpp into extra files: imgui_demo.cpp imgui_draw.cpp imgui_intern…
488 …- 2015/07/18 (1.44) - fixed angles in ImDrawList::PathArcTo(), PathArcToFast() (introduced in 1.43…
489 …- 2015/07/14 (1.43) - add new ImFontAtlas::AddFont() API. For the old AddFont***, moved the 'font_…
490 …o render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of …
491 …- 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amou…
493 …- if you are using a vanilla copy of one of the imgui_impl_XXXX.cpp provided in the example, you j…
494 - the signature of the io.RenderDrawListsFn handler has changed!
497 …parameters: 'cmd_lists' becomes 'draw_data->CmdLists', 'cmd_lists_count' becomes 'draw_data->CmdLi…
500 …- each ImDrawList now contains both a vertex buffer and an index buffer. For each command, render …
501 …- if you REALLY cannot render indexed primitives, you can call the draw_data->DeIndexAllBuffers() …
502 …- refer to code in the examples/ folder or ask on the GitHub if you are unsure of how to upgrade. …
503 - 2015/07/10 (1.43) - changed SameLine() parameters from int to float.
504 …- 2015/07/02 (1.42) - renamed SetScrollPosHere() to SetScrollFromCursorPos(). Kept inline redirect…
505 …- 2015/07/02 (1.42) - renamed GetScrollPosY() to GetScrollY(). Necessary to reduce confusion along…
506 …- 2015/06/14 (1.41) - changed ImageButton() default bg_col parameter from (0,0,0,1) (black) to (0,…
507 …- 2015/06/14 (1.41) - changed Selectable() API from (label, selected, size) to (label, selected, f…
508 …- 2015/05/31 (1.40) - renamed GetWindowCollapsed() to IsWindowCollapsed() for consistency. Kept in…
509 …- 2015/05/31 (1.40) - renamed IsRectClipped() to IsRectVisible() for consistency. Note that return…
510 …- 2015/05/27 (1.40) - removed the third 'repeat_if_held' parameter from Button() - sorry! it was r…
511 …- 2015/05/11 (1.40) - changed BeginPopup() API, takes a string identifier instead of a bool. ImGui…
512 …- 2015/05/03 (1.40) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (th…
513 …- 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function unt…
514 …- 2015/04/09 (1.38) - renamed ImDrawList::AddArc() to ImDrawList::AddArcFast() for compatibility w…
515 …- 2015/04/03 (1.38) - removed ImGuiCol_CheckHovered, ImGuiCol_CheckActive, replaced with the more …
516 …- 2014/04/03 (1.38) - removed support for passing -FLT_MAX..+FLT_MAX as the range for a SliderFloa…
517 …- 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectM…
518 …- 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNode…
519 …- 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection f…
520 - 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing)
521 …- 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kep…
522 …- 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession …
523 …- 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->in…
524 - 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior
525 - 2015/02/08 (1.31) - renamed GetTextLineSpacing() to GetTextLineHeightWithSpacing()
526 - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
527 …- 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() b…
528 …- 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no …
529 …(1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompress…
531 …ixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); <..Upload textur…
534 …(1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render i…
535 … (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix)
536 …(1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets
537 …- 2014/12/10 (1.18) - removed SetNewWindowDefaultPos() in favor of new generic API SetNextWindowPo…
538 …- 2014/11/28 (1.17) - moved IO.Font*** options to inside the IO.Font-> structure (FontYOffset, Fon…
539 …- 2014/11/26 (1.17) - reworked syntax of IMGUI_ONCE_UPON_A_FRAME helper macro to increase compiler…
540 - 2014/11/07 (1.15) - renamed IsHovered() to IsItemHovered()
541 …- 2014/10/02 (1.14) - renamed IMGUI_INCLUDE_IMGUI_USER_CPP to IMGUI_INCLUDE_IMGUI_USER_INL and img…
542 …- 2014/09/25 (1.13) - removed 'text_end' parameter from IO.SetClipboardTextFn (the string is now a…
543 - 2014/09/24 (1.12) - renamed SetFontScale() to SetWindowFontScale()
544 …- 2014/09/24 (1.12) - moved IM_MALLOC/IM_REALLOC/IM_FREE preprocessor defines to IO.MemAllocFn/IO.…
545 - 2014/08/30 (1.09) - removed IO.FontHeight (now computed automatically)
546 - 2014/08/30 (1.09) - moved IMGUI_FONT_TEX_UV_FOR_WHITE preprocessor define to IO.FontTexUvForWhite
547 …- 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fix…
555 …- When 'io.WantCaptureMouse' is set, imgui wants to use your mouse state, and you may want to disc…
556 …- When 'io.WantCaptureKeyboard' is set, imgui wants to use your keyboard state, and you may want t…
557 …- When 'io.WantTextInput' is set to may want to notify your OS to popup an on-screen keyboard, if …
565 …ng on your application logic it may or not be inconvenient. You might want to track which key-downs
566 …ere targeted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.)
570 …- You may use functions such as ImGui::Image(), ImGui::ImageButton() or lower-level ImDrawList::Ad…
571 …- Actual textures are identified in a way that is up to the user/engine. Those identifiers are sto…
572 …- Loading image files from the disk and turning them into a texture is not within the scope of Dea…
576 …- Dear ImGui's job is to create "meshes", defined in a renderer-agnostic format made of draw comma…
578 …to render them is generally fairly short (a few dozen lines). In the examples/ folder we provide f…
579 …- Each rendering function decides on a data type to represent "textures". The concept of what is a…
583 …- In the examples/ bindings, for each graphics API binding we decided on a type that is likely to …
584 … an image from the end-user perspective. This is what the _examples_ rendering functions are using:
592 …e store a pointer to ID3D11ShaderResourceView inside ImTextureID, which is a higher-level structure
594 …- If you have a custom engine built over e.g. OpenGL, instead of passing GLuint around you may dec…
596 …is designed. If your engine has high-level data types for "textures" and "material" then you may w…
599 …(Advanced users may also decide to keep a low-level type in ImTextureID, and use ImDrawList callba…
605 ImGui::Image((void*)texture, ImVec2(texture->Width, texture->Height));
610 MyTexture* texture = (MyTexture*)pcmd->TextureId;
638 …void* is pointer-sized storage. You may safely store any pointer or integer into it by casting you…
639 …Because both end-points (user code and rendering function) are under your control, you know exactl…
664 - Unique ID are often derived from a string label:
669 … - ID are uniquely scoped within windows, tree nodes, etc. which all pushes to the ID stack. Having
680 - If you have a same ID twice in the same location, you'll have a conflict:
687 - Solving ID conflict in a simple/local context:
689 Use "##" to pass a complement to the ID that won't be visible to the end-user.
699 - If you want to completely hide the label, but still need an ID:
703 - Occasionally/rarely you might want change a label while preserving a constant ID. This allows
713 - Solving ID conflict in a more general manner:
738 PushID(obj->Name);
739 Button("Click"); // Label = "Click", ID = hash of ("Window", obj->Name, "Click")
744 - You can stack multiple prefixes into the ID stack:
754 - Tree nodes implicitly creates a scope for you by calling PushID().
757 …if (TreeNode("node")) // <-- this function call will do a PushID() for you (unless instructed not…
763 - When working with trees, ID are used to preserve the open/close state of each tree node.
777 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
778 io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
785 …io.Fonts->AddFontFromFileTTF("MyDataFolder\MyFontFile.ttf", size_in_pixels); // WRONG (you are e…
786 io.Fonts->AddFontFromFileTTF("MyDataFolder\\MyFontFile.ttf", size_in_pixels); // CORRECT
787 io.Fonts->AddFontFromFileTTF("MyDataFolder/MyFontFile.ttf", size_in_pixels); // ALSO CORRECT
800 ImFont* font0 = io.Fonts->AddFontDefault();
801 ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
802 ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
803 io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
811 config.GlyphOffset.y -= 1.0f; // Move everything by 1 pixels up
813 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config);
819 io.Fonts->AddFontDefault();
820 …io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font
821 …io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRange…
823 Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
827 …io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, io.Fonts->GetGlyphRangesJapan…
834 builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges
836 io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, ranges.Data);
838 All your strings needs to use UTF-8 encoding. In C++11 you can encode a string literal in UTF-8
840 (such as CP-923 for Japanese or CP-1251 for Cyrillic) will NOT work!
841 Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8.
851 …A: - Being highly portable (bindings for several languages, frameworks, programming style, obscure…
852 …and aiming for compatibility & performance suitable for every modern real-time game engines, dear …
854 …- To use ImGui::InputText() with a std::string or any resizable string class, see misc/cpp/imgui_s…
855 …- To use combo boxes and list boxes with std::vector or any other data structure: the BeginCombo()…
858 - Generally for most high-level types you should be able to access the underlying data type.
859 …You may write your own one-liner wrappers to facilitate user code (tip: add new functions in ImGui…
860 …- Dear ImGui applications often need to make intensive use of strings. It is expected that many of…
863 …Modern implementations of std::string often include small-string optimization (which is often a lo…
865 …- If you are finding your UI traversal cost to be too large, make sure your string usage is not le…
868 …One possible implementation of a helper to facilitate printf-style building of strings: https://gi…
873 …A: - You can create a dummy window. Call Begin() with the NoBackground | NoDecoration | NoSavedSet…
876 …- You can call ImGui::GetOverlayDrawList() and use this draw list to display contents over every o…
877 …- You can create your own ImDrawList instance. You'll need to initialize them ImGui::GetDrawListSh…
881 …A: - You can control Dear ImGui with a gamepad. Read about navigation in "Using gamepad/keyboard n…
883 …- You can share your computer mouse seamlessly with your console/tablet/phone using Synergy (https…
885 …In particular, the "micro-synergy-client" repository (https://github.com/symless/micro-synergy-cli…
888 Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-like protocols.
889 …- You may also use a third party solution such as Remote ImGui (https://github.com/JordiRos/remote…
890 …ces to render over the local network, allowing you to use Dear ImGui even on a screen-less machine.
891 …- For touch inputs, you can increase the hit box of widgets (via the style.TouchPadding setting) t…
893 for screen real-estate and precision.
904 …A: - If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, …
906 …- Businesses: convince your company to fund development via support contracts/sponsoring! This is …
907 …- Individuals: you can also become a Patron (http://www.patreon.com/imgui) or donate on PayPal! Se…
908 …- Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewher…
911 …- If you have issues or if you need to hack into the library, even if you don't expect any support…
913 …- tip: you can call Begin() multiple times with the same name during the same frame, it will keep …
915 …- tip: you can create widgets without a Begin()/End() block, they will go in an implicit window ca…
916 …- tip: the ImGuiOnceUponAFrame helper will allow run the block of code only once a frame. You can …
918 - tip: you can call Render() multiple times (e.g for VR renders).
919 …- tip: call and read the ShowDemoWindow() code in imgui_demo.cpp for more example of how to use Im…
951 // Clang/GCC warnings with -Weverything
953 #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wf…
954 #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast …
955 #pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point w…
956 …ang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string liter…
957 … clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-tim…
958 #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a glo…
959 #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion change…
960 …-Wformat-pedantic" // warning : format specifies type 'void *' but the argument has type 'x…
961 #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' f…
962 #if __has_warning("-Wzero-as-null-pointer-constant")
963 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null point…
965 #if __has_warning("-Wdouble-promotion")
966 #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'f…
969 #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
970 #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from intege…
971 #pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argumen…
972 #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'f…
973 #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from '…
974 #pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal…
975 … GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not…
977 …-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' …
985 …ResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by back-end)
989 //-------------------------------------------------------------------------
991 //-------------------------------------------------------------------------
1038 //-----------------------------------------------------------------------------
1040 //-----------------------------------------------------------------------------
1044 // 1) Important: globals are not shared across DLL boundaries! If you use DLLs or any form of hot-r…
1045 …ter you got from CreateContext) from each unique static/DLL boundary, and after each hot-reloading.
1047 // 2) Important: Dear ImGui functions are not thread-safe because of this pointer.
1048 // If you want thread-safety to allow N threads to access N different contexts, you can:
1049 // - Change this variable to use thread local storage so each thread can refer to a different co…
1053 …ur cpp file. Note that thread_local is a C++11 keyword, earlier C++ uses compiler-specific keyword.
1054 // - Future development aim to make this context pointer explicit to all calls. Also read https:…
1055 // - If you need a finite number of contexts, you may compile and use multiple instances of the …
1062 // Otherwise, you probably don't want to modify them mid-program, and if you use global/static e.g.…
1075 //-----------------------------------------------------------------------------
1077 //-----------------------------------------------------------------------------
1096 …TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system… in ImGuiStyle()
1110 …AntiAliasedLines = true; // Enable anti-aliasing on lines/borders. Disable if y… in ImGuiStyle()
1111 …AntiAliasedFill = true; // Enable anti-aliasing on filled shapes (rounded rect… in ImGuiStyle()
1152 DisplaySize = ImVec2(-1.0f, -1.0f); in ImGuiIO()
1160 KeyMap[i] = -1; in ImGuiIO()
1196 MousePos = ImVec2(-FLT_MAX, -FLT_MAX); in ImGuiIO()
1197 MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX); in ImGuiIO()
1199 … i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f; in ImGuiIO()
1200 …0; i < IM_ARRAYSIZE(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f; in ImGuiIO()
1201 for (int i = 0; i < IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0f; in ImGuiIO()
1205 // - with glfw you can get those from the callback set in glfwSetCharCallback()
1206 // - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
1228 //-----------------------------------------------------------------------------
1230 //-----------------------------------------------------------------------------
1234 ImVec2 ap = p - a; in ImLineClosestPoint()
1235 ImVec2 ab_dir = b - a; in ImLineClosestPoint()
1247 bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f; in ImTriangleContainsPoint()
1248 bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f; in ImTriangleContainsPoint()
1249 bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f; in ImTriangleContainsPoint()
1255 ImVec2 v0 = b - a; in ImTriangleBarycentricCoords()
1256 ImVec2 v1 = c - a; in ImTriangleBarycentricCoords()
1257 ImVec2 v2 = p - a; in ImTriangleBarycentricCoords()
1258 const float denom = v0.x * v1.y - v1.x * v0.y; in ImTriangleBarycentricCoords()
1259 out_v = (v2.x * v1.y - v1.x * v2.y) / denom; in ImTriangleBarycentricCoords()
1260 out_w = (v0.x * v2.y - v2.x * v0.y) / denom; in ImTriangleBarycentricCoords()
1261 out_u = 1.0f - out_v - out_w; in ImTriangleBarycentricCoords()
1269 float dist2_ab = ImLengthSqr(p - proj_ab); in ImTriangleClosestPoint()
1270 float dist2_bc = ImLengthSqr(p - proj_bc); in ImTriangleClosestPoint()
1271 float dist2_ca = ImLengthSqr(p - proj_ca); in ImTriangleClosestPoint()
1284 while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } in ImStricmp()
1291 …while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--… in ImStrnicmp()
1300 strncpy(dst, src, count - 1); in ImStrncpy()
1301 dst[count - 1] = 0; in ImStrncpy()
1327 const char* p = (const char*)memchr(str, (int)c, str_end - str); in ImStrchrRange()
1333 //return (int)wcslen((const wchar_t*)str); // FIXME-OPT: Could use this when wchar_t are 16-bits in ImStrlenW()
1339 // Find end-of-line. Return pointer will point to either first \n, either str_end.
1342 const char* p = (const char*)memchr(str, '\n', str_end - str); in ImStreolRange()
1346 …ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line in ImStrbolW()
1348 while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n') in ImStrbolW()
1349 buf_mid_line--; in ImStrbolW()
1384 while (p > p_start && (p[-1] == ' ' || p[-1] == '\t')) // Trailing blanks in ImStrTrimBlanks()
1385 p--; in ImStrTrimBlanks()
1387 memmove(buf, p_start, p - p_start); in ImStrTrimBlanks()
1388 buf[p - p_start] = 0; // Zero terminate in ImStrTrimBlanks()
1391 // A) MSVC version appears to return -1 on overflow, whereas glibc appears to return total count (w…
1392 // Ideally we would test for only one of those limits at runtime depending on the behavior the vsnp…
1418 if (w == -1 || w >= (int)buf_size) in ImFormatString()
1419 w = (int)buf_size - 1; in ImFormatString()
1433 if (w == -1 || w >= (int)buf_size) in ImFormatStringV()
1434 w = (int)buf_size - 1; in ImFormatStringV()
1442 // - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constr…
1465 // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do prope…
1471 while (data_size-- != 0) in ImHashData()
1476 // Zero-terminated string hash, with support for ### to reset back to seed value
1479 // - If we reach ### in the string we discard the hash so far and reset to the seed.
1480 // - We don't do 'current += 2; continue;' after handling ### to keep the code smaller/faster (meas…
1481 // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do prope…
1490 while (data_size-- != 0) in ImHashStr()
1513 …wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UT… in ImFileOpen()
1539 if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET)) in ImFileLoadToMemory()
1568 //-----------------------------------------------------------------------------
1570 //-----------------------------------------------------------------------------
1572 // Convert UTF-8 to 32-bits character, process single character input.
1574 // We handle UTF-8 decoding error by skipping forward.
1577 unsigned int c = (unsigned int)-1; in ImTextCharFromUtf8()
1588 if (in_text_end && in_text_end - (const char*)str < 2) return 1; in ImTextCharFromUtf8()
1599 if (in_text_end && in_text_end - (const char*)str < 3) return 1; in ImTextCharFromUtf8()
1613 if (in_text_end && in_text_end - (const char*)str < 4) return 1; in ImTextCharFromUtf8()
1624 // utf-8 encodings of values used in surrogate pairs are invalid in ImTextCharFromUtf8()
1637 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) in ImTextStrFromUtf8()
1649 return (int)(buf_out - buf); in ImTextStrFromUtf8()
1725 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) in ImTextStrToUtf8()
1731 buf_out += ImTextCharToUtf8(buf_out, (int)(buf_end-buf_out-1), c); in ImTextStrToUtf8()
1734 return (int)(buf_out - buf); in ImTextStrToUtf8()
1751 //-----------------------------------------------------------------------------
1754 //-----------------------------------------------------------------------------
1776 // Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p…
1777 // Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv
1784 K = -1.f; in ColorConvertRGBtoHSV()
1789 K = -2.f / 6.f - K; in ColorConvertRGBtoHSV()
1792 const float chroma = r - (g < b ? g : b); in ColorConvertRGBtoHSV()
1793 out_h = ImFabs(K + (g - b) / (6.f * chroma + 1e-20f)); in ColorConvertRGBtoHSV()
1794 out_s = chroma / (r + 1e-20f); in ColorConvertRGBtoHSV()
1798 // Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p…
1811 float f = h - (float)i; in ColorConvertHSVtoRGB()
1812 float p = v * (1.0f - s); in ColorConvertHSVtoRGB()
1813 float q = v * (1.0f - s * f); in ColorConvertHSVtoRGB()
1814 float t = v * (1.0f - s * (1.0f - f)); in ColorConvertHSVtoRGB()
1829 ImGuiStyle& style = GImGui->Style; in GetColorU32()
1837 ImGuiStyle& style = GImGui->Style; in GetColorU32()
1845 ImGuiStyle& style = GImGui->Style; in GetStyleColorVec4()
1851 float style_alpha = GImGui->Style.Alpha; in GetColorU32()
1859 //-----------------------------------------------------------------------------
1861 // Helper: Key->value storage
1862 //-----------------------------------------------------------------------------
1869 size_t count = (size_t)(last - first); in LowerBound()
1874 if (mid->key < key) in LowerBound()
1877 count -= count2 + 1; in LowerBound()
1895 if (((const Pair*)lhs)->key > ((const Pair*)rhs)->key) return +1; in BuildSortByKey()
1896 if (((const Pair*)lhs)->key < ((const Pair*)rhs)->key) return -1; in BuildSortByKey()
1907 if (it == Data.end() || it->key != key) in GetInt()
1909 return it->val_i; in GetInt()
1920 if (it == Data.end() || it->key != key) in GetFloat()
1922 return it->val_f; in GetFloat()
1928 if (it == Data.end() || it->key != key) in GetVoidPtr()
1930 return it->val_p; in GetVoidPtr()
1937 if (it == Data.end() || it->key != key) in GetIntRef()
1939 return &it->val_i; in GetIntRef()
1950 if (it == Data.end() || it->key != key) in GetFloatRef()
1952 return &it->val_f; in GetFloatRef()
1958 if (it == Data.end() || it->key != key) in GetVoidPtrRef()
1960 return &it->val_p; in GetVoidPtrRef()
1963 // FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too …
1967 if (it == Data.end() || it->key != key) in SetInt()
1972 it->val_i = val; in SetInt()
1983 if (it == Data.end() || it->key != key) in SetFloat()
1988 it->val_f = val; in SetFloat()
1994 if (it == Data.end() || it->key != key) in SetVoidPtr()
1999 it->val_p = val; in SetVoidPtr()
2008 //-----------------------------------------------------------------------------
2010 //-----------------------------------------------------------------------------
2041 out->resize(0); in split()
2048 out->push_back(TextRange(wb, we)); in split()
2054 out->push_back(TextRange(wb, we)); in split()
2069 while (f.e > f.b && ImCharIsBlankA(f.e[-1])) in Build()
2070 f.e--; in Build()
2073 if (Filters[i].b[0] != '-') in Build()
2091 if (f.b[0] == '-') in PassFilter()
2112 //-----------------------------------------------------------------------------
2114 //-----------------------------------------------------------------------------
2130 int len = str_end ? (int)(str_end - str) : (int)strlen(str); in append()
2132 // Add zero-terminator the first time in append()
2142 memcpy(&Buf[write_off - 1], str, (size_t)len); in append()
2143 Buf[write_off - 1 + len] = 0; in append()
2160 …int len = ImFormatStringV(NULL, 0, fmt, args); // FIXME-OPT: could do a first pass write a… in appendfv()
2167 // Add zero-terminator the first time in appendfv()
2177 ImFormatStringV(&Buf[write_off - 1], (size_t)len + 1, fmt, args_copy); in appendfv()
2181 //-----------------------------------------------------------------------------
2184 //-----------------------------------------------------------------------------
2189 …// FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code … in SetCursorPosYAndSetupDummyPrevLine()
2193 …window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those field… in SetCursorPosYAndSetupDummyPrevLine()
2194 …window->DC.PrevLineSize.y = (line_height - GImGui->Style.ItemSpacing.y); // If we end up needin… in SetCursorPosYAndSetupDummyPrevLine()
2195 if (window->DC.ColumnsSet) in SetCursorPosYAndSetupDummyPrevLine()
2196 …window->DC.ColumnsSet->LineMinY = window->DC.CursorPos.y; // Setting this so that cell Y… in SetCursorPosYAndSetupDummyPrevLine()
2201 // FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy A…
2208 DisplayEnd = DisplayStart = -1; in Begin()
2225 ItemsCount = -1; in End()
2231 if (ItemsCount == 0 || ImGui::GetCurrentWindowRead()->SkipItems) in Step()
2233 ItemsCount = -1; in Step()
2246 if (ItemsCount == 1) { ItemsCount = -1; return false; } in Step()
2247 float items_height = ImGui::GetCursorPosY() - StartPosY; in Step()
2249 Begin(ItemsCount-1, items_height); in Step()
2266 //-----------------------------------------------------------------------------
2268 // Those (internal) functions are currently quite a legacy mess - their signature and behavior will…
2270 //-----------------------------------------------------------------------------
2276 text_end = (const char*)-1; in FindRenderedTextEnd()
2299 text_end = text + strlen(text); // FIXME-OPT in RenderText()
2305 …window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_… in RenderText()
2317 text_end = text + strlen(text); // FIXME-OPT in RenderTextWrapped()
2321 …window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_end, wra… in RenderTextWrapped()
2335 const ImVec2* clip_min = clip_rect ? &clip_rect->Min : &pos_min; in RenderTextClippedEx()
2336 const ImVec2* clip_max = clip_rect ? &clip_rect->Max : &pos_max; in RenderTextClippedEx()
2337 … bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y); in RenderTextClippedEx()
2339 need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y); in RenderTextClippedEx()
2342 if (align.x > 0.0f) pos.x = ImMax(pos.x, pos.x + (pos_max.x - pos.x - text_size.x) * align.x); in RenderTextClippedEx()
2343 if (align.y > 0.0f) pos.y = ImMax(pos.y, pos.y + (pos_max.y - pos.y - text_size.y) * align.y); in RenderTextClippedEx()
2348 ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y); in RenderTextClippedEx()
2349 …draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, &fin… in RenderTextClippedEx()
2353 …draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, NULL… in RenderTextClippedEx()
2361 const int text_len = (int)(text_display_end - text); in RenderTextClipped()
2367 …RenderTextClippedEx(window->DrawList, pos_min, pos_max, text, text_display_end, text_size_if_known… in RenderTextClipped()
2377 window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding); in RenderFrame()
2381 …window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow)… in RenderFrame()
2382 …window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_… in RenderFrame()
2393 …window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow)… in RenderFrameBorder()
2394 …window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_… in RenderFrameBorder()
2412 if (dir == ImGuiDir_Up) r = -r; in RenderArrow()
2414 b = ImVec2(-0.866f,-0.750f) * r; in RenderArrow()
2415 c = ImVec2(+0.866f,-0.750f) * r; in RenderArrow()
2419 if (dir == ImGuiDir_Left) r = -r; in RenderArrow()
2421 b = ImVec2(-0.750f,+0.866f) * r; in RenderArrow()
2422 c = ImVec2(-0.750f,-0.866f) * r; in RenderArrow()
2430 …g.CurrentWindow->DrawList->AddTriangleFilled(center + a, center + b, center + c, GetColorU32(ImGui… in RenderArrow()
2437 window->DrawList->AddCircleFilled(pos, g.FontSize*0.20f, GetColorU32(ImGuiCol_Text), 8); in RenderBullet()
2446 sz -= thickness*0.5f; in RenderCheckMark()
2451 float by = pos.y + sz - third*0.5f; in RenderCheckMark()
2452 window->DrawList->PathLineTo(ImVec2(bx - third, by - third)); in RenderCheckMark()
2453 window->DrawList->PathLineTo(ImVec2(bx, by)); in RenderCheckMark()
2454 window->DrawList->PathLineTo(ImVec2(bx + third*2, by - third*2)); in RenderCheckMark()
2455 window->DrawList->PathStroke(col, false, thickness); in RenderCheckMark()
2466 if (window->DC.NavHideHighlightOneFrame) in RenderNavHighlight()
2471 display_rect.ClipWith(window->ClipRect); in RenderNavHighlight()
2477 bool fully_visible = window->ClipRect.Contains(display_rect); in RenderNavHighlight()
2479 window->DrawList->PushClipRect(display_rect.Min, display_rect.Max); in RenderNavHighlight()
2480 …window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS*0.5f,THICKNESS*0.5f), display_rect.M… in RenderNavHighlight()
2482 window->DrawList->PopClipRect(); in RenderNavHighlight()
2486 …window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), … in RenderNavHighlight()
2490 //-----------------------------------------------------------------------------
2492 //-----------------------------------------------------------------------------
2496 : DrawListInst(&context->DrawListSharedData) in ImGuiWindow()
2524 ResizeBorderHeld = -1; in ImGuiWindow()
2526 BeginOrderWithinParent = -1; in ImGuiWindow()
2527 BeginOrderWithinContext = -1; in ImGuiWindow()
2529 AutoFitFramesX = AutoFitFramesY = -1; in ImGuiWindow()
2537 LastFrameActive = -1; in ImGuiWindow()
2540 SettingsIdx = -1; in ImGuiWindow()
2543 DrawList->_OwnerName = Name; in ImGuiWindow()
2553 FocusIdxAllCounter = FocusIdxTabCounter = -1; in ImGuiWindow()
2569 ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); in GetID()
2585 return ImHashStr(str, str_end ? (str_end - str) : 0, seed); in GetIDNoKeepAlive()
2598 …nt r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x)… in GetIDFromRectangle()
2609 g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); in SetCurrentWindow()
2618 g.NavWindow->NavLastIds[nav_layer] = id; in SetNavID()
2625 g.NavWindow->NavRectRel[nav_layer] = rect_rel; in SetNavIDWithRectRel()
2658 // FIXME-NAV: The existence of SetNavID/SetNavIDWithRectRel/SetFocusID is incredibly messy and conf…
2665 const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent; in SetFocusID()
2671 window->NavLastIds[nav_layer] = id; in SetFocusID()
2672 if (window->DC.LastItemId == id) in SetFocusID()
2673 …window->NavRectRel[nav_layer] = ImRect(window->DC.LastItemRect.Min - window->Pos, window->DC.LastI… in SetFocusID()
2717 //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id); in MarkItemEdited()
2719 g.CurrentWindow->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Edited; in MarkItemEdited()
2725 // FIXME-OPT: This could be cached/stored within the window. in IsWindowContentHoverable()
2728 if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindow) in IsWindowContentHoverable()
2729 if (focused_root_window->WasActive && focused_root_window != window->RootWindow) in IsWindowContentHoverable()
2733 if (focused_root_window->Flags & ImGuiWindowFlags_Modal) in IsWindowContentHoverable()
2735 …if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhen… in IsWindowContentHoverable()
2747 if (window->SkipItems) in ItemSize()
2751 const float line_height = ImMax(window->DC.CurrentLineSize.y, size.y); in ItemSize()
2752 const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y); in ItemSize()
2753 …//if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(s… in ItemSize()
2754 window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y); in ItemSize()
2755 …window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffs… in ItemSize()
2756 …window->DC.CursorPos.y = (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y… in ItemSize()
2757 window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); in ItemSize()
2758 …window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.Item… in ItemSize()
2759 …//if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255… in ItemSize()
2761 window->DC.PrevLineSize.y = line_height; in ItemSize()
2762 window->DC.PrevLineTextBaseOffset = text_base_offset; in ItemSize()
2763 window->DC.CurrentLineSize.y = window->DC.CurrentLineTextBaseOffset = 0.0f; in ItemSize()
2766 if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) in ItemSize()
2785 // Navigation processing runs prior to clipping early-out in ItemAdd()
2790 window->DC.NavLayerActiveMaskNext |= window->DC.NavLayerCurrentMask; in ItemAdd()
2792 if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) in ItemAdd()
2793 …if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened… in ItemAdd()
2797 window->DC.LastItemId = id; in ItemAdd()
2798 window->DC.LastItemRect = bb; in ItemAdd()
2799 window->DC.LastItemStatusFlags = ImGuiItemStatusFlags_None; in ItemAdd()
2806 // Clipping test in ItemAdd()
2810 … //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] in ItemAdd()
2814 window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HoveredRect; in ItemAdd()
2818 // This is roughly matching the behavior of internal-facing ItemHoverable()
2819 // - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactiv…
2820 // - this should work even for non-interactive items that have no ID, so we cannot use LastItemId
2828 // Test for bounding box overlap, as updated as ItemAdd() in IsItemHovered()
2829 if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) in IsItemHovered()
2833 // Test if we are hovering the right window (our window could be behind another window) in IsItemHovered()
2834 … 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but … in IsItemHovered()
2835 …il a solution is found I believe reverting to the test from 2017/09/27 is safe since this was the … in IsItemHovered()
2838 … if (g.HoveredRootWindow != window->RootWindow && !(flags & ImGuiHoveredFlags_AllowWhenOverlapped)) in IsItemHovered()
2841 // Test if another item is active (e.g. being dragged) in IsItemHovered()
2843 …if (g.ActiveId != 0 && g.ActiveId != window->DC.LastItemId && !g.ActiveIdAllowOverlap && g.ActiveI… in IsItemHovered()
2846 // Test if interactions on this window are blocked by an active popup or modal in IsItemHovered()
2850 // Test if the item is disabled in IsItemHovered()
2851 …if ((window->DC.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisab… in IsItemHovered()
2856 if (window->DC.LastItemId == window->MoveId && window->WriteAccessed) in IsItemHovered()
2877 if (window->DC.ItemFlags & ImGuiItemFlags_Disabled) in ItemHoverable()
2888 if (!bb.Overlaps(window->ClipRect)) in IsClippedEx()
2899 …const bool is_tab_stop = (window->DC.ItemFlags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabl… in FocusableItemRegister()
2900 window->FocusIdxAllCounter++; in FocusableItemRegister()
2902 window->FocusIdxTabCounter++; in FocusableItemRegister()
2904 // Process keyboard input at this point: TAB/Shift-TAB to tab out of the currently focused item. in FocusableItemRegister()
2906 …if (tab_stop && (g.ActiveId == id) && window->FocusIdxAllRequestNext == INT_MAX && window->FocusId… in FocusableItemRegister()
2907 …window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (is_tab_stop ? -1 :… in FocusableItemRegister()
2909 if (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent) in FocusableItemRegister()
2911 if (is_tab_stop && window->FocusIdxTabCounter == window->FocusIdxTabRequestCurrent) in FocusableItemRegister()
2922 window->FocusIdxAllCounter--; in FocusableItemUnregister()
2923 window->FocusIdxTabCounter--; in FocusableItemUnregister()
2931 content_max = g.CurrentWindow->Pos + GetContentRegionMax(); in CalcItemSize()
2933 …size.x = (size.x == 0.0f) ? default_x : ImMax(content_max.x - g.CurrentWindow->DC.CursorPos.x, 4.0… in CalcItemSize()
2935 …size.y = (size.y == 0.0f) ? default_y : ImMax(content_max.y - g.CurrentWindow->DC.CursorPos.y, 4.0… in CalcItemSize()
2946 wrap_pos_x = GetContentRegionMax().x + window->Pos.x; in CalcWrapWidthForPos()
2948 … wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space in CalcWrapWidthForPos()
2950 return ImMax(wrap_pos_x - pos.x, 1.0f); in CalcWrapWidthForPos()
2956 ctx->IO.MetricsActiveAllocations++; in MemAlloc()
2964 ctx->IO.MetricsActiveAllocations--; in MemFree()
2970 …return GImGui->IO.GetClipboardTextFn ? GImGui->IO.GetClipboardTextFn(GImGui->IO.ClipboardUserData)… in GetClipboardText()
2975 if (GImGui->IO.SetClipboardTextFn) in SetClipboardText()
2976 GImGui->IO.SetClipboardTextFn(GImGui->IO.ClipboardUserData, text); in SetClipboardText()
2984 // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate …
2994 …IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have contr… in SetCurrentContext()
3043 return GImGui->IO; in GetIO()
3049 return GImGui->Style; in GetStyle()
3061 return GImGui->Time; in GetTime()
3066 return GImGui->FrameCount; in GetFrameCount()
3072 return &GImGui->OverlayDrawList; in GetOverlayDrawList()
3077 return &GImGui->OverlayDrawList; in GetOverlayDrawList()
3082 return &GImGui->DrawListSharedData; in GetDrawListSharedData()
3092 SetActiveID(window->MoveId, window); in StartMouseMovingWindow()
3094 g.ActiveIdClickOffset = g.IO.MousePos - window->RootWindow->Pos; in StartMouseMovingWindow()
3097 …if ((window->Flags & ImGuiWindowFlags_NoMove) || (window->RootWindow->Flags & ImGuiWindowFlags_NoM… in StartMouseMovingWindow()
3104 // Note: moving window with the navigation keys (Square + d-pad / CTRL+TAB + Arrows) are processed …
3111 …o that generally ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consisten… in UpdateMouseMovingWindowNewFrame()
3113 IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow); in UpdateMouseMovingWindowNewFrame()
3114 ImGuiWindow* moving_window = g.MovingWindow->RootWindow; in UpdateMouseMovingWindowNewFrame()
3117 ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset; in UpdateMouseMovingWindowNewFrame()
3118 if (moving_window->Pos.x != pos.x || moving_window->Pos.y != pos.y) in UpdateMouseMovingWindowNewFrame()
3134 if (g.ActiveIdWindow && g.ActiveIdWindow->MoveId == g.ActiveId) in UpdateMouseMovingWindowNewFrame()
3143 // Initiate moving window, handle left-click and right-click focus
3152 if (g.NavWindow && g.NavWindow->Appearing) in UpdateMouseMovingWindowEndFrame()
3161 …if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(g.HoveredRootWindow->Flags & ImGuiWindowFlags_NoTi… in UpdateMouseMovingWindowEndFrame()
3162 if (!g.HoveredRootWindow->TitleBarRect().Contains(g.IO.MouseClickedPos[0])) in UpdateMouseMovingWindowEndFrame()
3173 …// (The left mouse button path calls FocusWindow which will lead NewFrame->ClosePopupsOverWindow t… in UpdateMouseMovingWindowEndFrame()
3176 // Find the top-most window between HoveredWindow and the front most Modal Window. in UpdateMouseMovingWindowEndFrame()
3182 for (int i = g.Windows.Size - 1; i >= 0 && hovered_window_above_modal == false; i--) in UpdateMouseMovingWindowEndFrame()
3196 return (window->Active) && (!window->Hidden); in IsWindowActiveAndVisible()
3203 …// Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't s… in UpdateMouseInputs()
3207 …// If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out mo… in UpdateMouseInputs()
3209 g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev; in UpdateMouseInputs()
3221 …] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f; in UpdateMouseInputs()
3225 if ((float)(g.Time - g.IO.MouseClickedTime[i]) < g.IO.MouseDoubleClickTime) in UpdateMouseInputs()
3227 …ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClicked… in UpdateMouseInputs()
3230 … g.IO.MouseClickedTime[i] = -FLT_MAX; // so the third click isn't turned into a double-click in UpdateMouseInputs()
3243 …ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClicked… in UpdateMouseInputs()
3245 … = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, delta_from_click_pos.x < 0.0f ? -delta_from_click_pos.… in UpdateMouseInputs()
3246 … = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, delta_from_click_pos.y < 0.0f ? -delta_from_click_pos.… in UpdateMouseInputs()
3256 if (!g.HoveredWindow || g.HoveredWindow->Collapsed) in UpdateMouseWheel()
3264 …->Flags & ImGuiWindowFlags_ChildWindow) && (scroll_window->Flags & ImGuiWindowFlags_NoScrollWithMo… in UpdateMouseWheel()
3265 scroll_window = scroll_window->ParentWindow; in UpdateMouseWheel()
3266 …const bool scroll_allowed = !(scroll_window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(scro… in UpdateMouseWheel()
3273 …const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.5… in UpdateMouseWheel()
3274 const float scale = new_font_scale / window->FontWindowScale; in UpdateMouseWheel()
3275 window->FontWindowScale = new_font_scale; in UpdateMouseWheel()
3277 …const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; in UpdateMouseWheel()
3278 window->Pos += offset; in UpdateMouseWheel()
3279 window->Size *= scale; in UpdateMouseWheel()
3280 window->SizeFull *= scale; in UpdateMouseWheel()
3285 float scroll_amount = 5 * scroll_window->CalcFontSize(); in UpdateMouseWheel()
3286 …nt = (float)(int)ImMin(scroll_amount, (scroll_window->ContentsRegionRect.GetHeight() + scroll_wind… in UpdateMouseWheel()
3287 … SetWindowScrollY(scroll_window, scroll_window->Scroll.y - g.IO.MouseWheel * scroll_amount); in UpdateMouseWheel()
3293 float scroll_amount = scroll_window->CalcFontSize(); in UpdateMouseWheel()
3294 SetWindowScrollX(scroll_window, scroll_window->Scroll.x - g.IO.MouseWheelH * scroll_amount); in UpdateMouseWheel()
3298 // The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hoverin…
3304 …// - Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWin… in UpdateHoveredWindowAndCaptureFlags()
3305 …// - When moving a window we can skip the search, which also conveniently bypasses the fact that w… in UpdateHoveredWindowAndCaptureFlags()
3306 …// - We also support the moved window toggling the NoInputs flag after moving has started in order… in UpdateHoveredWindowAndCaptureFlags()
3320 int mouse_earliest_button_down = -1; in UpdateHoveredWindowAndCaptureFlags()
3328 …if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[i] < g.IO.MouseClickedTime[mouse_ear… in UpdateHoveredWindowAndCaptureFlags()
3331 …const bool mouse_avail_to_imgui = (mouse_earliest_button_down == -1) || g.IO.MouseDownOwned[mouse_… in UpdateHoveredWindowAndCaptureFlags()
3334 …rns of drag and drop across OS windows, we may need to rework/remove this test (first committed 31… in UpdateHoveredWindowAndCaptureFlags()
3340 if (g.WantCaptureMouseNextFrame != -1) in UpdateHoveredWindowAndCaptureFlags()
3346 if (g.WantCaptureKeyboardNextFrame != -1) in UpdateHoveredWindowAndCaptureFlags()
3353 …xtInput flag, this is to allow systems without a keyboard (e.g. mobile, hand-held) to show a softw… in UpdateHoveredWindowAndCaptureFlags()
3354 g.IO.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false; in UpdateHoveredWindowAndCaptureFlags()
3371 …IM_ASSERT(g.IO.Fonts->Fonts.Size > 0 && "Font Atlas not built. Did … in NewFrame()
3372 …IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did … in NewFrame()
3377 …O.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out … in NewFrame()
3381 …IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboar… in NewFrame()
3383 …// Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires back-end to hono… in NewFrame()
3399 g.SettingsDirtyTimer -= g.IO.DeltaTime; in NewFrame()
3417 g.IO.Fonts->Locked = true; in NewFrame()
3419 IM_ASSERT(g.Font->IsLoaded()); in NewFrame()
3424 g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID); in NewFrame()
3470 …[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f; in NewFrame()
3478 // Calculate frame-rate for the user, as a purely luxurious feature in NewFrame()
3479 … g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx]; in NewFrame()
3492 g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f); in NewFrame()
3495 g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1; in NewFrame()
3496 …g.PlatformImePos = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window… in NewFrame()
3502 …if (g.ActiveId == 0 && g.NavWindow != NULL && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiW… in NewFrame()
3505 g.NavWindow->FocusIdxTabRequestNext = g.NavIdTabCounter + 1 + (g.IO.KeyShift ? -1 : 1); in NewFrame()
3507 g.NavWindow->FocusIdxTabRequestNext = g.IO.KeyShift ? -1 : 0; in NewFrame()
3516 window->WasActive = window->Active; in NewFrame()
3517 window->Active = false; in NewFrame()
3518 window->WriteAccessed = false; in NewFrame()
3521 … // Closing the focused window restore focus to the first active root window in descending z-order in NewFrame()
3522 if (g.NavWindow && !g.NavWindow->WasActive) in NewFrame()
3531 …// Create implicit/fallback window - which we will only render it if the user has added something … in NewFrame()
3567 g.IO.Fonts->Locked = false; in Shutdown()
3630 if (int d = (a->Flags & ImGuiWindowFlags_Popup) - (b->Flags & ImGuiWindowFlags_Popup)) in ChildWindowComparer()
3632 if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip)) in ChildWindowComparer()
3634 return (a->BeginOrderWithinParent - b->BeginOrderWithinParent); in ChildWindowComparer()
3639 out_sorted_windows->push_back(window); in AddWindowToSortBuffer()
3640 if (window->Active) in AddWindowToSortBuffer()
3642 int count = window->DC.ChildWindows.Size; in AddWindowToSortBuffer()
3644 …ImQsort(window->DC.ChildWindows.begin(), (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer); in AddWindowToSortBuffer()
3647 ImGuiWindow* child = window->DC.ChildWindows[i]; in AddWindowToSortBuffer()
3648 if (child->Active) in AddWindowToSortBuffer()
3656 if (draw_list->CmdBuffer.empty()) in AddDrawListToDrawData()
3660 ImDrawCmd& last_cmd = draw_list->CmdBuffer.back(); in AddDrawListToDrawData()
3663 draw_list->CmdBuffer.pop_back(); in AddDrawListToDrawData()
3664 if (draw_list->CmdBuffer.empty()) in AddDrawListToDrawData()
3669 …IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data +… in AddDrawListToDrawData()
3670 …IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data +… in AddDrawListToDrawData()
3671 IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); in AddDrawListToDrawData()
3677 …You'll need to handle the 4-bytes indices to your renderer. For example, the OpenGL example code d… in AddDrawListToDrawData()
3678 …// glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNE… in AddDrawListToDrawData()
3682 …IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit i… in AddDrawListToDrawData()
3684 out_list->push_back(draw_list); in AddDrawListToDrawData()
3691 AddDrawListToDrawData(out_render_list, window->DrawList); in AddWindowToDrawData()
3692 for (int i = 0; i < window->DC.ChildWindows.Size; i++) in AddWindowToDrawData()
3694 ImGuiWindow* child = window->DC.ChildWindows[i]; in AddWindowToDrawData()
3703 if (window->Flags & ImGuiWindowFlags_Tooltip) in AddRootWindowToDrawData()
3730 draw_data->Valid = true; in SetupDrawData()
3731 draw_data->CmdLists = (draw_lists->Size > 0) ? draw_lists->Data : NULL; in SetupDrawData()
3732 draw_data->CmdListsCount = draw_lists->Size; in SetupDrawData()
3733 draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0; in SetupDrawData()
3734 draw_data->DisplayPos = ImVec2(0.0f, 0.0f); in SetupDrawData()
3735 draw_data->DisplaySize = io.DisplaySize; in SetupDrawData()
3736 draw_data->FramebufferScale = io.DisplayFramebufferScale; in SetupDrawData()
3737 for (int n = 0; n < draw_lists->Size; n++) in SetupDrawData()
3739 draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size; in SetupDrawData()
3740 draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size; in SetupDrawData()
3744 …that float are perfectly rounded to integer values, to that e.g. (int)(max.x-min.x) in user's rend…
3748 window->DrawList->PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect); in PushClipRect()
3749 window->ClipRect = window->DrawList->_ClipRectStack.back(); in PushClipRect()
3755 window->DrawList->PopClipRect(); in PopClipRect()
3756 window->ClipRect = window->DrawList->_ClipRectStack.back(); in PopClipRect()
3769 …n && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > … in EndFrame()
3782 while (g.CurrentWindowStack.Size > 1) // FIXME-ERRORHANDLING in EndFrame()
3793 if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed) in EndFrame()
3794 g.CurrentWindow->Active = false; in EndFrame()
3822 // Initiate moving window + handle left-click and right-click focus in EndFrame()
3832 …if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is activ… in EndFrame()
3843 g.IO.Fonts->Locked = false; in EndFrame()
3864 …ndowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavW… in Render()
3869 …if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && win… in Render()
3873 …nder_front_most[n])) // NavWindowingTarget is always temporarily displayed as the front-most window in Render()
3884 // Setup ImDrawData structure for end-user in Render()
3896 // Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
3897 // CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize)
3912 …ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NUL… in CalcTextSize()
3921 // NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instruct…
3934 if (window->SkipItems) in CalcListClipping()
3941 ImRect unclipped_rect = window->ClipRect; in CalcListClipping()
3945 const ImVec2 pos = window->DC.CursorPos; in CalcListClipping()
3946 int start = (int)((unclipped_rect.Min.y - pos.y) / items_height); in CalcListClipping()
3947 int end = (int)((unclipped_rect.Max.y - pos.y) / items_height); in CalcListClipping()
3951 start--; in CalcListClipping()
3961 // Find window given position, search front-to-back
3970 if (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs)) in FindHoveredWindow()
3975 for (int i = g.Windows.Size - 1; i >= 0; i--) in FindHoveredWindow()
3978 if (!window->Active || window->Hidden) in FindHoveredWindow()
3980 if (window->Flags & ImGuiWindowFlags_NoMouseInputs) in FindHoveredWindow()
3984 ImRect bb(window->OuterRectClipped); in FindHoveredWindow()
3985 … if ((window->Flags & ImGuiWindowFlags_ChildWindow) || (window->Flags & ImGuiWindowFlags_NoResize)) in FindHoveredWindow()
4000 g.HoveredRootWindow = g.HoveredWindow ? g.HoveredWindow->RootWindow : NULL; in FindHoveredWindow()
4004 // Test if mouse cursor is hovering given rectangle
4005 // NB- Rectangle is clipped by our current clip setting
4006 // NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
4014 rect_clipped.ClipWith(g.CurrentWindow->ClipRect); in IsMouseHoveringRect()
4017 …const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Sty… in IsMouseHoveringRect()
4026 return GImGui->IO.KeyMap[imgui_key]; in GetKeyIndex()
4029 …ntry of io.KeysDown[]. Use your own indices/enums according to how your back-end/engine stored the…
4033 IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(GImGui->IO.KeysDown)); in IsKeyDown()
4034 return GImGui->IO.KeysDown[user_key_index]; in IsKeyDown()
4043 …const int count = (int)((t - repeat_delay) / repeat_rate) - (int)((t_prev - repeat_delay) / repeat… in CalcTypematicPressedRepeatAmount()
4054 return CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, repeat_delay, repeat_rate); in GetKeyPressedAmount()
4106 …if ((ImFmod(t - delay, rate) > rate*0.5f) != (ImFmod(t - delay - g.IO.DeltaTime, rate) > rate*0.5f… in IsMouseClicked()
4140 return GImGui->IO.MousePos; in GetMousePos()
4148 return g.OpenPopupStack[g.BeginPopupStack.Size-1].OpenMousePos; in GetMousePosOnOpeningCurrentPopup()
4152 // We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
4155 // The assert is only to silence a false-positive in XCode Static Analysis. in IsMousePosValid()
4158 const float MOUSE_INVALID = -256000.0f; in IsMousePosValid()
4159 ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos; in IsMousePosValid()
4165 // NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse positi…
4174 …return g.IO.MousePos - g.IO.MouseClickedPos[button]; // Assume we can only get active with lef… in GetMouseDragDelta()
4188 return GImGui->MouseCursor; in GetMouseCursor()
4193 GImGui->MouseCursor = cursor_type; in SetMouseCursor()
4198 GImGui->WantCaptureKeyboardNextFrame = capture ? 1 : 0; in CaptureKeyboardFromApp()
4203 GImGui->WantCaptureMouseNextFrame = capture ? 1 : 0; in CaptureMouseFromApp()
4212 return g.ActiveId == window->DC.LastItemId; in IsItemActive()
4223 if (g.ActiveId == window->DC.LastItemId && g.ActiveIdPreviousFrame != window->DC.LastItemId) in IsItemActivated()
4233 …eturn (g.ActiveIdPreviousFrame == window->DC.LastItemId && g.ActiveIdPreviousFrame != 0 && g.Activ… in IsItemDeactivated()
4247 if (g.NavId == 0 || g.NavDisableHighlight || g.NavId != window->DC.LastItemId) in IsItemFocused()
4278 return window->ClipRect.Overlaps(window->DC.LastItemRect); in IsItemVisible()
4284 return (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_Edited) != 0; in IsItemEdited()
4291 if (g.HoveredId == g.CurrentWindow->DC.LastItemId) in SetItemAllowOverlap()
4293 if (g.ActiveId == g.CurrentWindow->DC.LastItemId) in SetItemAllowOverlap()
4300 return window->DC.LastItemRect.Min; in GetItemRectMin()
4306 return window->DC.LastItemRect.Max; in GetItemRectMax()
4312 return window->DC.LastItemRect.GetSize(); in GetItemRectSize()
4327 flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag in BeginChildEx()
4342 ImFormatString(title, IM_ARRAYSIZE(title), "%s/%s_%08X", parent_window->Name, name, id); in BeginChildEx()
4344 ImFormatString(title, IM_ARRAYSIZE(title), "%s/%08X", parent_window->Name, id); in BeginChildEx()
4353 child_window->ChildId = id; in BeginChildEx()
4354 child_window->AutoFitChildAxises = auto_fit_axises; in BeginChildEx()
4358 if (child_window->BeginCount == 1) in BeginChildEx()
4359 parent_window->DC.CursorPos = child_window->Pos; in BeginChildEx()
4361 // Process navigation-in immediately so NavInit can run on first frame in BeginChildEx()
4362 …lags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window… in BeginChildEx()
4366 …SetActiveID(id+1, child_window); // Steal ActiveId with a dummy id so that key-press won't activat… in BeginChildEx()
4375 return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags); in BeginChild()
4389 …IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() c… in EndChild()
4390 if (window->BeginCount > 1) in EndChild()
4396 ImVec2 sz = window->Size; in EndChild()
4397 …if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4… in EndChild()
4399 if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y)) in EndChild()
4404 ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); in EndChild()
4406 …if ((window->DC.NavLayerActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWind… in EndChild()
4408 ItemAdd(bb, window->ChildId); in EndChild()
4409 RenderNavHighlight(bb, window->ChildId); in EndChild()
4412 if (window->DC.NavLayerActiveMask == 0 && window == g.NavWindow) in EndChild()
4413 …RenderNavHighlight(ImRect(bb.Min - ImVec2(2,2), bb.Max + ImVec2(2,2)), g.NavId, ImGuiNavHighlightF… in EndChild()
4448 short* p_backup = &window->DC.StackSizesBackup[0]; in CheckStacksSize()
4449 …{ int current = window->IDStack.Size; if (write) *p_backup = (short)current; else IM_ASSERT(… in CheckStacksSize()
4450 …{ int current = window->DC.GroupStack.Size; if (write) *p_backup = (short)current; else IM_ASSERT(… in CheckStacksSize()
4456 IM_ASSERT(p_backup == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup)); in CheckStacksSize()
4461 …window->SetWindowPosAllowFlags = enabled ? (window->SetWindowPosAllowFlags | flags) : … in SetWindowConditionAllowFlags()
4462 …window->SetWindowSizeAllowFlags = enabled ? (window->SetWindowSizeAllowFlags | flags) : … in SetWindowConditionAllowFlags()
4463 …window->SetWindowCollapsedAllowFlags = enabled ? (window->SetWindowCollapsedAllowFlags | flags) : … in SetWindowConditionAllowFlags()
4484 window->Flags = flags; in CreateNewWindow()
4485 g.WindowsById.SetVoidPtr(window->ID, window); in CreateNewWindow()
4488 window->Pos = ImVec2(60, 60); in CreateNewWindow()
4492 if (ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID)) in CreateNewWindow()
4495 window->SettingsIdx = g.SettingsWindows.index_from_ptr(settings); in CreateNewWindow()
4497 window->Pos = ImFloor(settings->Pos); in CreateNewWindow()
4498 window->Collapsed = settings->Collapsed; in CreateNewWindow()
4499 if (ImLengthSqr(settings->Size) > 0.00001f) in CreateNewWindow()
4500 size = ImFloor(settings->Size); in CreateNewWindow()
4502 window->Size = window->SizeFull = window->SizeFullAtLastBegin = ImFloor(size); in CreateNewWindow()
4503 …window->DC.CursorMaxPos = window->Pos; // So first call to CalcSizeContents() doesn't return crazy… in CreateNewWindow()
4507 window->AutoFitFramesX = window->AutoFitFramesY = 2; in CreateNewWindow()
4508 window->AutoFitOnlyGrows = false; in CreateNewWindow()
4512 if (window->Size.x <= 0.0f) in CreateNewWindow()
4513 window->AutoFitFramesX = 2; in CreateNewWindow()
4514 if (window->Size.y <= 0.0f) in CreateNewWindow()
4515 window->AutoFitFramesY = 2; in CreateNewWindow()
4516 window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); in CreateNewWindow()
4532 // Using -1,-1 on either X/Y axis to preserve the current size. in CalcSizeAfterConstraint()
4534 … = (cr.Min.x >= 0 && cr.Max.x >= 0) ? ImClamp(new_size.x, cr.Min.x, cr.Max.x) : window->SizeFull.x; in CalcSizeAfterConstraint()
4535 … = (cr.Min.y >= 0 && cr.Max.y >= 0) ? ImClamp(new_size.y, cr.Min.y, cr.Max.y) : window->SizeFull.y; in CalcSizeAfterConstraint()
4540 data.Pos = window->Pos; in CalcSizeAfterConstraint()
4541 data.CurrentSize = window->SizeFull; in CalcSizeAfterConstraint()
4549 if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) in CalcSizeAfterConstraint()
4552 …w_size.y = ImMax(new_size.y, window->TitleBarHeight() + window->MenuBarHeight() + ImMax(0.0f, g.St… in CalcSizeAfterConstraint()
4559 if (window->Collapsed) in CalcSizeContents()
4560 if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) in CalcSizeContents()
4561 return window->SizeContents; in CalcSizeContents()
4562 if (window->Hidden && window->HiddenFramesForResize == 0 && window->HiddenFramesRegular > 0) in CalcSizeContents()
4563 return window->SizeContents; in CalcSizeContents()
4566 …at)(int)((window->SizeContentsExplicit.x != 0.0f) ? window->SizeContentsExplicit.x : (window->DC.C… in CalcSizeContents()
4567 …at)(int)((window->SizeContentsExplicit.y != 0.0f) ? window->SizeContentsExplicit.y : (window->DC.C… in CalcSizeContents()
4568 return sz + window->WindowPadding; in CalcSizeContents()
4575 if (window->Flags & ImGuiWindowFlags_Tooltip) in CalcSizeAutoFit()
4583 const bool is_popup = (window->Flags & ImGuiWindowFlags_Popup) != 0; in CalcSizeAutoFit()
4584 const bool is_menu = (window->Flags & ImGuiWindowFlags_ChildMenu) != 0; in CalcSizeAutoFit()
4586 …pups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to … in CalcSizeAutoFit()
4588 …ImVec2 size_auto_fit = ImClamp(size_contents, size_min, ImMax(size_min, g.IO.DisplaySize - style.D… in CalcSizeAutoFit()
4591 …xis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding. in CalcSizeAutoFit()
4593 …it_after_constraint.x < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (win… in CalcSizeAutoFit()
4595 …if (size_auto_fit_after_constraint.y < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScr… in CalcSizeAutoFit()
4609 return ImMax(0.0f, window->SizeContents.x - (window->SizeFull.x - window->ScrollbarSizes.x)); in GetWindowScrollMaxX()
4614 return ImMax(0.0f, window->SizeContents.y - (window->SizeFull.y - window->ScrollbarSizes.y)); in GetWindowScrollMaxY()
4620 ImVec2 scroll = window->Scroll; in CalcNextScrollFromScrollTargetAndClamp()
4621 if (window->ScrollTarget.x < FLT_MAX) in CalcNextScrollFromScrollTargetAndClamp()
4623 float cr_x = window->ScrollTargetCenterRatio.x; in CalcNextScrollFromScrollTargetAndClamp()
4624 scroll.x = window->ScrollTarget.x - cr_x * (window->SizeFull.x - window->ScrollbarSizes.x); in CalcNextScrollFromScrollTargetAndClamp()
4626 if (window->ScrollTarget.y < FLT_MAX) in CalcNextScrollFromScrollTargetAndClamp()
4629 float cr_y = window->ScrollTargetCenterRatio.y; in CalcNextScrollFromScrollTargetAndClamp()
4630 float target_y = window->ScrollTarget.y; in CalcNextScrollFromScrollTargetAndClamp()
4631 if (snap_on_edges && cr_y <= 0.0f && target_y <= window->WindowPadding.y) in CalcNextScrollFromScrollTargetAndClamp()
4633 …if (snap_on_edges && cr_y >= 1.0f && target_y >= window->SizeContents.y - window->WindowPadding.y … in CalcNextScrollFromScrollTargetAndClamp()
4634 target_y = window->SizeContents.y; in CalcNextScrollFromScrollTargetAndClamp()
4635 …scroll.y = target_y - (1.0f - cr_y) * (window->TitleBarHeight() + window->MenuBarHeight()) - cr_y … in CalcNextScrollFromScrollTargetAndClamp()
4638 if (!window->Collapsed && !window->SkipItems) in CalcNextScrollFromScrollTargetAndClamp()
4657 …ImVec2 pos_min = ImLerp(corner_target, window->Pos, corner_norm); // Expected windo… in CalcResizePosSizeFromAnyCorner()
4658 …ImVec2 pos_max = ImLerp(window->Pos + window->Size, corner_target, corner_norm); // Expected windo… in CalcResizePosSizeFromAnyCorner()
4659 ImVec2 size_expected = pos_max - pos_min; in CalcResizePosSizeFromAnyCorner()
4663 out_pos->x -= (size_constrained.x - size_expected.x); in CalcResizePosSizeFromAnyCorner()
4665 out_pos->y -= (size_constrained.y - size_expected.y); in CalcResizePosSizeFromAnyCorner()
4678 { ImVec2(1,1), ImVec2(-1,-1), 0, 3 }, // Lower right
4679 { ImVec2(0,1), ImVec2(+1,-1), 3, 6 }, // Lower left
4681 { ImVec2(1,0), ImVec2(-1,+1), 9,12 }, // Upper right
4686 ImRect rect = window->Rect(); in GetResizeBorderRect()
4687 if (thickness == 0.0f) rect.Max -= ImVec2(1,1); in GetResizeBorderRect()
4688 …r_n == 0) return ImRect(rect.Min.x + perp_padding, rect.Min.y - thickness, rect.Max.x - perp_pa… in GetResizeBorderRect()
4689 …r_n == 1) return ImRect(rect.Max.x - thickness, rect.Min.y + perp_padding, rect.Max.x + thickne… in GetResizeBorderRect()
4690 …r_n == 2) return ImRect(rect.Min.x + perp_padding, rect.Max.y - thickness, rect.Max.x - perp_pa… in GetResizeBorderRect()
4691 …r_n == 3) return ImRect(rect.Min.x - thickness, rect.Min.y + perp_padding, rect.Min.x + thickne… in GetResizeBorderRect()
4700 ImGuiWindowFlags flags = window->Flags; in UpdateManualResize()
4701 …ize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoF… in UpdateManualResize()
4703 …if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implici… in UpdateManualResize()
4707 …const float grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f +… in UpdateManualResize()
4719 const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN); in UpdateManualResize()
4722 …ImRect resize_rect(corner - grip.InnerDir * grip_hover_outer_size, corner + grip.InnerDir * grip_h… in UpdateManualResize()
4726 …ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiB… in UpdateManualResize()
4727 …//GetOverlayDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255)… in UpdateManualResize()
4733 // Manual auto-fit when double-clicking in UpdateManualResize()
4741 …2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + ImLerp(grip.InnerDir * grip_hover_outer_… in UpdateManualResize()
4751 …ButtonBehavior(border_rect, window->GetID((void*)(intptr_t)(border_n + 4)), &hovered, &held, ImGui… in UpdateManualResize()
4752 …//GetOverlayDrawList(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255)… in UpdateManualResize()
4761 ImVec2 border_target = window->Pos; in UpdateManualResize()
4763 …if (border_n == 0) { border_posn = ImVec2(0, 0); border_target.y = (g.IO.MousePos.y - g.ActiveIdCl… in UpdateManualResize()
4764 …if (border_n == 1) { border_posn = ImVec2(1, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdCl… in UpdateManualResize()
4765 …if (border_n == 2) { border_posn = ImVec2(0, 1); border_target.y = (g.IO.MousePos.y - g.ActiveIdCl… in UpdateManualResize()
4766 …if (border_n == 3) { border_posn = ImVec2(0, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdCl… in UpdateManualResize()
4773 if (g.NavWindowingTarget && g.NavWindowingTarget->RootWindow == window) in UpdateManualResize()
4787 …// FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints… in UpdateManualResize()
4788 size_target = CalcSizeAfterConstraint(window, window->SizeFull + nav_resize_delta); in UpdateManualResize()
4795 window->SizeFull = size_target; in UpdateManualResize()
4800 window->Pos = ImFloor(pos_target); in UpdateManualResize()
4804 window->Size = window->SizeFull; in UpdateManualResize()
4810 float rounding = window->WindowRounding; in RenderOuterBorders()
4811 float border_size = window->WindowBorderSize; in RenderOuterBorders()
4812 if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground)) in RenderOuterBorders()
4813 …window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), r… in RenderOuterBorders()
4815 int border_held = window->ResizeBorderHeld; in RenderOuterBorders()
4816 if (border_held != -1) in RenderOuterBorders()
4827 { ImVec2(-1,0), ImVec2(1,0), ImVec2(1,1), IM_PI*0.00f }, // Right in RenderOuterBorders()
4828 { ImVec2(0,-1), ImVec2(1,1), ImVec2(0,1), IM_PI*0.50f }, // Bottom in RenderOuterBorders()
4833 …ow->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN1) + ImVec2(0.5f, 0.5f) +… in RenderOuterBorders()
4834 …window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN2) + ImVec2(0.5f, 0.5… in RenderOuterBorders()
4835 …window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), false, ImMax(2.0f, border_size… in RenderOuterBorders()
4837 if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) in RenderOuterBorders()
4839 float y = window->Pos.y + window->TitleBarHeight() - 1; in RenderOuterBorders()
4840 …window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->S… in RenderOuterBorders()
4846 window->ParentWindow = parent_window; in UpdateWindowParentAndRootLinks()
4847 window->RootWindow = window->RootWindowForTitleBarHighlight = window->RootWindowForNav = window; in UpdateWindowParentAndRootLinks()
4849 window->RootWindow = parent_window->RootWindow; in UpdateWindowParentAndRootLinks()
4851 window->RootWindowForTitleBarHighlight = parent_window->RootWindowForTitleBarHighlight; in UpdateWindowParentAndRootLinks()
4852 while (window->RootWindowForNav->Flags & ImGuiWindowFlags_NavFlattened) in UpdateWindowParentAndRootLinks()
4854 IM_ASSERT(window->RootWindowForNav->ParentWindow != NULL); in UpdateWindowParentAndRootLinks()
4855 window->RootWindowForNav = window->RootWindowForNav->ParentWindow; in UpdateWindowParentAndRootLinks()
4860 // - A default window called "Debug" is automatically stacked at the beginning of every frame so yo…
4861 // - Begin/End can be called multiple times during the frame with the same window name to append co…
4862 // - The window name is used as a unique identifier to preserve window information across frames (a…
4864 // - Return false when window is collapsed, so you can early out in your code. You always need to c…
4865 // - Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the po…
4891 const bool first_begin_of_the_frame = (window->LastFrameActive != current_frame); in Begin()
4895 window->Flags = (ImGuiWindowFlags)flags; in Begin()
4897 flags = window->Flags; in Begin()
4899 …// Parent window is latched only on the first call to Begin() of the frame, so further append-call… in Begin()
4901 …ags_ChildWindow | ImGuiWindowFlags_Popup)) ? parent_window_in_stack : NULL) : window->ParentWindow; in Begin()
4903 window->HasCloseButton = (p_open != NULL); in Begin()
4906 …ser = (window->LastFrameActive < current_frame - 1); // Not using !WasActive because the implici… in Begin()
4907 const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesForResize > 0); in Begin()
4911 …window_just_activated_by_user |= (window->PopupId != popup_ref.PopupId); // We recycle popups so t… in Begin()
4914 …window->Appearing = (window_just_activated_by_user || window_just_appearing_after_hidden_for_resiz… in Begin()
4915 if (window->Appearing) in Begin()
4927 window->PopupId = popup_ref.PopupId; in Begin()
4931 window->NavLastIds[0] = 0; in Begin()
4938 window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.NextWindowData.PosCond) != 0; in Begin()
4943 window->SetWindowPosVal = g.NextWindowData.PosVal; in Begin()
4944 window->SetWindowPosPivot = g.NextWindowData.PosPivotVal; in Begin()
4945 …window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); in Begin()
4954 …window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (… in Begin()
4955 …window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (… in Begin()
4961 window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal; in Begin()
4962 if (window->SizeContentsExplicit.y != 0.0f) in Begin()
4963 window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); in Begin()
4967 window->SizeContentsExplicit = ImVec2(0.0f, 0.0f); in Begin()
4973 if (window->Appearing) in Begin()
4980 …mGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented beh… in Begin()
4983 window->Active = true; in Begin()
4984 window->BeginOrderWithinParent = 0; in Begin()
4985 window->BeginOrderWithinContext = (short)(g.WindowsActiveCount++); in Begin()
4986 window->BeginCount = 0; in Begin()
4987 window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX); in Begin()
4988 window->LastFrameActive = current_frame; in Begin()
4989 window->IDStack.resize(1); in Begin()
4992 …arameter, so we only update the string storage if it needs to be visible to the end-user elsewhere. in Begin()
4994 …if (g.NavWindowingList != NULL && (window->Flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window … in Begin()
4996 … if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->Name) != 0) in Begin()
4998 size_t buf_len = (size_t)window->NameBufLen; in Begin()
4999 window->Name = ImStrdupcpy(window->Name, &buf_len, name); in Begin()
5000 window->NameBufLen = (int)buf_len; in Begin()
5005 // Update contents size from last frame for auto-fitting (or use explicit size) in Begin()
5006 window->SizeContents = CalcSizeContents(window); in Begin()
5007 if (window->HiddenFramesRegular > 0) in Begin()
5008 window->HiddenFramesRegular--; in Begin()
5009 if (window->HiddenFramesForResize > 0) in Begin()
5010 window->HiddenFramesForResize--; in Begin()
5014 window->HiddenFramesForResize = 1; in Begin()
5016 …// Hide popup/tooltip window when re-opening while we measure size (because we recycle the windows) in Begin()
5020 window->HiddenFramesForResize = 1; in Begin()
5024 window->Size.x = window->SizeFull.x = 0.f; in Begin()
5026 window->Size.y = window->SizeFull.y = 0.f; in Begin()
5027 window->SizeContents = ImVec2(0.f, 0.f); in Begin()
5034 …window->WindowBorderSize = (flags & ImGuiWindowFlags_ChildWindow) ? style.ChildBorderSize : ((flag… in Begin()
5035 window->WindowPadding = style.WindowPadding; in Begin()
5036 …ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == … in Begin()
5037 …window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : … in Begin()
5038 …window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWind… in Begin()
5039 window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y; in Begin()
5041 // Collapse window by double-clicking on title bar in Begin()
5045 …// We don't use a regular button+id to test for double-click on title bar (mostly due to legacy re… in Begin()
5046 ImRect title_bar_rect = window->TitleBarRect(); in Begin()
5048 window->WantCollapseToggle = true; in Begin()
5049 if (window->WantCollapseToggle) in Begin()
5051 window->Collapsed = !window->Collapsed; in Begin()
5058 window->Collapsed = false; in Begin()
5060 window->WantCollapseToggle = false; in Begin()
5064 // Calculate auto-fit size, handle automatic resize in Begin()
5065 const ImVec2 size_auto_fit = CalcSizeAutoFit(window, window->SizeContents); in Begin()
5067 if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed) in Begin()
5071 window->SizeFull.x = size_full_modified.x = size_auto_fit.x; in Begin()
5073 window->SizeFull.y = size_full_modified.y = size_auto_fit.y; in Begin()
5075 else if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) in Begin()
5077 // Auto-fit may only grow window during the first few frames in Begin()
5078 …// We still process initial auto-fit on collapsed windows to get a window width, but otherwise don… in Begin()
5079 if (!window_size_x_set_by_api && window->AutoFitFramesX > 0) in Begin()
5080 …window->SizeFull.x = size_full_modified.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, s… in Begin()
5081 if (!window_size_y_set_by_api && window->AutoFitFramesY > 0) in Begin()
5082 …window->SizeFull.y = size_full_modified.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, s… in Begin()
5083 if (!window->Collapsed) in Begin()
5088 window->SizeFull = CalcSizeAfterConstraint(window, window->SizeFull); in Begin()
5089 …window->Size = window->Collapsed && !(flags & ImGuiWindowFlags_ChildWindow) ? window->TitleBarRect… in Begin()
5093 …scrollbar status (based on the Size that was effective during last frame or the auto-resized Size). in Begin()
5094 if (!window->Collapsed) in Begin()
5097 … size_x_for_scrollbars = size_full_modified.x != FLT_MAX ? window->SizeFull.x : window->SizeFullAt… in Begin()
5098 … size_y_for_scrollbars = size_full_modified.y != FLT_MAX ? window->SizeFull.y : window->SizeFullAt… in Begin()
5099 …window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((window->SizeContents.… in Begin()
5100 …window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((window->SizeContent… in Begin()
5101 if (window->ScrollbarX && !window->ScrollbarY) in Begin()
5102 …window->ScrollbarY = (window->SizeContents.y > size_y_for_scrollbars - style.ScrollbarSize) && !(f… in Begin()
5103 …window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->Scrollbar… in Begin()
5111 window->AutoPosLastDirection = ImGuiDir_None; in Begin()
5113 window->Pos = g.BeginPopupStack.back().OpenPopupPos; in Begin()
5119 IM_ASSERT(parent_window && parent_window->Active); in Begin()
5120 window->BeginOrderWithinParent = (short)parent_window->DC.ChildWindows.Size; in Begin()
5121 parent_window->DC.ChildWindows.push_back(window); in Begin()
5123 window->Pos = parent_window->DC.CursorPos; in Begin()
5126 …const bool window_pos_with_pivot = (window->SetWindowPosVal.x != FLT_MAX && window->HiddenFramesFo… in Begin()
5128 …os(window, ImMax(style.DisplaySafeAreaPadding, window->SetWindowPosVal - window->SizeFull * window… in Begin()
5130 window->Pos = FindBestWindowPosForPopup(window); in Begin()
5132 window->Pos = FindBestWindowPosForPopup(window); in Begin()
5134 window->Pos = FindBestWindowPosForPopup(window); in Begin()
5137 …// Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero… in Begin()
5138 …_by_api && !(flags & ImGuiWindowFlags_ChildWindow) && window->AutoFitFramesX <= 0 && window->AutoF… in Begin()
5140 …splaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window … in Begin()
5143 …mTitleBarOnly) && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) ? ImVec2(window->Size.x, window-… in Begin()
5144 window->Pos = ImMax(window->Pos + size_for_clamping, padding) - size_for_clamping; in Begin()
5145 window->Pos = ImMin(window->Pos, g.IO.DisplaySize - padding); in Begin()
5148 window->Pos = ImFloor(window->Pos); in Begin()
5151 …window->WindowRounding = (flags & ImGuiWindowFlags_ChildWindow) ? style.ChildRounding : ((flags & … in Begin()
5154 …->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext == INT_MAX || window->FocusIdxAllCou… in Begin()
5155 …->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext == INT_MAX || window->FocusIdxTabCou… in Begin()
5156 window->FocusIdxAllCounter = window->FocusIdxTabCounter = -1; in Begin()
5157 window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext = INT_MAX; in Begin()
5160 window->Scroll = CalcNextScrollFromScrollTargetAndClamp(window, true); in Begin()
5161 window->ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); in Begin()
5174 int border_held = -1; in Begin()
5177 …const float grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f +… in Begin()
5178 if (!window->Collapsed) in Begin()
5180 window->ResizeBorderHeld = (signed char)border_held; in Begin()
5183 …if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_Alw… in Begin()
5184 window->ItemWidthDefault = (float)(int)(window->Size.x * 0.65f); in Begin()
5186 window->ItemWidthDefault = (float)(int)(g.FontSize * 16.0f); in Begin()
5191 window->DrawList->Clear(); in Begin()
5192 …window->DrawList->Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.S… in Begin()
5193 window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID); in Begin()
5196 PushClipRect(parent_window->ClipRect.Min, parent_window->ClipRect.Max, true); in Begin()
5201 …gs & ImGuiWindowFlags_Modal) && window == GetFrontMostPopupModal() && window->HiddenFramesForResiz… in Begin()
5202 …_bg_for_window_list = g.NavWindowingTargetAnim && (window == g.NavWindowingTargetAnim->RootWindow); in Begin()
5206 window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, dim_bg_col); in Begin()
5212 ImRect bb = window->Rect(); in Begin()
5215 …window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavW… in Begin()
5220 const float window_rounding = window->WindowRounding; in Begin()
5221 const float window_border_size = window->WindowBorderSize; in Begin()
5223 …t = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_high… in Begin()
5224 const ImRect title_bar_rect = window->TitleBarRect(); in Begin()
5225 if (window->Collapsed) in Begin()
5229 g.Style.FrameBorderSize = window->WindowBorderSize; in Begin()
5245 …window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + w… in Begin()
5253 …window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, window_roun… in Begin()
5259 ImRect menu_bar_rect = window->MenuBarRect(); in Begin()
5260 …menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have m… in Begin()
5261 …window->DrawList->AddRectFilled(menu_bar_rect.Min, menu_bar_rect.Max, GetColorU32(ImGuiCol_MenuBar… in Begin()
5262 … if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y) in Begin()
5263 …window->DrawList->AddLine(menu_bar_rect.GetBL(), menu_bar_rect.GetBR(), GetColorU32(ImGuiCol_Borde… in Begin()
5267 if (window->ScrollbarX) in Begin()
5269 if (window->ScrollbarY) in Begin()
5278 … const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN); in Begin()
5279 …window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(window_border_… in Begin()
5280 …window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(grip_draw_size… in Begin()
5281 …window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + window_bord… in Begin()
5282 window->DrawList->PathFillConvex(resize_grip_col[resize_grip_n]); in Begin()
5293 float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding); in Begin()
5294 ImRect bb = window->Rect(); in Begin()
5298 bb.Expand(-g.FontSize - 1.0f); in Begin()
5299 rounding = window->WindowRounding; in Begin()
5301 …window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowi… in Begin()
5305 window->SizeFullAtLastBegin = window->SizeFull; in Begin()
5308 …// FIXME: window->ContentsRegionRect.Max is currently very misleading / partly faulty, but some Be… in Begin()
5309 … window->ContentsRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x; in Begin()
5310 …window->ContentsRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + wi… in Begin()
5311 …->ContentsRegionRect.Max.x = window->Pos.x - window->Scroll.x - window->WindowPadding.x + (window-… in Begin()
5312 …->ContentsRegionRect.Max.y = window->Pos.y - window->Scroll.y - window->WindowPadding.y + (window-… in Begin()
5315 …ant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.) in Begin()
5316 window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x; in Begin()
5317 window->DC.GroupOffset.x = 0.0f; in Begin()
5318 window->DC.ColumnsOffset.x = 0.0f; in Begin()
5319 …->DC.CursorStartPos = window->Pos + ImVec2(window->DC.Indent.x + window->DC.ColumnsOffset.x, windo… in Begin()
5320 window->DC.CursorPos = window->DC.CursorStartPos; in Begin()
5321 window->DC.CursorPosPrevLine = window->DC.CursorPos; in Begin()
5322 window->DC.CursorMaxPos = window->DC.CursorStartPos; in Begin()
5323 window->DC.CurrentLineSize = window->DC.PrevLineSize = ImVec2(0.0f, 0.0f); in Begin()
5324 window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f; in Begin()
5325 window->DC.NavHideHighlightOneFrame = false; in Begin()
5326 window->DC.NavHasScroll = (GetWindowScrollMaxY(window) > 0.0f); in Begin()
5327 window->DC.NavLayerActiveMask = window->DC.NavLayerActiveMaskNext; in Begin()
5328 window->DC.NavLayerActiveMaskNext = 0x00; in Begin()
5329 window->DC.MenuBarAppending = false; in Begin()
5330 window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; in Begin()
5331 window->DC.ChildWindows.resize(0); in Begin()
5332 window->DC.LayoutType = ImGuiLayoutType_Vertical; in Begin()
5333 …window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Verti… in Begin()
5334 … window->DC.ItemFlags = parent_window ? parent_window->DC.ItemFlags : ImGuiItemFlags_Default_; in Begin()
5335 window->DC.ItemWidth = window->ItemWidthDefault; in Begin()
5336 window->DC.TextWrapPos = -1.0f; // disabled in Begin()
5337 window->DC.ItemFlagsStack.resize(0); in Begin()
5338 window->DC.ItemWidthStack.resize(0); in Begin()
5339 window->DC.TextWrapPosStack.resize(0); in Begin()
5340 window->DC.ColumnsSet = NULL; in Begin()
5341 window->DC.TreeDepth = 0; in Begin()
5342 window->DC.TreeDepthMayJumpToParentOnPop = 0x00; in Begin()
5343 window->DC.StateStorage = &window->StateStorage; in Begin()
5344 window->DC.GroupStack.resize(0); in Begin()
5345 window->MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user); in Begin()
5347 …if ((flags & ImGuiWindowFlags_ChildWindow) && (window->DC.ItemFlags != parent_window->DC.ItemFlags… in Begin()
5349 window->DC.ItemFlags = parent_window->DC.ItemFlags; in Begin()
5350 window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); in Begin()
5353 if (window->AutoFitFramesX > 0) in Begin()
5354 window->AutoFitFramesX--; in Begin()
5355 if (window->AutoFitFramesY > 0) in Begin()
5356 window->AutoFitFramesY--; in Begin()
5369 const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags; in Begin()
5370 window->DC.ItemFlags |= ImGuiItemFlags_NoNavDefaultFocus; in Begin()
5371 window->DC.NavLayerCurrent = ImGuiNavLayer_Menu; in Begin()
5372 window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Menu); in Begin()
5376 if (CollapseButton(window->GetID("#COLLAPSE"), window->Pos)) in Begin()
5377 …window->WantCollapseToggle = true; // Defer collapsing to next frame as we are too far in the Begi… in Begin()
5384 …if (CloseButton(window->GetID("#CLOSE"), window->Rect().GetTR() + ImVec2(-pad - rad, pad + rad), r… in Begin()
5388 window->DC.NavLayerCurrent = ImGuiNavLayer_Main; in Begin()
5389 window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main); in Begin()
5390 window->DC.ItemFlags = item_flags_backup; in Begin()
5403 text_r.Max.x -= pad_right; in Begin()
5405 …clip_rect.Max.x = window->Pos.x + window->Size.x - (p_open ? title_bar_rect.GetHeight() - 3 : styl… in Begin()
5409 …text_r.Min.x + (text_r.GetWidth() - text_size.x) * style.WindowTitleAlign.x) + text_size.x, text_r… in Begin()
5410 ImVec2 off = ImVec2(0.0f, (float)(int)(-g.FontSize * 0.25f)); in Begin()
5415 // Save clipped aabb so we can access it in constant-time in FindHoveredWindow() in Begin()
5416 window->OuterRectClipped = window->Rect(); in Begin()
5417 window->OuterRectClipped.ClipWith(window->ClipRect); in Begin()
5420 …t handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work t… in Begin()
5431 window->InnerMainRect.Min.x = title_bar_rect.Min.x + window->WindowBorderSize; in Begin()
5432 …->InnerMainRect.Min.y = title_bar_rect.Max.y + window->MenuBarHeight() + (((flags & ImGuiWindowFla… in Begin()
5433 …window->InnerMainRect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x - window->… in Begin()
5434 …window->InnerMainRect.Max.y = window->Pos.y + window->Size.y - window->ScrollbarSizes.y - window->… in Begin()
5435 //window->DrawList->AddRect(window->InnerRect.Min, window->InnerRect.Max, IM_COL32_WHITE); in Begin()
5438 …// Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce … in Begin()
5439 …window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerMainRect.Min.x + ImMax(0.0f, ImFloor(win… in Begin()
5440 window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerMainRect.Min.y); in Begin()
5441 …window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerMainRect.Max.x - ImMax(0.0f, ImFloor(win… in Begin()
5442 window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerMainRect.Max.y); in Begin()
5446 window->DC.LastItemId = window->MoveId; in Begin()
5447 …window->DC.LastItemStatusFlags = IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false… in Begin()
5448 window->DC.LastItemRect = title_bar_rect; in Begin()
5451 PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); in Begin()
5455 window->WriteAccessed = false; in Begin()
5457 window->BeginCount++; in Begin()
5465 …if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFit… in Begin()
5466 …if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.M… in Begin()
5467 window->HiddenFramesRegular = 1; in Begin()
5470 if (parent_window && (parent_window->Collapsed || parent_window->Hidden)) in Begin()
5471 window->HiddenFramesRegular = 1; in Begin()
5476 window->HiddenFramesRegular = 1; in Begin()
5479 window->Hidden = (window->HiddenFramesRegular > 0) || (window->HiddenFramesForResize > 0); in Begin()
5482 …indow->SkipItems = (window->Collapsed || !window->Active || window->Hidden) && window->AutoFitFram… in Begin()
5484 return !window->SkipItems; in Begin()
5510 return; // FIXME-ERRORHANDLING in End()
5516 if (window->DC.ColumnsSet != NULL) in End()
5521 …if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of lo… in End()
5526 if (window->Flags & ImGuiWindowFlags_Popup) in End()
5537 for (int i = g.WindowsFocusOrder.Size - 2; i >= 0; i--) // We can ignore the front most window in BringWindowToFocusFront()
5540 …sOrder[i], &g.WindowsFocusOrder[i + 1], (size_t)(g.WindowsFocusOrder.Size - i - 1) * sizeof(ImGuiW… in BringWindowToFocusFront()
5541 g.WindowsFocusOrder[g.WindowsFocusOrder.Size - 1] = window; in BringWindowToFocusFront()
5550 if (current_front_window == window || current_front_window->RootWindow == window) in BringWindowToDisplayFront()
5552 for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the front most window in BringWindowToDisplayFront()
5555 …memmove(&g.Windows[i], &g.Windows[i + 1], (size_t)(g.Windows.Size - i - 1) * sizeof(ImGuiWindow*)); in BringWindowToDisplayFront()
5556 g.Windows[g.Windows.Size - 1] = window; in BringWindowToDisplayFront()
5586 g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId in FocusWindow()
5589 //IMGUI_DEBUG_LOG("FocusWindow(\"%s\")\n", window ? window->Name : NULL); in FocusWindow()
5597 if (window->RootWindow) in FocusWindow()
5598 window = window->RootWindow; in FocusWindow()
5601 …if (window->Flags & ImGuiWindowFlags_Popup) // FIXME: This statement should be unnecessary. Need f… in FocusWindow()
5602 if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != window) in FocusWindow()
5607 if (!(window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) in FocusWindow()
5614 for (int i = g.WindowsFocusOrder.Size - 1; i >= 0; i--) in FocusPreviousWindowIgnoringOne()
5616 …// We may later decide to test for different NoXXXInputs based on the active navigation input (mou… in FocusPreviousWindowIgnoringOne()
5618 …if (window != ignore_window && window->WasActive && !(window->Flags & ImGuiWindowFlags_ChildWindow… in FocusPreviousWindowIgnoringOne()
5619 …if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWin… in FocusPreviousWindowIgnoringOne()
5631 window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width); in PushItemWidth()
5632 window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); in PushItemWidth()
5638 const ImGuiStyle& style = GImGui->Style; in PushMultiItemsWidths()
5641 …t float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-… in PushMultiItemsWidths()
5642 …t w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (compo… in PushMultiItemsWidths()
5643 window->DC.ItemWidthStack.push_back(w_item_last); in PushMultiItemsWidths()
5644 for (int i = 0; i < components-1; i++) in PushMultiItemsWidths()
5645 window->DC.ItemWidthStack.push_back(w_item_one); in PushMultiItemsWidths()
5646 window->DC.ItemWidth = window->DC.ItemWidthStack.back(); in PushMultiItemsWidths()
5652 window->DC.ItemWidthStack.pop_back(); in PopItemWidth()
5653 …window->DC.ItemWidth = window->DC.ItemWidthStack.empty() ? window->ItemWidthDefault : window->DC.I… in PopItemWidth()
5659 float w = window->DC.ItemWidth; in CalcItemWidth()
5662 …// Align to a right-side limit. We include 1 frame padding in the calculation because this is how … in CalcItemWidth()
5673 …IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDa… in SetCurrentFont()
5674 IM_ASSERT(font->Scale > 0.0f); in SetCurrentFont()
5676 g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale); in SetCurrentFont()
5677 g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f; in SetCurrentFont()
5679 ImFontAtlas* atlas = g.Font->ContainerAtlas; in SetCurrentFont()
5680 g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel; in SetCurrentFont()
5692 g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID); in PushFont()
5698 g.CurrentWindow->DrawList->PopTextureID(); in PopFont()
5707 window->DC.ItemFlags |= option; in PushItemFlag()
5709 window->DC.ItemFlags &= ~option; in PushItemFlag()
5710 window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); in PushItemFlag()
5716 window->DC.ItemFlagsStack.pop_back(); in PopItemFlag()
5717 …window->DC.ItemFlags = window->DC.ItemFlagsStack.empty() ? ImGuiItemFlags_Default_ : window->DC.It… in PopItemFlag()
5744 window->DC.TextWrapPos = wrap_pos_x; in PushTextWrapPos()
5745 window->DC.TextWrapPosStack.push_back(wrap_pos_x); in PushTextWrapPos()
5751 window->DC.TextWrapPosStack.pop_back(); in PopTextWrapPos()
5752 …window->DC.TextWrapPos = window->DC.TextWrapPosStack.empty() ? -1.0f : window->DC.TextWrapPosStack… in PopTextWrapPos()
5755 …/ FIXME: This may incur a round-trip (if the end user got their data from a float4) but eventually…
5784 count--; in PopStyleColor()
5833 if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1) in PushStyleVar()
5836 float* pvar = (float*)var_info->GetVarPtr(&g.Style); in PushStyleVar()
5841 IM_ASSERT(0); // Called function with wrong-type? Variable is not a float. in PushStyleVar()
5847 if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2) in PushStyleVar()
5850 ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); in PushStyleVar()
5855 IM_ASSERT(0); // Called function with wrong-type? Variable is not a ImVec2. in PushStyleVar()
5863 …// We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the… in PopStyleVar()
5866 void* data = info->GetVarPtr(&g.Style); in PopStyleVar()
5867 …if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.Backu… in PopStyleVar()
5868 …else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.Backu… in PopStyleVar()
5870 count--; in PopStyleVar()
5876 // Create switch-case from enum with regexp: ImGuiCol_{.*}, --> case ImGuiCol_\1: return "\1"; in GetStyleColorName()
5934 if (window->RootWindow == potential_parent) in IsWindowChildOf()
5940 window = window->ParentWindow; in IsWindowChildOf()
5960 if (g.HoveredRootWindow != g.CurrentWindow->RootWindow) in IsWindowHovered()
5964 if (g.HoveredWindow != g.CurrentWindow->RootWindow) in IsWindowHovered()
5981 if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != g.HoveredWindow->MoveId) in IsWindowHovered()
5997 return g.NavWindow && g.NavWindow->RootWindow == g.CurrentWindow->RootWindow; in IsWindowFocused()
5999 return g.NavWindow == g.CurrentWindow->RootWindow; in IsWindowFocused()
6012 …return window->Active && window == window->RootWindow && !(window->Flags & ImGuiWindowFlags_NoNavF… in IsWindowNavFocusable()
6017 ImGuiWindow* window = GImGui->CurrentWindow; in GetWindowWidth()
6018 return window->Size.x; in GetWindowWidth()
6023 ImGuiWindow* window = GImGui->CurrentWindow; in GetWindowHeight()
6024 return window->Size.y; in GetWindowHeight()
6031 return window->Pos; in GetWindowPos()
6036 …window->DC.CursorMaxPos.x += window->Scroll.x; // SizeContents is generally computed based on Curs… in SetWindowScrollX()
6037 window->Scroll.x = new_scroll_x; in SetWindowScrollX()
6038 window->DC.CursorMaxPos.x -= window->Scroll.x; in SetWindowScrollX()
6043 …window->DC.CursorMaxPos.y += window->Scroll.y; // SizeContents is generally computed based on Curs… in SetWindowScrollY()
6044 window->Scroll.y = new_scroll_y; in SetWindowScrollY()
6045 window->DC.CursorMaxPos.y -= window->Scroll.y; in SetWindowScrollY()
6050 // Test condition (NB: bit 0 is always true) and clear flags for next time in SetWindowPos()
6051 if (cond && (window->SetWindowPosAllowFlags & cond) == 0) in SetWindowPos()
6055 …window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); in SetWindowPos()
6056 window->SetWindowPosVal = ImVec2(FLT_MAX, FLT_MAX); in SetWindowPos()
6059 const ImVec2 old_pos = window->Pos; in SetWindowPos()
6060 window->Pos = ImFloor(pos); in SetWindowPos()
6061 …window->DC.CursorPos += (window->Pos - old_pos); // As we happen to move the window while it is… in SetWindowPos()
6062 …window->DC.CursorMaxPos += (window->Pos - old_pos); // And more importantly we need to adjust this… in SetWindowPos()
6080 return window->Size; in GetWindowSize()
6085 // Test condition (NB: bit 0 is always true) and clear flags for next time in SetWindowSize()
6086 if (cond && (window->SetWindowSizeAllowFlags & cond) == 0) in SetWindowSize()
6090 …window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing… in SetWindowSize()
6095 window->AutoFitFramesX = 0; in SetWindowSize()
6096 window->SizeFull.x = ImFloor(size.x); in SetWindowSize()
6100 window->AutoFitFramesX = 2; in SetWindowSize()
6101 window->AutoFitOnlyGrows = false; in SetWindowSize()
6105 window->AutoFitFramesY = 0; in SetWindowSize()
6106 window->SizeFull.y = ImFloor(size.y); in SetWindowSize()
6110 window->AutoFitFramesY = 2; in SetWindowSize()
6111 window->AutoFitOnlyGrows = false; in SetWindowSize()
6117 SetWindowSize(GImGui->CurrentWindow, size, cond); in SetWindowSize()
6128 // Test condition (NB: bit 0 is always true) and clear flags for next time in SetWindowCollapsed()
6129 if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0) in SetWindowCollapsed()
6131 …window->SetWindowCollapsedAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appe… in SetWindowCollapsed()
6134 window->Collapsed = collapsed; in SetWindowCollapsed()
6139 SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond); in SetWindowCollapsed()
6145 return window->Collapsed; in IsWindowCollapsed()
6151 return window->Appearing; in IsWindowAppearing()
6162 FocusWindow(GImGui->CurrentWindow); in SetWindowFocus()
6236 ImVec2 mx = window->ContentsRegionRect.Max - window->Pos; in GetContentRegionMax()
6237 if (window->DC.ColumnsSet) in GetContentRegionMax()
6238 mx.x = GetColumnOffset(window->DC.ColumnsSet->Current + 1) - window->WindowPadding.x; in GetContentRegionMax()
6245 return GetContentRegionMax() - (window->DC.CursorPos - window->Pos); in GetContentRegionAvail()
6257 return window->ContentsRegionRect.Min - window->Pos; in GetWindowContentRegionMin()
6263 return window->ContentsRegionRect.Max - window->Pos; in GetWindowContentRegionMax()
6269 return window->ContentsRegionRect.GetWidth(); in GetWindowContentRegionWidth()
6299 return window->DrawList; in GetWindowDrawList()
6304 return GImGui->Font; in GetFont()
6309 return GImGui->FontSize; in GetFontSize()
6314 return GImGui->DrawListSharedData.TexUvWhitePixel; in GetFontTexUvWhitePixel()
6321 window->FontWindowScale = scale; in SetWindowFontScale()
6322 g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); in SetWindowFontScale()
6326 …kes our naming convention confusing because GetCursorPos() == (DC.CursorPos - window.Pos). May wan…
6330 return window->DC.CursorPos - window->Pos + window->Scroll; in GetCursorPos()
6336 return window->DC.CursorPos.x - window->Pos.x + window->Scroll.x; in GetCursorPosX()
6342 return window->DC.CursorPos.y - window->Pos.y + window->Scroll.y; in GetCursorPosY()
6348 window->DC.CursorPos = window->Pos - window->Scroll + local_pos; in SetCursorPos()
6349 window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); in SetCursorPos()
6355 window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x; in SetCursorPosX()
6356 window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x); in SetCursorPosX()
6362 window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y; in SetCursorPosY()
6363 window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y); in SetCursorPosY()
6369 return window->DC.CursorStartPos - window->Pos; in GetCursorStartPos()
6375 return window->DC.CursorPos; in GetCursorScreenPos()
6381 window->DC.CursorPos = pos; in SetCursorScreenPos()
6382 window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); in SetCursorScreenPos()
6387 return GImGui->CurrentWindow->Scroll.x; in GetScrollX()
6392 return GImGui->CurrentWindow->Scroll.y; in GetScrollY()
6397 return GetWindowScrollMaxX(GImGui->CurrentWindow); in GetScrollMaxX()
6402 return GetWindowScrollMaxY(GImGui->CurrentWindow); in GetScrollMaxY()
6408 window->ScrollTarget.x = scroll_x; in SetScrollX()
6409 window->ScrollTargetCenterRatio.x = 0.0f; in SetScrollX()
6415 …window->ScrollTarget.y = scroll_y + window->TitleBarHeight() + window->MenuBarHeight(); // title b… in SetScrollY()
6416 window->ScrollTargetCenterRatio.y = 0.0f; in SetScrollY()
6424 window->ScrollTarget.y = (float)(int)(local_y + window->Scroll.y); in SetScrollFromPosY()
6425 window->ScrollTargetCenterRatio.y = center_y_ratio; in SetScrollFromPosY()
6432 …float target_y = window->DC.CursorPosPrevLine.y - window->Pos.y; // Top of last item, in window sp… in SetScrollHereY()
6433 …target_y += (window->DC.PrevLineSize.y * center_y_ratio) + (GImGui->Style.ItemSpacing.y * (center_… in SetScrollHereY()
6445 IM_ASSERT(offset >= -1); // -1 is allowed but not below in SetKeyboardFocusHere()
6447 window->FocusIdxAllRequestNext = window->FocusIdxAllCounter + 1 + offset; in SetKeyboardFocusHere()
6448 window->FocusIdxTabRequestNext = INT_MAX; in SetKeyboardFocusHere()
6455 if (!window->Appearing) in SetItemDefaultFocus()
6457 …if (g.NavWindow == window->RootWindowForNav && (g.NavInitRequest || g.NavInitResultId != 0) && g.N… in SetItemDefaultFocus()
6460 g.NavInitResultId = g.NavWindow->DC.LastItemId; in SetItemDefaultFocus()
6461 …sultRectRel = ImRect(g.NavWindow->DC.LastItemRect.Min - g.NavWindow->Pos, g.NavWindow->DC.LastItem… in SetItemDefaultFocus()
6470 ImGuiWindow* window = GImGui->CurrentWindow; in SetStateStorage()
6471 window->DC.StateStorage = tree ? tree : &window->StateStorage; in SetStateStorage()
6476 ImGuiWindow* window = GImGui->CurrentWindow; in GetStateStorage()
6477 return window->DC.StateStorage; in GetStateStorage()
6482 ImGuiWindow* window = GImGui->CurrentWindow; in PushID()
6483 window->IDStack.push_back(window->GetIDNoKeepAlive(str_id)); in PushID()
6488 ImGuiWindow* window = GImGui->CurrentWindow; in PushID()
6489 window->IDStack.push_back(window->GetIDNoKeepAlive(str_id_begin, str_id_end)); in PushID()
6494 ImGuiWindow* window = GImGui->CurrentWindow; in PushID()
6495 window->IDStack.push_back(window->GetIDNoKeepAlive(ptr_id)); in PushID()
6501 ImGuiWindow* window = GImGui->CurrentWindow; in PushID()
6502 window->IDStack.push_back(window->GetIDNoKeepAlive(ptr_id)); in PushID()
6507 ImGuiWindow* window = GImGui->CurrentWindow; in PopID()
6508 window->IDStack.pop_back(); in PopID()
6513 ImGuiWindow* window = GImGui->CurrentWindow; in GetID()
6514 return window->GetID(str_id); in GetID()
6519 ImGuiWindow* window = GImGui->CurrentWindow; in GetID()
6520 return window->GetID(str_id_begin, str_id_end); in GetID()
6525 ImGuiWindow* window = GImGui->CurrentWindow; in GetID()
6526 return window->GetID(ptr_id); in GetID()
6531 ImGuiWindow* window = GImGui->CurrentWindow;; in IsRectVisible()
6532 return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); in IsRectVisible()
6537 ImGuiWindow* window = GImGui->CurrentWindow;; in IsRectVisible()
6538 return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); in IsRectVisible()
6547 window->DC.GroupStack.resize(window->DC.GroupStack.Size + 1); in BeginGroup()
6548 ImGuiGroupData& group_data = window->DC.GroupStack.back(); in BeginGroup()
6549 group_data.BackupCursorPos = window->DC.CursorPos; in BeginGroup()
6550 group_data.BackupCursorMaxPos = window->DC.CursorMaxPos; in BeginGroup()
6551 group_data.BackupIndent = window->DC.Indent; in BeginGroup()
6552 group_data.BackupGroupOffset = window->DC.GroupOffset; in BeginGroup()
6553 group_data.BackupCurrentLineSize = window->DC.CurrentLineSize; in BeginGroup()
6554 group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset; in BeginGroup()
6555 group_data.BackupLogLinePosY = window->DC.LogLinePosY; in BeginGroup()
6560 window->DC.GroupOffset.x = window->DC.CursorPos.x - window->Pos.x - window->DC.ColumnsOffset.x; in BeginGroup()
6561 window->DC.Indent = window->DC.GroupOffset; in BeginGroup()
6562 window->DC.CursorMaxPos = window->DC.CursorPos; in BeginGroup()
6563 window->DC.CurrentLineSize = ImVec2(0.0f, 0.0f); in BeginGroup()
6564 window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; // To enforce Log carriage return in BeginGroup()
6571 IM_ASSERT(!window->DC.GroupStack.empty()); // Mismatched BeginGroup()/EndGroup() calls in EndGroup()
6573 ImGuiGroupData& group_data = window->DC.GroupStack.back(); in EndGroup()
6575 ImRect group_bb(group_data.BackupCursorPos, window->DC.CursorMaxPos); in EndGroup()
6578 window->DC.CursorPos = group_data.BackupCursorPos; in EndGroup()
6579 window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos); in EndGroup()
6580 window->DC.Indent = group_data.BackupIndent; in EndGroup()
6581 window->DC.GroupOffset = group_data.BackupGroupOffset; in EndGroup()
6582 window->DC.CurrentLineSize = group_data.BackupCurrentLineSize; in EndGroup()
6583 window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset; in EndGroup()
6584 window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; // To enforce Log carriage return in EndGroup()
6588 …window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupC… in EndGroup()
6596 …iveIdIsAlive == g.ActiveId) && g.ActiveId) // && g.ActiveIdWindow->RootWindow == window->RootWindo… in EndGroup()
6597 window->DC.LastItemId = g.ActiveId; in EndGroup()
6598 …ActiveIdPreviousFrameIsAlive) // && g.ActiveIdPreviousFrameWindow->RootWindow == window->RootWindo… in EndGroup()
6599 window->DC.LastItemId = g.ActiveIdPreviousFrame; in EndGroup()
6600 window->DC.LastItemRect = group_bb; in EndGroup()
6602 window->DC.GroupStack.pop_back(); in EndGroup()
6604 //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug] in EndGroup()
6615 if (window->SkipItems) in SameLine()
6622 …window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + pos_x + spacing_w + window->DC.GroupOf… in SameLine()
6623 window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; in SameLine()
6628 window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w; in SameLine()
6629 window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; in SameLine()
6631 window->DC.CurrentLineSize = window->DC.PrevLineSize; in SameLine()
6632 window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset; in SameLine()
6639 window->DC.Indent.x += (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; in Indent()
6640 window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x; in Indent()
6647 window->DC.Indent.x -= (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; in Unindent()
6648 window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x; in Unindent()
6651 //-----------------------------------------------------------------------------
6653 //-----------------------------------------------------------------------------
6663 //ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding; in BeginTooltip()
6684 if (window->Active) in BeginTooltipEx()
6687 window->Hidden = true; in BeginTooltipEx()
6688 window->HiddenFramesRegular = 1; in BeginTooltipEx()
6697 …IM_ASSERT(GetCurrentWindowRead()->Flags & ImGuiWindowFlags_Tooltip); // Mismatched BeginTooltip(… in EndTooltip()
6720 //-----------------------------------------------------------------------------
6722 //-----------------------------------------------------------------------------
6733 …upStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].PopupId == g.CurrentWindow->GetID(str_id); in IsPopupOpen()
6739 for (int n = g.OpenPopupStack.Size-1; n >= 0; n--) in GetFrontMostPopupModal()
6741 if (popup->Flags & ImGuiWindowFlags_Modal) in GetFrontMostPopupModal()
6749 OpenPopupEx(g.CurrentWindow->GetID(str_id)); in OpenPopup()
6754 // Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be …
6766 popup_ref.OpenParentId = parent_window->IDStack.back(); in OpenPopupEx()
6778 …come completely unusable because the popup will always be in hidden-while-calculating-size state _… in OpenPopupEx()
6780 …ack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) in OpenPopupEx()
6800 ImGuiWindow* window = GImGui->CurrentWindow; in OpenPopupOnItemClick()
6803 …ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an I… in OpenPopupOnItemClick()
6828 IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); in ClosePopupsOverWindow()
6829 if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) in ClosePopupsOverWindow()
6835 …if (g.OpenPopupStack[m].Window && g.OpenPopupStack[m].Window->RootWindow == ref_window->RootWindow) in ClosePopupsOverWindow()
6841 …if (popup_count_to_keep < g.OpenPopupStack.Size) // This test is not required but it allows to set… in ClosePopupsOverWindow()
6843 …//IMGUI_DEBUG_LOG("ClosePopupsOverWindow(%s) -> ClosePopupToLevel(%d)\n", ref_window->Name, popup_… in ClosePopupsOverWindow()
6852 …ImGuiWindow* focus_window = (remaining > 0) ? g.OpenPopupStack[remaining-1].Window : g.OpenPopupSt… in ClosePopupToLevel()
6856 …// Instead of using g.OpenPopupStack[remaining-1].Window etc. we should find the highest root wind… in ClosePopupToLevel()
6871 // Close the popup we have begin-ed into.
6875 int popup_idx = g.BeginPopupStack.Size - 1; in CloseCurrentPopup()
6879 // Closing a menu closes its top-most parent popup (unless a modal) in CloseCurrentPopup()
6883 ImGuiWindow* parent_popup_window = g.OpenPopupStack[popup_idx - 1].Window; in CloseCurrentPopup()
6885 if (popup_window && (popup_window->Flags & ImGuiWindowFlags_ChildMenu)) in CloseCurrentPopup()
6886 … if (parent_popup_window == NULL || !(parent_popup_window->Flags & ImGuiWindowFlags_Modal)) in CloseCurrentPopup()
6890 popup_idx--; in CloseCurrentPopup()
6892 //IMGUI_DEBUG_LOG("CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx); in CloseCurrentPopup()
6899 window->DC.NavHideHighlightOneFrame = true; in CloseCurrentPopup()
6933 return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags); in BeginPopup()
6942 const ImGuiID id = window->GetID(name); in BeginPopupModal()
6950 // FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window. in BeginPopupModal()
6969 …IM_ASSERT(g.CurrentWindow->Flags & ImGuiWindowFlags_Popup); // Mismatched BeginPopup()/EndPopup()… in EndPopup()
6983 ImGuiWindow* window = GImGui->CurrentWindow; in BeginPopupContextItem()
6984 …ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an I… in BeginPopupContextItem()
6995 ImGuiID id = GImGui->CurrentWindow->GetID(str_id); in BeginPopupContextWindow()
7006 ImGuiID id = GImGui->CurrentWindow->GetID(str_id); in BeginPopupContextVoid()
7014 ImVec2 padding = GImGui->Style.DisplaySafeAreaPadding; in GetWindowAllowedExtentRect()
7016 …mVec2((r_screen.GetWidth() > padding.x * 2) ? -padding.x : 0.0f, (r_screen.GetHeight() > padding.y… in GetWindowAllowedExtentRect()
7024 ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size); in FindBestWindowPosForPopupEx()
7025 //GImGui->OverlayDrawList.AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255)); in FindBestWindowPosForPopupEx()
7026 //GImGui->OverlayDrawList.AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255)); in FindBestWindowPosForPopupEx()
7032 for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) in FindBestWindowPosForPopupEx()
7034 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; in FindBestWindowPosForPopupEx()
7035 if (n != -1 && dir == *last_dir) // Already tried this direction? in FindBestWindowPosForPopupEx()
7039 …if (dir == ImGuiDir_Right) pos = ImVec2(r_avoid.Min.x, r_avoid.Min.y - size.y); // Above, Toward R… in FindBestWindowPosForPopupEx()
7040 …if (dir == ImGuiDir_Left) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Max.y); // Below, Toward L… in FindBestWindowPosForPopupEx()
7041 …if (dir == ImGuiDir_Up) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Min.y - size.y); // Above,… in FindBestWindowPosForPopupEx()
7051 for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) in FindBestWindowPosForPopupEx()
7053 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; in FindBestWindowPosForPopupEx()
7054 if (n != -1 && dir == *last_dir) // Already tried this direction? in FindBestWindowPosForPopupEx()
7056 …float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? … in FindBestWindowPosForPopupEx()
7057 …float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_a… in FindBestWindowPosForPopupEx()
7061 …pos.x = (dir == ImGuiDir_Left) ? r_avoid.Min.x - size.x : (dir == ImGuiDir_Right) ? r_avoid.Max.x … in FindBestWindowPosForPopupEx()
7062 …pos.y = (dir == ImGuiDir_Up) ? r_avoid.Min.y - size.y : (dir == ImGuiDir_Down) ? r_avoid.Max.y … in FindBestWindowPosForPopupEx()
7070 pos.x = ImMax(ImMin(pos.x + size.x, r_outer.Max.x) - size.x, r_outer.Min.x); in FindBestWindowPosForPopupEx()
7071 pos.y = ImMax(ImMin(pos.y + size.y, r_outer.Max.y) - size.y, r_outer.Min.y); in FindBestWindowPosForPopupEx()
7080 if (window->Flags & ImGuiWindowFlags_ChildMenu) in FindBestWindowPosForPopup()
7083 …// This is how we end up with child menus appearing (most-commonly) on the right of the parent men… in FindBestWindowPosForPopup()
7085 ImGuiWindow* parent_window = g.CurrentWindowStack[g.CurrentWindowStack.Size - 2]; in FindBestWindowPosForPopup()
7086 …vey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSp… in FindBestWindowPosForPopup()
7088 if (parent_window->DC.MenuBarAppending) in FindBestWindowPosForPopup()
7089 …ct(-FLT_MAX, parent_window->Pos.y + parent_window->TitleBarHeight(), FLT_MAX, parent_window->Pos.y… in FindBestWindowPosForPopup()
7091 …t(parent_window->Pos.x + horizontal_overlap, -FLT_MAX, parent_window->Pos.x + parent_window->Size.… in FindBestWindowPosForPopup()
7092 …return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_out… in FindBestWindowPosForPopup()
7094 if (window->Flags & ImGuiWindowFlags_Popup) in FindBestWindowPosForPopup()
7096 …ImRect r_avoid = ImRect(window->Pos.x - 1, window->Pos.y - 1, window->Pos.x + 1, window->Pos.y + 1… in FindBestWindowPosForPopup()
7097 …return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_out… in FindBestWindowPosForPopup()
7099 if (window->Flags & ImGuiWindowFlags_Tooltip) in FindBestWindowPosForPopup()
7106 r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 16, ref_pos.y + 8); in FindBestWindowPosForPopup()
7108 …r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * sc, ref_pos.y + 24 * sc); // FIXM… in FindBestWindowPosForPopup()
7109 …ImVec2 pos = FindBestWindowPosForPopupEx(ref_pos, window->Size, &window->AutoPosLastDirection, r_o… in FindBestWindowPosForPopup()
7110 if (window->AutoPosLastDirection == ImGuiDir_None) in FindBestWindowPosForPopup()
7115 return window->Pos; in FindBestWindowPosForPopup()
7118 //-----------------------------------------------------------------------------
7120 //-----------------------------------------------------------------------------
7124 //-----------------------------------------------------------------------------
7126 //-----------------------------------------------------------------------------
7138 return a1 - b0; in NavScoreItemDistInterval()
7140 return a0 - b1; in NavScoreItemDistInterval()
7163 if (g.NavLayer != window->DC.NavLayerCurrent) in NavScoreItem()
7170 if (window->ParentWindow == g.NavWindow) in NavScoreItem()
7172 IM_ASSERT((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened); in NavScoreItem()
7173 if (!window->ClipRect.Contains(cand)) in NavScoreItem()
7175 …cand.ClipWithFull(window->ClipRect); // This allows the scored item to not overlap other candidate… in NavScoreItem()
7180 NavClampRectToVisibleAreaForMoveDir(g.NavMoveClipDir, cand, window->ClipRect); in NavScoreItem()
7183 // FIXME-NAV: Introducing biases for vertical navigation, needs to be removed. in NavScoreItem()
7185 … ImLerp(curr.Min.y, curr.Max.y, 0.8f)); // Scale down on Y to keep using box-distance for vertical… in NavScoreItem()
7187 dbx = (dbx/1000.0f) + ((dbx > 0.0f) ? +1.0f : -1.0f); in NavScoreItem()
7191 float dcx = (cand.Min.x + cand.Max.x) - (curr.Min.x + curr.Max.x); in NavScoreItem()
7192 float dcy = (cand.Min.y + cand.Max.y) - (curr.Min.y + curr.Max.y); in NavScoreItem()
7200 // For non-overlapping boxes, use distance between boxes in NavScoreItem()
7217 quadrant = (window->DC.LastItemId < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right; in NavScoreItem()
7224 …FormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f… in NavScoreItem()
7226 draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100)); in NavScoreItem()
7227 draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200)); in NavScoreItem()
7228 …draw_list->AddRectFilled(cand.Max-ImVec2(4,4), cand.Max+ImGui::CalcTextSize(buf)+ImVec2(4,4), IM_C… in NavScoreItem()
7229 draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Max, ~0U, buf); in NavScoreItem()
7238 draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200)); in NavScoreItem()
7239 … draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf); in NavScoreItem()
7249 if (dist_box < result->DistBox) in NavScoreItem()
7251 result->DistBox = dist_box; in NavScoreItem()
7252 result->DistCenter = dist_center; in NavScoreItem()
7255 if (dist_box == result->DistBox) in NavScoreItem()
7258 if (dist_center < result->DistCenter) in NavScoreItem()
7260 result->DistCenter = dist_center; in NavScoreItem()
7263 else if (dist_center == result->DistCenter) in NavScoreItem()
7265 …// Still tied! we need to be extra-careful to make sure everything gets linked properly. We consis… in NavScoreItem()
7279 if (result->DistBox == FLT_MAX && dist_axial < result->DistAxial) // Check axial match in NavScoreItem()
7280 if (g.NavLayer == 1 && !(g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu)) in NavScoreItem()
7283 result->DistAxial = dist_axial; in NavScoreItem()
7294 …Active) // [2017/10/06] Removed this possibly redundant test but I am not sure of all the side-ef… in NavProcessItem()
7297 const ImGuiItemFlags item_flags = window->DC.ItemFlags; in NavProcessItem()
7298 const ImRect nav_bb_rel(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); in NavProcessItem()
7301 if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent) in NavProcessItem()
7317 …// FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRectScreen + scoring from… in NavProcessItem()
7331 result->ID = id; in NavProcessItem()
7332 result->SelectScopeId = g.MultiSelectScopeId; in NavProcessItem()
7333 result->Window = window; in NavProcessItem()
7334 result->RectRel = nav_bb_rel; in NavProcessItem()
7338 …if ((g.NavMoveRequestFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(n… in NavProcessItem()
7339 ….y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y… in NavProcessItem()
7343 result->ID = id; in NavProcessItem()
7344 result->SelectScopeId = g.MultiSelectScopeId; in NavProcessItem()
7345 result->Window = window; in NavProcessItem()
7346 result->RectRel = nav_bb_rel; in NavProcessItem()
7350 // Update window-relative bounding box of navigated item in NavProcessItem()
7354 g.NavLayer = window->DC.NavLayerCurrent; in NavProcessItem()
7356 g.NavIdTabCounter = window->FocusIdxTabCounter; in NavProcessItem()
7357 …window->NavRectRel[window->DC.NavLayerCurrent] = nav_bb_rel; // Store item bounding box (relati… in NavProcessItem()
7383 g.NavWindow->NavRectRel[g.NavLayer] = bb_rel; in NavMoveRequestForward()
7392 ImRect bb_rel = window->NavRectRel[0]; in NavMoveRequestTryWrapping()
7397 …bb_rel.Min.x = bb_rel.Max.x = ImMax(window->SizeFull.x, window->SizeContents.x) - window->Scroll.x; in NavMoveRequestTryWrapping()
7398 …if (move_flags & ImGuiNavMoveFlags_WrapX) { bb_rel.TranslateY(-bb_rel.GetHeight()); clip_dir = ImG… in NavMoveRequestTryWrapping()
7403 bb_rel.Min.x = bb_rel.Max.x = -window->Scroll.x; in NavMoveRequestTryWrapping()
7409 …bb_rel.Min.y = bb_rel.Max.y = ImMax(window->SizeFull.y, window->SizeContents.y) - window->Scroll.y; in NavMoveRequestTryWrapping()
7410 …if (move_flags & ImGuiNavMoveFlags_WrapY) { bb_rel.TranslateX(-bb_rel.GetWidth()); clip_dir = ImGu… in NavMoveRequestTryWrapping()
7415 bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y; in NavMoveRequestTryWrapping()
7424 …while (parent_window && (parent_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 && (parent_wind… in NavSaveLastChildNavWindow()
7425 parent_window = parent_window->ParentWindow; in NavSaveLastChildNavWindow()
7427 parent_window->NavLastChildNavWindow = nav_window; in NavSaveLastChildNavWindow()
7433 return window->NavLastChildNavWindow ? window->NavLastChildNavWindow : window; in NavRestoreLastChildNavWindow()
7442 if (layer == 0 && g.NavWindow->NavLastIds[0] != 0) in NavRestoreLayer()
7443 ImGui::SetNavIDWithRectRel(g.NavWindow->NavLastIds[0], layer, g.NavWindow->NavRectRel[0]); in NavRestoreLayer()
7462 if (!(window->Flags & ImGuiWindowFlags_NoNavInputs)) in NavInitWindow()
7463 …if (!(window->Flags & ImGuiWindowFlags_ChildWindow) || (window->Flags & ImGuiWindowFlags_Popup) ||… in NavInitWindow()
7476 g.NavId = window->NavLastIds[0]; in NavInitWindow()
7493 const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer]; in NavCalcPreferredRefPos()
7494 …ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel… in NavCalcPreferredRefPos()
7496 …oor() is important because non-integer mouse position application in back-end might be lossy and r… in NavCalcPreferredRefPos()
7514 …return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f,… in GetNavInputAmount()
7516 …return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 1.00f,… in GetNavInputAmount()
7518 …return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f,… in GetNavInputAmount()
7526 …nput_KeyRight_, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft_, mode), GetNavInputAmount(ImG… in GetNavInputAmount2d()
7528 …nput_DpadRight, mode) - GetNavInputAmount(ImGuiNavInput_DpadLeft, mode), GetNavInputAmount(ImG… in GetNavInputAmount2d()
7530 …nput_LStickRight, mode) - GetNavInputAmount(ImGuiNavInput_LStickLeft, mode), GetNavInputAmount(ImG… in GetNavInputAmount2d()
7542 …ImRect window_rect(window->InnerMainRect.Min - ImVec2(1, 1), window->InnerMainRect.Max + ImVec2(1,… in NavScrollToBringItemIntoView()
7543 …//GetOverlayDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG] in NavScrollToBringItemIntoView()
7548 if (window->ScrollbarX && item_rect.Min.x < window_rect.Min.x) in NavScrollToBringItemIntoView()
7550 …window->ScrollTarget.x = item_rect.Min.x - window->Pos.x + window->Scroll.x - g.Style.ItemSpacing.… in NavScrollToBringItemIntoView()
7551 window->ScrollTargetCenterRatio.x = 0.0f; in NavScrollToBringItemIntoView()
7553 else if (window->ScrollbarX && item_rect.Max.x >= window_rect.Max.x) in NavScrollToBringItemIntoView()
7555 …window->ScrollTarget.x = item_rect.Max.x - window->Pos.x + window->Scroll.x + g.Style.ItemSpacing.… in NavScrollToBringItemIntoView()
7556 window->ScrollTargetCenterRatio.x = 1.0f; in NavScrollToBringItemIntoView()
7560 …window->ScrollTarget.y = item_rect.Min.y - window->Pos.y + window->Scroll.y - g.Style.ItemSpacing.… in NavScrollToBringItemIntoView()
7561 window->ScrollTargetCenterRatio.y = 0.0f; in NavScrollToBringItemIntoView()
7565 …window->ScrollTarget.y = item_rect.Max.y - window->Pos.y + window->Scroll.y + g.Style.ItemSpacing.… in NavScrollToBringItemIntoView()
7566 window->ScrollTargetCenterRatio.y = 1.0f; in NavScrollToBringItemIntoView()
7575 …:%d, Move:%d)\n", g.FrameCount, g.NavScoringCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.Nav… in NavUpdate()
7585 // Update Keyboard->Nav inputs mapping in NavUpdate()
7603 …O.NavInputsDownDuration[i] < 0.0f ? 0.0f : g.IO.NavInputsDownDuration[i] + g.IO.DeltaTime) : -1.0f; in NavUpdate()
7614 g.NavWindow->NavRectRel[g.NavLayer] = g.NavInitResultRectRel; in NavUpdate()
7655 if (g.NavWindow && g.NavWindow->NavLastChildNavWindow != NULL && g.NavLayer == 0) in NavUpdate()
7656 g.NavWindow->NavLastChildNavWindow = NULL; in NavUpdate()
7662 …g.IO.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flag… in NavUpdate()
7673 …avWindow && (g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow) && !(g.NavWindow->Flags & ImGuiWin… in NavUpdate()
7677 ImGuiWindow* parent_window = g.NavWindow->ParentWindow; in NavUpdate()
7678 IM_ASSERT(child_window->ChildId != 0); in NavUpdate()
7680 SetNavID(child_window->ChildId, 0); in NavUpdate()
7688 if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) in NavUpdate()
7689 ClosePopupToLevel(g.OpenPopupStack.Size - 1, true); in NavUpdate()
7699 …if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiW… in NavUpdate()
7700 g.NavWindow->NavLastIds[0] = 0; in NavUpdate()
7707 …NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowF… in NavUpdate()
7720 if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) in NavUpdate()
7737 …if (g.NavWindow && !g.NavWindowingTarget && allowed_dir_flags && !(g.NavWindow->Flags & ImGuiWindo… in NavUpdate()
7775 … if (g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.NavWindowingTarget) in NavUpdate()
7777 // *Fallback* manual-scroll with Nav directional keys when window has no navigable item in NavUpdate()
7779 …roll_speed = ImFloor(window->CalcFontSize() * 100 * g.IO.DeltaTime + 0.5f); // We need round the s… in NavUpdate()
7780 if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll && g.NavMoveRequest) in NavUpdate()
7783 …SetWindowScrollX(window, ImFloor(window->Scroll.x + ((g.NavMoveDir == ImGuiDir_Left) ? -1.0f : +1.… in NavUpdate()
7785 …SetWindowScrollY(window, ImFloor(window->Scroll.y + ((g.NavMoveDir == ImGuiDir_Up) ? -1.0f : +1.0f… in NavUpdate()
7791 if (scroll_dir.x != 0.0f && window->ScrollbarX) in NavUpdate()
7793 SetWindowScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed)); in NavUpdate()
7798 SetWindowScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed)); in NavUpdate()
7812 …ImRect window_rect_rel(window->InnerMainRect.Min - window->Pos - ImVec2(1,1), window->InnerMainRec… in NavUpdate()
7813 if (!window_rect_rel.Contains(window->NavRectRel[g.NavLayer])) in NavUpdate()
7815 float pad = window->CalcFontSize() * 0.5f; in NavUpdate()
7816 …window_rect_rel.Expand(ImVec2(-ImMin(window_rect_rel.GetWidth(), pad), -ImMin(window_rect_rel.GetH… in NavUpdate()
7817 window->NavRectRel[g.NavLayer].ClipWith(window_rect_rel); in NavUpdate()
7823 …e our current item bounding box (not touching the edge to avoid box overlap with zero-spaced items) in NavUpdate()
7824 …ImRect nav_rect_rel = (g.NavWindow && !g.NavWindow->NavRectRel[g.NavLayer].IsInverted()) ? g.NavWi… in NavUpdate()
7825 …g.NavScoringRectScreen = g.NavWindow ? ImRect(g.NavWindow->Pos + nav_rect_rel.Min, g.NavWindow->Po… in NavUpdate()
7829 …IM_ASSERT(!g.NavScoringRectScreen.IsInverted()); // Ensure if we have a finite, non-inverted bound… in NavUpdate()
7833 …OverlayDrawList(g.NavWindow)->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.Nav… in NavUpdate()
7834 …->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); … in NavUpdate()
7844 …// In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (bec… in NavUpdateMoveResult()
7861 …ing a flattened child from the outside? In this case solve the tie using the regular scoring rules. in NavUpdateMoveResult()
7862 …veResultOther && g.NavMoveResultOther.ID != 0 && g.NavMoveResultOther.Window->ParentWindow == g.Na… in NavUpdateMoveResult()
7863 …tOther.DistBox < result->DistBox) || (g.NavMoveResultOther.DistBox == result->DistBox && g.NavMove… in NavUpdateMoveResult()
7865 IM_ASSERT(g.NavWindow && result->Window); in NavUpdateMoveResult()
7870 …ImRect rect_abs = ImRect(result->RectRel.Min + result->Window->Pos, result->RectRel.Max + result->… in NavUpdateMoveResult()
7871 NavScrollToBringItemIntoView(result->Window, rect_abs); in NavUpdateMoveResult()
7874 ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(result->Window, false); in NavUpdateMoveResult()
7875 ImVec2 delta_scroll = result->Window->Scroll - next_scroll; in NavUpdateMoveResult()
7876 result->RectRel.Translate(delta_scroll); in NavUpdateMoveResult()
7879 if (result->Window->Flags & ImGuiWindowFlags_ChildWindow) in NavUpdateMoveResult()
7880 …NavScrollToBringItemIntoView(result->Window->ParentWindow, ImRect(rect_abs.Min + delta_scroll, rec… in NavUpdateMoveResult()
7884 g.NavWindow = result->Window; in NavUpdateMoveResult()
7885 if (g.NavId != result->ID) in NavUpdateMoveResult()
7888 g.NavJustMovedToId = result->ID; in NavUpdateMoveResult()
7889 g.NavJustMovedToSelectScopeId = result->SelectScopeId; in NavUpdateMoveResult()
7891 SetNavIDWithRectRel(result->ID, g.NavLayer, result->RectRel); in NavUpdateMoveResult()
7898 …if (g.NavMoveDir == ImGuiDir_None && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavI… in NavUpdatePageUpPageDown()
7905 if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll) in NavUpdatePageUpPageDown()
7907 // Fallback manual-scroll when window has no navigable item in NavUpdatePageUpPageDown()
7909 SetWindowScrollY(window, window->Scroll.y - window->InnerClipRect.GetHeight()); in NavUpdatePageUpPageDown()
7911 SetWindowScrollY(window, window->Scroll.y + window->InnerClipRect.GetHeight()); in NavUpdatePageUpPageDown()
7915 const ImRect& nav_rect_rel = window->NavRectRel[g.NavLayer]; in NavUpdatePageUpPageDown()
7916 …const float page_offset_y = ImMax(0.0f, window->InnerClipRect.GetHeight() - window->CalcFontSize()… in NavUpdatePageUpPageDown()
7920 nav_scoring_rect_offset_y = -page_offset_y; in NavUpdatePageUpPageDown()
7939 static int FindWindowFocusIndex(ImGuiWindow* window) // FIXME-OPT O(N) in FindWindowFocusIndex()
7942 for (int i = g.WindowsFocusOrder.Size-1; i >= 0; i--) in FindWindowFocusIndex()
7945 return -1; in FindWindowFocusIndex()
7948 static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) // FIXME-OPT O(N) in FindWindowNavFocusable()
7961 if (g.NavWindowingTarget->Flags & ImGuiWindowFlags_Modal) in NavUpdateWindowingHighlightWindow()
7965 …ImGuiWindow* window_target = FindWindowNavFocusable(i_current + focus_change_dir, -INT_MAX, focus_… in NavUpdateWindowingHighlightWindow()
7967 …window_target = FindWindowNavFocusable((focus_change_dir < 0) ? (g.WindowsFocusOrder.Size - 1) : 0… in NavUpdateWindowingHighlightWindow()
7990 … g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha - g.IO.DeltaTime * 10.0f, 0.0f); in NavUpdateWindowing()
7995 // Start CTRL-TAB or Square+L/R window selection in NavUpdateWindowing()
7999 …w = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) in NavUpdateWindowing()
8012 …Alpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLI… in NavUpdateWindowing()
8015 …t)IsNavInputPressed(ImGuiNavInput_FocusPrev, ImGuiInputReadMode_RepeatSlow) - (int)IsNavInputPress… in NavUpdateWindowing()
8022 …press with L/R apply actual focus on release (until then the window was merely rendered front-most) in NavUpdateWindowing()
8025 …< 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anym… in NavUpdateWindowing()
8038 …Alpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLI… in NavUpdateWindowing()
8040 NavUpdateWindowingHighlightWindow(g.IO.KeyShift ? +1 : -1); in NavUpdateWindowing()
8046 … compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB in NavUpdateWindowing()
8052 if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove)) in NavUpdateWindowing()
8063 g.NavWindowingTarget->RootWindow->Pos += move_delta * move_speed; in NavUpdateWindowing()
8070 … if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow)) in NavUpdateWindowing()
8077 if (apply_focus_window->NavLastIds[0] == 0) in NavUpdateWindowing()
8081 if (apply_focus_window->DC.NavLayerActiveMask == (1 << ImGuiNavLayer_Menu)) in NavUpdateWindowing()
8092 while ((new_nav_window->DC.NavLayerActiveMask & (1 << 1)) == 0 in NavUpdateWindowing()
8093 && (new_nav_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 in NavUpdateWindowing()
8094 && (new_nav_window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) == 0) in NavUpdateWindowing()
8095 new_nav_window = new_nav_window->ParentWindow; in NavUpdateWindowing()
8100 new_nav_window->NavLastChildNavWindow = old_nav_window; in NavUpdateWindowing()
8104 …NavRestoreLayer((g.NavWindow->DC.NavLayerActiveMask & (1 << ImGuiNavLayer_Menu)) ? (ImGuiNavLayer)… in NavUpdateWindowing()
8111 if (window->Flags & ImGuiWindowFlags_Popup) in GetFallbackWindowNameForWindowingList()
8113 if ((window->Flags & ImGuiWindowFlags_MenuBar) && strcmp(window->Name, "##MainMenuBar") == 0) in GetFallbackWindowNameForWindowingList()
8133 for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--) in NavUpdateWindowingList()
8138 const char* label = window->Name; in NavUpdateWindowingList()
8147 //-----------------------------------------------------------------------------
8149 // In the current version, Columns are very weak. Needs to be replaced with a more full-featured sy…
8150 //-----------------------------------------------------------------------------
8155 if (window->SkipItems || window->DC.ColumnsSet == NULL) in NextColumn()
8162 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in NextColumn()
8163 columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); in NextColumn()
8164 if (++columns->Current < columns->Count) in NextColumn()
8167 …window->DC.ColumnsOffset.x = GetColumnOffset(columns->Current) - window->DC.Indent.x + g.Style.Ite… in NextColumn()
8168 window->DrawList->ChannelsSetCurrent(columns->Current); in NextColumn()
8172 window->DC.ColumnsOffset.x = 0.0f; in NextColumn()
8173 window->DrawList->ChannelsSetCurrent(0); in NextColumn()
8174 columns->Current = 0; in NextColumn()
8175 columns->LineMinY = columns->LineMaxY; in NextColumn()
8177 …window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffs… in NextColumn()
8178 window->DC.CursorPos.y = columns->LineMinY; in NextColumn()
8179 window->DC.CurrentLineSize = ImVec2(0.0f, 0.0f); in NextColumn()
8180 window->DC.CurrentLineTextBaseOffset = 0.0f; in NextColumn()
8189 return window->DC.ColumnsSet ? window->DC.ColumnsSet->Current : 0; in GetColumnIndex()
8195 return window->DC.ColumnsSet ? window->DC.ColumnsSet->Count : 1; in GetColumnsCount()
8200 return offset_norm * (columns->MaxX - columns->MinX); in OffsetNormToPixels()
8205 return offset / (columns->MaxX - columns->MinX); in PixelsToOffsetNorm()
8212 …llow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing in GetDraggedColumnOffset()
8217 IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); in GetDraggedColumnOffset()
8219 float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + GetColumnsRectHalfWidth() - window->Pos.x; in GetDraggedColumnOffset()
8220 x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); in GetDraggedColumnOffset()
8221 if ((columns->Flags & ImGuiColumnsFlags_NoPreserveWidths)) in GetDraggedColumnOffset()
8222 x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); in GetDraggedColumnOffset()
8230 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in GetColumnOffset()
8234 column_index = columns->Current; in GetColumnOffset()
8235 IM_ASSERT(column_index < columns->Columns.Size); in GetColumnOffset()
8237 const float t = columns->Columns[column_index].OffsetNorm; in GetColumnOffset()
8238 const float x_offset = ImLerp(columns->MinX, columns->MaxX, t); in GetColumnOffset()
8245 column_index = columns->Current; in GetColumnWidthEx()
8249 …offset_norm = columns->Columns[column_index + 1].OffsetNormBeforeResize - columns->Columns[column_… in GetColumnWidthEx()
8251 …offset_norm = columns->Columns[column_index + 1].OffsetNorm - columns->Columns[column_index].Offse… in GetColumnWidthEx()
8258 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in GetColumnWidth()
8262 column_index = columns->Current; in GetColumnWidth()
8263 …return OffsetNormToPixels(columns, columns->Columns[column_index + 1].OffsetNorm - columns->Column… in GetColumnWidth()
8270 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in SetColumnOffset()
8274 column_index = columns->Current; in SetColumnOffset()
8275 IM_ASSERT(column_index < columns->Columns.Size); in SetColumnOffset()
8277 …onst bool preserve_width = !(columns->Flags & ImGuiColumnsFlags_NoPreserveWidths) && (column_index… in SetColumnOffset()
8278 …const float width = preserve_width ? GetColumnWidthEx(columns, column_index, columns->IsBeingResiz… in SetColumnOffset()
8280 if (!(columns->Flags & ImGuiColumnsFlags_NoForceWithinWindow)) in SetColumnOffset()
8281 …offset = ImMin(offset, columns->MaxX - g.Style.ColumnsMinSpacing * (columns->Count - column_index)… in SetColumnOffset()
8282 columns->Columns[column_index].OffsetNorm = PixelsToOffsetNorm(columns, offset - columns->MinX); in SetColumnOffset()
8291 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in SetColumnWidth()
8295 column_index = columns->Current; in SetColumnWidth()
8302 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in PushColumnClipRect()
8304 column_index = columns->Current; in PushColumnClipRect()
8306 …PushClipRect(columns->Columns[column_index].ClipRect.Min, columns->Columns[column_index].ClipRect.… in PushColumnClipRect()
8311 for (int n = 0; n < window->ColumnsStorage.Size; n++) in FindOrAddColumnsSet()
8312 if (window->ColumnsStorage[n].ID == id) in FindOrAddColumnsSet()
8313 return &window->ColumnsStorage[n]; in FindOrAddColumnsSet()
8315 window->ColumnsStorage.push_back(ImGuiColumnsSet()); in FindOrAddColumnsSet()
8316 ImGuiColumnsSet* columns = &window->ColumnsStorage.back(); in FindOrAddColumnsSet()
8317 columns->ID = id; in FindOrAddColumnsSet()
8327 IM_ASSERT(window->DC.ColumnsSet == NULL); // Nested columns are currently not supported in BeginColumns()
8332 ImGuiID id = window->GetID(str_id ? str_id : "columns"); in BeginColumns()
8337 IM_ASSERT(columns->ID == id); in BeginColumns()
8338 columns->Current = 0; in BeginColumns()
8339 columns->Count = columns_count; in BeginColumns()
8340 columns->Flags = flags; in BeginColumns()
8341 window->DC.ColumnsSet = columns; in BeginColumns()
8344 …region_width = (window->SizeContentsExplicit.x != 0.0f) ? (window->SizeContentsExplicit.x) : (wind… in BeginColumns()
8345 columns->MinX = window->DC.Indent.x - g.Style.ItemSpacing.x; // Lock our horizontal range in BeginColumns()
8346 columns->MaxX = ImMax(content_region_width - window->Scroll.x, columns->MinX + 1.0f); in BeginColumns()
8347 columns->StartPosY = window->DC.CursorPos.y; in BeginColumns()
8348 columns->StartMaxPosX = window->DC.CursorMaxPos.x; in BeginColumns()
8349 columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y; in BeginColumns()
8350 window->DC.ColumnsOffset.x = 0.0f; in BeginColumns()
8351 …window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffs… in BeginColumns()
8354 if (columns->Columns.Size != 0 && columns->Columns.Size != columns_count + 1) in BeginColumns()
8355 columns->Columns.resize(0); in BeginColumns()
8358 columns->IsFirstFrame = (columns->Columns.Size == 0); in BeginColumns()
8359 if (columns->Columns.Size == 0) in BeginColumns()
8361 columns->Columns.reserve(columns_count + 1); in BeginColumns()
8366 columns->Columns.push_back(column); in BeginColumns()
8373 ImGuiColumnData* column = &columns->Columns[n]; in BeginColumns()
8374 float clip_x1 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n) - 1.0f); in BeginColumns()
8375 float clip_x2 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n + 1) - 1.0f); in BeginColumns()
8376 column->ClipRect = ImRect(clip_x1, -FLT_MAX, clip_x2, +FLT_MAX); in BeginColumns()
8377 column->ClipRect.ClipWith(window->ClipRect); in BeginColumns()
8380 window->DrawList->ChannelsSplit(columns->Count); in BeginColumns()
8389 ImGuiColumnsSet* columns = window->DC.ColumnsSet; in EndColumns()
8394 window->DrawList->ChannelsMerge(); in EndColumns()
8396 columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); in EndColumns()
8397 window->DC.CursorPos.y = columns->LineMaxY; in EndColumns()
8398 if (!(columns->Flags & ImGuiColumnsFlags_GrowParentContentsSize)) in EndColumns()
8399 …window->DC.CursorMaxPos.x = columns->StartMaxPosX; // Restore cursor max pos, as columns don't gr… in EndColumns()
8403 if (!(columns->Flags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems) in EndColumns()
8405 const float y1 = columns->StartPosY; in EndColumns()
8406 const float y2 = window->DC.CursorPos.y; in EndColumns()
8407 int dragging_column = -1; in EndColumns()
8408 for (int n = 1; n < columns->Count; n++) in EndColumns()
8410 float x = window->Pos.x + GetColumnOffset(n); in EndColumns()
8411 const ImGuiID column_id = columns->ID + ImGuiID(n); in EndColumns()
8412 const float column_hw = GetColumnsRectHalfWidth(); // Half-width for interaction in EndColumns()
8413 const ImRect column_rect(ImVec2(x - column_hw, y1), ImVec2(x + column_hw, y2)); in EndColumns()
8419 if (!(columns->Flags & ImGuiColumnsFlags_NoResize)) in EndColumns()
8424 if (held && !(columns->Columns[n].Flags & ImGuiColumnsFlags_NoResize)) in EndColumns()
8431 …window->DrawList->AddLine(ImVec2(xi, ImMax(y1 + 1.0f, window->ClipRect.Min.y)), ImVec2(xi, ImMin(y… in EndColumns()
8435 if (dragging_column != -1) in EndColumns()
8437 if (!columns->IsBeingResized) in EndColumns()
8438 for (int n = 0; n < columns->Count + 1; n++) in EndColumns()
8439 columns->Columns[n].OffsetNormBeforeResize = columns->Columns[n].OffsetNorm; in EndColumns()
8440 columns->IsBeingResized = is_being_resized = true; in EndColumns()
8445 columns->IsBeingResized = is_being_resized; in EndColumns()
8447 window->DC.ColumnsSet = NULL; in EndColumns()
8448 window->DC.ColumnsOffset.x = 0.0f; in EndColumns()
8449 …window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffs… in EndColumns()
8452 // [2018-03: This is currently the only public API, while we are working on making BeginColumns/End…
8460 …if (window->DC.ColumnsSet != NULL && window->DC.ColumnsSet->Count == columns_count && window->DC.C… in Columns()
8463 if (window->DC.ColumnsSet != NULL) in Columns()
8470 //-----------------------------------------------------------------------------
8472 //-----------------------------------------------------------------------------
8482 g.DragDropAcceptFrameCount = -1; in ClearDragDrop()
8501 source_id = window->DC.LastItemId; in BeginDragDropSource()
8521 … bool is_hovered = (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) != 0; in BeginDragDropSource()
8524 source_id = window->DC.LastItemId = window->GetIDFromRectangle(window->DC.LastItemRect); in BeginDragDropSource()
8541 source_parent_id = window->IDStack.back(); in BeginDragDropSource()
8575 tooltip_window->SkipItems = true; in BeginDragDropSource()
8576 tooltip_window->HiddenFramesRegular = 1; in BeginDragDropSource()
8581 window->DC.LastItemStatusFlags &= ~ImGuiItemStatusFlags_HoveredRect; in BeginDragDropSource()
8598 if (g.DragDropPayload.DataFrameCount == -1) in EndDragDropSource()
8617 if (cond == ImGuiCond_Always || payload.DataFrameCount == -1) in SetDragDropPayload()
8644 …n (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1); in SetDragDropPayload()
8654 if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) in BeginDragDropTargetCustom()
8659 if (window->SkipItems) in BeginDragDropTargetCustom()
8672 // Also note how the HoveredWindow test is positioned differently in both functions (in both functi…
8680 if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) in BeginDragDropTarget()
8682 if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) in BeginDragDropTarget()
8685 … display_rect = (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? window->D… in BeginDragDropTarget()
8686 ImGuiID id = window->DC.LastItemId; in BeginDragDropTarget()
8688 id = window->GetIDFromRectangle(display_rect); in BeginDragDropTarget()
8711 IM_ASSERT(payload.DataFrameCount != -1); // Forgot to call EndDragDropTarget() ? in AcceptDragDropPayload()
8732 // FIXME-DRAG: Settle on a proper default visuals for drop target. in AcceptDragDropPayload()
8734 bool push_clip_rect = !window->ClipRect.Contains(r); in AcceptDragDropPayload()
8735 if (push_clip_rect) window->DrawList->PushClipRect(r.Min-ImVec2(1,1), r.Max+ImVec2(1,1)); in AcceptDragDropPayload()
8736 … window->DrawList->AddRect(r.Min, r.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, ~0, 2.0f); in AcceptDragDropPayload()
8737 if (push_clip_rect) window->DrawList->PopClipRect(); in AcceptDragDropPayload()
8741 …// For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() inst… in AcceptDragDropPayload()
8763 //-----------------------------------------------------------------------------
8765 //-----------------------------------------------------------------------------
8769 //-----------------------------------------------------------------------------
8771 //-----------------------------------------------------------------------------
8774 //-----------------------------------------------------------------------------
8802 const bool log_new_line = ref_pos && (ref_pos->y > window->DC.LogLinePosY + 1); in LogRenderedText()
8804 window->DC.LogLinePosY = ref_pos->y; in LogRenderedText()
8807 …if (g.LogStartDepth > window->DC.TreeDepth) // Re-adjust padding if we have popped out of our sta… in LogRenderedText()
8808 g.LogStartDepth = window->DC.TreeDepth; in LogRenderedText()
8809 const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth); in LogRenderedText()
8819 const int char_count = (int)(line_end - line_start); in LogRenderedText()
8843 g.LogStartDepth = window->DC.TreeDepth; in LogToTTY()
8871 g.LogStartDepth = window->DC.TreeDepth; in LogToFile()
8887 g.LogStartDepth = window->DC.TreeDepth; in LogToClipboard()
8940 //-----------------------------------------------------------------------------
8942 //-----------------------------------------------------------------------------
8954 if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings)) in MarkIniSettingsDirty()
8964 settings->Name = ImStrdup(name); in CreateNewWindowSettings()
8965 settings->ID = ImHashStr(name, 0); in CreateNewWindowSettings()
9005 // Zero-tolerance, no error reporting, cheap .ini parsing
9012 …// For user convenience, we allow passing a non zero-terminated string (hence the ini_size paramet… in LoadIniSettingsFromMemory()
9013 …// For our convenience and to make the code simpler, we'll also write zero-terminators within the … in LoadIniSettingsFromMemory()
9036 if (line[0] == '[' && line_end > line && line_end[-1] == ']') in LoadIniSettingsFromMemory()
9039 line_end[-1] = 0; in LoadIniSettingsFromMemory()
9040 const char* name_end = line_end - 1; in LoadIniSettingsFromMemory()
9055 … entry_data = entry_handler ? entry_handler->ReadOpenFn(&g, entry_handler, name_start) : NULL; in LoadIniSettingsFromMemory()
9060 entry_handler->ReadLineFn(&g, entry_handler, entry_data, line); in LoadIniSettingsFromMemory()
9093 handler->WriteAllFn(&g, handler, &g.SettingsIniData); in SaveIniSettingsToMemory()
9113 if (sscanf(line, "Pos=%f,%f", &x, &y) == 2) settings->Pos = ImVec2(x, y); in SettingsHandlerWindow_ReadLine()
9114 …se if (sscanf(line, "Size=%f,%f", &x, &y) == 2) settings->Size = ImMax(ImVec2(x, y), GImGui->Sty… in SettingsHandlerWindow_ReadLine()
9115 else if (sscanf(line, "Collapsed=%d", &i) == 1) settings->Collapsed = (i != 0); in SettingsHandlerWindow_ReadLine()
9126 if (window->Flags & ImGuiWindowFlags_NoSavedSettings) in SettingsHandlerWindow_WriteAll()
9129 …ettings* settings = (window->SettingsIdx != -1) ? &g.SettingsWindows[window->SettingsIdx] : ImGui:… in SettingsHandlerWindow_WriteAll()
9132 settings = ImGui::CreateNewWindowSettings(window->Name); in SettingsHandlerWindow_WriteAll()
9133 window->SettingsIdx = g.SettingsWindows.index_from_ptr(settings); in SettingsHandlerWindow_WriteAll()
9135 IM_ASSERT(settings->ID == window->ID); in SettingsHandlerWindow_WriteAll()
9136 settings->Pos = window->Pos; in SettingsHandlerWindow_WriteAll()
9137 settings->Size = window->SizeFull; in SettingsHandlerWindow_WriteAll()
9138 settings->Collapsed = window->Collapsed; in SettingsHandlerWindow_WriteAll()
9142 buf->reserve(buf->size() + g.SettingsWindows.Size * 96); // ballpark reserve in SettingsHandlerWindow_WriteAll()
9146 if (settings->Pos.x == FLT_MAX) in SettingsHandlerWindow_WriteAll()
9148 const char* name = settings->Name; in SettingsHandlerWindow_WriteAll()
9151 buf->appendf("[%s][%s]\n", handler->TypeName, name); in SettingsHandlerWindow_WriteAll()
9152 buf->appendf("Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y); in SettingsHandlerWindow_WriteAll()
9153 buf->appendf("Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y); in SettingsHandlerWindow_WriteAll()
9154 buf->appendf("Collapsed=%d\n", settings->Collapsed); in SettingsHandlerWindow_WriteAll()
9155 buf->appendf("\n"); in SettingsHandlerWindow_WriteAll()
9159 //-----------------------------------------------------------------------------
9161 //-----------------------------------------------------------------------------
9226 // Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
9233 // Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
9239 g.PrivateClipboard.resize((int)(text_end - text) + 1); in SetClipboardTextFn_DefaultImpl()
9240 memcpy(&g.PrivateClipboard[0], text, (size_t)(text_end - text)); in SetClipboardTextFn_DefaultImpl()
9241 g.PrivateClipboard[(int)(text_end - text)] = 0; in SetClipboardTextFn_DefaultImpl()
9257 if (HWND hwnd = (HWND)GImGui->IO.ImeWindowHandle) in ImeSetInputScreenPosFn_DefaultImpl()
9275 //-----------------------------------------------------------------------------
9277 //-----------------------------------------------------------------------------
9303 …cmds", label, draw_list->_OwnerName ? draw_list->_OwnerName : "", draw_list->VtxBuffer.Size, draw_… in ShowMetricsWindow()
9307 … APPENDING"); // Can't display stats for active draw list! (we don't have the data double-buffered) in ShowMetricsWindow()
9312 …ay_draw_list = GetOverlayDrawList(window); // Render additional visuals into the top-most draw list in ShowMetricsWindow()
9314 … overlay_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); in ShowMetricsWindow()
9319 …for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem… in ShowMetricsWindow()
9321 if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0) in ShowMetricsWindow()
9323 if (pcmd->UserCallback) in ShowMetricsWindow()
9325 … ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData); in ShowMetricsWindow()
9328 … ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL; in ShowMetricsWindow()
9329 …- draw_list->CmdBuffer.begin()), "Draw %4d %s vtx, tex 0x%p, clip_rect (%4.0f,%4.0f)-(%4.0f,%4.0f)… in ShowMetricsWindow()
9332 ImRect clip_rect = pcmd->ClipRect; in ShowMetricsWindow()
9334 for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++) in ShowMetricsWindow()
9335 vtxs_rect.Add(draw_list->VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos); in ShowMetricsWindow()
9336 …clip_rect.Floor(); overlay_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,255,0,255… in ShowMetricsWindow()
9337 …vtxs_rect.Floor(); overlay_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,0,255,255… in ShowMetricsWindow()
9343 …ImGuiListClipper clipper(pcmd->ElemCount/3); // Manually coarse clip our print out of individual v… in ShowMetricsWindow()
9353 ImDrawVert& v = draw_list->VtxBuffer[vtx_i]; in ShowMetricsWindow()
9355 …buf_p += ImFormatString(buf_p, buf_end - buf_p, "%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %… in ShowMetricsWindow()
9361 ImDrawListFlags backup_flags = overlay_draw_list->Flags; in ShowMetricsWindow()
9362 …overlay_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines … in ShowMetricsWindow()
9363 … overlay_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f); in ShowMetricsWindow()
9364 overlay_draw_list->Flags = backup_flags; in ShowMetricsWindow()
9383 …!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasA… in ShowMetricsWindow()
9385 ImGuiWindowFlags flags = window->Flags; in ShowMetricsWindow()
9386 NodeDrawList(window, window->DrawList, "DrawList"); in ShowMetricsWindow()
9387 …SizeContents (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->S… in ShowMetricsWindow()
9392 …::BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f)", window->Scroll.x, GetWindowScrollMaxX(window), windo… in ShowMetricsWindow()
9393 …: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasAct… in ShowMetricsWindow()
9394 … %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesRegular, window->Hidd… in ShowMetricsWindow()
9395 …stIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], windo… in ShowMetricsWindow()
9396 …::BulletText("NavLastChildNavWindow: %s", window->NavLastChildNavWindow ? window->NavLastChildNavW… in ShowMetricsWindow()
9397 if (!window->NavRectRel[0].IsInverted()) in ShowMetricsWindow()
9398 … (%.1f,%.1f)(%.1f,%.1f)", window->NavRectRel[0].Min.x, window->NavRectRel[0].Min.y, window->NavRec… in ShowMetricsWindow()
9401 if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow"); in ShowMetricsWindow()
9402 if (window->ParentWindow != NULL) NodeWindow(window->ParentWindow, "ParentWindow"); in ShowMetricsWindow()
9403 … if (window->DC.ChildWindows.Size > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows"); in ShowMetricsWindow()
9404 …if (window->ColumnsStorage.Size > 0 && ImGui::TreeNode("Columns", "Columns sets (%d)", window->Col… in ShowMetricsWindow()
9406 for (int n = 0; n < window->ColumnsStorage.Size; n++) in ShowMetricsWindow()
9408 const ImGuiColumnsSet* columns = &window->ColumnsStorage[n]; in ShowMetricsWindow()
9409 …eNode((void*)(uintptr_t)columns->ID, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->ID, … in ShowMetricsWindow()
9411 …tText("Width: %.1f (MinX: %.1f, MaxX: %.1f)", columns->MaxX - columns->MinX, columns->MinX, column… in ShowMetricsWindow()
9412 for (int column_n = 0; column_n < columns->Columns.Size; column_n++) in ShowMetricsWindow()
9413 …tNorm %.3f (= %.1f px)", column_n, columns->Columns[column_n].OffsetNorm, OffsetNormToPixels(colum… in ShowMetricsWindow()
9419 …ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.Size * (int)sizeof(ImGuiStorage::… in ShowMetricsWindow()
9429 …ImFormatString(p, buf_end - p, "TabBar (%d tabs)%s", tab_bar->Tabs.Size, (tab_bar->PrevFrameVisibl… in ShowMetricsWindow()
9432 for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) in ShowMetricsWindow()
9434 const ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; in ShowMetricsWindow()
9436 …if (ImGui::SmallButton("<")) { TabBarQueueChangeTabOrder(tab_bar, tab, -1); } ImGui::SameLine(0, 2… in ShowMetricsWindow()
9438 … ImGui::Text("%02d%c Tab 0x%08X", tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID); in ShowMetricsWindow()
9460 …Id, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " C… in ShowMetricsWindow()
9473 ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL"); in ShowMetricsWindow()
9474 … ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL"); in ShowMetricsWindow()
9475 …dIdPreviousFrame, g.HoveredIdTimer, g.HoveredIdAllowOverlap); // Data is "in-flight" so depending … in ShowMetricsWindow()
9477 ImGui::Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL"); in ShowMetricsWindow()
9478 ImGui::Text("MovingWindow: '%s'", g.MovingWindow ? g.MovingWindow->Name : "NULL"); in ShowMetricsWindow()
9479 ImGui::Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL"); in ShowMetricsWindow()
9485 …ImGui::Text("NavWindowingTarget: '%s'", g.NavWindowingTarget ? g.NavWindowingTarget->Name : "NULL"… in ShowMetricsWindow()
9496 if ((window->Flags & ImGuiWindowFlags_ChildWindow) || !window->WasActive) in ShowMetricsWindow()
9499 ImFormatString(buf, IM_ARRAYSIZE(buf), "%d", window->BeginOrderWithinContext); in ShowMetricsWindow()
9502 …overlay_draw_list->AddRectFilled(window->Pos, window->Pos + ImVec2(font_size, font_size), IM_COL32… in ShowMetricsWindow()
9503 … overlay_draw_list->AddText(NULL, font_size, window->Pos, IM_COL32(255, 255, 255, 255), buf); in ShowMetricsWindow()
9509 //-----------------------------------------------------------------------------
9517 //-----------------------------------------------------------------------------