61#if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE)
62#define IMGUI_ENABLE_SSE
69#pragma warning (disable: 4251)
70#pragma warning (disable: 26812)
71#pragma warning (disable: 26495)
72#if defined(_MSC_VER) && _MSC_VER >= 1922
73#pragma warning (disable: 5054)
79#pragma clang diagnostic push
80#if __has_warning("-Wunknown-warning-option")
81#pragma clang diagnostic ignored "-Wunknown-warning-option"
83#pragma clang diagnostic ignored "-Wunknown-pragmas"
84#pragma clang diagnostic ignored "-Wfloat-equal"
85#pragma clang diagnostic ignored "-Wunused-function"
86#pragma clang diagnostic ignored "-Wmissing-prototypes"
87#pragma clang diagnostic ignored "-Wold-style-cast"
88#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
89#pragma clang diagnostic ignored "-Wdouble-promotion"
90#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
91#pragma clang diagnostic ignored "-Wmissing-noreturn"
92#elif defined(__GNUC__)
93#pragma GCC diagnostic push
94#pragma GCC diagnostic ignored "-Wpragmas"
95#pragma GCC diagnostic ignored "-Wclass-memaccess"
99#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
100#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
102#ifdef IMGUI_DISABLE_MATH_FUNCTIONS
103#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
108#ifndef IMGUI_ENABLE_FREETYPE
109#define IMGUI_ENABLE_STB_TRUETYPE
146struct ImGuiTableColumnsSettings;
153enum ImGuiLocKey : int;
154typedef int ImGuiLayoutType;
157typedef int ImGuiActivateFlags;
158typedef int ImGuiDebugLogFlags;
159typedef int ImGuiInputFlags;
160typedef int ImGuiItemFlags;
161typedef int ImGuiItemStatusFlags;
162typedef int ImGuiOldColumnFlags;
163typedef int ImGuiNavHighlightFlags;
164typedef int ImGuiNavMoveFlags;
165typedef int ImGuiNextItemDataFlags;
166typedef int ImGuiNextWindowDataFlags;
167typedef int ImGuiScrollFlags;
168typedef int ImGuiSeparatorFlags;
169typedef int ImGuiTextFlags;
170typedef int ImGuiTooltipFlags;
172typedef void (*ImGuiErrorLogCallback)(
void* user_data,
const char* fmt, ...);
190#undef STB_TEXTEDIT_STRING
191#undef STB_TEXTEDIT_CHARTYPE
192#define STB_TEXTEDIT_STRING ImGuiInputTextState
193#define STB_TEXTEDIT_CHARTYPE ImWchar
194#define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
195#define STB_TEXTEDIT_UNDOSTATECOUNT 99
196#define STB_TEXTEDIT_UNDOCHARCOUNT 999
197#include "imstb_textedit.h"
207#ifndef IMGUI_DEBUG_PRINTF
208#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
209#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
211#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
216#ifndef IMGUI_DISABLE_DEBUG_TOOLS
217#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
219#define IMGUI_DEBUG_LOG(...) ((void)0)
221#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
222#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
223#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
224#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
225#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
226#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
229#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
234#ifdef IMGUI_DEBUG_PARANOID
235#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
237#define IM_ASSERT_PARANOID(_EXPR)
242#ifndef IM_ASSERT_USER_ERROR
243#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG)
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_FLOOR(_VAL) ((float)(int)(_VAL))
260#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f))
264#define IMGUI_CDECL __cdecl
270#if defined(_MSC_VER) && !defined(__clang__)
271#define IM_MSVC_WARNING_SUPPRESS(XXXX) __pragma(warning(suppress: XXXX))
273#define IM_MSVC_WARNING_SUPPRESS(XXXX)
279#ifndef IM_DEBUG_BREAK
280#if defined (_MSC_VER)
281#define IM_DEBUG_BREAK() __debugbreak()
282#elif defined(__clang__)
283#define IM_DEBUG_BREAK() __builtin_debugtrap()
284#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
285#define IM_DEBUG_BREAK() __asm__ volatile("int $0x03")
286#elif defined(__GNUC__) && defined(__thumb__)
287#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
288#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
289#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0");
291#define IM_DEBUG_BREAK() IM_ASSERT(0)
321IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImGuiID seed = 0);
322IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImGuiID seed = 0);
326static 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); }
330IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
333static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
334static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
335static inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
338IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
339IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
340IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
341IMGUI_API
char* ImStrdup(
const char* str);
342IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
343IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
344IMGUI_API
int ImStrlenW(
const ImWchar* str);
345IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
346IMGUI_API
const ImWchar*ImStrbolW(
const ImWchar* buf_mid_line,
const ImWchar* buf_begin);
347IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
348IMGUI_API
void ImStrTrimBlanks(
char* str);
349IMGUI_API
const char* ImStrSkipBlank(
const char* str);
350IM_MSVC_RUNTIME_CHECKS_OFF
351static inline char ImToUpper(
char c) {
return (c >=
'a' && c <=
'z') ? c &= ~32 : c; }
352static inline bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
353static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
354IM_MSVC_RUNTIME_CHECKS_RESTORE
357IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
358IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
359IMGUI_API
void ImFormatStringToTempBuffer(const
char** out_buf, const
char** out_buf_end, const
char* fmt, ...) IM_FMTARGS(3);
360IMGUI_API
void ImFormatStringToTempBufferV(const
char** out_buf, const
char** out_buf_end, const
char* fmt, va_list args) IM_FMTLIST(3);
361IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
362IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
363IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
364IMGUI_API
void ImParseFormatSanitizeForPrinting(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
365IMGUI_API const
char* ImParseFormatSanitizeForScanning(const
char* fmt_in,
char* fmt_out,
size_t fmt_out_size);
366IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
369IMGUI_API const
char* ImTextCharToUtf8(
char out_buf[5],
unsigned int c);
370IMGUI_API
int ImTextStrToUtf8(
char* out_buf,
int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end);
371IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char, const
char* in_text, const
char* in_text_end);
372IMGUI_API
int ImTextStrFromUtf8(ImWchar* out_buf,
int out_buf_size, const
char* in_text, const
char* in_text_end, const
char** in_remaining = NULL);
373IMGUI_API
int ImTextCountCharsFromUtf8(const
char* in_text, const
char* in_text_end);
374IMGUI_API
int ImTextCountUtf8BytesFromChar(const
char* in_text, const
char* in_text_end);
375IMGUI_API
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end);
380#ifdef IMGUI_DEFINE_MATH_OPERATORS
381IM_MSVC_RUNTIME_CHECKS_OFF
382static inline ImVec2 operator*(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x * rhs, lhs.y * rhs); }
383static inline ImVec2 operator/(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x / rhs, lhs.y / rhs); }
384static inline ImVec2 operator+(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
385static inline ImVec2 operator-(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
386static inline ImVec2 operator*(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
387static inline ImVec2 operator/(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
388static inline ImVec2& operator*=(
ImVec2& lhs,
const float rhs) { lhs.x *= rhs; lhs.y *= rhs;
return lhs; }
389static inline ImVec2& operator/=(
ImVec2& lhs,
const float rhs) { lhs.x /= rhs; lhs.y /= rhs;
return lhs; }
390static inline ImVec2& operator+=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y;
return lhs; }
391static inline ImVec2& operator-=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y;
return lhs; }
392static inline ImVec2& operator*=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y;
return lhs; }
393static inline ImVec2& operator/=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y;
return lhs; }
394static inline ImVec4 operator+(
const ImVec4& lhs,
const ImVec4& rhs) {
return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); }
395static inline ImVec4 operator-(
const ImVec4& lhs,
const ImVec4& rhs) {
return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); }
396static inline ImVec4 operator*(
const ImVec4& lhs,
const ImVec4& rhs) {
return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); }
397IM_MSVC_RUNTIME_CHECKS_RESTORE
401#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
402#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
403typedef void* ImFileHandle;
404static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
405static inline bool ImFileClose(ImFileHandle) {
return false; }
406static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
407static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
408static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
410#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
411typedef FILE* ImFileHandle;
412IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
413IMGUI_API
bool ImFileClose(ImFileHandle file);
414IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
415IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
416IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
418#define IMGUI_DISABLE_TTY_FUNCTIONS
420IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
423IM_MSVC_RUNTIME_CHECKS_OFF
425#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
426#define ImFabs(X) fabsf(X)
427#define ImSqrt(X) sqrtf(X)
428#define ImFmod(X, Y) fmodf((X), (Y))
429#define ImCos(X) cosf(X)
430#define ImSin(X) sinf(X)
431#define ImAcos(X) acosf(X)
432#define ImAtan2(Y, X) atan2f((Y), (X))
433#define ImAtof(STR) atof(STR)
435#define ImCeil(X) ceilf(X)
436static inline float ImPow(
float x,
float y) {
return powf(x, y); }
437static inline double ImPow(
double x,
double y) {
return pow(x, y); }
438static inline float ImLog(
float x) {
return logf(x); }
439static inline double ImLog(
double x) {
return log(x); }
440static inline int ImAbs(
int x) {
return x < 0 ? -x : x; }
441static inline float ImAbs(
float x) {
return fabsf(x); }
442static inline double ImAbs(
double x) {
return fabs(x); }
443static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; }
444static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
445#ifdef IMGUI_ENABLE_SSE
446static inline float ImRsqrt(
float x) {
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
448static inline float ImRsqrt(
float x) {
return 1.0f / sqrtf(x); }
450static inline double ImRsqrt(
double x) {
return 1.0 / sqrt(x); }
454template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
455template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
456template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
457template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
458template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
459template<
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; }
460template<
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; }
462static 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); }
463static 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); }
464static inline ImVec2 ImClamp(
const ImVec2& v,
const ImVec2& mn,
ImVec2 mx) {
return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); }
465static 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); }
466static 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); }
467static 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); }
468static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
469static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
470static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
471static 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; }
472static inline float ImFloor(
float f) {
return (
float)(int)(f); }
473static inline float ImFloorSigned(
float f) {
return (
float)((f >= 0 || (float)(
int)f == f) ? (
int)f : (int)f - 1); }
474static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
475static inline ImVec2 ImFloorSigned(
const ImVec2& v) {
return ImVec2(ImFloorSigned(v.x), ImFloorSigned(v.y)); }
476static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
477static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
478static 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); }
479static 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; }
481static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(
float f) {
return f <= -16777216 || f >= 16777216; }
482static inline float ImExponentialMovingAverage(
float avg,
float sample,
int n) { avg -= avg / n; avg += sample / n;
return avg; }
483IM_MSVC_RUNTIME_CHECKS_RESTORE
493IMGUI_API
void ImTriangleBarycentricCoords(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c,
const ImVec2& p,
float& out_u,
float& out_v,
float& out_w);
494inline 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; }
495IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(
float dx,
float dy);
499IM_MSVC_RUNTIME_CHECKS_OFF
503 constexpr ImVec1() : x(0.0f) { }
504 constexpr ImVec1(
float _x) : x(_x) { }
511 constexpr ImVec2ih() : x(0), y(0) {}
512 constexpr ImVec2ih(
short _x,
short _y) : x(_x), y(_y) {}
513 constexpr explicit ImVec2ih(
const ImVec2& rhs) : x((
short)rhs.x), y((
short)rhs.y) {}
523 constexpr ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
525 constexpr ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
526 constexpr ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
528 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
529 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
530 float GetWidth()
const {
return Max.x - Min.x; }
531 float GetHeight()
const {
return Max.y - Min.y; }
532 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
533 ImVec2 GetTL()
const {
return Min; }
536 ImVec2 GetBR()
const {
return Max; }
537 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
538 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; }
539 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; }
540 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; }
541 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; }
542 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
543 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
544 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
545 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
546 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
547 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
548 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
549 void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); }
550 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
551 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
555#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0)
556#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31))))
557inline size_t ImBitArrayGetStorageSizeInBytes(
int bitcount) {
return (
size_t)((bitcount + 31) >> 5) << 2; }
558inline void ImBitArrayClearAllBits(ImU32* arr,
int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
559inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
560inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
561inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
562inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
567 int a_mod = (n & 31);
568 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
569 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
575typedef ImU32* ImBitArrayPtr;
579template<
int BITCOUNT,
int OFFSET = 0>
582 ImU32 Storage[(BITCOUNT + 31) >> 5];
584 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
585 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
586 bool TestBit(
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
587 void SetBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
588 void ClearBit(
int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
589 void SetBitRange(
int n,
int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); }
590 bool operator[](
int n)
const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT);
return IM_BITARRAY_TESTBIT(Storage, n); }
598 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
599 void Clear() { Storage.clear(); }
600 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return IM_BITARRAY_TESTBIT(Storage.Data, n); }
601 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
602 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
604IM_MSVC_RUNTIME_CHECKS_RESTORE
615 inline ImSpan() { Data = DataEnd = NULL; }
616 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
617 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
619 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
620 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
621 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
622 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
623 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
624 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
626 inline T* begin() {
return Data; }
627 inline const T* begin()
const {
return Data; }
628 inline T* end() {
return DataEnd; }
629 inline const T* end()
const {
return DataEnd; }
632 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
648 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; }
649 inline int GetArenaSizeInBytes() {
return CurrOff; }
650 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
651 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
652 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
654 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
660typedef int ImPoolIdx;
667 ImPoolIdx AliveCount;
669 ImPool() { FreeIdx = AliveCount = 0; }
671 T* GetByKey(ImGuiID key) {
int idx =
Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
672 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
673 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
674 T* GetOrAddByKey(ImGuiID key) {
int* p_idx =
Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
675 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
676 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; }
677 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]; }
678 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
679 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx;
Map.SetInt(key, -1); AliveCount--; }
680 void Reserve(
int capacity) { Buf.reserve(capacity);
Map.Data.reserve(capacity); }
684 int GetAliveCount()
const {
return AliveCount; }
685 int GetBufSize()
const {
return Buf.Size; }
686 int GetMapSize()
const {
return Map.Data.Size; }
687 T* TryGetMapData(ImPoolIdx n) {
int idx =
Map.Data[n].val_i;
if (idx == -1)
return NULL;
return GetByIndex(idx); }
688#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
689 int GetSize() {
return GetMapSize(); }
703 void clear() { Buf.clear(); }
704 bool empty()
const {
return Buf.Size == 0; }
705 int size()
const {
return Buf.Size; }
706 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); }
707 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
708 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; }
709 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
710 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
711 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; }
712 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
724 void clear() { LineOffsets.clear(); EndOffset = 0; }
725 int size() {
return LineOffsets.Size; }
726 const char* get_line_begin(
const char* base,
int n) {
return base + LineOffsets[n]; }
727 const char* get_line_end(
const char* base,
int n) {
return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
728 void append(
const char* base,
int old_size,
int new_size);
745#define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
746#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
747#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
748#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)
751#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))))
752#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD))
755#ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE
756#define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48
758#define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE
767 float CurveTessellationTol;
768 float CircleSegmentMaxError;
769 ImVec4 ClipRectFullscreen;
770 ImDrawListFlags InitialFlags;
776 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
777 float ArcFastRadiusCutoff;
778 ImU8 CircleSegmentCounts[64];
782 void SetCircleTessellationMaxError(
float max_error);
789 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
790 void ClearFreeMemory() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
791 int GetDrawListCount()
const {
int count = 0;
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) count += Layers[n].Size;
return count; }
792 IMGUI_API
void FlattenIntoSingleLayer();
807 ImGuiItemFlags_None = 0,
808 ImGuiItemFlags_NoTabStop = 1 << 0,
809 ImGuiItemFlags_ButtonRepeat = 1 << 1,
810 ImGuiItemFlags_Disabled = 1 << 2,
811 ImGuiItemFlags_NoNav = 1 << 3,
812 ImGuiItemFlags_NoNavDefaultFocus = 1 << 4,
813 ImGuiItemFlags_SelectableDontClosePopup = 1 << 5,
814 ImGuiItemFlags_MixedValue = 1 << 6,
815 ImGuiItemFlags_ReadOnly = 1 << 7,
816 ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8,
819 ImGuiItemFlags_Inputable = 1 << 10,
824enum ImGuiItemStatusFlags_
826 ImGuiItemStatusFlags_None = 0,
827 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
828 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
829 ImGuiItemStatusFlags_Edited = 1 << 2,
830 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
831 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
832 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
833 ImGuiItemStatusFlags_Deactivated = 1 << 6,
834 ImGuiItemStatusFlags_HoveredWindow = 1 << 7,
835 ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8,
836 ImGuiItemStatusFlags_Visible = 1 << 9,
838#ifdef IMGUI_ENABLE_TEST_ENGINE
839 ImGuiItemStatusFlags_Openable = 1 << 20,
840 ImGuiItemStatusFlags_Opened = 1 << 21,
841 ImGuiItemStatusFlags_Checkable = 1 << 22,
842 ImGuiItemStatusFlags_Checked = 1 << 23,
847enum ImGuiInputTextFlagsPrivate_
850 ImGuiInputTextFlags_Multiline = 1 << 26,
851 ImGuiInputTextFlags_NoMarkEdited = 1 << 27,
852 ImGuiInputTextFlags_MergedItem = 1 << 28,
856enum ImGuiButtonFlagsPrivate_
858 ImGuiButtonFlags_PressedOnClick = 1 << 4,
859 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
860 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
861 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
862 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
863 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
864 ImGuiButtonFlags_Repeat = 1 << 10,
865 ImGuiButtonFlags_FlattenChildren = 1 << 11,
866 ImGuiButtonFlags_AllowItemOverlap = 1 << 12,
867 ImGuiButtonFlags_DontClosePopups = 1 << 13,
869 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
870 ImGuiButtonFlags_NoKeyModifiers = 1 << 16,
871 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
872 ImGuiButtonFlags_NoNavFocus = 1 << 18,
873 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
874 ImGuiButtonFlags_NoSetKeyOwner = 1 << 20,
875 ImGuiButtonFlags_NoTestKeyOwner = 1 << 21,
876 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
877 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
881enum ImGuiComboFlagsPrivate_
883 ImGuiComboFlags_CustomPreview = 1 << 20,
887enum ImGuiSliderFlagsPrivate_
889 ImGuiSliderFlags_Vertical = 1 << 20,
890 ImGuiSliderFlags_ReadOnly = 1 << 21,
894enum ImGuiSelectableFlagsPrivate_
897 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
898 ImGuiSelectableFlags_SelectOnNav = 1 << 21,
899 ImGuiSelectableFlags_SelectOnClick = 1 << 22,
900 ImGuiSelectableFlags_SelectOnRelease = 1 << 23,
901 ImGuiSelectableFlags_SpanAvailWidth = 1 << 24,
902 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
903 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26,
904 ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27,
908enum ImGuiTreeNodeFlagsPrivate_
910 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20,
913enum ImGuiSeparatorFlags_
915 ImGuiSeparatorFlags_None = 0,
916 ImGuiSeparatorFlags_Horizontal = 1 << 0,
917 ImGuiSeparatorFlags_Vertical = 1 << 1,
918 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
923 ImGuiTextFlags_None = 0,
924 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
927enum ImGuiTooltipFlags_
929 ImGuiTooltipFlags_None = 0,
930 ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0,
937 ImGuiLayoutType_Horizontal = 0,
938 ImGuiLayoutType_Vertical = 1
943 ImGuiLogType_None = 0,
947 ImGuiLogType_Clipboard,
961 ImGuiPlotType_Histogram,
964enum ImGuiPopupPositionPolicy
966 ImGuiPopupPositionPolicy_Default,
967 ImGuiPopupPositionPolicy_ComboBox,
968 ImGuiPopupPositionPolicy_Tooltip,
981 const char* PrintFmt;
986enum ImGuiDataTypePrivate_
988 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
989 ImGuiDataType_Pointer,
1003 ImGuiStyleVar VarIdx;
1004 union {
int BackupInt[2];
float BackupFloat[2]; };
1005 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
1006 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
1007 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
1015 ImVec2 BackupCursorMaxPos;
1016 ImVec2 BackupCursorPosPrevLine;
1017 float BackupPrevLineTextBaseOffset;
1018 ImGuiLayoutType BackupLayout;
1028 ImVec2 BackupCursorMaxPos;
1030 ImVec1 BackupGroupOffset;
1031 ImVec2 BackupCurrLineSize;
1032 float BackupCurrLineTextBaseOffset;
1033 ImGuiID BackupActiveIdIsAlive;
1034 bool BackupActiveIdPreviousFrameIsAlive;
1035 bool BackupHoveredIdIsAlive;
1043 ImU32 NextTotalWidth;
1047 ImU16 OffsetShortcut;
1052 void Update(
float spacing,
bool window_reappearing);
1053 float DeclColumns(
float w_icon,
float w_label,
float w_shortcut,
float w_mark);
1054 void CalcNextTotalWidth(
bool update_offsets);
1063 int CurLenW, CurLenA;
1070 ImStb::STB_TexteditState Stb;
1073 bool SelectedAllMouseLock;
1075 ImGuiInputTextFlags Flags;
1078 void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
1079 void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
1080 int GetUndoAvailCount()
const {
return Stb.undostate.undo_point; }
1081 int GetRedoAvailCount()
const {
return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
1082 void OnKeyPressed(
int key);
1085 void CursorAnimReset() { CursorAnim = -0.30f; }
1086 void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
1087 bool HasSelection()
const {
return Stb.select_start != Stb.select_end; }
1088 void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
1089 int GetCursorPos()
const {
return Stb.cursor; }
1090 int GetSelectionStart()
const {
return Stb.select_start; }
1091 int GetSelectionEnd()
const {
return Stb.select_end; }
1092 void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
1103 ImGuiID OpenParentId;
1107 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); ParentNavLayer = OpenFrameCount = -1; }
1110enum ImGuiNextWindowDataFlags_
1112 ImGuiNextWindowDataFlags_None = 0,
1113 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1114 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1115 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1116 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1117 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1118 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1119 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1120 ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
1126 ImGuiNextWindowDataFlags Flags;
1129 ImGuiCond CollapsedCond;
1136 ImRect SizeConstraintRect;
1137 ImGuiSizeCallback SizeCallback;
1138 void* SizeCallbackUserData;
1140 ImVec2 MenuBarOffsetMinVal;
1143 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1146enum ImGuiNextItemDataFlags_
1148 ImGuiNextItemDataFlags_None = 0,
1149 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1150 ImGuiNextItemDataFlags_HasOpen = 1 << 1,
1155 ImGuiNextItemDataFlags Flags;
1157 ImGuiID FocusScopeId;
1162 inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; }
1169 ImGuiItemFlags InFlags;
1170 ImGuiItemStatusFlags StatusFlags;
1180 short SizeOfIDStack;
1181 short SizeOfColorStack;
1182 short SizeOfStyleVarStack;
1183 short SizeOfFontStack;
1184 short SizeOfFocusScopeStack;
1185 short SizeOfGroupStack;
1186 short SizeOfItemFlagsStack;
1187 short SizeOfBeginPopupStack;
1188 short SizeOfDisabledStack;
1191 void SetToCurrentState();
1192 void CompareWithCurrentState();
1226#define ImGuiKey_LegacyNativeKey_BEGIN 0
1227#define ImGuiKey_LegacyNativeKey_END 512
1228#define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
1229#define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
1230#define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
1231#define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
1232#define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
1233#define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
1234#define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
1235#define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
1238#define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
1239#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
1240#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
1241#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
1242#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
1243#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
1244#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
1245#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
1247enum ImGuiInputEventType
1249 ImGuiInputEventType_None = 0,
1250 ImGuiInputEventType_MousePos,
1251 ImGuiInputEventType_MouseWheel,
1252 ImGuiInputEventType_MouseButton,
1253 ImGuiInputEventType_Key,
1254 ImGuiInputEventType_Text,
1255 ImGuiInputEventType_Focus,
1256 ImGuiInputEventType_COUNT
1259enum ImGuiInputSource
1261 ImGuiInputSource_None = 0,
1262 ImGuiInputSource_Mouse,
1263 ImGuiInputSource_Keyboard,
1264 ImGuiInputSource_Gamepad,
1265 ImGuiInputSource_Clipboard,
1266 ImGuiInputSource_Nav,
1267 ImGuiInputSource_COUNT
1281 ImGuiInputEventType Type;
1282 ImGuiInputSource Source;
1292 bool AddedByTestEngine;
1298#define ImGuiKeyOwner_Any ((ImGuiID)0)
1299#define ImGuiKeyOwner_None ((ImGuiID)-1)
1301typedef ImS16 ImGuiKeyRoutingIndex;
1306 ImGuiKeyRoutingIndex NextEntryIndex;
1308 ImU8 RoutingNextScore;
1309 ImGuiID RoutingCurr;
1310 ImGuiID RoutingNext;
1312 ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_None; }
1319 ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT];
1324 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
1334 bool LockUntilRelease;
1336 ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease =
false; }
1341enum ImGuiInputFlags_
1344 ImGuiInputFlags_None = 0,
1345 ImGuiInputFlags_Repeat = 1 << 0,
1346 ImGuiInputFlags_RepeatRateDefault = 1 << 1,
1347 ImGuiInputFlags_RepeatRateNavMove = 1 << 2,
1348 ImGuiInputFlags_RepeatRateNavTweak = 1 << 3,
1349 ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
1352 ImGuiInputFlags_CondHovered = 1 << 4,
1353 ImGuiInputFlags_CondActive = 1 << 5,
1354 ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1355 ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
1358 ImGuiInputFlags_LockThisFrame = 1 << 6,
1359 ImGuiInputFlags_LockUntilRelease = 1 << 7,
1371 ImGuiInputFlags_RouteFocused = 1 << 8,
1372 ImGuiInputFlags_RouteGlobalLow = 1 << 9,
1373 ImGuiInputFlags_RouteGlobal = 1 << 10,
1374 ImGuiInputFlags_RouteGlobalHigh = 1 << 11,
1375 ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh,
1376 ImGuiInputFlags_RouteAlways = 1 << 12,
1377 ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13,
1378 ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused,
1381 ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_,
1382 ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_,
1383 ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
1384 ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
1395 bool PosToIndexConvert;
1396 ImS8 PosToIndexOffsetMin;
1397 ImS8 PosToIndexOffsetMax;
1407 float LossynessOffset;
1413 void Reset(
ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
1420enum ImGuiActivateFlags_
1422 ImGuiActivateFlags_None = 0,
1423 ImGuiActivateFlags_PreferInput = 1 << 0,
1424 ImGuiActivateFlags_PreferTweak = 1 << 1,
1425 ImGuiActivateFlags_TryToPreserveState = 1 << 2,
1429enum ImGuiScrollFlags_
1431 ImGuiScrollFlags_None = 0,
1432 ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0,
1433 ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1,
1434 ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2,
1435 ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3,
1436 ImGuiScrollFlags_AlwaysCenterX = 1 << 4,
1437 ImGuiScrollFlags_AlwaysCenterY = 1 << 5,
1438 ImGuiScrollFlags_NoScrollParent = 1 << 6,
1439 ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
1440 ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
1443enum ImGuiNavHighlightFlags_
1445 ImGuiNavHighlightFlags_None = 0,
1446 ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
1447 ImGuiNavHighlightFlags_TypeThin = 1 << 1,
1448 ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2,
1449 ImGuiNavHighlightFlags_NoRounding = 1 << 3,
1452enum ImGuiNavMoveFlags_
1454 ImGuiNavMoveFlags_None = 0,
1455 ImGuiNavMoveFlags_LoopX = 1 << 0,
1456 ImGuiNavMoveFlags_LoopY = 1 << 1,
1457 ImGuiNavMoveFlags_WrapX = 1 << 2,
1458 ImGuiNavMoveFlags_WrapY = 1 << 3,
1459 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
1460 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
1461 ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6,
1462 ImGuiNavMoveFlags_Forwarded = 1 << 7,
1463 ImGuiNavMoveFlags_DebugNoResult = 1 << 8,
1464 ImGuiNavMoveFlags_FocusApi = 1 << 9,
1465 ImGuiNavMoveFlags_Tabbing = 1 << 10,
1466 ImGuiNavMoveFlags_Activate = 1 << 11,
1467 ImGuiNavMoveFlags_DontSetNavHighlight = 1 << 12,
1472 ImGuiNavLayer_Main = 0,
1473 ImGuiNavLayer_Menu = 1,
1481 ImGuiID FocusScopeId;
1483 ImGuiItemFlags InFlags;
1489 void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; }
1497enum ImGuiOldColumnFlags_
1499 ImGuiOldColumnFlags_None = 0,
1500 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1501 ImGuiOldColumnFlags_NoResize = 1 << 1,
1502 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1503 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1504 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4,
1507#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1508 ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
1509 ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
1510 ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
1511 ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
1512 ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
1513 ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
1520 float OffsetNormBeforeResize;
1521 ImGuiOldColumnFlags Flags;
1530 ImGuiOldColumnFlags Flags;
1532 bool IsBeingResized;
1535 float OffMinX, OffMaxX;
1536 float LineMinY, LineMaxY;
1537 float HostCursorPosY;
1538 float HostCursorMaxPosX;
1539 ImRect HostInitialClipRect;
1540 ImRect HostBackupClipRect;
1541 ImRect HostBackupParentWorkRect;
1552#ifdef IMGUI_HAS_MULTI_SELECT
1560#ifdef IMGUI_HAS_DOCK
1572 int DrawListsLastFrame[2];
1579 ImVec2 BuildWorkOffsetMin;
1580 ImVec2 BuildWorkOffsetMax;
1582 ImGuiViewportP() { DrawListsLastFrame[0] = DrawListsLastFrame[1] = -1; DrawLists[0] = DrawLists[1] = NULL; }
1583 ~ImGuiViewportP() {
if (DrawLists[0]) IM_DELETE(DrawLists[0]);
if (DrawLists[1]) IM_DELETE(DrawLists[1]); }
1586 ImVec2 CalcWorkRectPos(
const ImVec2& off_min)
const {
return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); }
1587 ImVec2 CalcWorkRectSize(
const ImVec2& off_min,
const ImVec2& off_max)
const {
return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); }
1588 void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); }
1591 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1592 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
1593 ImRect GetBuildWorkRect()
const {
ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin);
ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax);
return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
1613 char* GetName() {
return (
char*)(
this + 1); }
1618 const char* TypeName;
1636enum ImGuiLocKey :
int
1638 ImGuiLocKey_TableSizeOne,
1639 ImGuiLocKey_TableSizeAllFit,
1640 ImGuiLocKey_TableSizeAllDefault,
1641 ImGuiLocKey_TableResetOrder,
1642 ImGuiLocKey_WindowingMainMenuBar,
1643 ImGuiLocKey_WindowingPopup,
1644 ImGuiLocKey_WindowingUntitled,
1659enum ImGuiDebugLogFlags_
1662 ImGuiDebugLogFlags_None = 0,
1663 ImGuiDebugLogFlags_EventActiveId = 1 << 0,
1664 ImGuiDebugLogFlags_EventFocus = 1 << 1,
1665 ImGuiDebugLogFlags_EventPopup = 1 << 2,
1666 ImGuiDebugLogFlags_EventNav = 1 << 3,
1667 ImGuiDebugLogFlags_EventClipper = 1 << 4,
1668 ImGuiDebugLogFlags_EventIO = 1 << 5,
1669 ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventIO,
1670 ImGuiDebugLogFlags_OutputToTTY = 1 << 10,
1675 bool ShowDebugLog =
false;
1676 bool ShowStackTool =
false;
1677 bool ShowWindowsRects =
false;
1678 bool ShowWindowsBeginOrder =
false;
1679 bool ShowTablesRects =
false;
1680 bool ShowDrawCmdMesh =
true;
1681 bool ShowDrawCmdBoundingBoxes =
true;
1682 bool ShowAtlasTintedWithTextColor =
false;
1683 int ShowWindowsRectsType = -1;
1684 int ShowTablesRectsType = -1;
1690 ImS8 QueryFrameCount;
1692 ImGuiDataType DataType : 8;
1701 int LastActiveFrame;
1705 bool CopyToClipboardOnCtrlC;
1706 float CopyToClipboardLastTime;
1708 ImGuiStackTool() { memset(
this, 0,
sizeof(*
this)); CopyToClipboardLastTime = -FLT_MAX; }
1716enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
1721 ImGuiContextHookType Type;
1723 ImGuiContextHookCallback Callback;
1736 bool FontAtlasOwnedByContext;
1747 int FrameCountEnded;
1748 int FrameCountRendered;
1749 bool WithinFrameScope;
1750 bool WithinFrameScopeWithImplicitWindow;
1751 bool WithinEndChild;
1753 bool TestEngineHookItems;
1762 int WindowsActiveCount;
1763 ImVec2 WindowsHoverPadding;
1769 ImVec2 WheelingWindowRefMousePos;
1770 int WheelingWindowStartFrame;
1771 float WheelingWindowReleaseTimer;
1772 ImVec2 WheelingWindowWheelRemainder;
1776 ImGuiID DebugHookIdInfo;
1778 ImGuiID HoveredIdPreviousFrame;
1779 bool HoveredIdAllowOverlap;
1780 bool HoveredIdDisabled;
1781 float HoveredIdTimer;
1782 float HoveredIdNotActiveTimer;
1784 ImGuiID ActiveIdIsAlive;
1785 float ActiveIdTimer;
1786 bool ActiveIdIsJustActivated;
1787 bool ActiveIdAllowOverlap;
1788 bool ActiveIdNoClearOnFocusLoss;
1789 bool ActiveIdHasBeenPressedBefore;
1790 bool ActiveIdHasBeenEditedBefore;
1791 bool ActiveIdHasBeenEditedThisFrame;
1792 ImVec2 ActiveIdClickOffset;
1794 ImGuiInputSource ActiveIdSource;
1795 int ActiveIdMouseButton;
1796 ImGuiID ActiveIdPreviousFrame;
1797 bool ActiveIdPreviousFrameIsAlive;
1798 bool ActiveIdPreviousFrameHasBeenEditedBefore;
1800 ImGuiID LastActiveId;
1801 float LastActiveIdTimer;
1809 ImU32 ActiveIdUsingNavDirMask;
1810 bool ActiveIdUsingAllKeyboardKeys;
1811#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1812 ImU32 ActiveIdUsingNavInputMask;
1816 ImGuiID CurrentFocusScopeId;
1817 ImGuiItemFlags CurrentItemFlags;
1818 ImGuiID DebugLocateId;
1840 ImGuiID NavFocusScopeId;
1841 ImGuiID NavActivateId;
1842 ImGuiID NavActivateDownId;
1843 ImGuiID NavActivatePressedId;
1844 ImGuiID NavActivateInputId;
1845 ImGuiActivateFlags NavActivateFlags;
1846 ImGuiID NavJustMovedToId;
1847 ImGuiID NavJustMovedToFocusScopeId;
1848 ImGuiKeyChord NavJustMovedToKeyMods;
1849 ImGuiID NavNextActivateId;
1850 ImGuiActivateFlags NavNextActivateFlags;
1851 ImGuiInputSource NavInputSource;
1852 ImGuiNavLayer NavLayer;
1854 bool NavMousePosDirty;
1855 bool NavDisableHighlight;
1856 bool NavDisableMouseHover;
1860 bool NavInitRequest;
1861 bool NavInitRequestFromMove;
1862 ImGuiID NavInitResultId;
1863 ImRect NavInitResultRectRel;
1864 bool NavMoveSubmitted;
1865 bool NavMoveScoringItems;
1866 bool NavMoveForwardToNextFrame;
1867 ImGuiNavMoveFlags NavMoveFlags;
1868 ImGuiScrollFlags NavMoveScrollFlags;
1869 ImGuiKeyChord NavMoveKeyMods;
1870 ImGuiDir NavMoveDir;
1871 ImGuiDir NavMoveDirForDebug;
1872 ImGuiDir NavMoveClipDir;
1874 ImRect NavScoringNoClipRect;
1875 int NavScoringDebugCount;
1877 int NavTabbingCounter;
1884 ImGuiKeyChord ConfigNavWindowingKeyNext;
1885 ImGuiKeyChord ConfigNavWindowingKeyPrev;
1889 float NavWindowingTimer;
1890 float NavWindowingHighlightAlpha;
1891 bool NavWindowingToggleLayer;
1892 ImVec2 NavWindowingAccumDeltaPos;
1893 ImVec2 NavWindowingAccumDeltaSize;
1897 ImGuiMouseCursor MouseCursor;
1900 bool DragDropActive;
1901 bool DragDropWithinSource;
1902 bool DragDropWithinTarget;
1903 ImGuiDragDropFlags DragDropSourceFlags;
1904 int DragDropSourceFrameCount;
1905 int DragDropMouseButton;
1907 ImRect DragDropTargetRect;
1908 ImGuiID DragDropTargetId;
1909 ImGuiDragDropFlags DragDropAcceptFlags;
1910 float DragDropAcceptIdCurrRectSurface;
1911 ImGuiID DragDropAcceptIdCurr;
1912 ImGuiID DragDropAcceptIdPrev;
1913 int DragDropAcceptFrameCount;
1914 ImGuiID DragDropHoldJustPressedId;
1916 unsigned char DragDropPayloadBufLocal[16];
1919 int ClipperTempDataStacked;
1924 int TablesTempDataStacked;
1937 ImGuiID HoverDelayId;
1938 ImGuiID HoverDelayIdPreviousFrame;
1939 float HoverDelayTimer;
1940 float HoverDelayClearTimer;
1943 ImVec2 MouseLastValidPos;
1945 ImFont InputTextPasswordFont;
1946 ImGuiID TempInputId;
1947 ImGuiColorEditFlags ColorEditOptions;
1948 ImGuiID ColorEditCurrentID;
1949 ImGuiID ColorEditSavedID;
1950 float ColorEditSavedHue;
1951 float ColorEditSavedSat;
1952 ImU32 ColorEditSavedColor;
1955 float SliderGrabClickOffset;
1956 float SliderCurrentAccum;
1957 bool SliderCurrentAccumDirty;
1958 bool DragCurrentAccumDirty;
1959 float DragCurrentAccum;
1960 float DragSpeedDefaultRatio;
1961 float ScrollbarClickDeltaToGrabCenter;
1962 float DisabledAlphaBackup;
1963 short DisabledStackSize;
1964 short TooltipOverrideCount;
1971 char PlatformLocaleDecimalPoint;
1974 bool SettingsLoaded;
1975 float SettingsDirtyTimer;
1984 const char* LocalizationTable[ImGuiLocKey_COUNT];
1988 ImGuiLogType LogType;
1989 ImFileHandle LogFile;
1991 const char* LogNextPrefix;
1992 const char* LogNextSuffix;
1994 bool LogLineFirstItem;
1996 int LogDepthToExpand;
1997 int LogDepthToExpandDefault;
2000 ImGuiDebugLogFlags DebugLogFlags;
2003 ImU8 DebugLocateFrames;
2004 bool DebugItemPickerActive;
2005 ImU8 DebugItemPickerMouseButton;
2006 ImGuiID DebugItemPickerBreakId;
2011 float FramerateSecPerFrame[60];
2012 int FramerateSecPerFrameIdx;
2013 int FramerateSecPerFrameCount;
2014 float FramerateSecPerFrameAccum;
2015 int WantCaptureMouseNextFrame;
2016 int WantCaptureKeyboardNextFrame;
2017 int WantTextInputNextFrame;
2021 : InputTextState(
this)
2023 Initialized =
false;
2024 FontAtlasOwnedByContext = shared_font_atlas ? false :
true;
2026 FontSize = FontBaseSize = 0.0f;
2027 IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(
ImFontAtlas)();
2030 FrameCountEnded = FrameCountRendered = -1;
2031 WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild =
false;
2032 GcCompactAll =
false;
2033 TestEngineHookItems =
false;
2036 WindowsActiveCount = 0;
2037 CurrentWindow = NULL;
2038 HoveredWindow = NULL;
2039 HoveredWindowUnderMovingWindow = NULL;
2040 MovingWindow = NULL;
2041 WheelingWindow = NULL;
2042 WheelingWindowStartFrame = -1;
2043 WheelingWindowReleaseTimer = 0.0f;
2045 DebugHookIdInfo = 0;
2046 HoveredId = HoveredIdPreviousFrame = 0;
2047 HoveredIdAllowOverlap =
false;
2048 HoveredIdDisabled =
false;
2049 HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
2051 ActiveIdIsAlive = 0;
2052 ActiveIdTimer = 0.0f;
2053 ActiveIdIsJustActivated =
false;
2054 ActiveIdAllowOverlap =
false;
2055 ActiveIdNoClearOnFocusLoss =
false;
2056 ActiveIdHasBeenPressedBefore =
false;
2057 ActiveIdHasBeenEditedBefore =
false;
2058 ActiveIdHasBeenEditedThisFrame =
false;
2059 ActiveIdClickOffset =
ImVec2(-1, -1);
2060 ActiveIdWindow = NULL;
2061 ActiveIdSource = ImGuiInputSource_None;
2062 ActiveIdMouseButton = -1;
2063 ActiveIdPreviousFrame = 0;
2064 ActiveIdPreviousFrameIsAlive =
false;
2065 ActiveIdPreviousFrameHasBeenEditedBefore =
false;
2066 ActiveIdPreviousFrameWindow = NULL;
2068 LastActiveIdTimer = 0.0f;
2070 ActiveIdUsingNavDirMask = 0x00;
2071 ActiveIdUsingAllKeyboardKeys =
false;
2072#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
2073 ActiveIdUsingNavInputMask = 0x00;
2076 CurrentFocusScopeId = 0;
2077 CurrentItemFlags = ImGuiItemFlags_None;
2081 NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;
2082 NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
2083 NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
2084 NavJustMovedToKeyMods = ImGuiMod_None;
2085 NavInputSource = ImGuiInputSource_None;
2086 NavLayer = ImGuiNavLayer_Main;
2087 NavIdIsAlive =
false;
2088 NavMousePosDirty =
false;
2089 NavDisableHighlight =
true;
2090 NavDisableMouseHover =
false;
2091 NavAnyRequest =
false;
2092 NavInitRequest =
false;
2093 NavInitRequestFromMove =
false;
2094 NavInitResultId = 0;
2095 NavMoveSubmitted =
false;
2096 NavMoveScoringItems =
false;
2097 NavMoveForwardToNextFrame =
false;
2098 NavMoveFlags = ImGuiNavMoveFlags_None;
2099 NavMoveScrollFlags = ImGuiScrollFlags_None;
2100 NavMoveKeyMods = ImGuiMod_None;
2101 NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
2102 NavScoringDebugCount = 0;
2104 NavTabbingCounter = 0;
2106 ConfigNavWindowingKeyNext = ImGuiMod_Ctrl | ImGuiKey_Tab;
2107 ConfigNavWindowingKeyPrev = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab;
2108 NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
2109 NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
2110 NavWindowingToggleLayer =
false;
2113 MouseCursor = ImGuiMouseCursor_Arrow;
2115 DragDropActive = DragDropWithinSource = DragDropWithinTarget =
false;
2116 DragDropSourceFlags = ImGuiDragDropFlags_None;
2117 DragDropSourceFrameCount = -1;
2118 DragDropMouseButton = -1;
2119 DragDropTargetId = 0;
2120 DragDropAcceptFlags = ImGuiDragDropFlags_None;
2121 DragDropAcceptIdCurrRectSurface = 0.0f;
2122 DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
2123 DragDropAcceptFrameCount = -1;
2124 DragDropHoldJustPressedId = 0;
2125 memset(DragDropPayloadBufLocal, 0,
sizeof(DragDropPayloadBufLocal));
2127 ClipperTempDataStacked = 0;
2129 CurrentTable = NULL;
2130 TablesTempDataStacked = 0;
2131 CurrentTabBar = NULL;
2133 HoverDelayId = HoverDelayIdPreviousFrame = 0;
2134 HoverDelayTimer = HoverDelayClearTimer = 0.0f;
2137 ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
2138 ColorEditCurrentID = ColorEditSavedID = 0;
2139 ColorEditSavedHue = ColorEditSavedSat = 0.0f;
2140 ColorEditSavedColor = 0;
2141 SliderGrabClickOffset = 0.0f;
2142 SliderCurrentAccum = 0.0f;
2143 SliderCurrentAccumDirty =
false;
2144 DragCurrentAccumDirty =
false;
2145 DragCurrentAccum = 0.0f;
2146 DragSpeedDefaultRatio = 1.0f / 100.0f;
2147 ScrollbarClickDeltaToGrabCenter = 0.0f;
2148 DisabledAlphaBackup = 0.0f;
2149 DisabledStackSize = 0;
2150 TooltipOverrideCount = 0;
2152 PlatformImeData.InputPos =
ImVec2(0.0f, 0.0f);
2153 PlatformImeDataPrev.InputPos =
ImVec2(-1.0f, -1.0f);
2154 PlatformLocaleDecimalPoint =
'.';
2156 SettingsLoaded =
false;
2157 SettingsDirtyTimer = 0.0f;
2160 memset(LocalizationTable, 0,
sizeof(LocalizationTable));
2163 LogType = ImGuiLogType_None;
2164 LogNextPrefix = LogNextSuffix = NULL;
2166 LogLinePosY = FLT_MAX;
2167 LogLineFirstItem =
false;
2169 LogDepthToExpand = LogDepthToExpandDefault = 2;
2171 DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
2173 DebugLocateFrames = 0;
2174 DebugItemPickerActive =
false;
2175 DebugItemPickerMouseButton = ImGuiMouseButton_Left;
2176 DebugItemPickerBreakId = 0;
2178 memset(FramerateSecPerFrame, 0,
sizeof(FramerateSecPerFrame));
2179 FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
2180 FramerateSecPerFrameAccum = 0.0f;
2181 WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
2196 ImVec2 CursorPosPrevLine;
2202 float CurrLineTextBaseOffset;
2203 float PrevLineTextBaseOffset;
2209 ImVec2 CursorStartPosLossyness;
2212 ImGuiNavLayer NavLayerCurrent;
2213 short NavLayersActiveMask;
2214 short NavLayersActiveMaskNext;
2215 bool NavHideHighlightOneFrame;
2219 bool MenuBarAppending;
2223 ImU32 TreeJumpToParentOnPopMask;
2227 int CurrentTableIdx;
2228 ImGuiLayoutType LayoutType;
2229 ImGuiLayoutType ParentLayoutType;
2244 ImGuiWindowFlags Flags;
2251 ImVec2 ContentSizeExplicit;
2253 float WindowRounding;
2254 float WindowBorderSize;
2255 float DecoOuterSizeX1, DecoOuterSizeY1;
2256 float DecoOuterSizeX2, DecoOuterSizeY2;
2257 float DecoInnerSizeX1, DecoInnerSizeY1;
2264 ImVec2 ScrollTargetCenterRatio;
2265 ImVec2 ScrollTargetEdgeSnapDist;
2267 bool ScrollbarX, ScrollbarY;
2272 bool WantCollapseToggle;
2276 bool IsFallbackWindow;
2277 bool IsExplicitChild;
2278 bool HasCloseButton;
2279 signed char ResizeBorderHeld;
2281 short BeginCountPreviousFrame;
2282 short BeginOrderWithinParent;
2283 short BeginOrderWithinContext;
2286 ImS8 AutoFitFramesX, AutoFitFramesY;
2287 ImS8 AutoFitChildAxises;
2288 bool AutoFitOnlyGrows;
2289 ImGuiDir AutoPosLastDirection;
2290 ImS8 HiddenFramesCanSkipItems;
2291 ImS8 HiddenFramesCannotSkipItems;
2292 ImS8 HiddenFramesForRenderOnly;
2293 ImS8 DisableInputsFrames;
2294 ImGuiCond SetWindowPosAllowFlags : 8;
2295 ImGuiCond SetWindowSizeAllowFlags : 8;
2296 ImGuiCond SetWindowCollapsedAllowFlags : 8;
2298 ImVec2 SetWindowPosPivot;
2311 ImRect ContentRegionRect;
2315 int LastFrameActive;
2316 float LastTimeActive;
2317 float ItemWidthDefault;
2320 float FontWindowScale;
2333 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
2334 ImRect NavRectRel[ImGuiNavLayer_COUNT];
2335 ImGuiID NavRootFocusScopeId;
2337 int MemoryDrawListIdxCapacity;
2338 int MemoryDrawListVtxCapacity;
2339 bool MemoryCompacted;
2345 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
2346 ImGuiID GetID(
const void* ptr);
2347 ImGuiID GetID(
int n);
2348 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
2351 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
2352 float CalcFontSize()
const {
ImGuiContext& g = *GImGui;
float scale = g.FontBaseSize * FontWindowScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
2353 float TitleBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
2354 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
2355 float MenuBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
2356 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight();
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
2364enum ImGuiTabBarFlagsPrivate_
2366 ImGuiTabBarFlags_DockNode = 1 << 20,
2367 ImGuiTabBarFlags_IsFocused = 1 << 21,
2368 ImGuiTabBarFlags_SaveSettings = 1 << 22,
2372enum ImGuiTabItemFlagsPrivate_
2374 ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
2375 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
2376 ImGuiTabItemFlags_Button = 1 << 21,
2383 ImGuiTabItemFlags Flags;
2384 int LastFrameVisible;
2385 int LastFrameSelected;
2389 float RequestedWidth;
2392 ImS16 IndexDuringLayout;
2395 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
2402 ImGuiTabBarFlags Flags;
2404 ImGuiID SelectedTabId;
2405 ImGuiID NextSelectedTabId;
2406 ImGuiID VisibleTabId;
2407 int CurrFrameVisible;
2408 int PrevFrameVisible;
2410 float CurrTabsContentsHeight;
2411 float PrevTabsContentsHeight;
2413 float WidthAllTabsIdeal;
2414 float ScrollingAnim;
2415 float ScrollingTarget;
2416 float ScrollingTargetDistToVisibility;
2417 float ScrollingSpeed;
2418 float ScrollingRectMinX;
2419 float ScrollingRectMaxX;
2420 ImGuiID ReorderRequestTabId;
2421 ImS16 ReorderRequestOffset;
2424 bool VisibleTabWasSubmitted;
2426 ImS16 TabsActiveCount;
2427 ImS16 LastTabItemIdx;
2440#define IM_COL32_DISABLE IM_COL32(0,0,0,1)
2441#define IMGUI_TABLE_MAX_COLUMNS 512
2444typedef ImS16 ImGuiTableColumnIdx;
2445typedef ImU16 ImGuiTableDrawChannelIdx;
2453 ImGuiTableColumnFlags Flags;
2459 float StretchWeight;
2460 float InitStretchWeightOrWidth;
2466 float ContentMaxXFrozen;
2467 float ContentMaxXUnfrozen;
2468 float ContentMaxXHeadersUsed;
2469 float ContentMaxXHeadersIdeal;
2471 ImGuiTableColumnIdx DisplayOrder;
2472 ImGuiTableColumnIdx IndexWithinEnabledSet;
2473 ImGuiTableColumnIdx PrevEnabledColumn;
2474 ImGuiTableColumnIdx NextEnabledColumn;
2475 ImGuiTableColumnIdx SortOrder;
2476 ImGuiTableDrawChannelIdx DrawChannelCurrent;
2477 ImGuiTableDrawChannelIdx DrawChannelFrozen;
2478 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
2481 bool IsUserEnabledNextFrame;
2484 bool IsRequestOutput;
2486 bool IsPreserveWidthAuto;
2487 ImS8 NavLayerCurrent;
2489 ImU8 CannotSkipItemsQueue;
2490 ImU8 SortDirection : 2;
2491 ImU8 SortDirectionsAvailCount : 2;
2492 ImU8 SortDirectionsAvailMask : 4;
2493 ImU8 SortDirectionsAvailList;
2497 memset(
this, 0,
sizeof(*
this));
2498 StretchWeight = WidthRequest = -1.0f;
2500 DisplayOrder = IndexWithinEnabledSet = -1;
2501 PrevEnabledColumn = NextEnabledColumn = -1;
2503 SortDirection = ImGuiSortDirection_None;
2504 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2513 ImGuiTableColumnIdx Column;
2519 ImGuiID TableInstanceID;
2520 float LastOuterHeight;
2521 float LastFirstRowHeight;
2522 float LastFrozenHeight;
2524 ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; }
2531 ImGuiTableFlags Flags;
2537 ImBitArrayPtr EnabledMaskByDisplayOrder;
2538 ImBitArrayPtr EnabledMaskByIndex;
2539 ImBitArrayPtr VisibleMaskByIndex;
2540 ImGuiTableFlags SettingsLoadedFlags;
2542 int LastFrameActive;
2546 ImS16 InstanceCurrent;
2547 ImS16 InstanceInteracted;
2551 float RowTextBaseline;
2552 float RowIndentOffsetX;
2553 ImGuiTableRowFlags RowFlags : 16;
2554 ImGuiTableRowFlags LastRowFlags : 16;
2555 int RowBgColorCounter;
2556 ImU32 RowBgColor[2];
2557 ImU32 BorderColorStrong;
2558 ImU32 BorderColorLight;
2562 float MinColumnWidth;
2563 float OuterPaddingX;
2566 float CellSpacingX1;
2567 float CellSpacingX2;
2569 float ColumnsGivenWidth;
2570 float ColumnsAutoFitWidth;
2571 float ColumnsStretchSumWeights;
2572 float ResizedColumnNextWidth;
2573 float ResizeLockMinContentsX2;
2580 ImRect Bg0ClipRectForDrawCmd;
2581 ImRect Bg2ClipRectForDrawCmd;
2583 ImRect HostBackupInnerClipRect;
2593 ImGuiTableColumnIdx SortSpecsCount;
2594 ImGuiTableColumnIdx ColumnsEnabledCount;
2595 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
2596 ImGuiTableColumnIdx DeclColumnsCount;
2597 ImGuiTableColumnIdx HoveredColumnBody;
2598 ImGuiTableColumnIdx HoveredColumnBorder;
2599 ImGuiTableColumnIdx AutoFitSingleColumn;
2600 ImGuiTableColumnIdx ResizedColumn;
2601 ImGuiTableColumnIdx LastResizedColumn;
2602 ImGuiTableColumnIdx HeldHeaderColumn;
2603 ImGuiTableColumnIdx ReorderColumn;
2604 ImGuiTableColumnIdx ReorderColumnDir;
2605 ImGuiTableColumnIdx LeftMostEnabledColumn;
2606 ImGuiTableColumnIdx RightMostEnabledColumn;
2607 ImGuiTableColumnIdx LeftMostStretchedColumn;
2608 ImGuiTableColumnIdx RightMostStretchedColumn;
2609 ImGuiTableColumnIdx ContextPopupColumn;
2610 ImGuiTableColumnIdx FreezeRowsRequest;
2611 ImGuiTableColumnIdx FreezeRowsCount;
2612 ImGuiTableColumnIdx FreezeColumnsRequest;
2613 ImGuiTableColumnIdx FreezeColumnsCount;
2614 ImGuiTableColumnIdx RowCellDataCurrent;
2615 ImGuiTableDrawChannelIdx DummyDrawChannel;
2616 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
2617 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
2618 bool IsLayoutLocked;
2620 bool IsInitializing;
2621 bool IsSortSpecsDirty;
2622 bool IsUsingHeaders;
2623 bool IsContextPopupOpen;
2624 bool IsSettingsRequestLoad;
2625 bool IsSettingsDirty;
2626 bool IsDefaultDisplayOrder;
2627 bool IsResetAllRequest;
2628 bool IsResetDisplayOrderRequest;
2629 bool IsUnfrozenRows;
2630 bool IsDefaultSizingPolicy;
2631 bool HasScrollbarYCurr;
2632 bool HasScrollbarYPrev;
2633 bool MemoryCompacted;
2636 ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
2646 float LastTimeActive;
2651 ImRect HostBackupWorkRect;
2652 ImRect HostBackupParentWorkRect;
2653 ImVec2 HostBackupPrevLineSize;
2654 ImVec2 HostBackupCurrLineSize;
2655 ImVec2 HostBackupCursorMaxPos;
2656 ImVec1 HostBackupColumnsOffset;
2657 float HostBackupItemWidth;
2658 int HostBackupItemWidthStackSize;
2666 float WidthOrWeight;
2668 ImGuiTableColumnIdx Index;
2669 ImGuiTableColumnIdx DisplayOrder;
2670 ImGuiTableColumnIdx SortOrder;
2671 ImU8 SortDirection : 2;
2677 WidthOrWeight = 0.0f;
2680 DisplayOrder = SortOrder = -1;
2681 SortDirection = ImGuiSortDirection_None;
2691 ImGuiTableFlags SaveFlags;
2693 ImGuiTableColumnIdx ColumnsCount;
2694 ImGuiTableColumnIdx ColumnsCountMax;
2714 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
2715 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
2716 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
2717 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
2719 IMGUI_API
bool IsWindowChildOf(
ImGuiWindow* window,
ImGuiWindow* potential_parent,
bool popup_hierarchy);
2722 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
2723 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
2724 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
2725 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
2727 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); }
2728 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); }
2733 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
2734 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
2735 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
2737 IMGUI_API
int FindWindowDisplayIndex(
ImGuiWindow* window);
2741 IMGUI_API
void SetCurrentFont(
ImFont* font);
2742 inline ImFont* GetDefaultFont() {
ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
2743 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) { IM_UNUSED(window);
return GetForegroundDrawList(); }
2748 IMGUI_API
void Initialize();
2749 IMGUI_API
void Shutdown();
2752 IMGUI_API
void UpdateInputEvents(
bool trickle_fast_inputs);
2753 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
2754 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
2755 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
2756 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
2760 IMGUI_API
void RemoveContextHook(
ImGuiContext* context, ImGuiID hook_to_remove);
2761 IMGUI_API
void CallContextHooks(
ImGuiContext* context, ImGuiContextHookType type);
2767 IMGUI_API
void MarkIniSettingsDirty();
2768 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
2769 IMGUI_API
void ClearIniSettings();
2771 IMGUI_API
void RemoveSettingsHandler(
const char* type_name);
2778 IMGUI_API
void ClearWindowSettings(
const char* name);
2781 IMGUI_API
void LocalizeRegisterEntries(
const ImGuiLocEntry* entries,
int count);
2782 inline const char* LocalizeGetMsg(ImGuiLocKey key) {
ImGuiContext& g = *GImGui;
const char* msg = g.LocalizationTable[key];
return msg ? msg :
"*Missing Text*"; }
2785 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
2786 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
2787 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
2788 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
2791 IMGUI_API
void ScrollToItem(ImGuiScrollFlags flags = 0);
2792 IMGUI_API
void ScrollToRect(
ImGuiWindow* window,
const ImRect& rect, ImGuiScrollFlags flags = 0);
2795 inline void ScrollToBringRectIntoView(
ImGuiWindow* window,
const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
2799 inline ImGuiItemStatusFlags GetItemStatusFlags(){
ImGuiContext& g = *GImGui;
return g.LastItemData.StatusFlags; }
2800 inline ImGuiItemFlags GetItemFlags() {
ImGuiContext& g = *GImGui;
return g.LastItemData.InFlags; }
2801 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
2802 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
2803 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
2804 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
2805 IMGUI_API
void ClearActiveID();
2806 IMGUI_API ImGuiID GetHoveredID();
2807 IMGUI_API
void SetHoveredID(ImGuiID
id);
2808 IMGUI_API
void KeepAliveID(ImGuiID
id);
2809 IMGUI_API
void MarkItemEdited(ImGuiID
id);
2810 IMGUI_API
void PushOverrideID(ImGuiID
id);
2811 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
2812 IMGUI_API ImGuiID GetIDWithSeed(
int n, ImGuiID seed);
2815 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
2816 inline void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); }
2817 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
2818 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id);
2819 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id);
2820 IMGUI_API
void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
2821 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
2822 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
2823 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
2824 IMGUI_API
bool IsItemToggledSelection();
2825 IMGUI_API
ImVec2 GetContentRegionMaxAbs();
2829 IMGUI_API
void PushItemFlag(ImGuiItemFlags option,
bool enabled);
2830 IMGUI_API
void PopItemFlag();
2833 IMGUI_API
void LogBegin(ImGuiLogType type,
int auto_open_depth);
2834 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
2835 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
2836 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
2839 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg,
bool border, ImGuiWindowFlags flags);
2840 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
2841 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
2842 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
2843 IMGUI_API
void ClosePopupsExceptModals();
2844 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
2845 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_flags);
2846 IMGUI_API
void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
2849 IMGUI_API
ImGuiWindow* GetTopMostAndVisiblePopupModal();
2851 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
2854 IMGUI_API
bool BeginViewportSideBar(
const char* name,
ImGuiViewport* viewport, ImGuiDir dir,
float size, ImGuiWindowFlags window_flags);
2855 IMGUI_API
bool BeginMenuEx(
const char* label,
const char* icon,
bool enabled =
true);
2856 IMGUI_API
bool MenuItemEx(
const char* label,
const char* icon,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
2859 IMGUI_API
bool BeginComboPopup(ImGuiID popup_id,
const ImRect& bb, ImGuiComboFlags flags);
2860 IMGUI_API
bool BeginComboPreview();
2861 IMGUI_API
void EndComboPreview();
2864 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
2865 IMGUI_API
void NavInitRequestApplyResult();
2866 IMGUI_API
bool NavMoveRequestButNoResultYet();
2867 IMGUI_API
void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
2868 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
2869 IMGUI_API
void NavMoveRequestResolveWithLastItem(
ImGuiNavItemData* result);
2870 IMGUI_API
void NavMoveRequestCancel();
2871 IMGUI_API
void NavMoveRequestApplyResult();
2872 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
2873 IMGUI_API
void ActivateItem(ImGuiID
id);
2875 IMGUI_API
void SetNavID(ImGuiID
id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
2879 inline bool IsNamedKey(ImGuiKey key) {
return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
2880 inline bool IsNamedKeyOrModKey(ImGuiKey key) {
return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super || key == ImGuiMod_Shortcut; }
2881 inline bool IsLegacyKey(ImGuiKey key) {
return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
2882 inline bool IsKeyboardKey(ImGuiKey key) {
return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
2883 inline bool IsGamepadKey(ImGuiKey key) {
return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
2884 inline bool IsMouseKey(ImGuiKey key) {
return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
2885 inline bool IsAliasKey(ImGuiKey key) {
return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
2886 inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) {
ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut);
return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); }
2887 inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
2890 if (key == ImGuiMod_Ctrl)
return ImGuiKey_ReservedForModCtrl;
2891 if (key == ImGuiMod_Shift)
return ImGuiKey_ReservedForModShift;
2892 if (key == ImGuiMod_Alt)
return ImGuiKey_ReservedForModAlt;
2893 if (key == ImGuiMod_Super)
return ImGuiKey_ReservedForModSuper;
2894 if (key == ImGuiMod_Shortcut)
return (g.IO.ConfigMacOSXBehaviors ? ImGuiKey_ReservedForModSuper : ImGuiKey_ReservedForModCtrl);
2899 IMGUI_API
void GetKeyChordName(ImGuiKeyChord key_chord,
char* out_buf,
int out_buf_size);
2900 inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
2901 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
2902 IMGUI_API
ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
2903 IMGUI_API
float GetNavTweakPressedAmount(ImGuiAxis axis);
2904 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
2905 IMGUI_API
void GetTypematicRepeatRate(ImGuiInputFlags flags,
float* repeat_delay,
float* repeat_rate);
2906 IMGUI_API
void SetActiveIdUsingAllKeyboardKeys();
2907 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
2920 IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
2921 IMGUI_API
void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2922 IMGUI_API
void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0);
2923 IMGUI_API
bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);
2924 inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiKey key) {
if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key));
return &GImGui->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
2932 IMGUI_API
bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
2933 IMGUI_API
bool IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2934 IMGUI_API
bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
2935 IMGUI_API
bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
2936 IMGUI_API
bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
2937 IMGUI_API
bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
2949 IMGUI_API
bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
2950 IMGUI_API
bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
2951 IMGUI_API
bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
2962 IMGUI_API
void PushFocusScope(ImGuiID
id);
2963 IMGUI_API
void PopFocusScope();
2964 inline ImGuiID GetCurrentFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentFocusScopeId; }
2967 IMGUI_API
bool IsDragDropActive();
2968 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
2969 IMGUI_API
void ClearDragDrop();
2970 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
2971 IMGUI_API
void RenderDragDropTargetRect(
const ImRect& bb);
2974 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
2975 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
2976 IMGUI_API
void EndColumns();
2977 IMGUI_API
void PushColumnClipRect(
int column_index);
2978 IMGUI_API
void PushColumnsBackground();
2979 IMGUI_API
void PopColumnsBackground();
2980 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
2982 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
2983 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
2986 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
2987 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
2988 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
2989 IMGUI_API
int TableGetHoveredColumn();
2990 IMGUI_API
float TableGetHeaderRowHeight();
2991 IMGUI_API
void TablePushBackgroundChannel();
2992 IMGUI_API
void TablePopBackgroundChannel();
2996 IMGUI_API
ImGuiTable* TableFindByID(ImGuiID
id);
2997 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);
2998 IMGUI_API
void TableBeginInitMemory(
ImGuiTable* table,
int columns_count);
2999 IMGUI_API
void TableBeginApplyRequests(
ImGuiTable* table);
3000 IMGUI_API
void TableSetupDrawChannels(
ImGuiTable* table);
3001 IMGUI_API
void TableUpdateLayout(
ImGuiTable* table);
3002 IMGUI_API
void TableUpdateBorders(
ImGuiTable* table);
3003 IMGUI_API
void TableUpdateColumnsWeightFromWidth(
ImGuiTable* table);
3004 IMGUI_API
void TableDrawBorders(
ImGuiTable* table);
3005 IMGUI_API
void TableDrawContextMenu(
ImGuiTable* table);
3006 IMGUI_API
bool TableBeginContextMenuPopup(
ImGuiTable* table);
3007 IMGUI_API
void TableMergeDrawChannels(
ImGuiTable* table);
3008 inline ImGuiTableInstanceData* TableGetInstanceData(
ImGuiTable* table,
int instance_no) {
if (instance_no == 0)
return &table->InstanceDataFirst;
return &table->InstanceDataExtra[instance_no - 1]; }
3009 inline ImGuiID TableGetInstanceID(
ImGuiTable* table,
int instance_no) {
return TableGetInstanceData(table, instance_no)->TableInstanceID; }
3010 IMGUI_API
void TableSortSpecsSanitize(
ImGuiTable* table);
3011 IMGUI_API
void TableSortSpecsBuild(
ImGuiTable* table);
3012 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(
ImGuiTableColumn* column);
3015 IMGUI_API
void TableBeginRow(
ImGuiTable* table);
3016 IMGUI_API
void TableEndRow(
ImGuiTable* table);
3017 IMGUI_API
void TableBeginCell(
ImGuiTable* table,
int column_n);
3018 IMGUI_API
void TableEndCell(
ImGuiTable* table);
3019 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
3020 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
3021 IMGUI_API ImGuiID TableGetColumnResizeID(
ImGuiTable* table,
int column_n,
int instance_no = 0);
3022 IMGUI_API
float TableGetMaxColumnWidth(
const ImGuiTable* table,
int column_n);
3023 IMGUI_API
void TableSetColumnWidthAutoSingle(
ImGuiTable* table,
int column_n);
3024 IMGUI_API
void TableSetColumnWidthAutoAll(
ImGuiTable* table);
3025 IMGUI_API
void TableRemove(
ImGuiTable* table);
3026 IMGUI_API
void TableGcCompactTransientBuffers(
ImGuiTable* table);
3028 IMGUI_API
void TableGcCompactSettings();
3031 IMGUI_API
void TableLoadSettings(
ImGuiTable* table);
3032 IMGUI_API
void TableSaveSettings(
ImGuiTable* table);
3033 IMGUI_API
void TableResetSettings(
ImGuiTable* table);
3035 IMGUI_API
void TableSettingsAddSettingsHandler();
3041 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
3045 inline int TabBarGetTabOrder(
ImGuiTabBar* tab_bar,
ImGuiTabItem* tab) {
return tab_bar->Tabs.index_from_ptr(tab); }
3047 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
3052 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
3053 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags,
ImGuiWindow* docked_window);
3054 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button_or_unsaved_marker);
3056 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
3057 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);
3062 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
3063 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
3064 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);
3065 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);
3066 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);
3067 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool border =
true,
float rounding = 0.0f);
3068 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
3069 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);
3070 IMGUI_API
void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault);
3071 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
3072 IMGUI_API
void RenderMouseCursor(
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
3075 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
3077 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
3078 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
3079 IMGUI_API
void RenderRectFilledRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
3080 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
const ImRect& outer,
const ImRect& inner, ImU32 col,
float rounding);
3083 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
3084 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
3085 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
3086 IMGUI_API
bool ImageButtonEx(ImGuiID
id, ImTextureID texture_id,
const ImVec2& size,
const ImVec2& uv0,
const ImVec2& uv1,
const ImVec4& bg_col,
const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
3087 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags);
3088 IMGUI_API
void SeparatorTextEx(ImGuiID
id,
const char* label,
const char* label_end,
float extra_width);
3089 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
3090 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
3093 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
3094 IMGUI_API
bool CollapseButton(ImGuiID
id,
const ImVec2& pos);
3095 IMGUI_API
void Scrollbar(ImGuiAxis axis);
3096 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
3098 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
3099 IMGUI_API ImGuiID GetWindowResizeCornerID(
ImGuiWindow* window,
int n);
3100 IMGUI_API ImGuiID GetWindowResizeBorderID(
ImGuiWindow* window, ImGuiDir dir);
3103 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
3104 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);
3105 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);
3106 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);
3107 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
3108 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
3109 IMGUI_API
void TreeNodeSetOpen(ImGuiID
id,
bool open);
3110 IMGUI_API
bool TreeNodeUpdateNextOpen(ImGuiID
id, ImGuiTreeNodeFlags flags);
3115 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);
3116 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);
3117 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);
3118 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);
3119 template<
typename T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
3120 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
3124 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
3125 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
3126 IMGUI_API
bool DataTypeApplyFromText(
const char* buf, ImGuiDataType data_type,
void* p_data,
const char* format);
3127 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
3128 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
3131 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);
3132 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
3133 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);
3134 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
3135 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (
id != 0 && g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
3138 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
3139 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
3140 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
3143 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);
3146 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);
3147 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);
3150 IMGUI_API
void GcCompactTransientMiscBuffers();
3151 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
3152 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
3155 IMGUI_API
void DebugLog(
const char* fmt, ...) IM_FMTARGS(1);
3156 IMGUI_API
void DebugLogV(const
char* fmt, va_list args) IM_FMTLIST(1);
3159 IMGUI_API
void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,
void* user_data = NULL);
3160 IMGUI_API
void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback,
void* user_data = NULL);
3161 IMGUI_API
void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
3162 IMGUI_API
void DebugLocateItem(ImGuiID target_id);
3163 IMGUI_API
void DebugLocateItemOnHover(ImGuiID target_id);
3164 IMGUI_API
void DebugLocateItemResolveWithLastItem();
3165 inline
void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, col); }
3166 inline void DebugStartItemPicker() {
ImGuiContext& g = *GImGui; g.DebugItemPickerActive =
true; }
3168 IMGUI_API
void DebugHookIdInfo(ImGuiID
id, ImGuiDataType data_type,
const void* data_id,
const void* data_id_end);
3170 IMGUI_API
void DebugNodeDrawList(
ImGuiWindow* window,
const ImDrawList* draw_list,
const char* label);
3171 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
3172 IMGUI_API
void DebugNodeFont(
ImFont* font);
3174 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
3175 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
3176 IMGUI_API
void DebugNodeTable(
ImGuiTable* table);
3179 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
3182 IMGUI_API
void DebugNodeWindowsListByBeginStackParent(
ImGuiWindow** windows,
int windows_size,
ImGuiWindow* parent_in_begin_stack);
3184 IMGUI_API
void DebugRenderKeyboardPreview(
ImDrawList* draw_list);
3188#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3189 inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); }
3190 inline bool TreeNodeBehaviorIsOpen(ImGuiID
id, ImGuiTreeNodeFlags flags = 0) {
return TreeNodeUpdateNextOpen(
id, flags); }
3197 inline bool FocusableItemRegister(
ImGuiWindow* window, ImGuiID
id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(
id);
return false; }
3198 inline void FocusableItemUnregister(
ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); }
3200#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
3201 inline bool IsKeyPressedMap(ImGuiKey key,
bool repeat =
true) { IM_ASSERT(IsNamedKey(key));
return IsKeyPressed(key, repeat); }
3218#ifdef IMGUI_ENABLE_STB_TRUETYPE
3219IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
3221IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
3223IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
3224IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
3225IMGUI_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);
3226IMGUI_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);
3227IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
3228IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
3234#ifdef IMGUI_ENABLE_TEST_ENGINE
3235extern void ImGuiTestEngineHook_ItemAdd(
ImGuiContext* ctx,
const ImRect& bb, ImGuiID
id);
3236extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
3237extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
3238extern const char* ImGuiTestEngine_FindItemDebugLabel(
ImGuiContext* ctx, ImGuiID
id);
3240#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID)
3241#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS)
3242#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__)
3244#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
3245#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
3250#if defined(__clang__)
3251#pragma clang diagnostic pop
3252#elif defined(__GNUC__)
3253#pragma GCC diagnostic pop
3257#pragma warning (pop)
Definition: imgui_internal.h:581
Definition: imgui_internal.h:596
Definition: imgui_internal.h:700
Definition: imgui_internal.h:786
Definition: imgui_internal.h:763
Definition: imgui_internal.h:3213
Definition: imgui_internal.h:995
Definition: imgui_internal.h:1012
Definition: imgui_internal.h:1719
Definition: imgui_internal.h:1734
Definition: imgui_internal.h:978
Definition: imgui_internal.h:972
Definition: imgui_internal.h:1025
Definition: imgui_internal.h:1276
Definition: imgui_internal.h:1060
Definition: imgui_internal.h:1330
Definition: imgui_internal.h:1305
Definition: imgui_internal.h:1318
Definition: imgui_internal.h:1167
Definition: imgui_internal.h:1405
Definition: imgui_internal.h:1392
Definition: imgui_internal.h:1649
Definition: imgui_internal.h:1041
Definition: imgui_internal.h:1674
Definition: imgui_internal.h:1478
Definition: imgui_internal.h:1154
Definition: imgui_internal.h:1125
Definition: imgui_internal.h:1518
Definition: imgui_internal.h:1528
Definition: imgui_internal.h:1211
Definition: imgui_internal.h:1617
Definition: imgui_internal.h:1204
Definition: imgui_internal.h:1688
Definition: imgui_internal.h:1179
Definition: imgui_internal.h:1002
Definition: imgui_internal.h:2400
Definition: imgui_internal.h:2381
Definition: imgui_internal.h:2511
Definition: imgui_internal.h:2452
Definition: imgui_internal.h:2665
Definition: imgui_internal.h:2529
Definition: imgui_internal.h:2518
Definition: imgui_internal.h:2689
Definition: imgui_internal.h:2644
Definition: imgui_internal.h:720
Definition: imgui_internal.h:1571
Definition: imgui_internal.h:2241
Definition: imgui_internal.h:1604
Definition: imgui_internal.h:1197
Definition: imgui_internal.h:2193
Definition: imgui_internal.h:663
Definition: imgui_internal.h:519
Definition: imgui_internal.h:640
Definition: imgui_internal.h:610
Definition: imgui_internal.h:501
Definition: imgui_internal.h:509