imgui_internal.h
Go to the documentation of this file.
1 // dear imgui, v1.67 WIP
2 // (internal structures/api)
3 
4 // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
5 // Set:
6 // #define IMGUI_DEFINE_MATH_OPERATORS
7 // To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
8 
9 /*
10 
11 Index of this file:
12 // Header mess
13 // Forward declarations
14 // STB libraries includes
15 // Context pointer
16 // Generic helpers
17 // Misc data structures
18 // Main imgui context
19 // Tab bar, tab item
20 // Internal API
21 
22 */
23 
24 #pragma once
25 
26 //-----------------------------------------------------------------------------
27 // Header mess
28 //-----------------------------------------------------------------------------
29 
30 #ifndef IMGUI_VERSION
31 #error Must include imgui.h before imgui_internal.h
32 #endif
33 
34 #include <stdio.h> // FILE*
35 #include <stdlib.h> // NULL, malloc, free, qsort, atoi, atof
36 #include <math.h> // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf
37 #include <limits.h> // INT_MIN, INT_MAX
38 
39 #ifdef _MSC_VER
40 #pragma warning (push)
41 #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
42 #endif
43 
44 #ifdef __clang__
45 #pragma clang diagnostic push
46 #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
47 #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
48 #pragma clang diagnostic ignored "-Wold-style-cast"
49 #endif
50 
51 //-----------------------------------------------------------------------------
52 // Forward declarations
53 //-----------------------------------------------------------------------------
54 
55 struct ImRect; // An axis-aligned rectangle (2 points)
56 struct ImDrawDataBuilder; // Helper to build a ImDrawData instance
57 struct ImDrawListSharedData; // Data shared between all ImDrawList instances
58 struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it
59 struct ImGuiColumnData; // Storage data for a single column
60 struct ImGuiColumnsSet; // Storage data for a columns set
61 struct ImGuiContext; // Main imgui context
62 struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
63 struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
64 struct ImGuiItemHoveredDataBackup; // Backup and restore IsItemHovered() internal data
65 struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
66 struct ImGuiNavMoveResult; // Result of a directional navigation move query result
67 struct ImGuiNextWindowData; // Storage for SetNexWindow** functions
68 struct ImGuiPopupRef; // Storage for current popup stack
69 struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file
70 struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it
71 struct ImGuiTabBar; // Storage for a tab bar
72 struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
73 struct ImGuiWindow; // Storage for one window
74 struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame)
75 struct ImGuiWindowSettings; // Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
76 
77 // Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
78 typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
79 typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: for ButtonEx(), ButtonBehavior()
80 typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
81 typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
82 typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
83 typedef int ImGuiNavDirSourceFlags; // -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
84 typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
85 typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for Separator() - internal
86 typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for SliderBehavior()
87 typedef int ImGuiDragFlags; // -> enum ImGuiDragFlags_ // Flags: for DragBehavior()
88 
89 //-------------------------------------------------------------------------
90 // STB libraries includes
91 //-------------------------------------------------------------------------
92 
93 namespace ImGuiStb
94 {
95 
96 #undef STB_TEXTEDIT_STRING
97 #undef STB_TEXTEDIT_CHARTYPE
98 #define STB_TEXTEDIT_STRING ImGuiInputTextState
99 #define STB_TEXTEDIT_CHARTYPE ImWchar
100 #define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f
101 #include "imstb_textedit.h"
102 
103 } // namespace ImGuiStb
104 
105 //-----------------------------------------------------------------------------
106 // Context pointer
107 //-----------------------------------------------------------------------------
108 
109 #ifndef GImGui
110 extern IMGUI_API ImGuiContext* GImGui; // Current implicit ImGui context pointer
111 #endif
112 
113 //-----------------------------------------------------------------------------
114 // Generic helpers
115 //-----------------------------------------------------------------------------
116 
117 #define IM_PI 3.14159265358979323846f
118 #ifdef _WIN32
119 #define IM_NEWLINE "\r\n" // Play it nice with Windows users (2018/05 news: Microsoft announced that Notepad will finally display Unix-style carriage returns!)
120 #else
121 #define IM_NEWLINE "\n"
122 #endif
123 #define IMGUI_DEBUG_LOG(_FMT,...) printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__)
124 #define IM_STATIC_ASSERT(_COND) typedef char static_assertion_##__line__[(_COND)?1:-1]
125 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose
126 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
127 
128 // Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
129 #ifdef _MSC_VER
130 #define IMGUI_CDECL __cdecl
131 #else
132 #define IMGUI_CDECL
133 #endif
134 
135 // Helpers: UTF-8 <> wchar
136 IMGUI_API int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
137 IMGUI_API int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // read one character. return input UTF-8 bytes count
138 IMGUI_API int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count
139 IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count)
140 IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8
141 IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8
142 
143 // Helpers: Misc
144 IMGUI_API ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings
145 IMGUI_API void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, size_t* out_file_size = NULL, int padding_bytes = 0);
146 IMGUI_API FILE* ImFileOpen(const char* filename, const char* file_open_mode);
147 static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
148 static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; }
149 static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; }
150 static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
151 #define ImQsort qsort
152 
153 // Helpers: Geometry
154 IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);
155 IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
156 IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
157 IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);
158 IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy);
159 
160 // Helpers: String
161 IMGUI_API int ImStricmp(const char* str1, const char* str2);
162 IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count);
163 IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count);
164 IMGUI_API char* ImStrdup(const char* str);
165 IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str);
166 IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c);
167 IMGUI_API int ImStrlenW(const ImWchar* str);
168 IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line
169 IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line
170 IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end);
171 IMGUI_API void ImStrTrimBlanks(char* str);
172 IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3);
173 IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3);
174 IMGUI_API const char* ImParseFormatFindStart(const char* format);
175 IMGUI_API const char* ImParseFormatFindEnd(const char* format);
176 IMGUI_API const char* ImParseFormatTrimDecorations(const char* format, char* buf, int buf_size);
177 IMGUI_API int ImParseFormatPrecision(const char* format, int default_value);
178 
179 // Helpers: ImVec2/ImVec4 operators
180 // We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.)
181 // We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself.
182 #ifdef IMGUI_DEFINE_MATH_OPERATORS
183 static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x*rhs, lhs.y*rhs); }
184 static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x/rhs, lhs.y/rhs); }
185 static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); }
186 static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); }
187 static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); }
188 static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); }
189 static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
190 static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
191 static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
192 static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
193 static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z, lhs.w+rhs.w); }
194 static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z, lhs.w-rhs.w); }
195 static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); }
196 #endif
197 
198 // Helpers: Maths
199 // - Wrapper for standard libs functions. (Note that imgui_demo.cpp does _not_ use them to keep the code easy to copy)
200 #ifndef IMGUI_DISABLE_MATH_FUNCTIONS
201 static inline float ImFabs(float x) { return fabsf(x); }
202 static inline float ImSqrt(float x) { return sqrtf(x); }
203 static inline float ImPow(float x, float y) { return powf(x, y); }
204 static inline double ImPow(double x, double y) { return pow(x, y); }
205 static inline float ImFmod(float x, float y) { return fmodf(x, y); }
206 static inline double ImFmod(double x, double y) { return fmod(x, y); }
207 static inline float ImCos(float x) { return cosf(x); }
208 static inline float ImSin(float x) { return sinf(x); }
209 static inline float ImAcos(float x) { return acosf(x); }
210 static inline float ImAtan2(float y, float x) { return atan2f(y, x); }
211 static inline double ImAtof(const char* s) { return atof(s); }
212 static inline float ImFloorStd(float x) { return floorf(x); } // we already uses our own ImFloor() { return (float)(int)v } internally so the standard one wrapper is named differently (it's used by stb_truetype)
213 static inline float ImCeil(float x) { return ceilf(x); }
214 #endif
215 // - ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support for variety of types: signed/unsigned int/long long float/double, using templates here but we could also redefine them 6 times
216 template<typename T> static inline T ImMin(T lhs, T rhs) { return lhs < rhs ? lhs : rhs; }
217 template<typename T> static inline T ImMax(T lhs, T rhs) { return lhs >= rhs ? lhs : rhs; }
218 template<typename T> static inline T ImClamp(T v, T mn, T mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
219 template<typename T> static inline T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); }
220 template<typename T> static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
221 // - Misc maths helpers
222 static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); }
223 static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); }
224 static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); }
225 static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); }
226 static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
227 static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); }
228 static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
229 static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; }
230 static inline float ImLengthSqr(const ImVec4& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y + lhs.z*lhs.z + lhs.w*lhs.w; }
231 static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = lhs.x*lhs.x + lhs.y*lhs.y; if (d > 0.0f) return 1.0f / ImSqrt(d); return fail_value; }
232 static inline float ImFloor(float f) { return (float)(int)f; }
233 static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)v.x, (float)(int)v.y); }
234 static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
235 static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
236 static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; }
237 static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
238 
239 // Helper: ImPool<>. Basic keyed storage for contiguous instances, slow/amortized insertion, O(1) indexable, O(Log N) queries by ID over a dense/hot buffer,
240 // Honor constructor/destructor. Add/remove invalidate all pointers. Indexes have the same lifetime as the associated object.
241 typedef int ImPoolIdx;
242 template<typename T>
244 {
245  ImVector<T> Data; // Contiguous data
246  ImGuiStorage Map; // ID->Index
247  ImPoolIdx FreeIdx; // Next free idx to use
248 
249  ImPool() { FreeIdx = 0; }
250  ~ImPool() { Clear(); }
251  T* GetByKey(ImGuiID key) { int idx = Map.GetInt(key, -1); return (idx != -1) ? &Data[idx] : NULL; }
252  T* GetByIndex(ImPoolIdx n) { return &Data[n]; }
253  ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Data.Data && p < Data.Data + Data.Size); return (ImPoolIdx)(p - Data.Data); }
254  T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Data[*p_idx]; *p_idx = FreeIdx; return Add(); }
255  void Clear() { for (int n = 0; n < Map.Data.Size; n++) { int idx = Map.Data[n].val_i; if (idx != -1) Data[idx].~T(); } Map.Clear(); Data.clear(); FreeIdx = 0; }
256  T* Add() { int idx = FreeIdx; if (idx == Data.Size) { Data.resize(Data.Size + 1); FreeIdx++; } else { FreeIdx = *(int*)&Data[idx]; } IM_PLACEMENT_NEW(&Data[idx]) T(); return &Data[idx]; }
257  void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); }
258  void Remove(ImGuiID key, ImPoolIdx idx) { Data[idx].~T(); *(int*)&Data[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); }
259  void Reserve(int capacity) { Data.reserve(capacity); Map.Data.reserve(capacity); }
260  int GetSize() const { return Data.Size; }
261 };
262 
263 //-----------------------------------------------------------------------------
264 // Misc data structures
265 //-----------------------------------------------------------------------------
266 
267 // 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
268 struct ImVec1
269 {
270  float x;
271  ImVec1() { x = 0.0f; }
272  ImVec1(float _x) { x = _x; }
273 };
274 
276 {
278  ImGuiButtonFlags_Repeat = 1 << 0, // hold to repeat
279  ImGuiButtonFlags_PressedOnClickRelease = 1 << 1, // return true on click + release on same item [DEFAULT if no PressedOn* flag is set]
280  ImGuiButtonFlags_PressedOnClick = 1 << 2, // return true on click (default requires click+release)
281  ImGuiButtonFlags_PressedOnRelease = 1 << 3, // return true on release (default requires click+release)
282  ImGuiButtonFlags_PressedOnDoubleClick = 1 << 4, // return true on double-click (default requires click+release)
283  ImGuiButtonFlags_FlattenChildren = 1 << 5, // allow interactions even if a child window is overlapping
284  ImGuiButtonFlags_AllowItemOverlap = 1 << 6, // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
285  ImGuiButtonFlags_DontClosePopups = 1 << 7, // disable automatically closing parent popup on press // [UNUSED]
286  ImGuiButtonFlags_Disabled = 1 << 8, // disable interactions
287  ImGuiButtonFlags_AlignTextBaseLine = 1 << 9, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
288  ImGuiButtonFlags_NoKeyModifiers = 1 << 10, // disable interaction if a key modifier is held
289  ImGuiButtonFlags_NoHoldingActiveID = 1 << 11, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
290  ImGuiButtonFlags_PressedOnDragDropHold = 1 << 12, // press when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
291  ImGuiButtonFlags_NoNavFocus = 1 << 13 // don't override navigation focus when activated
292 };
293 
295 {
298 };
299 
301 {
304 };
307 {
308  // Default: 0
310  ImGuiColumnsFlags_NoBorder = 1 << 0, // Disable column dividers
311  ImGuiColumnsFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers
312  ImGuiColumnsFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns
313  ImGuiColumnsFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window
314  ImGuiColumnsFlags_GrowParentContentsSize= 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
315 };
316 
318 {
319  // NB: need to be in sync with last value of ImGuiSelectableFlags_
324 };
327 {
329  ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
331 };
332 
333 // Storage for LastItem data
335 {
339  ImGuiItemStatusFlags_Edited = 1 << 2 // Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
340 
341 #ifdef IMGUI_ENABLE_TEST_ENGINE
342  , // [imgui-test only]
343  ImGuiItemStatusFlags_Openable = 1 << 10, //
344  ImGuiItemStatusFlags_Opened = 1 << 11, //
345  ImGuiItemStatusFlags_Checkable = 1 << 12, //
346  ImGuiItemStatusFlags_Checked = 1 << 13 //
347 #endif
348 };
350 // FIXME: this is in development, not exposed/functional as a generic feature yet.
352 {
355 };
356 
358 {
362 };
365 {
368 };
369 
371 {
375  ImGuiInputSource_NavKeyboard, // Only used occasionally for storage, not tested/handled by most code
378 };
379 
380 // FIXME-NAV: Clarify/expose various repeat delay/rate
382 {
389 };
390 
392 {
398 };
399 
401 {
406 };
407 
409 {
411  ImGuiNavMoveFlags_LoopX = 1 << 0, // On failed request, restart from opposite side
413  ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
414  ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful for provided for completeness
415  ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place)
416  ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5 // Store alternate result in NavMoveResultLocalVisibleSet that only comprise elements that are already fully visible.
417 };
418 
420 {
424 };
425 
427 {
428  ImGuiNavLayer_Main = 0, // Main scrolling layer
429  ImGuiNavLayer_Menu = 1, // Menu layer (access with Alt/ImGuiNavInput_Menu)
431 };
432 
434 {
437 };
438 
439 // 2D axis aligned bounding-box
440 // NB: we can't rely on ImVec2 math operators being available here
442 {
443  ImVec2 Min; // Upper-left
444  ImVec2 Max; // Lower-right
445 
446  ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {}
447  ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
448  ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
449  ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}
450 
451  ImVec2 GetCenter() const { return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
452  ImVec2 GetSize() const { return ImVec2(Max.x - Min.x, Max.y - Min.y); }
453  float GetWidth() const { return Max.x - Min.x; }
454  float GetHeight() const { return Max.y - Min.y; }
455  ImVec2 GetTL() const { return Min; } // Top-left
456  ImVec2 GetTR() const { return ImVec2(Max.x, Min.y); } // Top-right
457  ImVec2 GetBL() const { return ImVec2(Min.x, Max.y); } // Bottom-left
458  ImVec2 GetBR() const { return Max; } // Bottom-right
459  bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
460  bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; }
461  bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
462  void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; }
463  void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; }
464  void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
465  void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
466  void Translate(const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
467  void TranslateX(float dx) { Min.x += dx; Max.x += dx; }
468  void TranslateY(float dy) { Min.y += dy; Max.y += dy; }
469  void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
470  void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped.
471  void Floor() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; }
472  bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; }
473 };
474 
475 // Stacked color modifier, backup of modified data so we can restore it
477 {
480 };
481 
482 // Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
484 {
486  union { int BackupInt[2]; float BackupFloat[2]; };
487  ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; }
488  ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; }
489  ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
490 };
491 
492 // Stacked storage data for BeginGroup()/EndGroup()
494 {
505 };
506 
507 // Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper.
509 {
510  int Count;
511  float Spacing;
512  float Width, NextWidth;
513  float Pos[4], NextWidths[4];
514 
516  void Update(int count, float spacing, bool clear);
517  float DeclColumns(float w0, float w1, float w2);
518  float CalcExtraSpace(float avail_w);
519 };
520 
521 // Internal state of the currently focused/edited text input box
523 {
524  ImGuiID ID; // widget id owning the text state
525  ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
526  ImVector<char> InitialText; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
527  ImVector<char> TempBuffer; // temporary buffer for callback and other other operations. size=capacity.
528  int CurLenA, CurLenW; // we need to maintain our buffer length in both UTF-8 and wchar format.
529  int BufCapacityA; // end-user buffer capacity
530  float ScrollX;
532  float CursorAnim;
535 
536  // Temporarily set when active
540 
541  ImGuiInputTextState() { memset(this, 0, sizeof(*this)); }
542  void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
543  void CursorClamp() { StbState.cursor = ImMin(StbState.cursor, CurLenW); StbState.select_start = ImMin(StbState.select_start, CurLenW); StbState.select_end = ImMin(StbState.select_end, CurLenW); }
544  bool HasSelection() const { return StbState.select_start != StbState.select_end; }
545  void ClearSelection() { StbState.select_start = StbState.select_end = StbState.cursor; }
546  void SelectAll() { StbState.select_start = 0; StbState.cursor = StbState.select_end = CurLenW; StbState.has_preferred_x = false; }
547  void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
548 };
549 
550 // Windows data saved in imgui.ini file
552 {
553  char* Name;
557  bool Collapsed;
558 
559  ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ImVec2(0,0); Collapsed = false; }
560 };
561 
563 {
564  const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']'
565  ImGuiID TypeHash; // == ImHash(TypeName, 0, 0)
566  void* (*ReadOpenFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); // Read: Called when entering into a new ini entry e.g. "[Window][Name]"
567  void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); // Read: Called for every line of text within an ini entry
568  void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); // Write: Output every entries into 'out_buf'
569  void* UserData;
570 
571  ImGuiSettingsHandler() { memset(this, 0, sizeof(*this)); }
572 };
573 
574 // Storage for current popup stack
576 {
577  ImGuiID PopupId; // Set on OpenPopup()
578  ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
579  ImGuiWindow* ParentWindow; // Set on OpenPopup()
580  int OpenFrameCount; // Set on OpenPopup()
581  ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differenciate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
582  ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
583  ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup
584 };
585 
587 {
588  float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
590  ImGuiColumnsFlags Flags; // Not exposed
592 
593  ImGuiColumnData() { OffsetNorm = OffsetNormBeforeResize = 0.0f; Flags = 0; }
594 };
595 
597 {
602  int Current;
603  int Count;
604  float MinX, MaxX;
605  float LineMinY, LineMaxY;
606  float StartPosY; // Copy of CursorPos
607  float StartMaxPosX; // Copy of CursorMaxPos
609 
610  ImGuiColumnsSet() { Clear(); }
611  void Clear()
612  {
613  ID = 0;
614  Flags = 0;
615  IsFirstFrame = false;
616  IsBeingResized = false;
617  Current = 0;
618  Count = 1;
619  MinX = MaxX = 0.0f;
620  LineMinY = LineMaxY = 0.0f;
621  StartPosY = 0.0f;
622  StartMaxPosX = 0.0f;
623  Columns.clear();
624  }
625 };
626 
627 // Data shared between all ImDrawList instances
629 {
630  ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas
631  ImFont* Font; // Current/default font (optional, for simplified AddText overload)
632  float FontSize; // Current/default font size (optional, for simplified AddText overload)
634  ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
635 
636  // Const data
637  // FIXME: Bake rounded corners fill/borders in atlas
638  ImVec2 CircleVtx12[12];
639 
641 };
642 
644 {
645  ImVector<ImDrawList*> Layers[2]; // Global layers for: regular, tooltip
646 
647  void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
648  void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
649  IMGUI_API void FlattenIntoSingleLayer();
650 };
651 
653 {
654  ImGuiID ID; // Best candidate
655  ImGuiWindow* Window; // Best candidate window
656  float DistBox; // Best candidate box distance to current NavId
657  float DistCenter; // Best candidate center distance to current NavId
658  float DistAxial;
659  ImRect RectRel; // Best candidate bounding box in window relative space
660 
661  ImGuiNavMoveResult() { Clear(); }
662  void Clear() { ID = 0; Window = NULL; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel = ImRect(); }
663 };
664 
665 // Storage for SetNexWindow** functions
667 {
683  float BgAlphaVal;
684  ImVec2 MenuBarOffsetMinVal; // This is not exposed publicly, so we don't clear it.
685 
687  {
688  PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = 0;
689  PosVal = PosPivotVal = SizeVal = ImVec2(0.0f, 0.0f);
690  ContentSizeVal = ImVec2(0.0f, 0.0f);
691  CollapsedVal = false;
692  SizeConstraintRect = ImRect();
693  SizeCallback = NULL;
694  SizeCallbackUserData = NULL;
695  BgAlphaVal = FLT_MAX;
696  MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
697  }
698 
699  void Clear()
700  {
701  PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = 0;
702  }
703 };
704 
706 {
707  int Index;
708  float Width;
709 };
710 
711 //-----------------------------------------------------------------------------
712 // Main imgui context
713 //-----------------------------------------------------------------------------
714 
716 {
718  bool FrameScopeActive; // Set by NewFrame(), cleared by EndFrame()
719  bool FrameScopePushedImplicitWindow; // Set by NewFrame(), cleared by EndFrame()
720  bool FontAtlasOwnedByContext; // Io.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
723  ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
724  float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
725  float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height.
727 
728  double Time;
732  ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
733  ImVector<ImGuiWindow*> WindowsFocusOrder; // Windows, sorted in focus order, back to front
738  ImGuiWindow* CurrentWindow; // Being drawn into
739  ImGuiWindow* HoveredWindow; // Will catch mouse inputs
740  ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only)
741  ImGuiID HoveredId; // Hovered widget
744  float HoveredIdTimer; // Measure contiguous hovering time
745  float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
746  ImGuiID ActiveId; // Active widget
748  ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
750  bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
751  bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
752  bool ActiveIdHasBeenEdited; // Was the value associated to the widget Edited over the course of the Active state.
755  int ActiveIdAllowNavDirFlags; // Active widget allows using directional navigation (e.g. can activate a button and move away from it)
756  ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
759  ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
760  ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation.
761  float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
763  ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
764  ImVector<ImGuiColorMod> ColorModifiers; // Stack for PushStyleColor()/PopStyleColor()
765  ImVector<ImGuiStyleMod> StyleModifiers; // Stack for PushStyleVar()/PopStyleVar()
766  ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont()
767  ImVector<ImGuiPopupRef> OpenPopupStack; // Which popups are open (persistent)
768  ImVector<ImGuiPopupRef> BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
769  ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions
770  bool NextTreeNodeOpenVal; // Storage for SetNextTreeNode** functions
772 
773  // Navigation data (for gamepad/keyboard)
774  ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusWindow'
775  ImGuiID NavId; // Focused item for navigation
776  ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem()
777  ImGuiID NavActivateDownId; // ~~ IsNavInputDown(ImGuiNavInput_Activate) ? NavId : 0
778  ImGuiID NavActivatePressedId; // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0
779  ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0
780  ImGuiID NavJustTabbedId; // Just tabbed to this id.
781  ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest)
782  ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame
783  ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
784  ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
785  int NavScoringCount; // Metrics for debugging
786  ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
787  ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f
792  ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
793  int NavIdTabCounter; // == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
794  bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRefRectRel is valid
795  bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
796  bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
797  bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
798  bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest
799  bool NavInitRequest; // Init request for appearing window to select first item
803  bool NavMoveFromClampedRefRect; // Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items
804  bool NavMoveRequest; // Move request for this frame
806  ImGuiNavForward NavMoveRequestForward; // None / ForwardQueued / ForwardActive (this is used to navigate sibling parent menus from a child menu)
807  ImGuiDir NavMoveDir, NavMoveDirLast; // Direction of the move request (left/right/up/down), direction of the previous move request
809  ImGuiNavMoveResult NavMoveResultLocal; // Best move request candidate within NavWindow
810  ImGuiNavMoveResult NavMoveResultLocalVisibleSet; // Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
811  ImGuiNavMoveResult NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
812 
813  // Render
814  ImDrawData DrawData; // Main ImDrawData instance to pass render information to the user
816  float DimBgRatio; // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
817  ImDrawList OverlayDrawList; // Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays
819 
820  // Drag and Drop
830  float DragDropAcceptIdCurrRectSurface; // Target item surface (we resolve overlapping targets by prioritizing the smaller surface)
831  ImGuiID DragDropAcceptIdCurr; // Target item id (set at the time of accepting the payload)
832  ImGuiID DragDropAcceptIdPrev; // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
833  int DragDropAcceptFrameCount; // Last time a target expressed a desire to accept the source
834  ImVector<unsigned char> DragDropPayloadBufHeap; // We don't expose the ImVector<> directly
835  unsigned char DragDropPayloadBufLocal[8]; // Local buffer for small payloads
836 
837  // Tab bars
841 
842  // Widget state
845  ImGuiID ScalarAsInputTextId; // Temporary text input when CTRL+clicking on a slider, etc.
846  ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
849  float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
850  float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
851  ImVec2 ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
853  ImVector<char> PrivateClipboard; // If no custom clipboard handler is defined
854 
855  // Platform support
856  ImVec2 PlatformImePos, PlatformImeLastPos; // Cursor position request & last passed to the OS Input Method Editor
857 
858  // Settings
860  float SettingsDirtyTimer; // Save .ini Settings to memory when time reaches zero
861  ImGuiTextBuffer SettingsIniData; // In memory .ini settings
862  ImVector<ImGuiSettingsHandler> SettingsHandlers; // List of .ini settings handlers
863  ImVector<ImGuiWindowSettings> SettingsWindows; // ImGuiWindow .ini settings entries (parsed from the last loaded .ini file and maintained on saving)
864 
865  // Logging
867  FILE* LogFile; // If != NULL log to stdout/ file
868  ImGuiTextBuffer LogClipboard; // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
871 
872  // Misc
873  float FramerateSecPerFrame[120]; // Calculate estimate of framerate for user over the last 2 seconds.
876  int WantCaptureMouseNextFrame; // Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags
879  char TempBuffer[1024*3+1]; // Temporary text buffer
880 
881  ImGuiContext(ImFontAtlas* shared_font_atlas) : OverlayDrawList(NULL)
882  {
883  Initialized = false;
884  FrameScopeActive = FrameScopePushedImplicitWindow = false;
885  Font = NULL;
886  FontSize = FontBaseSize = 0.0f;
887  FontAtlasOwnedByContext = shared_font_atlas ? false : true;
888  IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
889 
890  Time = 0.0f;
891  FrameCount = 0;
892  FrameCountEnded = FrameCountRendered = -1;
893  WindowsActiveCount = 0;
894  CurrentWindow = NULL;
895  HoveredWindow = NULL;
896  HoveredRootWindow = NULL;
897  HoveredId = 0;
898  HoveredIdAllowOverlap = false;
899  HoveredIdPreviousFrame = 0;
900  HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
901  ActiveId = 0;
902  ActiveIdPreviousFrame = 0;
903  ActiveIdIsAlive = 0;
904  ActiveIdTimer = 0.0f;
905  ActiveIdIsJustActivated = false;
906  ActiveIdAllowOverlap = false;
907  ActiveIdHasBeenEdited = false;
908  ActiveIdPreviousFrameIsAlive = false;
909  ActiveIdPreviousFrameHasBeenEdited = false;
910  ActiveIdAllowNavDirFlags = 0;
911  ActiveIdClickOffset = ImVec2(-1,-1);
912  ActiveIdWindow = ActiveIdPreviousFrameWindow = NULL;
913  ActiveIdSource = ImGuiInputSource_None;
914  LastActiveId = 0;
915  LastActiveIdTimer = 0.0f;
916  LastValidMousePos = ImVec2(0.0f, 0.0f);
917  MovingWindow = NULL;
918  NextTreeNodeOpenVal = false;
919  NextTreeNodeOpenCond = 0;
920 
921  NavWindow = NULL;
922  NavId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavInputId = 0;
923  NavJustTabbedId = NavJustMovedToId = NavNextActivateId = 0;
924  NavInputSource = ImGuiInputSource_None;
925  NavScoringRectScreen = ImRect();
926  NavScoringCount = 0;
927  NavWindowingTarget = NavWindowingTargetAnim = NavWindowingList = NULL;
928  NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
929  NavWindowingToggleLayer = false;
930  NavLayer = ImGuiNavLayer_Main;
931  NavIdTabCounter = INT_MAX;
932  NavIdIsAlive = false;
933  NavMousePosDirty = false;
934  NavDisableHighlight = true;
935  NavDisableMouseHover = false;
936  NavAnyRequest = false;
937  NavInitRequest = false;
938  NavInitRequestFromMove = false;
939  NavInitResultId = 0;
940  NavMoveFromClampedRefRect = false;
941  NavMoveRequest = false;
942  NavMoveRequestFlags = 0;
943  NavMoveRequestForward = ImGuiNavForward_None;
944  NavMoveDir = NavMoveDirLast = NavMoveClipDir = ImGuiDir_None;
945 
946  DimBgRatio = 0.0f;
947  OverlayDrawList._Data = &DrawListSharedData;
948  OverlayDrawList._OwnerName = "##Overlay"; // Give it a name for debugging
949  MouseCursor = ImGuiMouseCursor_Arrow;
950 
951  DragDropActive = DragDropWithinSourceOrTarget = false;
952  DragDropSourceFlags = 0;
953  DragDropSourceFrameCount = -1;
954  DragDropMouseButton = -1;
955  DragDropTargetId = 0;
956  DragDropAcceptFlags = 0;
957  DragDropAcceptIdCurrRectSurface = 0.0f;
958  DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
959  DragDropAcceptFrameCount = -1;
960  memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
961 
962  ScalarAsInputTextId = 0;
963  ColorEditOptions = ImGuiColorEditFlags__OptionsDefault;
964  DragCurrentAccumDirty = false;
965  DragCurrentAccum = 0.0f;
966  DragSpeedDefaultRatio = 1.0f / 100.0f;
967  ScrollbarClickDeltaToGrabCenter = ImVec2(0.0f, 0.0f);
968  TooltipOverrideCount = 0;
969  PlatformImePos = PlatformImeLastPos = ImVec2(FLT_MAX, FLT_MAX);
970 
971  SettingsLoaded = false;
972  SettingsDirtyTimer = 0.0f;
973 
974  LogEnabled = false;
975  LogFile = NULL;
976  LogStartDepth = 0;
977  LogAutoExpandMaxDepth = 2;
978 
979  memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
980  FramerateSecPerFrameIdx = 0;
981  FramerateSecPerFrameAccum = 0.0f;
982  WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
983  memset(TempBuffer, 0, sizeof(TempBuffer));
984  }
985 };
986 
987 // Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
988 // This is going to be exposed in imgui.h when stabilized enough.
990 {
991  ImGuiItemFlags_NoTabStop = 1 << 0, // false
992  ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
993  ImGuiItemFlags_Disabled = 1 << 2, // false // [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
994  ImGuiItemFlags_NoNav = 1 << 3, // false
996  ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // MenuItem/Selectable() automatically closes current Popup window
998 };
999 
1000 // Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow.
1001 // FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
1003 {
1006  ImVec2 CursorStartPos; // Initial position in client area with padding
1007  ImVec2 CursorMaxPos; // Used to implicitly calculate the size of our contents, always growing during the frame. Turned into window->SizeContents at the beginning of next frame
1014  ImU32 TreeDepthMayJumpToParentOnPop; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31
1017  ImRect LastItemRect; // Interaction rect
1018  ImRect LastItemDisplayRect; // End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
1019  ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
1020  int NavLayerCurrentMask; // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
1021  int NavLayerActiveMask; // Which layer have been written to (result from previous frame)
1022  int NavLayerActiveMaskNext; // Which layer have been written to (buffer for current frame)
1024  bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f)
1025  bool MenuBarAppending; // FIXME: Remove this
1026  ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
1030  ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
1031 
1032  // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
1033  ImGuiItemFlags ItemFlags; // == ItemFlagsStack.back() [empty == ImGuiItemFlags_Default]
1034  float ItemWidth; // == ItemWidthStack.back(). 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
1035  float TextWrapPos; // == TextWrapPosStack.back() [empty == -1.0f]
1040  short StackSizesBackup[6]; // Store size of various stacks for asserting
1041 
1042  ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
1044  ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
1045  ImGuiColumnsSet* ColumnsSet; // Current columns set
1046 
1048  {
1049  CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos = ImVec2(0.0f, 0.0f);
1050  CurrentLineSize = PrevLineSize = ImVec2(0.0f, 0.0f);
1051  CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
1052  LogLinePosY = -1.0f;
1053  TreeDepth = 0;
1054  TreeDepthMayJumpToParentOnPop = 0x00;
1055  LastItemId = 0;
1056  LastItemStatusFlags = 0;
1057  LastItemRect = LastItemDisplayRect = ImRect();
1058  NavLayerActiveMask = NavLayerActiveMaskNext = 0x00;
1059  NavLayerCurrent = ImGuiNavLayer_Main;
1060  NavLayerCurrentMask = (1 << ImGuiNavLayer_Main);
1061  NavHideHighlightOneFrame = false;
1062  NavHasScroll = false;
1063  MenuBarAppending = false;
1064  MenuBarOffset = ImVec2(0.0f, 0.0f);
1065  StateStorage = NULL;
1066  LayoutType = ParentLayoutType = ImGuiLayoutType_Vertical;
1067  ItemWidth = 0.0f;
1068  ItemFlags = ImGuiItemFlags_Default_;
1069  TextWrapPos = -1.0f;
1070  memset(StackSizesBackup, 0, sizeof(StackSizesBackup));
1071 
1072  Indent = ImVec1(0.0f);
1073  GroupOffset = ImVec1(0.0f);
1074  ColumnsOffset = ImVec1(0.0f);
1075  ColumnsSet = NULL;
1076  }
1077 };
1078 
1079 // Storage for one window
1081 {
1082  char* Name;
1083  ImGuiID ID; // == ImHash(Name)
1084  ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
1085  ImVec2 Pos; // Position (always rounded-up to nearest pixel)
1086  ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
1087  ImVec2 SizeFull; // Size when non collapsed
1088  ImVec2 SizeFullAtLastBegin; // Copy of SizeFull at the end of Begin. This is the reference value we'll use on the next frame to decide if we need scrollbars.
1089  ImVec2 SizeContents; // Size of contents (== extents reach of the drawing cursor) from previous frame. Include decoration, window title, border, menu, etc.
1090  ImVec2 SizeContentsExplicit; // Size of contents explicitly set by the user via SetNextWindowContentSize()
1091  ImVec2 WindowPadding; // Window padding at the time of begin.
1092  float WindowRounding; // Window rounding at the time of begin.
1093  float WindowBorderSize; // Window border size at the time of begin.
1094  int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
1095  ImGuiID MoveId; // == window->GetID("#MOVE")
1096  ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
1098  ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
1099  ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
1100  ImVec2 ScrollbarSizes; // Size taken by scrollbars on each axis
1101  bool ScrollbarX, ScrollbarY;
1102  bool Active; // Set to true on Begin(), unless Collapsed
1104  bool WriteAccessed; // Set to true when any widget access the current window
1105  bool Collapsed; // Set when collapsing window to become only title-bar
1107  bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed)
1108  bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
1109  bool Hidden; // Do not display (== (HiddenFramesForResize > 0) ||
1110  bool HasCloseButton; // Set when the window has a close button (p_open != NULL)
1111  short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
1112  short BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0.
1113  short BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues.
1114  ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
1115  int AutoFitFramesX, AutoFitFramesY;
1119  int HiddenFramesRegular; // Hide the window for N frames
1120  int HiddenFramesForResize; // Hide the window for N frames while allowing items to be submitted so we can measure their size
1121  ImGuiCond SetWindowPosAllowFlags; // store acceptable condition flags for SetNextWindowPos() use.
1122  ImGuiCond SetWindowSizeAllowFlags; // store acceptable condition flags for SetNextWindowSize() use.
1123  ImGuiCond SetWindowCollapsedAllowFlags; // store acceptable condition flags for SetNextWindowCollapsed() use.
1124  ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
1125  ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
1126 
1127  ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
1128  ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
1129  ImRect ClipRect; // Current clipping rectangle. = DrawList->clip_rect_stack.back(). Scissoring / clipping rectangle. x1, y1, x2, y2.
1130  ImRect OuterRectClipped; // = WindowRect just after setup in Begin(). == window->Rect() for root window.
1131  ImRect InnerMainRect, InnerClipRect;
1132  ImRect ContentsRegionRect; // FIXME: This is currently confusing/misleading. Maximum visible content position ~~ Pos + (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis
1133  int LastFrameActive; // Last frame number the window was Active.
1135  ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items
1138  float FontWindowScale; // User scale multiplier per-window
1139  int SettingsIdx; // Index into SettingsWindow[] (indices are always valid as we only grow the array from the back)
1140 
1141  ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
1143  ImGuiWindow* ParentWindow; // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
1144  ImGuiWindow* RootWindow; // Point to ourself or first ancestor that is not a child window.
1145  ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
1146  ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag.
1147 
1148  ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
1149  ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1)
1150  ImRect NavRectRel[ImGuiNavLayer_COUNT]; // Reference rectangle, in window relative space
1151 
1152  // Navigation / Focus
1153  // FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext
1154  int FocusIdxAllCounter; // Start at -1 and increase as assigned via FocusItemRegister()
1155  int FocusIdxTabCounter; // (same, but only count widgets which you can Tab through)
1156  int FocusIdxAllRequestCurrent; // Item being requested for focus
1157  int FocusIdxTabRequestCurrent; // Tab-able item being requested for focus
1158  int FocusIdxAllRequestNext; // Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
1160 
1161 public:
1162  ImGuiWindow(ImGuiContext* context, const char* name);
1163  ~ImGuiWindow();
1164 
1165  ImGuiID GetID(const char* str, const char* str_end = NULL);
1166  ImGuiID GetID(const void* ptr);
1167  ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL);
1168  ImGuiID GetIDNoKeepAlive(const void* ptr);
1169  ImGuiID GetIDFromRectangle(const ImRect& r_abs);
1170 
1171  // We don't use g.FontSize because the window may be != g.CurrentWidow.
1172  ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x+Size.x, Pos.y+Size.y); }
1173  float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale; }
1174  float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; }
1175  ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
1176  float MenuBarHeight() const { return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f : 0.0f; }
1177  ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
1178 };
1179 
1180 // Backup and restore just enough data to be able to use IsItemHovered() on item A after another B in the same window has overwritten the data.
1182 {
1187 
1189  void Backup() { ImGuiWindow* window = GImGui->CurrentWindow; LastItemId = window->DC.LastItemId; LastItemStatusFlags = window->DC.LastItemStatusFlags; LastItemRect = window->DC.LastItemRect; LastItemDisplayRect = window->DC.LastItemDisplayRect; }
1190  void Restore() const { ImGuiWindow* window = GImGui->CurrentWindow; window->DC.LastItemId = LastItemId; window->DC.LastItemStatusFlags = LastItemStatusFlags; window->DC.LastItemRect = LastItemRect; window->DC.LastItemDisplayRect = LastItemDisplayRect; }
1191 };
1192 
1193 //-----------------------------------------------------------------------------
1194 // Tab bar, tab item
1195 //-----------------------------------------------------------------------------
1196 
1198 {
1199  ImGuiTabBarFlags_DockNode = 1 << 20, // [Docking: Unused in Master Branch] Part of a dock node
1200  ImGuiTabBarFlags_DockNodeIsDockSpace = 1 << 21, // [Docking: Unused in Master Branch] Part of an explicit dockspace node node
1202  ImGuiTabBarFlags_SaveSettings = 1 << 23 // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
1203 };
1204 
1205 // Storage for one active tab item (sizeof() 26~32 bytes)
1207 {
1211  int LastFrameSelected; // This allows us to infer an ordered list of the last activated tabs with little maintenance
1212  float Offset; // Position relative to beginning of tab
1213  float Width; // Width currently displayed
1214  float WidthContents; // Width of actual contents, stored during BeginTabItem() call
1215 
1216  ImGuiTabItem() { ID = Flags = 0; LastFrameVisible = LastFrameSelected = -1; Offset = Width = WidthContents = 0.0f; }
1217 };
1218 
1219 // Storage for a tab bar (sizeof() 92~96 bytes)
1221 {
1223  ImGuiID ID; // Zero for tab-bars used by docking
1224  ImGuiID SelectedTabId; // Selected tab
1226  ImGuiID VisibleTabId; // Can occasionally be != SelectedTabId (e.g. when previewing contents for CTRL+TAB preview)
1231  float OffsetMax; // Distance from BarRect.Min.x, locked during layout
1232  float OffsetNextTab; // Distance from BarRect.Min.x, incremented with each BeginTabItem() call, not used if ImGuiTabBarFlags_Reorderable if set.
1240  short LastTabItemIdx; // For BeginTabItem()/EndTabItem()
1241 
1242  ImGuiTabBar();
1243  int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); }
1244 };
1245 
1246 //-----------------------------------------------------------------------------
1247 // Internal API
1248 // No guarantee of forward compatibility here.
1249 //-----------------------------------------------------------------------------
1250 
1251 namespace ImGui
1252 {
1253  // We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
1254  // If this ever crash because g.CurrentWindow is NULL it means that either
1255  // - ImGui::NewFrame() has never been called, which is illegal.
1256  // - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
1260  IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
1261  IMGUI_API void FocusWindow(ImGuiWindow* window);
1268  IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
1270  IMGUI_API void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x);
1271  IMGUI_API void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y);
1272  IMGUI_API float GetWindowScrollMaxX(ImGuiWindow* window);
1273  IMGUI_API float GetWindowScrollMaxY(ImGuiWindow* window);
1275 
1276  IMGUI_API void SetCurrentFont(ImFont* font);
1277  inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
1278 
1279  // Init
1280  IMGUI_API void Initialize(ImGuiContext* context);
1281  IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
1282 
1283  // NewFrame
1288 
1289  // Settings
1294  IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
1295 
1296  // Basic Accessors
1298  inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
1299  inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; }
1300  IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
1301  IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);
1302  IMGUI_API void ClearActiveID();
1304  IMGUI_API void SetHoveredID(ImGuiID id);
1305  IMGUI_API void KeepAliveID(ImGuiID id);
1306  IMGUI_API void MarkItemEdited(ImGuiID id);
1307 
1308  // Basic Helpers for widget code
1309  IMGUI_API void ItemSize(const ImVec2& size, float text_offset_y = 0.0f);
1310  IMGUI_API void ItemSize(const ImRect& bb, float text_offset_y = 0.0f);
1311  IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL);
1312  IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id);
1313  IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged);
1314  IMGUI_API bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id, bool tab_stop = true); // Return true if focus is requested
1316  IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y);
1317  IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
1318  IMGUI_API void PushMultiItemsWidths(int components, float width_full = 0.0f);
1319  IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
1320  IMGUI_API void PopItemFlag();
1321 
1322  // Popups, Modals, Tooltips
1323  IMGUI_API void OpenPopupEx(ImGuiID id);
1324  IMGUI_API void ClosePopupToLevel(int remaining, bool apply_focus_to_window_under);
1325  IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window);
1326  IMGUI_API bool IsPopupOpen(ImGuiID id); // Test for id within current popup stack level (currently begin-ed into); this doesn't scan the whole popup stack!
1327  IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
1328  IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true);
1331  IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy = ImGuiPopupPositionPolicy_Default);
1332 
1333  // Navigation
1334  IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
1337  IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect& bb_rel, ImGuiNavMoveFlags move_flags);
1340  IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f);
1341  IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate);
1342  IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
1343  IMGUI_API void SetNavID(ImGuiID id, int nav_layer);
1344  IMGUI_API void SetNavIDWithRectRel(ImGuiID id, int nav_layer, const ImRect& rect_rel);
1345 
1346  // Inputs
1347  inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { const int key_index = GImGui->IO.KeyMap[key]; return (key_index >= 0) ? IsKeyPressed(key_index, repeat) : false; }
1348  inline bool IsNavInputDown(ImGuiNavInput n) { return GImGui->IO.NavInputs[n] > 0.0f; }
1349  inline bool IsNavInputPressed(ImGuiNavInput n, ImGuiInputReadMode mode) { return GetNavInputAmount(n, mode) > 0.0f; }
1350  inline bool IsNavInputPressedAnyOfTwo(ImGuiNavInput n1, ImGuiNavInput n2, ImGuiInputReadMode mode) { return (GetNavInputAmount(n1, mode) + GetNavInputAmount(n2, mode)) > 0.0f; }
1351 
1352  // Drag and Drop
1353  IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);
1354  IMGUI_API void ClearDragDrop();
1356 
1357  // New Columns API (FIXME-WIP)
1358  IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiColumnsFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
1359  IMGUI_API void EndColumns(); // close columns
1360  IMGUI_API void PushColumnClipRect(int column_index = -1);
1361 
1362  // Tab Bars
1363  IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);
1365  IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
1366  IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
1367  IMGUI_API void TabBarQueueChangeTabOrder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int dir);
1368  IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags);
1369  IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button);
1370  IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
1371  IMGUI_API bool TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, const char* label, ImGuiID tab_id, ImGuiID close_button_id);
1372 
1373  // Render helpers
1374  // AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
1375  // NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
1376  IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
1377  IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
1378  IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0,0), const ImRect* clip_rect = NULL);
1379  IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
1380  IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
1381  IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
1382  IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, int rounding_corners_flags = ~0);
1383  IMGUI_API void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale = 1.0f);
1384  IMGUI_API void RenderBullet(ImVec2 pos);
1385  IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col, float sz);
1386  IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight
1387  IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
1388  IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL);
1389 
1390  // Render helpers (those functions don't access any ImGui state!)
1391  IMGUI_API void RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor = ImGuiMouseCursor_Arrow);
1392  IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
1393  IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
1394  IMGUI_API void RenderPixelEllipsis(ImDrawList* draw_list, ImVec2 pos, int count, ImU32 col);
1395 
1396  // Widgets
1397  IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0,0), ImGuiButtonFlags flags = 0);
1398  IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos, float radius);
1399  IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos);
1400  IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags);
1401  IMGUI_API void Scrollbar(ImGuiLayoutType direction);
1402  IMGUI_API void VerticalSeparator(); // Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout.
1403 
1404  // Widgets low-level behaviors
1405  IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
1406  IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power, ImGuiDragFlags flags);
1407  IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb);
1408  IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f);
1409  IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
1410  IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
1411  IMGUI_API void TreePushRawID(ImGuiID id);
1412 
1413  // Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
1414  // To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
1415  // e.g. " extern template IMGUI_API float RoundScalarWithFormatT<float, float>(const char* format, ImGuiDataType data_type, float v); "
1416  template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool DragBehaviorT(ImGuiDataType data_type, T* v, float v_speed, const T v_min, const T v_max, const char* format, float power, ImGuiDragFlags flags);
1417  template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, T* v, const T v_min, const T v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb);
1418  template<typename T, typename FLOAT_T> IMGUI_API float SliderCalcRatioFromValueT(ImGuiDataType data_type, T v, T v_min, T v_max, float power, float linear_zero_pos);
1419  template<typename T, typename SIGNED_T> IMGUI_API T RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, T v);
1420 
1421  // InputText
1422  IMGUI_API bool InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
1423  IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* data_ptr, const char* format);
1424 
1425  // Color
1426  IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
1427  IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags);
1428  IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);
1429 
1430  // Plot
1431  IMGUI_API void PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size);
1432 
1433  // Shade functions (write over already created vertices)
1434  IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
1435  IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
1436 
1437 } // namespace ImGui
1438 
1439 // ImFontAtlas internals
1442 IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent);
1443 IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* spc);
1445 IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor);
1446 IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride);
1447 
1448 // Test engine hooks (imgui-test)
1449 //#define IMGUI_ENABLE_TEST_ENGINE
1450 #ifdef IMGUI_ENABLE_TEST_ENGINE
1451 extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx);
1452 extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx);
1453 extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
1454 extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, int flags);
1455 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register status flags
1456 #else
1457 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) do { } while (0)
1458 #endif
1459 
1460 #ifdef __clang__
1461 #pragma clang diagnostic pop
1462 #endif
1463 
1464 #ifdef _MSC_VER
1465 #pragma warning (pop)
1466 #endif
ImGuiStorage Map
float NavInputs[ImGuiNavInput_COUNT]
Definition: imgui.h:1350
d
ImGuiWindowTempData DC
ImGuiDir NavMoveDirLast
ImGuiInputTextFlags UserFlags
VectorAcc operator/(const VectorAcc &r1, double r2)
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow *window, ImGuiNavMoveFlags move_flags)
Definition: imgui.cpp:7235
ImRect MenuBarRect() const
static float ImAcos(float x)
ImVec2 BackupCursorPos
IMGUI_API bool DragBehaviorT(ImGuiDataType data_type, T *v, float v_speed, const T v_min, const T v_max, const char *format, float power, ImGuiDragFlags flags)
ImGuiTabBarFlagsPrivate_
static float ImAtan2(float y, float x)
int GetSize() const
IMGUI_API const char * ImStreolRange(const char *str, const char *str_end)
Definition: imgui.cpp:1321
int FocusIdxTabRequestNext
ImGuiWindow * RootWindowForTitleBarHighlight
static bool ImCharIsBlankW(unsigned int c)
IMGUI_API void ClosePopupToLevel(int remaining, bool apply_focus_to_window_under)
Definition: imgui.cpp:6712
unsigned int ImU32
Definition: imgui.h:150
IMGUI_API void ShadeVertsLinearUV(ImDrawList *draw_list, int vert_start_idx, int vert_end_idx, const ImVec2 &a, const ImVec2 &b, const ImVec2 &uv_a, const ImVec2 &uv_b, bool clamp)
IMGUI_API void RenderText(ImVec2 pos, const char *text, const char *text_end=NULL, bool hide_text_after_hash=true)
Definition: imgui.cpp:2224
ImRect NavInitResultRectRel
float WindowBorderSize
ImGuiInputSource
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void *v, float v_speed, const void *v_min, const void *v_max, const char *format, float power, ImGuiDragFlags flags)
IMGUI_API bool InputTextEx(const char *label, char *buf, int buf_size, const ImVec2 &size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API void UpdateMouseMovingWindowNewFrame()
Definition: imgui.cpp:3036
IMGUI_API ImVec2 TabItemCalcSize(const char *label, bool has_close_button)
bool HasSelection() const
IMGUI_API bool SliderBehavior(const ImRect &bb, ImGuiID id, ImGuiDataType data_type, void *v, const void *v_min, const void *v_max, const char *format, float power, ImGuiSliderFlags flags, ImRect *out_grab_bb)
ImGuiSeparatorFlags_
int ActiveIdAllowNavDirFlags
ImGuiCond SetWindowPosAllowFlags
IMGUI_API bool SliderBehaviorT(const ImRect &bb, ImGuiID id, ImGuiDataType data_type, T *v, const T v_min, const T v_max, const char *format, float power, ImGuiSliderFlags flags, ImRect *out_grab_bb)
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow *window)
Definition: imgui.cpp:5414
ImGuiNavMoveResult NavMoveResultLocalVisibleSet
ImGuiColumnsFlags Flags
ImVector< T > Data
int DragDropSourceFrameCount
bool ActiveIdIsJustActivated
short LastTabItemIdx
IMGUI_API void RenderMouseCursor(ImDrawList *draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor=ImGuiMouseCursor_Arrow)
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col, float sz)
Definition: imgui.cpp:2379
ImGuiWindow * ParentWindow
IMGUI_API void PushColumnClipRect(int column_index=-1)
Definition: imgui.cpp:8142
ImVec2 ActiveIdClickOffset
IMGUI_API void ColorEditOptionsPopup(const float *col, ImGuiColorEditFlags flags)
IMGUI_API bool IsPopupOpen(ImGuiID id)
Definition: imgui.cpp:6588
ImVec2 GetTL() const
ImGuiID ActiveIdIsAlive
float GetWidth() const
IMGUI_API float SliderCalcRatioFromValueT(ImGuiDataType data_type, T v, T v_min, T v_max, float power, float linear_zero_pos)
ImGuiStyleMod(ImGuiStyleVar idx, int v)
ImDrawData DrawData
IMGUI_API bool SplitterBehavior(const ImRect &bb, ImGuiID id, ImGuiAxis axis, float *size1, float *size2, float min_size1, float min_size2, float hover_extend=0.0f, float hover_visibility_delay=0.0f)
void Clear()
Definition: imgui.h:1612
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow *ref_window)
Definition: imgui.cpp:6675
IMGUI_API const char * FindRenderedTextEnd(const char *text, const char *text_end=NULL)
Definition: imgui.cpp:2211
int WantCaptureMouseNextFrame
float GetHeight() const
IMGUI_API ImGuiWindowSettings * FindWindowSettings(ImGuiID id)
Definition: imgui.cpp:8809
#define IM_FMTLIST(FMT)
Definition: imgui.h:71
IMGUI_API bool IsWindowChildOf(ImGuiWindow *window, ImGuiWindow *potential_parent)
Definition: imgui.cpp:5799
IMGUI_API bool ArrowButtonEx(const char *str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags)
IMGUI_API void PopItemFlag()
Definition: imgui.cpp:5581
void TranslateX(float dx)
f
int(* ImGuiInputTextCallback)(ImGuiInputTextCallbackData *data)
Definition: imgui.h:145
IMGUI_API void RenderTextClippedEx(ImDrawList *draw_list, const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &align=ImVec2(0, 0), const ImRect *clip_rect=NULL)
Definition: imgui.cpp:2268
ImGuiID GetItemID()
ImGuiID NavActivateId
IMGUI_API void LogRenderedText(const ImVec2 *ref_pos, const char *text, const char *text_end=NULL)
Definition: imgui.cpp:8634
bool VisibleTabWasSubmitted
ImVector< ImGuiTabBarSortItem > TabSortByWidthBuffer
float FontWindowScale
T * GetByIndex(ImPoolIdx n)
ImGuiID NextSelectedTabId
ImGuiNavHighlightFlags_
Definition: imgui.h:164
IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat=true)
Definition: imgui.cpp:3989
float ScrollingTarget
ImGuiContext(ImFontAtlas *shared_font_atlas)
ImVec2 GetBL() const
ImVector< float > ItemWidthStack
int TooltipOverrideCount
IMGUI_API void PushMultiItemsWidths(int components, float width_full=0.0f)
Definition: imgui.cpp:5503
IMGUI_API char * ImStrdupcpy(char *dst, size_t *p_dst_size, const char *str)
Definition: imgui.cpp:1292
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding=0.0f)
Definition: imgui.cpp:2325
bool ActiveIdAllowOverlap
ImVec2 ScrollbarClickDeltaToGrabCenter
ImGuiWindow * Window
int FramerateSecPerFrameIdx
IMGUI_API void * ImFileLoadToMemory(const char *filename, const char *file_open_mode, size_t *out_file_size=NULL, int padding_bytes=0)
Definition: imgui.cpp:1485
IMGUI_API ImGuiWindow * FindWindowByID(ImGuiID id)
Definition: imgui.cpp:4381
void(* ImGuiSizeCallback)(ImGuiSizeCallbackData *data)
Definition: imgui.h:146
IMGUI_API void SetHoveredID(ImGuiID id)
Definition: imgui.cpp:2622
ImGuiID HoveredId
#define IM_FMTARGS(FMT)
Definition: imgui.h:70
ImDrawList OverlayDrawList
int FocusIdxAllRequestCurrent
ImGuiNavMoveResult NavMoveResultLocal
bool IsInverted() const
float HoveredIdTimer
ImVec2 LastValidMousePos
ImGuiTabItemFlags Flags
int ImGuiTreeNodeFlags
Definition: imgui.h:143
static T ImClamp(T v, T mn, T mx)
ImVec1 BackupGroupOffset
IMGUI_API bool FocusableItemRegister(ImGuiWindow *window, ImGuiID id, bool tab_stop=true)
Definition: imgui.cpp:2830
static ImVec2 ImMul(const ImVec2 &lhs, const ImVec2 &rhs)
static float ImCos(float x)
int ImGuiColorEditFlags
Definition: imgui.h:132
ImRect DragDropTargetRect
ImGuiWindow * RootWindowForNav
bool WantCollapseToggle
b2Vec2 operator*(float s, const b2Vec2 &a)
Definition: b2_math.h:446
IMGUI_API bool BeginTabBarEx(ImGuiTabBar *tab_bar, const ImRect &bb, ImGuiTabBarFlags flags)
int ImGuiLayoutType
int ImGuiNavMoveFlags
float FramerateSecPerFrameAccum
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow *window)
Definition: imgui.cpp:2595
ImGuiAxis
IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char *pixels, int x, int y, int w, int h, int stride)
ImPool< ImGuiTabBar > TabBars
IMGUI_API ImGuiTabItem * TabBarFindTabByID(ImGuiTabBar *tab_bar, ImGuiID tab_id)
ImGuiSizeCallback SizeCallback
IMGUI_API int ImParseFormatPrecision(const char *format, int default_value)
IMGUI_API int ImTextStrToUtf8(char *buf, int buf_size, const ImWchar *in_text, const ImWchar *in_text_end)
Definition: imgui.cpp:1678
IMGUI_API ImVec2 CalcWindowExpectedSize(ImGuiWindow *window)
Definition: imgui.cpp:4512
IMGUI_API bool IsDragDropPayloadBeingAccepted()
Definition: imgui.cpp:8542
IMGUI_API ImRect GetWindowAllowedExtentRect(ImGuiWindow *window)
Definition: imgui.cpp:6863
ImVec2 PlatformImePos
ImGuiLayoutType LayoutType
ImVector< ImGuiItemFlags > ItemFlagsStack
ImGuiDragDropFlags DragDropSourceFlags
ImGuiButtonFlags_
bool FontAtlasOwnedByContext
ImGuiID SelectedTabId
ImVector< ImGuiTabItem > Tabs
static bool ImIsPowerOfTwo(int v)
void resize(int new_size)
Definition: imgui.h:1201
#define IM_ARRAYSIZE(_ARR)
Definition: imgui.h:73
float BackupCurrentLineTextBaseOffset
static float ImSin(float x)
ImVec2 SetWindowPosVal
ImRect TitleBarRect() const
static float ImFloor(float f)
ImGuiStorage StateStorage
ImRect NavScoringRectScreen
IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor=0.0f, float fast_factor=0.0f)
Definition: imgui.cpp:7371
IMGUI_API void SetCurrentFont(ImFont *font)
Definition: imgui.cpp:5538
bool ActiveIdPreviousFrameIsAlive
ImFont * GetDefaultFont()
ImGuiPlotType
ImGuiInputReadMode
ImGuiNavMoveFlags_
float CalcFontSize() const
const ImDrawListSharedData * _Data
Definition: imgui.h:1796
ImGuiMenuColumns MenuColumns
float WindowRounding
IMGUI_API void UpdateHoveredWindowAndCaptureFlags()
Definition: imgui.cpp:3229
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char *label, const char *label_end=NULL)
ImGuiInputSource NavInputSource
IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas *atlas, ImFont *font, ImFontConfig *font_config, float ascent, float descent)
IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor)
int ImGuiItemFlags
IMGUI_API int ImStrlenW(const ImWchar *str)
Definition: imgui.cpp:1312
IMGUI_API void SetNavID(ImGuiID id, int nav_layer)
Definition: imgui.cpp:2550
IMGUI_API int ImTextCountUtf8BytesFromChar(const char *in_text, const char *in_text_end)
Definition: imgui.cpp:1663
ImVec2 GetCenter() const
ImVector< ImFont * > Fonts
Definition: imgui.h:2059
IMGUI_API float GetWindowScrollMaxY(ImGuiWindow *window)
Definition: imgui.cpp:4523
static ImVec2 ImRotate(const ImVec2 &v, float cos_a, float sin_a)
ImVector< ImGuiColorMod > ColorModifiers
IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
Definition: imgui.cpp:1248
float HoveredIdNotActiveTimer
ImGuiColorEditFlags ColorEditOptions
IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode)
Definition: imgui.cpp:7349
ImVector< ImGuiWindow * > CurrentWindowStack
static T ImLerp(T a, T b, float t)
IMGUI_API void RenderArrowPointingAt(ImDrawList *draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col)
ImVector< Pair > Data
Definition: imgui.h:1607
int ImGuiDragDropFlags
Definition: imgui.h:136
int KeyMap[ImGuiKey_COUNT]
Definition: imgui.h:1285
geometry_msgs::TransformStamped t
ImVector< ImFont * > FontStack
ImGuiID NavActivatePressedId
IMGUI_API void ActivateItem(ImGuiID id)
Definition: imgui.cpp:6304
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2 &ref_pos, const ImVec2 &size, ImGuiDir *last_dir, const ImRect &r_outer, const ImRect &r_avoid, ImGuiPopupPositionPolicy policy=ImGuiPopupPositionPolicy_Default)
Definition: imgui.cpp:6873
void Add(const ImRect &r)
ImGuiNavMoveFlags NavMoveRequestFlags
ImGuiItemFlags ItemFlags
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
IMGUI_API bool BeginDragDropTargetCustom(const ImRect &bb, ImGuiID id)
Definition: imgui.cpp:8490
ImDrawList * DrawList
ImVec2 SetWindowPosPivot
ImDrawDataBuilder DrawDataBuilder
IMGUI_API ImGuiWindowSettings * CreateNewWindowSettings(const char *name)
Definition: imgui.cpp:8799
IMGUI_API ImGuiID GetHoveredID()
Definition: imgui.cpp:2631
unsigned short ImWchar
Definition: imgui.h:119
bool IsNavInputPressed(ImGuiNavInput n, ImGuiInputReadMode mode)
IMGUI_API void ItemSize(const ImRect &bb, float text_offset_y=0.0f)
Definition: imgui.cpp:2706
int ImGuiCond
Definition: imgui.h:121
IMGUI_API float GetWindowScrollMaxX(ImGuiWindow *window)
Definition: imgui.cpp:4518
int ImGuiInputTextFlags
Definition: imgui.h:139
ImGuiID ActiveId
int ImGuiDir
Definition: imgui.h:123
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow *window)
Definition: imgui.cpp:6926
ImVec2 BackupCurrentLineSize
ImGuiDir NavMoveClipDir
ImGuiLayoutType ParentLayoutType
IMGUI_API void RenderRectFilledRangeH(ImDrawList *draw_list, const ImRect &rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding)
IMGUI_API FILE * ImFileOpen(const char *filename, const char *file_open_mode)
Definition: imgui.cpp:1467
IMGUI_API const char * ImParseFormatFindEnd(const char *format)
float DragSpeedDefaultRatio
IMGUI_API ImU32 ImHash(const void *data, int data_size, ImU32 seed=0)
Definition: imgui.cpp:1425
IMGUI_API void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale=1.0f)
Definition: imgui.cpp:2338
ImGuiWindow * NavLastChildNavWindow
ImVector< ImGuiWindow * > Windows
#define IM_ASSERT(_EXPR)
Definition: imgui.h:64
int WantTextInputNextFrame
int ImGuiWindowFlags
Definition: imgui.h:144
bool NavWindowingToggleLayer
#define IMGUI_API
Definition: imgui.h:55
ImVec2 GetSize() const
ImRect(const ImVec4 &v)
ImVec2 SizeContentsExplicit
ImGuiNavForward NavMoveRequestForward
T * Add()
IMGUI_API void KeepAliveID(ImGuiID id)
Definition: imgui.cpp:2637
void Expand(const float amount)
ImGuiInputTextState InputTextState
float ContentsHeight
IMGUI_API int ImStrnicmp(const char *str1, const char *str2, size_t count)
Definition: imgui.cpp:1271
ImGuiID OpenParentId
float w
Definition: imgui.h:178
ImGuiInputTextCallback UserCallback
ImFont InputTextPasswordFont
static void ImSwap(T &a, T &b)
static float ImLengthSqr(const ImVec2 &lhs)
IMGUI_API int GetInt(ImGuiID key, int default_val=0) const
Definition: imgui.cpp:1861
bool NavInitRequestFromMove
T * GetByKey(ImGuiID key)
static float ImDot(const ImVec2 &a, const ImVec2 &b)
ImGuiColumnsFlags Flags
ImGuiTabBarFlags Flags
void ClipWith(const ImRect &r)
ImVec2 SizeFullAtLastBegin
b2Vec2 operator+(const b2Vec2 &a, const b2Vec2 &b)
Add two vectors component-wise.
Definition: b2_math.h:435
ImGuiNavLayer
IMGUI_API void ColorTooltip(const char *text, const float *col, ImGuiColorEditFlags flags)
ImGuiID NavJustTabbedId
IMGUI_API void TreePushRawID(ImGuiID id)
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled)
Definition: imgui.cpp:5571
ImGuiWindow * RootWindow
ImGuiWindow * NavWindowingTargetAnim
IMGUI_API void ImStrncpy(char *dst, const char *src, size_t count)
Definition: imgui.cpp:1278
IMGUI_API bool TabItemEx(ImGuiTabBar *tab_bar, const char *label, bool *p_open, ImGuiTabItemFlags flags)
ImGuiNavLayer NavLayer
IMGUI_API void Scrollbar(ImGuiLayoutType direction)
IMGUI_API int ImStricmp(const char *str1, const char *str2)
Definition: imgui.cpp:1264
ImVec2 Max
const char * _OwnerName
Definition: imgui.h:1797
T * Data
Definition: imgui.h:1170
bool BackupActiveIdPreviousFrameIsAlive
ImGuiStb::STB_TexteditState StbState
static float ImFabs(float x)
float ItemWidthDefault
IMGUI_API void FocusWindow(ImGuiWindow *window)
Definition: imgui.cpp:5444
ImGuiWindow * ActiveIdWindow
ImGuiTextBuffer SettingsIniData
IMGUI_API const char * ImStrchrRange(const char *str_begin, const char *str_end, char c)
Definition: imgui.cpp:1306
float NavWindowingTimer
ImPoolIdx FreeIdx
IMGUI_API bool ImTriangleContainsPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
Definition: imgui.cpp:1229
ImGuiWindow * NavWindowingTarget
ImVector< ImGuiStyleMod > StyleModifiers
IMGUI_API void RenderNavHighlight(const ImRect &bb, ImGuiID id, ImGuiNavHighlightFlags flags=ImGuiNavHighlightFlags_TypeDefault)
Definition: imgui.cpp:2397
ImGuiDir AutoPosLastDirection
bool DragCurrentAccumDirty
ImRect ContentsRegionRect
int ImGuiStyleVar
Definition: imgui.h:127
ImDrawListSharedData DrawListSharedData
ImGuiID HoveredIdPreviousFrame
IMGUI_API bool ItemAdd(const ImRect &bb, ImGuiID id, const ImRect *nav_bb=NULL)
Definition: imgui.cpp:2714
ImGuiItemStatusFlags_
ImGuiID DragDropTargetId
ImVector< ImGuiColumnData > Columns
ImVector< ImGuiTabBar * > CurrentTabBar
int ImGuiKey
Definition: imgui.h:124
static T ImMax(T lhs, T rhs)
IMGUI_API void Shutdown(ImGuiContext *context)
Definition: imgui.cpp:3491
IMGUI_API ImGuiWindow * GetFrontMostPopupModal()
Definition: imgui.cpp:6600
float z
Definition: imgui.h:178
int ImGuiNavDirSourceFlags
ImPoolIdx GetIndex(const T *p) const
IMGUI_API void ImFontAtlasBuildFinish(ImFontAtlas *atlas)
ImVec2 WindowPadding
bool FrameScopePushedImplicitWindow
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow *window)
Definition: imgui.cpp:5877
ImGuiID NavInitResultId
ImGuiDragFlags_
ImGuiID ActiveIdPreviousFrame
IMGUI_API void VerticalSeparator()
short BeginOrderWithinParent
ImVector< ImGuiWindow * > WindowsFocusOrder
IMGUI_API void SetNavIDWithRectRel(ImGuiID id, int nav_layer, const ImRect &rect_rel)
Definition: imgui.cpp:2559
IMGUI_API void Initialize(ImGuiContext *context)
Definition: imgui.cpp:3473
unsigned int ImGuiID
Definition: imgui.h:118
static float ImInvLength(const ImVec2 &lhs, float fail_value)
ImVector< ImGuiWindowSettings > SettingsWindows
IMGUI_API void ImTriangleBarycentricCoords(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p, float &out_u, float &out_v, float &out_w)
Definition: imgui.cpp:1237
IMGUI_API void StartMouseMovingWindow(ImGuiWindow *window)
Definition: imgui.cpp:3020
ImVec2 ScrollTargetCenterRatio
IMGUI_API void MarkItemEdited(ImGuiID id)
Definition: imgui.cpp:2646
ImGuiWindow * HoveredRootWindow
int FocusIdxTabRequestCurrent
ImGuiID LastActiveId
IMGUI_API int ImTextStrFromUtf8(ImWchar *buf, int buf_size, const char *in_text, const char *in_text_end, const char **in_remaining=NULL)
Definition: imgui.cpp:1590
IMGUI_API void FocusableItemUnregister(ImGuiWindow *window)
Definition: imgui.cpp:2855
ImRect(float x1, float y1, float x2, float y2)
Definition: imgui.h:176
ImGuiWindow * MovingWindow
int Size
Definition: imgui.h:1168
int ImGuiSliderFlags
ImGuiID ScalarAsInputTextId
IMGUI_API void ColorPickerOptionsPopup(const float *ref_col, ImGuiColorEditFlags flags)
IMGUI_API void BringWindowToFocusFront(ImGuiWindow *window)
Definition: imgui.cpp:5400
ImGuiTextBuffer LogClipboard
float DragDropAcceptIdCurrRectSurface
int ImGuiMouseCursor
Definition: imgui.h:126
static float ImSqrt(float x)
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding=0.0f, int rounding_corners_flags=~0)
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow *window)
Definition: imgui.cpp:5429
int ImGuiTabBarFlags
Definition: imgui.h:141
int ImGuiTabItemFlags
Definition: imgui.h:142
int HiddenFramesForResize
void TranslateY(float dy)
ImGuiWindow * NavWindowingList
ImGuiWindow * ParentWindow
ImGuiSelectableFlagsPrivate_
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char *text, const char *text_end, float wrap_width)
Definition: imgui.cpp:2250
short BeginOrderWithinContext
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2 &pos)
static bool ImCharIsBlankA(char c)
IMGUI_API void ClearDragDrop()
Definition: imgui.cpp:8317
IMGUI_API void RenderBullet(ImVec2 pos)
Definition: imgui.cpp:2372
float x
Definition: imgui.h:178
ImRect(const ImVec2 &min, const ImVec2 &max)
ImGuiItemFlags_
ImVector< ImGuiPopupRef > OpenPopupStack
ImGuiID BackupActiveIdIsAlive
ImGuiID DragDropAcceptIdPrev
IMGUI_API bool ButtonEx(const char *label, const ImVec2 &size_arg=ImVec2(0, 0), ImGuiButtonFlags flags=0)
ImVector< char > PrivateClipboard
float LastActiveIdTimer
ImGuiCond SetWindowCollapsedAllowFlags
IMGUI_API void BeginColumns(const char *str_id, int count, ImGuiColumnsFlags flags=0)
Definition: imgui.cpp:8164
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
void Clear()
float SettingsDirtyTimer
ImGuiWindow * CurrentWindow
ImVec2 GetTR() const
float y
Definition: imgui.h:166
ImGuiStyle Style
IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar *in_text, const ImWchar *in_text_end)
Definition: imgui.cpp:1694
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow *window)
Definition: imgui.cpp:8791
ImRect InnerMainRect
ImVec2 FramePadding
Definition: imgui.h:1236
int ImGuiSeparatorFlags
int DragDropAcceptFrameCount
IMGUI_API void FocusPreviousWindowIgnoringOne(ImGuiWindow *ignore_window)
Definition: imgui.cpp:5479
bool Contains(const ImRect &r) const
IMGUI_API int ImFormatString(char *buf, size_t buf_size, const char *fmt,...) IM_FMTARGS(3)
Definition: imgui.cpp:1387
int LogAutoExpandMaxDepth
IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas *atlas, void *spc)
bool IsNavInputPressedAnyOfTwo(ImGuiNavInput n1, ImGuiNavInput n2, ImGuiInputReadMode mode)
T * GetOrAddByKey(ImGuiID key)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
Definition: imgui.cpp:2312
ImGuiWindowFlags Flags
void clear()
Definition: imgui.h:1189
ImGuiColumnsFlags_
int ImPoolIdx
IMGUI_API void SetInt(ImGuiID key, int val)
Definition: imgui.cpp:1921
IMGUI_API const ImWchar * ImStrbolW(const ImWchar *buf_mid_line, const ImWchar *buf_begin)
Definition: imgui.cpp:1327
ImGuiID ReorderRequestTabId
ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v)
static float ImCeil(float x)
IMGUI_API ImGuiWindow * FindWindowByName(const char *name)
Definition: imgui.cpp:4387
IMGUI_API void NavMoveRequestCancel()
Definition: imgui.cpp:7216
bool NavDisableHighlight
IMGUI_API char * ImStrdup(const char *str)
Definition: imgui.cpp:1285
ImDrawList DrawListInst
IMGUI_API const char * ImStristr(const char *haystack, const char *haystack_end, const char *needle, const char *needle_end)
Definition: imgui.cpp:1334
IMGUI_API void OpenPopupEx(ImGuiID id)
Definition: imgui.cpp:6620
ImVec4 ColorPickerRef
ImGuiDragDropFlags DragDropAcceptFlags
IMGUI_API bool NavMoveRequestButNoResultYet()
Definition: imgui.cpp:7210
IMGUI_API void UpdateMouseMovingWindowEndFrame()
Definition: imgui.cpp:3075
IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &p)
Definition: imgui.cpp:1216
ImVector< ImGuiWindow * > WindowsSortBuffer
ImVector< ImGuiSettingsHandler > SettingsHandlers
ImVector< float > TextWrapPosStack
IMGUI_API void SetWindowScrollY(ImGuiWindow *window, float new_scroll_y)
Definition: imgui.cpp:5908
ImVector< char > InitialText
ImGuiSliderFlags_
ImGuiNavMoveResult NavMoveResultOther
int GetTabOrder(const ImGuiTabItem *tab) const
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip=true)
Definition: imgui.cpp:6541
int ImGuiDataType
Definition: imgui.h:122
IMGUI_API void EndColumns()
Definition: imgui.cpp:8228
ImGuiWindow * ActiveIdPreviousFrameWindow
int FocusIdxAllRequestNext
ImVec2 ScrollbarSizes
IMGUI_API int * GetIntRef(ImGuiID key, int default_val=0)
Definition: imgui.cpp:1891
static float ImSaturate(float f)
IMGUI_API bool ButtonBehavior(const ImRect &bb, ImGuiID id, bool *out_hovered, bool *out_held, ImGuiButtonFlags flags=0)
void ClipWithFull(const ImRect &r)
IMGUI_API void TabBarRemoveTab(ImGuiTabBar *tab_bar, ImGuiID tab_id)
Definition: imgui.h:2071
IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate)
Definition: imgui.cpp:3970
ImGuiID NavActivateDownId
IMGUI_API bool ItemHoverable(const ImRect &bb, ImGuiID id)
Definition: imgui.cpp:2797
IMGUI_API void PlotEx(ImGuiPlotType plot_type, const char *label, float(*values_getter)(void *data, int idx), void *data, int values_count, int values_offset, const char *overlay_text, float scale_min, float scale_max, ImVec2 graph_size)
IMGUI_API void TabBarCloseTab(ImGuiTabBar *tab_bar, ImGuiTabItem *tab)
ImGuiID GetActiveID()
ImGuiStyleMod(ImGuiStyleVar idx, float v)
ImGuiID VisibleTabId
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow *window)
Definition: imgui.cpp:2569
ImGuiWindow * NavWindow
ImVec2 GetBR() const
IMGUI_API const char * ImParseFormatTrimDecorations(const char *format, char *buf, int buf_size)
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2 &pos, float radius)
ImVector< ImGuiPopupRef > BeginPopupStack
IMGUI_API void RenderPixelEllipsis(ImDrawList *draw_list, ImVec2 pos, int count, ImU32 col)
float OffsetNormBeforeResize
bool HoveredIdAllowOverlap
int WantCaptureKeyboardNextFrame
bool NavMoveFromClampedRefRect
void Reserve(int capacity)
int index_from_ptr(const T *it) const
Definition: imgui.h:1214
static float ImPow(float x, float y)
IMGUI_API void NavInitWindow(ImGuiWindow *window, bool force_reinit)
Definition: imgui.cpp:7306
static float ImFloorStd(float x)
IMGUI_API void SetWindowScrollX(ImGuiWindow *window, float new_scroll_x)
Definition: imgui.cpp:5901
static int min(int n1, int n2)
Definition: wl_init.c:42
IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags=0)
IMGUI_API bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas *atlas)
static float ImFmod(float x, float y)
static double ImAtof(const char *s)
IMGUI_API float CalcWrapWidthForPos(const ImVec2 &pos, float wrap_pos_x)
Definition: imgui.cpp:2874
ImVector< ImGuiGroupData > GroupStack
ImGuiNavDirSourceFlags_
IMGUI_API void TabItemBackground(ImDrawList *draw_list, const ImRect &bb, ImGuiTabItemFlags flags, ImU32 col)
IMGUI_API T RoundScalarWithFormatT(const char *format, ImGuiDataType data_type, T v)
ImVector< ImGuiColumnsSet > ColumnsStorage
ImGuiPayload DragDropPayload
IMGUI_API void ImStrTrimBlanks(char *str)
Definition: imgui.cpp:1357
IMGUI_API void ImFontAtlasBuildRegisterDefaultCustomRects(ImFontAtlas *atlas)
IMGUI_API void TabBarQueueChangeTabOrder(ImGuiTabBar *tab_bar, const ImGuiTabItem *tab, int dir)
IMGUI_API int ImTextCharFromUtf8(unsigned int *out_char, const char *in_text, const char *in_text_end)
Definition: imgui.cpp:1532
ImGuiItemStatusFlags LastItemStatusFlags
bool ActiveIdHasBeenEdited
ImGuiLayoutType_
IMGUI_API ImGuiID GetID(const char *str_id)
Definition: imgui.cpp:6378
void Expand(const ImVec2 &amount)
float TitleBarHeight() const
bool Overlaps(const ImRect &r) const
ImVector< ImGuiID > IDStack
ImGuiMouseCursor MouseCursor
IMGUI_API bool TabItemLabelAndCloseButton(ImDrawList *draw_list, const ImRect &bb, ImGuiTabItemFlags flags, const char *label, ImGuiID tab_id, ImGuiID close_button_id)
ImGuiCond NextTreeNodeOpenCond
float DragCurrentAccum
int ImGuiColumnsFlags
Definition: imgui.h:133
ImGuiNextWindowData NextWindowData
IMGUI_API void RenderTextClipped(const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &align=ImVec2(0, 0), const ImRect *clip_rect=NULL)
Definition: imgui.cpp:2296
ImRect Rect() const
IMGUI_API int ImTextCountCharsFromUtf8(const char *in_text, const char *in_text_end)
Definition: imgui.cpp:1609
ImGuiWindow * GetCurrentWindow()
static float ImLinearSweep(float current, float target, float speed)
void Floor()
ImGuiStorage * StateStorage
int ImGuiCol
Definition: imgui.h:120
ImVector< ImGuiWindow * > ChildWindows
ImRect OuterRectClipped
int ImGuiNavInput
Definition: imgui.h:125
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList *draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1)
ImGuiColumnsSet * ColumnsSet
ImGuiItemStatusFlags LastItemStatusFlags
int ImGuiDragFlags
ImGuiCond SizeConstraintCond
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y)
Definition: imgui.cpp:2861
void Translate(const ImVec2 &d)
IMGUI_API ImGuiSettingsHandler * FindSettingsHandler(const char *type_name)
Definition: imgui.cpp:8828
IMGUI_API ImGuiContext * GImGui
Definition: imgui.cpp:1042
ImGuiID GetFocusID()
ImGuiNavLayer NavLayerCurrent
ImGuiWindow * Window
int ImGuiNavHighlightFlags
ImVec2 BackupCursorMaxPos
ImVec2 SizeContents
ImGuiStorage WindowsById
bool IsKeyPressedMap(ImGuiKey key, bool repeat=true)
ImVec1(float _x)
void reserve(int new_capacity)
Definition: imgui.h:1203
bool NextTreeNodeOpenVal
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow *window, ImGuiWindowFlags flags, ImGuiWindow *parent_window)
Definition: imgui.cpp:4717
ImVector< char > TempBuffer
IMGUI_API void ClearActiveID()
Definition: imgui.cpp:2617
ImGuiNavForward
ImVec2 Min
bool DragDropWithinSourceOrTarget
bool Contains(const ImVec2 &p) const
IMGUI_API const char * ImParseFormatFindStart(const char *format)
ImFontAtlas * Fonts
Definition: imgui.h:1290
ImFont * FontDefault
Definition: imgui.h:1293
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect &bb_rel, ImGuiNavMoveFlags move_flags)
Definition: imgui.cpp:7223
ImGuiID NavInputId
ImGuiWindow * HoveredWindow
ImGuiID DragDropAcceptIdCurr
static int ImUpperPowerOfTwo(int v)
bool NavDisableMouseHover
ImVector< unsigned char > DragDropPayloadBufHeap
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
Definition: imgui.cpp:6753
void Add(const ImVec2 &p)
IMGUI_API bool IsClippedEx(const ImRect &bb, ImGuiID id, bool clip_even_when_logged)
Definition: imgui.cpp:2819
int ImGuiButtonFlags
ImGuiStyleVar VarIdx
ImGuiWindow * GetCurrentWindowRead()
bool IsNavInputDown(ImGuiNavInput n)
int ImGuiItemStatusFlags
ImVec2 ScrollTarget
float y
Definition: imgui.h:178
IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
Definition: imgui.cpp:6979
float x
Definition: imgui.h:166
bool ActiveIdPreviousFrameHasBeenEdited
ImGuiCond SetWindowSizeAllowFlags
b2Vec2 operator-(const b2Vec2 &a, const b2Vec2 &b)
Subtract two vectors component-wise.
Definition: b2_math.h:441
float MenuBarHeight() const
ImVector< ImWchar > TextW
static T ImMin(T lhs, T rhs)
void Remove(ImGuiID key, ImPoolIdx idx)
#define IM_PLACEMENT_NEW(_PTR)
Definition: imgui.h:1523
void Remove(ImGuiID key, const T *p)
ImGuiID NavNextActivateId
ImGuiInputSource ActiveIdSource
ImGuiID NavJustMovedToId
IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect &bb, ImGuiID id, const char *label, ImGuiDataType data_type, void *data_ptr, const char *format)
IMGUI_API int ImFormatStringV(char *buf, size_t buf_size, const char *fmt, va_list args) IM_FMTLIST(3)
Definition: imgui.cpp:1405
#define IM_NEW(_TYPE)
Definition: imgui.h:1524
float NavWindowingHighlightAlpha
ImGuiPopupPositionPolicy


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:21