63 #if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE) && !defined(_M_ARM64) && !defined(_M_ARM64EC) 64 #define IMGUI_ENABLE_SSE 65 #include <immintrin.h> 66 #if (defined __AVX__ || defined __SSE4_2__) 67 #define IMGUI_ENABLE_SSE4_2 68 #include <nmmintrin.h> 72 #if defined(IMGUI_ENABLE_SSE4_2) && !defined(IMGUI_USE_LEGACY_CRC32_ADLER) && !defined(__EMSCRIPTEN__) 73 #define IMGUI_ENABLE_SSE4_2_CRC 78 #pragma warning (push) 79 #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) 80 #pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6). 81 #pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). 82 #if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later 83 #pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types 88 #if defined(__clang__) 89 #pragma clang diagnostic push 90 #if __has_warning("-Wunknown-warning-option") 91 #pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' 93 #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx' 94 #pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloor() 95 #pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast 96 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant 97 #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function 98 #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision 99 #pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn' 100 #pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated 101 #pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access 102 #pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 103 #elif defined(__GNUC__) 104 #pragma GCC diagnostic push 105 #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind 106 #pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe 107 #pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead 108 #pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated 109 #pragma GCC diagnostic ignored "-Wsign-conversion" // warning: conversion to 'xxxx' from 'xxxx' may change the sign of the result 114 #if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED) 115 #error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h! 119 #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74 120 #error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 122 #ifdef IMGUI_DISABLE_MATH_FUNCTIONS // Renamed in 1.74 123 #error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 128 #ifndef IMGUI_ENABLE_FREETYPE 129 #define IMGUI_ENABLE_STB_TRUETYPE 157 struct ImGuiDockRequest;
159 struct ImGuiDockNodeSettings;
163 struct ImGuiInputTextDeactivateData;
187 struct ImGuiTableColumnsSettings;
198 enum ImGuiLocKey : int;
199 typedef int ImGuiDataAuthority;
200 typedef int ImGuiLayoutType;
203 typedef int ImDrawTextFlags;
204 typedef int ImGuiActivateFlags;
205 typedef int ImGuiDebugLogFlags;
206 typedef int ImGuiFocusRequestFlags;
207 typedef int ImGuiItemStatusFlags;
208 typedef int ImGuiOldColumnFlags;
209 typedef int ImGuiLogFlags;
210 typedef int ImGuiNavRenderCursorFlags;
211 typedef int ImGuiNavMoveFlags;
212 typedef int ImGuiNextItemDataFlags;
213 typedef int ImGuiNextWindowDataFlags;
214 typedef int ImGuiScrollFlags;
215 typedef int ImGuiSeparatorFlags;
216 typedef int ImGuiTextFlags;
217 typedef int ImGuiTooltipFlags;
218 typedef int ImGuiTypingSelectFlags;
219 typedef int ImGuiWindowBgClickFlags;
220 typedef int ImGuiWindowRefreshFlags;
223 typedef ImS16 ImGuiTableColumnIdx;
224 typedef ImU16 ImGuiTableDrawChannelIdx;
240 #define IMGUI_PAYLOAD_TYPE_WINDOW "_IMWINDOW" // Payload == ImGuiWindow* 244 #ifndef IMGUI_DEBUG_PRINTF 245 #ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 246 #define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__) 248 #define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0) 253 #define IMGUI_DEBUG_LOG_ERROR(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g.DebugLogSkippedErrors++; } while (0) 254 #define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 255 #define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 256 #define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 257 #define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 258 #define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 259 #define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 260 #define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 261 #define IMGUI_DEBUG_LOG_FONT(...) do { ImGuiContext* g2 = GImGui; if (g2 && g2->DebugLogFlags & ImGuiDebugLogFlags_EventFont) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) // Called from ImFontAtlas function which may operate without a context. 262 #define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 263 #define IMGUI_DEBUG_LOG_DOCKING(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventDocking) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 264 #define IMGUI_DEBUG_LOG_VIEWPORT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventViewport) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 267 #define IM_STATIC_ASSERT(_COND) static_assert(_COND, "") 272 #ifdef IMGUI_DEBUG_PARANOID 273 #define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR) 275 #define IM_ASSERT_PARANOID(_EXPR) 279 #define IM_PI 3.14159265358979323846f 281 #define IM_NEWLINE "\r\n" // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!) 283 #define IM_NEWLINE "\n" 285 #ifndef IM_TABSIZE // Until we move this to runtime and/or add proper tab support, at least allow users to compile-time override 286 #define IM_TABSIZE (4) 288 #define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8 289 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose 290 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 291 #define IM_TRUNC(_VAL) ((float)(int)(_VAL)) // Positive values only! ImTrunc() is not inlined in MSVC debug builds 292 #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // Positive values only! 296 #if (defined(__cplusplus) && (__cplusplus >= 202002L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L)) 297 #define IM_LIKELY [[likely]] 298 #define IM_UNLIKELY [[unlikely]] 306 #define IMGUI_CDECL __cdecl 312 #if defined(_MSC_VER) && !defined(__clang__) 313 #define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX)) 315 #define IM_MSVC_WARNING_SUPPRESS(XXXX) 321 #ifndef IM_DEBUG_BREAK 322 #if defined (_MSC_VER) 323 #define IM_DEBUG_BREAK() __debugbreak() 324 #elif defined(__clang__) 325 #define IM_DEBUG_BREAK() __builtin_debugtrap() 326 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 327 #define IM_DEBUG_BREAK() __asm__ volatile("int3;nop") 328 #elif defined(__GNUC__) && defined(__thumb__) 329 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01") 330 #elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__) 331 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0") 333 #define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger! 335 #endif // #ifndef IM_DEBUG_BREAK 339 #if defined(_MSC_VER) && !defined(__clang__) 340 #define IM_PRId64 "I64d" 341 #define IM_PRIu64 "I64u" 342 #define IM_PRIX64 "I64X" 344 #define IM_PRId64 "lld" 345 #define IM_PRIu64 "llu" 346 #define IM_PRIX64 "llX" 377 IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImGuiID seed = 0);
378 IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImGuiID seed = 0);
379 IMGUI_API
const char* ImHashSkipUncontributingPrefix(
const char* label);
383 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); }
387 IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
390 inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
391 inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
392 inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
393 inline unsigned int ImCountSetBits(
unsigned int v) {
unsigned int count = 0;
while (v > 0) { v = v & (v - 1); count++; }
return count; }
396 #define ImStrlen strlen 397 #define ImMemchr memchr 398 IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
399 IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
400 IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
401 IMGUI_API
char* ImStrdup(
const char* str);
402 IMGUI_API
void* ImMemdup(
const void* src,
size_t size);
403 IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
404 IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
405 IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
406 IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
407 IMGUI_API
void ImStrTrimBlanks(
char* str);
408 IMGUI_API
const char* ImStrSkipBlank(
const char* str);
409 IMGUI_API
int ImStrlenW(
const ImWchar* str);
410 IMGUI_API
const char* ImStrbol(
const char* buf_mid_line,
const char* buf_begin);
411 IM_MSVC_RUNTIME_CHECKS_OFF
412 inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
413 inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
414 inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
415 inline bool ImCharIsXdigitA(
char c) {
return (c >=
'0' && c <=
'9') || (c >=
'A' && c <= 'F') || (c >=
'a' && c <=
'f'); }
416 IM_MSVC_RUNTIME_CHECKS_RESTORE
419 IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
420 IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
421 IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
422 IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
423 IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
424 IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
425 IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
426 IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
427 IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
428 IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
431 IMGUI_API
int ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
432 IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
433 IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
434 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);
435 IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
436 IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
437 IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
438 IMGUI_API const
char* ImTextFindPreviousUtf8Codepoint(const
char* in_text_start, const
char* in_p);
439 IMGUI_API const
char* ImTextFindValidUtf8CodepointEnd(const
char* in_text_start, const
char* in_text_end, const
char* in_p);
440 IMGUI_API
int ImTextCountLines(const
char* in_text, const
char* in_text_end);
443 enum ImDrawTextFlags_
445 ImDrawTextFlags_None = 0,
446 ImDrawTextFlags_CpuFineClip = 1 << 0,
447 ImDrawTextFlags_WrapKeepBlanks = 1 << 1,
448 ImDrawTextFlags_StopOnNewLine = 1 << 2,
450 IMGUI_API
ImVec2 ImFontCalcTextSizeEx(
ImFont* font,
float size,
float max_width,
float wrap_width,
const char* text_begin,
const char* text_end_display,
const char* text_end,
const char** out_remaining,
ImVec2* out_offset, ImDrawTextFlags flags);
451 IMGUI_API
const char* ImFontCalcWordWrapPositionEx(
ImFont* font,
float size,
const char* text,
const char* text_end,
float wrap_width, ImDrawTextFlags flags = 0);
452 IMGUI_API
const char* ImTextCalcWordWrapNextLineStart(
const char* text,
const char* text_end, ImDrawTextFlags flags = 0);
457 ImWcharClass_Blank, ImWcharClass_Punct, ImWcharClass_Other
459 IMGUI_API
void ImTextInitClassifiers();
460 IMGUI_API
void ImTextClassifierClear(ImU32* bits,
unsigned int codepoint_min,
unsigned int codepoint_end, ImWcharClass char_class);
461 IMGUI_API
void ImTextClassifierSetCharClass(ImU32* bits,
unsigned int codepoint_min,
unsigned int codepoint_end, ImWcharClass char_class,
unsigned int c);
462 IMGUI_API
void ImTextClassifierSetCharClassFromStr(ImU32* bits,
unsigned int codepoint_min,
unsigned int codepoint_end, ImWcharClass char_class,
const char* s);
465 #ifdef IMGUI_DISABLE_FILE_FUNCTIONS 466 #define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 467 typedef void* ImFileHandle;
468 inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
469 inline bool ImFileClose(ImFileHandle) {
return false; }
470 inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
471 inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
472 inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
474 #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 475 typedef FILE* ImFileHandle;
476 IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
477 IMGUI_API
bool ImFileClose(ImFileHandle file);
478 IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
479 IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
480 IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
482 #define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions 484 IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
487 IM_MSVC_RUNTIME_CHECKS_OFF
489 #ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 490 #define ImFabs(X) fabsf(X) 491 #define ImSqrt(X) sqrtf(X) 492 #define ImFmod(X, Y) fmodf((X), (Y)) 493 #define ImCos(X) cosf(X) 494 #define ImSin(X) sinf(X) 495 #define ImAcos(X) acosf(X) 496 #define ImAtan2(Y, X) atan2f((Y), (X)) 497 #define ImAtof(STR) atof(STR) 498 #define ImCeil(X) ceilf(X) 499 inline float ImPow(
float x,
float y) {
return powf(x, y); }
500 inline double ImPow(
double x,
double y) {
return pow(x, y); }
501 inline float ImLog(
float x) {
return logf(x); }
502 inline double ImLog(
double x) {
return log(x); }
503 inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
504 inline float ImAbs(
float x) {
return fabsf(x); }
505 inline double ImAbs(
double x) {
return fabs(x); }
506 inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
507 inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
508 #ifdef IMGUI_ENABLE_SSE 509 inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
511 inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
513 inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
517 template<
typename T> T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
518 template<
typename T> T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
519 template<
typename T> T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
520 template<
typename T> T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
521 template<
typename T>
void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
522 template<
typename T> 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; }
523 template<
typename T> 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; }
525 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); }
526 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); }
527 inline ImVec2 ImClamp(
const ImVec2& v,
const ImVec2&mn,
const 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); }
528 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); }
530 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); }
531 inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
532 inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
533 inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
534 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; }
535 inline float ImTrunc(
float f) {
return (
float)(int)(f); }
536 inline ImVec2 ImTrunc(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
537 inline float ImFloor(
float f) {
return (
float)((f >= 0 || (float)(
int)f == f) ? (
int)f : (int)f - 1); }
539 inline float ImTrunc64(
float f) {
return (
float)(ImS64)(f); }
540 inline float ImRound64(
float f) {
return (
float)(ImS64)(f + 0.5f); }
541 inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
542 inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
543 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); }
544 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; }
545 inline float ImLinearRemapClamp(
float s0,
float s1,
float d0,
float d1,
float x) {
return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; }
547 inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
548 inline float ImExponentialMovingAverage(
float avg,
float sample,
int n){ avg -= avg / n; avg += sample / n;
return avg; }
549 IM_MSVC_RUNTIME_CHECKS_RESTORE
559 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);
560 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; }
561 inline bool ImTriangleIsClockwise(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c) {
return ((b.x - a.x) * (c.y - b.y)) - ((c.x - b.x) * (b.y - a.y)) > 0.0f; }
565 IM_MSVC_RUNTIME_CHECKS_OFF
569 constexpr
ImVec1() : x(0.0f) { }
570 constexpr ImVec1(
float _x) : x(_x) { }
577 constexpr
ImVec2i() : x(0), y(0) {}
578 constexpr ImVec2i(
int _x,
int _y) : x(_x), y(_y) {}
585 constexpr
ImVec2ih() : x(0), y(0) {}
586 constexpr ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
587 constexpr
explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
597 constexpr
ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
598 constexpr ImRect(
const ImVec2& min,
const ImVec2& max) : Min(min), Max(max) {}
599 constexpr ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
600 constexpr ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
602 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
603 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
604 float GetWidth()
const {
return Max.x - Min.x; }
605 float GetHeight()
const {
return Max.y - Min.y; }
606 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
607 ImVec2 GetTL()
const {
return Min; }
610 ImVec2 GetBR()
const {
return Max; }
611 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
612 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; }
613 bool ContainsWithPad(
const ImVec2& p,
const ImVec2& pad)
const {
return p.x >= Min.x - pad.x && p.y >= Min.y - pad.y && p.x < Max.x + pad.x && p.y < Max.y + pad.y; }
614 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; }
615 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; }
616 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; }
617 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
618 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
619 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
620 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
621 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
622 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
623 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
624 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
625 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
626 const ImVec4& AsVec4()
const {
return *(
const ImVec4*)&Min.x; }
630 #define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly! 631 #define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly! 632 inline size_t ImBitArrayGetStorageSizeInBytes(
int bitcount) {
return (
size_t)((bitcount + 31) >> 5) << 2; }
633 inline void ImBitArrayClearAllBits(ImU32* arr,
int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
634 inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
635 inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
636 inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
637 inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
642 int a_mod = (n & 31);
643 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
644 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
650 typedef ImU32* ImBitArrayPtr;
654 template<
int BITCOUNT,
int OFFSET = 0>
657 ImU32 Data[(BITCOUNT + 31) >> 5];
659 void ClearAllBits() { memset(Data, 0,
sizeof(Data)); }
660 void SetAllBits() { memset(Data, 255,
sizeof(Data)); }
661 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Data, n); }
662 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Data, n); }
663 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Data, n); }
664 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Data, n, n2); }
665 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Data, n); }
673 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
674 void Clear() { Storage.clear(); }
675 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return IM_BITARRAY_TESTBIT(Storage.Data, n); }
676 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
677 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
679 IM_MSVC_RUNTIME_CHECKS_RESTORE
690 inline ImSpan() { Data = DataEnd = NULL; }
691 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
692 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
694 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
695 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
696 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
697 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
698 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
699 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
701 inline T* begin() {
return Data; }
702 inline const T* begin()
const {
return Data; }
703 inline T* end() {
return DataEnd; }
704 inline const T* end()
const {
return DataEnd; }
707 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
723 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; }
724 inline int GetArenaSizeInBytes() {
return CurrOff; }
725 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
726 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
727 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
729 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
736 template<
typename T,
int BLOCKSIZE>
744 inline ~
ImStableVector() {
for (T* block : Blocks) IM_FREE(block); }
746 inline void clear() { Size = Capacity = 0; Blocks.clear_delete(); }
747 inline void resize(
int new_size) {
if (new_size > Capacity) reserve(new_size); Size = new_size; }
748 inline void reserve(
int new_cap)
750 new_cap = IM_MEMALIGN(new_cap, BLOCKSIZE);
751 int old_count = Capacity / BLOCKSIZE;
752 int new_count = new_cap / BLOCKSIZE;
753 if (new_count <= old_count)
755 Blocks.resize(new_count);
756 for (
int n = old_count; n < new_count; n++)
757 Blocks[n] = (T*)IM_ALLOC(
sizeof(T) * BLOCKSIZE);
760 inline T& operator[](
int i) { IM_ASSERT(i >= 0 && i < Size);
return Blocks[i / BLOCKSIZE][i % BLOCKSIZE]; }
761 inline const T& operator[](
int i)
const { IM_ASSERT(i >= 0 && i < Size);
return Blocks[i / BLOCKSIZE][i % BLOCKSIZE]; }
762 inline T* push_back(
const T& v) {
int i = Size; IM_ASSERT(i >= 0);
if (Size == Capacity) reserve(Capacity + BLOCKSIZE);
void* ptr = &Blocks[i / BLOCKSIZE][i % BLOCKSIZE]; memcpy(ptr, &v,
sizeof(v)); Size++;
return (T*)ptr; }
768 typedef int ImPoolIdx;
775 ImPoolIdx AliveCount;
777 ImPool() { FreeIdx = AliveCount = 0; }
779 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
780 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
781 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
782 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
783 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
784 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; }
785 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]; }
786 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
787 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
788 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
792 int GetAliveCount()
const {
return AliveCount; }
793 int GetBufSize()
const {
return Buf.Size; }
794 int GetMapSize()
const {
return Map.Data.Size; }
795 T* TryGetMapData(ImPoolIdx n) {
int idx = Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
808 void clear() { Buf.clear(); }
809 bool empty()
const {
return Buf.Size == 0; }
810 int size()
const {
return Buf.Size; }
811 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); }
812 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
813 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; }
814 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
815 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
816 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; }
817 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
828 void clear() { Offsets.clear(); EndOffset = 0; }
829 int size() {
return Offsets.Size; }
830 const char* get_line_begin(
const char* base,
int n) {
return base + (Offsets.Size != 0 ? Offsets[n] : 0); }
831 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < Offsets.Size ? (Offsets[n + 1] - 1) : EndOffset); }
832 void append(
const char* base,
int old_size,
int new_size);
852 #define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2) 853 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4 854 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512 855 #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) 858 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI)))) 859 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD)) 862 #ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE 863 #define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48 // Number of samples in lookup table. 865 #define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE // Sample index _PathArcToFastEx() for 360 angle. 879 float CurveTessellationTol;
880 float CircleSegmentMaxError;
881 float InitialFringeScale;
882 ImDrawListFlags InitialFlags;
883 ImVec4 ClipRectFullscreen;
889 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
890 float ArcFastRadiusCutoff;
891 ImU8 CircleSegmentCounts[64];
895 void SetCircleTessellationMaxError(
float max_error);
909 float FontSizeBeforeScaling;
910 float FontSizeAfterScaling;
920 ImGuiDataType DataType : 8;
922 void* GetVarPtr(
void* parent)
const {
return (
void*)((
unsigned char*)parent + Offset); }
935 ImGuiStyleVar VarIdx;
936 union {
int BackupInt[2];
float BackupFloat[2]; };
937 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
938 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
939 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
956 const char* PrintFmt;
961 enum ImGuiDataTypePrivate_
963 ImGuiDataType_Pointer = ImGuiDataType_COUNT,
974 enum ImGuiItemFlagsPrivate_
977 ImGuiItemFlags_ReadOnly = 1 << 11,
978 ImGuiItemFlags_MixedValue = 1 << 12,
979 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13,
980 ImGuiItemFlags_AllowOverlap = 1 << 14,
981 ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15,
982 ImGuiItemFlags_NoMarkEdited = 1 << 16,
983 ImGuiItemFlags_NoFocus = 1 << 17,
986 ImGuiItemFlags_Inputable = 1 << 20,
987 ImGuiItemFlags_HasSelectionUserData = 1 << 21,
988 ImGuiItemFlags_IsMultiSelect = 1 << 22,
990 ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups,
998 enum ImGuiItemStatusFlags_
1000 ImGuiItemStatusFlags_None = 0,
1001 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
1002 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
1003 ImGuiItemStatusFlags_Edited = 1 << 2,
1004 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
1005 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
1006 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
1007 ImGuiItemStatusFlags_Deactivated = 1 << 6,
1008 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
1009 ImGuiItemStatusFlags_Visible = 1 << 8,
1010 ImGuiItemStatusFlags_HasClipRect = 1 << 9,
1011 ImGuiItemStatusFlags_HasShortcut = 1 << 10,
1015 #ifdef IMGUI_ENABLE_TEST_ENGINE 1016 ImGuiItemStatusFlags_Openable = 1 << 20,
1017 ImGuiItemStatusFlags_Opened = 1 << 21,
1018 ImGuiItemStatusFlags_Checkable = 1 << 22,
1019 ImGuiItemStatusFlags_Checked = 1 << 23,
1020 ImGuiItemStatusFlags_Inputable = 1 << 24,
1025 enum ImGuiHoveredFlagsPrivate_
1027 ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
1028 ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
1029 ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
1033 enum ImGuiInputTextFlagsPrivate_
1036 ImGuiInputTextFlags_Multiline = 1 << 26,
1037 ImGuiInputTextFlags_MergedItem = 1 << 27,
1038 ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28,
1042 enum ImGuiButtonFlagsPrivate_
1044 ImGuiButtonFlags_PressedOnClick = 1 << 4,
1045 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
1046 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
1047 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
1048 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
1049 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
1051 ImGuiButtonFlags_FlattenChildren = 1 << 11,
1052 ImGuiButtonFlags_AllowOverlap = 1 << 12,
1055 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
1056 ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16,
1057 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
1058 ImGuiButtonFlags_NoNavFocus = 1 << 18,
1059 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
1060 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
1061 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
1062 ImGuiButtonFlags_NoFocus = 1 << 22,
1063 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
1064 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
1069 enum ImGuiComboFlagsPrivate_
1071 ImGuiComboFlags_CustomPreview = 1 << 20,
1075 enum ImGuiSliderFlagsPrivate_
1077 ImGuiSliderFlags_Vertical = 1 << 20,
1078 ImGuiSliderFlags_ReadOnly = 1 << 21,
1082 enum ImGuiSelectableFlagsPrivate_
1085 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
1086 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
1087 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
1088 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
1089 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
1090 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
1091 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
1095 enum ImGuiTreeNodeFlagsPrivate_
1097 ImGuiTreeNodeFlags_NoNavFocus = 1 << 27,
1098 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,
1099 ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,
1100 ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
1101 ImGuiTreeNodeFlags_DrawLinesMask_ = ImGuiTreeNodeFlags_DrawLinesNone | ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes,
1104 enum ImGuiSeparatorFlags_
1106 ImGuiSeparatorFlags_None = 0,
1107 ImGuiSeparatorFlags_Horizontal = 1 << 0,
1108 ImGuiSeparatorFlags_Vertical = 1 << 1,
1109 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
1115 enum ImGuiFocusRequestFlags_
1117 ImGuiFocusRequestFlags_None = 0,
1118 ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0,
1119 ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1,
1122 enum ImGuiTextFlags_
1124 ImGuiTextFlags_None = 0,
1125 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
1128 enum ImGuiTooltipFlags_
1130 ImGuiTooltipFlags_None = 0,
1131 ImGuiTooltipFlags_OverridePrevious = 1 << 1,
1136 enum ImGuiLayoutType_
1138 ImGuiLayoutType_Horizontal = 0,
1139 ImGuiLayoutType_Vertical = 1
1145 ImGuiLogFlags_None = 0,
1147 ImGuiLogFlags_OutputTTY = 1 << 0,
1148 ImGuiLogFlags_OutputFile = 1 << 1,
1149 ImGuiLogFlags_OutputBuffer = 1 << 2,
1150 ImGuiLogFlags_OutputClipboard = 1 << 3,
1151 ImGuiLogFlags_OutputMask_ = ImGuiLogFlags_OutputTTY | ImGuiLogFlags_OutputFile | ImGuiLogFlags_OutputBuffer | ImGuiLogFlags_OutputClipboard,
1157 ImGuiAxis_None = -1,
1164 ImGuiPlotType_Lines,
1165 ImGuiPlotType_Histogram,
1173 ImVec2 BackupCursorMaxPos;
1174 ImVec2 BackupCursorPosPrevLine;
1175 float BackupPrevLineTextBaseOffset;
1176 ImGuiLayoutType BackupLayout;
1186 ImVec2 BackupCursorMaxPos;
1187 ImVec2 BackupCursorPosPrevLine;
1189 ImVec1 BackupGroupOffset;
1190 ImVec2 BackupCurrLineSize;
1191 float BackupCurrLineTextBaseOffset;
1192 ImGuiID BackupActiveIdIsAlive;
1193 bool BackupActiveIdHasBeenEditedThisFrame;
1194 bool BackupDeactivatedIdIsAlive;
1195 bool BackupHoveredIdIsAlive;
1196 bool BackupIsSameLine;
1204 ImU32 NextTotalWidth;
1208 ImU16 OffsetShortcut;
1213 void Update(
float spacing,
bool window_reappearing);
1214 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1215 void CalcNextTotalWidth(
bool update_offsets);
1225 void ClearFreeMemory() { ID = 0; TextA.clear(); }
1229 #undef IMSTB_TEXTEDIT_STRING 1230 #undef IMSTB_TEXTEDIT_CHARTYPE 1231 #define IMSTB_TEXTEDIT_STRING ImGuiInputTextState 1232 #define IMSTB_TEXTEDIT_CHARTYPE char 1233 #define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) 1234 #define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99 1235 #define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999 1237 typedef ImStb::STB_TexteditState ImStbTexteditState;
1244 ImStbTexteditState* Stb;
1245 ImGuiInputTextFlags Flags;
1248 const char* TextSrc;
1259 bool SelectedAllMouseLock;
1261 bool WantReloadUserBuf;
1262 ImS8 LastMoveDirectionLR;
1263 int ReloadSelectionStart;
1264 int ReloadSelectionEnd;
1268 void ClearText() { TextLen = 0; TextA[0] = 0; CursorClamp(); }
1269 void ClearFreeMemory() { TextA.clear(); TextToRevertTo.clear(); }
1270 void OnKeyPressed(
int key);
1271 void OnCharPressed(
unsigned int c);
1272 float GetPreferredOffsetX()
const;
1275 void CursorAnimReset();
1277 bool HasSelection()
const;
1278 void ClearSelection();
1279 int GetCursorPos()
const;
1280 int GetSelectionStart()
const;
1281 int GetSelectionEnd()
const;
1282 void SetSelection(
int start,
int end);
1290 void ReloadUserBufAndSelectAll();
1291 void ReloadUserBufAndKeepSelection();
1292 void ReloadUserBufAndMoveToEnd();
1295 enum ImGuiWindowRefreshFlags_
1297 ImGuiWindowRefreshFlags_None = 0,
1298 ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0,
1299 ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1,
1300 ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2,
1304 enum ImGuiWindowBgClickFlags_
1306 ImGuiWindowBgClickFlags_None = 0,
1307 ImGuiWindowBgClickFlags_Move = 1 << 0,
1310 enum ImGuiNextWindowDataFlags_
1312 ImGuiNextWindowDataFlags_None = 0,
1313 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1314 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1315 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1316 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1317 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1318 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1319 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1320 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1321 ImGuiNextWindowDataFlags_HasWindowFlags = 1 << 8,
1322 ImGuiNextWindowDataFlags_HasChildFlags = 1 << 9,
1323 ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 10,
1324 ImGuiNextWindowDataFlags_HasViewport = 1 << 11,
1325 ImGuiNextWindowDataFlags_HasDock = 1 << 12,
1326 ImGuiNextWindowDataFlags_HasWindowClass = 1 << 13,
1332 ImGuiNextWindowDataFlags HasFlags;
1337 ImGuiCond CollapsedCond;
1344 ImGuiWindowFlags WindowFlags;
1345 ImGuiChildFlags ChildFlags;
1348 ImRect SizeConstraintRect;
1349 ImGuiSizeCallback SizeCallback;
1350 void* SizeCallbackUserData;
1355 ImVec2 MenuBarOffsetMinVal;
1356 ImGuiWindowRefreshFlags RefreshFlagsVal;
1359 inline void ClearFlags() { HasFlags = ImGuiNextWindowDataFlags_None; }
1362 enum ImGuiNextItemDataFlags_
1364 ImGuiNextItemDataFlags_None = 0,
1365 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1366 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1367 ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
1368 ImGuiNextItemDataFlags_HasRefVal = 1 << 3,
1369 ImGuiNextItemDataFlags_HasStorageID = 1 << 4,
1370 ImGuiNextItemDataFlags_HasColorMarker = 1 << 5,
1375 ImGuiNextItemDataFlags HasFlags;
1376 ImGuiItemFlags ItemFlags;
1379 ImGuiID FocusScopeId;
1380 ImGuiSelectionUserData SelectionUserData;
1382 ImGuiKeyChord Shortcut;
1383 ImGuiInputFlags ShortcutFlags;
1390 ImGuiNextItemData() { memset((
void*)
this, 0,
sizeof(*
this)); SelectionUserData = -1; }
1391 inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; }
1398 ImGuiItemFlags ItemFlags;
1399 ImGuiItemStatusFlags StatusFlags;
1405 ImGuiKeyChord Shortcut;
1417 ImGuiTreeNodeFlags TreeFlags;
1418 ImGuiItemFlags ItemFlags;
1421 float DrawLinesToNodesY2;
1422 ImGuiTableColumnIdx DrawLinesTableColumn;
1428 short SizeOfWindowStack;
1429 short SizeOfIDStack;
1430 short SizeOfTreeStack;
1431 short SizeOfColorStack;
1432 short SizeOfStyleVarStack;
1433 short SizeOfFontStack;
1434 short SizeOfFocusScopeStack;
1435 short SizeOfGroupStack;
1436 short SizeOfItemFlagsStack;
1437 short SizeOfBeginPopupStack;
1438 short SizeOfDisabledStack;
1449 bool DisabledOverrideReenable;
1450 float DisabledOverrideReenableAlphaBackup;
1474 bool HasBeenEditedBefore;
1482 enum ImGuiPopupPositionPolicy
1484 ImGuiPopupPositionPolicy_Default,
1485 ImGuiPopupPositionPolicy_ComboBox,
1486 ImGuiPopupPositionPolicy_Tooltip,
1497 ImGuiID OpenParentId;
1501 ImGuiPopupData() { memset((
void*)
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1512 #define ImGuiKey_LegacyNativeKey_BEGIN 0 1513 #define ImGuiKey_LegacyNativeKey_END 512 1514 #define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN) 1515 #define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart) 1516 #define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart) 1517 #define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1) 1518 #define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft) 1519 #define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1) 1520 #define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN) 1521 #define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END) 1524 #define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl 1525 #define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift 1526 #define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1 1527 #define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1 1528 #define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown) 1529 #define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight) 1530 #define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft 1531 #define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp 1533 enum ImGuiInputEventType
1535 ImGuiInputEventType_None = 0,
1536 ImGuiInputEventType_MousePos,
1537 ImGuiInputEventType_MouseWheel,
1538 ImGuiInputEventType_MouseButton,
1539 ImGuiInputEventType_MouseViewport,
1540 ImGuiInputEventType_Key,
1541 ImGuiInputEventType_Text,
1542 ImGuiInputEventType_Focus,
1543 ImGuiInputEventType_COUNT
1546 enum ImGuiInputSource :
int 1548 ImGuiInputSource_None = 0,
1549 ImGuiInputSource_Mouse,
1550 ImGuiInputSource_Keyboard,
1551 ImGuiInputSource_Gamepad,
1552 ImGuiInputSource_COUNT
1567 ImGuiInputEventType
Type;
1568 ImGuiInputSource Source;
1580 bool AddedByTestEngine;
1586 #define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease. 1587 #define ImGuiKeyOwner_NoOwner ((ImGuiID)-1) // Require key to have no owner. 1590 typedef ImS16 ImGuiKeyRoutingIndex;
1595 ImGuiKeyRoutingIndex NextEntryIndex;
1597 ImU16 RoutingCurrScore;
1598 ImU16 RoutingNextScore;
1599 ImGuiID RoutingCurr;
1600 ImGuiID RoutingNext;
1602 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 0; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
1609 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1614 void Clear() {
for (
int n = 0; n < IM_COUNTOF(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1624 bool LockUntilRelease;
1626 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease =
false; }
1632 enum ImGuiInputFlagsPrivate_
1636 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1637 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1638 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1641 ImGuiInputFlags_RepeatUntilRelease = 1 << 4,
1642 ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5,
1643 ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6,
1644 ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7,
1648 ImGuiInputFlags_LockThisFrame = 1 << 20,
1649 ImGuiInputFlags_LockUntilRelease = 1 << 21,
1652 ImGuiInputFlags_CondHovered = 1 << 22,
1653 ImGuiInputFlags_CondActive = 1 << 23,
1654 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1657 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1658 ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
1659 ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
1660 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1661 ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
1662 ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
1663 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
1664 ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
1665 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
1666 ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
1667 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1668 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1680 bool PosToIndexConvert;
1681 ImS8 PosToIndexOffsetMin;
1682 ImS8 PosToIndexOffsetMax;
1692 float LossynessOffset;
1698 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1705 enum ImGuiActivateFlags_
1707 ImGuiActivateFlags_None = 0,
1708 ImGuiActivateFlags_PreferInput = 1 << 0,
1709 ImGuiActivateFlags_PreferTweak = 1 << 1,
1710 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1711 ImGuiActivateFlags_FromTabbing = 1 << 3,
1712 ImGuiActivateFlags_FromShortcut = 1 << 4,
1713 ImGuiActivateFlags_FromFocusApi = 1 << 5,
1717 enum ImGuiScrollFlags_
1719 ImGuiScrollFlags_None = 0,
1720 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1721 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1722 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1723 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1724 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1725 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1726 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1727 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1728 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1731 enum ImGuiNavRenderCursorFlags_
1733 ImGuiNavRenderCursorFlags_None = 0,
1734 ImGuiNavRenderCursorFlags_Compact = 1 << 1,
1735 ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2,
1736 ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
1737 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1738 ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None,
1739 ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact,
1740 ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw,
1741 ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding,
1746 enum ImGuiNavMoveFlags_
1748 ImGuiNavMoveFlags_None = 0,
1749 ImGuiNavMoveFlags_LoopX = 1 << 0,
1750 ImGuiNavMoveFlags_LoopY = 1 << 1,
1751 ImGuiNavMoveFlags_WrapX = 1 << 2,
1752 ImGuiNavMoveFlags_WrapY = 1 << 3,
1753 ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
1754 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1755 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1756 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1757 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1758 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1759 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1760 ImGuiNavMoveFlags_IsTabbing = 1 << 10,
1761 ImGuiNavMoveFlags_IsPageMove = 1 << 11,
1762 ImGuiNavMoveFlags_Activate = 1 << 12,
1763 ImGuiNavMoveFlags_NoSelect = 1 << 13,
1764 ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14,
1765 ImGuiNavMoveFlags_NoClearActiveId = 1 << 15,
1770 ImGuiNavLayer_Main = 0,
1771 ImGuiNavLayer_Menu = 1,
1780 ImGuiID FocusScopeId;
1782 ImGuiItemFlags ItemFlags;
1786 ImGuiSelectionUserData SelectionUserData;
1789 void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
1804 enum ImGuiTypingSelectFlags_
1806 ImGuiTypingSelectFlags_None = 0,
1807 ImGuiTypingSelectFlags_AllowBackspace = 1 << 0,
1808 ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1,
1814 ImGuiTypingSelectFlags Flags;
1815 int SearchBufferLen;
1816 const char* SearchBuffer;
1818 bool SingleCharMode;
1819 ImS8 SingleCharSize;
1826 char SearchBuffer[64];
1828 int LastRequestFrame = 0;
1829 float LastRequestTime = 0.0f;
1830 bool SingleCharModeLock =
false;
1833 void Clear() { SearchBuffer[0] = 0; SingleCharModeLock =
false; }
1841 enum ImGuiOldColumnFlags_
1843 ImGuiOldColumnFlags_None = 0,
1844 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1845 ImGuiOldColumnFlags_NoResize = 1 << 1,
1846 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1847 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1848 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1851 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1864 float OffsetNormBeforeResize;
1865 ImGuiOldColumnFlags Flags;
1874 ImGuiOldColumnFlags Flags;
1876 bool IsBeingResized;
1879 float OffMinX, OffMaxX;
1880 float LineMinY, LineMaxY;
1881 float HostCursorPosY;
1882 float HostCursorMaxPosX;
1883 ImRect HostInitialClipRect;
1884 ImRect HostBackupClipRect;
1885 ImRect HostBackupParentWorkRect;
1902 bool IsStartedFromVoid;
1903 bool IsStartedSetNavIdOnce;
1905 ImGuiKeyChord KeyMods : 16;
1914 ImRect BoxSelectRectPrev;
1915 ImRect BoxSelectRectCurr;
1925 #define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1) 1932 ImGuiID FocusScopeId;
1933 ImGuiMultiSelectFlags Flags;
1935 ImVec2 BackupCursorMaxPos;
1936 ImGuiSelectionUserData LastSubmittedItem;
1937 ImGuiID BoxSelectId;
1938 ImGuiKeyChord KeyMods;
1939 ImS8 LoopRequestSetAll;
1942 bool IsKeyboardSetRange;
1944 bool RangeSrcPassedBy;
1945 bool RangeDstPassedBy;
1948 void Clear() {
size_t io_sz =
sizeof(IO); ClearIO(); memset((
void*)(&IO + 1), 0,
sizeof(*
this) - io_sz); }
1949 void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset =
false; }
1957 int LastFrameActive;
1958 int LastSelectionSize;
1961 ImGuiSelectionUserData RangeSrcItem;
1962 ImGuiSelectionUserData NavIdItem;
1964 ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; }
1971 #define DOCKING_HOST_DRAW_CHANNEL_BG 0 // Dock host: background fill 1972 #define DOCKING_HOST_DRAW_CHANNEL_FG 1 // Dock host: decorations and contents 1974 #ifdef IMGUI_HAS_DOCK 1977 enum ImGuiDockNodeFlagsPrivate_
1980 ImGuiDockNodeFlags_DockSpace = 1 << 10,
1981 ImGuiDockNodeFlags_CentralNode = 1 << 11,
1982 ImGuiDockNodeFlags_NoTabBar = 1 << 12,
1983 ImGuiDockNodeFlags_HiddenTabBar = 1 << 13,
1984 ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14,
1985 ImGuiDockNodeFlags_NoCloseButton = 1 << 15,
1986 ImGuiDockNodeFlags_NoResizeX = 1 << 16,
1987 ImGuiDockNodeFlags_NoResizeY = 1 << 17,
1988 ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18,
1993 ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 19,
1994 ImGuiDockNodeFlags_NoDockingOverMe = 1 << 20,
1995 ImGuiDockNodeFlags_NoDockingOverOther = 1 << 21,
1996 ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 22,
1997 ImGuiDockNodeFlags_NoDocking = ImGuiDockNodeFlags_NoDockingOverMe | ImGuiDockNodeFlags_NoDockingOverOther | ImGuiDockNodeFlags_NoDockingOverEmpty | ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoDockingSplitOther,
2000 ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0,
2001 ImGuiDockNodeFlags_NoResizeFlagsMask_ = (int)ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeY,
2004 ImGuiDockNodeFlags_LocalFlagsTransferMask_ = (
int)ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | (int)ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
2005 ImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
2009 enum ImGuiDataAuthority_
2011 ImGuiDataAuthority_Auto,
2012 ImGuiDataAuthority_DockNode,
2013 ImGuiDataAuthority_Window,
2016 enum ImGuiDockNodeState
2018 ImGuiDockNodeState_Unknown,
2019 ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow,
2020 ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing,
2021 ImGuiDockNodeState_HostWindowVisible,
2028 ImGuiDockNodeFlags SharedFlags;
2029 ImGuiDockNodeFlags LocalFlags;
2030 ImGuiDockNodeFlags LocalFlagsInWindows;
2031 ImGuiDockNodeFlags MergedFlags;
2032 ImGuiDockNodeState State;
2040 ImGuiAxis SplitAxis;
2048 int CountNodeWithWindows;
2050 int LastFrameActive;
2051 int LastFrameFocused;
2052 ImGuiID LastFocusedNodeId;
2053 ImGuiID SelectedTabId;
2054 ImGuiID WantCloseTabId;
2055 ImGuiID RefViewportId;
2056 ImGuiDataAuthority AuthorityForPos :3;
2057 ImGuiDataAuthority AuthorityForSize :3;
2058 ImGuiDataAuthority AuthorityForViewport :3;
2061 bool IsBgDrawnThisFrame :1;
2062 bool HasCloseButton :1;
2063 bool HasWindowMenuButton :1;
2064 bool HasCentralNodeChild :1;
2065 bool WantCloseAll :1;
2066 bool WantLockSizeOnce :1;
2067 bool WantMouseMove :1;
2068 bool WantHiddenTabBarUpdate :1;
2069 bool WantHiddenTabBarToggle :1;
2073 bool IsRootNode()
const {
return ParentNode == NULL; }
2074 bool IsDockSpace()
const {
return (MergedFlags & ImGuiDockNodeFlags_DockSpace) != 0; }
2075 bool IsFloatingNode()
const {
return ParentNode == NULL && (MergedFlags & ImGuiDockNodeFlags_DockSpace) == 0; }
2076 bool IsCentralNode()
const {
return (MergedFlags & ImGuiDockNodeFlags_CentralNode) != 0; }
2077 bool IsHiddenTabBar()
const {
return (MergedFlags & ImGuiDockNodeFlags_HiddenTabBar) != 0; }
2078 bool IsNoTabBar()
const {
return (MergedFlags & ImGuiDockNodeFlags_NoTabBar) != 0; }
2079 bool IsSplitNode()
const {
return ChildNodes[0] != NULL; }
2080 bool IsLeafNode()
const {
return ChildNodes[0] == NULL; }
2081 bool IsEmpty()
const {
return ChildNodes[0] == NULL && Windows.Size == 0; }
2082 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2084 void SetLocalFlags(ImGuiDockNodeFlags flags) { LocalFlags = flags; UpdateMergedFlags(); }
2085 void UpdateMergedFlags() { MergedFlags = SharedFlags | LocalFlags | LocalFlagsInWindows; }
2092 enum ImGuiWindowDockStyleCol
2094 ImGuiWindowDockStyleCol_Text,
2095 ImGuiWindowDockStyleCol_TabHovered,
2096 ImGuiWindowDockStyleCol_TabFocused,
2097 ImGuiWindowDockStyleCol_TabSelected,
2098 ImGuiWindowDockStyleCol_TabSelectedOverline,
2099 ImGuiWindowDockStyleCol_TabDimmed,
2100 ImGuiWindowDockStyleCol_TabDimmedSelected,
2101 ImGuiWindowDockStyleCol_TabDimmedSelectedOverline,
2102 ImGuiWindowDockStyleCol_UnsavedMarker,
2103 ImGuiWindowDockStyleCol_COUNT
2109 ImU32 Colors[ImGuiWindowDockStyleCol_COUNT];
2117 bool WantFullRebuild;
2121 #endif // #ifdef IMGUI_HAS_DOCK 2133 int LastFrameActive;
2134 int LastFocusedStampCount;
2135 ImGuiID LastNameHash;
2140 bool LastFocusedHadNavWindow;
2141 short PlatformMonitor;
2142 int BgFgDrawListsLastFrame[2];
2156 ImVec2 BuildWorkInsetMin;
2157 ImVec2 BuildWorkInsetMax;
2159 ImGuiViewportP() { Window = NULL; Idx = -1; LastFrameActive = BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = LastFocusedStampCount = -1; LastNameHash = 0; Alpha = LastAlpha = 1.0f; LastFocusedHadNavWindow =
false; PlatformMonitor = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; LastPlatformPos = LastPlatformSize = LastRendererSize =
ImVec2(FLT_MAX, FLT_MAX); }
2160 ~
ImGuiViewportP() {
if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]);
if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
2161 void ClearRequestFlags() { PlatformRequestClose = PlatformRequestMove = PlatformRequestResize =
false; }
2164 ImVec2 CalcWorkRectPos(
const ImVec2& inset_min)
const {
return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
2165 ImVec2 CalcWorkRectSize(
const ImVec2& inset_min,
const ImVec2& inset_max)
const {
return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y - inset_max.y)); }
2166 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); }
2169 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2170 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
2171 ImRect GetBuildWorkRect()
const {
ImVec2 pos = CalcWorkRectPos(BuildWorkInsetMin);
ImVec2 size = CalcWorkRectSize(BuildWorkInsetMin, BuildWorkInsetMax);
return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
2197 char* GetName() {
return (
char*)(
this + 1); }
2202 const char* TypeName;
2220 enum ImGuiLocKey :
int 2222 ImGuiLocKey_VersionStr,
2223 ImGuiLocKey_TableSizeOne,
2224 ImGuiLocKey_TableSizeAllFit,
2225 ImGuiLocKey_TableSizeAllDefault,
2226 ImGuiLocKey_TableResetOrder,
2227 ImGuiLocKey_WindowingMainMenuBar,
2228 ImGuiLocKey_WindowingPopup,
2229 ImGuiLocKey_WindowingUntitled,
2230 ImGuiLocKey_OpenLink_s,
2231 ImGuiLocKey_CopyLink,
2232 ImGuiLocKey_DockingHideTabBar,
2233 ImGuiLocKey_DockingHoldShiftToDock,
2234 ImGuiLocKey_DockingDragToUndockOrMoveNode,
2253 #ifndef IM_ASSERT_USER_ERROR 2254 #define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR)) { if (ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } } while (0) // Recoverable User Error 2255 #define IM_ASSERT_USER_ERROR_RET(_EXPR,_MSG) do { if (!(_EXPR)) { if (ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } return; } } while (0) // Recoverable User Error 2256 #define IM_ASSERT_USER_ERROR_RETV(_EXPR,_RETV,_MSG) do { if (!(_EXPR)) { if (ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } return _RETV; } } while (0) // Recoverable User Error 2260 typedef void (*ImGuiErrorCallback)(
ImGuiContext* ctx,
void* user_data,
const char* msg);
2267 enum ImGuiDebugLogFlags_
2270 ImGuiDebugLogFlags_None = 0,
2271 ImGuiDebugLogFlags_EventError = 1 << 0,
2272 ImGuiDebugLogFlags_EventActiveId = 1 << 1,
2273 ImGuiDebugLogFlags_EventFocus = 1 << 2,
2274 ImGuiDebugLogFlags_EventPopup = 1 << 3,
2275 ImGuiDebugLogFlags_EventNav = 1 << 4,
2276 ImGuiDebugLogFlags_EventClipper = 1 << 5,
2277 ImGuiDebugLogFlags_EventSelection = 1 << 6,
2278 ImGuiDebugLogFlags_EventIO = 1 << 7,
2279 ImGuiDebugLogFlags_EventFont = 1 << 8,
2280 ImGuiDebugLogFlags_EventInputRouting = 1 << 9,
2281 ImGuiDebugLogFlags_EventDocking = 1 << 10,
2282 ImGuiDebugLogFlags_EventViewport = 1 << 11,
2284 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
2285 ImGuiDebugLogFlags_OutputToTTY = 1 << 20,
2286 ImGuiDebugLogFlags_OutputToDebugger = 1 << 21,
2287 ImGuiDebugLogFlags_OutputToTestEngine = 1 << 22,
2299 int TotalAllocCount;
2301 ImS16 LastEntriesIdx;
2309 bool ShowDebugLog =
false;
2310 bool ShowIDStackTool =
false;
2311 bool ShowWindowsRects =
false;
2312 bool ShowWindowsBeginOrder =
false;
2313 bool ShowTablesRects =
false;
2314 bool ShowDrawCmdMesh =
true;
2315 bool ShowDrawCmdBoundingBoxes =
true;
2316 bool ShowTextEncodingViewer =
false;
2317 bool ShowTextureUsedRect =
false;
2318 bool ShowDockingNodes =
false;
2319 int ShowWindowsRectsType = -1;
2320 int ShowTablesRectsType = -1;
2321 int HighlightMonitorIdx = -1;
2322 ImGuiID HighlightViewportID = 0;
2323 bool ShowFontPreview =
true;
2329 ImS8 QueryFrameCount;
2334 ImGuiStackLevelInfo() { memset((
void*)
this, 0,
sizeof(*
this)); DataType = -1; DescOffset = -1; }
2353 bool OptHexEncodeNonAsciiChars;
2354 bool OptCopyToClipboardOnCtrlC;
2355 int LastActiveFrame;
2356 float CopyToClipboardLastTime;
2358 ImGuiIDStackTool() { memset((
void*)
this, 0,
sizeof(*
this)); LastActiveFrame = -1; OptHexEncodeNonAsciiChars =
true; CopyToClipboardLastTime = -FLT_MAX; }
2366 enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
2371 ImGuiContextHookType
Type;
2373 ImGuiContextHookCallback Callback;
2386 bool WithinFrameScope;
2387 bool WithinFrameScopeWithImplicitWindow;
2388 bool TestEngineHookItems;
2390 int FrameCountEnded;
2391 int FrameCountPlatformEnded;
2392 int FrameCountRendered;
2394 char ContextName[16];
2398 ImGuiConfigFlags ConfigFlagsCurrFrame;
2399 ImGuiConfigFlags ConfigFlagsLastFrame;
2405 float FontBakedScale;
2406 float FontRasterizerDensity;
2407 float CurrentDpiScale;
2409 ImGuiID WithinEndChildID;
2415 ImGuiMouseSource InputEventsNextMouseSource;
2416 ImU32 InputEventsNextEventId;
2424 int WindowsActiveCount;
2425 float WindowsBorderHoverPadding;
2426 ImGuiID DebugBreakInWindow;
2433 ImVec2 WheelingWindowRefMousePos;
2434 int WheelingWindowStartFrame;
2435 int WheelingWindowScrolledFrame;
2436 float WheelingWindowReleaseTimer;
2437 ImVec2 WheelingWindowWheelRemainder;
2441 ImGuiID DebugDrawIdConflictsId;
2442 ImGuiID DebugHookIdInfoId;
2444 ImGuiID HoveredIdPreviousFrame;
2445 int HoveredIdPreviousFrameItemCount;
2446 float HoveredIdTimer;
2447 float HoveredIdNotActiveTimer;
2448 bool HoveredIdAllowOverlap;
2449 bool HoveredIdIsDisabled;
2450 bool ItemUnclipByLog;
2452 ImGuiID ActiveIdIsAlive;
2453 float ActiveIdTimer;
2454 bool ActiveIdIsJustActivated;
2455 bool ActiveIdAllowOverlap;
2456 bool ActiveIdNoClearOnFocusLoss;
2457 bool ActiveIdHasBeenPressedBefore;
2458 bool ActiveIdHasBeenEditedBefore;
2459 bool ActiveIdHasBeenEditedThisFrame;
2460 bool ActiveIdFromShortcut;
2461 ImS8 ActiveIdMouseButton;
2462 ImGuiID ActiveIdDisabledId;
2463 ImVec2 ActiveIdClickOffset;
2464 ImGuiInputSource ActiveIdSource;
2466 ImGuiID ActiveIdPreviousFrame;
2469 ImGuiID LastActiveId;
2470 float LastActiveIdTimer;
2476 double LastKeyModsChangeTime;
2477 double LastKeyModsChangeFromNoneTime;
2478 double LastKeyboardKeyPressTime;
2479 ImBitArrayForNamedKeys KeysMayBeCharInput;
2482 ImU32 ActiveIdUsingNavDirMask;
2483 bool ActiveIdUsingAllKeyboardKeys;
2484 ImGuiKeyChord DebugBreakInShortcutRouting;
2488 ImGuiID CurrentFocusScopeId;
2489 ImGuiItemFlags CurrentItemFlags;
2490 ImGuiID DebugLocateId;
2494 bool DebugShowGroupRects;
2498 ImGuiCol DebugFlashStyleColorIdx;
2514 ImGuiID PlatformLastFocusedViewportId;
2516 ImRect PlatformMonitorsFullWorkRect;
2517 int ViewportCreatedCount;
2518 int PlatformWindowsCreatedCount;
2519 int ViewportFocusedStampCount;
2522 bool NavCursorVisible;
2523 bool NavHighlightItemUnderNav;
2526 bool NavMousePosDirty;
2530 ImGuiID NavFocusScopeId;
2531 ImGuiNavLayer NavLayer;
2532 ImGuiID NavActivateId;
2533 ImGuiID NavActivateDownId;
2534 ImGuiID NavActivatePressedId;
2535 ImGuiActivateFlags NavActivateFlags;
2537 ImGuiID NavHighlightActivatedId;
2538 float NavHighlightActivatedTimer;
2539 ImGuiID NavNextActivateId;
2540 ImGuiActivateFlags NavNextActivateFlags;
2541 ImGuiInputSource NavInputSource;
2542 ImGuiSelectionUserData NavLastValidSelectionUserData;
2543 ImS8 NavCursorHideFrames;
2548 bool NavInitRequest;
2549 bool NavInitRequestFromMove;
2551 bool NavMoveSubmitted;
2552 bool NavMoveScoringItems;
2553 bool NavMoveForwardToNextFrame;
2554 ImGuiNavMoveFlags NavMoveFlags;
2555 ImGuiScrollFlags NavMoveScrollFlags;
2556 ImGuiKeyChord NavMoveKeyMods;
2557 ImGuiDir NavMoveDir;
2558 ImGuiDir NavMoveDirForDebug;
2559 ImGuiDir NavMoveClipDir;
2561 ImRect NavScoringNoClipRect;
2562 int NavScoringDebugCount;
2564 int NavTabbingCounter;
2571 ImGuiID NavJustMovedFromFocusScopeId;
2572 ImGuiID NavJustMovedToId;
2573 ImGuiID NavJustMovedToFocusScopeId;
2574 ImGuiKeyChord NavJustMovedToKeyMods;
2575 bool NavJustMovedToIsTabbing;
2576 bool NavJustMovedToHasSelectionData;
2581 bool ConfigNavEnableTabbing;
2582 bool ConfigNavWindowingWithGamepad;
2583 ImGuiKeyChord ConfigNavWindowingKeyNext;
2584 ImGuiKeyChord ConfigNavWindowingKeyPrev;
2590 float NavWindowingTimer;
2591 float NavWindowingHighlightAlpha;
2592 ImGuiInputSource NavWindowingInputSource;
2593 bool NavWindowingToggleLayer;
2594 ImGuiKey NavWindowingToggleKey;
2595 ImVec2 NavWindowingAccumDeltaPos;
2596 ImVec2 NavWindowingAccumDeltaSize;
2602 bool DragDropActive;
2603 bool DragDropWithinSource;
2604 bool DragDropWithinTarget;
2605 ImGuiDragDropFlags DragDropSourceFlags;
2606 int DragDropSourceFrameCount;
2607 int DragDropMouseButton;
2609 ImRect DragDropTargetRect;
2610 ImRect DragDropTargetClipRect;
2611 ImGuiID DragDropTargetId;
2612 ImGuiID DragDropTargetFullViewport;
2613 ImGuiDragDropFlags DragDropAcceptFlagsCurr;
2614 ImGuiDragDropFlags DragDropAcceptFlagsPrev;
2615 float DragDropAcceptIdCurrRectSurface;
2616 ImGuiID DragDropAcceptIdCurr;
2617 ImGuiID DragDropAcceptIdPrev;
2618 int DragDropAcceptFrameCount;
2619 ImGuiID DragDropHoldJustPressedId;
2621 unsigned char DragDropPayloadBufLocal[16];
2624 int ClipperTempDataStacked;
2629 ImGuiID DebugBreakInTable;
2630 int TablesTempDataStacked;
2645 int MultiSelectTempDataStacked;
2650 ImGuiID HoverItemDelayId;
2651 ImGuiID HoverItemDelayIdPreviousFrame;
2652 float HoverItemDelayTimer;
2653 float HoverItemDelayClearTimer;
2654 ImGuiID HoverItemUnlockedStationaryId;
2655 ImGuiID HoverWindowUnlockedStationaryId;
2658 ImGuiMouseCursor MouseCursor;
2659 float MouseStationaryTimer;
2660 ImVec2 MouseLastValidPos;
2667 ImFontFlags InputTextPasswordFontBackupFlags;
2668 ImGuiID TempInputId;
2671 int BeginComboDepth;
2672 ImGuiColorEditFlags ColorEditOptions;
2673 ImGuiID ColorEditCurrentID;
2674 ImGuiID ColorEditSavedID;
2675 float ColorEditSavedHue;
2676 float ColorEditSavedSat;
2677 ImU32 ColorEditSavedColor;
2680 ImRect WindowResizeBorderExpectedRect;
2681 bool WindowResizeRelativeMode;
2682 short ScrollbarSeekMode;
2683 float ScrollbarClickDeltaToGrabCenter;
2684 float SliderGrabClickOffset;
2685 float SliderCurrentAccum;
2686 bool SliderCurrentAccumDirty;
2687 bool DragCurrentAccumDirty;
2688 float DragCurrentAccum;
2689 float DragSpeedDefaultRatio;
2690 float DisabledAlphaBackup;
2691 short DisabledStackSize;
2692 short TooltipOverrideCount;
2709 bool SettingsLoaded;
2710 float SettingsDirtyTimer;
2719 const char* LocalizationTable[ImGuiLocKey_COUNT];
2723 bool LogLineFirstItem;
2724 ImGuiLogFlags LogFlags;
2726 ImFileHandle LogFile;
2728 const char* LogNextPrefix;
2729 const char* LogNextSuffix;
2732 int LogDepthToExpand;
2733 int LogDepthToExpandDefault;
2736 ImGuiErrorCallback ErrorCallback;
2737 void* ErrorCallbackUserData;
2738 ImVec2 ErrorTooltipLockedPos;
2740 int ErrorCountCurrentFrame;
2746 int DebugDrawIdConflictsCount;
2747 ImGuiDebugLogFlags DebugLogFlags;
2750 int DebugLogSkippedErrors;
2751 ImGuiDebugLogFlags DebugLogAutoDisableFlags;
2752 ImU8 DebugLogAutoDisableFrames;
2753 ImU8 DebugLocateFrames;
2754 bool DebugBreakInLocateId;
2755 ImGuiKeyChord DebugBreakKeyChord;
2756 ImS8 DebugBeginReturnValueCullDepth;
2757 bool DebugItemPickerActive;
2758 ImU8 DebugItemPickerMouseButton;
2759 ImGuiID DebugItemPickerBreakId;
2760 float DebugFlashStyleColorTime;
2761 ImVec4 DebugFlashStyleColorBackup;
2767 #if defined(IMGUI_DEBUG_HIGHLIGHT_ALL_ID_CONFLICTS) && !defined(IMGUI_DISABLE_DEBUG_TOOLS) 2773 float FramerateSecPerFrame[60];
2774 int FramerateSecPerFrameIdx;
2775 int FramerateSecPerFrameCount;
2776 float FramerateSecPerFrameAccum;
2777 int WantCaptureMouseNextFrame;
2778 int WantCaptureKeyboardNextFrame;
2779 int WantTextInputNextFrame;
2781 char TempKeychordName[64];
2791 #define IMGUI_WINDOW_HARD_MIN_SIZE 4.0f 2800 ImVec2 CursorPosPrevLine;
2806 float CurrLineTextBaseOffset;
2807 float PrevLineTextBaseOffset;
2813 ImVec2 CursorStartPosLossyness;
2816 ImGuiNavLayer NavLayerCurrent;
2817 short NavLayersActiveMask;
2818 short NavLayersActiveMaskNext;
2819 bool NavIsScrollPushableX;
2820 bool NavHideHighlightOneFrame;
2821 bool NavWindowHasScrollY;
2824 bool MenuBarAppending;
2828 ImU32 TreeHasStackDataDepthMask;
2829 ImU32 TreeRecordsClippedNodesY2Mask;
2833 int CurrentTableIdx;
2834 ImGuiLayoutType LayoutType;
2835 ImGuiLayoutType ParentLayoutType;
2836 ImU32 ModalDimBgColor;
2839 ImGuiItemStatusFlags WindowItemStatusFlags;
2840 ImGuiItemStatusFlags ChildItemStatusFlags;
2841 ImGuiItemStatusFlags DockTabItemStatusFlags;
2847 float ItemWidthDefault;
2859 ImGuiWindowFlags Flags, FlagsPreviousFrame;
2860 ImGuiChildFlags ChildFlags;
2865 int ViewportAllowPlatformMonitorExtend;
2871 ImVec2 ContentSizeExplicit;
2873 float WindowRounding;
2874 float WindowBorderSize;
2875 float TitleBarHeight, MenuBarHeight;
2876 float DecoOuterSizeX1, DecoOuterSizeY1;
2877 float DecoOuterSizeX2, DecoOuterSizeY2;
2878 float DecoInnerSizeX1, DecoInnerSizeY1;
2887 ImVec2 ScrollTargetCenterRatio;
2888 ImVec2 ScrollTargetEdgeSnapDist;
2890 bool ScrollbarX, ScrollbarY;
2891 bool ScrollbarXStabilizeEnabled;
2892 ImU8 ScrollbarXStabilizeToggledHistory;
2898 bool WantCollapseToggle;
2903 bool IsFallbackWindow;
2904 bool IsExplicitChild;
2905 bool HasCloseButton;
2906 signed char ResizeBorderHovered;
2907 signed char ResizeBorderHeld;
2909 short BeginCountPreviousFrame;
2910 short BeginOrderWithinParent;
2911 short BeginOrderWithinContext;
2913 ImGuiDir AutoPosLastDirection;
2914 ImS8 AutoFitFramesX, AutoFitFramesY;
2915 bool AutoFitOnlyGrows;
2916 ImS8 HiddenFramesCanSkipItems;
2917 ImS8 HiddenFramesCannotSkipItems;
2918 ImS8 HiddenFramesForRenderOnly;
2919 ImS8 DisableInputsFrames;
2920 ImGuiWindowBgClickFlags BgClickFlags : 8;
2921 ImGuiCond SetWindowPosAllowFlags : 8;
2922 ImGuiCond SetWindowSizeAllowFlags : 8;
2923 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2924 ImGuiCond SetWindowDockAllowFlags : 8;
2926 ImVec2 SetWindowPosPivot;
2939 ImRect ContentRegionRect;
2943 int LastFrameActive;
2944 int LastFrameJustFocused;
2945 float LastTimeActive;
2948 float FontWindowScale;
2949 float FontWindowScaleParents;
2965 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2966 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2967 ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT];
2968 ImGuiID NavRootFocusScopeId;
2970 int MemoryDrawListIdxCapacity;
2971 int MemoryDrawListVtxCapacity;
2972 bool MemoryCompacted;
2975 bool DockIsActive :1;
2976 bool DockNodeIsVisible :1;
2977 bool DockTabIsVisible :1;
2978 bool DockTabWantClose :1;
2989 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2990 ImGuiID GetID(
const void* ptr);
2991 ImGuiID GetID(
int n);
2992 ImGuiID GetIDFromPos(
const ImVec2& p_abs);
2993 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2996 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2997 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); }
2998 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight;
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); }
3009 enum ImGuiTabBarFlagsPrivate_
3011 ImGuiTabBarFlags_DockNode = 1 << 20,
3012 ImGuiTabBarFlags_IsFocused = 1 << 21,
3013 ImGuiTabBarFlags_SaveSettings = 1 << 22,
3017 enum ImGuiTabItemFlagsPrivate_
3019 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
3020 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
3021 ImGuiTabItemFlags_Button = 1 << 21,
3022 ImGuiTabItemFlags_Invisible = 1 << 22,
3023 ImGuiTabItemFlags_Unsorted = 1 << 23,
3030 ImGuiTabItemFlags Flags;
3032 int LastFrameVisible;
3033 int LastFrameSelected;
3037 float RequestedWidth;
3040 ImS16 IndexDuringLayout;
3043 ImGuiTabItem() { memset((
void*)
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
3051 ImGuiTabBarFlags Flags;
3053 ImGuiID SelectedTabId;
3054 ImGuiID NextSelectedTabId;
3055 ImGuiID NextScrollToTabId;
3056 ImGuiID VisibleTabId;
3057 int CurrFrameVisible;
3058 int PrevFrameVisible;
3060 float BarRectPrevWidth;
3061 float CurrTabsContentsHeight;
3062 float PrevTabsContentsHeight;
3064 float WidthAllTabsIdeal;
3065 float ScrollingAnim;
3066 float ScrollingTarget;
3067 float ScrollingTargetDistToVisibility;
3068 float ScrollingSpeed;
3069 float ScrollingRectMinX;
3070 float ScrollingRectMaxX;
3071 float SeparatorMinX;
3072 float SeparatorMaxX;
3073 ImGuiID ReorderRequestTabId;
3074 ImS16 ReorderRequestOffset;
3077 bool VisibleTabWasSubmitted;
3079 bool ScrollButtonEnabled;
3080 ImS16 TabsActiveCount;
3081 ImS16 LastTabItemIdx;
3094 #define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color. 3095 #define IMGUI_TABLE_MAX_COLUMNS 512 // Arbitrary "safety" maximum, may be lifted in the future if needed. Must fit in ImGuiTableColumnIdx/ImGuiTableDrawChannelIdx. 3103 ImGuiTableColumnFlags Flags;
3110 float StretchWeight;
3111 float InitStretchWeightOrWidth;
3117 float ContentMaxXFrozen;
3118 float ContentMaxXUnfrozen;
3119 float ContentMaxXHeadersUsed;
3120 float ContentMaxXHeadersIdeal;
3122 ImGuiTableColumnIdx DisplayOrder;
3123 ImGuiTableColumnIdx IndexWithinEnabledSet;
3124 ImGuiTableColumnIdx PrevEnabledColumn;
3125 ImGuiTableColumnIdx NextEnabledColumn;
3126 ImGuiTableColumnIdx SortOrder;
3127 ImGuiTableDrawChannelIdx DrawChannelCurrent;
3128 ImGuiTableDrawChannelIdx DrawChannelFrozen;
3129 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
3132 bool IsUserEnabledNextFrame;
3135 bool IsRequestOutput;
3137 bool IsPreserveWidthAuto;
3138 ImS8 NavLayerCurrent;
3140 ImU8 CannotSkipItemsQueue;
3141 ImU8 SortDirection : 2;
3142 ImU8 SortDirectionsAvailCount : 2;
3143 ImU8 SortDirectionsAvailMask : 4;
3144 ImU8 SortDirectionsAvailList;
3148 memset((
void*)
this, 0,
sizeof(*
this));
3149 StretchWeight = WidthRequest = -1.0f;
3151 DisplayOrder = IndexWithinEnabledSet = -1;
3152 PrevEnabledColumn = NextEnabledColumn = -1;
3154 SortDirection = ImGuiSortDirection_None;
3155 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
3164 ImGuiTableColumnIdx Column;
3172 ImGuiTableColumnIdx Index;
3182 ImGuiID TableInstanceID;
3183 float LastOuterHeight;
3184 float LastTopHeadersRowHeight;
3185 float LastFrozenHeight;
3189 ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
3196 ImGuiTableFlags Flags;
3202 ImBitArrayPtr EnabledMaskByDisplayOrder;
3203 ImBitArrayPtr EnabledMaskByIndex;
3204 ImBitArrayPtr VisibleMaskByIndex;
3205 ImGuiTableFlags SettingsLoadedFlags;
3207 int LastFrameActive;
3211 ImS16 InstanceCurrent;
3212 ImS16 InstanceInteracted;
3216 float RowCellPaddingY;
3217 float RowTextBaseline;
3218 float RowIndentOffsetX;
3219 ImGuiTableRowFlags RowFlags : 16;
3220 ImGuiTableRowFlags LastRowFlags : 16;
3221 int RowBgColorCounter;
3222 ImU32 RowBgColor[2];
3223 ImU32 BorderColorStrong;
3224 ImU32 BorderColorLight;
3228 float MinColumnWidth;
3229 float OuterPaddingX;
3231 float CellSpacingX1;
3232 float CellSpacingX2;
3234 float ColumnsGivenWidth;
3235 float ColumnsAutoFitWidth;
3236 float ColumnsStretchSumWeights;
3237 float ResizedColumnNextWidth;
3238 float ResizeLockMinContentsX2;
3240 float AngledHeadersHeight;
3241 float AngledHeadersSlope;
3247 ImRect Bg0ClipRectForDrawCmd;
3248 ImRect Bg2ClipRectForDrawCmd;
3250 ImRect HostBackupInnerClipRect;
3260 ImGuiTableColumnIdx SortSpecsCount;
3261 ImGuiTableColumnIdx ColumnsEnabledCount;
3262 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
3263 ImGuiTableColumnIdx DeclColumnsCount;
3264 ImGuiTableColumnIdx AngledHeadersCount;
3265 ImGuiTableColumnIdx HoveredColumnBody;
3266 ImGuiTableColumnIdx HoveredColumnBorder;
3267 ImGuiTableColumnIdx HighlightColumnHeader;
3268 ImGuiTableColumnIdx AutoFitSingleColumn;
3269 ImGuiTableColumnIdx ResizedColumn;
3270 ImGuiTableColumnIdx LastResizedColumn;
3271 ImGuiTableColumnIdx HeldHeaderColumn;
3272 ImGuiTableColumnIdx ReorderColumn;
3273 ImGuiTableColumnIdx ReorderColumnDir;
3274 ImGuiTableColumnIdx LeftMostEnabledColumn;
3275 ImGuiTableColumnIdx RightMostEnabledColumn;
3276 ImGuiTableColumnIdx LeftMostStretchedColumn;
3277 ImGuiTableColumnIdx RightMostStretchedColumn;
3278 ImGuiTableColumnIdx ContextPopupColumn;
3279 ImGuiTableColumnIdx FreezeRowsRequest;
3280 ImGuiTableColumnIdx FreezeRowsCount;
3281 ImGuiTableColumnIdx FreezeColumnsRequest;
3282 ImGuiTableColumnIdx FreezeColumnsCount;
3283 ImGuiTableColumnIdx RowCellDataCurrent;
3284 ImGuiTableDrawChannelIdx DummyDrawChannel;
3285 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
3286 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
3288 bool IsLayoutLocked;
3290 bool IsInitializing;
3291 bool IsSortSpecsDirty;
3292 bool IsUsingHeaders;
3293 bool IsContextPopupOpen;
3294 bool DisableDefaultContextMenu;
3295 bool IsSettingsRequestLoad;
3296 bool IsSettingsDirty;
3297 bool IsDefaultDisplayOrder;
3298 bool IsResetAllRequest;
3299 bool IsResetDisplayOrderRequest;
3300 bool IsUnfrozenRows;
3301 bool IsDefaultSizingPolicy;
3302 bool IsActiveIdAliveBeforeTable;
3303 bool IsActiveIdInTable;
3304 bool HasScrollbarYCurr;
3305 bool HasScrollbarYPrev;
3306 bool MemoryCompacted;
3309 ImGuiTable() { memset((
void*)
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
3322 float LastTimeActive;
3323 float AngledHeadersExtraWidth;
3329 ImRect HostBackupWorkRect;
3330 ImRect HostBackupParentWorkRect;
3331 ImVec2 HostBackupPrevLineSize;
3332 ImVec2 HostBackupCurrLineSize;
3333 ImVec2 HostBackupCursorMaxPos;
3334 ImVec1 HostBackupColumnsOffset;
3335 float HostBackupItemWidth;
3336 int HostBackupItemWidthStackSize;
3338 ImGuiTableTempData() { memset((
void*)
this, 0,
sizeof(*
this)); LastTimeActive = -1.0f; }
3344 float WidthOrWeight;
3346 ImGuiTableColumnIdx Index;
3347 ImGuiTableColumnIdx DisplayOrder;
3348 ImGuiTableColumnIdx SortOrder;
3349 ImU8 SortDirection : 2;
3355 WidthOrWeight = 0.0f;
3358 DisplayOrder = SortOrder = -1;
3359 SortDirection = ImGuiSortDirection_None;
3369 ImGuiTableFlags SaveFlags;
3371 ImGuiTableColumnIdx ColumnsCount;
3372 ImGuiTableColumnIdx ColumnsCountMax;
3393 inline float GetScale() {
ImGuiContext& g = *GImGui;
return g.Style._MainScale; }
3395 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
3396 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
3397 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
3398 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
3399 IMGUI_API
void UpdateWindowSkipRefresh(
ImGuiWindow* window);
3401 IMGUI_API
bool IsWindowChildOf(
ImGuiWindow* window,
ImGuiWindow* potential_parent,
bool popup_hierarchy,
bool dock_hierarchy);
3402 IMGUI_API
bool IsWindowInBeginStack(
ImGuiWindow* window);
3405 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
3406 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
3407 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
3408 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
3410 IMGUI_API
void SetWindowHiddenAndSkipItemsForCurrentFrame(
ImGuiWindow* window);
3411 inline void SetWindowParentWindowForFocusRoute(
ImGuiWindow* window,
ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
3412 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); }
3413 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); }
3418 IMGUI_API
void FocusWindow(
ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
3420 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
3421 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
3422 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
3424 IMGUI_API
int FindWindowDisplayIndex(
ImGuiWindow* window);
3428 IMGUI_API
void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
3433 IMGUI_API
void RegisterFontAtlas(
ImFontAtlas* atlas);
3434 IMGUI_API
void UnregisterFontAtlas(
ImFontAtlas* atlas);
3435 IMGUI_API
void SetCurrentFont(
ImFont* font,
float font_size_before_scaling,
float font_size_after_scaling);
3436 IMGUI_API
void UpdateCurrentFontSize(
float restore_font_size_after_scaling);
3437 IMGUI_API
void SetFontRasterizerDensity(
float rasterizer_density);
3438 inline float GetFontRasterizerDensity() {
return GImGui->FontRasterizerDensity; }
3439 inline float GetRoundedFontSize(
float size) {
return IM_ROUND(size); }
3440 IMGUI_API
ImFont* GetDefaultFont();
3441 IMGUI_API
void PushPasswordFont();
3442 IMGUI_API
void PopPasswordFont();
3443 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) {
return GetForegroundDrawList(window->Viewport); }
3447 IMGUI_API
void Initialize();
3448 IMGUI_API
void Shutdown();
3451 IMGUI_API
void SetContextName(
ImGuiContext* ctx,
const char* name);
3453 IMGUI_API
void RemoveContextHook(
ImGuiContext* ctx, ImGuiID hook_to_remove);
3454 IMGUI_API
void CallContextHooks(
ImGuiContext* ctx, ImGuiContextHookType type);
3457 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
3458 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags(
const ImVec2& mouse_pos);
3459 IMGUI_API
void FindHoveredWindowEx(
const ImVec2& pos,
bool find_first_and_in_any_viewport,
ImGuiWindow** out_hovered_window,
ImGuiWindow** out_hovered_window_under_moving_window);
3460 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
3462 IMGUI_API
void StopMouseMovingWindow();
3463 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
3464 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
3473 IMGUI_API
ImGuiViewportP* FindHoveredViewportFromPlatformWindowStack(
const ImVec2& mouse_platform_pos);
3476 IMGUI_API
void MarkIniSettingsDirty();
3477 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
3478 IMGUI_API
void ClearIniSettings();
3480 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
3487 IMGUI_API
void ClearWindowSettings(
const char* name);
3490 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
3491 inline const char* LocalizeGetMsg(ImGuiLocKey key) {
ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
3494 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
3495 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
3496 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
3497 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
3500 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
3501 IMGUI_API
void ScrollToRect(
ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
3504 inline void ScrollToBringRectIntoView(
ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
3508 inline ImGuiItemStatusFlags GetItemStatusFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
3509 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
3510 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
3511 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
3512 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
3513 IMGUI_API
void ClearActiveID();
3514 IMGUI_API ImGuiID GetHoveredID();
3515 IMGUI_API
void SetHoveredID(ImGuiID
id);
3516 IMGUI_API
void KeepAliveID(ImGuiID
id);
3517 IMGUI_API
void MarkItemEdited(ImGuiID
id);
3518 IMGUI_API
void PushOverrideID(ImGuiID
id);
3519 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
3520 IMGUI_API ImGuiID GetIDWithSeed(
int n, ImGuiID seed);
3523 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
3524 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
3525 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
3526 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id, ImGuiItemFlags item_flags);
3527 IMGUI_API
bool IsWindowContentHoverable(
ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
3528 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
3529 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags item_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
3530 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
3531 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
3532 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
3533 IMGUI_API
void ShrinkWidths(
ImGuiShrinkWidthItem* items,
int count,
float width_excess,
float width_min);
3534 IMGUI_API
void CalcClipRectVisibleItemsY(
const ImRect& clip_rect,
const ImVec2& pos,
float items_height,
int* out_visible_start,
int* out_visible_end);
3538 IMGUI_API
void BeginDisabledOverrideReenable();
3539 IMGUI_API
void EndDisabledOverrideReenable();
3542 IMGUI_API
void LogBegin(ImGuiLogFlags flags,
int auto_open_depth);
3543 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
3544 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
3545 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
3548 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
3551 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_window_flags);
3552 IMGUI_API
bool BeginPopupMenuEx(ImGuiID
id,
const char* label, ImGuiWindowFlags extra_window_flags);
3553 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
3554 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
3555 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
3556 IMGUI_API
void ClosePopupsExceptModals();
3557 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
3560 IMGUI_API
ImGuiWindow* GetTopMostAndVisiblePopupModal();
3563 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
3564 IMGUI_API ImGuiMouseButton GetMouseButtonFromPopupFlags(ImGuiPopupFlags flags);
3567 IMGUI_API
bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
3568 IMGUI_API
bool BeginTooltipHidden();
3571 IMGUI_API
bool BeginViewportSideBar(
const char* name,
ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
3572 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
3573 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
3576 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
3577 IMGUI_API
bool BeginComboPreview();
3578 IMGUI_API
void EndComboPreview();
3581 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
3582 IMGUI_API
void NavInitRequestApplyResult();
3583 IMGUI_API
bool NavMoveRequestButNoResultYet();
3584 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3585 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3586 IMGUI_API
void NavMoveRequestResolveWithLastItem(
ImGuiNavItemData* result);
3588 IMGUI_API
void NavMoveRequestCancel();
3589 IMGUI_API
void NavMoveRequestApplyResult();
3590 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
3591 IMGUI_API
void NavHighlightActivated(ImGuiID
id);
3592 IMGUI_API
void NavClearPreferredPosForAxis(ImGuiAxis axis);
3593 IMGUI_API
void SetNavCursorVisibleAfterMove();
3594 IMGUI_API
void NavUpdateCurrentWindowIsScrollPushableX();
3596 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
3597 IMGUI_API
void SetNavFocusScope(ImGuiID focus_scope_id);
3602 IMGUI_API
void FocusItem();
3603 IMGUI_API
void ActivateItemByID(ImGuiID
id);
3607 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
3608 inline bool IsNamedKeyOrMod(ImGuiKey key) {
return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; }
3609 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
3610 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
3611 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
3612 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
3613 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
3614 inline bool IsLRModKey(ImGuiKey key) {
return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
3615 ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
3616 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
3618 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
3619 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
3620 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
3621 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
3627 IMGUI_API
const char* GetKeyChordName(ImGuiKeyChord key_chord);
3628 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
3629 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
3630 IMGUI_API
ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
3631 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
3632 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
3633 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
3634 IMGUI_API
void TeleportMousePos(
const ImVec2& pos);
3635 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
3636 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
3649 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
3650 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3651 IMGUI_API
void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3652 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);
3653 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
3654 inline ImGuiKeyOwnerData* GetKeyOwnerData(
ImGuiContext* ctx, ImGuiKey key) {
if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key));
return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
3662 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
3663 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3664 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
3665 IMGUI_API
bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3666 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
3667 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3668 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
3669 IMGUI_API
bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
3685 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3686 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3687 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
3692 IMGUI_API
void DockContextInitialize(
ImGuiContext* ctx);
3694 IMGUI_API
void DockContextClearNodes(
ImGuiContext* ctx, ImGuiID root_id,
bool clear_settings_refs);
3695 IMGUI_API
void DockContextRebuildNodes(
ImGuiContext* ctx);
3696 IMGUI_API
void DockContextNewFrameUpdateUndocking(
ImGuiContext* ctx);
3697 IMGUI_API
void DockContextNewFrameUpdateDocking(
ImGuiContext* ctx);
3699 IMGUI_API ImGuiID DockContextGenNodeID(
ImGuiContext* ctx);
3703 IMGUI_API
void DockContextProcessUndockWindow(
ImGuiContext* ctx,
ImGuiWindow* window,
bool clear_persistent_docking_ref =
true);
3708 IMGUI_API
bool DockNodeBeginAmendTabBar(
ImGuiDockNode* node);
3709 IMGUI_API
void DockNodeEndAmendTabBar();
3710 inline ImGuiDockNode* DockNodeGetRootNode(
ImGuiDockNode* node) {
while (node->ParentNode) node = node->ParentNode;
return node; }
3711 inline bool DockNodeIsInHierarchyOf(
ImGuiDockNode* node,
ImGuiDockNode* parent) {
while (node) {
if (node == parent)
return true; node = node->ParentNode; }
return false; }
3712 inline int DockNodeGetDepth(
const ImGuiDockNode* node) {
int depth = 0;
while (node->ParentNode) { node = node->ParentNode; depth++; }
return depth; }
3713 inline ImGuiID DockNodeGetWindowMenuButtonId(
const ImGuiDockNode* node) {
return ImHashStr(
"#COLLAPSE", 0, node->ID); }
3715 IMGUI_API
bool GetWindowAlwaysWantOwnTabBar(
ImGuiWindow* window);
3716 IMGUI_API
void BeginDocked(
ImGuiWindow* window,
bool* p_open);
3717 IMGUI_API
void BeginDockableDragDropSource(
ImGuiWindow* window);
3718 IMGUI_API
void BeginDockableDragDropTarget(
ImGuiWindow* window);
3719 IMGUI_API
void SetWindowDock(
ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond);
3730 IMGUI_API
void DockBuilderDockWindow(
const char* window_name, ImGuiID node_id);
3731 IMGUI_API
ImGuiDockNode*DockBuilderGetNode(ImGuiID node_id);
3732 inline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id) {
ImGuiDockNode* node = DockBuilderGetNode(node_id);
if (!node)
return NULL;
return DockNodeGetRootNode(node)->CentralNode; }
3733 IMGUI_API ImGuiID DockBuilderAddNode(ImGuiID node_id = 0, ImGuiDockNodeFlags flags = 0);
3734 IMGUI_API
void DockBuilderRemoveNode(ImGuiID node_id);
3735 IMGUI_API
void DockBuilderRemoveNodeDockedWindows(ImGuiID node_id,
bool clear_settings_refs =
true);
3736 IMGUI_API
void DockBuilderRemoveNodeChildNodes(ImGuiID node_id);
3737 IMGUI_API
void DockBuilderSetNodePos(ImGuiID node_id,
ImVec2 pos);
3738 IMGUI_API
void DockBuilderSetNodeSize(ImGuiID node_id,
ImVec2 size);
3739 IMGUI_API ImGuiID DockBuilderSplitNode(ImGuiID node_id, ImGuiDir split_dir,
float size_ratio_for_node_at_dir, ImGuiID* out_id_at_dir, ImGuiID* out_id_at_opposite_dir);
3740 IMGUI_API
void DockBuilderCopyDockSpace(ImGuiID src_dockspace_id, ImGuiID dst_dockspace_id,
ImVector<const char*>* in_window_remap_pairs);
3741 IMGUI_API
void DockBuilderCopyNode(ImGuiID src_node_id, ImGuiID dst_node_id,
ImVector<ImGuiID>* out_node_remap_pairs);
3742 IMGUI_API
void DockBuilderCopyWindowSettings(
const char* src_name,
const char* dst_name);
3743 IMGUI_API
void DockBuilderFinish(ImGuiID node_id);
3753 IMGUI_API
void PushFocusScope(ImGuiID
id);
3754 IMGUI_API
void PopFocusScope();
3755 inline ImGuiID GetCurrentFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
3758 IMGUI_API
bool IsDragDropActive();
3759 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
3760 IMGUI_API
bool BeginDragDropTargetViewport(
ImGuiViewport* viewport,
const ImRect* p_bb = NULL);
3761 IMGUI_API
void ClearDragDrop();
3762 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
3763 IMGUI_API
void RenderDragDropTargetRectForItem(
const ImRect& bb);
3764 IMGUI_API
void RenderDragDropTargetRectEx(
ImDrawList* draw_list,
const ImRect& bb);
3769 IMGUI_API
ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
3770 IMGUI_API
int TypingSelectFindMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3771 IMGUI_API
int TypingSelectFindNextSingleCharMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3772 IMGUI_API
int TypingSelectFindBestLeadingMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data);
3775 IMGUI_API
bool BeginBoxSelect(
const ImRect& scope_rect,
ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);
3776 IMGUI_API
void EndBoxSelect(
const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);
3779 IMGUI_API
void MultiSelectItemHeader(ImGuiID
id,
bool* p_selected, ImGuiButtonFlags* p_button_flags);
3780 IMGUI_API
void MultiSelectItemFooter(ImGuiID
id,
bool* p_selected,
bool* p_pressed);
3782 IMGUI_API
void MultiSelectAddSetRange(
ImGuiMultiSelectTempData* ms,
bool selected,
int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
3783 inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.BoxSelectState.ID ==
id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
3787 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
3788 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
3789 IMGUI_API
void EndColumns();
3790 IMGUI_API
void PushColumnClipRect(
int column_index);
3791 IMGUI_API
void PushColumnsBackground();
3792 IMGUI_API
void PopColumnsBackground();
3793 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
3795 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
3796 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
3799 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
3800 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
3801 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
3802 IMGUI_API
int TableGetHoveredRow();
3803 IMGUI_API
float TableGetHeaderRowHeight();
3804 IMGUI_API
float TableGetHeaderAngledMaxLabelWidth();
3805 IMGUI_API
void TablePushBackgroundChannel();
3806 IMGUI_API
void TablePopBackgroundChannel();
3807 IMGUI_API
void TablePushColumnChannel(
int column_n);
3808 IMGUI_API
void TablePopColumnChannel();
3809 IMGUI_API
void TableAngledHeadersRowEx(ImGuiID row_id,
float angle,
float max_label_width,
const ImGuiTableHeaderData* data,
int data_count);
3813 IMGUI_API
ImGuiTable* TableFindByID(ImGuiID
id);
3814 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);
3815 IMGUI_API
void TableBeginInitMemory(
ImGuiTable* table,
int columns_count);
3816 IMGUI_API
void TableBeginApplyRequests(
ImGuiTable* table);
3817 IMGUI_API
void TableSetupDrawChannels(
ImGuiTable* table);
3818 IMGUI_API
void TableUpdateLayout(
ImGuiTable* table);
3819 IMGUI_API
void TableUpdateBorders(
ImGuiTable* table);
3820 IMGUI_API
void TableUpdateColumnsWeightFromWidth(
ImGuiTable* table);
3821 IMGUI_API
void TableDrawBorders(
ImGuiTable* table);
3822 IMGUI_API
void TableDrawDefaultContextMenu(
ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
3823 IMGUI_API
bool TableBeginContextMenuPopup(
ImGuiTable* table);
3824 IMGUI_API
void TableMergeDrawChannels(
ImGuiTable* table);
3825 inline ImGuiTableInstanceData* TableGetInstanceData(
ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3826 inline ImGuiID TableGetInstanceID(
ImGuiTable* table,
int instance_no) {
return TableGetInstanceData(table, instance_no)->TableInstanceID; }
3827 IMGUI_API
void TableFixDisplayOrder(
ImGuiTable* table);
3828 IMGUI_API
void TableSortSpecsSanitize(
ImGuiTable* table);
3829 IMGUI_API
void TableSortSpecsBuild(
ImGuiTable* table);
3830 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(
ImGuiTableColumn* column);
3833 IMGUI_API
void TableBeginRow(
ImGuiTable* table);
3834 IMGUI_API
void TableEndRow(
ImGuiTable* table);
3835 IMGUI_API
void TableBeginCell(
ImGuiTable* table,
int column_n);
3836 IMGUI_API
void TableEndCell(
ImGuiTable* table);
3837 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3838 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3839 IMGUI_API ImGuiID TableGetColumnResizeID(
ImGuiTable* table,
int column_n,
int instance_no = 0);
3840 IMGUI_API
float TableCalcMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3841 IMGUI_API
void TableSetColumnWidthAutoSingle(
ImGuiTable* table,
int column_n);
3842 IMGUI_API
void TableSetColumnWidthAutoAll(
ImGuiTable* table);
3843 IMGUI_API
void TableSetColumnDisplayOrder(
ImGuiTable* table,
int column_n,
int dst_order);
3844 IMGUI_API
void TableRemove(
ImGuiTable* table);
3845 IMGUI_API
void TableGcCompactTransientBuffers(
ImGuiTable* table);
3847 IMGUI_API
void TableGcCompactSettings();
3850 IMGUI_API
void TableLoadSettings(
ImGuiTable* table);
3851 IMGUI_API
void TableSaveSettings(
ImGuiTable* table);
3852 IMGUI_API
void TableResetSettings(
ImGuiTable* table);
3854 IMGUI_API
void TableSettingsAddSettingsHandler();
3860 IMGUI_API
ImGuiTabBar* TabBarFindByID(ImGuiID
id);
3861 IMGUI_API
void TabBarRemove(
ImGuiTabBar* tab_bar);
3862 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3867 inline int TabBarGetTabOrder(
ImGuiTabBar* tab_bar,
ImGuiTabItem* tab) {
return tab_bar->Tabs.index_from_ptr(tab); }
3870 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
3873 IMGUI_API
void TabBarQueueFocus(
ImGuiTabBar* tab_bar,
const char* tab_name);
3876 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
3877 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags,
ImGuiWindow* docked_window);
3878 IMGUI_API
void TabItemSpacing(
const char* str_id, ImGuiTabItemFlags flags,
float width);
3879 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3881 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3882 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);
3887 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3888 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3889 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);
3890 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);
3891 IMGUI_API
void RenderTextEllipsis(
ImDrawList* draw_list,
const ImVec2& pos_min,
const ImVec2& pos_max,
float ellipsis_max_x,
const char* text,
const char* text_end,
const ImVec2* text_size_if_known);
3892 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool borders =
true,
float rounding = 0.0f);
3893 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
3894 IMGUI_API
void RenderColorComponentMarker(
const ImRect& bb, ImU32 col,
float rounding);
3895 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);
3896 IMGUI_API
void RenderNavCursor(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None);
3897 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 3898 inline void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb,
id, flags); }
3900 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3901 IMGUI_API
void RenderMouseCursor(
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3904 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3906 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
3907 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3908 IMGUI_API
void RenderArrowDockMenu(
ImDrawList* draw_list,
ImVec2 p_min,
float sz, ImU32 col);
3909 IMGUI_API
void RenderRectFilledInRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float fill_x0,
float fill_x1,
float rounding);
3910 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3911 IMGUI_API ImDrawFlags CalcRoundingFlagsForRectInRect(
const ImRect& r_in,
const ImRect& r_outer,
float threshold);
3914 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3915 IMGUI_API
void TextAligned(
float align_x,
float size_x,
const char* fmt, ...);
3916 IMGUI_API
void TextAlignedV(
float align_x,
float size_x,
const char* fmt, va_list args);
3919 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3920 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3922 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags,
float thickness = 1.0f);
3923 IMGUI_API
void SeparatorTextEx(ImGuiID
id,
const char* label,
const char* label_end,
float extra_width);
3924 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3925 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3928 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3930 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3931 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags draw_rounding_flags = 0);
3933 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
3934 IMGUI_API ImGuiID GetWindowResizeCornerID(
ImGuiWindow* window,
int n);
3935 IMGUI_API ImGuiID GetWindowResizeBorderID(
ImGuiWindow* window, ImGuiDir dir);
3938 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3939 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);
3940 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);
3941 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);
3944 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3945 IMGUI_API
void TreeNodeDrawLineToChildNode(
const ImVec2& target_pos);
3947 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3948 IMGUI_API
bool TreeNodeGetOpen(ImGuiID storage_id);
3949 IMGUI_API
void TreeNodeSetOpen(ImGuiID storage_id,
bool open);
3950 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);
3955 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);
3956 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);
3957 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);
3958 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);
3959 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3960 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3964 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3965 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3966 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format,
void* p_data_when_empty = NULL);
3967 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3968 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3969 IMGUI_API
bool DataTypeIsZero(ImGuiDataType data_type,
const void* p_data);
3972 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);
3973 IMGUI_API
void InputTextDeactivateHook(ImGuiID
id);
3974 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3975 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);
3976 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return g.ActiveId ==
id && g.TempInputId == id; }
3977 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3978 IMGUI_API
void SetNextItemRefVal(ImGuiDataType data_type,
void* p_data);
3979 inline bool IsItemActiveAsInputText() {
ImGuiContext& g = *GImGui;
return g.ActiveId != 0 && g.ActiveId == g.LastItemData.ID && g.InputTextState.ID == g.LastItemData.ID; }
3982 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3983 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3984 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3985 inline void SetNextItemColorMarker(ImU32 col) {
ImGuiContext& g = *GImGui; g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasColorMarker; g.NextItemData.ColorMarker = col; }
3988 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,
const ImVec2& size_arg);
3991 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);
3992 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);
3993 IMGUI_API
void ShadeVertsTransformPos(
ImDrawList* draw_list,
int vert_start_idx,
int vert_end_idx,
const ImVec2& pivot_in,
float cos_a,
float sin_a,
const ImVec2& pivot_out);
3996 IMGUI_API
void GcCompactTransientMiscBuffers();
3997 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
3998 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
4001 IMGUI_API
bool ErrorLog(
const char* msg);
4005 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
4006 IMGUI_API
void ErrorCheckEndFrameFinalizeErrorTooltip();
4007 IMGUI_API
bool BeginErrorTooltip();
4008 IMGUI_API
void EndErrorTooltip();
4011 IMGUI_API
void DebugAllocHook(
ImGuiDebugAllocInfo* info,
int frame_count,
void* ptr,
size_t size);
4012 IMGUI_API
void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
4013 IMGUI_API
void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
4014 IMGUI_API
void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
4015 IMGUI_API
void DebugTextUnformattedWithLocateItem(
const char* line_begin,
const char* line_end);
4016 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
4017 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
4018 IMGUI_API
void DebugLocateItemResolveWithLastItem();
4019 IMGUI_API
void DebugBreakClearData();
4020 IMGUI_API
bool DebugBreakButton(
const char* label,
const char* description_of_location);
4021 IMGUI_API
void DebugBreakButtonTooltip(
bool keyboard_only,
const char* description_of_location);
4023 IMGUI_API ImU64 DebugTextureIDToU64(ImTextureID tex_id);
4024 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
4026 IMGUI_API
void DebugNodeDockNode(
ImGuiDockNode* node,
const char* label);
4028 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
4029 IMGUI_API
void DebugNodeFont(
ImFont* font);
4030 IMGUI_API
void DebugNodeFontGlyphesForSrcMask(
ImFont* font,
ImFontBaked* baked,
int src_mask);
4033 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
4034 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
4035 IMGUI_API
void DebugNodeTable(
ImGuiTable* table);
4040 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
4043 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(
ImGuiWindow** windows,
int windows_size,
ImGuiWindow* parent_in_begin_stack);
4045 IMGUI_API
void DebugNodePlatformMonitor(
ImGuiPlatformMonitor* monitor,
const char* label,
int idx);
4046 IMGUI_API
void DebugRenderKeyboardPreview(
ImDrawList* draw_list);
4050 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 4087 size_t FontBakedSrcLoaderDataSize;
4089 ImFontLoader() { memset((
void*)
this, 0,
sizeof(*
this)); }
4092 #ifdef IMGUI_ENABLE_STB_TRUETYPE 4093 IMGUI_API
const ImFontLoader* ImFontAtlasGetFontLoaderForStbTruetype();
4095 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 4103 #define IMGUI_FONT_SIZE_MAX (512.0f) 4104 #define IMGUI_FONT_SIZE_THRESHOLD_FOR_LOADADVANCEXONLYMODE (128.0f) 4108 inline bool operator==(
const ImTextureRef& lhs,
const ImTextureRef& rhs) {
return lhs._TexID == rhs._TexID && lhs._TexData == rhs._TexData; }
4109 inline bool operator!=(
const ImTextureRef& lhs,
const ImTextureRef& rhs) {
return lhs._TexID != rhs._TexID || lhs._TexData != rhs._TexData; }
4112 #define ImFontAtlasRectId_IndexMask_ (0x0007FFFF) // 20-bits signed: index to access builder->RectsIndex[]. 4113 #define ImFontAtlasRectId_GenerationMask_ (0x3FF00000) // 10-bits: entry generation, so each ID is unique and get can safely detected old identifiers. 4114 #define ImFontAtlasRectId_GenerationShift_ (20) 4115 inline int ImFontAtlasRectId_GetIndex(ImFontAtlasRectId
id) {
return (
id & ImFontAtlasRectId_IndexMask_); }
4116 inline unsigned int ImFontAtlasRectId_GetGeneration(ImFontAtlasRectId
id) {
return (
unsigned int)(
id & ImFontAtlasRectId_GenerationMask_) >> ImFontAtlasRectId_GenerationShift_; }
4117 inline ImFontAtlasRectId ImFontAtlasRectId_Make(
int index_idx,
int gen_idx) { IM_ASSERT(index_idx >= 0 && index_idx <= ImFontAtlasRectId_IndexMask_ && gen_idx <= (ImFontAtlasRectId_GenerationMask_ >> ImFontAtlasRectId_GenerationShift_));
return (ImFontAtlasRectId)(index_idx | (gen_idx << ImFontAtlasRectId_GenerationShift_)); }
4126 int TargetIndex : 20;
4127 unsigned int Generation : 10;
4128 unsigned int IsUsed : 1;
4142 ImTextureFormat Format;
4149 #ifdef IMGUI_STB_NAMESPACE 4150 namespace IMGUI_STB_NAMESPACE {
struct stbrp_node; }
4166 int RectsIndexFreeListStart;
4167 int RectsPackedCount;
4168 int RectsPackedSurface;
4169 int RectsDiscardedCount;
4170 int RectsDiscardedSurface;
4174 bool LockDisableResize;
4175 bool PreloadedAllGlyphsRanges;
4180 int BakedDiscardedCount;
4183 ImFontAtlasRectId PackIdMouseCursors;
4184 ImFontAtlasRectId PackIdLinesTexData;
4186 ImFontAtlasBuilder() { memset((
void*)
this, 0,
sizeof(*
this)); FrameCount = -1; RectsIndexFreeListStart = -1; PackIdMouseCursors = PackIdLinesTexData = -1; }
4189 IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
4190 IMGUI_API
void ImFontAtlasBuildDestroy(
ImFontAtlas* atlas);
4191 IMGUI_API
void ImFontAtlasBuildMain(
ImFontAtlas* atlas);
4194 IMGUI_API
void ImFontAtlasBuildUpdatePointers(
ImFontAtlas* atlas);
4195 IMGUI_API
void ImFontAtlasBuildRenderBitmapFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char);
4196 IMGUI_API
void ImFontAtlasBuildClear(
ImFontAtlas* atlas);
4199 IMGUI_API
void ImFontAtlasTextureMakeSpace(
ImFontAtlas* atlas);
4200 IMGUI_API
void ImFontAtlasTextureRepack(
ImFontAtlas* atlas,
int w,
int h);
4201 IMGUI_API
void ImFontAtlasTextureGrow(
ImFontAtlas* atlas,
int old_w = -1,
int old_h = -1);
4202 IMGUI_API
void ImFontAtlasTextureCompact(
ImFontAtlas* atlas);
4206 IMGUI_API
void ImFontAtlasBuildLegacyPreloadAllGlyphRanges(
ImFontAtlas* atlas);
4207 IMGUI_API
void ImFontAtlasBuildGetOversampleFactors(
ImFontConfig* src,
ImFontBaked* baked,
int* out_oversample_h,
int* out_oversample_v);
4208 IMGUI_API
void ImFontAtlasBuildDiscardBakes(
ImFontAtlas* atlas,
int unused_frames);
4216 IMGUI_API
void ImFontAtlasFontDiscardBakes(
ImFontAtlas* atlas,
ImFont* font,
int unused_frames);
4218 IMGUI_API ImGuiID ImFontAtlasBakedGetId(ImGuiID font_id,
float baked_size,
float rasterizer_density);
4220 IMGUI_API
ImFontBaked* ImFontAtlasBakedGetClosestMatch(
ImFontAtlas* atlas,
ImFont* font,
float font_size,
float font_rasterizer_density);
4221 IMGUI_API
ImFontBaked* ImFontAtlasBakedAdd(
ImFontAtlas* atlas,
ImFont* font,
float font_size,
float font_rasterizer_density, ImGuiID baked_id);
4228 IMGUI_API
void ImFontAtlasPackInit(
ImFontAtlas* atlas);
4232 IMGUI_API
void ImFontAtlasPackDiscardRect(
ImFontAtlas* atlas, ImFontAtlasRectId
id);
4234 IMGUI_API
void ImFontAtlasUpdateNewFrame(
ImFontAtlas* atlas,
int frame_count,
bool renderer_has_textures);
4238 IMGUI_API
void ImFontAtlasUpdateDrawListsSharedData(
ImFontAtlas* atlas);
4240 IMGUI_API
void ImFontAtlasTextureBlockConvert(
const unsigned char* src_pixels, ImTextureFormat src_fmt,
int src_pitch,
unsigned char* dst_pixels, ImTextureFormat dst_fmt,
int dst_pitch,
int w,
int h);
4243 IMGUI_API
void ImFontAtlasTextureBlockFill(
ImTextureData* dst_tex,
int dst_x,
int dst_y,
int w,
int h, ImU32 col);
4244 IMGUI_API
void ImFontAtlasTextureBlockCopy(
ImTextureData* src_tex,
int src_x,
int src_y,
ImTextureData* dst_tex,
int dst_x,
int dst_y,
int w,
int h);
4245 IMGUI_API
void ImFontAtlasTextureBlockQueueUpload(
ImFontAtlas* atlas,
ImTextureData* tex,
int x,
int y,
int w,
int h);
4247 IMGUI_API
int ImTextureDataGetFormatBytesPerPixel(ImTextureFormat format);
4248 IMGUI_API
const char* ImTextureDataGetStatusName(ImTextureStatus status);
4249 IMGUI_API
const char* ImTextureDataGetFormatName(ImTextureFormat format);
4251 #ifndef IMGUI_DISABLE_DEBUG_TOOLS 4252 IMGUI_API
void ImFontAtlasDebugLogTextureRequests(
ImFontAtlas* atlas);
4255 IMGUI_API
bool ImFontAtlasGetMouseCursorTexData(
ImFontAtlas* atlas, ImGuiMouseCursor cursor_type,
ImVec2* out_offset,
ImVec2* out_size,
ImVec2 out_uv_border[2],
ImVec2 out_uv_fill[2]);
4261 #ifdef IMGUI_ENABLE_TEST_ENGINE 4263 extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
4264 extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
4265 extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
4268 #define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box 4269 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) 4270 #define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log 4272 #define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) ((void)0) 4273 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g) 4278 #if defined(__clang__) 4279 #pragma clang diagnostic pop 4280 #elif defined(__GNUC__) 4281 #pragma GCC diagnostic pop 4285 #pragma warning (pop) 4288 #endif // #ifndef IMGUI_DISABLE Definition: imgui_internal.h:1395
Definition: imgui_internal.h:3047
Definition: imgui_internal.h:871
Definition: imgui_internal.h:1562
Definition: imgui_internal.h:1861
Definition: imgui_internal.h:2181
Definition: imgui_internal.h:1823
Definition: imgui_internal.h:804
Definition: imgui_internal.h:1812
Definition: imgui_internal.h:2290
Definition: imgui_internal.h:737
Definition: imgui_internal.h:823
Definition: imgui_internal.h:1219
Definition: imgui_internal.h:1793
Definition: imgui_internal.h:566
Definition: imstb_rectpack.h:179
Definition: imgui_internal.h:933
Definition: imgui_internal.h:3027
Definition: imgui_internal.h:2337
Definition: imgui_internal.h:1241
Definition: imgui_internal.h:4132
Definition: imgui_internal.h:2107
Definition: imgui_internal.h:4156
Definition: imgui_internal.h:1444
Definition: imgui_internal.h:1896
Definition: imgui_internal.h:4124
Definition: imgui_internal.h:655
Definition: imgui_internal.h:2297
Definition: imgui_internal.h:1236
Definition: imgui_internal.h:2326
Definition: imgui_internal.h:1453
Definition: imgui_internal.h:1169
Definition: imgui_internal.h:1460
Definition: imgui_internal.h:670
Definition: imgui_internal.h:1414
Definition: imgui_internal.h:3318
Definition: imgui_internal.h:4073
Definition: imgui_internal.h:2129
Definition: imgui_internal.h:1330
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: imgui_internal.h:3193
MouseButton
Definition: events.h:194
Definition: imgui_internal.h:1182
Definition: imgui_internal.h:684
Definition: imgui_internal.h:2307
Definition: imgui_internal.h:1619
Definition: imgui_internal.h:1201
Definition: imgui_internal.h:1593
Definition: imgui_internal.h:1607
Definition: imgui_internal.h:2854
Definition: imgui_internal.h:926
Definition: imgui_internal.h:1928
Definition: imgui_internal.h:1689
Definition: imgui_internal.h:1953
Definition: imgui_internal.h:946
Definition: imgui_internal.h:2112
Definition: imgui_internal.h:4159
Definition: imgui_internal.h:1470
Definition: imgui_internal.h:3101
Definition: imgui_internal.h:1871
Definition: imgui_internal.h:1373
Definition: imgui_internal.h:582
Definition: imgui_internal.h:3161
Definition: imstb_textedit.h:342
Definition: imgui_internal.h:1776
Definition: imgui_internal.h:2025
Definition: imgui_internal.h:3366
Definition: imgui_internal.h:2796
Definition: imgui_internal.h:714
Definition: imgui_internal.h:906
Definition: imgui_internal.h:2383
Definition: imgui_internal.h:952
Definition: imgui_internal.h:3180
Definition: imgui_internal.h:898
Definition: imgui_internal.h:1426
Definition: imgui_internal.h:2238
Definition: imgui_internal.h:3342
Definition: imgui_internal.h:917
Definition: imgui_internal.h:2368
Definition: imgui_internal.h:770
Definition: imgui_internal.h:592
Definition: imgui_internal.h:574
Definition: imgui_internal.h:2200
Definition: imgui_internal.h:1676