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
69#pragma warning (disable: 4251)
70#pragma warning (disable: 26812)
71#pragma warning (disable: 26495)
72#if defined(_MSC_VER) && _MSC_VER >= 1922
73#pragma warning (disable: 5054)
79#pragma clang diagnostic push
80#if __has_warning("-Wunknown-warning-option")
81#pragma clang diagnostic ignored "-Wunknown-warning-option"
83#pragma clang diagnostic ignored "-Wunknown-pragmas"
84#pragma clang diagnostic ignored "-Wfloat-equal"
85#pragma clang diagnostic ignored "-Wunused-function"
86#pragma clang diagnostic ignored "-Wmissing-prototypes"
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"
91#pragma clang diagnostic ignored "-Wmissing-noreturn"
92#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
93#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
94#elif defined(__GNUC__)
95#pragma GCC diagnostic push
96#pragma GCC diagnostic ignored "-Wpragmas"
97#pragma GCC diagnostic ignored "-Wclass-memaccess"
98#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
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
109#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
111#ifdef IMGUI_DISABLE_MATH_FUNCTIONS
112#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
117#ifndef IMGUI_ENABLE_FREETYPE
118#define IMGUI_ENABLE_STB_TRUETYPE
138struct ImGuiInputTextDeactivateData;
161struct ImGuiTableColumnsSettings;
171enum ImGuiLocKey : int;
172typedef int ImGuiLayoutType;
175typedef int ImGuiActivateFlags;
176typedef int ImGuiDebugLogFlags;
177typedef int ImGuiFocusRequestFlags;
178typedef int ImGuiItemStatusFlags;
179typedef int ImGuiOldColumnFlags;
180typedef int ImGuiNavRenderCursorFlags;
181typedef int ImGuiNavMoveFlags;
182typedef int ImGuiNextItemDataFlags;
183typedef int ImGuiNextWindowDataFlags;
184typedef int ImGuiScrollFlags;
185typedef int ImGuiSeparatorFlags;
186typedef int ImGuiTextFlags;
187typedef int ImGuiTooltipFlags;
188typedef int ImGuiTypingSelectFlags;
189typedef int ImGuiWindowRefreshFlags;
206#ifndef IMGUI_DEBUG_PRINTF
207#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
208#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
210#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
215#ifndef IMGUI_DISABLE_DEBUG_TOOLS
216#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
218#define IMGUI_DEBUG_LOG(...) ((void)0)
220#define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0)
221#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
222#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
223#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
224#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
225#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
226#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
227#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
228#define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
231#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
236#ifdef IMGUI_DEBUG_PARANOID
237#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
239#define IM_ASSERT_PARANOID(_EXPR)
243#define IM_PI 3.14159265358979323846f
245#define IM_NEWLINE "\r\n"
247#define IM_NEWLINE "\n"
250#define IM_TABSIZE (4)
252#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1))
253#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f)))
254#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f))
255#define IM_TRUNC(_VAL) ((float)(int)(_VAL))
256#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f))
257#define IM_STRINGIFY_HELPER(_X) #_X
258#define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X)
259#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
260#define IM_FLOOR IM_TRUNC
265#define IMGUI_CDECL __cdecl
271#if defined(_MSC_VER) && !defined(__clang__)
272#define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX))
274#define IM_MSVC_WARNING_SUPPRESS(XXXX)
280#ifndef IM_DEBUG_BREAK
281#if defined (_MSC_VER)
282#define IM_DEBUG_BREAK() __debugbreak()
283#elif defined(__clang__)
284#define IM_DEBUG_BREAK() __builtin_debugtrap()
285#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
286#define IM_DEBUG_BREAK() __asm__ volatile("int3;nop")
287#elif defined(__GNUC__) && defined(__thumb__)
288#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
289#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
290#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0")
292#define IM_DEBUG_BREAK() IM_ASSERT(0)
298#if defined(_MSC_VER) && !defined(__clang__)
299#define IM_PRId64 "I64d"
300#define IM_PRIu64 "I64u"
301#define IM_PRIX64 "I64X"
303#define IM_PRId64 "lld"
304#define IM_PRIu64 "llu"
305#define IM_PRIX64 "llX"
335IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImGuiID seed = 0);
336IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImGuiID seed = 0);
340static 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); }
344IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
347static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
348static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
349static inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
352IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
353IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
354IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
355IMGUI_API
char* ImStrdup(
const char* str);
356IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
357IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
358IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
359IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
360IMGUI_API
void ImStrTrimBlanks(
char* str);
361IMGUI_API
const char* ImStrSkipBlank(
const char* str);
362IMGUI_API
int ImStrlenW(
const ImWchar* str);
363IMGUI_API
const char* ImStrbol(
const char* buf_mid_line,
const char* buf_begin);
364IM_MSVC_RUNTIME_CHECKS_OFF
365static inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
366static inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
367static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
368static inline bool ImCharIsXdigitA(
char c) {
return (c >=
'0' && c <=
'9') || (c >=
'A' && c <=
'F') || (c >=
'a' && c <=
'f'); }
369IM_MSVC_RUNTIME_CHECKS_RESTORE
372IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
373IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
374IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
375IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
376IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
377IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
378IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
379IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
380IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
381IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
384IMGUI_API const
char* ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
385IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
386IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
387IMGUI_API
int ImTextStrFromUtf8(ImWchar* out_buf,
int out_buf_size, const
char* in_text, const
char* in_text_end, const
char** in_remaining = NULL);
388IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
389IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
390IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
391IMGUI_API const
char* ImTextFindPreviousUtf8Codepoint(const
char* in_text_start, const
char* in_text_curr);
392IMGUI_API
int ImTextCountLines(const
char* in_text, const
char* in_text_end);
395#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
396#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
397typedef void* ImFileHandle;
398static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
399static inline bool ImFileClose(ImFileHandle) {
return false; }
400static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
401static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
402static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
404#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
405typedef FILE* ImFileHandle;
406IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
407IMGUI_API
bool ImFileClose(ImFileHandle file);
408IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
409IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
410IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
412#define IMGUI_DISABLE_TTY_FUNCTIONS
414IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
417IM_MSVC_RUNTIME_CHECKS_OFF
419#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
420#define ImFabs(X) fabsf(X)
421#define ImSqrt(X) sqrtf(X)
422#define ImFmod(X, Y) fmodf((X), (Y))
423#define ImCos(X) cosf(X)
424#define ImSin(X) sinf(X)
425#define ImAcos(X) acosf(X)
426#define ImAtan2(Y, X) atan2f((Y), (X))
427#define ImAtof(STR) atof(STR)
428#define ImCeil(X) ceilf(X)
429static inline float ImPow(
float x,
float y) {
return powf(x, y); }
430static inline double ImPow(
double x,
double y) {
return pow(x, y); }
431static inline float ImLog(
float x) {
return logf(x); }
432static inline double ImLog(
double x) {
return log(x); }
433static inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
434static inline float ImAbs(
float x) {
return fabsf(x); }
435static inline double ImAbs(
double x) {
return fabs(x); }
436static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
437static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
438#ifdef IMGUI_ENABLE_SSE
439static inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
441static inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
443static inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
447template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
448template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
449template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
450template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
451template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
452template<
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; }
453template<
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; }
455static 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); }
456static 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); }
457static 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); }
458static 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); }
459static 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); }
460static 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); }
461static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
462static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
463static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
464static 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; }
465static inline float ImTrunc(
float f) {
return (
float)(int)(f); }
466static inline ImVec2 ImTrunc(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
467static inline float ImFloor(
float f) {
return (
float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); }
468static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
469static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
470static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
471static 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); }
472static 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; }
473static inline float ImLinearRemapClamp(
float s0,
float s1,
float d0,
float d1,
float x) {
return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; }
475static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
476static inline float ImExponentialMovingAverage(
float avg,
float sample,
int n) { avg -= avg / n; avg += sample / n;
return avg; }
477IM_MSVC_RUNTIME_CHECKS_RESTORE
487IMGUI_API
void ImTriangleBarycentricCoords(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c,
const ImVec2& p,
float& out_u,
float& out_v,
float& out_w);
488inline 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; }
489inline 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; }
493IM_MSVC_RUNTIME_CHECKS_OFF
497 constexpr ImVec1() : x(0.0f) { }
498 constexpr ImVec1(
float _x) : x(_x) { }
505 constexpr ImVec2ih() : x(0), y(0) {}
506 constexpr ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
507 constexpr explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
517 constexpr ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
519 constexpr ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
520 constexpr ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
522 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
523 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
524 float GetWidth()
const {
return Max.x - Min.x; }
525 float GetHeight()
const {
return Max.y - Min.y; }
526 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
527 ImVec2 GetTL()
const {
return Min; }
530 ImVec2 GetBR()
const {
return Max; }
531 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
532 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; }
533 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; }
534 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; }
535 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; }
536 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; }
537 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
538 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
539 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
540 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
541 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
542 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
543 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
544 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); }
545 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
546 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
550#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0)
551#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31))))
552inline size_t ImBitArrayGetStorageSizeInBytes(
int bitcount) {
return (
size_t)((bitcount + 31) >> 5) << 2; }
553inline void ImBitArrayClearAllBits(ImU32* arr,
int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
554inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
555inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
556inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
557inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
562 int a_mod = (n & 31);
563 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
564 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
570typedef ImU32* ImBitArrayPtr;
574template<
int BITCOUNT,
int OFFSET = 0>
577 ImU32 Storage[(BITCOUNT + 31) >> 5];
579 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
580 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
581 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
582 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
583 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
584 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); }
585 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
593 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
594 void Clear() { Storage.clear(); }
595 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return IM_BITARRAY_TESTBIT(Storage.Data, n); }
596 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
597 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
599IM_MSVC_RUNTIME_CHECKS_RESTORE
610 inline ImSpan() { Data = DataEnd = NULL; }
611 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
612 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
614 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
615 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
616 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
617 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
618 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
619 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
621 inline T* begin() {
return Data; }
622 inline const T* begin()
const {
return Data; }
623 inline T* end() {
return DataEnd; }
624 inline const T* end()
const {
return DataEnd; }
627 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
643 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; }
644 inline int GetArenaSizeInBytes() {
return CurrOff; }
645 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
646 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
647 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
649 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
655typedef int ImPoolIdx;
662 ImPoolIdx AliveCount;
664 ImPool() { FreeIdx = AliveCount = 0; }
666 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
667 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
668 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
669 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
670 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
671 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; }
672 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]; }
673 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
674 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
675 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
679 int GetAliveCount()
const {
return AliveCount; }
680 int GetBufSize()
const {
return Buf.Size; }
681 int GetMapSize()
const {
return Map.Data.Size; }
682 T* TryGetMapData(ImPoolIdx n) {
int idx = Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
695 void clear() { Buf.clear(); }
696 bool empty()
const {
return Buf.Size == 0; }
697 int size()
const {
return Buf.Size; }
698 T* alloc_chunk(
size_t sz) {
size_t HDR_SZ = 4; sz = IM_MEMALIGN(HDR_SZ + sz, 4u);
int off = Buf.Size; Buf.resize(off + (
int)sz); ((
int*)(
void*)(Buf.Data + off))[0] = (int)sz;
return (T*)(
void*)(Buf.Data + off + (
int)HDR_SZ); }
699 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
700 T* next_chunk(T* p) {
size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(
void*)((
char*)(
void*)p + chunk_size(p));
if (p == (T*)(
void*)((
char*)end() + HDR_SZ))
return (T*)0; IM_ASSERT(p < end());
return p; }
701 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
702 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
703 int offset_from_ptr(
const T* p) { IM_ASSERT(p >= begin() && p < end());
const ptrdiff_t off = (
const char*)p - Buf.Data;
return (
int)off; }
704 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
715 void clear() { LineOffsets.clear(); EndOffset = 0; }
716 int size() {
return LineOffsets.Size; }
717 const char* get_line_begin(
const char* base,
int n) {
return base + LineOffsets[n]; }
718 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
719 void append(
const char* base,
int old_size,
int new_size);
738#define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
739#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
740#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
741#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)
744#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))))
745#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD))
748#ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE
749#define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48
751#define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE
761 float CurveTessellationTol;
762 float CircleSegmentMaxError;
763 ImVec4 ClipRectFullscreen;
764 ImDrawListFlags InitialFlags;
770 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
771 float ArcFastRadiusCutoff;
772 ImU8 CircleSegmentCounts[64];
776 void SetCircleTessellationMaxError(
float max_error);
796 void* GetVarPtr(
void* parent)
const {
return (
void*)((
unsigned char*)parent + Offset); }
809 const char* PrintFmt;
814enum ImGuiDataTypePrivate_
816 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
817 ImGuiDataType_Pointer,
828enum ImGuiItemFlagsPrivate_
831 ImGuiItemFlags_Disabled = 1 << 10,
832 ImGuiItemFlags_ReadOnly = 1 << 11,
833 ImGuiItemFlags_MixedValue = 1 << 12,
834 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13,
835 ImGuiItemFlags_AllowOverlap = 1 << 14,
836 ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15,
837 ImGuiItemFlags_NoMarkEdited = 1 << 16,
840 ImGuiItemFlags_Inputable = 1 << 20,
841 ImGuiItemFlags_HasSelectionUserData = 1 << 21,
842 ImGuiItemFlags_IsMultiSelect = 1 << 22,
844 ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups,
852enum ImGuiItemStatusFlags_
854 ImGuiItemStatusFlags_None = 0,
855 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
856 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
857 ImGuiItemStatusFlags_Edited = 1 << 2,
858 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
859 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
860 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
861 ImGuiItemStatusFlags_Deactivated = 1 << 6,
862 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
863 ImGuiItemStatusFlags_Visible = 1 << 8,
864 ImGuiItemStatusFlags_HasClipRect = 1 << 9,
865 ImGuiItemStatusFlags_HasShortcut = 1 << 10,
868#ifdef IMGUI_ENABLE_TEST_ENGINE
869 ImGuiItemStatusFlags_Openable = 1 << 20,
870 ImGuiItemStatusFlags_Opened = 1 << 21,
871 ImGuiItemStatusFlags_Checkable = 1 << 22,
872 ImGuiItemStatusFlags_Checked = 1 << 23,
873 ImGuiItemStatusFlags_Inputable = 1 << 24,
878enum ImGuiHoveredFlagsPrivate_
880 ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
881 ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
882 ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
886enum ImGuiInputTextFlagsPrivate_
889 ImGuiInputTextFlags_Multiline = 1 << 26,
890 ImGuiInputTextFlags_MergedItem = 1 << 27,
891 ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28,
895enum ImGuiButtonFlagsPrivate_
897 ImGuiButtonFlags_PressedOnClick = 1 << 4,
898 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
899 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
900 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
901 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
902 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
904 ImGuiButtonFlags_FlattenChildren = 1 << 11,
905 ImGuiButtonFlags_AllowOverlap = 1 << 12,
908 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
909 ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16,
910 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
911 ImGuiButtonFlags_NoNavFocus = 1 << 18,
912 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
913 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
914 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
915 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
916 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
920enum ImGuiComboFlagsPrivate_
922 ImGuiComboFlags_CustomPreview = 1 << 20,
926enum ImGuiSliderFlagsPrivate_
928 ImGuiSliderFlags_Vertical = 1 << 20,
929 ImGuiSliderFlags_ReadOnly = 1 << 21,
933enum ImGuiSelectableFlagsPrivate_
936 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
937 ImGuiSelectableFlags_SelectOnNav = 1 << 21,
938 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
939 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
940 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
941 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
942 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
943 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
947enum ImGuiTreeNodeFlagsPrivate_
949 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,
950 ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,
951 ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
954enum ImGuiSeparatorFlags_
956 ImGuiSeparatorFlags_None = 0,
957 ImGuiSeparatorFlags_Horizontal = 1 << 0,
958 ImGuiSeparatorFlags_Vertical = 1 << 1,
959 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
965enum ImGuiFocusRequestFlags_
967 ImGuiFocusRequestFlags_None = 0,
968 ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0,
969 ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1,
974 ImGuiTextFlags_None = 0,
975 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
978enum ImGuiTooltipFlags_
980 ImGuiTooltipFlags_None = 0,
981 ImGuiTooltipFlags_OverridePrevious = 1 << 1,
988 ImGuiLayoutType_Horizontal = 0,
989 ImGuiLayoutType_Vertical = 1
994 ImGuiLogType_None = 0,
998 ImGuiLogType_Clipboard,
1004 ImGuiAxis_None = -1,
1011 ImGuiPlotType_Lines,
1012 ImGuiPlotType_Histogram,
1025 ImGuiStyleVar VarIdx;
1026 union {
int BackupInt[2];
float BackupFloat[2]; };
1027 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
1028 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
1029 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
1037 ImVec2 BackupCursorMaxPos;
1038 ImVec2 BackupCursorPosPrevLine;
1039 float BackupPrevLineTextBaseOffset;
1040 ImGuiLayoutType BackupLayout;
1050 ImVec2 BackupCursorMaxPos;
1051 ImVec2 BackupCursorPosPrevLine;
1053 ImVec1 BackupGroupOffset;
1054 ImVec2 BackupCurrLineSize;
1055 float BackupCurrLineTextBaseOffset;
1056 ImGuiID BackupActiveIdIsAlive;
1057 bool BackupActiveIdPreviousFrameIsAlive;
1058 bool BackupHoveredIdIsAlive;
1059 bool BackupIsSameLine;
1067 ImU32 NextTotalWidth;
1071 ImU16 OffsetShortcut;
1076 void Update(
float spacing,
bool window_reappearing);
1077 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1078 void CalcNextTotalWidth(
bool update_offsets);
1088 void ClearFreeMemory() { ID = 0; TextA.clear(); }
1092#undef IMSTB_TEXTEDIT_STRING
1093#undef IMSTB_TEXTEDIT_CHARTYPE
1094#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
1095#define IMSTB_TEXTEDIT_CHARTYPE char
1096#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
1097#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
1098#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
1100typedef ImStb::STB_TexteditState ImStbTexteditState;
1107 ImStbTexteditState* Stb;
1117 bool SelectedAllMouseLock;
1119 ImGuiInputTextFlags Flags;
1121 int ReloadSelectionStart;
1122 int ReloadSelectionEnd;
1126 void ClearText() { CurLenA = 0; TextA[0] = 0; CursorClamp(); }
1127 void ClearFreeMemory() { TextA.clear(); InitialTextA.clear(); }
1128 void OnKeyPressed(
int key);
1129 void OnCharPressed(
unsigned int c);
1132 void CursorAnimReset();
1134 bool HasSelection()
const;
1135 void ClearSelection();
1136 int GetCursorPos()
const;
1137 int GetSelectionStart()
const;
1138 int GetSelectionEnd()
const;
1146 void ReloadUserBufAndSelectAll();
1147 void ReloadUserBufAndKeepSelection();
1148 void ReloadUserBufAndMoveToEnd();
1151enum ImGuiWindowRefreshFlags_
1153 ImGuiWindowRefreshFlags_None = 0,
1154 ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0,
1155 ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1,
1156 ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2,
1160enum ImGuiNextWindowDataFlags_
1162 ImGuiNextWindowDataFlags_None = 0,
1163 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1164 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1165 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1166 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1167 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1168 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1169 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1170 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1171 ImGuiNextWindowDataFlags_HasChildFlags = 1 << 8,
1172 ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 9,
1178 ImGuiNextWindowDataFlags Flags;
1181 ImGuiCond CollapsedCond;
1187 ImGuiChildFlags ChildFlags;
1189 ImRect SizeConstraintRect;
1190 ImGuiSizeCallback SizeCallback;
1191 void* SizeCallbackUserData;
1193 ImVec2 MenuBarOffsetMinVal;
1194 ImGuiWindowRefreshFlags RefreshFlagsVal;
1197 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1200enum ImGuiNextItemDataFlags_
1202 ImGuiNextItemDataFlags_None = 0,
1203 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1204 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1205 ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
1206 ImGuiNextItemDataFlags_HasRefVal = 1 << 3,
1207 ImGuiNextItemDataFlags_HasStorageID = 1 << 4,
1212 ImGuiNextItemDataFlags HasFlags;
1213 ImGuiItemFlags ItemFlags;
1215 ImGuiID FocusScopeId;
1216 ImGuiSelectionUserData SelectionUserData;
1218 ImGuiKeyChord Shortcut;
1219 ImGuiInputFlags ShortcutFlags;
1226 inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; }
1233 ImGuiItemFlags ItemFlags;
1234 ImGuiItemStatusFlags StatusFlags;
1240 ImGuiKeyChord Shortcut;
1252 ImGuiTreeNodeFlags TreeFlags;
1253 ImGuiItemFlags ItemFlags;
1260 short SizeOfWindowStack;
1261 short SizeOfIDStack;
1262 short SizeOfTreeStack;
1263 short SizeOfColorStack;
1264 short SizeOfStyleVarStack;
1265 short SizeOfFontStack;
1266 short SizeOfFocusScopeStack;
1267 short SizeOfGroupStack;
1268 short SizeOfItemFlagsStack;
1269 short SizeOfBeginPopupStack;
1270 short SizeOfDisabledStack;
1281 bool DisabledOverrideReenable;
1304enum ImGuiPopupPositionPolicy
1306 ImGuiPopupPositionPolicy_Default,
1307 ImGuiPopupPositionPolicy_ComboBox,
1308 ImGuiPopupPositionPolicy_Tooltip,
1319 ImGuiID OpenParentId;
1323 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1334#define ImGuiKey_LegacyNativeKey_BEGIN 0
1335#define ImGuiKey_LegacyNativeKey_END 512
1336#define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
1337#define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
1338#define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
1339#define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
1340#define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
1341#define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
1342#define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
1343#define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
1346#define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
1347#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
1348#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
1349#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
1350#define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown)
1351#define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight)
1352#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
1353#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
1355enum ImGuiInputEventType
1357 ImGuiInputEventType_None = 0,
1358 ImGuiInputEventType_MousePos,
1359 ImGuiInputEventType_MouseWheel,
1360 ImGuiInputEventType_MouseButton,
1361 ImGuiInputEventType_Key,
1362 ImGuiInputEventType_Text,
1363 ImGuiInputEventType_Focus,
1364 ImGuiInputEventType_COUNT
1367enum ImGuiInputSource
1369 ImGuiInputSource_None = 0,
1370 ImGuiInputSource_Mouse,
1371 ImGuiInputSource_Keyboard,
1372 ImGuiInputSource_Gamepad,
1373 ImGuiInputSource_COUNT
1387 ImGuiInputEventType Type;
1388 ImGuiInputSource Source;
1399 bool AddedByTestEngine;
1405#define ImGuiKeyOwner_Any ((ImGuiID)0)
1406#define ImGuiKeyOwner_NoOwner ((ImGuiID)-1)
1409typedef ImS16 ImGuiKeyRoutingIndex;
1414 ImGuiKeyRoutingIndex NextEntryIndex;
1416 ImU8 RoutingCurrScore;
1417 ImU8 RoutingNextScore;
1418 ImGuiID RoutingCurr;
1419 ImGuiID RoutingNext;
1421 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
1428 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1433 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1443 bool LockUntilRelease;
1445 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease =
false; }
1451enum ImGuiInputFlagsPrivate_
1455 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1456 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1457 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1460 ImGuiInputFlags_RepeatUntilRelease = 1 << 4,
1461 ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5,
1462 ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6,
1463 ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7,
1467 ImGuiInputFlags_LockThisFrame = 1 << 20,
1468 ImGuiInputFlags_LockUntilRelease = 1 << 21,
1471 ImGuiInputFlags_CondHovered = 1 << 22,
1472 ImGuiInputFlags_CondActive = 1 << 23,
1473 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1476 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1477 ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
1478 ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
1479 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1480 ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
1481 ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
1482 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
1483 ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
1484 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
1485 ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
1486 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1487 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1499 bool PosToIndexConvert;
1500 ImS8 PosToIndexOffsetMin;
1501 ImS8 PosToIndexOffsetMax;
1511 float LossynessOffset;
1517 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1524enum ImGuiActivateFlags_
1526 ImGuiActivateFlags_None = 0,
1527 ImGuiActivateFlags_PreferInput = 1 << 0,
1528 ImGuiActivateFlags_PreferTweak = 1 << 1,
1529 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1530 ImGuiActivateFlags_FromTabbing = 1 << 3,
1531 ImGuiActivateFlags_FromShortcut = 1 << 4,
1535enum ImGuiScrollFlags_
1537 ImGuiScrollFlags_None = 0,
1538 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1539 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1540 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1541 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1542 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1543 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1544 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1545 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1546 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1549enum ImGuiNavRenderCursorFlags_
1551 ImGuiNavRenderCursorFlags_None = 0,
1552 ImGuiNavRenderCursorFlags_Compact = 1 << 1,
1553 ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2,
1554 ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
1555#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1556 ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None,
1557 ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact,
1558 ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw,
1559 ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding,
1563enum ImGuiNavMoveFlags_
1565 ImGuiNavMoveFlags_None = 0,
1566 ImGuiNavMoveFlags_LoopX = 1 << 0,
1567 ImGuiNavMoveFlags_LoopY = 1 << 1,
1568 ImGuiNavMoveFlags_WrapX = 1 << 2,
1569 ImGuiNavMoveFlags_WrapY = 1 << 3,
1570 ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
1571 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1572 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1573 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1574 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1575 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1576 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1577 ImGuiNavMoveFlags_IsTabbing = 1 << 10,
1578 ImGuiNavMoveFlags_IsPageMove = 1 << 11,
1579 ImGuiNavMoveFlags_Activate = 1 << 12,
1580 ImGuiNavMoveFlags_NoSelect = 1 << 13,
1581 ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14,
1582 ImGuiNavMoveFlags_NoClearActiveId = 1 << 15,
1587 ImGuiNavLayer_Main = 0,
1588 ImGuiNavLayer_Menu = 1,
1597 ImGuiID FocusScopeId;
1599 ImGuiItemFlags ItemFlags;
1603 ImGuiSelectionUserData SelectionUserData;
1606 void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
1621enum ImGuiTypingSelectFlags_
1623 ImGuiTypingSelectFlags_None = 0,
1624 ImGuiTypingSelectFlags_AllowBackspace = 1 << 0,
1625 ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1,
1631 ImGuiTypingSelectFlags Flags;
1632 int SearchBufferLen;
1633 const char* SearchBuffer;
1635 bool SingleCharMode;
1636 ImS8 SingleCharSize;
1643 char SearchBuffer[64];
1645 int LastRequestFrame = 0;
1646 float LastRequestTime = 0.0f;
1647 bool SingleCharModeLock =
false;
1650 void Clear() { SearchBuffer[0] = 0; SingleCharModeLock =
false; }
1658enum ImGuiOldColumnFlags_
1660 ImGuiOldColumnFlags_None = 0,
1661 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1662 ImGuiOldColumnFlags_NoResize = 1 << 1,
1663 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1664 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1665 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1668#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1681 float OffsetNormBeforeResize;
1682 ImGuiOldColumnFlags Flags;
1691 ImGuiOldColumnFlags Flags;
1693 bool IsBeingResized;
1696 float OffMinX, OffMaxX;
1697 float LineMinY, LineMaxY;
1698 float HostCursorPosY;
1699 float HostCursorMaxPosX;
1700 ImRect HostInitialClipRect;
1701 ImRect HostBackupClipRect;
1702 ImRect HostBackupParentWorkRect;
1719 bool IsStartedFromVoid;
1720 bool IsStartedSetNavIdOnce;
1722 ImGuiKeyChord KeyMods : 16;
1731 ImRect BoxSelectRectPrev;
1732 ImRect BoxSelectRectCurr;
1742#define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1)
1749 ImGuiID FocusScopeId;
1750 ImGuiMultiSelectFlags Flags;
1752 ImVec2 BackupCursorMaxPos;
1753 ImGuiSelectionUserData LastSubmittedItem;
1754 ImGuiID BoxSelectId;
1755 ImGuiKeyChord KeyMods;
1756 ImS8 LoopRequestSetAll;
1759 bool IsKeyboardSetRange;
1761 bool RangeSrcPassedBy;
1762 bool RangeDstPassedBy;
1765 void Clear() {
size_t io_sz =
sizeof(IO); ClearIO(); memset((
void*)(&IO + 1), 0,
sizeof(*
this) - io_sz); }
1766 void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset =
false; }
1774 int LastFrameActive;
1775 int LastSelectionSize;
1778 ImGuiSelectionUserData RangeSrcItem;
1779 ImGuiSelectionUserData NavIdItem;
1781 ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; }
1788#ifdef IMGUI_HAS_DOCK
1800 int BgFgDrawListsLastFrame[2];
1811 ImVec2 BuildWorkInsetMin;
1812 ImVec2 BuildWorkInsetMax;
1814 ImGuiViewportP() { BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; }
1815 ~ImGuiViewportP() {
if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]);
if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
1818 ImVec2 CalcWorkRectPos(
const ImVec2& inset_min)
const {
return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
1819 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)); }
1820 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); }
1823 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1824 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
1825 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); }
1846 char* GetName() {
return (
char*)(
this + 1); }
1851 const char* TypeName;
1869enum ImGuiLocKey :
int
1871 ImGuiLocKey_VersionStr,
1872 ImGuiLocKey_TableSizeOne,
1873 ImGuiLocKey_TableSizeAllFit,
1874 ImGuiLocKey_TableSizeAllDefault,
1875 ImGuiLocKey_TableResetOrder,
1876 ImGuiLocKey_WindowingMainMenuBar,
1877 ImGuiLocKey_WindowingPopup,
1878 ImGuiLocKey_WindowingUntitled,
1879 ImGuiLocKey_OpenLink_s,
1880 ImGuiLocKey_CopyLink,
1899#ifndef IM_ASSERT_USER_ERROR
1900#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0)
1904typedef void (*ImGuiErrorCallback)(
ImGuiContext* ctx,
void* user_data,
const char* msg);
1910enum ImGuiDebugLogFlags_
1913 ImGuiDebugLogFlags_None = 0,
1914 ImGuiDebugLogFlags_EventError = 1 << 0,
1915 ImGuiDebugLogFlags_EventActiveId = 1 << 1,
1916 ImGuiDebugLogFlags_EventFocus = 1 << 2,
1917 ImGuiDebugLogFlags_EventPopup = 1 << 3,
1918 ImGuiDebugLogFlags_EventNav = 1 << 4,
1919 ImGuiDebugLogFlags_EventClipper = 1 << 5,
1920 ImGuiDebugLogFlags_EventSelection = 1 << 6,
1921 ImGuiDebugLogFlags_EventIO = 1 << 7,
1922 ImGuiDebugLogFlags_EventInputRouting = 1 << 8,
1923 ImGuiDebugLogFlags_EventDocking = 1 << 9,
1924 ImGuiDebugLogFlags_EventViewport = 1 << 10,
1926 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
1927 ImGuiDebugLogFlags_OutputToTTY = 1 << 20,
1928 ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21,
1940 int TotalAllocCount;
1942 ImS16 LastEntriesIdx;
1950 bool ShowDebugLog =
false;
1951 bool ShowIDStackTool =
false;
1952 bool ShowWindowsRects =
false;
1953 bool ShowWindowsBeginOrder =
false;
1954 bool ShowTablesRects =
false;
1955 bool ShowDrawCmdMesh =
true;
1956 bool ShowDrawCmdBoundingBoxes =
true;
1957 bool ShowTextEncodingViewer =
false;
1958 bool ShowAtlasTintedWithTextColor =
false;
1959 int ShowWindowsRectsType = -1;
1960 int ShowTablesRectsType = -1;
1961 int HighlightMonitorIdx = -1;
1962 ImGuiID HighlightViewportID = 0;
1968 ImS8 QueryFrameCount;
1970 ImGuiDataType DataType : 8;
1979 int LastActiveFrame;
1983 bool CopyToClipboardOnCtrlC;
1984 float CopyToClipboardLastTime;
1986 ImGuiIDStackTool() { memset(
this, 0,
sizeof(*
this)); CopyToClipboardLastTime = -FLT_MAX; }
1994enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
1999 ImGuiContextHookType Type;
2001 ImGuiContextHookCallback Callback;
2014 bool FontAtlasOwnedByContext;
2022 float CurrentDpiScale;
2026 int FrameCountEnded;
2027 int FrameCountRendered;
2028 bool WithinFrameScope;
2029 bool WithinFrameScopeWithImplicitWindow;
2030 bool WithinEndChild;
2032 bool TestEngineHookItems;
2034 char ContextName[16];
2039 ImGuiMouseSource InputEventsNextMouseSource;
2040 ImU32 InputEventsNextEventId;
2048 int WindowsActiveCount;
2049 ImVec2 WindowsHoverPadding;
2050 ImGuiID DebugBreakInWindow;
2057 ImVec2 WheelingWindowRefMousePos;
2058 int WheelingWindowStartFrame;
2059 int WheelingWindowScrolledFrame;
2060 float WheelingWindowReleaseTimer;
2061 ImVec2 WheelingWindowWheelRemainder;
2065 ImGuiID DebugDrawIdConflicts;
2066 ImGuiID DebugHookIdInfo;
2068 ImGuiID HoveredIdPreviousFrame;
2069 int HoveredIdPreviousFrameItemCount;
2070 float HoveredIdTimer;
2071 float HoveredIdNotActiveTimer;
2072 bool HoveredIdAllowOverlap;
2073 bool HoveredIdIsDisabled;
2074 bool ItemUnclipByLog;
2076 ImGuiID ActiveIdIsAlive;
2077 float ActiveIdTimer;
2078 bool ActiveIdIsJustActivated;
2079 bool ActiveIdAllowOverlap;
2080 bool ActiveIdNoClearOnFocusLoss;
2081 bool ActiveIdHasBeenPressedBefore;
2082 bool ActiveIdHasBeenEditedBefore;
2083 bool ActiveIdHasBeenEditedThisFrame;
2084 bool ActiveIdFromShortcut;
2085 int ActiveIdMouseButton : 8;
2086 ImVec2 ActiveIdClickOffset;
2088 ImGuiInputSource ActiveIdSource;
2089 ImGuiID ActiveIdPreviousFrame;
2090 bool ActiveIdPreviousFrameIsAlive;
2091 bool ActiveIdPreviousFrameHasBeenEditedBefore;
2093 ImGuiID LastActiveId;
2094 float LastActiveIdTimer;
2100 double LastKeyModsChangeTime;
2101 double LastKeyModsChangeFromNoneTime;
2102 double LastKeyboardKeyPressTime;
2106 ImU32 ActiveIdUsingNavDirMask;
2107 bool ActiveIdUsingAllKeyboardKeys;
2108 ImGuiKeyChord DebugBreakInShortcutRouting;
2112 ImGuiID CurrentFocusScopeId;
2113 ImGuiItemFlags CurrentItemFlags;
2114 ImGuiID DebugLocateId;
2118 bool DebugShowGroupRects;
2121 ImGuiCol DebugFlashStyleColorIdx;
2136 bool NavCursorVisible;
2137 bool NavHighlightItemUnderNav;
2140 bool NavMousePosDirty;
2144 ImGuiID NavFocusScopeId;
2145 ImGuiNavLayer NavLayer;
2146 ImGuiID NavActivateId;
2147 ImGuiID NavActivateDownId;
2148 ImGuiID NavActivatePressedId;
2149 ImGuiActivateFlags NavActivateFlags;
2151 ImGuiID NavHighlightActivatedId;
2152 float NavHighlightActivatedTimer;
2153 ImGuiID NavNextActivateId;
2154 ImGuiActivateFlags NavNextActivateFlags;
2155 ImGuiInputSource NavInputSource;
2156 ImGuiSelectionUserData NavLastValidSelectionUserData;
2157 ImS8 NavCursorHideFrames;
2161 bool NavInitRequest;
2162 bool NavInitRequestFromMove;
2164 bool NavMoveSubmitted;
2165 bool NavMoveScoringItems;
2166 bool NavMoveForwardToNextFrame;
2167 ImGuiNavMoveFlags NavMoveFlags;
2168 ImGuiScrollFlags NavMoveScrollFlags;
2169 ImGuiKeyChord NavMoveKeyMods;
2170 ImGuiDir NavMoveDir;
2171 ImGuiDir NavMoveDirForDebug;
2172 ImGuiDir NavMoveClipDir;
2174 ImRect NavScoringNoClipRect;
2175 int NavScoringDebugCount;
2177 int NavTabbingCounter;
2184 ImGuiID NavJustMovedFromFocusScopeId;
2185 ImGuiID NavJustMovedToId;
2186 ImGuiID NavJustMovedToFocusScopeId;
2187 ImGuiKeyChord NavJustMovedToKeyMods;
2188 bool NavJustMovedToIsTabbing;
2189 bool NavJustMovedToHasSelectionData;
2192 ImGuiKeyChord ConfigNavWindowingKeyNext;
2193 ImGuiKeyChord ConfigNavWindowingKeyPrev;
2197 float NavWindowingTimer;
2198 float NavWindowingHighlightAlpha;
2199 bool NavWindowingToggleLayer;
2200 ImGuiKey NavWindowingToggleKey;
2201 ImVec2 NavWindowingAccumDeltaPos;
2202 ImVec2 NavWindowingAccumDeltaSize;
2208 bool DragDropActive;
2209 bool DragDropWithinSource;
2210 bool DragDropWithinTarget;
2211 ImGuiDragDropFlags DragDropSourceFlags;
2212 int DragDropSourceFrameCount;
2213 int DragDropMouseButton;
2215 ImRect DragDropTargetRect;
2216 ImRect DragDropTargetClipRect;
2217 ImGuiID DragDropTargetId;
2218 ImGuiDragDropFlags DragDropAcceptFlags;
2219 float DragDropAcceptIdCurrRectSurface;
2220 ImGuiID DragDropAcceptIdCurr;
2221 ImGuiID DragDropAcceptIdPrev;
2222 int DragDropAcceptFrameCount;
2223 ImGuiID DragDropHoldJustPressedId;
2225 unsigned char DragDropPayloadBufLocal[16];
2228 int ClipperTempDataStacked;
2233 ImGuiID DebugBreakInTable;
2234 int TablesTempDataStacked;
2249 int MultiSelectTempDataStacked;
2254 ImGuiID HoverItemDelayId;
2255 ImGuiID HoverItemDelayIdPreviousFrame;
2256 float HoverItemDelayTimer;
2257 float HoverItemDelayClearTimer;
2258 ImGuiID HoverItemUnlockedStationaryId;
2259 ImGuiID HoverWindowUnlockedStationaryId;
2262 ImGuiMouseCursor MouseCursor;
2263 float MouseStationaryTimer;
2264 ImVec2 MouseLastValidPos;
2269 ImFont InputTextPasswordFont;
2270 ImGuiID TempInputId;
2273 int BeginComboDepth;
2274 ImGuiColorEditFlags ColorEditOptions;
2275 ImGuiID ColorEditCurrentID;
2276 ImGuiID ColorEditSavedID;
2277 float ColorEditSavedHue;
2278 float ColorEditSavedSat;
2279 ImU32 ColorEditSavedColor;
2282 ImRect WindowResizeBorderExpectedRect;
2283 bool WindowResizeRelativeMode;
2284 short ScrollbarSeekMode;
2285 float ScrollbarClickDeltaToGrabCenter;
2286 float SliderGrabClickOffset;
2287 float SliderCurrentAccum;
2288 bool SliderCurrentAccumDirty;
2289 bool DragCurrentAccumDirty;
2290 float DragCurrentAccum;
2291 float DragSpeedDefaultRatio;
2292 float DisabledAlphaBackup;
2293 short DisabledStackSize;
2294 short TooltipOverrideCount;
2305 bool SettingsLoaded;
2306 float SettingsDirtyTimer;
2315 const char* LocalizationTable[ImGuiLocKey_COUNT];
2319 ImGuiLogType LogType;
2320 ImFileHandle LogFile;
2322 const char* LogNextPrefix;
2323 const char* LogNextSuffix;
2325 bool LogLineFirstItem;
2327 int LogDepthToExpand;
2328 int LogDepthToExpandDefault;
2331 ImGuiErrorCallback ErrorCallback;
2332 void* ErrorCallbackUserData;
2333 ImVec2 ErrorTooltipLockedPos;
2335 int ErrorCountCurrentFrame;
2341 int DebugDrawIdConflictsCount;
2342 ImGuiDebugLogFlags DebugLogFlags;
2345 int DebugLogSkippedErrors;
2346 ImGuiDebugLogFlags DebugLogAutoDisableFlags;
2347 ImU8 DebugLogAutoDisableFrames;
2348 ImU8 DebugLocateFrames;
2349 bool DebugBreakInLocateId;
2350 ImGuiKeyChord DebugBreakKeyChord;
2351 ImS8 DebugBeginReturnValueCullDepth;
2352 bool DebugItemPickerActive;
2353 ImU8 DebugItemPickerMouseButton;
2354 ImGuiID DebugItemPickerBreakId;
2355 float DebugFlashStyleColorTime;
2356 ImVec4 DebugFlashStyleColorBackup;
2362 float FramerateSecPerFrame[60];
2363 int FramerateSecPerFrameIdx;
2364 int FramerateSecPerFrameCount;
2365 float FramerateSecPerFrameAccum;
2366 int WantCaptureMouseNextFrame;
2367 int WantCaptureKeyboardNextFrame;
2368 int WantTextInputNextFrame;
2370 char TempKeychordName[64];
2386 ImVec2 CursorPosPrevLine;
2392 float CurrLineTextBaseOffset;
2393 float PrevLineTextBaseOffset;
2399 ImVec2 CursorStartPosLossyness;
2402 ImGuiNavLayer NavLayerCurrent;
2403 short NavLayersActiveMask;
2404 short NavLayersActiveMaskNext;
2405 bool NavIsScrollPushableX;
2406 bool NavHideHighlightOneFrame;
2407 bool NavWindowHasScrollY;
2410 bool MenuBarAppending;
2414 ImU32 TreeHasStackDataDepthMask;
2418 int CurrentTableIdx;
2419 ImGuiLayoutType LayoutType;
2420 ImGuiLayoutType ParentLayoutType;
2421 ImU32 ModalDimBgColor;
2437 ImGuiWindowFlags Flags;
2438 ImGuiChildFlags ChildFlags;
2445 ImVec2 ContentSizeExplicit;
2447 float WindowRounding;
2448 float WindowBorderSize;
2449 float TitleBarHeight, MenuBarHeight;
2450 float DecoOuterSizeX1, DecoOuterSizeY1;
2451 float DecoOuterSizeX2, DecoOuterSizeY2;
2452 float DecoInnerSizeX1, DecoInnerSizeY1;
2460 ImVec2 ScrollTargetCenterRatio;
2461 ImVec2 ScrollTargetEdgeSnapDist;
2463 bool ScrollbarX, ScrollbarY;
2468 bool WantCollapseToggle;
2473 bool IsFallbackWindow;
2474 bool IsExplicitChild;
2475 bool HasCloseButton;
2476 signed char ResizeBorderHovered;
2477 signed char ResizeBorderHeld;
2479 short BeginCountPreviousFrame;
2480 short BeginOrderWithinParent;
2481 short BeginOrderWithinContext;
2483 ImS8 AutoFitFramesX, AutoFitFramesY;
2484 bool AutoFitOnlyGrows;
2485 ImGuiDir AutoPosLastDirection;
2486 ImS8 HiddenFramesCanSkipItems;
2487 ImS8 HiddenFramesCannotSkipItems;
2488 ImS8 HiddenFramesForRenderOnly;
2489 ImS8 DisableInputsFrames;
2490 ImGuiCond SetWindowPosAllowFlags : 8;
2491 ImGuiCond SetWindowSizeAllowFlags : 8;
2492 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2494 ImVec2 SetWindowPosPivot;
2507 ImRect ContentRegionRect;
2511 int LastFrameActive;
2512 float LastTimeActive;
2513 float ItemWidthDefault;
2516 float FontWindowScale;
2530 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2531 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2532 ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT];
2533 ImGuiID NavRootFocusScopeId;
2535 int MemoryDrawListIdxCapacity;
2536 int MemoryDrawListVtxCapacity;
2537 bool MemoryCompacted;
2543 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2544 ImGuiID GetID(
const void* ptr);
2545 ImGuiID GetID(
int n);
2546 ImGuiID GetIDFromPos(
const ImVec2& p_abs);
2547 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2550 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2551 float CalcFontSize()
const {
ImGuiContext& g = *Ctx;
float scale = g.FontBaseSize * FontWindowScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
2552 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); }
2553 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight;
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); }
2561enum ImGuiTabBarFlagsPrivate_
2563 ImGuiTabBarFlags_DockNode = 1 << 20,
2564 ImGuiTabBarFlags_IsFocused = 1 << 21,
2565 ImGuiTabBarFlags_SaveSettings = 1 << 22,
2569enum ImGuiTabItemFlagsPrivate_
2571 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
2572 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
2573 ImGuiTabItemFlags_Button = 1 << 21,
2580 ImGuiTabItemFlags Flags;
2581 int LastFrameVisible;
2582 int LastFrameSelected;
2586 float RequestedWidth;
2589 ImS16 IndexDuringLayout;
2592 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
2600 ImGuiTabBarFlags Flags;
2602 ImGuiID SelectedTabId;
2603 ImGuiID NextSelectedTabId;
2604 ImGuiID VisibleTabId;
2605 int CurrFrameVisible;
2606 int PrevFrameVisible;
2608 float CurrTabsContentsHeight;
2609 float PrevTabsContentsHeight;
2611 float WidthAllTabsIdeal;
2612 float ScrollingAnim;
2613 float ScrollingTarget;
2614 float ScrollingTargetDistToVisibility;
2615 float ScrollingSpeed;
2616 float ScrollingRectMinX;
2617 float ScrollingRectMaxX;
2618 float SeparatorMinX;
2619 float SeparatorMaxX;
2620 ImGuiID ReorderRequestTabId;
2621 ImS16 ReorderRequestOffset;
2624 bool VisibleTabWasSubmitted;
2626 ImS16 TabsActiveCount;
2627 ImS16 LastTabItemIdx;
2640#define IM_COL32_DISABLE IM_COL32(0,0,0,1)
2641#define IMGUI_TABLE_MAX_COLUMNS 512
2644typedef ImS16 ImGuiTableColumnIdx;
2645typedef ImU16 ImGuiTableDrawChannelIdx;
2653 ImGuiTableColumnFlags Flags;
2660 float StretchWeight;
2661 float InitStretchWeightOrWidth;
2667 float ContentMaxXFrozen;
2668 float ContentMaxXUnfrozen;
2669 float ContentMaxXHeadersUsed;
2670 float ContentMaxXHeadersIdeal;
2672 ImGuiTableColumnIdx DisplayOrder;
2673 ImGuiTableColumnIdx IndexWithinEnabledSet;
2674 ImGuiTableColumnIdx PrevEnabledColumn;
2675 ImGuiTableColumnIdx NextEnabledColumn;
2676 ImGuiTableColumnIdx SortOrder;
2677 ImGuiTableDrawChannelIdx DrawChannelCurrent;
2678 ImGuiTableDrawChannelIdx DrawChannelFrozen;
2679 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
2682 bool IsUserEnabledNextFrame;
2685 bool IsRequestOutput;
2687 bool IsPreserveWidthAuto;
2688 ImS8 NavLayerCurrent;
2690 ImU8 CannotSkipItemsQueue;
2691 ImU8 SortDirection : 2;
2692 ImU8 SortDirectionsAvailCount : 2;
2693 ImU8 SortDirectionsAvailMask : 4;
2694 ImU8 SortDirectionsAvailList;
2698 memset(
this, 0,
sizeof(*
this));
2699 StretchWeight = WidthRequest = -1.0f;
2701 DisplayOrder = IndexWithinEnabledSet = -1;
2702 PrevEnabledColumn = NextEnabledColumn = -1;
2704 SortDirection = ImGuiSortDirection_None;
2705 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2714 ImGuiTableColumnIdx Column;
2722 ImGuiTableColumnIdx Index;
2732 ImGuiID TableInstanceID;
2733 float LastOuterHeight;
2734 float LastTopHeadersRowHeight;
2735 float LastFrozenHeight;
2739 ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
2746 ImGuiTableFlags Flags;
2752 ImBitArrayPtr EnabledMaskByDisplayOrder;
2753 ImBitArrayPtr EnabledMaskByIndex;
2754 ImBitArrayPtr VisibleMaskByIndex;
2755 ImGuiTableFlags SettingsLoadedFlags;
2757 int LastFrameActive;
2761 ImS16 InstanceCurrent;
2762 ImS16 InstanceInteracted;
2766 float RowCellPaddingY;
2767 float RowTextBaseline;
2768 float RowIndentOffsetX;
2769 ImGuiTableRowFlags RowFlags : 16;
2770 ImGuiTableRowFlags LastRowFlags : 16;
2771 int RowBgColorCounter;
2772 ImU32 RowBgColor[2];
2773 ImU32 BorderColorStrong;
2774 ImU32 BorderColorLight;
2778 float MinColumnWidth;
2779 float OuterPaddingX;
2781 float CellSpacingX1;
2782 float CellSpacingX2;
2784 float ColumnsGivenWidth;
2785 float ColumnsAutoFitWidth;
2786 float ColumnsStretchSumWeights;
2787 float ResizedColumnNextWidth;
2788 float ResizeLockMinContentsX2;
2790 float AngledHeadersHeight;
2791 float AngledHeadersSlope;
2797 ImRect Bg0ClipRectForDrawCmd;
2798 ImRect Bg2ClipRectForDrawCmd;
2800 ImRect HostBackupInnerClipRect;
2810 ImGuiTableColumnIdx SortSpecsCount;
2811 ImGuiTableColumnIdx ColumnsEnabledCount;
2812 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
2813 ImGuiTableColumnIdx DeclColumnsCount;
2814 ImGuiTableColumnIdx AngledHeadersCount;
2815 ImGuiTableColumnIdx HoveredColumnBody;
2816 ImGuiTableColumnIdx HoveredColumnBorder;
2817 ImGuiTableColumnIdx HighlightColumnHeader;
2818 ImGuiTableColumnIdx AutoFitSingleColumn;
2819 ImGuiTableColumnIdx ResizedColumn;
2820 ImGuiTableColumnIdx LastResizedColumn;
2821 ImGuiTableColumnIdx HeldHeaderColumn;
2822 ImGuiTableColumnIdx ReorderColumn;
2823 ImGuiTableColumnIdx ReorderColumnDir;
2824 ImGuiTableColumnIdx LeftMostEnabledColumn;
2825 ImGuiTableColumnIdx RightMostEnabledColumn;
2826 ImGuiTableColumnIdx LeftMostStretchedColumn;
2827 ImGuiTableColumnIdx RightMostStretchedColumn;
2828 ImGuiTableColumnIdx ContextPopupColumn;
2829 ImGuiTableColumnIdx FreezeRowsRequest;
2830 ImGuiTableColumnIdx FreezeRowsCount;
2831 ImGuiTableColumnIdx FreezeColumnsRequest;
2832 ImGuiTableColumnIdx FreezeColumnsCount;
2833 ImGuiTableColumnIdx RowCellDataCurrent;
2834 ImGuiTableDrawChannelIdx DummyDrawChannel;
2835 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
2836 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
2837 bool IsLayoutLocked;
2839 bool IsInitializing;
2840 bool IsSortSpecsDirty;
2841 bool IsUsingHeaders;
2842 bool IsContextPopupOpen;
2843 bool DisableDefaultContextMenu;
2844 bool IsSettingsRequestLoad;
2845 bool IsSettingsDirty;
2846 bool IsDefaultDisplayOrder;
2847 bool IsResetAllRequest;
2848 bool IsResetDisplayOrderRequest;
2849 bool IsUnfrozenRows;
2850 bool IsDefaultSizingPolicy;
2851 bool IsActiveIdAliveBeforeTable;
2852 bool IsActiveIdInTable;
2853 bool HasScrollbarYCurr;
2854 bool HasScrollbarYPrev;
2855 bool MemoryCompacted;
2858 ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
2870 float LastTimeActive;
2871 float AngledHeadersExtraWidth;
2877 ImRect HostBackupWorkRect;
2878 ImRect HostBackupParentWorkRect;
2879 ImVec2 HostBackupPrevLineSize;
2880 ImVec2 HostBackupCurrLineSize;
2881 ImVec2 HostBackupCursorMaxPos;
2882 ImVec1 HostBackupColumnsOffset;
2883 float HostBackupItemWidth;
2884 int HostBackupItemWidthStackSize;
2892 float WidthOrWeight;
2894 ImGuiTableColumnIdx Index;
2895 ImGuiTableColumnIdx DisplayOrder;
2896 ImGuiTableColumnIdx SortOrder;
2897 ImU8 SortDirection : 2;
2903 WidthOrWeight = 0.0f;
2906 DisplayOrder = SortOrder = -1;
2907 SortDirection = ImGuiSortDirection_None;
2917 ImGuiTableFlags SaveFlags;
2919 ImGuiTableColumnIdx ColumnsCount;
2920 ImGuiTableColumnIdx ColumnsCountMax;
2940 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
2941 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
2942 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
2943 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
2944 IMGUI_API
void UpdateWindowSkipRefresh(
ImGuiWindow* window);
2946 IMGUI_API
bool IsWindowChildOf(
ImGuiWindow* window,
ImGuiWindow* potential_parent,
bool popup_hierarchy);
2949 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
2950 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
2951 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
2952 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
2954 IMGUI_API
void SetWindowHiddenAndSkipItemsForCurrentFrame(
ImGuiWindow* window);
2955 inline void SetWindowParentWindowForFocusRoute(
ImGuiWindow* window,
ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
2956 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); }
2957 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); }
2962 IMGUI_API
void FocusWindow(
ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
2964 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
2965 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
2966 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
2968 IMGUI_API
int FindWindowDisplayIndex(
ImGuiWindow* window);
2972 IMGUI_API
void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
2975 IMGUI_API
void SetCurrentFont(
ImFont* font);
2976 inline ImFont* GetDefaultFont() {
ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
2977 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) { IM_UNUSED(window);
return GetForegroundDrawList(); }
2983 IMGUI_API
void Initialize();
2984 IMGUI_API
void Shutdown();
2987 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
2988 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
2989 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);
2990 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
2991 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
2992 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
2996 IMGUI_API
void RemoveContextHook(
ImGuiContext* context, ImGuiID hook_to_remove);
2997 IMGUI_API
void CallContextHooks(
ImGuiContext* context, ImGuiContextHookType type);
3003 IMGUI_API
void MarkIniSettingsDirty();
3004 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
3005 IMGUI_API
void ClearIniSettings();
3007 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
3014 IMGUI_API
void ClearWindowSettings(
const char* name);
3017 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
3018 inline const char* LocalizeGetMsg(ImGuiLocKey key) {
ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
3021 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
3022 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
3023 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
3024 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
3027 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
3028 IMGUI_API
void ScrollToRect(
ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
3031 inline void ScrollToBringRectIntoView(
ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
3035 inline ImGuiItemStatusFlags GetItemStatusFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
3036 inline ImGuiItemFlags GetItemFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.ItemFlags; }
3037 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
3038 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
3039 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
3040 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
3041 IMGUI_API
void ClearActiveID();
3042 IMGUI_API ImGuiID GetHoveredID();
3043 IMGUI_API
void SetHoveredID(ImGuiID
id);
3044 IMGUI_API
void KeepAliveID(ImGuiID
id);
3045 IMGUI_API
void MarkItemEdited(ImGuiID
id);
3046 IMGUI_API
void PushOverrideID(ImGuiID
id);
3047 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
3048 IMGUI_API ImGuiID GetIDWithSeed(
int n, ImGuiID seed);
3051 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
3052 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
3053 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
3054 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id, ImGuiItemFlags item_flags);
3055 IMGUI_API
bool IsWindowContentHoverable(
ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
3056 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
3057 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
3058 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
3059 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
3060 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
3065 IMGUI_API
void BeginDisabledOverrideReenable();
3066 IMGUI_API
void EndDisabledOverrideReenable();
3069 IMGUI_API
void LogBegin(ImGuiLogType type,
int auto_open_depth);
3070 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
3071 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
3072 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
3075 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
3078 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_window_flags);
3079 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
3080 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
3081 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
3082 IMGUI_API
void ClosePopupsExceptModals();
3083 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
3086 IMGUI_API
ImGuiWindow* GetTopMostAndVisiblePopupModal();
3089 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
3092 IMGUI_API
bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
3093 IMGUI_API
bool BeginTooltipHidden();
3096 IMGUI_API
bool BeginViewportSideBar(
const char* name,
ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
3097 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
3098 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
3101 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
3102 IMGUI_API
bool BeginComboPreview();
3103 IMGUI_API
void EndComboPreview();
3106 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
3107 IMGUI_API
void NavInitRequestApplyResult();
3108 IMGUI_API
bool NavMoveRequestButNoResultYet();
3109 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3110 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3111 IMGUI_API
void NavMoveRequestResolveWithLastItem(
ImGuiNavItemData* result);
3113 IMGUI_API
void NavMoveRequestCancel();
3114 IMGUI_API
void NavMoveRequestApplyResult();
3115 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
3116 IMGUI_API
void NavHighlightActivated(ImGuiID
id);
3117 IMGUI_API
void NavClearPreferredPosForAxis(ImGuiAxis axis);
3118 IMGUI_API
void SetNavCursorVisibleAfterMove();
3119 IMGUI_API
void NavUpdateCurrentWindowIsScrollPushableX();
3121 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
3122 IMGUI_API
void SetNavFocusScope(ImGuiID focus_scope_id);
3127 IMGUI_API
void FocusItem();
3128 IMGUI_API
void ActivateItemByID(ImGuiID
id);
3132 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
3133 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; }
3134 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
3135 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
3136 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
3137 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
3138 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
3139 inline bool IsLRModKey(ImGuiKey key) {
return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
3140 ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
3141 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
3143 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
3144 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
3145 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
3146 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
3152 IMGUI_API
const char* GetKeyChordName(ImGuiKeyChord key_chord);
3153 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
3154 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
3155 IMGUI_API
ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
3156 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
3157 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
3158 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
3159 IMGUI_API
void TeleportMousePos(
const ImVec2& pos);
3160 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
3161 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
3174 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
3175 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3176 IMGUI_API
void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3177 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);
3178 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
3179 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]; }
3187 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
3188 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3189 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
3190 IMGUI_API
bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3191 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
3192 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3193 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
3194 IMGUI_API
bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
3210 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3211 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3212 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
3223 IMGUI_API
void PushFocusScope(ImGuiID
id);
3224 IMGUI_API
void PopFocusScope();
3225 inline ImGuiID GetCurrentFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
3228 IMGUI_API
bool IsDragDropActive();
3229 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
3230 IMGUI_API
void ClearDragDrop();
3231 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
3232 IMGUI_API
void RenderDragDropTargetRect(
const ImRect& bb,
const ImRect& item_clip_rect);
3237 IMGUI_API
ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
3238 IMGUI_API
int TypingSelectFindMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3239 IMGUI_API
int TypingSelectFindNextSingleCharMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3240 IMGUI_API
int TypingSelectFindBestLeadingMatch(
ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data);
3243 IMGUI_API
bool BeginBoxSelect(
const ImRect& scope_rect,
ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);
3244 IMGUI_API
void EndBoxSelect(
const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);
3247 IMGUI_API
void MultiSelectItemHeader(ImGuiID
id,
bool* p_selected, ImGuiButtonFlags* p_button_flags);
3248 IMGUI_API
void MultiSelectItemFooter(ImGuiID
id,
bool* p_selected,
bool* p_pressed);
3250 IMGUI_API
void MultiSelectAddSetRange(
ImGuiMultiSelectTempData* ms,
bool selected,
int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
3251 inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.BoxSelectState.ID ==
id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
3255 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
3256 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
3257 IMGUI_API
void EndColumns();
3258 IMGUI_API
void PushColumnClipRect(
int column_index);
3259 IMGUI_API
void PushColumnsBackground();
3260 IMGUI_API
void PopColumnsBackground();
3261 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
3263 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
3264 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
3267 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
3268 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
3269 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
3270 IMGUI_API
int TableGetHoveredRow();
3271 IMGUI_API
float TableGetHeaderRowHeight();
3272 IMGUI_API
float TableGetHeaderAngledMaxLabelWidth();
3273 IMGUI_API
void TablePushBackgroundChannel();
3274 IMGUI_API
void TablePopBackgroundChannel();
3275 IMGUI_API
void TableAngledHeadersRowEx(ImGuiID row_id,
float angle,
float max_label_width,
const ImGuiTableHeaderData* data,
int data_count);
3279 IMGUI_API
ImGuiTable* TableFindByID(ImGuiID
id);
3280 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);
3281 IMGUI_API
void TableBeginInitMemory(
ImGuiTable* table,
int columns_count);
3282 IMGUI_API
void TableBeginApplyRequests(
ImGuiTable* table);
3283 IMGUI_API
void TableSetupDrawChannels(
ImGuiTable* table);
3284 IMGUI_API
void TableUpdateLayout(
ImGuiTable* table);
3285 IMGUI_API
void TableUpdateBorders(
ImGuiTable* table);
3286 IMGUI_API
void TableUpdateColumnsWeightFromWidth(
ImGuiTable* table);
3287 IMGUI_API
void TableDrawBorders(
ImGuiTable* table);
3288 IMGUI_API
void TableDrawDefaultContextMenu(
ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
3289 IMGUI_API
bool TableBeginContextMenuPopup(
ImGuiTable* table);
3290 IMGUI_API
void TableMergeDrawChannels(
ImGuiTable* table);
3291 inline ImGuiTableInstanceData* TableGetInstanceData(
ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3292 inline ImGuiID TableGetInstanceID(
ImGuiTable* table,
int instance_no) {
return TableGetInstanceData(table, instance_no)->TableInstanceID; }
3293 IMGUI_API
void TableSortSpecsSanitize(
ImGuiTable* table);
3294 IMGUI_API
void TableSortSpecsBuild(
ImGuiTable* table);
3295 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(
ImGuiTableColumn* column);
3298 IMGUI_API
void TableBeginRow(
ImGuiTable* table);
3299 IMGUI_API
void TableEndRow(
ImGuiTable* table);
3300 IMGUI_API
void TableBeginCell(
ImGuiTable* table,
int column_n);
3301 IMGUI_API
void TableEndCell(
ImGuiTable* table);
3302 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3303 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3304 IMGUI_API ImGuiID TableGetColumnResizeID(
ImGuiTable* table,
int column_n,
int instance_no = 0);
3305 IMGUI_API
float TableCalcMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3306 IMGUI_API
void TableSetColumnWidthAutoSingle(
ImGuiTable* table,
int column_n);
3307 IMGUI_API
void TableSetColumnWidthAutoAll(
ImGuiTable* table);
3308 IMGUI_API
void TableRemove(
ImGuiTable* table);
3309 IMGUI_API
void TableGcCompactTransientBuffers(
ImGuiTable* table);
3311 IMGUI_API
void TableGcCompactSettings();
3314 IMGUI_API
void TableLoadSettings(
ImGuiTable* table);
3315 IMGUI_API
void TableSaveSettings(
ImGuiTable* table);
3316 IMGUI_API
void TableResetSettings(
ImGuiTable* table);
3318 IMGUI_API
void TableSettingsAddSettingsHandler();
3324 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3328 inline int TabBarGetTabOrder(
ImGuiTabBar* tab_bar,
ImGuiTabItem* tab) {
return tab_bar->Tabs.index_from_ptr(tab); }
3330 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
3333 IMGUI_API
void TabBarQueueFocus(
ImGuiTabBar* tab_bar,
const char* tab_name);
3336 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
3337 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags,
ImGuiWindow* docked_window);
3338 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3340 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3341 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);
3346 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3347 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3348 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);
3349 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);
3350 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);
3351 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool borders =
true,
float rounding = 0.0f);
3352 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
3353 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);
3354 IMGUI_API
void RenderNavCursor(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None);
3355#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3356 inline void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb,
id, flags); }
3358 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3359 IMGUI_API
void RenderMouseCursor(
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3362 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3364 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
3365 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3366 IMGUI_API
void RenderRectFilledRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
3367 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3370 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3371 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3372 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3373 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);
3374 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags,
float thickness = 1.0f);
3375 IMGUI_API
void SeparatorTextEx(ImGuiID
id,
const char* label,
const char* label_end,
float extra_width);
3376 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3377 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3380 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3381 IMGUI_API
bool CollapseButton(ImGuiID
id,
const ImVec2& pos);
3382 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3383 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
3385 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
3386 IMGUI_API ImGuiID GetWindowResizeCornerID(
ImGuiWindow* window,
int n);
3387 IMGUI_API ImGuiID GetWindowResizeBorderID(
ImGuiWindow* window, ImGuiDir dir);
3390 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3391 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);
3392 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);
3393 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);
3396 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3397 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3398 IMGUI_API
bool TreeNodeGetOpen(ImGuiID storage_id);
3399 IMGUI_API
void TreeNodeSetOpen(ImGuiID storage_id,
bool open);
3400 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);
3405 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);
3406 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);
3407 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);
3408 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);
3409 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3410 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3414 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3415 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3416 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format,
void* p_data_when_empty = NULL);
3417 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3418 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3419 IMGUI_API
bool DataTypeIsZero(ImGuiDataType data_type,
const void* p_data);
3422 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);
3423 IMGUI_API
void InputTextDeactivateHook(ImGuiID
id);
3424 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3425 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);
3426 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
3427 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3428 IMGUI_API
void SetNextItemRefVal(ImGuiDataType data_type,
void* p_data);
3431 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3432 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3433 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3436 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);
3439 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);
3440 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);
3441 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);
3444 IMGUI_API
void GcCompactTransientMiscBuffers();
3445 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
3446 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
3449 IMGUI_API
bool ErrorLog(
const char* msg);
3453 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
3454 IMGUI_API
void ErrorCheckEndFrameFinalizeErrorTooltip();
3455 IMGUI_API
bool BeginErrorTooltip();
3456 IMGUI_API
void EndErrorTooltip();
3459 IMGUI_API
void DebugAllocHook(
ImGuiDebugAllocInfo* info,
int frame_count,
void* ptr,
size_t size);
3460 IMGUI_API
void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
3461 IMGUI_API
void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
3462 IMGUI_API
void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
3463 IMGUI_API
void DebugTextUnformattedWithLocateItem(
const char* line_begin,
const char* line_end);
3464 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
3465 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
3466 IMGUI_API
void DebugLocateItemResolveWithLastItem();
3467 IMGUI_API
void DebugBreakClearData();
3468 IMGUI_API
bool DebugBreakButton(
const char* label,
const char* description_of_location);
3469 IMGUI_API
void DebugBreakButtonTooltip(
bool keyboard_only,
const char* description_of_location);
3471 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
3474 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
3475 IMGUI_API
void DebugNodeFont(
ImFont* font);
3477 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
3478 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
3479 IMGUI_API
void DebugNodeTable(
ImGuiTable* table);
3484 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
3487 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(
ImGuiWindow** windows,
int windows_size,
ImGuiWindow* parent_in_begin_stack);
3489 IMGUI_API
void DebugRenderKeyboardPreview(
ImDrawList* draw_list);
3493#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3520#ifdef IMGUI_ENABLE_STB_TRUETYPE
3521IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
3523IMGUI_API
void ImFontAtlasUpdateConfigDataPointers(
ImFontAtlas* atlas);
3524IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
3526IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
3527IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
3528IMGUI_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);
3529IMGUI_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);
3530IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
3531IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
3537#ifdef IMGUI_ENABLE_TEST_ENGINE
3539extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
3540extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
3541extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
3544#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA)
3545#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS)
3546#define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__)
3548#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
3549#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
3554#if defined(__clang__)
3555#pragma clang diagnostic pop
3556#elif defined(__GNUC__)
3557#pragma GCC diagnostic pop
3561#pragma warning (pop)
Definition imgui_internal.h:576
Definition imgui_internal.h:591
Definition imgui_internal.h:692
Definition imgui_internal.h:780
Definition imgui_internal.h:756
Definition imgui_internal.h:3515
Definition imgui_internal.h:1714
Definition imgui_internal.h:1017
Definition imgui_internal.h:1034
Definition imgui_internal.h:1997
Definition imgui_internal.h:2012
Definition imgui_internal.h:806
Definition imgui_internal.h:800
Definition imgui_internal.h:792
Definition imgui_internal.h:1932
Definition imgui_internal.h:1939
Definition imgui_internal.h:1259
Definition imgui_internal.h:1611
Definition imgui_internal.h:1047
Definition imgui_internal.h:1382
Definition imgui_internal.h:1083
Definition imgui_internal.h:1105
Definition imgui_internal.h:1439
Definition imgui_internal.h:1413
Definition imgui_internal.h:1427
Definition imgui_internal.h:1231
Definition imgui_internal.h:1509
Definition imgui_internal.h:1496
Definition imgui_internal.h:1885
Definition imgui_internal.h:1065
Definition imgui_internal.h:1949
Definition imgui_internal.h:1771
Definition imgui_internal.h:1746
Definition imgui_internal.h:1594
Definition imgui_internal.h:1211
Definition imgui_internal.h:1177
Definition imgui_internal.h:1679
Definition imgui_internal.h:1689
Definition imgui_internal.h:1292
Definition imgui_internal.h:1850
Definition imgui_internal.h:1285
Definition imgui_internal.h:1966
Definition imgui_internal.h:1024
Definition imgui_internal.h:2597
Definition imgui_internal.h:2578
Definition imgui_internal.h:2712
Definition imgui_internal.h:2652
Definition imgui_internal.h:2891
Definition imgui_internal.h:2744
Definition imgui_internal.h:2731
Definition imgui_internal.h:2915
Definition imgui_internal.h:2868
Definition imgui_internal.h:711
Definition imgui_internal.h:1250
Definition imgui_internal.h:1630
Definition imgui_internal.h:1641
Definition imgui_internal.h:1799
Definition imgui_internal.h:2433
Definition imgui_internal.h:1836
Definition imgui_internal.h:1277
Definition imgui_internal.h:2383
Definition imgui_internal.h:658
Definition imgui_internal.h:513
Definition imgui_internal.h:635
Definition imgui_internal.h:605
Definition imgui_internal.h:495
Definition imgui_internal.h:503
Definition imstb_textedit.h:330