61 #if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE) 62 #define IMGUI_ENABLE_SSE 63 #include <immintrin.h> 68 #pragma warning (push) 69 #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) 70 #pragma warning (disable: 26812) // The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer) 71 #pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6). 72 #if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later 73 #pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types 78 #if defined(__clang__) 79 #pragma clang diagnostic push 80 #if __has_warning("-Wunknown-warning-option") 81 #pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' 83 #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx' 84 #pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloor() 85 #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h 86 #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h 87 #pragma clang diagnostic ignored "-Wold-style-cast" 88 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" 89 #pragma clang diagnostic ignored "-Wdouble-promotion" 90 #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision 91 #pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn' 92 #pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated 93 #pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access 94 #elif defined(__GNUC__) 95 #pragma GCC diagnostic push 96 #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind 97 #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 98 #pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated 103 #if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED) 104 #error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h! 108 #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74 109 #error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 111 #ifdef IMGUI_DISABLE_MATH_FUNCTIONS // Renamed in 1.74 112 #error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 117 #ifndef IMGUI_ENABLE_FREETYPE 118 #define IMGUI_ENABLE_STB_TRUETYPE 136 struct ImGuiDockRequest;
138 struct ImGuiDockNodeSettings;
142 struct ImGuiInputTextDeactivateData;
165 struct ImGuiTableColumnsSettings;
176 enum ImGuiLocKey : int;
177 typedef int ImGuiDataAuthority;
178 typedef int ImGuiLayoutType;
181 typedef int ImGuiActivateFlags;
182 typedef int ImGuiDebugLogFlags;
183 typedef int ImGuiFocusRequestFlags;
184 typedef int ImGuiItemStatusFlags;
185 typedef int ImGuiOldColumnFlags;
186 typedef int ImGuiNavHighlightFlags;
187 typedef int ImGuiNavMoveFlags;
188 typedef int ImGuiNextItemDataFlags;
189 typedef int ImGuiNextWindowDataFlags;
190 typedef int ImGuiScrollFlags;
191 typedef int ImGuiSeparatorFlags;
192 typedef int ImGuiTextFlags;
193 typedef int ImGuiTooltipFlags;
194 typedef int ImGuiTypingSelectFlags;
195 typedef int ImGuiWindowRefreshFlags;
211 #define IMGUI_PAYLOAD_TYPE_WINDOW "_IMWINDOW" // Payload == ImGuiWindow* 215 #ifndef IMGUI_DEBUG_PRINTF 216 #ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 217 #define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__) 219 #define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0) 224 #ifndef IMGUI_DISABLE_DEBUG_TOOLS 225 #define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__) 227 #define IMGUI_DEBUG_LOG(...) ((void)0) 229 #define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0) 230 #define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 231 #define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 232 #define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 233 #define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 234 #define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 235 #define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 236 #define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 237 #define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 238 #define IMGUI_DEBUG_LOG_DOCKING(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventDocking) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 239 #define IMGUI_DEBUG_LOG_VIEWPORT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventViewport) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) 242 #define IM_STATIC_ASSERT(_COND) static_assert(_COND, "") 247 #ifdef IMGUI_DEBUG_PARANOID 248 #define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR) 250 #define IM_ASSERT_PARANOID(_EXPR) 254 #define IM_PI 3.14159265358979323846f 256 #define IM_NEWLINE "\r\n" // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!) 258 #define IM_NEWLINE "\n" 260 #ifndef IM_TABSIZE // Until we move this to runtime and/or add proper tab support, at least allow users to compile-time override 261 #define IM_TABSIZE (4) 263 #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 264 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose 265 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 266 #define IM_TRUNC(_VAL) ((float)(int)(_VAL)) // ImTrunc() is not inlined in MSVC debug builds 267 #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // 268 #define IM_STRINGIFY_HELPER(_X) #_X 269 #define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X) // Preprocessor idiom to stringify e.g. an integer. 270 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 271 #define IM_FLOOR IM_TRUNC 276 #define IMGUI_CDECL __cdecl 282 #if defined(_MSC_VER) && !defined(__clang__) 283 #define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX)) 285 #define IM_MSVC_WARNING_SUPPRESS(XXXX) 291 #ifndef IM_DEBUG_BREAK 292 #if defined (_MSC_VER) 293 #define IM_DEBUG_BREAK() __debugbreak() 294 #elif defined(__clang__) 295 #define IM_DEBUG_BREAK() __builtin_debugtrap() 296 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 297 #define IM_DEBUG_BREAK() __asm__ volatile("int3;nop") 298 #elif defined(__GNUC__) && defined(__thumb__) 299 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01") 300 #elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__) 301 #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0") 303 #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! 305 #endif // #ifndef IM_DEBUG_BREAK 309 #if defined(_MSC_VER) && !defined(__clang__) 310 #define IM_PRId64 "I64d" 311 #define IM_PRIu64 "I64u" 312 #define IM_PRIX64 "I64X" 314 #define IM_PRId64 "lld" 315 #define IM_PRIu64 "llu" 316 #define IM_PRIX64 "llX" 346 IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImGuiID seed = 0);
347 IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImGuiID seed = 0);
351 static inline void ImQsort(
void* base,
size_t count,
size_t size_of_element,
int(IMGUI_CDECL *compare_func)(
void const*,
void const*)) {
if (count > 1) qsort(base, count, size_of_element, compare_func); }
355 IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
358 static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
359 static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
360 static inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
363 IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
364 IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
365 IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
366 IMGUI_API
char* ImStrdup(
const char* str);
367 IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
368 IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
369 IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
370 IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
371 IMGUI_API
void ImStrTrimBlanks(
char* str);
372 IMGUI_API
const char* ImStrSkipBlank(
const char* str);
373 IMGUI_API
int ImStrlenW(
const ImWchar* str);
374 IMGUI_API
const char* ImStrbol(
const char* buf_mid_line,
const char* buf_begin);
375 IM_MSVC_RUNTIME_CHECKS_OFF
376 static inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
377 static inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
378 static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
379 static inline bool ImCharIsXdigitA(
char c) {
return (c >=
'0' && c <=
'9') || (c >=
'A' && c <= 'F') || (c >=
'a' && c <=
'f'); }
380 IM_MSVC_RUNTIME_CHECKS_RESTORE
383 IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
384 IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
385 IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
386 IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
387 IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
388 IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
389 IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
390 IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
391 IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
392 IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
395 IMGUI_API const
char* ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
396 IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
397 IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
398 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);
399 IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
400 IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
401 IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
402 IMGUI_API const
char* ImTextFindPreviousUtf8Codepoint(const
char* in_text_start, const
char* in_text_curr);
403 IMGUI_API
int ImTextCountLines(const
char* in_text, const
char* in_text_end);
406 #ifdef IMGUI_DISABLE_FILE_FUNCTIONS 407 #define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 408 typedef void* ImFileHandle;
409 static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
410 static inline bool ImFileClose(ImFileHandle) {
return false; }
411 static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
412 static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
413 static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
415 #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 416 typedef FILE* ImFileHandle;
417 IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
418 IMGUI_API
bool ImFileClose(ImFileHandle file);
419 IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
420 IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
421 IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
423 #define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions 425 IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
428 IM_MSVC_RUNTIME_CHECKS_OFF
430 #ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 431 #define ImFabs(X) fabsf(X) 432 #define ImSqrt(X) sqrtf(X) 433 #define ImFmod(X, Y) fmodf((X), (Y)) 434 #define ImCos(X) cosf(X) 435 #define ImSin(X) sinf(X) 436 #define ImAcos(X) acosf(X) 437 #define ImAtan2(Y, X) atan2f((Y), (X)) 438 #define ImAtof(STR) atof(STR) 439 #define ImCeil(X) ceilf(X) 440 static inline float ImPow(
float x,
float y) {
return powf(x, y); }
441 static inline double ImPow(
double x,
double y) {
return pow(x, y); }
442 static inline float ImLog(
float x) {
return logf(x); }
443 static inline double ImLog(
double x) {
return log(x); }
444 static inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
445 static inline float ImAbs(
float x) {
return fabsf(x); }
446 static inline double ImAbs(
double x) {
return fabs(x); }
447 static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
448 static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
449 #ifdef IMGUI_ENABLE_SSE 450 static inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
452 static inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
454 static inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
458 template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
459 template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
460 template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
461 template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
462 template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
463 template<
typename T>
static inline T ImAddClampOverflow(T a, T b, T mn, T mx) {
if (b < 0 && (a < mn - b))
return mn;
if (b > 0 && (a > mx - b))
return mx;
return a + b; }
464 template<
typename T>
static inline T ImSubClampOverflow(T a, T b, T mn, T mx) {
if (b > 0 && (a < mn + b))
return mn;
if (b < 0 && (a > mx + b))
return mx;
return a - b; }
466 static inline ImVec2 ImMin(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); }
467 static inline ImVec2 ImMax(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); }
468 static 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); }
469 static inline ImVec2 ImLerp(
const ImVec2& a,
const ImVec2& b,
float t) {
return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); }
470 static inline ImVec2 ImLerp(
const ImVec2& a,
const ImVec2& b,
const ImVec2& t) {
return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
471 static inline ImVec4 ImLerp(
const ImVec4& a,
const ImVec4& b,
float t) {
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); }
472 static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
473 static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
474 static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
475 static inline float ImInvLength(
const ImVec2& lhs,
float fail_value) {
float d = (lhs.x * lhs.x) + (lhs.y * lhs.y);
if (d > 0.0f)
return ImRsqrt(d);
return fail_value; }
476 static inline float ImTrunc(
float f) {
return (
float)(int)(f); }
477 static inline ImVec2 ImTrunc(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
478 static inline float ImFloor(
float f) {
return (
float)((f >= 0 || (float)(
int)f == f) ? (
int)f : (int)f - 1); }
479 static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
480 static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
481 static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
482 static inline ImVec2 ImRotate(
const ImVec2& v,
float cos_a,
float sin_a) {
return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
483 static inline float ImLinearSweep(
float current,
float target,
float speed) {
if (current < target)
return ImMin(current + speed, target);
if (current > target)
return ImMax(current - speed, target);
return current; }
484 static inline float ImLinearRemapClamp(
float s0,
float s1,
float d0,
float d1,
float x) {
return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; }
486 static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
487 static inline float ImExponentialMovingAverage(
float avg,
float sample,
int n) { avg -= avg / n; avg += sample / n;
return avg; }
488 IM_MSVC_RUNTIME_CHECKS_RESTORE
498 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);
499 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; }
500 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; }
504 IM_MSVC_RUNTIME_CHECKS_OFF
508 constexpr
ImVec1() : x(0.0f) { }
509 constexpr ImVec1(
float _x) : x(_x) { }
516 constexpr
ImVec2ih() : x(0), y(0) {}
517 constexpr ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
518 constexpr
explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
528 constexpr
ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
529 constexpr ImRect(
const ImVec2& min,
const ImVec2& max) : Min(min), Max(max) {}
530 constexpr ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
531 constexpr ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
533 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
534 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
535 float GetWidth()
const {
return Max.x - Min.x; }
536 float GetHeight()
const {
return Max.y - Min.y; }
537 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
538 ImVec2 GetTL()
const {
return Min; }
541 ImVec2 GetBR()
const {
return Max; }
542 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
543 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; }
544 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; }
545 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; }
546 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; }
547 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; }
548 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
549 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
550 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
551 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
552 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
553 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
554 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
555 void Floor() { Min.x = IM_TRUNC(Min.x); Min.y = IM_TRUNC(Min.y); Max.x = IM_TRUNC(Max.x); Max.y = IM_TRUNC(Max.y); }
556 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
557 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
561 #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! 562 #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! 563 inline size_t ImBitArrayGetStorageSizeInBytes(
int bitcount) {
return (
size_t)((bitcount + 31) >> 5) << 2; }
564 inline void ImBitArrayClearAllBits(ImU32* arr,
int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
565 inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
566 inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
567 inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
568 inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
573 int a_mod = (n & 31);
574 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
575 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
581 typedef ImU32* ImBitArrayPtr;
585 template<
int BITCOUNT,
int OFFSET = 0>
588 ImU32 Storage[(BITCOUNT + 31) >> 5];
590 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
591 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
592 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
593 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
594 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
595 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); }
596 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
604 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
605 void Clear() { Storage.clear(); }
606 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return IM_BITARRAY_TESTBIT(Storage.Data, n); }
607 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
608 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
610 IM_MSVC_RUNTIME_CHECKS_RESTORE
621 inline ImSpan() { Data = DataEnd = NULL; }
622 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
623 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
625 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
626 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
627 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
628 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
629 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
630 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
632 inline T* begin() {
return Data; }
633 inline const T* begin()
const {
return Data; }
634 inline T* end() {
return DataEnd; }
635 inline const T* end()
const {
return DataEnd; }
638 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
654 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; }
655 inline int GetArenaSizeInBytes() {
return CurrOff; }
656 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
657 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
658 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
660 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
666 typedef int ImPoolIdx;
673 ImPoolIdx AliveCount;
675 ImPool() { FreeIdx = AliveCount = 0; }
677 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
678 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
679 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
680 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
681 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
682 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; }
683 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]; }
684 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
685 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
686 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
690 int GetAliveCount()
const {
return AliveCount; }
691 int GetBufSize()
const {
return Buf.Size; }
692 int GetMapSize()
const {
return Map.Data.Size; }
693 T* TryGetMapData(ImPoolIdx n) {
int idx = Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
706 void clear() { Buf.clear(); }
707 bool empty()
const {
return Buf.Size == 0; }
708 int size()
const {
return Buf.Size; }
709 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); }
710 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
711 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; }
712 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
713 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
714 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; }
715 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
726 void clear() { LineOffsets.clear(); EndOffset = 0; }
727 int size() {
return LineOffsets.Size; }
728 const char* get_line_begin(
const char* base,
int n) {
return base + LineOffsets[n]; }
729 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
730 void append(
const char* base,
int old_size,
int new_size);
749 #define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2) 750 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4 751 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512 752 #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) 755 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI)))) 756 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD)) 759 #ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE 760 #define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48 // Number of samples in lookup table. 762 #define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE // Sample index _PathArcToFastEx() for 360 angle. 772 float CurveTessellationTol;
773 float CircleSegmentMaxError;
774 ImVec4 ClipRectFullscreen;
775 ImDrawListFlags InitialFlags;
781 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
782 float ArcFastRadiusCutoff;
783 ImU8 CircleSegmentCounts[64];
787 void SetCircleTessellationMaxError(
float max_error);
807 void* GetVarPtr(
void* parent)
const {
return (
void*)((
unsigned char*)parent + Offset); }
820 const char* PrintFmt;
825 enum ImGuiDataTypePrivate_
827 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
828 ImGuiDataType_Pointer,
839 enum ImGuiItemFlagsPrivate_
842 ImGuiItemFlags_Disabled = 1 << 10,
843 ImGuiItemFlags_ReadOnly = 1 << 11,
844 ImGuiItemFlags_MixedValue = 1 << 12,
845 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13,
846 ImGuiItemFlags_AllowOverlap = 1 << 14,
849 ImGuiItemFlags_Inputable = 1 << 20,
850 ImGuiItemFlags_HasSelectionUserData = 1 << 21,
851 ImGuiItemFlags_IsMultiSelect = 1 << 22,
853 ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups,
861 enum ImGuiItemStatusFlags_
863 ImGuiItemStatusFlags_None = 0,
864 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
865 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
866 ImGuiItemStatusFlags_Edited = 1 << 2,
867 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
868 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
869 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
870 ImGuiItemStatusFlags_Deactivated = 1 << 6,
871 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
872 ImGuiItemStatusFlags_Visible = 1 << 8,
873 ImGuiItemStatusFlags_HasClipRect = 1 << 9,
874 ImGuiItemStatusFlags_HasShortcut = 1 << 10,
877 #ifdef IMGUI_ENABLE_TEST_ENGINE 878 ImGuiItemStatusFlags_Openable = 1 << 20,
879 ImGuiItemStatusFlags_Opened = 1 << 21,
880 ImGuiItemStatusFlags_Checkable = 1 << 22,
881 ImGuiItemStatusFlags_Checked = 1 << 23,
882 ImGuiItemStatusFlags_Inputable = 1 << 24,
887 enum ImGuiHoveredFlagsPrivate_
889 ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
890 ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
891 ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
895 enum ImGuiInputTextFlagsPrivate_
898 ImGuiInputTextFlags_Multiline = 1 << 26,
899 ImGuiInputTextFlags_NoMarkEdited = 1 << 27,
900 ImGuiInputTextFlags_MergedItem = 1 << 28,
901 ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 29,
905 enum ImGuiButtonFlagsPrivate_
907 ImGuiButtonFlags_PressedOnClick = 1 << 4,
908 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
909 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
910 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
911 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
912 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
913 ImGuiButtonFlags_Repeat = 1 << 10,
914 ImGuiButtonFlags_FlattenChildren = 1 << 11,
915 ImGuiButtonFlags_AllowOverlap = 1 << 12,
916 ImGuiButtonFlags_DontClosePopups = 1 << 13,
918 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
919 ImGuiButtonFlags_NoKeyModifiers = 1 << 16,
920 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
921 ImGuiButtonFlags_NoNavFocus = 1 << 18,
922 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
923 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
924 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
925 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
926 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
930 enum ImGuiComboFlagsPrivate_
932 ImGuiComboFlags_CustomPreview = 1 << 20,
936 enum ImGuiSliderFlagsPrivate_
938 ImGuiSliderFlags_Vertical = 1 << 20,
939 ImGuiSliderFlags_ReadOnly = 1 << 21,
943 enum ImGuiSelectableFlagsPrivate_
946 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
947 ImGuiSelectableFlags_SelectOnNav = 1 << 21,
948 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
949 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
950 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
951 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
952 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
953 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
957 enum ImGuiTreeNodeFlagsPrivate_
959 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,
960 ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,
961 ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
964 enum ImGuiSeparatorFlags_
966 ImGuiSeparatorFlags_None = 0,
967 ImGuiSeparatorFlags_Horizontal = 1 << 0,
968 ImGuiSeparatorFlags_Vertical = 1 << 1,
969 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
975 enum ImGuiFocusRequestFlags_
977 ImGuiFocusRequestFlags_None = 0,
978 ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0,
979 ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1,
984 ImGuiTextFlags_None = 0,
985 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
988 enum ImGuiTooltipFlags_
990 ImGuiTooltipFlags_None = 0,
991 ImGuiTooltipFlags_OverridePrevious = 1 << 1,
996 enum ImGuiLayoutType_
998 ImGuiLayoutType_Horizontal = 0,
999 ImGuiLayoutType_Vertical = 1
1004 ImGuiLogType_None = 0,
1007 ImGuiLogType_Buffer,
1008 ImGuiLogType_Clipboard,
1014 ImGuiAxis_None = -1,
1021 ImGuiPlotType_Lines,
1022 ImGuiPlotType_Histogram,
1035 ImGuiStyleVar VarIdx;
1036 union {
int BackupInt[2];
float BackupFloat[2]; };
1037 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
1038 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
1039 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
1047 ImVec2 BackupCursorMaxPos;
1048 ImVec2 BackupCursorPosPrevLine;
1049 float BackupPrevLineTextBaseOffset;
1050 ImGuiLayoutType BackupLayout;
1060 ImVec2 BackupCursorMaxPos;
1061 ImVec2 BackupCursorPosPrevLine;
1063 ImVec1 BackupGroupOffset;
1064 ImVec2 BackupCurrLineSize;
1065 float BackupCurrLineTextBaseOffset;
1066 ImGuiID BackupActiveIdIsAlive;
1067 bool BackupActiveIdPreviousFrameIsAlive;
1068 bool BackupHoveredIdIsAlive;
1069 bool BackupIsSameLine;
1077 ImU32 NextTotalWidth;
1081 ImU16 OffsetShortcut;
1086 void Update(
float spacing,
bool window_reappearing);
1087 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1088 void CalcNextTotalWidth(
bool update_offsets);
1098 void ClearFreeMemory() { ID = 0; TextA.clear(); }
1102 #undef IMSTB_TEXTEDIT_STRING 1103 #undef IMSTB_TEXTEDIT_CHARTYPE 1104 #define IMSTB_TEXTEDIT_STRING ImGuiInputTextState 1105 #define IMSTB_TEXTEDIT_CHARTYPE char 1106 #define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) 1107 #define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99 1108 #define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999 1110 typedef ImStb::STB_TexteditState ImStbTexteditState;
1117 ImStbTexteditState* Stb;
1127 bool SelectedAllMouseLock;
1129 ImGuiInputTextFlags Flags;
1131 int ReloadSelectionStart;
1132 int ReloadSelectionEnd;
1136 void ClearText() { CurLenA = 0; TextA[0] = 0; CursorClamp(); }
1137 void ClearFreeMemory() { TextA.clear(); InitialTextA.clear(); }
1138 void OnKeyPressed(
int key);
1139 void OnCharPressed(
unsigned int c);
1142 void CursorAnimReset();
1144 bool HasSelection()
const;
1145 void ClearSelection();
1146 int GetCursorPos()
const;
1147 int GetSelectionStart()
const;
1148 int GetSelectionEnd()
const;
1156 void ReloadUserBufAndSelectAll();
1157 void ReloadUserBufAndKeepSelection();
1158 void ReloadUserBufAndMoveToEnd();
1161 enum ImGuiWindowRefreshFlags_
1163 ImGuiWindowRefreshFlags_None = 0,
1164 ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0,
1165 ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1,
1166 ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2,
1170 enum ImGuiNextWindowDataFlags_
1172 ImGuiNextWindowDataFlags_None = 0,
1173 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1174 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1175 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1176 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1177 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1178 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1179 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1180 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1181 ImGuiNextWindowDataFlags_HasChildFlags = 1 << 8,
1182 ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 9,
1183 ImGuiNextWindowDataFlags_HasViewport = 1 << 10,
1184 ImGuiNextWindowDataFlags_HasDock = 1 << 11,
1185 ImGuiNextWindowDataFlags_HasWindowClass = 1 << 12,
1191 ImGuiNextWindowDataFlags Flags;
1194 ImGuiCond CollapsedCond;
1201 ImGuiChildFlags ChildFlags;
1204 ImRect SizeConstraintRect;
1205 ImGuiSizeCallback SizeCallback;
1206 void* SizeCallbackUserData;
1211 ImVec2 MenuBarOffsetMinVal;
1212 ImGuiWindowRefreshFlags RefreshFlagsVal;
1215 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1218 enum ImGuiNextItemDataFlags_
1220 ImGuiNextItemDataFlags_None = 0,
1221 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1222 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1223 ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
1224 ImGuiNextItemDataFlags_HasRefVal = 1 << 3,
1225 ImGuiNextItemDataFlags_HasStorageID = 1 << 4,
1230 ImGuiNextItemDataFlags Flags;
1231 ImGuiItemFlags ItemFlags;
1233 ImGuiID FocusScopeId;
1234 ImGuiSelectionUserData SelectionUserData;
1236 ImGuiKeyChord Shortcut;
1237 ImGuiInputFlags ShortcutFlags;
1244 inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; }
1251 ImGuiItemFlags InFlags;
1252 ImGuiItemStatusFlags StatusFlags;
1258 ImGuiKeyChord Shortcut;
1270 ImGuiTreeNodeFlags TreeFlags;
1271 ImGuiItemFlags InFlags;
1278 short SizeOfWindowStack;
1279 short SizeOfIDStack;
1280 short SizeOfTreeStack;
1281 short SizeOfColorStack;
1282 short SizeOfStyleVarStack;
1283 short SizeOfFontStack;
1284 short SizeOfFocusScopeStack;
1285 short SizeOfGroupStack;
1286 short SizeOfItemFlagsStack;
1287 short SizeOfBeginPopupStack;
1288 short SizeOfDisabledStack;
1299 bool DisabledOverrideReenable;
1322 enum ImGuiPopupPositionPolicy
1324 ImGuiPopupPositionPolicy_Default,
1325 ImGuiPopupPositionPolicy_ComboBox,
1326 ImGuiPopupPositionPolicy_Tooltip,
1337 ImGuiID OpenParentId;
1341 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1352 #define ImGuiKey_LegacyNativeKey_BEGIN 0 1353 #define ImGuiKey_LegacyNativeKey_END 512 1354 #define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN) 1355 #define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart) 1356 #define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart) 1357 #define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1) 1358 #define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft) 1359 #define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1) 1360 #define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN) 1361 #define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END) 1364 #define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl 1365 #define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift 1366 #define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1 1367 #define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1 1368 #define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown) 1369 #define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight) 1370 #define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft 1371 #define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp 1373 enum ImGuiInputEventType
1375 ImGuiInputEventType_None = 0,
1376 ImGuiInputEventType_MousePos,
1377 ImGuiInputEventType_MouseWheel,
1378 ImGuiInputEventType_MouseButton,
1379 ImGuiInputEventType_MouseViewport,
1380 ImGuiInputEventType_Key,
1381 ImGuiInputEventType_Text,
1382 ImGuiInputEventType_Focus,
1383 ImGuiInputEventType_COUNT
1386 enum ImGuiInputSource
1388 ImGuiInputSource_None = 0,
1389 ImGuiInputSource_Mouse,
1390 ImGuiInputSource_Keyboard,
1391 ImGuiInputSource_Gamepad,
1392 ImGuiInputSource_COUNT
1407 ImGuiInputEventType
Type;
1408 ImGuiInputSource Source;
1420 bool AddedByTestEngine;
1426 #define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease. 1427 #define ImGuiKeyOwner_NoOwner ((ImGuiID)-1) // Require key to have no owner. 1430 typedef ImS16 ImGuiKeyRoutingIndex;
1435 ImGuiKeyRoutingIndex NextEntryIndex;
1437 ImU8 RoutingCurrScore;
1438 ImU8 RoutingNextScore;
1439 ImGuiID RoutingCurr;
1440 ImGuiID RoutingNext;
1442 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
1449 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1454 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1464 bool LockUntilRelease;
1466 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease =
false; }
1472 enum ImGuiInputFlagsPrivate_
1476 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1477 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1478 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1481 ImGuiInputFlags_RepeatUntilRelease = 1 << 4,
1482 ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5,
1483 ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6,
1484 ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7,
1488 ImGuiInputFlags_LockThisFrame = 1 << 20,
1489 ImGuiInputFlags_LockUntilRelease = 1 << 21,
1492 ImGuiInputFlags_CondHovered = 1 << 22,
1493 ImGuiInputFlags_CondActive = 1 << 23,
1494 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1497 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1498 ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
1499 ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
1500 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1501 ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
1502 ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
1503 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
1504 ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
1505 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
1506 ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
1507 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1508 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1520 bool PosToIndexConvert;
1521 ImS8 PosToIndexOffsetMin;
1522 ImS8 PosToIndexOffsetMax;
1532 float LossynessOffset;
1538 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1545 enum ImGuiActivateFlags_
1547 ImGuiActivateFlags_None = 0,
1548 ImGuiActivateFlags_PreferInput = 1 << 0,
1549 ImGuiActivateFlags_PreferTweak = 1 << 1,
1550 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1551 ImGuiActivateFlags_FromTabbing = 1 << 3,
1552 ImGuiActivateFlags_FromShortcut = 1 << 4,
1556 enum ImGuiScrollFlags_
1558 ImGuiScrollFlags_None = 0,
1559 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1560 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1561 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1562 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1563 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1564 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1565 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1566 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1567 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1570 enum ImGuiNavHighlightFlags_
1572 ImGuiNavHighlightFlags_None = 0,
1573 ImGuiNavHighlightFlags_Compact = 1 << 1,
1574 ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2,
1575 ImGuiNavHighlightFlags_NoRounding = 1 << 3,
1578 enum ImGuiNavMoveFlags_
1580 ImGuiNavMoveFlags_None = 0,
1581 ImGuiNavMoveFlags_LoopX = 1 << 0,
1582 ImGuiNavMoveFlags_LoopY = 1 << 1,
1583 ImGuiNavMoveFlags_WrapX = 1 << 2,
1584 ImGuiNavMoveFlags_WrapY = 1 << 3,
1585 ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
1586 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1587 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1588 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1589 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1590 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1591 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1592 ImGuiNavMoveFlags_IsTabbing = 1 << 10,
1593 ImGuiNavMoveFlags_IsPageMove = 1 << 11,
1594 ImGuiNavMoveFlags_Activate = 1 << 12,
1595 ImGuiNavMoveFlags_NoSelect = 1 << 13,
1596 ImGuiNavMoveFlags_NoSetNavHighlight = 1 << 14,
1597 ImGuiNavMoveFlags_NoClearActiveId = 1 << 15,
1602 ImGuiNavLayer_Main = 0,
1603 ImGuiNavLayer_Menu = 1,
1612 ImGuiID FocusScopeId;
1614 ImGuiItemFlags InFlags;
1618 ImGuiSelectionUserData SelectionUserData;
1621 void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
1636 enum ImGuiTypingSelectFlags_
1638 ImGuiTypingSelectFlags_None = 0,
1639 ImGuiTypingSelectFlags_AllowBackspace = 1 << 0,
1640 ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1,
1646 ImGuiTypingSelectFlags Flags;
1647 int SearchBufferLen;
1648 const char* SearchBuffer;
1650 bool SingleCharMode;
1651 ImS8 SingleCharSize;
1658 char SearchBuffer[64];
1660 int LastRequestFrame = 0;
1661 float LastRequestTime = 0.0f;
1662 bool SingleCharModeLock =
false;
1665 void Clear() { SearchBuffer[0] = 0; SingleCharModeLock =
false; }
1673 enum ImGuiOldColumnFlags_
1675 ImGuiOldColumnFlags_None = 0,
1676 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1677 ImGuiOldColumnFlags_NoResize = 1 << 1,
1678 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1679 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1680 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1683 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1696 float OffsetNormBeforeResize;
1697 ImGuiOldColumnFlags Flags;
1706 ImGuiOldColumnFlags Flags;
1708 bool IsBeingResized;
1711 float OffMinX, OffMaxX;
1712 float LineMinY, LineMaxY;
1713 float HostCursorPosY;
1714 float HostCursorMaxPosX;
1715 ImRect HostInitialClipRect;
1716 ImRect HostBackupClipRect;
1717 ImRect HostBackupParentWorkRect;
1734 bool IsStartedFromVoid;
1735 bool IsStartedSetNavIdOnce;
1737 ImGuiKeyChord KeyMods : 16;
1746 ImRect BoxSelectRectPrev;
1747 ImRect BoxSelectRectCurr;
1757 #define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1) 1764 ImGuiID FocusScopeId;
1765 ImGuiMultiSelectFlags Flags;
1767 ImVec2 BackupCursorMaxPos;
1768 ImGuiSelectionUserData LastSubmittedItem;
1769 ImGuiID BoxSelectId;
1770 ImGuiKeyChord KeyMods;
1771 ImS8 LoopRequestSetAll;
1774 bool IsKeyboardSetRange;
1776 bool RangeSrcPassedBy;
1777 bool RangeDstPassedBy;
1780 void Clear() {
size_t io_sz =
sizeof(IO); ClearIO(); memset((
void*)(&IO + 1), 0,
sizeof(*
this) - io_sz); }
1781 void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset =
false; }
1789 int LastFrameActive;
1790 int LastSelectionSize;
1793 ImGuiSelectionUserData RangeSrcItem;
1794 ImGuiSelectionUserData NavIdItem;
1796 ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; }
1803 #define DOCKING_HOST_DRAW_CHANNEL_BG 0 // Dock host: background fill 1804 #define DOCKING_HOST_DRAW_CHANNEL_FG 1 // Dock host: decorations and contents 1806 #ifdef IMGUI_HAS_DOCK 1809 enum ImGuiDockNodeFlagsPrivate_
1812 ImGuiDockNodeFlags_DockSpace = 1 << 10,
1813 ImGuiDockNodeFlags_CentralNode = 1 << 11,
1814 ImGuiDockNodeFlags_NoTabBar = 1 << 12,
1815 ImGuiDockNodeFlags_HiddenTabBar = 1 << 13,
1816 ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14,
1817 ImGuiDockNodeFlags_NoCloseButton = 1 << 15,
1818 ImGuiDockNodeFlags_NoResizeX = 1 << 16,
1819 ImGuiDockNodeFlags_NoResizeY = 1 << 17,
1820 ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18,
1824 ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 19,
1825 ImGuiDockNodeFlags_NoDockingOverMe = 1 << 20,
1826 ImGuiDockNodeFlags_NoDockingOverOther = 1 << 21,
1827 ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 22,
1828 ImGuiDockNodeFlags_NoDocking = ImGuiDockNodeFlags_NoDockingOverMe | ImGuiDockNodeFlags_NoDockingOverOther | ImGuiDockNodeFlags_NoDockingOverEmpty | ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoDockingSplitOther,
1830 ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0,
1831 ImGuiDockNodeFlags_NoResizeFlagsMask_ = (int)ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeY,
1834 ImGuiDockNodeFlags_LocalFlagsTransferMask_ = (
int)ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | (int)ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
1835 ImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton,
1839 enum ImGuiDataAuthority_
1841 ImGuiDataAuthority_Auto,
1842 ImGuiDataAuthority_DockNode,
1843 ImGuiDataAuthority_Window,
1846 enum ImGuiDockNodeState
1848 ImGuiDockNodeState_Unknown,
1849 ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow,
1850 ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing,
1851 ImGuiDockNodeState_HostWindowVisible,
1858 ImGuiDockNodeFlags SharedFlags;
1859 ImGuiDockNodeFlags LocalFlags;
1860 ImGuiDockNodeFlags LocalFlagsInWindows;
1861 ImGuiDockNodeFlags MergedFlags;
1862 ImGuiDockNodeState State;
1870 ImGuiAxis SplitAxis;
1878 int CountNodeWithWindows;
1880 int LastFrameActive;
1881 int LastFrameFocused;
1882 ImGuiID LastFocusedNodeId;
1883 ImGuiID SelectedTabId;
1884 ImGuiID WantCloseTabId;
1885 ImGuiID RefViewportId;
1886 ImGuiDataAuthority AuthorityForPos :3;
1887 ImGuiDataAuthority AuthorityForSize :3;
1888 ImGuiDataAuthority AuthorityForViewport :3;
1891 bool IsBgDrawnThisFrame :1;
1892 bool HasCloseButton :1;
1893 bool HasWindowMenuButton :1;
1894 bool HasCentralNodeChild :1;
1895 bool WantCloseAll :1;
1896 bool WantLockSizeOnce :1;
1897 bool WantMouseMove :1;
1898 bool WantHiddenTabBarUpdate :1;
1899 bool WantHiddenTabBarToggle :1;
1903 bool IsRootNode()
const {
return ParentNode == NULL; }
1904 bool IsDockSpace()
const {
return (MergedFlags & ImGuiDockNodeFlags_DockSpace) != 0; }
1905 bool IsFloatingNode()
const {
return ParentNode == NULL && (MergedFlags & ImGuiDockNodeFlags_DockSpace) == 0; }
1906 bool IsCentralNode()
const {
return (MergedFlags & ImGuiDockNodeFlags_CentralNode) != 0; }
1907 bool IsHiddenTabBar()
const {
return (MergedFlags & ImGuiDockNodeFlags_HiddenTabBar) != 0; }
1908 bool IsNoTabBar()
const {
return (MergedFlags & ImGuiDockNodeFlags_NoTabBar) != 0; }
1909 bool IsSplitNode()
const {
return ChildNodes[0] != NULL; }
1910 bool IsLeafNode()
const {
return ChildNodes[0] == NULL; }
1911 bool IsEmpty()
const {
return ChildNodes[0] == NULL && Windows.Size == 0; }
1912 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1914 void SetLocalFlags(ImGuiDockNodeFlags flags) { LocalFlags = flags; UpdateMergedFlags(); }
1915 void UpdateMergedFlags() { MergedFlags = SharedFlags | LocalFlags | LocalFlagsInWindows; }
1922 enum ImGuiWindowDockStyleCol
1924 ImGuiWindowDockStyleCol_Text,
1925 ImGuiWindowDockStyleCol_TabHovered,
1926 ImGuiWindowDockStyleCol_TabFocused,
1927 ImGuiWindowDockStyleCol_TabSelected,
1928 ImGuiWindowDockStyleCol_TabSelectedOverline,
1929 ImGuiWindowDockStyleCol_TabDimmed,
1930 ImGuiWindowDockStyleCol_TabDimmedSelected,
1931 ImGuiWindowDockStyleCol_TabDimmedSelectedOverline,
1932 ImGuiWindowDockStyleCol_COUNT
1938 ImU32 Colors[ImGuiWindowDockStyleCol_COUNT];
1946 bool WantFullRebuild;
1950 #endif // #ifdef IMGUI_HAS_DOCK 1962 int LastFrameActive;
1963 int LastFocusedStampCount;
1964 ImGuiID LastNameHash;
1969 bool LastFocusedHadNavWindow;
1970 short PlatformMonitor;
1971 int BgFgDrawListsLastFrame[2];
1985 ImVec2 BuildWorkInsetMin;
1986 ImVec2 BuildWorkInsetMax;
1988 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); }
1989 ~
ImGuiViewportP() {
if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]);
if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
1990 void ClearRequestFlags() { PlatformRequestClose = PlatformRequestMove = PlatformRequestResize =
false; }
1993 ImVec2 CalcWorkRectPos(
const ImVec2& inset_min)
const {
return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
1994 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)); }
1995 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); }
1998 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1999 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
2000 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); }
2026 char* GetName() {
return (
char*)(
this + 1); }
2031 const char* TypeName;
2049 enum ImGuiLocKey :
int 2051 ImGuiLocKey_VersionStr,
2052 ImGuiLocKey_TableSizeOne,
2053 ImGuiLocKey_TableSizeAllFit,
2054 ImGuiLocKey_TableSizeAllDefault,
2055 ImGuiLocKey_TableResetOrder,
2056 ImGuiLocKey_WindowingMainMenuBar,
2057 ImGuiLocKey_WindowingPopup,
2058 ImGuiLocKey_WindowingUntitled,
2059 ImGuiLocKey_OpenLink_s,
2060 ImGuiLocKey_CopyLink,
2061 ImGuiLocKey_DockingHideTabBar,
2062 ImGuiLocKey_DockingHoldShiftToDock,
2063 ImGuiLocKey_DockingDragToUndockOrMoveNode,
2082 #ifndef IM_ASSERT_USER_ERROR 2083 #define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error 2087 typedef void (*ImGuiErrorCallback)(
ImGuiContext* ctx,
void* user_data,
const char* msg);
2093 enum ImGuiDebugLogFlags_
2096 ImGuiDebugLogFlags_None = 0,
2097 ImGuiDebugLogFlags_EventError = 1 << 0,
2098 ImGuiDebugLogFlags_EventActiveId = 1 << 1,
2099 ImGuiDebugLogFlags_EventFocus = 1 << 2,
2100 ImGuiDebugLogFlags_EventPopup = 1 << 3,
2101 ImGuiDebugLogFlags_EventNav = 1 << 4,
2102 ImGuiDebugLogFlags_EventClipper = 1 << 5,
2103 ImGuiDebugLogFlags_EventSelection = 1 << 6,
2104 ImGuiDebugLogFlags_EventIO = 1 << 7,
2105 ImGuiDebugLogFlags_EventInputRouting = 1 << 8,
2106 ImGuiDebugLogFlags_EventDocking = 1 << 9,
2107 ImGuiDebugLogFlags_EventViewport = 1 << 10,
2109 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
2110 ImGuiDebugLogFlags_OutputToTTY = 1 << 20,
2111 ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21,
2123 int TotalAllocCount;
2125 ImS16 LastEntriesIdx;
2133 bool ShowDebugLog =
false;
2134 bool ShowIDStackTool =
false;
2135 bool ShowWindowsRects =
false;
2136 bool ShowWindowsBeginOrder =
false;
2137 bool ShowTablesRects =
false;
2138 bool ShowDrawCmdMesh =
true;
2139 bool ShowDrawCmdBoundingBoxes =
true;
2140 bool ShowTextEncodingViewer =
false;
2141 bool ShowAtlasTintedWithTextColor =
false;
2142 bool ShowDockingNodes =
false;
2143 int ShowWindowsRectsType = -1;
2144 int ShowTablesRectsType = -1;
2145 int HighlightMonitorIdx = -1;
2146 ImGuiID HighlightViewportID = 0;
2152 ImS8 QueryFrameCount;
2154 ImGuiDataType DataType : 8;
2163 int LastActiveFrame;
2167 bool CopyToClipboardOnCtrlC;
2168 float CopyToClipboardLastTime;
2170 ImGuiIDStackTool() { memset(
this, 0,
sizeof(*
this)); CopyToClipboardLastTime = -FLT_MAX; }
2178 enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
2183 ImGuiContextHookType
Type;
2185 ImGuiContextHookCallback Callback;
2198 bool FontAtlasOwnedByContext;
2202 ImGuiConfigFlags ConfigFlagsCurrFrame;
2203 ImGuiConfigFlags ConfigFlagsLastFrame;
2208 float CurrentDpiScale;
2212 int FrameCountEnded;
2213 int FrameCountPlatformEnded;
2214 int FrameCountRendered;
2215 bool WithinFrameScope;
2216 bool WithinFrameScopeWithImplicitWindow;
2217 bool WithinEndChild;
2219 bool TestEngineHookItems;
2221 char ContextName[16];
2226 ImGuiMouseSource InputEventsNextMouseSource;
2227 ImU32 InputEventsNextEventId;
2235 int WindowsActiveCount;
2236 ImVec2 WindowsHoverPadding;
2237 ImGuiID DebugBreakInWindow;
2244 ImVec2 WheelingWindowRefMousePos;
2245 int WheelingWindowStartFrame;
2246 int WheelingWindowScrolledFrame;
2247 float WheelingWindowReleaseTimer;
2248 ImVec2 WheelingWindowWheelRemainder;
2252 ImGuiID DebugDrawIdConflicts;
2253 ImGuiID DebugHookIdInfo;
2255 ImGuiID HoveredIdPreviousFrame;
2256 int HoveredIdPreviousFrameItemCount;
2257 float HoveredIdTimer;
2258 float HoveredIdNotActiveTimer;
2259 bool HoveredIdAllowOverlap;
2260 bool HoveredIdIsDisabled;
2261 bool ItemUnclipByLog;
2263 ImGuiID ActiveIdIsAlive;
2264 float ActiveIdTimer;
2265 bool ActiveIdIsJustActivated;
2266 bool ActiveIdAllowOverlap;
2267 bool ActiveIdNoClearOnFocusLoss;
2268 bool ActiveIdHasBeenPressedBefore;
2269 bool ActiveIdHasBeenEditedBefore;
2270 bool ActiveIdHasBeenEditedThisFrame;
2271 bool ActiveIdFromShortcut;
2272 int ActiveIdMouseButton : 8;
2273 ImVec2 ActiveIdClickOffset;
2275 ImGuiInputSource ActiveIdSource;
2276 ImGuiID ActiveIdPreviousFrame;
2277 bool ActiveIdPreviousFrameIsAlive;
2278 bool ActiveIdPreviousFrameHasBeenEditedBefore;
2280 ImGuiID LastActiveId;
2281 float LastActiveIdTimer;
2287 double LastKeyModsChangeTime;
2288 double LastKeyModsChangeFromNoneTime;
2289 double LastKeyboardKeyPressTime;
2290 ImBitArrayForNamedKeys KeysMayBeCharInput;
2293 ImU32 ActiveIdUsingNavDirMask;
2294 bool ActiveIdUsingAllKeyboardKeys;
2295 ImGuiKeyChord DebugBreakInShortcutRouting;
2299 ImGuiID CurrentFocusScopeId;
2300 ImGuiItemFlags CurrentItemFlags;
2301 ImGuiID DebugLocateId;
2305 bool DebugShowGroupRects;
2308 ImGuiCol DebugFlashStyleColorIdx;
2324 ImGuiID PlatformLastFocusedViewportId;
2326 ImRect PlatformMonitorsFullWorkRect;
2327 int ViewportCreatedCount;
2328 int PlatformWindowsCreatedCount;
2329 int ViewportFocusedStampCount;
2334 ImGuiID NavFocusScopeId;
2335 ImGuiNavLayer NavLayer;
2336 ImGuiID NavActivateId;
2337 ImGuiID NavActivateDownId;
2338 ImGuiID NavActivatePressedId;
2339 ImGuiActivateFlags NavActivateFlags;
2341 ImGuiID NavHighlightActivatedId;
2342 float NavHighlightActivatedTimer;
2343 ImGuiID NavNextActivateId;
2344 ImGuiActivateFlags NavNextActivateFlags;
2345 ImGuiInputSource NavInputSource;
2346 ImGuiSelectionUserData NavLastValidSelectionUserData;
2348 bool NavMousePosDirty;
2349 bool NavDisableHighlight;
2350 bool NavDisableMouseHover;
2354 bool NavInitRequest;
2355 bool NavInitRequestFromMove;
2357 bool NavMoveSubmitted;
2358 bool NavMoveScoringItems;
2359 bool NavMoveForwardToNextFrame;
2360 ImGuiNavMoveFlags NavMoveFlags;
2361 ImGuiScrollFlags NavMoveScrollFlags;
2362 ImGuiKeyChord NavMoveKeyMods;
2363 ImGuiDir NavMoveDir;
2364 ImGuiDir NavMoveDirForDebug;
2365 ImGuiDir NavMoveClipDir;
2367 ImRect NavScoringNoClipRect;
2368 int NavScoringDebugCount;
2370 int NavTabbingCounter;
2377 ImGuiID NavJustMovedFromFocusScopeId;
2378 ImGuiID NavJustMovedToId;
2379 ImGuiID NavJustMovedToFocusScopeId;
2380 ImGuiKeyChord NavJustMovedToKeyMods;
2381 bool NavJustMovedToIsTabbing;
2382 bool NavJustMovedToHasSelectionData;
2385 ImGuiKeyChord ConfigNavWindowingKeyNext;
2386 ImGuiKeyChord ConfigNavWindowingKeyPrev;
2390 float NavWindowingTimer;
2391 float NavWindowingHighlightAlpha;
2392 bool NavWindowingToggleLayer;
2393 ImGuiKey NavWindowingToggleKey;
2394 ImVec2 NavWindowingAccumDeltaPos;
2395 ImVec2 NavWindowingAccumDeltaSize;
2401 bool DragDropActive;
2402 bool DragDropWithinSource;
2403 bool DragDropWithinTarget;
2404 ImGuiDragDropFlags DragDropSourceFlags;
2405 int DragDropSourceFrameCount;
2406 int DragDropMouseButton;
2408 ImRect DragDropTargetRect;
2409 ImRect DragDropTargetClipRect;
2410 ImGuiID DragDropTargetId;
2411 ImGuiDragDropFlags DragDropAcceptFlags;
2412 float DragDropAcceptIdCurrRectSurface;
2413 ImGuiID DragDropAcceptIdCurr;
2414 ImGuiID DragDropAcceptIdPrev;
2415 int DragDropAcceptFrameCount;
2416 ImGuiID DragDropHoldJustPressedId;
2418 unsigned char DragDropPayloadBufLocal[16];
2421 int ClipperTempDataStacked;
2426 ImGuiID DebugBreakInTable;
2427 int TablesTempDataStacked;
2442 int MultiSelectTempDataStacked;
2447 ImGuiID HoverItemDelayId;
2448 ImGuiID HoverItemDelayIdPreviousFrame;
2449 float HoverItemDelayTimer;
2450 float HoverItemDelayClearTimer;
2451 ImGuiID HoverItemUnlockedStationaryId;
2452 ImGuiID HoverWindowUnlockedStationaryId;
2455 ImGuiMouseCursor MouseCursor;
2456 float MouseStationaryTimer;
2457 ImVec2 MouseLastValidPos;
2462 ImFont InputTextPasswordFont;
2463 ImGuiID TempInputId;
2466 int BeginComboDepth;
2467 ImGuiColorEditFlags ColorEditOptions;
2468 ImGuiID ColorEditCurrentID;
2469 ImGuiID ColorEditSavedID;
2470 float ColorEditSavedHue;
2471 float ColorEditSavedSat;
2472 ImU32 ColorEditSavedColor;
2475 ImRect WindowResizeBorderExpectedRect;
2476 bool WindowResizeRelativeMode;
2477 short ScrollbarSeekMode;
2478 float ScrollbarClickDeltaToGrabCenter;
2479 float SliderGrabClickOffset;
2480 float SliderCurrentAccum;
2481 bool SliderCurrentAccumDirty;
2482 bool DragCurrentAccumDirty;
2483 float DragCurrentAccum;
2484 float DragSpeedDefaultRatio;
2485 float DisabledAlphaBackup;
2486 short DisabledStackSize;
2487 short LockMarkEdited;
2488 short TooltipOverrideCount;
2497 ImGuiID PlatformImeViewport;
2505 bool SettingsLoaded;
2506 float SettingsDirtyTimer;
2515 const char* LocalizationTable[ImGuiLocKey_COUNT];
2519 ImGuiLogType LogType;
2520 ImFileHandle LogFile;
2522 const char* LogNextPrefix;
2523 const char* LogNextSuffix;
2525 bool LogLineFirstItem;
2527 int LogDepthToExpand;
2528 int LogDepthToExpandDefault;
2531 ImGuiErrorCallback ErrorCallback;
2532 void* ErrorCallbackUserData;
2533 ImVec2 ErrorTooltipLockedPos;
2535 int ErrorCountCurrentFrame;
2541 int DebugDrawIdConflictsCount;
2542 ImGuiDebugLogFlags DebugLogFlags;
2545 int DebugLogSkippedErrors;
2546 ImGuiDebugLogFlags DebugLogAutoDisableFlags;
2547 ImU8 DebugLogAutoDisableFrames;
2548 ImU8 DebugLocateFrames;
2549 bool DebugBreakInLocateId;
2550 ImGuiKeyChord DebugBreakKeyChord;
2551 ImS8 DebugBeginReturnValueCullDepth;
2552 bool DebugItemPickerActive;
2553 ImU8 DebugItemPickerMouseButton;
2554 ImGuiID DebugItemPickerBreakId;
2555 float DebugFlashStyleColorTime;
2556 ImVec4 DebugFlashStyleColorBackup;
2563 float FramerateSecPerFrame[60];
2564 int FramerateSecPerFrameIdx;
2565 int FramerateSecPerFrameCount;
2566 float FramerateSecPerFrameAccum;
2567 int WantCaptureMouseNextFrame;
2568 int WantCaptureKeyboardNextFrame;
2569 int WantTextInputNextFrame;
2571 char TempKeychordName[64];
2587 ImVec2 CursorPosPrevLine;
2593 float CurrLineTextBaseOffset;
2594 float PrevLineTextBaseOffset;
2600 ImVec2 CursorStartPosLossyness;
2603 ImGuiNavLayer NavLayerCurrent;
2604 short NavLayersActiveMask;
2605 short NavLayersActiveMaskNext;
2606 bool NavIsScrollPushableX;
2607 bool NavHideHighlightOneFrame;
2608 bool NavWindowHasScrollY;
2611 bool MenuBarAppending;
2615 ImU32 TreeHasStackDataDepthMask;
2619 int CurrentTableIdx;
2620 ImGuiLayoutType LayoutType;
2621 ImGuiLayoutType ParentLayoutType;
2622 ImU32 ModalDimBgColor;
2638 ImGuiWindowFlags Flags, FlagsPreviousFrame;
2639 ImGuiChildFlags ChildFlags;
2644 int ViewportAllowPlatformMonitorExtend;
2650 ImVec2 ContentSizeExplicit;
2652 float WindowRounding;
2653 float WindowBorderSize;
2654 float TitleBarHeight, MenuBarHeight;
2655 float DecoOuterSizeX1, DecoOuterSizeY1;
2656 float DecoOuterSizeX2, DecoOuterSizeY2;
2657 float DecoInnerSizeX1, DecoInnerSizeY1;
2666 ImVec2 ScrollTargetCenterRatio;
2667 ImVec2 ScrollTargetEdgeSnapDist;
2669 bool ScrollbarX, ScrollbarY;
2675 bool WantCollapseToggle;
2680 bool IsFallbackWindow;
2681 bool IsExplicitChild;
2682 bool HasCloseButton;
2683 signed char ResizeBorderHovered;
2684 signed char ResizeBorderHeld;
2686 short BeginCountPreviousFrame;
2687 short BeginOrderWithinParent;
2688 short BeginOrderWithinContext;
2690 ImS8 AutoFitFramesX, AutoFitFramesY;
2691 bool AutoFitOnlyGrows;
2692 ImGuiDir AutoPosLastDirection;
2693 ImS8 HiddenFramesCanSkipItems;
2694 ImS8 HiddenFramesCannotSkipItems;
2695 ImS8 HiddenFramesForRenderOnly;
2696 ImS8 DisableInputsFrames;
2697 ImGuiCond SetWindowPosAllowFlags : 8;
2698 ImGuiCond SetWindowSizeAllowFlags : 8;
2699 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2700 ImGuiCond SetWindowDockAllowFlags : 8;
2702 ImVec2 SetWindowPosPivot;
2715 ImRect ContentRegionRect;
2719 int LastFrameActive;
2720 int LastFrameJustFocused;
2721 float LastTimeActive;
2722 float ItemWidthDefault;
2725 float FontWindowScale;
2741 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2742 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2743 ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT];
2744 ImGuiID NavRootFocusScopeId;
2746 int MemoryDrawListIdxCapacity;
2747 int MemoryDrawListVtxCapacity;
2748 bool MemoryCompacted;
2751 bool DockIsActive :1;
2752 bool DockNodeIsVisible :1;
2753 bool DockTabIsVisible :1;
2754 bool DockTabWantClose :1;
2760 ImGuiItemStatusFlags DockTabItemStatusFlags;
2767 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2768 ImGuiID GetID(
const void* ptr);
2769 ImGuiID GetID(
int n);
2770 ImGuiID GetIDFromPos(
const ImVec2& p_abs);
2771 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2774 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2775 float CalcFontSize()
const {
ImGuiContext& g = *Ctx;
float scale = g.FontBaseSize * FontWindowScale * FontDpiScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
2776 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); }
2777 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight;
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); }
2785 enum ImGuiTabBarFlagsPrivate_
2787 ImGuiTabBarFlags_DockNode = 1 << 20,
2788 ImGuiTabBarFlags_IsFocused = 1 << 21,
2789 ImGuiTabBarFlags_SaveSettings = 1 << 22,
2793 enum ImGuiTabItemFlagsPrivate_
2795 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
2796 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
2797 ImGuiTabItemFlags_Button = 1 << 21,
2798 ImGuiTabItemFlags_Unsorted = 1 << 22,
2805 ImGuiTabItemFlags Flags;
2807 int LastFrameVisible;
2808 int LastFrameSelected;
2812 float RequestedWidth;
2815 ImS16 IndexDuringLayout;
2818 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
2826 ImGuiTabBarFlags Flags;
2828 ImGuiID SelectedTabId;
2829 ImGuiID NextSelectedTabId;
2830 ImGuiID VisibleTabId;
2831 int CurrFrameVisible;
2832 int PrevFrameVisible;
2834 float CurrTabsContentsHeight;
2835 float PrevTabsContentsHeight;
2837 float WidthAllTabsIdeal;
2838 float ScrollingAnim;
2839 float ScrollingTarget;
2840 float ScrollingTargetDistToVisibility;
2841 float ScrollingSpeed;
2842 float ScrollingRectMinX;
2843 float ScrollingRectMaxX;
2844 float SeparatorMinX;
2845 float SeparatorMaxX;
2846 ImGuiID ReorderRequestTabId;
2847 ImS16 ReorderRequestOffset;
2850 bool VisibleTabWasSubmitted;
2852 ImS16 TabsActiveCount;
2853 ImS16 LastTabItemIdx;
2866 #define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color. 2867 #define IMGUI_TABLE_MAX_COLUMNS 512 // May be further lifted 2870 typedef ImS16 ImGuiTableColumnIdx;
2871 typedef ImU16 ImGuiTableDrawChannelIdx;
2879 ImGuiTableColumnFlags Flags;
2886 float StretchWeight;
2887 float InitStretchWeightOrWidth;
2893 float ContentMaxXFrozen;
2894 float ContentMaxXUnfrozen;
2895 float ContentMaxXHeadersUsed;
2896 float ContentMaxXHeadersIdeal;
2898 ImGuiTableColumnIdx DisplayOrder;
2899 ImGuiTableColumnIdx IndexWithinEnabledSet;
2900 ImGuiTableColumnIdx PrevEnabledColumn;
2901 ImGuiTableColumnIdx NextEnabledColumn;
2902 ImGuiTableColumnIdx SortOrder;
2903 ImGuiTableDrawChannelIdx DrawChannelCurrent;
2904 ImGuiTableDrawChannelIdx DrawChannelFrozen;
2905 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
2908 bool IsUserEnabledNextFrame;
2911 bool IsRequestOutput;
2913 bool IsPreserveWidthAuto;
2914 ImS8 NavLayerCurrent;
2916 ImU8 CannotSkipItemsQueue;
2917 ImU8 SortDirection : 2;
2918 ImU8 SortDirectionsAvailCount : 2;
2919 ImU8 SortDirectionsAvailMask : 4;
2920 ImU8 SortDirectionsAvailList;
2924 memset(
this, 0,
sizeof(*
this));
2925 StretchWeight = WidthRequest = -1.0f;
2927 DisplayOrder = IndexWithinEnabledSet = -1;
2928 PrevEnabledColumn = NextEnabledColumn = -1;
2930 SortDirection = ImGuiSortDirection_None;
2931 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2940 ImGuiTableColumnIdx Column;
2948 ImGuiTableColumnIdx Index;
2958 ImGuiID TableInstanceID;
2959 float LastOuterHeight;
2960 float LastTopHeadersRowHeight;
2961 float LastFrozenHeight;
2965 ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
2972 ImGuiTableFlags Flags;
2978 ImBitArrayPtr EnabledMaskByDisplayOrder;
2979 ImBitArrayPtr EnabledMaskByIndex;
2980 ImBitArrayPtr VisibleMaskByIndex;
2981 ImGuiTableFlags SettingsLoadedFlags;
2983 int LastFrameActive;
2987 ImS16 InstanceCurrent;
2988 ImS16 InstanceInteracted;
2992 float RowCellPaddingY;
2993 float RowTextBaseline;
2994 float RowIndentOffsetX;
2995 ImGuiTableRowFlags RowFlags : 16;
2996 ImGuiTableRowFlags LastRowFlags : 16;
2997 int RowBgColorCounter;
2998 ImU32 RowBgColor[2];
2999 ImU32 BorderColorStrong;
3000 ImU32 BorderColorLight;
3004 float MinColumnWidth;
3005 float OuterPaddingX;
3007 float CellSpacingX1;
3008 float CellSpacingX2;
3010 float ColumnsGivenWidth;
3011 float ColumnsAutoFitWidth;
3012 float ColumnsStretchSumWeights;
3013 float ResizedColumnNextWidth;
3014 float ResizeLockMinContentsX2;
3016 float AngledHeadersHeight;
3017 float AngledHeadersSlope;
3023 ImRect Bg0ClipRectForDrawCmd;
3024 ImRect Bg2ClipRectForDrawCmd;
3026 ImRect HostBackupInnerClipRect;
3036 ImGuiTableColumnIdx SortSpecsCount;
3037 ImGuiTableColumnIdx ColumnsEnabledCount;
3038 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
3039 ImGuiTableColumnIdx DeclColumnsCount;
3040 ImGuiTableColumnIdx AngledHeadersCount;
3041 ImGuiTableColumnIdx HoveredColumnBody;
3042 ImGuiTableColumnIdx HoveredColumnBorder;
3043 ImGuiTableColumnIdx HighlightColumnHeader;
3044 ImGuiTableColumnIdx AutoFitSingleColumn;
3045 ImGuiTableColumnIdx ResizedColumn;
3046 ImGuiTableColumnIdx LastResizedColumn;
3047 ImGuiTableColumnIdx HeldHeaderColumn;
3048 ImGuiTableColumnIdx ReorderColumn;
3049 ImGuiTableColumnIdx ReorderColumnDir;
3050 ImGuiTableColumnIdx LeftMostEnabledColumn;
3051 ImGuiTableColumnIdx RightMostEnabledColumn;
3052 ImGuiTableColumnIdx LeftMostStretchedColumn;
3053 ImGuiTableColumnIdx RightMostStretchedColumn;
3054 ImGuiTableColumnIdx ContextPopupColumn;
3055 ImGuiTableColumnIdx FreezeRowsRequest;
3056 ImGuiTableColumnIdx FreezeRowsCount;
3057 ImGuiTableColumnIdx FreezeColumnsRequest;
3058 ImGuiTableColumnIdx FreezeColumnsCount;
3059 ImGuiTableColumnIdx RowCellDataCurrent;
3060 ImGuiTableDrawChannelIdx DummyDrawChannel;
3061 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
3062 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
3063 bool IsLayoutLocked;
3065 bool IsInitializing;
3066 bool IsSortSpecsDirty;
3067 bool IsUsingHeaders;
3068 bool IsContextPopupOpen;
3069 bool DisableDefaultContextMenu;
3070 bool IsSettingsRequestLoad;
3071 bool IsSettingsDirty;
3072 bool IsDefaultDisplayOrder;
3073 bool IsResetAllRequest;
3074 bool IsResetDisplayOrderRequest;
3075 bool IsUnfrozenRows;
3076 bool IsDefaultSizingPolicy;
3077 bool IsActiveIdAliveBeforeTable;
3078 bool IsActiveIdInTable;
3079 bool HasScrollbarYCurr;
3080 bool HasScrollbarYPrev;
3081 bool MemoryCompacted;
3084 ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
3096 float LastTimeActive;
3097 float AngledHeadersExtraWidth;
3103 ImRect HostBackupWorkRect;
3104 ImRect HostBackupParentWorkRect;
3105 ImVec2 HostBackupPrevLineSize;
3106 ImVec2 HostBackupCurrLineSize;
3107 ImVec2 HostBackupCursorMaxPos;
3108 ImVec1 HostBackupColumnsOffset;
3109 float HostBackupItemWidth;
3110 int HostBackupItemWidthStackSize;
3118 float WidthOrWeight;
3120 ImGuiTableColumnIdx Index;
3121 ImGuiTableColumnIdx DisplayOrder;
3122 ImGuiTableColumnIdx SortOrder;
3123 ImU8 SortDirection : 2;
3129 WidthOrWeight = 0.0f;
3132 DisplayOrder = SortOrder = -1;
3133 SortDirection = ImGuiSortDirection_None;
3143 ImGuiTableFlags SaveFlags;
3145 ImGuiTableColumnIdx ColumnsCount;
3146 ImGuiTableColumnIdx ColumnsCountMax;
3166 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
3167 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
3168 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
3169 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
3170 IMGUI_API
void UpdateWindowSkipRefresh(
ImGuiWindow* window);
3172 IMGUI_API
bool IsWindowChildOf(
ImGuiWindow* window,
ImGuiWindow* potential_parent,
bool popup_hierarchy,
bool dock_hierarchy);
3175 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
3176 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
3177 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
3178 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
3180 IMGUI_API
void SetWindowHiddenAndSkipItemsForCurrentFrame(
ImGuiWindow* window);
3181 inline void SetWindowParentWindowForFocusRoute(
ImGuiWindow* window,
ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
3182 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); }
3183 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); }
3188 IMGUI_API
void FocusWindow(
ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
3190 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
3191 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
3192 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
3194 IMGUI_API
int FindWindowDisplayIndex(
ImGuiWindow* window);
3198 IMGUI_API
void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
3201 IMGUI_API
void SetCurrentFont(
ImFont* font);
3202 inline ImFont* GetDefaultFont() {
ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
3203 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) {
return GetForegroundDrawList(window->Viewport); }
3207 IMGUI_API
void Initialize();
3208 IMGUI_API
void Shutdown();
3211 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
3212 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
3213 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);
3214 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
3216 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
3217 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
3221 IMGUI_API
void RemoveContextHook(
ImGuiContext* context, ImGuiID hook_to_remove);
3222 IMGUI_API
void CallContextHooks(
ImGuiContext* context, ImGuiContextHookType type);
3231 IMGUI_API
ImGuiViewportP* FindHoveredViewportFromPlatformWindowStack(
const ImVec2& mouse_platform_pos);
3234 IMGUI_API
void MarkIniSettingsDirty();
3235 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
3236 IMGUI_API
void ClearIniSettings();
3238 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
3245 IMGUI_API
void ClearWindowSettings(
const char* name);
3248 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
3249 inline const char* LocalizeGetMsg(ImGuiLocKey key) {
ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
3252 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
3253 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
3254 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
3255 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
3258 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
3259 IMGUI_API
void ScrollToRect(
ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
3262 inline void ScrollToBringRectIntoView(
ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
3266 inline ImGuiItemStatusFlags GetItemStatusFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
3267 inline ImGuiItemFlags GetItemFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.InFlags; }
3268 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
3269 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
3270 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
3271 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
3272 IMGUI_API
void ClearActiveID();
3273 IMGUI_API ImGuiID GetHoveredID();
3274 IMGUI_API
void SetHoveredID(ImGuiID
id);
3275 IMGUI_API
void KeepAliveID(ImGuiID
id);
3276 IMGUI_API
void MarkItemEdited(ImGuiID
id);
3277 IMGUI_API
void PushOverrideID(ImGuiID
id);
3278 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
3279 IMGUI_API ImGuiID GetIDWithSeed(
int n, ImGuiID seed);
3282 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
3283 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
3284 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
3285 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id, ImGuiItemFlags item_flags);
3286 IMGUI_API
bool IsWindowContentHoverable(
ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
3287 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
3288 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
3289 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
3290 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
3291 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
3296 IMGUI_API
void BeginDisabledOverrideReenable();
3297 IMGUI_API
void EndDisabledOverrideReenable();
3300 IMGUI_API
void LogBegin(ImGuiLogType type,
int auto_open_depth);
3301 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
3302 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
3303 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
3306 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
3309 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_window_flags);
3310 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
3311 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
3312 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
3313 IMGUI_API
void ClosePopupsExceptModals();
3314 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
3317 IMGUI_API
ImGuiWindow* GetTopMostAndVisiblePopupModal();
3320 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
3323 IMGUI_API
bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
3324 IMGUI_API
bool BeginTooltipHidden();
3327 IMGUI_API
bool BeginViewportSideBar(
const char* name,
ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
3328 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
3329 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
3332 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
3333 IMGUI_API
bool BeginComboPreview();
3334 IMGUI_API
void EndComboPreview();
3337 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
3338 IMGUI_API
void NavInitRequestApplyResult();
3339 IMGUI_API
bool NavMoveRequestButNoResultYet();
3340 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3341 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3342 IMGUI_API
void NavMoveRequestResolveWithLastItem(
ImGuiNavItemData* result);
3344 IMGUI_API
void NavMoveRequestCancel();
3345 IMGUI_API
void NavMoveRequestApplyResult();
3346 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
3347 IMGUI_API
void NavHighlightActivated(ImGuiID
id);
3348 IMGUI_API
void NavClearPreferredPosForAxis(ImGuiAxis axis);
3349 IMGUI_API
void NavRestoreHighlightAfterMove();
3350 IMGUI_API
void NavUpdateCurrentWindowIsScrollPushableX();
3352 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
3353 IMGUI_API
void SetNavFocusScope(ImGuiID focus_scope_id);
3358 IMGUI_API
void FocusItem();
3359 IMGUI_API
void ActivateItemByID(ImGuiID
id);
3363 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
3364 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; }
3365 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
3366 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
3367 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
3368 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
3369 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
3370 inline bool IsLRModKey(ImGuiKey key) {
return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
3371 ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
3372 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
3374 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
3375 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
3376 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
3377 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
3383 IMGUI_API
const char* GetKeyChordName(ImGuiKeyChord key_chord);
3384 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
3385 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
3386 IMGUI_API
ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
3387 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
3388 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
3389 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
3390 IMGUI_API
void TeleportMousePos(
const ImVec2& pos);
3391 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
3392 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
3405 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
3406 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3407 IMGUI_API
void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3408 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);
3409 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
3410 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]; }
3418 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
3419 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3420 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
3421 IMGUI_API
bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3422 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
3423 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3424 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
3425 IMGUI_API
bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
3441 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3442 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3443 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
3448 IMGUI_API
void DockContextInitialize(
ImGuiContext* ctx);
3450 IMGUI_API
void DockContextClearNodes(
ImGuiContext* ctx, ImGuiID root_id,
bool clear_settings_refs);
3451 IMGUI_API
void DockContextRebuildNodes(
ImGuiContext* ctx);
3452 IMGUI_API
void DockContextNewFrameUpdateUndocking(
ImGuiContext* ctx);
3453 IMGUI_API
void DockContextNewFrameUpdateDocking(
ImGuiContext* ctx);
3455 IMGUI_API ImGuiID DockContextGenNodeID(
ImGuiContext* ctx);
3459 IMGUI_API
void DockContextProcessUndockWindow(
ImGuiContext* ctx,
ImGuiWindow* window,
bool clear_persistent_docking_ref =
true);
3464 IMGUI_API
bool DockNodeBeginAmendTabBar(
ImGuiDockNode* node);
3465 IMGUI_API
void DockNodeEndAmendTabBar();
3466 inline ImGuiDockNode* DockNodeGetRootNode(
ImGuiDockNode* node) {
while (node->ParentNode) node = node->ParentNode;
return node; }
3467 inline bool DockNodeIsInHierarchyOf(
ImGuiDockNode* node,
ImGuiDockNode* parent) {
while (node) {
if (node == parent)
return true; node = node->ParentNode; }
return false; }
3468 inline int DockNodeGetDepth(
const ImGuiDockNode* node) {
int depth = 0;
while (node->ParentNode) { node = node->ParentNode; depth++; }
return depth; }
3469 inline ImGuiID DockNodeGetWindowMenuButtonId(
const ImGuiDockNode* node) {
return ImHashStr(
"#COLLAPSE", 0, node->ID); }
3471 IMGUI_API
bool GetWindowAlwaysWantOwnTabBar(
ImGuiWindow* window);
3472 IMGUI_API
void BeginDocked(
ImGuiWindow* window,
bool* p_open);
3473 IMGUI_API
void BeginDockableDragDropSource(
ImGuiWindow* window);
3474 IMGUI_API
void BeginDockableDragDropTarget(
ImGuiWindow* window);
3475 IMGUI_API
void SetWindowDock(
ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond);
3486 IMGUI_API
void DockBuilderDockWindow(
const char* window_name, ImGuiID node_id);
3487 IMGUI_API
ImGuiDockNode*DockBuilderGetNode(ImGuiID node_id);
3488 inline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id) {
ImGuiDockNode* node = DockBuilderGetNode(node_id);
if (!node)
return NULL;
return DockNodeGetRootNode(node)->CentralNode; }
3489 IMGUI_API ImGuiID DockBuilderAddNode(ImGuiID node_id = 0, ImGuiDockNodeFlags flags = 0);
3490 IMGUI_API
void DockBuilderRemoveNode(ImGuiID node_id);
3491 IMGUI_API
void DockBuilderRemoveNodeDockedWindows(ImGuiID node_id,
bool clear_settings_refs =
true);
3492 IMGUI_API
void DockBuilderRemoveNodeChildNodes(ImGuiID node_id);
3493 IMGUI_API
void DockBuilderSetNodePos(ImGuiID node_id,
ImVec2 pos);
3494 IMGUI_API
void DockBuilderSetNodeSize(ImGuiID node_id,
ImVec2 size);
3495 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);
3496 IMGUI_API
void DockBuilderCopyDockSpace(ImGuiID src_dockspace_id, ImGuiID dst_dockspace_id,
ImVector<const char*>* in_window_remap_pairs);
3497 IMGUI_API
void DockBuilderCopyNode(ImGuiID src_node_id, ImGuiID dst_node_id,
ImVector<ImGuiID>* out_node_remap_pairs);
3498 IMGUI_API
void DockBuilderCopyWindowSettings(
const char* src_name,
const char* dst_name);
3499 IMGUI_API
void DockBuilderFinish(ImGuiID node_id);
3509 IMGUI_API
void PushFocusScope(ImGuiID
id);
3510 IMGUI_API
void PopFocusScope();
3511 inline ImGuiID GetCurrentFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
3514 IMGUI_API
bool IsDragDropActive();
3515 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
3516 IMGUI_API
void ClearDragDrop();
3517 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
3518 IMGUI_API
void RenderDragDropTargetRect(
const ImRect& bb,
const ImRect& item_clip_rect);
3521 IMGUI_API
ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
3522 IMGUI_API
int TypingSelectFindMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3523 IMGUI_API
int TypingSelectFindNextSingleCharMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3524 IMGUI_API
int TypingSelectFindBestLeadingMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data);
3527 IMGUI_API
bool BeginBoxSelect(
const ImRect& scope_rect,
ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);
3528 IMGUI_API
void EndBoxSelect(
const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);
3531 IMGUI_API
void MultiSelectItemHeader(ImGuiID
id,
bool* p_selected, ImGuiButtonFlags* p_button_flags);
3532 IMGUI_API
void MultiSelectItemFooter(ImGuiID
id,
bool* p_selected,
bool* p_pressed);
3534 IMGUI_API
void MultiSelectAddSetRange(
ImGuiMultiSelectTempData* ms,
bool selected,
int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
3535 inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.BoxSelectState.ID ==
id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
3539 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
3540 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
3541 IMGUI_API
void EndColumns();
3542 IMGUI_API
void PushColumnClipRect(
int column_index);
3543 IMGUI_API
void PushColumnsBackground();
3544 IMGUI_API
void PopColumnsBackground();
3545 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
3547 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
3548 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
3551 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
3552 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
3553 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
3554 IMGUI_API
int TableGetHoveredRow();
3555 IMGUI_API
float TableGetHeaderRowHeight();
3556 IMGUI_API
float TableGetHeaderAngledMaxLabelWidth();
3557 IMGUI_API
void TablePushBackgroundChannel();
3558 IMGUI_API
void TablePopBackgroundChannel();
3559 IMGUI_API
void TableAngledHeadersRowEx(ImGuiID row_id,
float angle,
float max_label_width,
const ImGuiTableHeaderData* data,
int data_count);
3563 IMGUI_API
ImGuiTable* TableFindByID(ImGuiID
id);
3564 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);
3565 IMGUI_API
void TableBeginInitMemory(
ImGuiTable* table,
int columns_count);
3566 IMGUI_API
void TableBeginApplyRequests(
ImGuiTable* table);
3567 IMGUI_API
void TableSetupDrawChannels(
ImGuiTable* table);
3568 IMGUI_API
void TableUpdateLayout(
ImGuiTable* table);
3569 IMGUI_API
void TableUpdateBorders(
ImGuiTable* table);
3570 IMGUI_API
void TableUpdateColumnsWeightFromWidth(
ImGuiTable* table);
3571 IMGUI_API
void TableDrawBorders(
ImGuiTable* table);
3572 IMGUI_API
void TableDrawDefaultContextMenu(
ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
3573 IMGUI_API
bool TableBeginContextMenuPopup(
ImGuiTable* table);
3574 IMGUI_API
void TableMergeDrawChannels(
ImGuiTable* table);
3575 inline ImGuiTableInstanceData* TableGetInstanceData(
ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3576 inline ImGuiID TableGetInstanceID(
ImGuiTable* table,
int instance_no) {
return TableGetInstanceData(table, instance_no)->TableInstanceID; }
3577 IMGUI_API
void TableSortSpecsSanitize(
ImGuiTable* table);
3578 IMGUI_API
void TableSortSpecsBuild(
ImGuiTable* table);
3579 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(
ImGuiTableColumn* column);
3582 IMGUI_API
void TableBeginRow(
ImGuiTable* table);
3583 IMGUI_API
void TableEndRow(
ImGuiTable* table);
3584 IMGUI_API
void TableBeginCell(
ImGuiTable* table,
int column_n);
3585 IMGUI_API
void TableEndCell(
ImGuiTable* table);
3586 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3587 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3588 IMGUI_API ImGuiID TableGetColumnResizeID(
ImGuiTable* table,
int column_n,
int instance_no = 0);
3589 IMGUI_API
float TableCalcMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3590 IMGUI_API
void TableSetColumnWidthAutoSingle(
ImGuiTable* table,
int column_n);
3591 IMGUI_API
void TableSetColumnWidthAutoAll(
ImGuiTable* table);
3592 IMGUI_API
void TableRemove(
ImGuiTable* table);
3593 IMGUI_API
void TableGcCompactTransientBuffers(
ImGuiTable* table);
3595 IMGUI_API
void TableGcCompactSettings();
3598 IMGUI_API
void TableLoadSettings(
ImGuiTable* table);
3599 IMGUI_API
void TableSaveSettings(
ImGuiTable* table);
3600 IMGUI_API
void TableResetSettings(
ImGuiTable* table);
3602 IMGUI_API
void TableSettingsAddSettingsHandler();
3608 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3613 inline int TabBarGetTabOrder(
ImGuiTabBar* tab_bar,
ImGuiTabItem* tab) {
return tab_bar->Tabs.index_from_ptr(tab); }
3616 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
3619 IMGUI_API
void TabBarQueueFocus(
ImGuiTabBar* tab_bar,
const char* tab_name);
3622 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
3623 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags,
ImGuiWindow* docked_window);
3624 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3626 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3627 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);
3632 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3633 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3634 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);
3635 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);
3636 IMGUI_API
void RenderTextEllipsis(
ImDrawList* draw_list,
const ImVec2& pos_min,
const ImVec2& pos_max,
float clip_max_x,
float ellipsis_max_x,
const char* text,
const char* text_end,
const ImVec2* text_size_if_known);
3637 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool borders =
true,
float rounding = 0.0f);
3638 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
3639 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);
3640 IMGUI_API
void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_None);
3641 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3642 IMGUI_API
void RenderMouseCursor(
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3645 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3647 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
3648 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3649 IMGUI_API
void RenderArrowDockMenu(
ImDrawList* draw_list,
ImVec2 p_min,
float sz, ImU32 col);
3650 IMGUI_API
void RenderRectFilledRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
3651 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3652 IMGUI_API ImDrawFlags CalcRoundingFlagsForRectInRect(
const ImRect& r_in,
const ImRect& r_outer,
float threshold);
3655 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3656 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3657 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3658 IMGUI_API
bool ImageButtonEx(ImGuiID
id, ImTextureID texture_id,
const ImVec2& image_size,
const ImVec2& uv0,
const ImVec2& uv1,
const ImVec4& bg_col,
const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
3659 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags,
float thickness = 1.0f);
3660 IMGUI_API
void SeparatorTextEx(ImGuiID
id,
const char* label,
const char* label_end,
float extra_width);
3661 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3662 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3665 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3667 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3668 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
3670 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
3671 IMGUI_API ImGuiID GetWindowResizeCornerID(
ImGuiWindow* window,
int n);
3672 IMGUI_API ImGuiID GetWindowResizeBorderID(
ImGuiWindow* window, ImGuiDir dir);
3675 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3676 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);
3677 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);
3678 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);
3681 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3682 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3683 IMGUI_API
bool TreeNodeGetOpen(ImGuiID storage_id);
3684 IMGUI_API
void TreeNodeSetOpen(ImGuiID storage_id,
bool open);
3685 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);
3690 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);
3691 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);
3692 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);
3693 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);
3694 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3695 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3699 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3700 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3701 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format,
void* p_data_when_empty = NULL);
3702 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3703 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3704 IMGUI_API
bool DataTypeIsZero(ImGuiDataType data_type,
const void* p_data);
3707 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);
3708 IMGUI_API
void InputTextDeactivateHook(ImGuiID
id);
3709 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3710 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);
3711 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
3712 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3713 IMGUI_API
void SetNextItemRefVal(ImGuiDataType data_type,
void* p_data);
3716 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3717 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3718 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3721 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);
3724 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);
3725 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);
3726 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);
3729 IMGUI_API
void GcCompactTransientMiscBuffers();
3730 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
3731 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
3734 IMGUI_API
bool ErrorLog(
const char* msg);
3738 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
3739 IMGUI_API
void ErrorCheckEndFrameFinalizeErrorTooltip();
3740 IMGUI_API
bool BeginErrorTooltip();
3741 IMGUI_API
void EndErrorTooltip();
3744 IMGUI_API
void DebugAllocHook(
ImGuiDebugAllocInfo* info,
int frame_count,
void* ptr,
size_t size);
3745 IMGUI_API
void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
3746 IMGUI_API
void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
3747 IMGUI_API
void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
3748 IMGUI_API
void DebugTextUnformattedWithLocateItem(
const char* line_begin,
const char* line_end);
3749 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
3750 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
3751 IMGUI_API
void DebugLocateItemResolveWithLastItem();
3752 IMGUI_API
void DebugBreakClearData();
3753 IMGUI_API
bool DebugBreakButton(
const char* label,
const char* description_of_location);
3754 IMGUI_API
void DebugBreakButtonTooltip(
bool keyboard_only,
const char* description_of_location);
3756 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
3758 IMGUI_API
void DebugNodeDockNode(
ImGuiDockNode* node,
const char* label);
3760 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
3761 IMGUI_API
void DebugNodeFont(
ImFont* font);
3763 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
3764 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
3765 IMGUI_API
void DebugNodeTable(
ImGuiTable* table);
3770 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
3773 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(
ImGuiWindow** windows,
int windows_size,
ImGuiWindow* parent_in_begin_stack);
3775 IMGUI_API
void DebugNodePlatformMonitor(
ImGuiPlatformMonitor* monitor,
const char* label,
int idx);
3776 IMGUI_API
void DebugRenderKeyboardPreview(
ImDrawList* draw_list);
3780 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 3781 inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); }
3782 inline bool TreeNodeBehaviorIsOpen(ImGuiID
id, ImGuiTreeNodeFlags flags = 0) {
return TreeNodeUpdateNextOpen(
id, flags); }
3808 #ifdef IMGUI_ENABLE_STB_TRUETYPE 3809 IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
3811 IMGUI_API
void ImFontAtlasUpdateConfigDataPointers(
ImFontAtlas* atlas);
3812 IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
3814 IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
3815 IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
3816 IMGUI_API
void ImFontAtlasBuildRender8bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned char in_marker_pixel_value);
3817 IMGUI_API
void ImFontAtlasBuildRender32bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned int in_marker_pixel_value);
3818 IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
3819 IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
3825 #ifdef IMGUI_ENABLE_TEST_ENGINE 3827 extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
3828 extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
3829 extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
3832 #define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box 3833 #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) 3834 #define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log 3836 #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0) 3837 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g) 3842 #if defined(__clang__) 3843 #pragma clang diagnostic pop 3844 #elif defined(__GNUC__) 3845 #pragma GCC diagnostic pop 3849 #pragma warning (pop) 3852 #endif // #ifndef IMGUI_DISABLE Definition: imgui_internal.h:1248
Definition: imgui_internal.h:2822
Definition: imgui_internal.h:766
Definition: imgui_internal.h:1402
Definition: imgui_internal.h:1693
Definition: imgui_internal.h:2010
Definition: imgui_internal.h:1655
Definition: imgui_internal.h:702
Definition: imgui_internal.h:1644
Definition: imgui_internal.h:2114
Definition: imgui_internal.h:721
Definition: imgui_internal.h:1092
Definition: imgui_internal.h:1625
Definition: imgui_internal.h:505
Definition: imgui_internal.h:1033
Definition: imgui_internal.h:2802
Definition: imgui_internal.h:1114
Definition: imgui_internal.h:1936
Definition: imgui_internal.h:1294
Definition: imgui_internal.h:1728
Definition: imgui_internal.h:586
Definition: imgui_internal.h:2121
Definition: imgui_internal.h:1109
Definition: imgui_internal.h:2149
Definition: imgui_internal.h:1302
Definition: imgui_internal.h:1043
Definition: imgui_internal.h:1309
Definition: imgui_internal.h:601
Definition: imgui_internal.h:1267
Definition: imgui_internal.h:3093
Definition: imgui_internal.h:1958
Definition: imgui_internal.h:1189
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: imgui_internal.h:2969
MouseButton
Definition: events.h:183
Definition: imgui_internal.h:1056
Definition: imgui_internal.h:615
Definition: imgui_internal.h:2131
Definition: imgui_internal.h:1459
Definition: imgui_internal.h:1074
Definition: imgui_internal.h:1433
Definition: imgui_internal.h:1447
Definition: imgui_internal.h:2633
Definition: imgui_internal.h:1026
Definition: imgui_internal.h:1760
Definition: imgui_internal.h:1529
Definition: imgui_internal.h:1785
Definition: imgui_internal.h:810
Definition: imgui_internal.h:1941
Definition: imgui_internal.h:2877
Definition: imgui_internal.h:3802
Definition: imgui_internal.h:1703
Definition: imgui_internal.h:1228
Definition: imgui_internal.h:513
Definition: imgui_internal.h:2937
Definition: imstb_textedit.h:329
Definition: imgui_internal.h:1608
Definition: imgui_internal.h:1855
Definition: imgui_internal.h:3140
Definition: imgui_internal.h:2583
Definition: imgui_internal.h:645
Definition: imgui_internal.h:2195
Definition: imgui_internal.h:816
Definition: imgui_internal.h:2956
Definition: imgui_internal.h:790
Definition: imgui_internal.h:1276
Definition: imgui_internal.h:802
Definition: imgui_internal.h:2067
Definition: imgui_internal.h:3116
Definition: imgui_internal.h:2180
Definition: imgui_internal.h:668
Definition: imgui_internal.h:523
Definition: imgui_internal.h:2029
Definition: imgui_internal.h:1516