59 #if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE)
60 #define IMGUI_ENABLE_SSE
61 #include <immintrin.h>
66 #pragma warning (push)
67 #pragma warning (disable: 4251)
68 #pragma warning (disable: 26812)
69 #pragma warning (disable: 26495)
70 #if defined(_MSC_VER) && _MSC_VER >= 1922
71 #pragma warning (disable: 5054)
76 #if defined(__clang__)
77 #pragma clang diagnostic push
78 #if __has_warning("-Wunknown-warning-option")
79 #pragma clang diagnostic ignored "-Wunknown-warning-option"
81 #pragma clang diagnostic ignored "-Wunknown-pragmas"
82 #pragma clang diagnostic ignored "-Wfloat-equal"
83 #pragma clang diagnostic ignored "-Wunused-function"
84 #pragma clang diagnostic ignored "-Wmissing-prototypes"
85 #pragma clang diagnostic ignored "-Wold-style-cast"
86 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
87 #pragma clang diagnostic ignored "-Wdouble-promotion"
88 #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
89 #pragma clang diagnostic ignored "-Wmissing-noreturn"
90 #elif defined(__GNUC__)
91 #pragma GCC diagnostic push
92 #pragma GCC diagnostic ignored "-Wpragmas"
93 #pragma GCC diagnostic ignored "-Wclass-memaccess"
97 #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
98 #error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
100 #ifdef IMGUI_DISABLE_MATH_FUNCTIONS
101 #error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
106 #ifndef IMGUI_ENABLE_FREETYPE
107 #define IMGUI_ENABLE_STB_TRUETYPE
144 struct ImGuiTableColumnsSettings;
151 enum ImGuiLocKey : int;
152 typedef int ImGuiLayoutType;
155 typedef int ImGuiActivateFlags;
156 typedef int ImGuiDebugLogFlags;
157 typedef int ImGuiInputFlags;
158 typedef int ImGuiItemFlags;
159 typedef int ImGuiItemStatusFlags;
160 typedef int ImGuiOldColumnFlags;
161 typedef int ImGuiNavHighlightFlags;
162 typedef int ImGuiNavMoveFlags;
163 typedef int ImGuiNextItemDataFlags;
164 typedef int ImGuiNextWindowDataFlags;
165 typedef int ImGuiScrollFlags;
166 typedef int ImGuiSeparatorFlags;
167 typedef int ImGuiTextFlags;
168 typedef int ImGuiTooltipFlags;
170 typedef void (*ImGuiErrorLogCallback)(
void* user_data,
const char* fmt, ...);
188 #undef STB_TEXTEDIT_STRING
189 #undef STB_TEXTEDIT_CHARTYPE
190 #define STB_TEXTEDIT_STRING ImGuiInputTextState
191 #define STB_TEXTEDIT_CHARTYPE ImWchar
192 #define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
193 #define STB_TEXTEDIT_UNDOSTATECOUNT 99
194 #define STB_TEXTEDIT_UNDOCHARCOUNT 999
195 #include "imstb_textedit.h"
205 #ifndef IMGUI_DEBUG_PRINTF
206 #ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
207 #define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
209 #define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
214 #ifndef IMGUI_DISABLE_DEBUG_TOOLS
215 #define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
217 #define IMGUI_DEBUG_LOG(...) ((void)0)
219 #define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
220 #define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
221 #define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
222 #define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
223 #define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
224 #define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
227 #define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
232 #ifdef IMGUI_DEBUG_PARANOID
233 #define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
235 #define IM_ASSERT_PARANOID(_EXPR)
240 #ifndef IM_ASSERT_USER_ERROR
241 #define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG)
245 #define IM_PI 3.14159265358979323846f
247 #define IM_NEWLINE "\r\n"
249 #define IM_NEWLINE "\n"
252 #define IM_TABSIZE (4)
254 #define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1))
255 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f)))
256 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f))
257 #define IM_FLOOR(_VAL) ((float)(int)(_VAL))
258 #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f))
262 #define IMGUI_CDECL __cdecl
268 #if defined(_MSC_VER) && !defined(__clang__)
269 #define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX))
271 #define IM_MSVC_WARNING_SUPPRESS(XXXX)
277 #ifndef IM_DEBUG_BREAK
278 #if defined (_MSC_VER)
279 #define IM_DEBUG_BREAK() __debugbreak()
280 #elif defined(__clang__)
281 #define IM_DEBUG_BREAK() __builtin_debugtrap()
282 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
283 #define IM_DEBUG_BREAK() __asm__ volatile("int $0x03")
284 #elif defined(__GNUC__) && defined(__thumb__)
285 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
286 #elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
287 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0");
289 #define IM_DEBUG_BREAK() IM_ASSERT(0)
319 IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImU32 seed = 0);
320 IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImU32 seed = 0);
324 static inline void ImQsort(
void* base,
size_t count,
size_t size_of_element,
int(IMGUI_CDECL *compare_func)(
void const*,
void const*)) {
if (count > 1) qsort(base, count, size_of_element, compare_func); }
328 IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
331 static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
332 static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
333 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; }
336 IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
337 IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
338 IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
339 IMGUI_API
char* ImStrdup(
const char* str);
340 IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
341 IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
342 IMGUI_API
int ImStrlenW(
const ImWchar* str);
343 IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
344 IMGUI_API
const ImWchar*ImStrbolW(
const ImWchar* buf_mid_line,
const ImWchar* buf_begin);
345 IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
346 IMGUI_API
void ImStrTrimBlanks(
char* str);
347 IMGUI_API
const char* ImStrSkipBlank(
const char* str);
348 IM_MSVC_RUNTIME_CHECKS_OFF
349 static inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
350 static inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
351 static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
352 IM_MSVC_RUNTIME_CHECKS_RESTORE
355 IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
356 IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
357 IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
358 IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
359 IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
360 IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
361 IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
362 IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
363 IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
364 IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
367 IMGUI_API const
char* ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
368 IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
369 IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
370 IMGUI_API
int ImTextStrFromUtf8(ImWchar* out_buf,
int out_buf_size, const
char* in_text, const
char* in_text_end, const
char** in_remaining = NULL);
371 IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
372 IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
373 IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
378 #ifdef IMGUI_DEFINE_MATH_OPERATORS
379 IM_MSVC_RUNTIME_CHECKS_OFF
380 static inline ImVec2 operator*(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x * rhs, lhs.y * rhs); }
381 static inline ImVec2 operator/(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x / rhs, lhs.y / rhs); }
382 static inline ImVec2 operator+(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
383 static inline ImVec2 operator-(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
384 static inline ImVec2 operator*(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
385 static inline ImVec2 operator/(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
386 static inline ImVec2& operator*=(
ImVec2& lhs,
const float rhs) { lhs.x *= rhs; lhs.y *= rhs;
return lhs; }
387 static inline ImVec2& operator/=(
ImVec2& lhs,
const float rhs) { lhs.x /= rhs; lhs.y /= rhs;
return lhs; }
388 static inline ImVec2& operator+=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y;
return lhs; }
389 static inline ImVec2& operator-=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y;
return lhs; }
390 static inline ImVec2& operator*=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y;
return lhs; }
391 static inline ImVec2& operator/=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y;
return lhs; }
392 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); }
393 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); }
394 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); }
395 IM_MSVC_RUNTIME_CHECKS_RESTORE
399 #ifdef IMGUI_DISABLE_FILE_FUNCTIONS
400 #define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
401 typedef void* ImFileHandle;
402 static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
403 static inline bool ImFileClose(ImFileHandle) {
return false; }
404 static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
405 static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
406 static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
408 #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
409 typedef FILE* ImFileHandle;
410 IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
411 IMGUI_API
bool ImFileClose(ImFileHandle file);
412 IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
413 IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
414 IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
416 #define IMGUI_DISABLE_TTY_FUNCTIONS
418 IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
421 IM_MSVC_RUNTIME_CHECKS_OFF
423 #ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
424 #define ImFabs(X) fabsf(X)
425 #define ImSqrt(X) sqrtf(X)
426 #define ImFmod(X, Y) fmodf((X), (Y))
427 #define ImCos(X) cosf(X)
428 #define ImSin(X) sinf(X)
429 #define ImAcos(X) acosf(X)
430 #define ImAtan2(Y, X) atan2f((Y), (X))
431 #define ImAtof(STR) atof(STR)
433 #define ImCeil(X) ceilf(X)
434 static inline float ImPow(
float x,
float y) {
return powf(x, y); }
435 static inline double ImPow(
double x,
double y) {
return pow(x, y); }
436 static inline float ImLog(
float x) {
return logf(x); }
437 static inline double ImLog(
double x) {
return log(x); }
438 static inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
439 static inline float ImAbs(
float x) {
return fabsf(x); }
440 static inline double ImAbs(
double x) {
return fabs(x); }
441 static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
442 static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
443 #ifdef IMGUI_ENABLE_SSE
444 static inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
446 static inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
448 static inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
452 template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
453 template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
454 template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
455 template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
456 template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
457 template<
typename T>
static inline T ImAddClampOverflow(T a, T b, T mn, T mx) {
if (b < 0 && (a < mn - b))
return mn;
if (b > 0 && (a > mx - b))
return mx;
return a + b; }
458 template<
typename T>
static inline T ImSubClampOverflow(T a, T b, T mn, T mx) {
if (b > 0 && (a < mn + b))
return mn;
if (b < 0 && (a > mx + b))
return mx;
return a - b; }
460 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); }
461 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); }
462 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); }
463 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); }
464 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); }
465 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); }
466 static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
467 static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
468 static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
469 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 ImRsqrt(d);
return fail_value; }
470 static inline float ImFloor(
float f) {
return (
float)(int)(f); }
471 static inline float ImFloorSigned(
float f) {
return (
float)((f >= 0 || (float)(
int)f == f) ? (
int)f : (int)f - 1); }
472 static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
473 static inline ImVec2 ImFloorSigned(
const ImVec2& v) {
return ImVec2(ImFloorSigned(v.x), ImFloorSigned(v.y)); }
474 static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
475 static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
476 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); }
477 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; }
479 static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
480 static inline float ImExponentialMovingAverage(
float avg,
float sample,
int n) { avg -= avg / n; avg += sample / n;
return avg; }
481 IM_MSVC_RUNTIME_CHECKS_RESTORE
491 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);
492 inline float ImTriangleArea(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c) {
return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
493 IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(
float dx,
float dy);
497 IM_MSVC_RUNTIME_CHECKS_OFF
501 constexpr
ImVec1() : x(0.0f) { }
502 constexpr
ImVec1(
float _x) : x(_x) { }
509 constexpr
ImVec2ih() : x(0), y(0) {}
510 constexpr
ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
511 constexpr
explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
521 constexpr
ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
523 constexpr
ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
524 constexpr
ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
526 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
527 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
528 float GetWidth()
const {
return Max.x - Min.x; }
529 float GetHeight()
const {
return Max.y - Min.y; }
530 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
531 ImVec2 GetTL()
const {
return Min; }
534 ImVec2 GetBR()
const {
return Max; }
535 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
536 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; }
537 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; }
538 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; }
539 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; }
540 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
541 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
542 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
543 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
544 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
545 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
546 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
547 void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); }
548 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
549 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
551 IM_MSVC_RUNTIME_CHECKS_RESTORE
554 inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
555 inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
556 inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
557 inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
562 int a_mod = (n & 31);
563 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
564 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
572 template<
int BITCOUNT,
int OFFSET = 0>
575 ImU32 Storage[(BITCOUNT + 31) >> 5];
577 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
578 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
579 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return ImBitArrayTestBit(Storage, n); }
580 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
581 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
582 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); }
583 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return ImBitArrayTestBit(Storage, n); }
591 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
592 void Clear() { Storage.clear(); }
593 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return ImBitArrayTestBit(Storage.Data, n); }
594 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
595 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
607 inline ImSpan() { Data = DataEnd = NULL; }
608 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
609 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
611 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
612 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
613 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
614 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
615 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
616 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
618 inline T* begin() {
return Data; }
619 inline const T* begin()
const {
return Data; }
620 inline T* end() {
return DataEnd; }
621 inline const T* end()
const {
return DataEnd; }
624 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
640 inline void Reserve(
int n,
size_t sz,
int a=4) { IM_ASSERT(n == CurrIdx && n < CHUNKS); CurrOff = IM_MEMALIGN(CurrOff, a); Offsets[n] = CurrOff; Sizes[n] = (int)sz; CurrIdx++; CurrOff += (int)sz; }
641 inline int GetArenaSizeInBytes() {
return CurrOff; }
642 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
643 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
644 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
646 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
652 typedef int ImPoolIdx;
659 ImPoolIdx AliveCount;
661 ImPool() { FreeIdx = AliveCount = 0; }
663 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
664 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
665 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
666 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
667 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
668 void Clear() {
for (
int n = 0; n < Map.Data.Size; n++) {
int idx = Map.Data[n].val_i;
if (idx != -1) Buf[idx].~T(); } Map.Clear(); Buf.clear(); FreeIdx = AliveCount = 0; }
669 T* Add() {
int idx = FreeIdx;
if (idx == Buf.Size) { Buf.resize(Buf.Size + 1); FreeIdx++; }
else { FreeIdx = *(
int*)&Buf[idx]; } IM_PLACEMENT_NEW(&Buf[idx]) T(); AliveCount++;
return &Buf[idx]; }
670 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
671 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
672 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
676 int GetAliveCount()
const {
return AliveCount; }
677 int GetBufSize()
const {
return Buf.Size; }
678 int GetMapSize()
const {
return Map.Data.Size; }
679 T* TryGetMapData(ImPoolIdx n) {
int idx = Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
680 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
681 int GetSize() {
return GetMapSize(); }
695 void clear() { Buf.clear(); }
696 bool empty()
const {
return Buf.Size == 0; }
697 int size()
const {
return Buf.Size; }
698 T* alloc_chunk(
size_t sz) {
size_t HDR_SZ = 4; sz = IM_MEMALIGN(HDR_SZ + sz, 4u);
int off = Buf.Size; Buf.resize(off + (
int)sz); ((
int*)(
void*)(Buf.Data + off))[0] = (int)sz;
return (T*)(
void*)(Buf.Data + off + (
int)HDR_SZ); }
699 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
700 T* next_chunk(T* p) {
size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(
void*)((
char*)(
void*)p + chunk_size(p));
if (p == (T*)(
void*)((
char*)end() + HDR_SZ))
return (T*)0; IM_ASSERT(p < end());
return p; }
701 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
702 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
703 int offset_from_ptr(
const T* p) { IM_ASSERT(p >= begin() && p < end());
const ptrdiff_t off = (
const char*)p - Buf.Data; return (
int)off; }
704 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
716 void clear() { LineOffsets.clear(); EndOffset = 0; }
717 int size() {
return LineOffsets.Size; }
718 const char* get_line_begin(
const char* base,
int n) {
return base + LineOffsets[n]; }
719 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
720 void append(
const char* base,
int old_size,
int new_size);
737 #define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
738 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
739 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
740 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(_RAD,_MAXERROR) ImClamp(IM_ROUNDUP_TO_EVEN((int)ImCeil(IM_PI / ImAcos(1 - ImMin((_MAXERROR), (_RAD)) / (_RAD)))), IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX)
743 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))))
744 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD))
747 #ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE
748 #define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48
750 #define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE
759 float CurveTessellationTol;
760 float CircleSegmentMaxError;
761 ImVec4 ClipRectFullscreen;
762 ImDrawListFlags InitialFlags;
768 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
769 float ArcFastRadiusCutoff;
770 ImU8 CircleSegmentCounts[64];
774 void SetCircleTessellationMaxError(
float max_error);
781 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
782 void ClearFreeMemory() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
783 int GetDrawListCount()
const {
int count = 0;
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) count += Layers[n].Size;
return count; }
784 IMGUI_API
void FlattenIntoSingleLayer();
799 ImGuiItemFlags_None = 0,
800 ImGuiItemFlags_NoTabStop = 1 << 0,
801 ImGuiItemFlags_ButtonRepeat = 1 << 1,
802 ImGuiItemFlags_Disabled = 1 << 2,
803 ImGuiItemFlags_NoNav = 1 << 3,
804 ImGuiItemFlags_NoNavDefaultFocus = 1 << 4,
805 ImGuiItemFlags_SelectableDontClosePopup = 1 << 5,
806 ImGuiItemFlags_MixedValue = 1 << 6,
807 ImGuiItemFlags_ReadOnly = 1 << 7,
808 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8,
811 ImGuiItemFlags_Inputable = 1 << 10,
816 enum ImGuiItemStatusFlags_
818 ImGuiItemStatusFlags_None = 0,
819 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
820 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
821 ImGuiItemStatusFlags_Edited = 1 << 2,
822 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
823 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
824 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
825 ImGuiItemStatusFlags_Deactivated = 1 << 6,
826 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
827 ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8,
828 ImGuiItemStatusFlags_Visible = 1 << 9,
830 #ifdef IMGUI_ENABLE_TEST_ENGINE
831 ImGuiItemStatusFlags_Openable = 1 << 20,
832 ImGuiItemStatusFlags_Opened = 1 << 21,
833 ImGuiItemStatusFlags_Checkable = 1 << 22,
834 ImGuiItemStatusFlags_Checked = 1 << 23,
839 enum ImGuiInputTextFlagsPrivate_
842 ImGuiInputTextFlags_Multiline = 1 << 26,
843 ImGuiInputTextFlags_NoMarkEdited = 1 << 27,
844 ImGuiInputTextFlags_MergedItem = 1 << 28,
848 enum ImGuiButtonFlagsPrivate_
850 ImGuiButtonFlags_PressedOnClick = 1 << 4,
851 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
852 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
853 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
854 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
855 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
856 ImGuiButtonFlags_Repeat = 1 << 10,
857 ImGuiButtonFlags_FlattenChildren = 1 << 11,
858 ImGuiButtonFlags_AllowItemOverlap = 1 << 12,
859 ImGuiButtonFlags_DontClosePopups = 1 << 13,
861 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
862 ImGuiButtonFlags_NoKeyModifiers = 1 << 16,
863 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
864 ImGuiButtonFlags_NoNavFocus = 1 << 18,
865 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
866 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
867 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
868 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
869 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
873 enum ImGuiComboFlagsPrivate_
875 ImGuiComboFlags_CustomPreview = 1 << 20,
879 enum ImGuiSliderFlagsPrivate_
881 ImGuiSliderFlags_Vertical = 1 << 20,
882 ImGuiSliderFlags_ReadOnly = 1 << 21,
886 enum ImGuiSelectableFlagsPrivate_
889 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
890 ImGuiSelectableFlags_SelectOnNav = 1 << 21,
891 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
892 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
893 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
894 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
895 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
896 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
900 enum ImGuiTreeNodeFlagsPrivate_
902 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20,
905 enum ImGuiSeparatorFlags_
907 ImGuiSeparatorFlags_None = 0,
908 ImGuiSeparatorFlags_Horizontal = 1 << 0,
909 ImGuiSeparatorFlags_Vertical = 1 << 1,
910 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
915 ImGuiTextFlags_None = 0,
916 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
919 enum ImGuiTooltipFlags_
921 ImGuiTooltipFlags_None = 0,
922 ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0,
927 enum ImGuiLayoutType_
929 ImGuiLayoutType_Horizontal = 0,
930 ImGuiLayoutType_Vertical = 1
935 ImGuiLogType_None = 0,
939 ImGuiLogType_Clipboard,
953 ImGuiPlotType_Histogram,
956 enum ImGuiPopupPositionPolicy
958 ImGuiPopupPositionPolicy_Default,
959 ImGuiPopupPositionPolicy_ComboBox,
960 ImGuiPopupPositionPolicy_Tooltip,
973 const char* PrintFmt;
978 enum ImGuiDataTypePrivate_
980 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
981 ImGuiDataType_Pointer,
995 ImGuiStyleVar VarIdx;
996 union {
int BackupInt[2];
float BackupFloat[2]; };
997 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
998 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
999 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
1007 ImVec2 BackupCursorMaxPos;
1008 ImVec2 BackupCursorPosPrevLine;
1009 float BackupPrevLineTextBaseOffset;
1010 ImGuiLayoutType BackupLayout;
1020 ImVec2 BackupCursorMaxPos;
1022 ImVec1 BackupGroupOffset;
1023 ImVec2 BackupCurrLineSize;
1024 float BackupCurrLineTextBaseOffset;
1025 ImGuiID BackupActiveIdIsAlive;
1026 bool BackupActiveIdPreviousFrameIsAlive;
1027 bool BackupHoveredIdIsAlive;
1035 ImU32 NextTotalWidth;
1039 ImU16 OffsetShortcut;
1044 void Update(
float spacing,
bool window_reappearing);
1045 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1046 void CalcNextTotalWidth(
bool update_offsets);
1055 int CurLenW, CurLenA;
1062 ImStb::STB_TexteditState Stb;
1065 bool SelectedAllMouseLock;
1067 ImGuiInputTextFlags Flags;
1070 void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
1071 void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
1072 int GetUndoAvailCount()
const {
return Stb.undostate.undo_point; }
1073 int GetRedoAvailCount()
const {
return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
1074 void OnKeyPressed(
int key);
1077 void CursorAnimReset() { CursorAnim = -0.30f; }
1078 void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
1079 bool HasSelection()
const {
return Stb.select_start != Stb.select_end; }
1080 void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
1081 int GetCursorPos()
const {
return Stb.cursor; }
1082 int GetSelectionStart()
const {
return Stb.select_start; }
1083 int GetSelectionEnd()
const {
return Stb.select_end; }
1084 void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
1095 ImGuiID OpenParentId;
1099 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1102 enum ImGuiNextWindowDataFlags_
1104 ImGuiNextWindowDataFlags_None = 0,
1105 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1106 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1107 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1108 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1109 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1110 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1111 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1112 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1118 ImGuiNextWindowDataFlags Flags;
1121 ImGuiCond CollapsedCond;
1128 ImRect SizeConstraintRect;
1129 ImGuiSizeCallback SizeCallback;
1130 void* SizeCallbackUserData;
1132 ImVec2 MenuBarOffsetMinVal;
1135 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1138 enum ImGuiNextItemDataFlags_
1140 ImGuiNextItemDataFlags_None = 0,
1141 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1142 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1147 ImGuiNextItemDataFlags Flags;
1149 ImGuiID FocusScopeId;
1154 inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; }
1161 ImGuiItemFlags InFlags;
1162 ImGuiItemStatusFlags StatusFlags;
1172 short SizeOfIDStack;
1173 short SizeOfColorStack;
1174 short SizeOfStyleVarStack;
1175 short SizeOfFontStack;
1176 short SizeOfFocusScopeStack;
1177 short SizeOfGroupStack;
1178 short SizeOfItemFlagsStack;
1179 short SizeOfBeginPopupStack;
1180 short SizeOfDisabledStack;
1183 void SetToCurrentState();
1184 void CompareWithCurrentState();
1218 #define ImGuiKey_LegacyNativeKey_BEGIN 0
1219 #define ImGuiKey_LegacyNativeKey_END 512
1220 #define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
1221 #define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
1222 #define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
1223 #define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
1224 #define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
1225 #define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
1226 #define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
1227 #define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
1230 #define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
1231 #define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
1232 #define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
1233 #define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
1234 #define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
1235 #define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
1236 #define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
1237 #define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
1239 enum ImGuiInputEventType
1241 ImGuiInputEventType_None = 0,
1242 ImGuiInputEventType_MousePos,
1243 ImGuiInputEventType_MouseWheel,
1244 ImGuiInputEventType_MouseButton,
1245 ImGuiInputEventType_Key,
1246 ImGuiInputEventType_Text,
1247 ImGuiInputEventType_Focus,
1248 ImGuiInputEventType_COUNT
1251 enum ImGuiInputSource
1253 ImGuiInputSource_None = 0,
1254 ImGuiInputSource_Mouse,
1255 ImGuiInputSource_Keyboard,
1256 ImGuiInputSource_Gamepad,
1257 ImGuiInputSource_Clipboard,
1258 ImGuiInputSource_Nav,
1259 ImGuiInputSource_COUNT
1273 ImGuiInputEventType Type;
1274 ImGuiInputSource Source;
1284 bool AddedByTestEngine;
1290 #define ImGuiKeyOwner_Any ((ImGuiID)0)
1291 #define ImGuiKeyOwner_None ((ImGuiID)-1)
1293 typedef ImS16 ImGuiKeyRoutingIndex;
1298 ImGuiKeyRoutingIndex NextEntryIndex;
1300 ImU8 RoutingNextScore;
1301 ImGuiID RoutingCurr;
1302 ImGuiID RoutingNext;
1304 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_None; }
1311 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1316 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1326 bool LockUntilRelease;
1328 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease =
false; }
1333 enum ImGuiInputFlags_
1336 ImGuiInputFlags_None = 0,
1337 ImGuiInputFlags_Repeat = 1 << 0,
1338 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1339 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1340 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1341 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1344 ImGuiInputFlags_CondHovered = 1 << 4,
1345 ImGuiInputFlags_CondActive = 1 << 5,
1346 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1347 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1350 ImGuiInputFlags_LockThisFrame = 1 << 6,
1351 ImGuiInputFlags_LockUntilRelease = 1 << 7,
1363 ImGuiInputFlags_RouteFocused = 1 << 8,
1364 ImGuiInputFlags_RouteGlobalLow = 1 << 9,
1365 ImGuiInputFlags_RouteGlobal = 1 << 10,
1366 ImGuiInputFlags_RouteGlobalHigh = 1 << 11,
1367 ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh,
1368 ImGuiInputFlags_RouteAlways = 1 << 12,
1369 ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13,
1370 ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused,
1373 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_,
1374 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_,
1375 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1376 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1387 bool PosToIndexConvert;
1388 ImS8 PosToIndexOffsetMin;
1389 ImS8 PosToIndexOffsetMax;
1399 float LossynessOffset;
1405 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1412 enum ImGuiActivateFlags_
1414 ImGuiActivateFlags_None = 0,
1415 ImGuiActivateFlags_PreferInput = 1 << 0,
1416 ImGuiActivateFlags_PreferTweak = 1 << 1,
1417 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1421 enum ImGuiScrollFlags_
1423 ImGuiScrollFlags_None = 0,
1424 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1425 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1426 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1427 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1428 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1429 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1430 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1431 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1432 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1435 enum ImGuiNavHighlightFlags_
1437 ImGuiNavHighlightFlags_None = 0,
1438 ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
1439 ImGuiNavHighlightFlags_TypeThin = 1 << 1,
1440 ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2,
1441 ImGuiNavHighlightFlags_NoRounding = 1 << 3,
1444 enum ImGuiNavMoveFlags_
1446 ImGuiNavMoveFlags_None = 0,
1447 ImGuiNavMoveFlags_LoopX = 1 << 0,
1448 ImGuiNavMoveFlags_LoopY = 1 << 1,
1449 ImGuiNavMoveFlags_WrapX = 1 << 2,
1450 ImGuiNavMoveFlags_WrapY = 1 << 3,
1451 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1452 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1453 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1454 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1455 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1456 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1457 ImGuiNavMoveFlags_Tabbing = 1 << 10,
1458 ImGuiNavMoveFlags_Activate = 1 << 11,
1459 ImGuiNavMoveFlags_DontSetNavHighlight = 1 << 12,
1464 ImGuiNavLayer_Main = 0,
1465 ImGuiNavLayer_Menu = 1,
1473 ImGuiID FocusScopeId;
1475 ImGuiItemFlags InFlags;
1481 void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; }
1489 enum ImGuiOldColumnFlags_
1491 ImGuiOldColumnFlags_None = 0,
1492 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1493 ImGuiOldColumnFlags_NoResize = 1 << 1,
1494 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1495 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1496 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1499 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1500 ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
1501 ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
1502 ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
1503 ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
1504 ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
1505 ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
1512 float OffsetNormBeforeResize;
1513 ImGuiOldColumnFlags Flags;
1522 ImGuiOldColumnFlags Flags;
1524 bool IsBeingResized;
1527 float OffMinX, OffMaxX;
1528 float LineMinY, LineMaxY;
1529 float HostCursorPosY;
1530 float HostCursorMaxPosX;
1531 ImRect HostInitialClipRect;
1532 ImRect HostBackupClipRect;
1533 ImRect HostBackupParentWorkRect;
1544 #ifdef IMGUI_HAS_MULTI_SELECT
1552 #ifdef IMGUI_HAS_DOCK
1564 int DrawListsLastFrame[2];
1571 ImVec2 BuildWorkOffsetMin;
1572 ImVec2 BuildWorkOffsetMax;
1574 ImGuiViewportP() { DrawListsLastFrame[0] = DrawListsLastFrame[1] = -1; DrawLists[0] = DrawLists[1] = NULL; }
1575 ~
ImGuiViewportP() {
if (DrawLists[0]) IM_DELETE(DrawLists[0]);
if (DrawLists[1]) IM_DELETE(DrawLists[1]); }
1578 ImVec2 CalcWorkRectPos(
const ImVec2& off_min)
const {
return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); }
1579 ImVec2 CalcWorkRectSize(
const ImVec2& off_min,
const ImVec2& off_max)
const {
return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); }
1580 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); }
1583 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1584 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
1585 ImRect GetBuildWorkRect()
const {
ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin);
ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax);
return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
1604 char* GetName() {
return (
char*)(
this + 1); }
1609 const char* TypeName;
1627 enum ImGuiLocKey :
int
1629 ImGuiLocKey_TableSizeOne,
1630 ImGuiLocKey_TableSizeAllFit,
1631 ImGuiLocKey_TableSizeAllDefault,
1632 ImGuiLocKey_TableResetOrder,
1633 ImGuiLocKey_WindowingMainMenuBar,
1634 ImGuiLocKey_WindowingPopup,
1635 ImGuiLocKey_WindowingUntitled,
1650 enum ImGuiDebugLogFlags_
1653 ImGuiDebugLogFlags_None = 0,
1654 ImGuiDebugLogFlags_EventActiveId = 1 << 0,
1655 ImGuiDebugLogFlags_EventFocus = 1 << 1,
1656 ImGuiDebugLogFlags_EventPopup = 1 << 2,
1657 ImGuiDebugLogFlags_EventNav = 1 << 3,
1658 ImGuiDebugLogFlags_EventClipper = 1 << 4,
1659 ImGuiDebugLogFlags_EventIO = 1 << 5,
1660 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventIO,
1661 ImGuiDebugLogFlags_OutputToTTY = 1 << 10,
1668 bool ShowWindowsRects;
1669 bool ShowWindowsBeginOrder;
1670 bool ShowTablesRects;
1671 bool ShowDrawCmdMesh;
1672 bool ShowDrawCmdBoundingBoxes;
1673 int ShowWindowsRectsType;
1674 int ShowTablesRectsType;
1678 ShowDebugLog = ShowStackTool = ShowWindowsRects = ShowWindowsBeginOrder = ShowTablesRects =
false;
1679 ShowDrawCmdMesh =
true;
1680 ShowDrawCmdBoundingBoxes =
true;
1681 ShowWindowsRectsType = ShowTablesRectsType = -1;
1688 ImS8 QueryFrameCount;
1690 ImGuiDataType DataType : 8;
1699 int LastActiveFrame;
1703 bool CopyToClipboardOnCtrlC;
1704 float CopyToClipboardLastTime;
1706 ImGuiStackTool() { memset(
this, 0,
sizeof(*
this)); CopyToClipboardLastTime = -FLT_MAX; }
1714 enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
1719 ImGuiContextHookType Type;
1721 ImGuiContextHookCallback Callback;
1734 bool FontAtlasOwnedByContext;
1745 int FrameCountEnded;
1746 int FrameCountRendered;
1747 bool WithinFrameScope;
1748 bool WithinFrameScopeWithImplicitWindow;
1749 bool WithinEndChild;
1751 bool TestEngineHookItems;
1760 int WindowsActiveCount;
1761 ImVec2 WindowsHoverPadding;
1767 ImVec2 WheelingWindowRefMousePos;
1768 int WheelingWindowStartFrame;
1769 float WheelingWindowReleaseTimer;
1770 ImVec2 WheelingWindowWheelRemainder;
1774 ImGuiID DebugHookIdInfo;
1776 ImGuiID HoveredIdPreviousFrame;
1777 bool HoveredIdAllowOverlap;
1778 bool HoveredIdDisabled;
1779 float HoveredIdTimer;
1780 float HoveredIdNotActiveTimer;
1782 ImGuiID ActiveIdIsAlive;
1783 float ActiveIdTimer;
1784 bool ActiveIdIsJustActivated;
1785 bool ActiveIdAllowOverlap;
1786 bool ActiveIdNoClearOnFocusLoss;
1787 bool ActiveIdHasBeenPressedBefore;
1788 bool ActiveIdHasBeenEditedBefore;
1789 bool ActiveIdHasBeenEditedThisFrame;
1790 ImVec2 ActiveIdClickOffset;
1792 ImGuiInputSource ActiveIdSource;
1793 int ActiveIdMouseButton;
1794 ImGuiID ActiveIdPreviousFrame;
1795 bool ActiveIdPreviousFrameIsAlive;
1796 bool ActiveIdPreviousFrameHasBeenEditedBefore;
1798 ImGuiID LastActiveId;
1799 float LastActiveIdTimer;
1807 ImU32 ActiveIdUsingNavDirMask;
1808 bool ActiveIdUsingAllKeyboardKeys;
1809 #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1810 ImU32 ActiveIdUsingNavInputMask;
1814 ImGuiID CurrentFocusScopeId;
1815 ImGuiItemFlags CurrentItemFlags;
1816 ImGuiID DebugLocateId;
1838 ImGuiID NavFocusScopeId;
1839 ImGuiID NavActivateId;
1840 ImGuiID NavActivateDownId;
1841 ImGuiID NavActivatePressedId;
1842 ImGuiID NavActivateInputId;
1843 ImGuiActivateFlags NavActivateFlags;
1844 ImGuiID NavJustMovedToId;
1845 ImGuiID NavJustMovedToFocusScopeId;
1846 ImGuiKeyChord NavJustMovedToKeyMods;
1847 ImGuiID NavNextActivateId;
1848 ImGuiActivateFlags NavNextActivateFlags;
1849 ImGuiInputSource NavInputSource;
1850 ImGuiNavLayer NavLayer;
1852 bool NavMousePosDirty;
1853 bool NavDisableHighlight;
1854 bool NavDisableMouseHover;
1858 bool NavInitRequest;
1859 bool NavInitRequestFromMove;
1860 ImGuiID NavInitResultId;
1861 ImRect NavInitResultRectRel;
1862 bool NavMoveSubmitted;
1863 bool NavMoveScoringItems;
1864 bool NavMoveForwardToNextFrame;
1865 ImGuiNavMoveFlags NavMoveFlags;
1866 ImGuiScrollFlags NavMoveScrollFlags;
1867 ImGuiKeyChord NavMoveKeyMods;
1868 ImGuiDir NavMoveDir;
1869 ImGuiDir NavMoveDirForDebug;
1870 ImGuiDir NavMoveClipDir;
1872 ImRect NavScoringNoClipRect;
1873 int NavScoringDebugCount;
1875 int NavTabbingCounter;
1882 ImGuiKeyChord ConfigNavWindowingKeyNext;
1883 ImGuiKeyChord ConfigNavWindowingKeyPrev;
1887 float NavWindowingTimer;
1888 float NavWindowingHighlightAlpha;
1889 bool NavWindowingToggleLayer;
1890 ImVec2 NavWindowingAccumDeltaPos;
1891 ImVec2 NavWindowingAccumDeltaSize;
1895 ImGuiMouseCursor MouseCursor;
1898 bool DragDropActive;
1899 bool DragDropWithinSource;
1900 bool DragDropWithinTarget;
1901 ImGuiDragDropFlags DragDropSourceFlags;
1902 int DragDropSourceFrameCount;
1903 int DragDropMouseButton;
1905 ImRect DragDropTargetRect;
1906 ImGuiID DragDropTargetId;
1907 ImGuiDragDropFlags DragDropAcceptFlags;
1908 float DragDropAcceptIdCurrRectSurface;
1909 ImGuiID DragDropAcceptIdCurr;
1910 ImGuiID DragDropAcceptIdPrev;
1911 int DragDropAcceptFrameCount;
1912 ImGuiID DragDropHoldJustPressedId;
1914 unsigned char DragDropPayloadBufLocal[16];
1917 int ClipperTempDataStacked;
1922 int TablesTempDataStacked;
1935 ImGuiID HoverDelayId;
1936 ImGuiID HoverDelayIdPreviousFrame;
1937 float HoverDelayTimer;
1938 float HoverDelayClearTimer;
1941 ImVec2 MouseLastValidPos;
1943 ImFont InputTextPasswordFont;
1944 ImGuiID TempInputId;
1945 ImGuiColorEditFlags ColorEditOptions;
1946 float ColorEditLastHue;
1947 float ColorEditLastSat;
1948 ImU32 ColorEditLastColor;
1951 float SliderGrabClickOffset;
1952 float SliderCurrentAccum;
1953 bool SliderCurrentAccumDirty;
1954 bool DragCurrentAccumDirty;
1955 float DragCurrentAccum;
1956 float DragSpeedDefaultRatio;
1957 float ScrollbarClickDeltaToGrabCenter;
1958 float DisabledAlphaBackup;
1959 short DisabledStackSize;
1960 short TooltipOverrideCount;
1967 char PlatformLocaleDecimalPoint;
1970 bool SettingsLoaded;
1971 float SettingsDirtyTimer;
1980 const char* LocalizationTable[ImGuiLocKey_COUNT];
1984 ImGuiLogType LogType;
1985 ImFileHandle LogFile;
1987 const char* LogNextPrefix;
1988 const char* LogNextSuffix;
1990 bool LogLineFirstItem;
1992 int LogDepthToExpand;
1993 int LogDepthToExpandDefault;
1996 ImGuiDebugLogFlags DebugLogFlags;
1999 ImU8 DebugLocateFrames;
2000 bool DebugItemPickerActive;
2001 ImU8 DebugItemPickerMouseButton;
2002 ImGuiID DebugItemPickerBreakId;
2007 float FramerateSecPerFrame[60];
2008 int FramerateSecPerFrameIdx;
2009 int FramerateSecPerFrameCount;
2010 float FramerateSecPerFrameAccum;
2011 int WantCaptureMouseNextFrame;
2012 int WantCaptureKeyboardNextFrame;
2013 int WantTextInputNextFrame;
2017 : InputTextState(
this)
2019 Initialized =
false;
2020 FontAtlasOwnedByContext = shared_font_atlas ? false :
true;
2022 FontSize = FontBaseSize = 0.0f;
2023 IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(
ImFontAtlas)();
2026 FrameCountEnded = FrameCountRendered = -1;
2027 WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild =
false;
2028 GcCompactAll =
false;
2029 TestEngineHookItems =
false;
2032 WindowsActiveCount = 0;
2033 CurrentWindow = NULL;
2034 HoveredWindow = NULL;
2035 HoveredWindowUnderMovingWindow = NULL;
2036 MovingWindow = NULL;
2037 WheelingWindow = NULL;
2038 WheelingWindowStartFrame = -1;
2039 WheelingWindowReleaseTimer = 0.0f;
2041 DebugHookIdInfo = 0;
2042 HoveredId = HoveredIdPreviousFrame = 0;
2043 HoveredIdAllowOverlap =
false;
2044 HoveredIdDisabled =
false;
2045 HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
2047 ActiveIdIsAlive = 0;
2048 ActiveIdTimer = 0.0f;
2049 ActiveIdIsJustActivated =
false;
2050 ActiveIdAllowOverlap =
false;
2051 ActiveIdNoClearOnFocusLoss =
false;
2052 ActiveIdHasBeenPressedBefore =
false;
2053 ActiveIdHasBeenEditedBefore =
false;
2054 ActiveIdHasBeenEditedThisFrame =
false;
2055 ActiveIdClickOffset =
ImVec2(-1, -1);
2056 ActiveIdWindow = NULL;
2057 ActiveIdSource = ImGuiInputSource_None;
2058 ActiveIdMouseButton = -1;
2059 ActiveIdPreviousFrame = 0;
2060 ActiveIdPreviousFrameIsAlive =
false;
2061 ActiveIdPreviousFrameHasBeenEditedBefore =
false;
2062 ActiveIdPreviousFrameWindow = NULL;
2064 LastActiveIdTimer = 0.0f;
2066 ActiveIdUsingNavDirMask = 0x00;
2067 ActiveIdUsingAllKeyboardKeys =
false;
2068 #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
2069 ActiveIdUsingNavInputMask = 0x00;
2072 CurrentFocusScopeId = 0;
2073 CurrentItemFlags = ImGuiItemFlags_None;
2077 NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;
2078 NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
2079 NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
2080 NavJustMovedToKeyMods = ImGuiMod_None;
2081 NavInputSource = ImGuiInputSource_None;
2082 NavLayer = ImGuiNavLayer_Main;
2083 NavIdIsAlive =
false;
2084 NavMousePosDirty =
false;
2085 NavDisableHighlight =
true;
2086 NavDisableMouseHover =
false;
2087 NavAnyRequest =
false;
2088 NavInitRequest =
false;
2089 NavInitRequestFromMove =
false;
2090 NavInitResultId = 0;
2091 NavMoveSubmitted =
false;
2092 NavMoveScoringItems =
false;
2093 NavMoveForwardToNextFrame =
false;
2094 NavMoveFlags = ImGuiNavMoveFlags_None;
2095 NavMoveScrollFlags = ImGuiScrollFlags_None;
2096 NavMoveKeyMods = ImGuiMod_None;
2097 NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
2098 NavScoringDebugCount = 0;
2100 NavTabbingCounter = 0;
2102 ConfigNavWindowingKeyNext = ImGuiMod_Ctrl | ImGuiKey_Tab;
2103 ConfigNavWindowingKeyPrev = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab;
2104 NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
2105 NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
2106 NavWindowingToggleLayer =
false;
2109 MouseCursor = ImGuiMouseCursor_Arrow;
2111 DragDropActive = DragDropWithinSource = DragDropWithinTarget =
false;
2112 DragDropSourceFlags = ImGuiDragDropFlags_None;
2113 DragDropSourceFrameCount = -1;
2114 DragDropMouseButton = -1;
2115 DragDropTargetId = 0;
2116 DragDropAcceptFlags = ImGuiDragDropFlags_None;
2117 DragDropAcceptIdCurrRectSurface = 0.0f;
2118 DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
2119 DragDropAcceptFrameCount = -1;
2120 DragDropHoldJustPressedId = 0;
2121 memset(DragDropPayloadBufLocal, 0,
sizeof(DragDropPayloadBufLocal));
2123 ClipperTempDataStacked = 0;
2125 CurrentTable = NULL;
2126 TablesTempDataStacked = 0;
2127 CurrentTabBar = NULL;
2129 HoverDelayId = HoverDelayIdPreviousFrame = 0;
2130 HoverDelayTimer = HoverDelayClearTimer = 0.0f;
2133 ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
2134 ColorEditLastHue = ColorEditLastSat = 0.0f;
2135 ColorEditLastColor = 0;
2136 SliderGrabClickOffset = 0.0f;
2137 SliderCurrentAccum = 0.0f;
2138 SliderCurrentAccumDirty =
false;
2139 DragCurrentAccumDirty =
false;
2140 DragCurrentAccum = 0.0f;
2141 DragSpeedDefaultRatio = 1.0f / 100.0f;
2142 ScrollbarClickDeltaToGrabCenter = 0.0f;
2143 DisabledAlphaBackup = 0.0f;
2144 DisabledStackSize = 0;
2145 TooltipOverrideCount = 0;
2147 PlatformImeData.InputPos =
ImVec2(0.0f, 0.0f);
2148 PlatformImeDataPrev.InputPos =
ImVec2(-1.0f, -1.0f);
2149 PlatformLocaleDecimalPoint =
'.';
2151 SettingsLoaded =
false;
2152 SettingsDirtyTimer = 0.0f;
2155 memset(LocalizationTable, 0,
sizeof(LocalizationTable));
2158 LogType = ImGuiLogType_None;
2159 LogNextPrefix = LogNextSuffix = NULL;
2161 LogLinePosY = FLT_MAX;
2162 LogLineFirstItem =
false;
2164 LogDepthToExpand = LogDepthToExpandDefault = 2;
2166 DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
2168 DebugLocateFrames = 0;
2169 DebugItemPickerActive =
false;
2170 DebugItemPickerMouseButton = ImGuiMouseButton_Left;
2171 DebugItemPickerBreakId = 0;
2173 memset(FramerateSecPerFrame, 0,
sizeof(FramerateSecPerFrame));
2174 FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
2175 FramerateSecPerFrameAccum = 0.0f;
2176 WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
2191 ImVec2 CursorPosPrevLine;
2197 float CurrLineTextBaseOffset;
2198 float PrevLineTextBaseOffset;
2204 ImVec2 CursorStartPosLossyness;
2207 ImGuiNavLayer NavLayerCurrent;
2208 short NavLayersActiveMask;
2209 short NavLayersActiveMaskNext;
2210 bool NavHideHighlightOneFrame;
2214 bool MenuBarAppending;
2218 ImU32 TreeJumpToParentOnPopMask;
2222 int CurrentTableIdx;
2223 ImGuiLayoutType LayoutType;
2224 ImGuiLayoutType ParentLayoutType;
2239 ImGuiWindowFlags Flags;
2246 ImVec2 ContentSizeExplicit;
2248 float WindowRounding;
2249 float WindowBorderSize;
2250 float DecoOuterSizeX1, DecoOuterSizeY1;
2251 float DecoOuterSizeX2, DecoOuterSizeY2;
2252 float DecoInnerSizeX1, DecoInnerSizeY1;
2259 ImVec2 ScrollTargetCenterRatio;
2260 ImVec2 ScrollTargetEdgeSnapDist;
2262 bool ScrollbarX, ScrollbarY;
2267 bool WantCollapseToggle;
2271 bool IsFallbackWindow;
2272 bool IsExplicitChild;
2273 bool HasCloseButton;
2274 signed char ResizeBorderHeld;
2276 short BeginCountPreviousFrame;
2277 short BeginOrderWithinParent;
2278 short BeginOrderWithinContext;
2281 ImS8 AutoFitFramesX, AutoFitFramesY;
2282 ImS8 AutoFitChildAxises;
2283 bool AutoFitOnlyGrows;
2284 ImGuiDir AutoPosLastDirection;
2285 ImS8 HiddenFramesCanSkipItems;
2286 ImS8 HiddenFramesCannotSkipItems;
2287 ImS8 HiddenFramesForRenderOnly;
2288 ImS8 DisableInputsFrames;
2289 ImGuiCond SetWindowPosAllowFlags : 8;
2290 ImGuiCond SetWindowSizeAllowFlags : 8;
2291 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2293 ImVec2 SetWindowPosPivot;
2306 ImRect ContentRegionRect;
2310 int LastFrameActive;
2311 float LastTimeActive;
2312 float ItemWidthDefault;
2315 float FontWindowScale;
2328 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2329 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2330 ImGuiID NavRootFocusScopeId;
2332 int MemoryDrawListIdxCapacity;
2333 int MemoryDrawListVtxCapacity;
2334 bool MemoryCompacted;
2340 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2341 ImGuiID GetID(
const void* ptr);
2342 ImGuiID GetID(
int n);
2343 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2346 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2347 float CalcFontSize()
const {
ImGuiContext& g = *GImGui;
float scale = g.FontBaseSize * FontWindowScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
2348 float TitleBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
2349 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
2350 float MenuBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
2351 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight();
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
2359 enum ImGuiTabBarFlagsPrivate_
2361 ImGuiTabBarFlags_DockNode = 1 << 20,
2362 ImGuiTabBarFlags_IsFocused = 1 << 21,
2363 ImGuiTabBarFlags_SaveSettings = 1 << 22,
2367 enum ImGuiTabItemFlagsPrivate_
2369 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
2370 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
2371 ImGuiTabItemFlags_Button = 1 << 21,
2378 ImGuiTabItemFlags Flags;
2379 int LastFrameVisible;
2380 int LastFrameSelected;
2384 float RequestedWidth;
2387 ImS16 IndexDuringLayout;
2390 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
2397 ImGuiTabBarFlags Flags;
2399 ImGuiID SelectedTabId;
2400 ImGuiID NextSelectedTabId;
2401 ImGuiID VisibleTabId;
2402 int CurrFrameVisible;
2403 int PrevFrameVisible;
2405 float CurrTabsContentsHeight;
2406 float PrevTabsContentsHeight;
2408 float WidthAllTabsIdeal;
2409 float ScrollingAnim;
2410 float ScrollingTarget;
2411 float ScrollingTargetDistToVisibility;
2412 float ScrollingSpeed;
2413 float ScrollingRectMinX;
2414 float ScrollingRectMaxX;
2415 ImGuiID ReorderRequestTabId;
2416 ImS16 ReorderRequestOffset;
2419 bool VisibleTabWasSubmitted;
2421 ImS16 TabsActiveCount;
2422 ImS16 LastTabItemIdx;
2429 int GetTabOrder(
const ImGuiTabItem* tab)
const {
return Tabs.index_from_ptr(tab); }
2432 IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size);
2433 return TabsNames.Buf.Data + tab->NameOffset;
2441 #define IM_COL32_DISABLE IM_COL32(0,0,0,1)
2442 #define IMGUI_TABLE_MAX_COLUMNS 64
2443 #define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2)
2446 typedef ImS8 ImGuiTableColumnIdx;
2447 typedef ImU8 ImGuiTableDrawChannelIdx;
2455 ImGuiTableColumnFlags Flags;
2461 float StretchWeight;
2462 float InitStretchWeightOrWidth;
2468 float ContentMaxXFrozen;
2469 float ContentMaxXUnfrozen;
2470 float ContentMaxXHeadersUsed;
2471 float ContentMaxXHeadersIdeal;
2473 ImGuiTableColumnIdx DisplayOrder;
2474 ImGuiTableColumnIdx IndexWithinEnabledSet;
2475 ImGuiTableColumnIdx PrevEnabledColumn;
2476 ImGuiTableColumnIdx NextEnabledColumn;
2477 ImGuiTableColumnIdx SortOrder;
2478 ImGuiTableDrawChannelIdx DrawChannelCurrent;
2479 ImGuiTableDrawChannelIdx DrawChannelFrozen;
2480 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
2483 bool IsUserEnabledNextFrame;
2486 bool IsRequestOutput;
2488 bool IsPreserveWidthAuto;
2489 ImS8 NavLayerCurrent;
2491 ImU8 CannotSkipItemsQueue;
2492 ImU8 SortDirection : 2;
2493 ImU8 SortDirectionsAvailCount : 2;
2494 ImU8 SortDirectionsAvailMask : 4;
2495 ImU8 SortDirectionsAvailList;
2499 memset(
this, 0,
sizeof(*
this));
2500 StretchWeight = WidthRequest = -1.0f;
2502 DisplayOrder = IndexWithinEnabledSet = -1;
2503 PrevEnabledColumn = NextEnabledColumn = -1;
2505 SortDirection = ImGuiSortDirection_None;
2506 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2515 ImGuiTableColumnIdx Column;
2521 float LastOuterHeight;
2522 float LastFirstRowHeight;
2523 float LastFrozenHeight;
2532 ImGuiTableFlags Flags;
2538 ImU64 EnabledMaskByDisplayOrder;
2539 ImU64 EnabledMaskByIndex;
2540 ImU64 VisibleMaskByIndex;
2541 ImU64 RequestOutputMaskByIndex;
2542 ImGuiTableFlags SettingsLoadedFlags;
2544 int LastFrameActive;
2548 ImS16 InstanceCurrent;
2549 ImS16 InstanceInteracted;
2553 float RowTextBaseline;
2554 float RowIndentOffsetX;
2555 ImGuiTableRowFlags RowFlags : 16;
2556 ImGuiTableRowFlags LastRowFlags : 16;
2557 int RowBgColorCounter;
2558 ImU32 RowBgColor[2];
2559 ImU32 BorderColorStrong;
2560 ImU32 BorderColorLight;
2564 float MinColumnWidth;
2565 float OuterPaddingX;
2568 float CellSpacingX1;
2569 float CellSpacingX2;
2571 float ColumnsGivenWidth;
2572 float ColumnsAutoFitWidth;
2573 float ColumnsStretchSumWeights;
2574 float ResizedColumnNextWidth;
2575 float ResizeLockMinContentsX2;
2582 ImRect Bg0ClipRectForDrawCmd;
2583 ImRect Bg2ClipRectForDrawCmd;
2585 ImRect HostBackupInnerClipRect;
2595 ImGuiTableColumnIdx SortSpecsCount;
2596 ImGuiTableColumnIdx ColumnsEnabledCount;
2597 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
2598 ImGuiTableColumnIdx DeclColumnsCount;
2599 ImGuiTableColumnIdx HoveredColumnBody;
2600 ImGuiTableColumnIdx HoveredColumnBorder;
2601 ImGuiTableColumnIdx AutoFitSingleColumn;
2602 ImGuiTableColumnIdx ResizedColumn;
2603 ImGuiTableColumnIdx LastResizedColumn;
2604 ImGuiTableColumnIdx HeldHeaderColumn;
2605 ImGuiTableColumnIdx ReorderColumn;
2606 ImGuiTableColumnIdx ReorderColumnDir;
2607 ImGuiTableColumnIdx LeftMostEnabledColumn;
2608 ImGuiTableColumnIdx RightMostEnabledColumn;
2609 ImGuiTableColumnIdx LeftMostStretchedColumn;
2610 ImGuiTableColumnIdx RightMostStretchedColumn;
2611 ImGuiTableColumnIdx ContextPopupColumn;
2612 ImGuiTableColumnIdx FreezeRowsRequest;
2613 ImGuiTableColumnIdx FreezeRowsCount;
2614 ImGuiTableColumnIdx FreezeColumnsRequest;
2615 ImGuiTableColumnIdx FreezeColumnsCount;
2616 ImGuiTableColumnIdx RowCellDataCurrent;
2617 ImGuiTableDrawChannelIdx DummyDrawChannel;
2618 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
2619 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
2620 bool IsLayoutLocked;
2622 bool IsInitializing;
2623 bool IsSortSpecsDirty;
2624 bool IsUsingHeaders;
2625 bool IsContextPopupOpen;
2626 bool IsSettingsRequestLoad;
2627 bool IsSettingsDirty;
2628 bool IsDefaultDisplayOrder;
2629 bool IsResetAllRequest;
2630 bool IsResetDisplayOrderRequest;
2631 bool IsUnfrozenRows;
2632 bool IsDefaultSizingPolicy;
2633 bool HasScrollbarYCurr;
2634 bool HasScrollbarYPrev;
2635 bool MemoryCompacted;
2638 ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
2648 float LastTimeActive;
2653 ImRect HostBackupWorkRect;
2654 ImRect HostBackupParentWorkRect;
2655 ImVec2 HostBackupPrevLineSize;
2656 ImVec2 HostBackupCurrLineSize;
2657 ImVec2 HostBackupCursorMaxPos;
2658 ImVec1 HostBackupColumnsOffset;
2659 float HostBackupItemWidth;
2660 int HostBackupItemWidthStackSize;
2668 float WidthOrWeight;
2670 ImGuiTableColumnIdx Index;
2671 ImGuiTableColumnIdx DisplayOrder;
2672 ImGuiTableColumnIdx SortOrder;
2673 ImU8 SortDirection : 2;
2679 WidthOrWeight = 0.0f;
2682 DisplayOrder = SortOrder = -1;
2683 SortDirection = ImGuiSortDirection_None;
2693 ImGuiTableFlags SaveFlags;
2695 ImGuiTableColumnIdx ColumnsCount;
2696 ImGuiTableColumnIdx ColumnsCountMax;
2716 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
2717 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
2718 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
2719 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
2721 IMGUI_API
bool IsWindowChildOf(
ImGuiWindow* window,
ImGuiWindow* potential_parent,
bool popup_hierarchy);
2724 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
2725 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
2726 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
2727 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
2729 inline ImRect WindowRectAbsToRel(
ImGuiWindow* window,
const ImRect& r) {
ImVec2 off = window->DC.CursorStartPos;
return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); }
2730 inline ImRect WindowRectRelToAbs(
ImGuiWindow* window,
const ImRect& r) {
ImVec2 off = window->DC.CursorStartPos;
return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); }
2735 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
2736 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
2737 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
2739 IMGUI_API
int FindWindowDisplayIndex(
ImGuiWindow* window);
2743 IMGUI_API
void SetCurrentFont(
ImFont* font);
2744 inline ImFont* GetDefaultFont() {
ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
2745 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) { IM_UNUSED(window);
return GetForegroundDrawList(); }
2750 IMGUI_API
void Initialize();
2751 IMGUI_API
void Shutdown();
2754 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
2755 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
2756 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
2757 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
2758 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
2762 IMGUI_API
void RemoveContextHook(
ImGuiContext* context, ImGuiID hook_to_remove);
2763 IMGUI_API
void CallContextHooks(
ImGuiContext* context, ImGuiContextHookType type);
2769 IMGUI_API
void MarkIniSettingsDirty();
2770 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
2771 IMGUI_API
void ClearIniSettings();
2776 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
2780 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
2781 inline const char* LocalizeGetMsg(ImGuiLocKey key) {
ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
2784 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
2785 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
2786 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
2787 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
2790 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
2791 IMGUI_API
void ScrollToRect(
ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
2794 inline void ScrollToBringRectIntoView(
ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
2798 inline ImGuiItemStatusFlags GetItemStatusFlags(){
ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
2799 inline ImGuiItemFlags GetItemFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.InFlags; }
2800 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
2801 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
2802 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
2803 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
2804 IMGUI_API
void ClearActiveID();
2805 IMGUI_API ImGuiID GetHoveredID();
2806 IMGUI_API
void SetHoveredID(ImGuiID
id);
2807 IMGUI_API
void KeepAliveID(ImGuiID
id);
2808 IMGUI_API
void MarkItemEdited(ImGuiID
id);
2809 IMGUI_API
void PushOverrideID(ImGuiID
id);
2810 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
2813 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
2814 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
2815 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
2816 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id);
2817 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
2818 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
2819 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
2820 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
2821 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
2822 IMGUI_API
bool IsItemToggledSelection();
2823 IMGUI_API
ImVec2 GetContentRegionMaxAbs();
2827 IMGUI_API
void PushItemFlag(ImGuiItemFlags option,
bool enabled);
2828 IMGUI_API
void PopItemFlag();
2831 IMGUI_API
void LogBegin(ImGuiLogType type,
int auto_open_depth);
2832 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
2833 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
2834 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
2837 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg,
bool border, ImGuiWindowFlags flags);
2838 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
2839 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
2840 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
2841 IMGUI_API
void ClosePopupsExceptModals();
2842 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
2843 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_flags);
2844 IMGUI_API
void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
2847 IMGUI_API
ImGuiWindow* GetTopMostAndVisiblePopupModal();
2849 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
2852 IMGUI_API
bool BeginViewportSideBar(
const char* name,
ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
2853 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
2854 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
2857 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
2858 IMGUI_API
bool BeginComboPreview();
2859 IMGUI_API
void EndComboPreview();
2862 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
2863 IMGUI_API
void NavInitRequestApplyResult();
2864 IMGUI_API
bool NavMoveRequestButNoResultYet();
2865 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
2866 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
2867 IMGUI_API
void NavMoveRequestResolveWithLastItem(
ImGuiNavItemData* result);
2868 IMGUI_API
void NavMoveRequestCancel();
2869 IMGUI_API
void NavMoveRequestApplyResult();
2870 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
2871 IMGUI_API
void ActivateItem(ImGuiID
id);
2873 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
2877 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
2878 inline bool IsNamedKeyOrModKey(ImGuiKey key) {
return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super || key == ImGuiMod_Shortcut; }
2879 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
2880 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
2881 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
2882 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
2883 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
2884 inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) {
ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut);
return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); }
2885 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
2888 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
2889 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
2890 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
2891 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
2892 if (key == ImGuiMod_Shortcut)
return (g.IO.ConfigMacOSXBehaviors ? ImGuiKey_ReservedForModSuper : ImGuiKey_ReservedForModCtrl);
2897 IMGUI_API
void GetKeyChordName(ImGuiKeyChord key_chord,
char* out_buf,
int out_buf_size);
2898 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
2899 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
2900 IMGUI_API
ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
2901 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
2902 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
2903 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
2904 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
2905 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
2918 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
2919 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2920 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0);
2921 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
2922 inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiKey key) {
if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key));
return &GImGui->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
2930 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
2931 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2932 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
2933 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
2934 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2935 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
2947 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
2948 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
2949 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
2960 IMGUI_API
void PushFocusScope(ImGuiID
id);
2961 IMGUI_API
void PopFocusScope();
2962 inline ImGuiID GetCurrentFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
2965 IMGUI_API
bool IsDragDropActive();
2966 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
2967 IMGUI_API
void ClearDragDrop();
2968 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
2969 IMGUI_API
void RenderDragDropTargetRect(
const ImRect& bb);
2972 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
2973 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
2974 IMGUI_API
void EndColumns();
2975 IMGUI_API
void PushColumnClipRect(
int column_index);
2976 IMGUI_API
void PushColumnsBackground();
2977 IMGUI_API
void PopColumnsBackground();
2978 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
2980 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
2981 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
2984 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
2985 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
2986 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
2987 IMGUI_API
int TableGetHoveredColumn();
2988 IMGUI_API
float TableGetHeaderRowHeight();
2989 IMGUI_API
void TablePushBackgroundChannel();
2990 IMGUI_API
void TablePopBackgroundChannel();
2994 IMGUI_API
ImGuiTable* TableFindByID(ImGuiID
id);
2995 IMGUI_API
bool BeginTableEx(
const char* name, ImGuiID
id,
int columns_count, ImGuiTableFlags flags = 0,
const ImVec2& outer_size =
ImVec2(0, 0),
float inner_width = 0.0f);
2996 IMGUI_API
void TableBeginInitMemory(
ImGuiTable* table,
int columns_count);
2997 IMGUI_API
void TableBeginApplyRequests(
ImGuiTable* table);
2998 IMGUI_API
void TableSetupDrawChannels(
ImGuiTable* table);
2999 IMGUI_API
void TableUpdateLayout(
ImGuiTable* table);
3000 IMGUI_API
void TableUpdateBorders(
ImGuiTable* table);
3001 IMGUI_API
void TableUpdateColumnsWeightFromWidth(
ImGuiTable* table);
3002 IMGUI_API
void TableDrawBorders(
ImGuiTable* table);
3003 IMGUI_API
void TableDrawContextMenu(
ImGuiTable* table);
3004 IMGUI_API
bool TableBeginContextMenuPopup(
ImGuiTable* table);
3005 IMGUI_API
void TableMergeDrawChannels(
ImGuiTable* table);
3006 inline ImGuiTableInstanceData* TableGetInstanceData(
ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3007 IMGUI_API
void TableSortSpecsSanitize(
ImGuiTable* table);
3008 IMGUI_API
void TableSortSpecsBuild(
ImGuiTable* table);
3009 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(
ImGuiTableColumn* column);
3012 IMGUI_API
void TableBeginRow(
ImGuiTable* table);
3013 IMGUI_API
void TableEndRow(
ImGuiTable* table);
3014 IMGUI_API
void TableBeginCell(
ImGuiTable* table,
int column_n);
3015 IMGUI_API
void TableEndCell(
ImGuiTable* table);
3016 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3017 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3018 IMGUI_API ImGuiID TableGetColumnResizeID(
const ImGuiTable* table,
int column_n,
int instance_no = 0);
3019 IMGUI_API
float TableGetMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3020 IMGUI_API
void TableSetColumnWidthAutoSingle(
ImGuiTable* table,
int column_n);
3021 IMGUI_API
void TableSetColumnWidthAutoAll(
ImGuiTable* table);
3022 IMGUI_API
void TableRemove(
ImGuiTable* table);
3023 IMGUI_API
void TableGcCompactTransientBuffers(
ImGuiTable* table);
3025 IMGUI_API
void TableGcCompactSettings();
3028 IMGUI_API
void TableLoadSettings(
ImGuiTable* table);
3029 IMGUI_API
void TableSaveSettings(
ImGuiTable* table);
3030 IMGUI_API
void TableResetSettings(
ImGuiTable* table);
3032 IMGUI_API
void TableSettingsAddSettingsHandler();
3037 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3039 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
3043 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
3044 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags,
ImGuiWindow* docked_window);
3045 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3047 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3048 IMGUI_API
void TabItemLabelAndCloseButton(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags,
ImVec2 frame_padding,
const char* label, ImGuiID tab_id, ImGuiID close_button_id,
bool is_contents_visible,
bool* out_just_closed,
bool* out_text_clipped);
3053 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3054 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3055 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);
3056 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);
3057 IMGUI_API
void RenderTextEllipsis(
ImDrawList* draw_list,
const ImVec2& pos_min,
const ImVec2& pos_max,
float clip_max_x,
float ellipsis_max_x,
const char* text,
const char* text_end,
const ImVec2* text_size_if_known);
3058 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool border =
true,
float rounding = 0.0f);
3059 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
3060 IMGUI_API
void RenderColorRectWithAlphaCheckerboard(
ImDrawList* draw_list,
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
float grid_step,
ImVec2 grid_off,
float rounding = 0.0f, ImDrawFlags flags = 0);
3061 IMGUI_API
void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault);
3062 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3063 IMGUI_API
void RenderMouseCursor(
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3066 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3068 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
3069 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3070 IMGUI_API
void RenderRectFilledRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
3071 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3074 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3075 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3076 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3077 IMGUI_API
bool ImageButtonEx(ImGuiID
id, ImTextureID texture_id,
const ImVec2& size,
const ImVec2& uv0,
const ImVec2& uv1,
const ImVec4& bg_col,
const ImVec4& tint_col);
3078 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags);
3079 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3080 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3083 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3084 IMGUI_API
bool CollapseButton(ImGuiID
id,
const ImVec2& pos);
3085 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3086 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
3088 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
3089 IMGUI_API ImGuiID GetWindowResizeCornerID(
ImGuiWindow* window,
int n);
3090 IMGUI_API ImGuiID GetWindowResizeBorderID(
ImGuiWindow* window, ImGuiDir dir);
3093 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3094 IMGUI_API
bool DragBehavior(ImGuiID
id, ImGuiDataType data_type,
void* p_v,
float v_speed,
const void* p_min,
const void* p_max,
const char* format, ImGuiSliderFlags flags);
3095 IMGUI_API
bool SliderBehavior(
const ImRect& bb, ImGuiID
id, ImGuiDataType data_type,
void* p_v,
const void* p_min,
const void* p_max,
const char* format, ImGuiSliderFlags flags,
ImRect* out_grab_bb);
3096 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, ImU32 bg_col = 0);
3097 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3098 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3099 IMGUI_API
void TreeNodeSetOpen(ImGuiID
id,
bool open);
3100 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID
id, ImGuiTreeNodeFlags flags);
3105 template<
typename T,
typename SIGNED_T,
typename FLOAT_T> IMGUI_API
float ScaleRatioFromValueT(ImGuiDataType data_type, T v, T v_min, T v_max,
bool is_logarithmic,
float logarithmic_zero_epsilon,
float zero_deadzone_size);
3106 template<
typename T,
typename SIGNED_T,
typename FLOAT_T> IMGUI_API T ScaleValueFromRatioT(ImGuiDataType data_type,
float t, T v_min, T v_max,
bool is_logarithmic,
float logarithmic_zero_epsilon,
float zero_deadzone_size);
3107 template<
typename T,
typename SIGNED_T,
typename FLOAT_T> IMGUI_API
bool DragBehaviorT(ImGuiDataType data_type, T* v,
float v_speed, T v_min, T v_max,
const char* format, ImGuiSliderFlags flags);
3108 template<
typename T,
typename SIGNED_T,
typename FLOAT_T> IMGUI_API
bool SliderBehaviorT(
const ImRect& bb, ImGuiID
id, ImGuiDataType data_type, T* v, T v_min, T v_max,
const char* format, ImGuiSliderFlags flags,
ImRect* out_grab_bb);
3109 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3110 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3114 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3115 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3116 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format);
3117 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3118 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3121 IMGUI_API
bool InputTextEx(
const char* label,
const char* hint,
char* buf,
int buf_size,
const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL,
void* user_data = NULL);
3122 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3123 IMGUI_API
bool TempInputScalar(
const ImRect& bb, ImGuiID
id,
const char* label, ImGuiDataType data_type,
void* p_data,
const char* format,
const void* p_clamp_min = NULL,
const void* p_clamp_max = NULL);
3124 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
3125 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3128 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3129 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3130 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3133 IMGUI_API
int 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 frame_size);
3136 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);
3137 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);
3140 IMGUI_API
void GcCompactTransientMiscBuffers();
3141 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
3142 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
3145 IMGUI_API
void DebugLog(
const char* fmt, ...) IM_FMTARGS(1);
3146 IMGUI_API
void DebugLogV(const
char* fmt, va_list args) IM_FMTLIST(1);
3149 IMGUI_API
void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,
void* user_data = NULL);
3150 IMGUI_API
void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback,
void* user_data = NULL);
3151 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
3152 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
3153 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
3154 IMGUI_API
void DebugLocateItemResolveWithLastItem();
3155 inline
void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, col); }
3156 inline void DebugStartItemPicker() {
ImGuiContext& g = *GImGui; g.DebugItemPickerActive =
true; }
3158 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
3160 IMGUI_API
void DebugNodeDrawList(
ImGuiWindow* window,
const ImDrawList* draw_list,
const char* label);
3161 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
3162 IMGUI_API
void DebugNodeFont(
ImFont* font);
3164 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
3165 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
3166 IMGUI_API
void DebugNodeTable(
ImGuiTable* table);
3169 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
3172 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(
ImGuiWindow** windows,
int windows_size,
ImGuiWindow* parent_in_begin_stack);
3174 IMGUI_API
void DebugRenderKeyboardPreview(
ImDrawList* draw_list);
3178 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3179 inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); }
3180 inline bool TreeNodeBehaviorIsOpen(ImGuiID
id, ImGuiTreeNodeFlags flags = 0) {
return TreeNodeUpdateNextOpen(
id, flags); }
3187 inline bool FocusableItemRegister(
ImGuiWindow* window, ImGuiID
id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(
id);
return false; }
3188 inline void FocusableItemUnregister(
ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); }
3190 #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
3191 inline bool IsKeyPressedMap(ImGuiKey key,
bool repeat =
true) { IM_ASSERT(IsNamedKey(key));
return IsKeyPressed(key, repeat); }
3208 #ifdef IMGUI_ENABLE_STB_TRUETYPE
3209 IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
3211 IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
3213 IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
3214 IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
3215 IMGUI_API
void ImFontAtlasBuildRender8bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned char in_marker_pixel_value);
3216 IMGUI_API
void ImFontAtlasBuildRender32bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned int in_marker_pixel_value);
3217 IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
3218 IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
3224 #ifdef IMGUI_ENABLE_TEST_ENGINE
3225 extern void ImGuiTestEngineHook_ItemAdd(
ImGuiContext* ctx,
const ImRect& bb, ImGuiID
id);
3226 extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
3227 extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
3228 extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
3230 #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID)
3231 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS)
3232 #define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__)
3234 #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
3235 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
3240 #if defined(__clang__)
3241 #pragma clang diagnostic pop
3242 #elif defined(__GNUC__)
3243 #pragma GCC diagnostic pop
3247 #pragma warning (pop)
Definition: imgui_internal.h:574
Definition: imgui_internal.h:589
Definition: imgui_internal.h:692
Definition: imgui_internal.h:778
Definition: imgui_internal.h:755
Definition: imgui_internal.h:3203
Definition: imgui_internal.h:987
Definition: imgui_internal.h:1004
Definition: imgui_internal.h:1717
Definition: imgui_internal.h:1732
Definition: imgui_internal.h:970
Definition: imgui_internal.h:964
Definition: imgui_internal.h:1017
Definition: imgui_internal.h:1268
Definition: imgui_internal.h:1052
Definition: imgui_internal.h:1322
Definition: imgui_internal.h:1297
Definition: imgui_internal.h:1310
Definition: imgui_internal.h:1159
Definition: imgui_internal.h:1397
Definition: imgui_internal.h:1384
Definition: imgui_internal.h:1640
Definition: imgui_internal.h:1033
Definition: imgui_internal.h:1665
Definition: imgui_internal.h:1470
Definition: imgui_internal.h:1146
Definition: imgui_internal.h:1117
Definition: imgui_internal.h:1510
Definition: imgui_internal.h:1520
Definition: imgui_internal.h:1203
Definition: imgui_internal.h:1608
Definition: imgui_internal.h:1196
Definition: imgui_internal.h:1686
Definition: imgui_internal.h:1171
Definition: imgui_internal.h:994
Definition: imgui_internal.h:2395
Definition: imgui_internal.h:2376
Definition: imgui_internal.h:2513
Definition: imgui_internal.h:2667
Definition: imgui_internal.h:2454
Definition: imgui_internal.h:2520
Definition: imgui_internal.h:2691
Definition: imgui_internal.h:2646
Definition: imgui_internal.h:2530
Definition: imgui_internal.h:712
Definition: imgui_internal.h:1563
Definition: imgui_internal.h:1596
Definition: imgui_internal.h:1189
Definition: imgui_internal.h:2188
Definition: imgui_internal.h:2236
Definition: imgui_internal.h:655
Definition: imgui_internal.h:517
Definition: imgui_internal.h:632
Definition: imgui_internal.h:602
Definition: imgui_internal.h:499
Definition: imgui_internal.h:507