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
64#if (defined __AVX__ || defined __SSE4_2__)
65#define IMGUI_ENABLE_SSE4_2
70#if defined(IMGUI_ENABLE_SSE4_2) && !defined(IMGUI_USE_LEGACY_CRC32_ADLER) && !defined(__EMSCRIPTEN__)
71#define IMGUI_ENABLE_SSE4_2_CRC
77#pragma warning (disable: 4251)
78#pragma warning (disable: 26812)
79#pragma warning (disable: 26495)
80#if defined(_MSC_VER) && _MSC_VER >= 1922
81#pragma warning (disable: 5054)
87#pragma clang diagnostic push
88#if __has_warning("-Wunknown-warning-option")
89#pragma clang diagnostic ignored "-Wunknown-warning-option"
91#pragma clang diagnostic ignored "-Wunknown-pragmas"
92#pragma clang diagnostic ignored "-Wfloat-equal"
93#pragma clang diagnostic ignored "-Wold-style-cast"
94#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
95#pragma clang diagnostic ignored "-Wdouble-promotion"
96#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
97#pragma clang diagnostic ignored "-Wmissing-noreturn"
98#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
99#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
100#pragma clang diagnostic ignored "-Wnontrivial-memaccess"
101#elif defined(__GNUC__)
102#pragma GCC diagnostic push
103#pragma GCC diagnostic ignored "-Wpragmas"
104#pragma GCC diagnostic ignored "-Wclass-memaccess"
105#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
110#if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED)
111#error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h!
115#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
116#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
118#ifdef IMGUI_DISABLE_MATH_FUNCTIONS
119#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
124#ifndef IMGUI_ENABLE_FREETYPE
125#define IMGUI_ENABLE_STB_TRUETYPE
145struct ImGuiInputTextDeactivateData;
168struct ImGuiTableColumnsSettings;
178enum ImGuiLocKey : int;
179typedef int ImGuiLayoutType;
182typedef int ImGuiActivateFlags;
183typedef int ImGuiDebugLogFlags;
184typedef int ImGuiFocusRequestFlags;
185typedef int ImGuiItemStatusFlags;
186typedef int ImGuiOldColumnFlags;
187typedef int ImGuiLogFlags;
188typedef int ImGuiNavRenderCursorFlags;
189typedef int ImGuiNavMoveFlags;
190typedef int ImGuiNextItemDataFlags;
191typedef int ImGuiNextWindowDataFlags;
192typedef int ImGuiScrollFlags;
193typedef int ImGuiSeparatorFlags;
194typedef int ImGuiTextFlags;
195typedef int ImGuiTooltipFlags;
196typedef int ImGuiTypingSelectFlags;
197typedef int ImGuiWindowRefreshFlags;
214#ifndef IMGUI_DEBUG_PRINTF
215#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
216#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
218#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
223#define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0)
224#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
225#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
226#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
227#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
228#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
229#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
230#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
231#define IMGUI_DEBUG_LOG_FONT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFont) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
232#define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
235#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
240#ifdef IMGUI_DEBUG_PARANOID
241#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
243#define IM_ASSERT_PARANOID(_EXPR)
247#define IM_PI 3.14159265358979323846f
249#define IM_NEWLINE "\r\n"
251#define IM_NEWLINE "\n"
254#define IM_TABSIZE (4)
256#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1))
257#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f)))
258#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f))
259#define IM_TRUNC(_VAL) ((float)(int)(_VAL))
260#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f))
261#define IM_STRINGIFY_HELPER(_X) #_X
262#define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X)
263#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
264#define IM_FLOOR IM_TRUNC
268#if (defined(__cplusplus) && (__cplusplus >= 202002L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L))
269#define IM_LIKELY [[likely]]
270#define IM_UNLIKELY [[unlikely]]
278#define IMGUI_CDECL __cdecl
284#if defined(_MSC_VER) && !defined(__clang__)
285#define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX))
287#define IM_MSVC_WARNING_SUPPRESS(XXXX)
293#ifndef IM_DEBUG_BREAK
294#if defined (_MSC_VER)
295#define IM_DEBUG_BREAK() __debugbreak()
296#elif defined(__clang__)
297#define IM_DEBUG_BREAK() __builtin_debugtrap()
298#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
299#define IM_DEBUG_BREAK() __asm__ volatile("int3;nop")
300#elif defined(__GNUC__) && defined(__thumb__)
301#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
302#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
303#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0")
305#define IM_DEBUG_BREAK() IM_ASSERT(0)
311#if defined(_MSC_VER) && !defined(__clang__)
312#define IM_PRId64 "I64d"
313#define IM_PRIu64 "I64u"
314#define IM_PRIX64 "I64X"
316#define IM_PRId64 "lld"
317#define IM_PRIu64 "llu"
318#define IM_PRIX64 "llX"
348IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImGuiID seed = 0);
349IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImGuiID seed = 0);
353static 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); }
357IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
360static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
361static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
362static inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
365IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
366IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
367IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
368IMGUI_API
char* ImStrdup(
const char* str);
369IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
370IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
371IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
372IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
373IMGUI_API
void ImStrTrimBlanks(
char* str);
374IMGUI_API
const char* ImStrSkipBlank(
const char* str);
375IMGUI_API
int ImStrlenW(
const ImWchar* str);
376IMGUI_API
const char* ImStrbol(
const char* buf_mid_line,
const char* buf_begin);
377IM_MSVC_RUNTIME_CHECKS_OFF
378static inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
379static inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
380static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
381static inline bool ImCharIsXdigitA(
char c) {
return (c >=
'0' && c <=
'9') || (c >=
'A' && c <=
'F') || (c >=
'a' && c <=
'f'); }
382IM_MSVC_RUNTIME_CHECKS_RESTORE
385IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
386IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
387IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
388IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
389IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
390IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
391IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
392IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
393IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
394IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
397IMGUI_API const
char* ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
398IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
399IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
400IMGUI_API
int ImTextStrFromUtf8(ImWchar* out_buf,
int out_buf_size, const
char* in_text, const
char* in_text_end, const
char** in_remaining = NULL);
401IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
402IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
403IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
404IMGUI_API const
char* ImTextFindPreviousUtf8Codepoint(const
char* in_text_start, const
char* in_text_curr);
405IMGUI_API
int ImTextCountLines(const
char* in_text, const
char* in_text_end);
408#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
409#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
410typedef void* ImFileHandle;
411static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
412static inline bool ImFileClose(ImFileHandle) {
return false; }
413static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
414static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
415static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
417#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
418typedef FILE* ImFileHandle;
419IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
420IMGUI_API
bool ImFileClose(ImFileHandle file);
421IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
422IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
423IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
425#define IMGUI_DISABLE_TTY_FUNCTIONS
427IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
430IM_MSVC_RUNTIME_CHECKS_OFF
432#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
433#define ImFabs(X) fabsf(X)
434#define ImSqrt(X) sqrtf(X)
435#define ImFmod(X, Y) fmodf((X), (Y))
436#define ImCos(X) cosf(X)
437#define ImSin(X) sinf(X)
438#define ImAcos(X) acosf(X)
439#define ImAtan2(Y, X) atan2f((Y), (X))
440#define ImAtof(STR) atof(STR)
441#define ImCeil(X) ceilf(X)
442static inline float ImPow(
float x,
float y) {
return powf(x, y); }
443static inline double ImPow(
double x,
double y) {
return pow(x, y); }
444static inline float ImLog(
float x) {
return logf(x); }
445static inline double ImLog(
double x) {
return log(x); }
446static inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
447static inline float ImAbs(
float x) {
return fabsf(x); }
448static inline double ImAbs(
double x) {
return fabs(x); }
449static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
450static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
451#ifdef IMGUI_ENABLE_SSE
452static inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
454static inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
456static inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
460template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
461template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
462template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
463template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
464template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
465template<
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; }
466template<
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; }
468static 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); }
469static 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); }
470static 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); }
471static 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); }
472static 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); }
473static 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); }
474static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
475static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
476static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
477static 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; }
478static inline float ImTrunc(
float f) {
return (
float)(int)(f); }
479static inline ImVec2 ImTrunc(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
480static inline float ImFloor(
float f) {
return (
float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); }
481static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
482static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
483static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
484static 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); }
485static 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; }
486static inline float ImLinearRemapClamp(
float s0,
float s1,
float d0,
float d1,
float x) {
return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; }
488static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
489static inline float ImExponentialMovingAverage(
float avg,
float sample,
int n) { avg -= avg / n; avg += sample / n;
return avg; }
490IM_MSVC_RUNTIME_CHECKS_RESTORE
500IMGUI_API
void ImTriangleBarycentricCoords(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c,
const ImVec2& p,
float& out_u,
float& out_v,
float& out_w);
501inline 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; }
502inline 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; }
506IM_MSVC_RUNTIME_CHECKS_OFF
510 constexpr ImVec1() : x(0.0f) { }
511 constexpr ImVec1(
float _x) : x(_x) { }
518 constexpr ImVec2ih() : x(0), y(0) {}
519 constexpr ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
520 constexpr explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
525struct IMGUI_API ImRect
530 constexpr ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
531 constexpr ImRect(
const ImVec2& min,
const ImVec2& max) : Min(min), Max(max) {}
532 constexpr ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
533 constexpr ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
535 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
536 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
537 float GetWidth()
const {
return Max.x - Min.x; }
538 float GetHeight()
const {
return Max.y - Min.y; }
539 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
540 ImVec2 GetTL()
const {
return Min; }
543 ImVec2 GetBR()
const {
return Max; }
544 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
545 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; }
546 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; }
547 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; }
548 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; }
549 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; }
550 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
551 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
552 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
553 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
554 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
555 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
556 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
557 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); }
558 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
559 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
563#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0)
564#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31))))
565inline size_t ImBitArrayGetStorageSizeInBytes(
int bitcount) {
return (
size_t)((bitcount + 31) >> 5) << 2; }
566inline void ImBitArrayClearAllBits(ImU32* arr,
int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
567inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
568inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
569inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
570inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
575 int a_mod = (n & 31);
576 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
577 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
583typedef ImU32* ImBitArrayPtr;
587template<
int BITCOUNT,
int OFFSET = 0>
590 ImU32 Storage[(BITCOUNT + 31) >> 5];
591 ImBitArray() { ClearAllBits(); }
592 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
593 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
594 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
595 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
596 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
597 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); }
598 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
606 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
607 void Clear() { Storage.clear(); }
608 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return IM_BITARRAY_TESTBIT(Storage.Data, n); }
609 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
610 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
612IM_MSVC_RUNTIME_CHECKS_RESTORE
623 inline ImSpan() { Data = DataEnd = NULL; }
624 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
625 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
627 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
628 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
629 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
630 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
631 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
632 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
634 inline T* begin() {
return Data; }
635 inline const T* begin()
const {
return Data; }
636 inline T* end() {
return DataEnd; }
637 inline const T* end()
const {
return DataEnd; }
640 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
647struct ImSpanAllocator
655 ImSpanAllocator() { memset(
this, 0,
sizeof(*
this)); }
656 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; }
657 inline int GetArenaSizeInBytes() {
return CurrOff; }
658 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
659 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
660 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
662 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
668typedef int ImPoolIdx;
675 ImPoolIdx AliveCount;
677 ImPool() { FreeIdx = AliveCount = 0; }
678 ~ImPool() { Clear(); }
679 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
680 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
681 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
682 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
683 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
684 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; }
685 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]; }
686 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
687 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
688 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
692 int GetAliveCount()
const {
return AliveCount; }
693 int GetBufSize()
const {
return Buf.Size; }
694 int GetMapSize()
const {
return Map.Data.Size; }
695 T* TryGetMapData(ImPoolIdx n) {
int idx = Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
708 void clear() { Buf.clear(); }
709 bool empty()
const {
return Buf.Size == 0; }
710 int size()
const {
return Buf.Size; }
711 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); }
712 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
713 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; }
714 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
715 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
716 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; }
717 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
728 void clear() { LineOffsets.clear(); EndOffset = 0; }
729 int size() {
return LineOffsets.Size; }
730 const char* get_line_begin(
const char* base,
int n) {
return base + LineOffsets[n]; }
731 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
732 void append(
const char* base,
int old_size,
int new_size);
751#define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
752#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
753#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
754#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)
757#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))))
758#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD))
761#ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE
762#define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48
764#define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE
770struct IMGUI_API ImDrawListSharedData
777 float CurveTessellationTol;
778 float CircleSegmentMaxError;
779 ImVec4 ClipRectFullscreen;
780 ImDrawListFlags InitialFlags;
784 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
785 float ArcFastRadiusCutoff;
786 ImU8 CircleSegmentCounts[64];
788 ImDrawListSharedData();
789 void SetCircleTessellationMaxError(
float max_error);
792struct ImDrawDataBuilder
797 ImDrawDataBuilder() { memset(
this, 0,
sizeof(*
this)); }
809 void* GetVarPtr(
void* parent)
const {
return (
void*)((
unsigned char*)parent + Offset); }
822 const char* PrintFmt;
827enum ImGuiDataTypePrivate_
829 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
830 ImGuiDataType_Pointer,
841enum ImGuiItemFlagsPrivate_
844 ImGuiItemFlags_Disabled = 1 << 10,
845 ImGuiItemFlags_ReadOnly = 1 << 11,
846 ImGuiItemFlags_MixedValue = 1 << 12,
847 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13,
848 ImGuiItemFlags_AllowOverlap = 1 << 14,
849 ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15,
850 ImGuiItemFlags_NoMarkEdited = 1 << 16,
853 ImGuiItemFlags_Inputable = 1 << 20,
854 ImGuiItemFlags_HasSelectionUserData = 1 << 21,
855 ImGuiItemFlags_IsMultiSelect = 1 << 22,
857 ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups,
865enum ImGuiItemStatusFlags_
867 ImGuiItemStatusFlags_None = 0,
868 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
869 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
870 ImGuiItemStatusFlags_Edited = 1 << 2,
871 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
872 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
873 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
874 ImGuiItemStatusFlags_Deactivated = 1 << 6,
875 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
876 ImGuiItemStatusFlags_Visible = 1 << 8,
877 ImGuiItemStatusFlags_HasClipRect = 1 << 9,
878 ImGuiItemStatusFlags_HasShortcut = 1 << 10,
881#ifdef IMGUI_ENABLE_TEST_ENGINE
882 ImGuiItemStatusFlags_Openable = 1 << 20,
883 ImGuiItemStatusFlags_Opened = 1 << 21,
884 ImGuiItemStatusFlags_Checkable = 1 << 22,
885 ImGuiItemStatusFlags_Checked = 1 << 23,
886 ImGuiItemStatusFlags_Inputable = 1 << 24,
891enum ImGuiHoveredFlagsPrivate_
893 ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
894 ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
895 ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
899enum ImGuiInputTextFlagsPrivate_
902 ImGuiInputTextFlags_Multiline = 1 << 26,
903 ImGuiInputTextFlags_MergedItem = 1 << 27,
904 ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28,
908enum ImGuiButtonFlagsPrivate_
910 ImGuiButtonFlags_PressedOnClick = 1 << 4,
911 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
912 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
913 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
914 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
915 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
917 ImGuiButtonFlags_FlattenChildren = 1 << 11,
918 ImGuiButtonFlags_AllowOverlap = 1 << 12,
921 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
922 ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16,
923 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
924 ImGuiButtonFlags_NoNavFocus = 1 << 18,
925 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
926 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
927 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
928 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
929 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
933enum ImGuiComboFlagsPrivate_
935 ImGuiComboFlags_CustomPreview = 1 << 20,
939enum ImGuiSliderFlagsPrivate_
941 ImGuiSliderFlags_Vertical = 1 << 20,
942 ImGuiSliderFlags_ReadOnly = 1 << 21,
946enum ImGuiSelectableFlagsPrivate_
949 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
950 ImGuiSelectableFlags_SelectOnNav = 1 << 21,
951 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
952 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
953 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
954 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
955 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
956 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
960enum ImGuiTreeNodeFlagsPrivate_
962 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,
963 ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,
964 ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
967enum ImGuiSeparatorFlags_
969 ImGuiSeparatorFlags_None = 0,
970 ImGuiSeparatorFlags_Horizontal = 1 << 0,
971 ImGuiSeparatorFlags_Vertical = 1 << 1,
972 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
978enum ImGuiFocusRequestFlags_
980 ImGuiFocusRequestFlags_None = 0,
981 ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0,
982 ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1,
987 ImGuiTextFlags_None = 0,
988 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
991enum ImGuiTooltipFlags_
993 ImGuiTooltipFlags_None = 0,
994 ImGuiTooltipFlags_OverridePrevious = 1 << 1,
1001 ImGuiLayoutType_Horizontal = 0,
1002 ImGuiLayoutType_Vertical = 1
1008 ImGuiLogFlags_None = 0,
1010 ImGuiLogFlags_OutputTTY = 1 << 0,
1011 ImGuiLogFlags_OutputFile = 1 << 1,
1012 ImGuiLogFlags_OutputBuffer = 1 << 2,
1013 ImGuiLogFlags_OutputClipboard = 1 << 3,
1014 ImGuiLogFlags_OutputMask_ = ImGuiLogFlags_OutputTTY | ImGuiLogFlags_OutputFile | ImGuiLogFlags_OutputBuffer | ImGuiLogFlags_OutputClipboard,
1020 ImGuiAxis_None = -1,
1027 ImGuiPlotType_Lines,
1028 ImGuiPlotType_Histogram,
1041 ImGuiStyleVar VarIdx;
1042 union {
int BackupInt[2];
float BackupFloat[2]; };
1043 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
1044 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
1045 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
1049struct IMGUI_API ImGuiComboPreviewData
1053 ImVec2 BackupCursorMaxPos;
1054 ImVec2 BackupCursorPosPrevLine;
1055 float BackupPrevLineTextBaseOffset;
1056 ImGuiLayoutType BackupLayout;
1058 ImGuiComboPreviewData() { memset(
this, 0,
sizeof(*
this)); }
1066 ImVec2 BackupCursorMaxPos;
1067 ImVec2 BackupCursorPosPrevLine;
1069 ImVec1 BackupGroupOffset;
1070 ImVec2 BackupCurrLineSize;
1071 float BackupCurrLineTextBaseOffset;
1072 ImGuiID BackupActiveIdIsAlive;
1073 bool BackupActiveIdPreviousFrameIsAlive;
1074 bool BackupHoveredIdIsAlive;
1075 bool BackupIsSameLine;
1080struct IMGUI_API ImGuiMenuColumns
1083 ImU32 NextTotalWidth;
1087 ImU16 OffsetShortcut;
1091 ImGuiMenuColumns() { memset(
this, 0,
sizeof(*
this)); }
1092 void Update(
float spacing,
bool window_reappearing);
1093 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1094 void CalcNextTotalWidth(
bool update_offsets);
1098struct IMGUI_API ImGuiInputTextDeactivatedState
1103 ImGuiInputTextDeactivatedState() { memset(
this, 0,
sizeof(*
this)); }
1104 void ClearFreeMemory() { ID = 0; TextA.clear(); }
1108#undef IMSTB_TEXTEDIT_STRING
1109#undef IMSTB_TEXTEDIT_CHARTYPE
1110#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
1111#define IMSTB_TEXTEDIT_CHARTYPE char
1112#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
1113#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
1114#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
1116typedef ImStb::STB_TexteditState ImStbTexteditState;
1120struct IMGUI_API ImGuiInputTextState
1123 ImStbTexteditState* Stb;
1133 bool SelectedAllMouseLock;
1135 ImGuiInputTextFlags Flags;
1137 int ReloadSelectionStart;
1138 int ReloadSelectionEnd;
1140 ImGuiInputTextState();
1141 ~ImGuiInputTextState();
1142 void ClearText() { TextLen = 0; TextA[0] = 0; CursorClamp(); }
1143 void ClearFreeMemory() { TextA.clear(); TextToRevertTo.clear(); }
1144 void OnKeyPressed(
int key);
1145 void OnCharPressed(
unsigned int c);
1148 void CursorAnimReset();
1150 bool HasSelection()
const;
1151 void ClearSelection();
1152 int GetCursorPos()
const;
1153 int GetSelectionStart()
const;
1154 int GetSelectionEnd()
const;
1162 void ReloadUserBufAndSelectAll();
1163 void ReloadUserBufAndKeepSelection();
1164 void ReloadUserBufAndMoveToEnd();
1167enum ImGuiWindowRefreshFlags_
1169 ImGuiWindowRefreshFlags_None = 0,
1170 ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0,
1171 ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1,
1172 ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2,
1176enum ImGuiNextWindowDataFlags_
1178 ImGuiNextWindowDataFlags_None = 0,
1179 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1180 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1181 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1182 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1183 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1184 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1185 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1186 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1187 ImGuiNextWindowDataFlags_HasChildFlags = 1 << 8,
1188 ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 9,
1192struct ImGuiNextWindowData
1194 ImGuiNextWindowDataFlags Flags;
1197 ImGuiCond CollapsedCond;
1203 ImGuiChildFlags ChildFlags;
1205 ImRect SizeConstraintRect;
1206 ImGuiSizeCallback SizeCallback;
1207 void* SizeCallbackUserData;
1209 ImVec2 MenuBarOffsetMinVal;
1210 ImGuiWindowRefreshFlags RefreshFlagsVal;
1212 ImGuiNextWindowData() { memset(
this, 0,
sizeof(*
this)); }
1213 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1216enum ImGuiNextItemDataFlags_
1218 ImGuiNextItemDataFlags_None = 0,
1219 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1220 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1221 ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
1222 ImGuiNextItemDataFlags_HasRefVal = 1 << 3,
1223 ImGuiNextItemDataFlags_HasStorageID = 1 << 4,
1226struct ImGuiNextItemData
1228 ImGuiNextItemDataFlags HasFlags;
1229 ImGuiItemFlags ItemFlags;
1231 ImGuiID FocusScopeId;
1232 ImGuiSelectionUserData SelectionUserData;
1234 ImGuiKeyChord Shortcut;
1235 ImGuiInputFlags ShortcutFlags;
1241 ImGuiNextItemData() { memset(
this, 0,
sizeof(*
this)); SelectionUserData = -1; }
1242 inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; }
1246struct ImGuiLastItemData
1249 ImGuiItemFlags ItemFlags;
1250 ImGuiItemStatusFlags StatusFlags;
1256 ImGuiKeyChord Shortcut;
1258 ImGuiLastItemData() { memset(
this, 0,
sizeof(*
this)); }
1268 ImGuiTreeNodeFlags TreeFlags;
1269 ImGuiItemFlags ItemFlags;
1274struct IMGUI_API ImGuiErrorRecoveryState
1276 short SizeOfWindowStack;
1277 short SizeOfIDStack;
1278 short SizeOfTreeStack;
1279 short SizeOfColorStack;
1280 short SizeOfStyleVarStack;
1281 short SizeOfFontStack;
1282 short SizeOfFocusScopeStack;
1283 short SizeOfGroupStack;
1284 short SizeOfItemFlagsStack;
1285 short SizeOfBeginPopupStack;
1286 short SizeOfDisabledStack;
1288 ImGuiErrorRecoveryState() { memset(
this, 0,
sizeof(*
this)); }
1297 bool DisabledOverrideReenable;
1307struct ImGuiPtrOrIndex
1312 ImGuiPtrOrIndex(
void* ptr) { Ptr = ptr; Index = -1; }
1313 ImGuiPtrOrIndex(
int index) { Ptr = NULL; Index = index; }
1320enum ImGuiPopupPositionPolicy
1322 ImGuiPopupPositionPolicy_Default,
1323 ImGuiPopupPositionPolicy_ComboBox,
1324 ImGuiPopupPositionPolicy_Tooltip,
1328struct ImGuiPopupData
1335 ImGuiID OpenParentId;
1339 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1347typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitArrayForNamedKeys;
1350#define ImGuiKey_LegacyNativeKey_BEGIN 0
1351#define ImGuiKey_LegacyNativeKey_END 512
1352#define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
1353#define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
1354#define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
1355#define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
1356#define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
1357#define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
1358#define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
1359#define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
1362#define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
1363#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
1364#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
1365#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
1366#define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown)
1367#define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight)
1368#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
1369#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
1371enum ImGuiInputEventType
1373 ImGuiInputEventType_None = 0,
1374 ImGuiInputEventType_MousePos,
1375 ImGuiInputEventType_MouseWheel,
1376 ImGuiInputEventType_MouseButton,
1377 ImGuiInputEventType_Key,
1378 ImGuiInputEventType_Text,
1379 ImGuiInputEventType_Focus,
1380 ImGuiInputEventType_COUNT
1383enum ImGuiInputSource
1385 ImGuiInputSource_None = 0,
1386 ImGuiInputSource_Mouse,
1387 ImGuiInputSource_Keyboard,
1388 ImGuiInputSource_Gamepad,
1389 ImGuiInputSource_COUNT
1401struct ImGuiInputEvent
1403 ImGuiInputEventType Type;
1404 ImGuiInputSource Source;
1415 bool AddedByTestEngine;
1417 ImGuiInputEvent() { memset(
this, 0,
sizeof(*
this)); }
1421#define ImGuiKeyOwner_Any ((ImGuiID)0)
1422#define ImGuiKeyOwner_NoOwner ((ImGuiID)-1)
1425typedef ImS16 ImGuiKeyRoutingIndex;
1428struct ImGuiKeyRoutingData
1430 ImGuiKeyRoutingIndex NextEntryIndex;
1432 ImU8 RoutingCurrScore;
1433 ImU8 RoutingNextScore;
1434 ImGuiID RoutingCurr;
1435 ImGuiID RoutingNext;
1437 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
1442struct ImGuiKeyRoutingTable
1444 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1448 ImGuiKeyRoutingTable() { Clear(); }
1449 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1454struct ImGuiKeyOwnerData
1459 bool LockUntilRelease;
1461 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease =
false; }
1467enum ImGuiInputFlagsPrivate_
1471 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1472 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1473 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1476 ImGuiInputFlags_RepeatUntilRelease = 1 << 4,
1477 ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5,
1478 ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6,
1479 ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7,
1483 ImGuiInputFlags_LockThisFrame = 1 << 20,
1484 ImGuiInputFlags_LockUntilRelease = 1 << 21,
1487 ImGuiInputFlags_CondHovered = 1 << 22,
1488 ImGuiInputFlags_CondActive = 1 << 23,
1489 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1492 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1493 ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
1494 ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
1495 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1496 ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
1497 ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
1498 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
1499 ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
1500 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
1501 ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
1502 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1503 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1515 bool PosToIndexConvert;
1516 ImS8 PosToIndexOffsetMin;
1517 ImS8 PosToIndexOffsetMax;
1524struct ImGuiListClipperData
1527 float LossynessOffset;
1532 ImGuiListClipperData() { memset(
this, 0,
sizeof(*
this)); }
1533 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1540enum ImGuiActivateFlags_
1542 ImGuiActivateFlags_None = 0,
1543 ImGuiActivateFlags_PreferInput = 1 << 0,
1544 ImGuiActivateFlags_PreferTweak = 1 << 1,
1545 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1546 ImGuiActivateFlags_FromTabbing = 1 << 3,
1547 ImGuiActivateFlags_FromShortcut = 1 << 4,
1551enum ImGuiScrollFlags_
1553 ImGuiScrollFlags_None = 0,
1554 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1555 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1556 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1557 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1558 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1559 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1560 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1561 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1562 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1565enum ImGuiNavRenderCursorFlags_
1567 ImGuiNavRenderCursorFlags_None = 0,
1568 ImGuiNavRenderCursorFlags_Compact = 1 << 1,
1569 ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2,
1570 ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
1571#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1572 ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None,
1573 ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact,
1574 ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw,
1575 ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding,
1579enum ImGuiNavMoveFlags_
1581 ImGuiNavMoveFlags_None = 0,
1582 ImGuiNavMoveFlags_LoopX = 1 << 0,
1583 ImGuiNavMoveFlags_LoopY = 1 << 1,
1584 ImGuiNavMoveFlags_WrapX = 1 << 2,
1585 ImGuiNavMoveFlags_WrapY = 1 << 3,
1586 ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
1587 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1588 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1589 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1590 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1591 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1592 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1593 ImGuiNavMoveFlags_IsTabbing = 1 << 10,
1594 ImGuiNavMoveFlags_IsPageMove = 1 << 11,
1595 ImGuiNavMoveFlags_Activate = 1 << 12,
1596 ImGuiNavMoveFlags_NoSelect = 1 << 13,
1597 ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14,
1598 ImGuiNavMoveFlags_NoClearActiveId = 1 << 15,
1603 ImGuiNavLayer_Main = 0,
1604 ImGuiNavLayer_Menu = 1,
1609struct ImGuiNavItemData
1613 ImGuiID FocusScopeId;
1615 ImGuiItemFlags ItemFlags;
1619 ImGuiSelectionUserData SelectionUserData;
1621 ImGuiNavItemData() { Clear(); }
1622 void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
1637enum ImGuiTypingSelectFlags_
1639 ImGuiTypingSelectFlags_None = 0,
1640 ImGuiTypingSelectFlags_AllowBackspace = 1 << 0,
1641 ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1,
1647 ImGuiTypingSelectFlags Flags;
1648 int SearchBufferLen;
1649 const char* SearchBuffer;
1651 bool SingleCharMode;
1652 ImS8 SingleCharSize;
1656struct IMGUI_API ImGuiTypingSelectState
1659 char SearchBuffer[64];
1661 int LastRequestFrame = 0;
1662 float LastRequestTime = 0.0f;
1663 bool SingleCharModeLock =
false;
1665 ImGuiTypingSelectState() { memset(
this, 0,
sizeof(*
this)); }
1666 void Clear() { SearchBuffer[0] = 0; SingleCharModeLock =
false; }
1674enum ImGuiOldColumnFlags_
1676 ImGuiOldColumnFlags_None = 0,
1677 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1678 ImGuiOldColumnFlags_NoResize = 1 << 1,
1679 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1680 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1681 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1684#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1694struct ImGuiOldColumnData
1697 float OffsetNormBeforeResize;
1698 ImGuiOldColumnFlags Flags;
1701 ImGuiOldColumnData() { memset(
this, 0,
sizeof(*
this)); }
1704struct ImGuiOldColumns
1707 ImGuiOldColumnFlags Flags;
1709 bool IsBeingResized;
1712 float OffMinX, OffMaxX;
1713 float LineMinY, LineMaxY;
1714 float HostCursorPosY;
1715 float HostCursorMaxPosX;
1716 ImRect HostInitialClipRect;
1717 ImRect HostBackupClipRect;
1718 ImRect HostBackupParentWorkRect;
1722 ImGuiOldColumns() { memset(
this, 0,
sizeof(*
this)); }
1729struct ImGuiBoxSelectState
1735 bool IsStartedFromVoid;
1736 bool IsStartedSetNavIdOnce;
1738 ImGuiKeyChord KeyMods : 16;
1747 ImRect BoxSelectRectPrev;
1748 ImRect BoxSelectRectCurr;
1750 ImGuiBoxSelectState() { memset(
this, 0,
sizeof(*
this)); }
1758#define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1)
1761struct IMGUI_API ImGuiMultiSelectTempData
1765 ImGuiID FocusScopeId;
1766 ImGuiMultiSelectFlags Flags;
1768 ImVec2 BackupCursorMaxPos;
1769 ImGuiSelectionUserData LastSubmittedItem;
1770 ImGuiID BoxSelectId;
1771 ImGuiKeyChord KeyMods;
1772 ImS8 LoopRequestSetAll;
1775 bool IsKeyboardSetRange;
1777 bool RangeSrcPassedBy;
1778 bool RangeDstPassedBy;
1780 ImGuiMultiSelectTempData() { Clear(); }
1781 void Clear() {
size_t io_sz =
sizeof(IO); ClearIO(); memset((
void*)(&IO + 1), 0,
sizeof(*
this) - io_sz); }
1782 void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset =
false; }
1786struct IMGUI_API ImGuiMultiSelectState
1790 int LastFrameActive;
1791 int LastSelectionSize;
1794 ImGuiSelectionUserData RangeSrcItem;
1795 ImGuiSelectionUserData NavIdItem;
1797 ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; }
1804#ifdef IMGUI_HAS_DOCK
1814struct ImGuiViewportP :
public ImGuiViewport
1816 int BgFgDrawListsLastFrame[2];
1827 ImVec2 BuildWorkInsetMin;
1828 ImVec2 BuildWorkInsetMax;
1830 ImGuiViewportP() { BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; }
1831 ~ImGuiViewportP() {
if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]);
if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
1834 ImVec2 CalcWorkRectPos(
const ImVec2& inset_min)
const {
return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
1835 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)); }
1836 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); }
1839 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1840 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
1841 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); }
1851struct ImGuiWindowSettings
1861 ImGuiWindowSettings() { memset(
this, 0,
sizeof(*
this)); }
1862 char* GetName() {
return (
char*)(
this + 1); }
1865struct ImGuiSettingsHandler
1867 const char* TypeName;
1869 void (*ClearAllFn)(
ImGuiContext* ctx, ImGuiSettingsHandler* handler);
1870 void (*ReadInitFn)(
ImGuiContext* ctx, ImGuiSettingsHandler* handler);
1871 void* (*ReadOpenFn)(
ImGuiContext* ctx, ImGuiSettingsHandler* handler,
const char* name);
1872 void (*ReadLineFn)(
ImGuiContext* ctx, ImGuiSettingsHandler* handler,
void* entry,
const char* line);
1873 void (*ApplyAllFn)(
ImGuiContext* ctx, ImGuiSettingsHandler* handler);
1877 ImGuiSettingsHandler() { memset(
this, 0,
sizeof(*
this)); }
1885enum ImGuiLocKey :
int
1887 ImGuiLocKey_VersionStr,
1888 ImGuiLocKey_TableSizeOne,
1889 ImGuiLocKey_TableSizeAllFit,
1890 ImGuiLocKey_TableSizeAllDefault,
1891 ImGuiLocKey_TableResetOrder,
1892 ImGuiLocKey_WindowingMainMenuBar,
1893 ImGuiLocKey_WindowingPopup,
1894 ImGuiLocKey_WindowingUntitled,
1895 ImGuiLocKey_OpenLink_s,
1896 ImGuiLocKey_CopyLink,
1915#ifndef IM_ASSERT_USER_ERROR
1916#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0)
1920typedef void (*ImGuiErrorCallback)(
ImGuiContext* ctx,
void* user_data,
const char* msg);
1927enum ImGuiDebugLogFlags_
1930 ImGuiDebugLogFlags_None = 0,
1931 ImGuiDebugLogFlags_EventError = 1 << 0,
1932 ImGuiDebugLogFlags_EventActiveId = 1 << 1,
1933 ImGuiDebugLogFlags_EventFocus = 1 << 2,
1934 ImGuiDebugLogFlags_EventPopup = 1 << 3,
1935 ImGuiDebugLogFlags_EventNav = 1 << 4,
1936 ImGuiDebugLogFlags_EventClipper = 1 << 5,
1937 ImGuiDebugLogFlags_EventSelection = 1 << 6,
1938 ImGuiDebugLogFlags_EventIO = 1 << 7,
1939 ImGuiDebugLogFlags_EventFont = 1 << 8,
1940 ImGuiDebugLogFlags_EventInputRouting = 1 << 9,
1941 ImGuiDebugLogFlags_EventDocking = 1 << 10,
1942 ImGuiDebugLogFlags_EventViewport = 1 << 11,
1944 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
1945 ImGuiDebugLogFlags_OutputToTTY = 1 << 20,
1946 ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21,
1956struct ImGuiDebugAllocInfo
1958 int TotalAllocCount;
1960 ImS16 LastEntriesIdx;
1963 ImGuiDebugAllocInfo() { memset(
this, 0,
sizeof(*
this)); }
1968 bool ShowDebugLog =
false;
1969 bool ShowIDStackTool =
false;
1970 bool ShowWindowsRects =
false;
1971 bool ShowWindowsBeginOrder =
false;
1972 bool ShowTablesRects =
false;
1973 bool ShowDrawCmdMesh =
true;
1974 bool ShowDrawCmdBoundingBoxes =
true;
1975 bool ShowTextEncodingViewer =
false;
1976 bool ShowAtlasTintedWithTextColor =
false;
1977 int ShowWindowsRectsType = -1;
1978 int ShowTablesRectsType = -1;
1979 int HighlightMonitorIdx = -1;
1980 ImGuiID HighlightViewportID = 0;
1983struct ImGuiStackLevelInfo
1986 ImS8 QueryFrameCount;
1988 ImGuiDataType DataType : 8;
1991 ImGuiStackLevelInfo() { memset(
this, 0,
sizeof(*
this)); }
1995struct ImGuiIDStackTool
1997 int LastActiveFrame;
2001 bool CopyToClipboardOnCtrlC;
2002 float CopyToClipboardLastTime;
2004 ImGuiIDStackTool() { memset(
this, 0,
sizeof(*
this)); CopyToClipboardLastTime = -FLT_MAX; }
2012enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
2014struct ImGuiContextHook
2017 ImGuiContextHookType Type;
2019 ImGuiContextHookCallback Callback;
2022 ImGuiContextHook() { memset(
this, 0,
sizeof(*
this)); }
2032 bool FontAtlasOwnedByContext;
2040 float CurrentDpiScale;
2044 int FrameCountEnded;
2045 int FrameCountRendered;
2046 bool WithinFrameScope;
2047 bool WithinFrameScopeWithImplicitWindow;
2048 bool WithinEndChild;
2050 bool TestEngineHookItems;
2052 char ContextName[16];
2057 ImGuiMouseSource InputEventsNextMouseSource;
2058 ImU32 InputEventsNextEventId;
2066 int WindowsActiveCount;
2067 ImVec2 WindowsHoverPadding;
2068 ImGuiID DebugBreakInWindow;
2075 ImVec2 WheelingWindowRefMousePos;
2076 int WheelingWindowStartFrame;
2077 int WheelingWindowScrolledFrame;
2078 float WheelingWindowReleaseTimer;
2079 ImVec2 WheelingWindowWheelRemainder;
2083 ImGuiID DebugDrawIdConflicts;
2084 ImGuiID DebugHookIdInfo;
2086 ImGuiID HoveredIdPreviousFrame;
2087 int HoveredIdPreviousFrameItemCount;
2088 float HoveredIdTimer;
2089 float HoveredIdNotActiveTimer;
2090 bool HoveredIdAllowOverlap;
2091 bool HoveredIdIsDisabled;
2092 bool ItemUnclipByLog;
2094 ImGuiID ActiveIdIsAlive;
2095 float ActiveIdTimer;
2096 bool ActiveIdIsJustActivated;
2097 bool ActiveIdAllowOverlap;
2098 bool ActiveIdNoClearOnFocusLoss;
2099 bool ActiveIdHasBeenPressedBefore;
2100 bool ActiveIdHasBeenEditedBefore;
2101 bool ActiveIdHasBeenEditedThisFrame;
2102 bool ActiveIdFromShortcut;
2103 int ActiveIdMouseButton : 8;
2104 ImVec2 ActiveIdClickOffset;
2106 ImGuiInputSource ActiveIdSource;
2107 ImGuiID ActiveIdPreviousFrame;
2108 bool ActiveIdPreviousFrameIsAlive;
2109 bool ActiveIdPreviousFrameHasBeenEditedBefore;
2111 ImGuiID LastActiveId;
2112 float LastActiveIdTimer;
2118 double LastKeyModsChangeTime;
2119 double LastKeyModsChangeFromNoneTime;
2120 double LastKeyboardKeyPressTime;
2121 ImBitArrayForNamedKeys KeysMayBeCharInput;
2124 ImU32 ActiveIdUsingNavDirMask;
2125 bool ActiveIdUsingAllKeyboardKeys;
2126 ImGuiKeyChord DebugBreakInShortcutRouting;
2130 ImGuiID CurrentFocusScopeId;
2131 ImGuiItemFlags CurrentItemFlags;
2132 ImGuiID DebugLocateId;
2136 bool DebugShowGroupRects;
2139 ImGuiCol DebugFlashStyleColorIdx;
2154 bool NavCursorVisible;
2155 bool NavHighlightItemUnderNav;
2158 bool NavMousePosDirty;
2162 ImGuiID NavFocusScopeId;
2163 ImGuiNavLayer NavLayer;
2164 ImGuiID NavActivateId;
2165 ImGuiID NavActivateDownId;
2166 ImGuiID NavActivatePressedId;
2167 ImGuiActivateFlags NavActivateFlags;
2169 ImGuiID NavHighlightActivatedId;
2170 float NavHighlightActivatedTimer;
2171 ImGuiID NavNextActivateId;
2172 ImGuiActivateFlags NavNextActivateFlags;
2173 ImGuiInputSource NavInputSource;
2174 ImGuiSelectionUserData NavLastValidSelectionUserData;
2175 ImS8 NavCursorHideFrames;
2179 bool NavInitRequest;
2180 bool NavInitRequestFromMove;
2182 bool NavMoveSubmitted;
2183 bool NavMoveScoringItems;
2184 bool NavMoveForwardToNextFrame;
2185 ImGuiNavMoveFlags NavMoveFlags;
2186 ImGuiScrollFlags NavMoveScrollFlags;
2187 ImGuiKeyChord NavMoveKeyMods;
2188 ImGuiDir NavMoveDir;
2189 ImGuiDir NavMoveDirForDebug;
2190 ImGuiDir NavMoveClipDir;
2192 ImRect NavScoringNoClipRect;
2193 int NavScoringDebugCount;
2195 int NavTabbingCounter;
2202 ImGuiID NavJustMovedFromFocusScopeId;
2203 ImGuiID NavJustMovedToId;
2204 ImGuiID NavJustMovedToFocusScopeId;
2205 ImGuiKeyChord NavJustMovedToKeyMods;
2206 bool NavJustMovedToIsTabbing;
2207 bool NavJustMovedToHasSelectionData;
2210 ImGuiKeyChord ConfigNavWindowingKeyNext;
2211 ImGuiKeyChord ConfigNavWindowingKeyPrev;
2215 float NavWindowingTimer;
2216 float NavWindowingHighlightAlpha;
2217 bool NavWindowingToggleLayer;
2218 ImGuiKey NavWindowingToggleKey;
2219 ImVec2 NavWindowingAccumDeltaPos;
2220 ImVec2 NavWindowingAccumDeltaSize;
2226 bool DragDropActive;
2227 bool DragDropWithinSource;
2228 bool DragDropWithinTarget;
2229 ImGuiDragDropFlags DragDropSourceFlags;
2230 int DragDropSourceFrameCount;
2231 int DragDropMouseButton;
2233 ImRect DragDropTargetRect;
2234 ImRect DragDropTargetClipRect;
2235 ImGuiID DragDropTargetId;
2236 ImGuiDragDropFlags DragDropAcceptFlags;
2237 float DragDropAcceptIdCurrRectSurface;
2238 ImGuiID DragDropAcceptIdCurr;
2239 ImGuiID DragDropAcceptIdPrev;
2240 int DragDropAcceptFrameCount;
2241 ImGuiID DragDropHoldJustPressedId;
2243 unsigned char DragDropPayloadBufLocal[16];
2246 int ClipperTempDataStacked;
2251 ImGuiID DebugBreakInTable;
2252 int TablesTempDataStacked;
2267 int MultiSelectTempDataStacked;
2272 ImGuiID HoverItemDelayId;
2273 ImGuiID HoverItemDelayIdPreviousFrame;
2274 float HoverItemDelayTimer;
2275 float HoverItemDelayClearTimer;
2276 ImGuiID HoverItemUnlockedStationaryId;
2277 ImGuiID HoverWindowUnlockedStationaryId;
2280 ImGuiMouseCursor MouseCursor;
2281 float MouseStationaryTimer;
2282 ImVec2 MouseLastValidPos;
2287 ImFont InputTextPasswordFont;
2288 ImGuiID TempInputId;
2291 int BeginComboDepth;
2292 ImGuiColorEditFlags ColorEditOptions;
2293 ImGuiID ColorEditCurrentID;
2294 ImGuiID ColorEditSavedID;
2295 float ColorEditSavedHue;
2296 float ColorEditSavedSat;
2297 ImU32 ColorEditSavedColor;
2300 ImRect WindowResizeBorderExpectedRect;
2301 bool WindowResizeRelativeMode;
2302 short ScrollbarSeekMode;
2303 float ScrollbarClickDeltaToGrabCenter;
2304 float SliderGrabClickOffset;
2305 float SliderCurrentAccum;
2306 bool SliderCurrentAccumDirty;
2307 bool DragCurrentAccumDirty;
2308 float DragCurrentAccum;
2309 float DragSpeedDefaultRatio;
2310 float DisabledAlphaBackup;
2311 short DisabledStackSize;
2312 short TooltipOverrideCount;
2323 bool SettingsLoaded;
2324 float SettingsDirtyTimer;
2333 const char* LocalizationTable[ImGuiLocKey_COUNT];
2337 ImGuiLogFlags LogFlags;
2339 ImFileHandle LogFile;
2341 const char* LogNextPrefix;
2342 const char* LogNextSuffix;
2344 bool LogLineFirstItem;
2346 int LogDepthToExpand;
2347 int LogDepthToExpandDefault;
2350 ImGuiErrorCallback ErrorCallback;
2351 void* ErrorCallbackUserData;
2352 ImVec2 ErrorTooltipLockedPos;
2354 int ErrorCountCurrentFrame;
2360 int DebugDrawIdConflictsCount;
2361 ImGuiDebugLogFlags DebugLogFlags;
2364 int DebugLogSkippedErrors;
2365 ImGuiDebugLogFlags DebugLogAutoDisableFlags;
2366 ImU8 DebugLogAutoDisableFrames;
2367 ImU8 DebugLocateFrames;
2368 bool DebugBreakInLocateId;
2369 ImGuiKeyChord DebugBreakKeyChord;
2370 ImS8 DebugBeginReturnValueCullDepth;
2371 bool DebugItemPickerActive;
2372 ImU8 DebugItemPickerMouseButton;
2373 ImGuiID DebugItemPickerBreakId;
2374 float DebugFlashStyleColorTime;
2375 ImVec4 DebugFlashStyleColorBackup;
2381 float FramerateSecPerFrame[60];
2382 int FramerateSecPerFrameIdx;
2383 int FramerateSecPerFrameCount;
2384 float FramerateSecPerFrameAccum;
2385 int WantCaptureMouseNextFrame;
2386 int WantCaptureKeyboardNextFrame;
2387 int WantTextInputNextFrame;
2389 char TempKeychordName[64];
2405 ImVec2 CursorPosPrevLine;
2411 float CurrLineTextBaseOffset;
2412 float PrevLineTextBaseOffset;
2418 ImVec2 CursorStartPosLossyness;
2421 ImGuiNavLayer NavLayerCurrent;
2422 short NavLayersActiveMask;
2423 short NavLayersActiveMaskNext;
2424 bool NavIsScrollPushableX;
2425 bool NavHideHighlightOneFrame;
2426 bool NavWindowHasScrollY;
2429 bool MenuBarAppending;
2433 ImU32 TreeHasStackDataDepthMask;
2437 int CurrentTableIdx;
2438 ImGuiLayoutType LayoutType;
2439 ImGuiLayoutType ParentLayoutType;
2440 ImU32 ModalDimBgColor;
2451struct IMGUI_API ImGuiWindow
2456 ImGuiWindowFlags Flags;
2457 ImGuiChildFlags ChildFlags;
2464 ImVec2 ContentSizeExplicit;
2466 float WindowRounding;
2467 float WindowBorderSize;
2468 float TitleBarHeight, MenuBarHeight;
2469 float DecoOuterSizeX1, DecoOuterSizeY1;
2470 float DecoOuterSizeX2, DecoOuterSizeY2;
2471 float DecoInnerSizeX1, DecoInnerSizeY1;
2479 ImVec2 ScrollTargetCenterRatio;
2480 ImVec2 ScrollTargetEdgeSnapDist;
2482 bool ScrollbarX, ScrollbarY;
2487 bool WantCollapseToggle;
2492 bool IsFallbackWindow;
2493 bool IsExplicitChild;
2494 bool HasCloseButton;
2495 signed char ResizeBorderHovered;
2496 signed char ResizeBorderHeld;
2498 short BeginCountPreviousFrame;
2499 short BeginOrderWithinParent;
2500 short BeginOrderWithinContext;
2502 ImS8 AutoFitFramesX, AutoFitFramesY;
2503 bool AutoFitOnlyGrows;
2504 ImGuiDir AutoPosLastDirection;
2505 ImS8 HiddenFramesCanSkipItems;
2506 ImS8 HiddenFramesCannotSkipItems;
2507 ImS8 HiddenFramesForRenderOnly;
2508 ImS8 DisableInputsFrames;
2509 ImGuiCond SetWindowPosAllowFlags : 8;
2510 ImGuiCond SetWindowSizeAllowFlags : 8;
2511 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2513 ImVec2 SetWindowPosPivot;
2526 ImRect ContentRegionRect;
2530 int LastFrameActive;
2531 float LastTimeActive;
2532 float ItemWidthDefault;
2535 float FontWindowScale;
2540 ImGuiWindow* ParentWindow;
2541 ImGuiWindow* ParentWindowInBeginStack;
2542 ImGuiWindow* RootWindow;
2543 ImGuiWindow* RootWindowPopupTree;
2544 ImGuiWindow* RootWindowForTitleBarHighlight;
2545 ImGuiWindow* RootWindowForNav;
2546 ImGuiWindow* ParentWindowForFocusRoute;
2548 ImGuiWindow* NavLastChildNavWindow;
2549 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2550 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2551 ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT];
2552 ImGuiID NavRootFocusScopeId;
2554 int MemoryDrawListIdxCapacity;
2555 int MemoryDrawListVtxCapacity;
2556 bool MemoryCompacted;
2562 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2563 ImGuiID GetID(
const void* ptr);
2564 ImGuiID GetID(
int n);
2565 ImGuiID GetIDFromPos(
const ImVec2& p_abs);
2566 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2569 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2570 float CalcFontSize()
const {
ImGuiContext& g = *Ctx;
float scale = g.FontBaseSize * FontWindowScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
2571 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); }
2572 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight;
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); }
2580enum ImGuiTabBarFlagsPrivate_
2582 ImGuiTabBarFlags_DockNode = 1 << 20,
2583 ImGuiTabBarFlags_IsFocused = 1 << 21,
2584 ImGuiTabBarFlags_SaveSettings = 1 << 22,
2588enum ImGuiTabItemFlagsPrivate_
2590 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
2591 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
2592 ImGuiTabItemFlags_Button = 1 << 21,
2599 ImGuiTabItemFlags Flags;
2600 int LastFrameVisible;
2601 int LastFrameSelected;
2605 float RequestedWidth;
2608 ImS16 IndexDuringLayout;
2611 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
2615struct IMGUI_API ImGuiTabBar
2619 ImGuiTabBarFlags Flags;
2621 ImGuiID SelectedTabId;
2622 ImGuiID NextSelectedTabId;
2623 ImGuiID VisibleTabId;
2624 int CurrFrameVisible;
2625 int PrevFrameVisible;
2627 float CurrTabsContentsHeight;
2628 float PrevTabsContentsHeight;
2630 float WidthAllTabsIdeal;
2631 float ScrollingAnim;
2632 float ScrollingTarget;
2633 float ScrollingTargetDistToVisibility;
2634 float ScrollingSpeed;
2635 float ScrollingRectMinX;
2636 float ScrollingRectMaxX;
2637 float SeparatorMinX;
2638 float SeparatorMaxX;
2639 ImGuiID ReorderRequestTabId;
2640 ImS16 ReorderRequestOffset;
2643 bool VisibleTabWasSubmitted;
2645 ImS16 TabsActiveCount;
2646 ImS16 LastTabItemIdx;
2659#define IM_COL32_DISABLE IM_COL32(0,0,0,1)
2660#define IMGUI_TABLE_MAX_COLUMNS 512
2663typedef ImS16 ImGuiTableColumnIdx;
2664typedef ImU16 ImGuiTableDrawChannelIdx;
2670struct ImGuiTableColumn
2672 ImGuiTableColumnFlags Flags;
2679 float StretchWeight;
2680 float InitStretchWeightOrWidth;
2686 float ContentMaxXFrozen;
2687 float ContentMaxXUnfrozen;
2688 float ContentMaxXHeadersUsed;
2689 float ContentMaxXHeadersIdeal;
2691 ImGuiTableColumnIdx DisplayOrder;
2692 ImGuiTableColumnIdx IndexWithinEnabledSet;
2693 ImGuiTableColumnIdx PrevEnabledColumn;
2694 ImGuiTableColumnIdx NextEnabledColumn;
2695 ImGuiTableColumnIdx SortOrder;
2696 ImGuiTableDrawChannelIdx DrawChannelCurrent;
2697 ImGuiTableDrawChannelIdx DrawChannelFrozen;
2698 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
2701 bool IsUserEnabledNextFrame;
2704 bool IsRequestOutput;
2706 bool IsPreserveWidthAuto;
2707 ImS8 NavLayerCurrent;
2709 ImU8 CannotSkipItemsQueue;
2710 ImU8 SortDirection : 2;
2711 ImU8 SortDirectionsAvailCount : 2;
2712 ImU8 SortDirectionsAvailMask : 4;
2713 ImU8 SortDirectionsAvailList;
2717 memset(
this, 0,
sizeof(*
this));
2718 StretchWeight = WidthRequest = -1.0f;
2720 DisplayOrder = IndexWithinEnabledSet = -1;
2721 PrevEnabledColumn = NextEnabledColumn = -1;
2723 SortDirection = ImGuiSortDirection_None;
2724 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2733 ImGuiTableColumnIdx Column;
2741 ImGuiTableColumnIdx Index;
2749struct ImGuiTableInstanceData
2751 ImGuiID TableInstanceID;
2752 float LastOuterHeight;
2753 float LastTopHeadersRowHeight;
2754 float LastFrozenHeight;
2758 ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
2762struct IMGUI_API ImGuiTable
2765 ImGuiTableFlags Flags;
2771 ImBitArrayPtr EnabledMaskByDisplayOrder;
2772 ImBitArrayPtr EnabledMaskByIndex;
2773 ImBitArrayPtr VisibleMaskByIndex;
2774 ImGuiTableFlags SettingsLoadedFlags;
2776 int LastFrameActive;
2780 ImS16 InstanceCurrent;
2781 ImS16 InstanceInteracted;
2785 float RowCellPaddingY;
2786 float RowTextBaseline;
2787 float RowIndentOffsetX;
2788 ImGuiTableRowFlags RowFlags : 16;
2789 ImGuiTableRowFlags LastRowFlags : 16;
2790 int RowBgColorCounter;
2791 ImU32 RowBgColor[2];
2792 ImU32 BorderColorStrong;
2793 ImU32 BorderColorLight;
2797 float MinColumnWidth;
2798 float OuterPaddingX;
2800 float CellSpacingX1;
2801 float CellSpacingX2;
2803 float ColumnsGivenWidth;
2804 float ColumnsAutoFitWidth;
2805 float ColumnsStretchSumWeights;
2806 float ResizedColumnNextWidth;
2807 float ResizeLockMinContentsX2;
2809 float AngledHeadersHeight;
2810 float AngledHeadersSlope;
2816 ImRect Bg0ClipRectForDrawCmd;
2817 ImRect Bg2ClipRectForDrawCmd;
2819 ImRect HostBackupInnerClipRect;
2829 ImGuiTableColumnIdx SortSpecsCount;
2830 ImGuiTableColumnIdx ColumnsEnabledCount;
2831 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
2832 ImGuiTableColumnIdx DeclColumnsCount;
2833 ImGuiTableColumnIdx AngledHeadersCount;
2834 ImGuiTableColumnIdx HoveredColumnBody;
2835 ImGuiTableColumnIdx HoveredColumnBorder;
2836 ImGuiTableColumnIdx HighlightColumnHeader;
2837 ImGuiTableColumnIdx AutoFitSingleColumn;
2838 ImGuiTableColumnIdx ResizedColumn;
2839 ImGuiTableColumnIdx LastResizedColumn;
2840 ImGuiTableColumnIdx HeldHeaderColumn;
2841 ImGuiTableColumnIdx ReorderColumn;
2842 ImGuiTableColumnIdx ReorderColumnDir;
2843 ImGuiTableColumnIdx LeftMostEnabledColumn;
2844 ImGuiTableColumnIdx RightMostEnabledColumn;
2845 ImGuiTableColumnIdx LeftMostStretchedColumn;
2846 ImGuiTableColumnIdx RightMostStretchedColumn;
2847 ImGuiTableColumnIdx ContextPopupColumn;
2848 ImGuiTableColumnIdx FreezeRowsRequest;
2849 ImGuiTableColumnIdx FreezeRowsCount;
2850 ImGuiTableColumnIdx FreezeColumnsRequest;
2851 ImGuiTableColumnIdx FreezeColumnsCount;
2852 ImGuiTableColumnIdx RowCellDataCurrent;
2853 ImGuiTableDrawChannelIdx DummyDrawChannel;
2854 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
2855 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
2856 bool IsLayoutLocked;
2858 bool IsInitializing;
2859 bool IsSortSpecsDirty;
2860 bool IsUsingHeaders;
2861 bool IsContextPopupOpen;
2862 bool DisableDefaultContextMenu;
2863 bool IsSettingsRequestLoad;
2864 bool IsSettingsDirty;
2865 bool IsDefaultDisplayOrder;
2866 bool IsResetAllRequest;
2867 bool IsResetDisplayOrderRequest;
2868 bool IsUnfrozenRows;
2869 bool IsDefaultSizingPolicy;
2870 bool IsActiveIdAliveBeforeTable;
2871 bool IsActiveIdInTable;
2872 bool HasScrollbarYCurr;
2873 bool HasScrollbarYPrev;
2874 bool MemoryCompacted;
2877 ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
2878 ~ImGuiTable() { IM_FREE(RawData); }
2886struct IMGUI_API ImGuiTableTempData
2889 float LastTimeActive;
2890 float AngledHeadersExtraWidth;
2896 ImRect HostBackupWorkRect;
2897 ImRect HostBackupParentWorkRect;
2898 ImVec2 HostBackupPrevLineSize;
2899 ImVec2 HostBackupCurrLineSize;
2900 ImVec2 HostBackupCursorMaxPos;
2901 ImVec1 HostBackupColumnsOffset;
2902 float HostBackupItemWidth;
2903 int HostBackupItemWidthStackSize;
2905 ImGuiTableTempData() { memset(
this, 0,
sizeof(*
this)); LastTimeActive = -1.0f; }
2909struct ImGuiTableColumnSettings
2911 float WidthOrWeight;
2913 ImGuiTableColumnIdx Index;
2914 ImGuiTableColumnIdx DisplayOrder;
2915 ImGuiTableColumnIdx SortOrder;
2916 ImU8 SortDirection : 2;
2920 ImGuiTableColumnSettings()
2922 WidthOrWeight = 0.0f;
2925 DisplayOrder = SortOrder = -1;
2926 SortDirection = ImGuiSortDirection_None;
2933struct ImGuiTableSettings
2936 ImGuiTableFlags SaveFlags;
2938 ImGuiTableColumnIdx ColumnsCount;
2939 ImGuiTableColumnIdx ColumnsCountMax;
2942 ImGuiTableSettings() { memset(
this, 0,
sizeof(*
this)); }
2960 inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
2961 IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID
id);
2962 IMGUI_API ImGuiWindow* FindWindowByName(
const char* name);
2963 IMGUI_API
void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);
2964 IMGUI_API
void UpdateWindowSkipRefresh(ImGuiWindow* window);
2965 IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);
2966 IMGUI_API
bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent,
bool popup_hierarchy);
2967 IMGUI_API
bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
2968 IMGUI_API
bool IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below);
2969 IMGUI_API
bool IsWindowNavFocusable(ImGuiWindow* window);
2970 IMGUI_API
void SetWindowPos(ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
2971 IMGUI_API
void SetWindowSize(ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
2972 IMGUI_API
void SetWindowCollapsed(ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
2973 IMGUI_API
void SetWindowHitTestHole(ImGuiWindow* window,
const ImVec2& pos,
const ImVec2& size);
2974 IMGUI_API
void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window);
2975 inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
2976 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); }
2977 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); }
2978 inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window,
const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos;
return ImVec2(p.x - off.x, p.y - off.y); }
2979 inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window,
const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos;
return ImVec2(p.x + off.x, p.y + off.y); }
2982 IMGUI_API
void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
2983 IMGUI_API
void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);
2984 IMGUI_API
void BringWindowToFocusFront(ImGuiWindow* window);
2985 IMGUI_API
void BringWindowToDisplayFront(ImGuiWindow* window);
2986 IMGUI_API
void BringWindowToDisplayBack(ImGuiWindow* window);
2987 IMGUI_API
void BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* above_window);
2988 IMGUI_API
int FindWindowDisplayIndex(ImGuiWindow* window);
2989 IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);
2992 IMGUI_API
void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
2995 IMGUI_API
void SetCurrentFont(ImFont* font);
2996 inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
2997 inline ImDrawList* GetForegroundDrawList(ImGuiWindow* window) { IM_UNUSED(window);
return GetForegroundDrawList(); }
2998 IMGUI_API ImDrawList* GetBackgroundDrawList(ImGuiViewport* viewport);
2999 IMGUI_API ImDrawList* GetForegroundDrawList(ImGuiViewport* viewport);
3000 IMGUI_API
void AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);
3003 IMGUI_API
void Initialize();
3004 IMGUI_API
void Shutdown();
3007 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
3008 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
3009 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);
3010 IMGUI_API
void StartMouseMovingWindow(ImGuiWindow* window);
3011 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
3012 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
3015 IMGUI_API ImGuiID AddContextHook(ImGuiContext* context,
const ImGuiContextHook* hook);
3016 IMGUI_API
void RemoveContextHook(ImGuiContext* context, ImGuiID hook_to_remove);
3017 IMGUI_API
void CallContextHooks(ImGuiContext* context, ImGuiContextHookType type);
3020 IMGUI_API
void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);
3023 IMGUI_API
void MarkIniSettingsDirty();
3024 IMGUI_API
void MarkIniSettingsDirty(ImGuiWindow* window);
3025 IMGUI_API
void ClearIniSettings();
3026 IMGUI_API
void AddSettingsHandler(
const ImGuiSettingsHandler* handler);
3027 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
3028 IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(
const char* type_name);
3031 IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(
const char* name);
3032 IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID
id);
3033 IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);
3034 IMGUI_API
void ClearWindowSettings(
const char* name);
3037 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
3038 inline const char* LocalizeGetMsg(ImGuiLocKey key) { ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
3041 IMGUI_API
void SetScrollX(ImGuiWindow* window,
float scroll_x);
3042 IMGUI_API
void SetScrollY(ImGuiWindow* window,
float scroll_y);
3043 IMGUI_API
void SetScrollFromPosX(ImGuiWindow* window,
float local_x,
float center_x_ratio);
3044 IMGUI_API
void SetScrollFromPosY(ImGuiWindow* window,
float local_y,
float center_y_ratio);
3047 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
3048 IMGUI_API
void ScrollToRect(ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
3049 IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
3051 inline void ScrollToBringRectIntoView(ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
3055 inline ImGuiItemStatusFlags GetItemStatusFlags() { ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
3056 inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui;
return g.LastItemData.ItemFlags; }
3057 inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui;
return g.ActiveId; }
3058 inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui;
return g.NavId; }
3059 IMGUI_API
void SetActiveID(ImGuiID
id, ImGuiWindow* window);
3060 IMGUI_API
void SetFocusID(ImGuiID
id, ImGuiWindow* window);
3061 IMGUI_API
void ClearActiveID();
3062 IMGUI_API ImGuiID GetHoveredID();
3063 IMGUI_API
void SetHoveredID(ImGuiID
id);
3064 IMGUI_API
void KeepAliveID(ImGuiID
id);
3065 IMGUI_API
void MarkItemEdited(ImGuiID
id);
3066 IMGUI_API
void PushOverrideID(ImGuiID
id);
3067 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
3068 IMGUI_API ImGuiID GetIDWithSeed(
int n, ImGuiID seed);
3071 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
3072 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
3073 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
3074 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id, ImGuiItemFlags item_flags);
3075 IMGUI_API
bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
3076 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
3077 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
3078 IMGUI_API ImVec2 CalcItemSize(ImVec2 size,
float default_w,
float default_h);
3079 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
3080 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
3081 IMGUI_API
void ShrinkWidths(ImGuiShrinkWidthItem* items,
int count,
float width_excess);
3084 IMGUI_API
const ImGuiDataVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);
3085 IMGUI_API
void BeginDisabledOverrideReenable();
3086 IMGUI_API
void EndDisabledOverrideReenable();
3089 IMGUI_API
void LogBegin(ImGuiLogFlags flags,
int auto_open_depth);
3090 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
3091 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
3092 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
3095 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
3098 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_window_flags);
3099 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
3100 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
3101 IMGUI_API
void ClosePopupsOverWindow(ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
3102 IMGUI_API
void ClosePopupsExceptModals();
3103 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
3104 IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
3105 IMGUI_API ImGuiWindow* GetTopMostPopupModal();
3106 IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();
3107 IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);
3108 IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);
3109 IMGUI_API ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
3112 IMGUI_API
bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
3113 IMGUI_API
bool BeginTooltipHidden();
3116 IMGUI_API
bool BeginViewportSideBar(
const char* name, ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
3117 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
3118 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
3121 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
3122 IMGUI_API
bool BeginComboPreview();
3123 IMGUI_API
void EndComboPreview();
3126 IMGUI_API
void NavInitWindow(ImGuiWindow* window,
bool force_reinit);
3127 IMGUI_API
void NavInitRequestApplyResult();
3128 IMGUI_API
bool NavMoveRequestButNoResultYet();
3129 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3130 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
3131 IMGUI_API
void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);
3132 IMGUI_API
void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiTreeNodeStackData* tree_node_data);
3133 IMGUI_API
void NavMoveRequestCancel();
3134 IMGUI_API
void NavMoveRequestApplyResult();
3135 IMGUI_API
void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
3136 IMGUI_API
void NavHighlightActivated(ImGuiID
id);
3137 IMGUI_API
void NavClearPreferredPosForAxis(ImGuiAxis axis);
3138 IMGUI_API
void SetNavCursorVisibleAfterMove();
3139 IMGUI_API
void NavUpdateCurrentWindowIsScrollPushableX();
3140 IMGUI_API
void SetNavWindow(ImGuiWindow* window);
3141 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
3142 IMGUI_API
void SetNavFocusScope(ImGuiID focus_scope_id);
3147 IMGUI_API
void FocusItem();
3148 IMGUI_API
void ActivateItemByID(ImGuiID
id);
3152 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
3153 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; }
3154 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
3155 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
3156 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
3157 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
3158 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
3159 inline bool IsLRModKey(ImGuiKey key) {
return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
3160 ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
3161 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
3163 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
3164 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
3165 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
3166 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
3170 IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
3171 inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui;
return GetKeyData(&g, key); }
3172 IMGUI_API
const char* GetKeyChordName(ImGuiKeyChord key_chord);
3173 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
3174 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
3175 IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
3176 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
3177 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
3178 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
3179 IMGUI_API
void TeleportMousePos(
const ImVec2& pos);
3180 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
3181 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
3194 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
3195 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3196 IMGUI_API
void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
3197 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);
3198 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
3199 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]; }
3207 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
3208 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3209 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
3210 IMGUI_API
bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3211 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
3212 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
3213 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
3214 IMGUI_API
bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
3230 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3231 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
3232 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
3233 IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);
3243 IMGUI_API
void PushFocusScope(ImGuiID
id);
3244 IMGUI_API
void PopFocusScope();
3245 inline ImGuiID GetCurrentFocusScope() { ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
3248 IMGUI_API
bool IsDragDropActive();
3249 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
3250 IMGUI_API
void ClearDragDrop();
3251 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
3252 IMGUI_API
void RenderDragDropTargetRect(
const ImRect& bb,
const ImRect& item_clip_rect);
3257 IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
3258 IMGUI_API
int TypingSelectFindMatch(ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3259 IMGUI_API
int TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data,
int nav_item_idx);
3260 IMGUI_API
int TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req,
int items_count,
const char* (*get_item_name_func)(
void*,
int),
void* user_data);
3263 IMGUI_API
bool BeginBoxSelect(
const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);
3264 IMGUI_API
void EndBoxSelect(
const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);
3267 IMGUI_API
void MultiSelectItemHeader(ImGuiID
id,
bool* p_selected, ImGuiButtonFlags* p_button_flags);
3268 IMGUI_API
void MultiSelectItemFooter(ImGuiID
id,
bool* p_selected,
bool* p_pressed);
3269 IMGUI_API
void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms,
bool selected);
3270 IMGUI_API
void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms,
bool selected,
int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
3271 inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID
id) { ImGuiContext& g = *GImGui;
return (
id != 0 && g.BoxSelectState.ID ==
id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
3272 inline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID
id) { ImGuiContext& g = *GImGui;
return g.MultiSelectStorage.GetByKey(
id); }
3275 IMGUI_API
void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window,
const ImRect& clip_rect);
3276 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
3277 IMGUI_API
void EndColumns();
3278 IMGUI_API
void PushColumnClipRect(
int column_index);
3279 IMGUI_API
void PushColumnsBackground();
3280 IMGUI_API
void PopColumnsBackground();
3281 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
3282 IMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID
id);
3283 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
3284 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
3287 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
3288 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
3289 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
3290 IMGUI_API
int TableGetHoveredRow();
3291 IMGUI_API
float TableGetHeaderRowHeight();
3292 IMGUI_API
float TableGetHeaderAngledMaxLabelWidth();
3293 IMGUI_API
void TablePushBackgroundChannel();
3294 IMGUI_API
void TablePopBackgroundChannel();
3295 IMGUI_API
void TableAngledHeadersRowEx(ImGuiID row_id,
float angle,
float max_label_width,
const ImGuiTableHeaderData* data,
int data_count);
3298 inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui;
return g.CurrentTable; }
3299 IMGUI_API ImGuiTable* TableFindByID(ImGuiID
id);
3300 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);
3301 IMGUI_API
void TableBeginInitMemory(ImGuiTable* table,
int columns_count);
3302 IMGUI_API
void TableBeginApplyRequests(ImGuiTable* table);
3303 IMGUI_API
void TableSetupDrawChannels(ImGuiTable* table);
3304 IMGUI_API
void TableUpdateLayout(ImGuiTable* table);
3305 IMGUI_API
void TableUpdateBorders(ImGuiTable* table);
3306 IMGUI_API
void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
3307 IMGUI_API
void TableDrawBorders(ImGuiTable* table);
3308 IMGUI_API
void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
3309 IMGUI_API
bool TableBeginContextMenuPopup(ImGuiTable* table);
3310 IMGUI_API
void TableMergeDrawChannels(ImGuiTable* table);
3311 inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3312 inline ImGuiID TableGetInstanceID(ImGuiTable* table,
int instance_no) {
return TableGetInstanceData(table, instance_no)->TableInstanceID; }
3313 IMGUI_API
void TableSortSpecsSanitize(ImGuiTable* table);
3314 IMGUI_API
void TableSortSpecsBuild(ImGuiTable* table);
3315 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
3316 IMGUI_API
void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);
3317 IMGUI_API
float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);
3318 IMGUI_API
void TableBeginRow(ImGuiTable* table);
3319 IMGUI_API
void TableEndRow(ImGuiTable* table);
3320 IMGUI_API
void TableBeginCell(ImGuiTable* table,
int column_n);
3321 IMGUI_API
void TableEndCell(ImGuiTable* table);
3322 IMGUI_API ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3323 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3324 IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table,
int column_n,
int instance_no = 0);
3325 IMGUI_API
float TableCalcMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3326 IMGUI_API
void TableSetColumnWidthAutoSingle(ImGuiTable* table,
int column_n);
3327 IMGUI_API
void TableSetColumnWidthAutoAll(ImGuiTable* table);
3328 IMGUI_API
void TableRemove(ImGuiTable* table);
3329 IMGUI_API
void TableGcCompactTransientBuffers(ImGuiTable* table);
3330 IMGUI_API
void TableGcCompactTransientBuffers(ImGuiTableTempData* table);
3331 IMGUI_API
void TableGcCompactSettings();
3334 IMGUI_API
void TableLoadSettings(ImGuiTable* table);
3335 IMGUI_API
void TableSaveSettings(ImGuiTable* table);
3336 IMGUI_API
void TableResetSettings(ImGuiTable* table);
3337 IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
3338 IMGUI_API
void TableSettingsAddSettingsHandler();
3339 IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID
id,
int columns_count);
3340 IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID
id);
3343 inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui;
return g.CurrentTabBar; }
3344 IMGUI_API
bool BeginTabBarEx(ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3345 IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);
3346 IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar,
int order);
3347 IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);
3348 inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) {
return tab_bar->Tabs.index_from_ptr(tab); }
3349 IMGUI_API
const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
3350 IMGUI_API
void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
3351 IMGUI_API
void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
3352 IMGUI_API
void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
3353 IMGUI_API
void TabBarQueueFocus(ImGuiTabBar* tab_bar,
const char* tab_name);
3354 IMGUI_API
void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab,
int offset);
3355 IMGUI_API
void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);
3356 IMGUI_API
bool TabBarProcessReorder(ImGuiTabBar* tab_bar);
3357 IMGUI_API
bool TabItemEx(ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);
3358 IMGUI_API ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3359 IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);
3360 IMGUI_API
void TabItemBackground(ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3361 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);
3366 IMGUI_API
void RenderText(ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3367 IMGUI_API
void RenderTextWrapped(ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3368 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);
3369 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);
3370 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);
3371 IMGUI_API
void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col,
bool borders =
true,
float rounding = 0.0f);
3372 IMGUI_API
void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max,
float rounding = 0.0f);
3373 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);
3374 IMGUI_API
void RenderNavCursor(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None);
3375#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3376 inline void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb,
id, flags); }
3378 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3379 IMGUI_API
void RenderMouseCursor(ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3382 IMGUI_API
void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3383 IMGUI_API
void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
3384 IMGUI_API
void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col,
float sz);
3385 IMGUI_API
void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3386 IMGUI_API
void RenderRectFilledRangeH(ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
3387 IMGUI_API
void RenderRectFilledWithHole(ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3390 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3391 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3392 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3393 IMGUI_API
bool ImageButtonEx(ImGuiID
id, ImTextureID user_texture_id,
const ImVec2& image_size,
const ImVec2& uv0,
const ImVec2& uv1,
const ImVec4& bg_col,
const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
3394 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags,
float thickness = 1.0f);
3395 IMGUI_API
void SeparatorTextEx(ImGuiID
id,
const char* label,
const char* label_end,
float extra_width);
3396 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3397 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3400 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3401 IMGUI_API
bool CollapseButton(ImGuiID
id,
const ImVec2& pos);
3402 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3403 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags draw_rounding_flags = 0);
3404 IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);
3405 IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
3406 IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window,
int n);
3407 IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);
3410 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3411 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);
3412 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);
3413 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);
3416 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3417 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3418 IMGUI_API
bool TreeNodeGetOpen(ImGuiID storage_id);
3419 IMGUI_API
void TreeNodeSetOpen(ImGuiID storage_id,
bool open);
3420 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);
3425 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);
3426 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);
3427 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);
3428 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);
3429 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3430 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3433 IMGUI_API
const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type);
3434 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3435 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3436 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format,
void* p_data_when_empty = NULL);
3437 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3438 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3439 IMGUI_API
bool DataTypeIsZero(ImGuiDataType data_type,
const void* p_data);
3442 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);
3443 IMGUI_API
void InputTextDeactivateHook(ImGuiID
id);
3444 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3445 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);
3446 inline bool TempInputIsActive(ImGuiID
id) { ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
3447 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) { ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3448 IMGUI_API
void SetNextItemRefVal(ImGuiDataType data_type,
void* p_data);
3451 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3452 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3453 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3456 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);
3459 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);
3460 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);
3461 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);
3464 IMGUI_API
void GcCompactTransientMiscBuffers();
3465 IMGUI_API
void GcCompactTransientWindowBuffers(ImGuiWindow* window);
3466 IMGUI_API
void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
3469 IMGUI_API
bool ErrorLog(
const char* msg);
3470 IMGUI_API
void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);
3471 IMGUI_API
void ErrorRecoveryTryToRecoverState(
const ImGuiErrorRecoveryState* state_in);
3472 IMGUI_API
void ErrorRecoveryTryToRecoverWindowState(
const ImGuiErrorRecoveryState* state_in);
3473 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
3474 IMGUI_API
void ErrorCheckEndFrameFinalizeErrorTooltip();
3475 IMGUI_API
bool BeginErrorTooltip();
3476 IMGUI_API
void EndErrorTooltip();
3479 IMGUI_API
void DebugAllocHook(ImGuiDebugAllocInfo* info,
int frame_count,
void* ptr,
size_t size);
3480 IMGUI_API
void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
3481 IMGUI_API
void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
3482 IMGUI_API
void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
3483 IMGUI_API
void DebugTextUnformattedWithLocateItem(
const char* line_begin,
const char* line_end);
3484 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
3485 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
3486 IMGUI_API
void DebugLocateItemResolveWithLastItem();
3487 IMGUI_API
void DebugBreakClearData();
3488 IMGUI_API
bool DebugBreakButton(
const char* label,
const char* description_of_location);
3489 IMGUI_API
void DebugBreakButtonTooltip(
bool keyboard_only,
const char* description_of_location);
3490 IMGUI_API
void ShowFontAtlas(ImFontAtlas* atlas);
3491 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
3492 IMGUI_API
void DebugNodeColumns(ImGuiOldColumns* columns);
3493 IMGUI_API
void DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport,
const ImDrawList* draw_list,
const char* label);
3494 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
3495 IMGUI_API
void DebugNodeFont(ImFont* font);
3496 IMGUI_API
void DebugNodeFontGlyph(ImFont* font,
const ImFontGlyph* glyph);
3497 IMGUI_API
void DebugNodeStorage(ImGuiStorage* storage,
const char* label);
3498 IMGUI_API
void DebugNodeTabBar(ImGuiTabBar* tab_bar,
const char* label);
3499 IMGUI_API
void DebugNodeTable(ImGuiTable* table);
3500 IMGUI_API
void DebugNodeTableSettings(ImGuiTableSettings* settings);
3501 IMGUI_API
void DebugNodeInputTextState(ImGuiInputTextState* state);
3502 IMGUI_API
void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);
3503 IMGUI_API
void DebugNodeMultiSelectState(ImGuiMultiSelectState* state);
3504 IMGUI_API
void DebugNodeWindow(ImGuiWindow* window,
const char* label);
3505 IMGUI_API
void DebugNodeWindowSettings(ImGuiWindowSettings* settings);
3506 IMGUI_API
void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows,
const char* label);
3507 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows,
int windows_size, ImGuiWindow* parent_in_begin_stack);
3508 IMGUI_API
void DebugNodeViewport(ImGuiViewportP* viewport);
3509 IMGUI_API
void DebugRenderKeyboardPreview(ImDrawList* draw_list);
3510 IMGUI_API
void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport,
const ImRect& bb);
3513#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3541#ifdef IMGUI_ENABLE_STB_TRUETYPE
3542IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
3544IMGUI_API
void ImFontAtlasUpdateConfigDataPointers(
ImFontAtlas* atlas);
3545IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
3547IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
3548IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
3549IMGUI_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);
3550IMGUI_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);
3551IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
3552IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
3558#ifdef IMGUI_ENABLE_TEST_ENGINE
3560extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
3561extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
3562extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
3565#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA)
3566#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS)
3567#define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__)
3569#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
3570#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
3575#if defined(__clang__)
3576#pragma clang diagnostic pop
3577#elif defined(__GNUC__)
3578#pragma GCC diagnostic pop
3582#pragma warning (pop)
Definition imgui_internal.h:589
Definition imgui_internal.h:604
Definition imgui_internal.h:705
Definition imgui_internal.h:793
Definition imgui_internal.h:771
Definition imgui_internal.h:3536
Definition imgui_internal.h:1730
Definition imgui_internal.h:1033
Definition imgui_internal.h:1050
Definition imgui_internal.h:2015
Definition imgui_internal.h:2030
Definition imgui_internal.h:819
Definition imgui_internal.h:813
Definition imgui_internal.h:805
Definition imgui_internal.h:1950
Definition imgui_internal.h:1957
Definition imgui_internal.h:1275
Definition imgui_internal.h:1627
Definition imgui_internal.h:1063
Definition imgui_internal.h:1398
Definition imgui_internal.h:1099
Definition imgui_internal.h:1121
Definition imgui_internal.h:1455
Definition imgui_internal.h:1443
Definition imgui_internal.h:1247
Definition imgui_internal.h:1512
Definition imgui_internal.h:1901
Definition imgui_internal.h:1081
Definition imgui_internal.h:1967
Definition imgui_internal.h:1787
Definition imgui_internal.h:1762
Definition imgui_internal.h:1610
Definition imgui_internal.h:1227
Definition imgui_internal.h:1193
Definition imgui_internal.h:1695
Definition imgui_internal.h:1705
Definition imgui_internal.h:1866
Definition imgui_internal.h:1301
Definition imgui_internal.h:1040
Definition imgui_internal.h:2616
Definition imgui_internal.h:2597
Definition imgui_internal.h:2731
Definition imgui_internal.h:2671
Definition imgui_internal.h:2910
Definition imgui_internal.h:2763
Definition imgui_internal.h:2750
Definition imgui_internal.h:2934
Definition imgui_internal.h:2887
Definition imgui_internal.h:724
Definition imgui_internal.h:1266
Definition imgui_internal.h:1646
Definition imgui_internal.h:1657
Definition imgui_internal.h:1815
Definition imgui_internal.h:2452
Definition imgui_internal.h:1852
Definition imgui_internal.h:1293
Definition imgui_internal.h:2402
Definition imgui_internal.h:671
Definition imgui_internal.h:526
Definition imgui_internal.h:618
Definition imgui_internal.h:508
Definition imgui_internal.h:516
Definition imstb_textedit.h:330