46 #error Must include imgui.h before imgui_internal.h 56 #pragma warning (push) 57 #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) 61 #if defined(__clang__) 62 #pragma clang diagnostic push 63 #if __has_warning("-Wunknown-warning-option") 64 #pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' 66 #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx' 67 #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h 68 #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h 69 #pragma clang diagnostic ignored "-Wold-style-cast" 70 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" 71 #pragma clang diagnostic ignored "-Wdouble-promotion" 72 #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision 73 #elif defined(__GNUC__) 74 #pragma GCC diagnostic push 75 #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind 76 #pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead 80 #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74 81 #error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 83 #ifdef IMGUI_DISABLE_MATH_FUNCTIONS // Renamed in 1.74 84 #error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 89 #ifndef IMGUI_ENABLE_FREETYPE 90 #define IMGUI_ENABLE_STB_TRUETYPE 122 struct ImGuiTableColumn;
123 struct ImGuiTableSettings;
124 struct ImGuiTableColumnsSettings;
130 typedef int ImGuiLayoutType;
131 typedef int ImGuiItemFlags;
132 typedef int ImGuiItemStatusFlags;
133 typedef int ImGuiOldColumnFlags;
134 typedef int ImGuiNavHighlightFlags;
135 typedef int ImGuiNavDirSourceFlags;
136 typedef int ImGuiNavMoveFlags;
137 typedef int ImGuiNextItemDataFlags;
138 typedef int ImGuiNextWindowDataFlags;
139 typedef int ImGuiSeparatorFlags;
140 typedef int ImGuiTextFlags;
141 typedef int ImGuiTooltipFlags;
143 typedef void (*ImGuiErrorLogCallback)(
void* user_data,
const char* fmt, ...);
161 #undef STB_TEXTEDIT_STRING 162 #undef STB_TEXTEDIT_CHARTYPE 163 #define STB_TEXTEDIT_STRING ImGuiInputTextState 164 #define STB_TEXTEDIT_CHARTYPE ImWchar 165 #define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) 166 #define STB_TEXTEDIT_UNDOSTATECOUNT 99 167 #define STB_TEXTEDIT_UNDOCHARCOUNT 999 168 #include "imstb_textedit.h" 177 #ifndef IMGUI_DEBUG_LOG 178 #define IMGUI_DEBUG_LOG(_FMT,...) printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__) 184 #define IMGUI_DEBUG_LOG_POPUP(...) ((void)0) // Disable log 185 #define IMGUI_DEBUG_LOG_NAV(...) ((void)0) // Disable log 188 #if (__cplusplus >= 201100) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201100) 189 #define IM_STATIC_ASSERT(_COND) static_assert(_COND, "") 191 #define IM_STATIC_ASSERT(_COND) typedef char static_assertion_##__line__[(_COND)?1:-1] 197 #ifdef IMGUI_DEBUG_PARANOID 198 #define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR) 200 #define IM_ASSERT_PARANOID(_EXPR) 205 #ifndef IM_ASSERT_USER_ERROR 206 #define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error 210 #define IM_PI 3.14159265358979323846f 212 #define IM_NEWLINE "\r\n" // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!) 214 #define IM_NEWLINE "\n" 216 #define IM_TABSIZE (4) 217 #define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + (_ALIGN - 1)) & ~(_ALIGN - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8 218 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose 219 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 220 #define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds 221 #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // 225 #define IMGUI_CDECL __cdecl 232 #ifndef IM_DEBUG_BREAK 233 #if defined(__clang__) 234 #define IM_DEBUG_BREAK() __builtin_debugtrap() 235 #elif defined (_MSC_VER) 236 #define IM_DEBUG_BREAK() __debugbreak() 238 #define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger! 240 #endif // #ifndef IM_DEBUG_BREAK 266 IMGUI_API ImGuiID ImHashData(
const void* data,
size_t data_size, ImU32 seed = 0);
267 IMGUI_API ImGuiID ImHashStr(
const char* data,
size_t data_size = 0, ImU32 seed = 0);
268 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 269 static inline ImGuiID ImHash(
const void* data,
int size, ImU32 seed = 0) {
return size ? ImHashData(data, (
size_t)size, seed) : ImHashStr((const char*)data, 0, seed); }
273 #define ImQsort qsort 276 IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
279 static inline bool ImIsPowerOfTwo(
int v) {
return v != 0 && (v & (v - 1)) == 0; }
280 static inline bool ImIsPowerOfTwo(ImU64 v) {
return v != 0 && (v & (v - 1)) == 0; }
281 static inline int ImUpperPowerOfTwo(
int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++;
return v; }
284 IMGUI_API
int ImStricmp(
const char* str1,
const char* str2);
285 IMGUI_API
int ImStrnicmp(
const char* str1,
const char* str2,
size_t count);
286 IMGUI_API
void ImStrncpy(
char* dst,
const char* src,
size_t count);
287 IMGUI_API
char* ImStrdup(
const char* str);
288 IMGUI_API
char* ImStrdupcpy(
char* dst,
size_t* p_dst_size,
const char* str);
289 IMGUI_API
const char* ImStrchrRange(
const char* str_begin,
const char* str_end,
char c);
290 IMGUI_API
int ImStrlenW(
const ImWchar* str);
291 IMGUI_API
const char* ImStreolRange(
const char* str,
const char* str_end);
292 IMGUI_API
const ImWchar*ImStrbolW(
const ImWchar* buf_mid_line,
const ImWchar* buf_begin);
293 IMGUI_API
const char* ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
294 IMGUI_API
void ImStrTrimBlanks(
char* str);
295 IMGUI_API
const char* ImStrSkipBlank(
const char* str);
296 IMGUI_API
int ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...) IM_FMTARGS(3);
297 IMGUI_API
int ImFormatStringV(
char* buf,
size_t buf_size, const
char* fmt, va_list args) IM_FMTLIST(3);
298 IMGUI_API const
char* ImParseFormatFindStart(const
char* format);
299 IMGUI_API const
char* ImParseFormatFindEnd(const
char* format);
300 IMGUI_API const
char* ImParseFormatTrimDecorations(const
char* format,
char* buf,
size_t buf_size);
301 IMGUI_API
int ImParseFormatPrecision(const
char* format,
int default_value);
302 static inline
bool ImCharIsBlankA(
char c) {
return c ==
' ' || c ==
'\t'; }
303 static inline bool ImCharIsBlankW(
unsigned int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
306 IMGUI_API
int ImTextStrToUtf8(
char* buf,
int buf_size,
const ImWchar* in_text,
const ImWchar* in_text_end);
307 IMGUI_API
int ImTextCharFromUtf8(
unsigned int* out_char,
const char* in_text,
const char* in_text_end);
308 IMGUI_API
int ImTextStrFromUtf8(ImWchar* buf,
int buf_size,
const char* in_text,
const char* in_text_end,
const char** in_remaining = NULL);
309 IMGUI_API
int ImTextCountCharsFromUtf8(
const char* in_text,
const char* in_text_end);
310 IMGUI_API
int ImTextCountUtf8BytesFromChar(
const char* in_text,
const char* in_text_end);
311 IMGUI_API
int ImTextCountUtf8BytesFromStr(
const ImWchar* in_text,
const ImWchar* in_text_end);
316 #ifdef IMGUI_DEFINE_MATH_OPERATORS 317 static inline ImVec2 operator*(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x * rhs, lhs.y * rhs); }
318 static inline ImVec2 operator/(
const ImVec2& lhs,
const float rhs) {
return ImVec2(lhs.x / rhs, lhs.y / rhs); }
319 static inline ImVec2 operator+(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
320 static inline ImVec2 operator-(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
321 static inline ImVec2 operator*(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
322 static inline ImVec2 operator/(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
323 static inline ImVec2& operator*=(
ImVec2& lhs,
const float rhs) { lhs.x *= rhs; lhs.y *= rhs;
return lhs; }
324 static inline ImVec2& operator/=(
ImVec2& lhs,
const float rhs) { lhs.x /= rhs; lhs.y /= rhs;
return lhs; }
325 static inline ImVec2& operator+=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y;
return lhs; }
326 static inline ImVec2& operator-=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y;
return lhs; }
327 static inline ImVec2& operator*=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y;
return lhs; }
328 static inline ImVec2& operator/=(
ImVec2& lhs,
const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y;
return lhs; }
329 static 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); }
330 static 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); }
331 static 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); }
335 #ifdef IMGUI_DISABLE_FILE_FUNCTIONS 336 #define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 337 typedef void* ImFileHandle;
338 static inline ImFileHandle ImFileOpen(
const char*,
const char*) {
return NULL; }
339 static inline bool ImFileClose(ImFileHandle) {
return false; }
340 static inline ImU64 ImFileGetSize(ImFileHandle) {
return (ImU64)-1; }
341 static inline ImU64 ImFileRead(
void*, ImU64, ImU64, ImFileHandle) {
return 0; }
342 static inline ImU64 ImFileWrite(
const void*, ImU64, ImU64, ImFileHandle) {
return 0; }
344 #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS 345 typedef FILE* ImFileHandle;
346 IMGUI_API ImFileHandle ImFileOpen(
const char* filename,
const char* mode);
347 IMGUI_API
bool ImFileClose(ImFileHandle file);
348 IMGUI_API ImU64 ImFileGetSize(ImFileHandle file);
349 IMGUI_API ImU64 ImFileRead(
void* data, ImU64 size, ImU64 count, ImFileHandle file);
350 IMGUI_API ImU64 ImFileWrite(
const void* data, ImU64 size, ImU64 count, ImFileHandle file);
352 #define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions 354 IMGUI_API
void* ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size = NULL,
int padding_bytes = 0);
358 #ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS 359 #define ImFabs(X) fabsf(X) 360 #define ImSqrt(X) sqrtf(X) 361 #define ImFmod(X, Y) fmodf((X), (Y)) 362 #define ImCos(X) cosf(X) 363 #define ImSin(X) sinf(X) 364 #define ImAcos(X) acosf(X) 365 #define ImAtan2(Y, X) atan2f((Y), (X)) 366 #define ImAtof(STR) atof(STR) 367 #define ImFloorStd(X) floorf(X) // We already uses our own ImFloor() { return (float)(int)v } internally so the standard one wrapper is named differently (it's used by e.g. stb_truetype) 368 #define ImCeil(X) ceilf(X) 369 static inline float ImPow(
float x,
float y) {
return powf(x, y); }
370 static inline double ImPow(
double x,
double y) {
return pow(x, y); }
371 static inline float ImLog(
float x) {
return logf(x); }
372 static inline double ImLog(
double x) {
return log(x); }
373 static inline float ImAbs(
float x) {
return fabsf(x); }
374 static inline double ImAbs(
double x) {
return fabs(x); }
375 static inline float ImSign(
float x) {
return (x < 0.0f) ? -1.0f : ((x > 0.0f) ? 1.0f : 0.0f); }
376 static inline double ImSign(
double x) {
return (x < 0.0) ? -1.0 : ((x > 0.0) ? 1.0 : 0.0); }
380 template<
typename T>
static inline T ImMin(T lhs, T rhs) {
return lhs < rhs ? lhs : rhs; }
381 template<
typename T>
static inline T ImMax(T lhs, T rhs) {
return lhs >= rhs ? lhs : rhs; }
382 template<
typename T>
static inline T ImClamp(T v, T mn, T mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
383 template<
typename T>
static inline T ImLerp(T a, T b,
float t) {
return (T)(a + (b - a) * t); }
384 template<
typename T>
static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
385 template<
typename T>
static inline T ImAddClampOverflow(T a, T b, T mn, T mx) {
if (b < 0 && (a < mn - b))
return mn;
if (b > 0 && (a > mx - b))
return mx;
return a + b; }
386 template<
typename T>
static inline T ImSubClampOverflow(T a, T b, T mn, T mx) {
if (b > 0 && (a < mn + b))
return mn;
if (b < 0 && (a > mx + b))
return mx;
return a - b; }
388 static inline ImVec2 ImMin(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); }
389 static inline ImVec2 ImMax(
const ImVec2& lhs,
const ImVec2& rhs) {
return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); }
390 static 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); }
391 static inline ImVec2 ImLerp(
const ImVec2& a,
const ImVec2& b,
float t) {
return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); }
392 static inline ImVec2 ImLerp(
const ImVec2& a,
const ImVec2& b,
const ImVec2& t) {
return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
393 static inline ImVec4 ImLerp(
const ImVec4& a,
const ImVec4& b,
float t) {
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); }
394 static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
395 static inline float ImLengthSqr(
const ImVec2& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
396 static inline float ImLengthSqr(
const ImVec4& lhs) {
return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
397 static inline float ImInvLength(
const ImVec2& lhs,
float fail_value) {
float d = (lhs.x * lhs.x) + (lhs.y * lhs.y);
if (d > 0.0f)
return 1.0f / ImSqrt(d);
return fail_value; }
398 static inline float ImFloor(
float f) {
return (
float)(int)(f); }
399 static inline ImVec2 ImFloor(
const ImVec2& v) {
return ImVec2((
float)(
int)(v.x), (
float)(
int)(v.y)); }
400 static inline int ImModPositive(
int a,
int b) {
return (a + b) % b; }
401 static inline float ImDot(
const ImVec2& a,
const ImVec2& b) {
return a.x * b.x + a.y * b.y; }
402 static inline ImVec2 ImRotate(
const ImVec2& v,
float cos_a,
float sin_a) {
return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
403 static inline float ImLinearSweep(
float current,
float target,
float speed) {
if (current < target)
return ImMin(current + speed, target);
if (current > target)
return ImMax(current - speed, target);
return current; }
414 IMGUI_API
void ImTriangleBarycentricCoords(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c,
const ImVec2& p,
float& out_u,
float& out_v,
float& out_w);
415 inline float ImTriangleArea(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c) {
return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
416 IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(
float dx,
float dy);
424 ImVec1(
float _x) { x = _x; }
432 ImVec2ih(
short _x,
short _y) { x = _x; y = _y; }
433 explicit ImVec2ih(
const ImVec2& rhs) { x = (short)rhs.x; y = (
short)rhs.y; }
443 ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
445 ImRect(
const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
446 ImRect(
float x1,
float y1,
float x2,
float y2) : Min(x1, y1), Max(x2, y2) {}
448 ImVec2 GetCenter()
const {
return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
449 ImVec2 GetSize()
const {
return ImVec2(Max.x - Min.x, Max.y - Min.y); }
450 float GetWidth()
const {
return Max.x - Min.x; }
451 float GetHeight()
const {
return Max.y - Min.y; }
452 float GetArea()
const {
return (Max.x - Min.x) * (Max.y - Min.y); }
453 ImVec2 GetTL()
const {
return Min; }
456 ImVec2 GetBR()
const {
return Max; }
457 bool Contains(
const ImVec2& p)
const {
return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
458 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; }
459 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; }
460 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; }
461 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; }
462 void Expand(
const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
463 void Expand(
const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
464 void Translate(
const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
465 void TranslateX(
float dx) { Min.x += dx; Max.x += dx; }
466 void TranslateY(
float dy) { Min.y += dy; Max.y += dy; }
467 void ClipWith(
const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); }
468 void ClipWithFull(
const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); }
469 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); }
470 bool IsInverted()
const {
return Min.x > Max.x || Min.y > Max.y; }
471 ImVec4 ToVec4()
const {
return ImVec4(Min.x, Min.y, Max.x, Max.y); }
475 inline bool ImBitArrayTestBit(
const ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31);
return (arr[n >> 5] & mask) != 0; }
476 inline void ImBitArrayClearBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
477 inline void ImBitArraySetBit(ImU32* arr,
int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
478 inline void ImBitArraySetBitRange(ImU32* arr,
int n,
int n2)
483 int a_mod = (n & 31);
484 int b_mod = (n2 > (n | 31) ? 31 : (n2 & 31)) + 1;
485 ImU32 mask = (ImU32)(((ImU64)1 << b_mod) - 1) & ~(ImU32)(((ImU64)1 << a_mod) - 1);
493 template<
int BITCOUNT>
496 ImU32 Storage[(BITCOUNT + 31) >> 5];
498 void ClearAllBits() { memset(Storage, 0,
sizeof(Storage)); }
499 void SetAllBits() { memset(Storage, 255,
sizeof(Storage)); }
500 bool TestBit(
int n)
const { IM_ASSERT(n < BITCOUNT);
return ImBitArrayTestBit(Storage, n); }
501 void SetBit(
int n) { IM_ASSERT(n < BITCOUNT); ImBitArraySetBit(Storage, n); }
502 void ClearBit(
int n) { IM_ASSERT(n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
503 void SetBitRange(
int n,
int n2) { ImBitArraySetBitRange(Storage, n, n2); }
511 void Create(
int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (
size_t)Storage.Size *
sizeof(Storage.Data[0])); }
512 void Clear() { Storage.clear(); }
513 bool TestBit(
int n)
const { IM_ASSERT(n < (Storage.Size << 5));
return ImBitArrayTestBit(Storage.Data, n); }
514 void SetBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
515 void ClearBit(
int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
527 inline ImSpan() { Data = DataEnd = NULL; }
528 inline ImSpan(T* data,
int size) { Data = data; DataEnd = data + size; }
529 inline ImSpan(T* data, T* data_end) { Data = data; DataEnd = data_end; }
531 inline void set(T* data,
int size) { Data = data; DataEnd = data + size; }
532 inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
533 inline int size()
const {
return (
int)(ptrdiff_t)(DataEnd - Data); }
534 inline int size_in_bytes()
const {
return (
int)(ptrdiff_t)(DataEnd - Data) * (int)
sizeof(T); }
535 inline T& operator[](
int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
536 inline const T& operator[](
int i)
const {
const T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd);
return *p; }
538 inline T* begin() {
return Data; }
539 inline const T* begin()
const {
return Data; }
540 inline T* end() {
return DataEnd; }
541 inline const T* end()
const {
return DataEnd; }
544 inline int index_from_ptr(
const T* it)
const { IM_ASSERT(it >= Data && it < DataEnd);
const ptrdiff_t off = it - Data;
return (
int)off; }
560 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; }
561 inline int GetArenaSizeInBytes() {
return CurrOff; }
562 inline void SetArenaBasePtr(
void* base_ptr) { BasePtr = (
char*)base_ptr; }
563 inline void* GetSpanPtrBegin(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n]); }
564 inline void* GetSpanPtrEnd(
int n) { IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS);
return (
void*)(BasePtr + Offsets[n] + Sizes[n]); }
566 inline void GetSpan(
int n,
ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
572 typedef int ImPoolIdx;
582 T* GetByKey(ImGuiID key) {
int idx = Map.GetInt(key, -1);
return (idx != -1) ? &Buf[idx] : NULL; }
583 T* GetByIndex(ImPoolIdx n) {
return &Buf[n]; }
584 ImPoolIdx GetIndex(
const T* p)
const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size);
return (ImPoolIdx)(p - Buf.Data); }
585 T* GetOrAddByKey(ImGuiID key) {
int* p_idx = Map.GetIntRef(key, -1);
if (*p_idx != -1)
return &Buf[*p_idx]; *p_idx = FreeIdx;
return Add(); }
586 bool Contains(
const T* p)
const {
return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
587 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 = 0; }
588 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();
return &Buf[idx]; }
589 void Remove(ImGuiID key,
const T* p) { Remove(key, GetIndex(p)); }
590 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(
int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); }
591 void Reserve(
int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }
592 int GetSize()
const {
return Buf.Size; }
605 void clear() { Buf.clear(); }
606 bool empty()
const {
return Buf.Size == 0; }
607 int size()
const {
return Buf.Size; }
608 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); }
609 T* begin() {
size_t HDR_SZ = 4;
if (!Buf.Data)
return NULL;
return (T*)(
void*)(Buf.Data + HDR_SZ); }
610 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; }
611 int chunk_size(
const T* p) {
return ((
const int*)p)[-1]; }
612 T* end() {
return (T*)(
void*)(Buf.Data + Buf.Size); }
613 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; }
614 T* ptr_from_offset(
int off) { IM_ASSERT(off >= 4 && off < Buf.Size);
return (T*)(
void*)(Buf.Data + off); }
634 #define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2) 635 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4 636 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512 637 #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) 640 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(_N,_MAXERROR) ((_MAXERROR) / (1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI)))) 641 #define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(_N,_RAD) ((1 - ImCos(IM_PI / ImMax((float)(_N), IM_PI))) / (_RAD)) 644 #ifndef IM_DRAWLIST_ARCFAST_TABLE_SIZE 645 #define IM_DRAWLIST_ARCFAST_TABLE_SIZE 48 // Number of samples in lookup table. 647 #define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE // Sample index _PathArcToFastEx() for 360 angle. 656 float CurveTessellationTol;
657 float CircleSegmentMaxError;
658 ImVec4 ClipRectFullscreen;
659 ImDrawListFlags InitialFlags;
662 ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE];
663 float ArcFastRadiusCutoff;
664 ImU8 CircleSegmentCounts[64];
668 void SetCircleTessellationMaxError(
float max_error);
675 void Clear() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
676 void ClearFreeMemory() {
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
677 int GetDrawListCount()
const {
int count = 0;
for (
int n = 0; n < IM_ARRAYSIZE(Layers); n++) count += Layers[n].Size;
return count; }
678 IMGUI_API
void FlattenIntoSingleLayer();
689 ImGuiItemFlags_None = 0,
690 ImGuiItemFlags_NoTabStop = 1 << 0,
691 ImGuiItemFlags_ButtonRepeat = 1 << 1,
692 ImGuiItemFlags_Disabled = 1 << 2,
693 ImGuiItemFlags_NoNav = 1 << 3,
694 ImGuiItemFlags_NoNavDefaultFocus = 1 << 4,
695 ImGuiItemFlags_SelectableDontClosePopup = 1 << 5,
696 ImGuiItemFlags_MixedValue = 1 << 6,
697 ImGuiItemFlags_ReadOnly = 1 << 7,
698 ImGuiItemFlags_Default_ = 0
702 enum ImGuiItemStatusFlags_
704 ImGuiItemStatusFlags_None = 0,
705 ImGuiItemStatusFlags_HoveredRect = 1 << 0,
706 ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
707 ImGuiItemStatusFlags_Edited = 1 << 2,
708 ImGuiItemStatusFlags_ToggledSelection = 1 << 3,
709 ImGuiItemStatusFlags_ToggledOpen = 1 << 4,
710 ImGuiItemStatusFlags_HasDeactivated = 1 << 5,
711 ImGuiItemStatusFlags_Deactivated = 1 << 6,
712 ImGuiItemStatusFlags_HoveredWindow = 1 << 7
714 #ifdef IMGUI_ENABLE_TEST_ENGINE 716 ImGuiItemStatusFlags_Openable = 1 << 10,
717 ImGuiItemStatusFlags_Opened = 1 << 11,
718 ImGuiItemStatusFlags_Checkable = 1 << 12,
719 ImGuiItemStatusFlags_Checked = 1 << 13
724 enum ImGuiButtonFlagsPrivate_
726 ImGuiButtonFlags_PressedOnClick = 1 << 4,
727 ImGuiButtonFlags_PressedOnClickRelease = 1 << 5,
728 ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6,
729 ImGuiButtonFlags_PressedOnRelease = 1 << 7,
730 ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8,
731 ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9,
732 ImGuiButtonFlags_Repeat = 1 << 10,
733 ImGuiButtonFlags_FlattenChildren = 1 << 11,
734 ImGuiButtonFlags_AllowItemOverlap = 1 << 12,
735 ImGuiButtonFlags_DontClosePopups = 1 << 13,
736 ImGuiButtonFlags_Disabled = 1 << 14,
737 ImGuiButtonFlags_AlignTextBaseLine = 1 << 15,
738 ImGuiButtonFlags_NoKeyModifiers = 1 << 16,
739 ImGuiButtonFlags_NoHoldingActiveId = 1 << 17,
740 ImGuiButtonFlags_NoNavFocus = 1 << 18,
741 ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19,
742 ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
743 ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease
747 enum ImGuiSliderFlagsPrivate_
749 ImGuiSliderFlags_Vertical = 1 << 20,
750 ImGuiSliderFlags_ReadOnly = 1 << 21
754 enum ImGuiSelectableFlagsPrivate_
757 ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20,
758 ImGuiSelectableFlags_SelectOnClick = 1 << 21,
759 ImGuiSelectableFlags_SelectOnRelease = 1 << 22,
760 ImGuiSelectableFlags_SpanAvailWidth = 1 << 23,
761 ImGuiSelectableFlags_DrawHoveredWhenHeld = 1 << 24,
762 ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25,
763 ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26
767 enum ImGuiTreeNodeFlagsPrivate_
769 ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20
772 enum ImGuiSeparatorFlags_
774 ImGuiSeparatorFlags_None = 0,
775 ImGuiSeparatorFlags_Horizontal = 1 << 0,
776 ImGuiSeparatorFlags_Vertical = 1 << 1,
777 ImGuiSeparatorFlags_SpanAllColumns = 1 << 2
782 ImGuiTextFlags_None = 0,
783 ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0
786 enum ImGuiTooltipFlags_
788 ImGuiTooltipFlags_None = 0,
789 ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0
794 enum ImGuiLayoutType_
796 ImGuiLayoutType_Horizontal = 0,
797 ImGuiLayoutType_Vertical = 1
802 ImGuiLogType_None = 0,
806 ImGuiLogType_Clipboard
820 ImGuiPlotType_Histogram
823 enum ImGuiInputSource
825 ImGuiInputSource_None = 0,
826 ImGuiInputSource_Mouse,
827 ImGuiInputSource_Keyboard,
828 ImGuiInputSource_Gamepad,
829 ImGuiInputSource_Nav,
830 ImGuiInputSource_COUNT
834 enum ImGuiInputReadMode
836 ImGuiInputReadMode_Down,
837 ImGuiInputReadMode_Pressed,
838 ImGuiInputReadMode_Released,
839 ImGuiInputReadMode_Repeat,
840 ImGuiInputReadMode_RepeatSlow,
841 ImGuiInputReadMode_RepeatFast
844 enum ImGuiNavHighlightFlags_
846 ImGuiNavHighlightFlags_None = 0,
847 ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
848 ImGuiNavHighlightFlags_TypeThin = 1 << 1,
849 ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2,
850 ImGuiNavHighlightFlags_NoRounding = 1 << 3
853 enum ImGuiNavDirSourceFlags_
855 ImGuiNavDirSourceFlags_None = 0,
856 ImGuiNavDirSourceFlags_Keyboard = 1 << 0,
857 ImGuiNavDirSourceFlags_PadDPad = 1 << 1,
858 ImGuiNavDirSourceFlags_PadLStick = 1 << 2
861 enum ImGuiNavMoveFlags_
863 ImGuiNavMoveFlags_None = 0,
864 ImGuiNavMoveFlags_LoopX = 1 << 0,
865 ImGuiNavMoveFlags_LoopY = 1 << 1,
866 ImGuiNavMoveFlags_WrapX = 1 << 2,
867 ImGuiNavMoveFlags_WrapY = 1 << 3,
868 ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4,
869 ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5,
870 ImGuiNavMoveFlags_ScrollToEdge = 1 << 6
875 ImGuiNavForward_None,
876 ImGuiNavForward_ForwardQueued,
877 ImGuiNavForward_ForwardActive
882 ImGuiNavLayer_Main = 0,
883 ImGuiNavLayer_Menu = 1,
887 enum ImGuiPopupPositionPolicy
889 ImGuiPopupPositionPolicy_Default,
890 ImGuiPopupPositionPolicy_ComboBox,
891 ImGuiPopupPositionPolicy_Tooltip
904 const char* PrintFmt;
909 enum ImGuiDataTypePrivate_
911 ImGuiDataType_String = ImGuiDataType_COUNT + 1,
912 ImGuiDataType_Pointer,
926 ImGuiStyleVar VarIdx;
927 union {
int BackupInt[2];
float BackupFloat[2]; };
928 ImGuiStyleMod(ImGuiStyleVar idx,
int v) { VarIdx = idx; BackupInt[0] = v; }
929 ImGuiStyleMod(ImGuiStyleVar idx,
float v) { VarIdx = idx; BackupFloat[0] = v; }
930 ImGuiStyleMod(ImGuiStyleVar idx,
ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
938 ImVec2 BackupCursorMaxPos;
941 ImVec2 BackupCurrLineSize;
942 float BackupCurrLineTextBaseOffset;
943 ImGuiID BackupActiveIdIsAlive;
944 bool BackupActiveIdPreviousFrameIsAlive;
945 bool BackupHoveredIdIsAlive;
953 float Width, NextWidth;
954 float Pos[3], NextWidths[3];
957 void Update(
int count,
float spacing,
bool clear);
958 float DeclColumns(
float w0,
float w1,
float w2);
959 float CalcExtraSpace(
float avail_w)
const;
967 int CurLenW, CurLenA;
977 bool SelectedAllMouseLock;
979 ImGuiInputTextFlags UserFlags;
980 ImGuiInputTextCallback UserCallback;
981 void* UserCallbackData;
984 void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
985 void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
986 int GetUndoAvailCount()
const {
return Stb.undostate.undo_point; }
987 int GetRedoAvailCount()
const {
return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
988 void OnKeyPressed(
int key);
991 void CursorAnimReset() { CursorAnim = -0.30f; }
992 void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
993 bool HasSelection()
const {
return Stb.select_start != Stb.select_end; }
994 void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
995 void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
1005 ImGuiID OpenParentId;
1009 ImGuiPopupData() { memset(
this, 0,
sizeof(*
this)); OpenFrameCount = -1; }
1016 ImGuiID FocusScopeId;
1023 void Clear() { Window = NULL; ID = FocusScopeId = 0; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel =
ImRect(); }
1026 enum ImGuiNextWindowDataFlags_
1028 ImGuiNextWindowDataFlags_None = 0,
1029 ImGuiNextWindowDataFlags_HasPos = 1 << 0,
1030 ImGuiNextWindowDataFlags_HasSize = 1 << 1,
1031 ImGuiNextWindowDataFlags_HasContentSize = 1 << 2,
1032 ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
1033 ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
1034 ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
1035 ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
1036 ImGuiNextWindowDataFlags_HasScroll = 1 << 7
1042 ImGuiNextWindowDataFlags Flags;
1045 ImGuiCond CollapsedCond;
1052 ImRect SizeConstraintRect;
1053 ImGuiSizeCallback SizeCallback;
1054 void* SizeCallbackUserData;
1056 ImVec2 MenuBarOffsetMinVal;
1059 inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
1062 enum ImGuiNextItemDataFlags_
1064 ImGuiNextItemDataFlags_None = 0,
1065 ImGuiNextItemDataFlags_HasWidth = 1 << 0,
1066 ImGuiNextItemDataFlags_HasOpen = 1 << 1
1071 ImGuiNextItemDataFlags Flags;
1073 ImGuiID FocusScopeId;
1078 inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; }
1101 enum ImGuiOldColumnFlags_
1103 ImGuiOldColumnFlags_None = 0,
1104 ImGuiOldColumnFlags_NoBorder = 1 << 0,
1105 ImGuiOldColumnFlags_NoResize = 1 << 1,
1106 ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2,
1107 ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3,
1108 ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4
1111 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1112 , ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
1113 ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
1114 ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
1115 ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
1116 ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
1117 ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize
1124 float OffsetNormBeforeResize;
1125 ImGuiOldColumnFlags Flags;
1134 ImGuiOldColumnFlags Flags;
1136 bool IsBeingResized;
1139 float OffMinX, OffMaxX;
1140 float LineMinY, LineMaxY;
1141 float HostCursorPosY;
1142 float HostCursorMaxPosX;
1143 ImRect HostInitialClipRect;
1144 ImRect HostBackupClipRect;
1145 ImRect HostBackupParentWorkRect;
1156 #ifdef IMGUI_HAS_MULTI_SELECT 1158 #endif // #ifdef IMGUI_HAS_MULTI_SELECT 1164 #ifdef IMGUI_HAS_DOCK 1166 #endif // #ifdef IMGUI_HAS_DOCK 1176 int DrawListsLastFrame[2];
1183 ImVec2 CurrWorkOffsetMin;
1184 ImVec2 CurrWorkOffsetMax;
1186 ImGuiViewportP() { DrawListsLastFrame[0] = DrawListsLastFrame[1] = -1; DrawLists[0] = DrawLists[1] = NULL; }
1187 ~
ImGuiViewportP() {
if (DrawLists[0]) IM_DELETE(DrawLists[0]);
if (DrawLists[1]) IM_DELETE(DrawLists[1]); }
1188 ImRect GetMainRect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1189 ImRect GetWorkRect()
const {
return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
1190 void UpdateWorkRect() { WorkPos =
ImVec2(Pos.x + WorkOffsetMin.x, Pos.y + WorkOffsetMin.y); WorkSize =
ImVec2(ImMax(0.0f, Size.x - WorkOffsetMin.x + WorkOffsetMax.x), ImMax(0.0f, Size.y - WorkOffsetMin.y + WorkOffsetMax.y)); }
1209 char* GetName() {
return (
char*)(
this + 1); }
1214 const char* TypeName;
1233 bool ShowWindowsRects;
1234 bool ShowWindowsBeginOrder;
1235 bool ShowTablesRects;
1236 bool ShowDrawCmdMesh;
1237 bool ShowDrawCmdBoundingBoxes;
1238 int ShowWindowsRectsType;
1239 int ShowTablesRectsType;
1243 ShowWindowsRects =
false;
1244 ShowWindowsBeginOrder =
false;
1245 ShowTablesRects =
false;
1246 ShowDrawCmdMesh =
true;
1247 ShowDrawCmdBoundingBoxes =
true;
1248 ShowWindowsRectsType = -1;
1249 ShowTablesRectsType = -1;
1255 short SizeOfIDStack;
1256 short SizeOfColorStack;
1257 short SizeOfStyleVarStack;
1258 short SizeOfFontStack;
1259 short SizeOfFocusScopeStack;
1260 short SizeOfGroupStack;
1261 short SizeOfBeginPopupStack;
1264 void SetToCurrentState();
1265 void CompareWithCurrentState();
1273 enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiContextHookType_NewFramePost, ImGuiContextHookType_EndFramePre, ImGuiContextHookType_EndFramePost, ImGuiContextHookType_RenderPre, ImGuiContextHookType_RenderPost, ImGuiContextHookType_Shutdown, ImGuiContextHookType_PendingRemoval_ };
1278 ImGuiContextHookType Type;
1280 ImGuiContextHookCallback Callback;
1293 bool FontAtlasOwnedByContext;
1302 int FrameCountEnded;
1303 int FrameCountRendered;
1304 bool WithinFrameScope;
1305 bool WithinFrameScopeWithImplicitWindow;
1306 bool WithinEndChild;
1308 bool TestEngineHookItems;
1309 ImGuiID TestEngineHookIdInfo;
1318 int WindowsActiveCount;
1324 ImVec2 WheelingWindowRefMousePos;
1325 float WheelingWindowTimer;
1329 ImGuiID HoveredIdPreviousFrame;
1330 bool HoveredIdAllowOverlap;
1331 bool HoveredIdUsingMouseWheel;
1332 bool HoveredIdPreviousFrameUsingMouseWheel;
1333 bool HoveredIdDisabled;
1334 float HoveredIdTimer;
1335 float HoveredIdNotActiveTimer;
1337 ImGuiID ActiveIdIsAlive;
1338 float ActiveIdTimer;
1339 bool ActiveIdIsJustActivated;
1340 bool ActiveIdAllowOverlap;
1341 bool ActiveIdNoClearOnFocusLoss;
1342 bool ActiveIdHasBeenPressedBefore;
1343 bool ActiveIdHasBeenEditedBefore;
1344 bool ActiveIdHasBeenEditedThisFrame;
1345 bool ActiveIdUsingMouseWheel;
1346 ImU32 ActiveIdUsingNavDirMask;
1347 ImU32 ActiveIdUsingNavInputMask;
1348 ImU64 ActiveIdUsingKeyInputMask;
1349 ImVec2 ActiveIdClickOffset;
1351 ImGuiInputSource ActiveIdSource;
1352 int ActiveIdMouseButton;
1353 ImGuiID ActiveIdPreviousFrame;
1354 bool ActiveIdPreviousFrameIsAlive;
1355 bool ActiveIdPreviousFrameHasBeenEditedBefore;
1357 ImGuiID LastActiveId;
1358 float LastActiveIdTimer;
1380 ImGuiID NavFocusScopeId;
1381 ImGuiID NavActivateId;
1382 ImGuiID NavActivateDownId;
1383 ImGuiID NavActivatePressedId;
1385 ImGuiID NavJustTabbedId;
1386 ImGuiID NavJustMovedToId;
1387 ImGuiID NavJustMovedToFocusScopeId;
1388 ImGuiKeyModFlags NavJustMovedToKeyMods;
1389 ImGuiID NavNextActivateId;
1390 ImGuiInputSource NavInputSource;
1392 int NavScoringCount;
1393 ImGuiNavLayer NavLayer;
1394 int NavIdTabCounter;
1396 bool NavMousePosDirty;
1397 bool NavDisableHighlight;
1398 bool NavDisableMouseHover;
1400 bool NavInitRequest;
1401 bool NavInitRequestFromMove;
1402 ImGuiID NavInitResultId;
1403 ImRect NavInitResultRectRel;
1404 bool NavMoveRequest;
1405 ImGuiNavMoveFlags NavMoveRequestFlags;
1406 ImGuiNavForward NavMoveRequestForward;
1407 ImGuiKeyModFlags NavMoveRequestKeyMods;
1408 ImGuiDir NavMoveDir, NavMoveDirLast;
1409 ImGuiDir NavMoveClipDir;
1414 ImGuiNavMoveFlags NavWrapRequestFlags;
1420 float NavWindowingTimer;
1421 float NavWindowingHighlightAlpha;
1422 bool NavWindowingToggleLayer;
1427 int TabFocusRequestCurrCounterRegular;
1428 int TabFocusRequestCurrCounterTabStop;
1429 int TabFocusRequestNextCounterRegular;
1430 int TabFocusRequestNextCounterTabStop;
1431 bool TabFocusPressed;
1435 ImGuiMouseCursor MouseCursor;
1438 bool DragDropActive;
1439 bool DragDropWithinSource;
1440 bool DragDropWithinTarget;
1441 ImGuiDragDropFlags DragDropSourceFlags;
1442 int DragDropSourceFrameCount;
1443 int DragDropMouseButton;
1445 ImRect DragDropTargetRect;
1446 ImGuiID DragDropTargetId;
1447 ImGuiDragDropFlags DragDropAcceptFlags;
1448 float DragDropAcceptIdCurrRectSurface;
1449 ImGuiID DragDropAcceptIdCurr;
1450 ImGuiID DragDropAcceptIdPrev;
1451 int DragDropAcceptFrameCount;
1452 ImGuiID DragDropHoldJustPressedId;
1454 unsigned char DragDropPayloadBufLocal[16];
1457 ImGuiTable* CurrentTable;
1470 ImVec2 LastValidMousePos;
1472 ImFont InputTextPasswordFont;
1473 ImGuiID TempInputId;
1474 ImGuiColorEditFlags ColorEditOptions;
1475 float ColorEditLastHue;
1476 float ColorEditLastSat;
1477 float ColorEditLastColor[3];
1479 float SliderCurrentAccum;
1480 bool SliderCurrentAccumDirty;
1481 bool DragCurrentAccumDirty;
1482 float DragCurrentAccum;
1483 float DragSpeedDefaultRatio;
1484 float ScrollbarClickDeltaToGrabCenter;
1485 int TooltipOverrideCount;
1486 float TooltipSlowDelay;
1492 ImVec2 PlatformImeLastPos;
1493 char PlatformLocaleDecimalPoint;
1496 bool SettingsLoaded;
1497 float SettingsDirtyTimer;
1507 ImGuiLogType LogType;
1508 ImFileHandle LogFile;
1510 const char* LogNextPrefix;
1511 const char* LogNextSuffix;
1513 bool LogLineFirstItem;
1515 int LogDepthToExpand;
1516 int LogDepthToExpandDefault;
1519 bool DebugItemPickerActive;
1520 ImGuiID DebugItemPickerBreakId;
1524 float FramerateSecPerFrame[120];
1525 int FramerateSecPerFrameIdx;
1526 float FramerateSecPerFrameAccum;
1527 int WantCaptureMouseNextFrame;
1528 int WantCaptureKeyboardNextFrame;
1529 int WantTextInputNextFrame;
1530 char TempBuffer[1024 * 3 + 1];
1534 Initialized =
false;
1535 FontAtlasOwnedByContext = shared_font_atlas ? false :
true;
1537 FontSize = FontBaseSize = 0.0f;
1538 IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(
ImFontAtlas)();
1541 FrameCountEnded = FrameCountRendered = -1;
1542 WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild =
false;
1543 GcCompactAll =
false;
1544 TestEngineHookItems =
false;
1545 TestEngineHookIdInfo = 0;
1548 WindowsActiveCount = 0;
1549 CurrentWindow = NULL;
1550 HoveredWindow = NULL;
1551 HoveredWindowUnderMovingWindow = NULL;
1552 MovingWindow = NULL;
1553 WheelingWindow = NULL;
1554 WheelingWindowTimer = 0.0f;
1556 HoveredId = HoveredIdPreviousFrame = 0;
1557 HoveredIdAllowOverlap =
false;
1558 HoveredIdUsingMouseWheel = HoveredIdPreviousFrameUsingMouseWheel =
false;
1559 HoveredIdDisabled =
false;
1560 HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
1562 ActiveIdIsAlive = 0;
1563 ActiveIdTimer = 0.0f;
1564 ActiveIdIsJustActivated =
false;
1565 ActiveIdAllowOverlap =
false;
1566 ActiveIdNoClearOnFocusLoss =
false;
1567 ActiveIdHasBeenPressedBefore =
false;
1568 ActiveIdHasBeenEditedBefore =
false;
1569 ActiveIdHasBeenEditedThisFrame =
false;
1570 ActiveIdUsingMouseWheel =
false;
1571 ActiveIdUsingNavDirMask = 0x00;
1572 ActiveIdUsingNavInputMask = 0x00;
1573 ActiveIdUsingKeyInputMask = 0x00;
1574 ActiveIdClickOffset =
ImVec2(-1, -1);
1575 ActiveIdWindow = NULL;
1576 ActiveIdSource = ImGuiInputSource_None;
1577 ActiveIdMouseButton = -1;
1578 ActiveIdPreviousFrame = 0;
1579 ActiveIdPreviousFrameIsAlive =
false;
1580 ActiveIdPreviousFrameHasBeenEditedBefore =
false;
1581 ActiveIdPreviousFrameWindow = NULL;
1583 LastActiveIdTimer = 0.0f;
1586 NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavInputId = 0;
1587 NavJustTabbedId = NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
1588 NavJustMovedToKeyMods = ImGuiKeyModFlags_None;
1589 NavInputSource = ImGuiInputSource_None;
1590 NavScoringRect =
ImRect();
1591 NavScoringCount = 0;
1592 NavLayer = ImGuiNavLayer_Main;
1593 NavIdTabCounter = INT_MAX;
1594 NavIdIsAlive =
false;
1595 NavMousePosDirty =
false;
1596 NavDisableHighlight =
true;
1597 NavDisableMouseHover =
false;
1598 NavAnyRequest =
false;
1599 NavInitRequest =
false;
1600 NavInitRequestFromMove =
false;
1601 NavInitResultId = 0;
1602 NavMoveRequest =
false;
1603 NavMoveRequestFlags = ImGuiNavMoveFlags_None;
1604 NavMoveRequestForward = ImGuiNavForward_None;
1605 NavMoveRequestKeyMods = ImGuiKeyModFlags_None;
1606 NavMoveDir = NavMoveDirLast = NavMoveClipDir = ImGuiDir_None;
1607 NavWrapRequestWindow = NULL;
1608 NavWrapRequestFlags = ImGuiNavMoveFlags_None;
1610 NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
1611 NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
1612 NavWindowingToggleLayer =
false;
1614 TabFocusRequestCurrWindow = TabFocusRequestNextWindow = NULL;
1615 TabFocusRequestCurrCounterRegular = TabFocusRequestCurrCounterTabStop = INT_MAX;
1616 TabFocusRequestNextCounterRegular = TabFocusRequestNextCounterTabStop = INT_MAX;
1617 TabFocusPressed =
false;
1620 MouseCursor = ImGuiMouseCursor_Arrow;
1622 DragDropActive = DragDropWithinSource = DragDropWithinTarget =
false;
1623 DragDropSourceFlags = ImGuiDragDropFlags_None;
1624 DragDropSourceFrameCount = -1;
1625 DragDropMouseButton = -1;
1626 DragDropTargetId = 0;
1627 DragDropAcceptFlags = ImGuiDragDropFlags_None;
1628 DragDropAcceptIdCurrRectSurface = 0.0f;
1629 DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
1630 DragDropAcceptFrameCount = -1;
1631 DragDropHoldJustPressedId = 0;
1632 memset(DragDropPayloadBufLocal, 0,
sizeof(DragDropPayloadBufLocal));
1634 CurrentTable = NULL;
1635 CurrentTabBar = NULL;
1637 LastValidMousePos =
ImVec2(0.0f, 0.0f);
1639 ColorEditOptions = ImGuiColorEditFlags__OptionsDefault;
1640 ColorEditLastHue = ColorEditLastSat = 0.0f;
1641 ColorEditLastColor[0] = ColorEditLastColor[1] = ColorEditLastColor[2] = FLT_MAX;
1642 SliderCurrentAccum = 0.0f;
1643 SliderCurrentAccumDirty =
false;
1644 DragCurrentAccumDirty =
false;
1645 DragCurrentAccum = 0.0f;
1646 DragSpeedDefaultRatio = 1.0f / 100.0f;
1647 ScrollbarClickDeltaToGrabCenter = 0.0f;
1648 TooltipOverrideCount = 0;
1649 TooltipSlowDelay = 0.50f;
1651 PlatformImePos = PlatformImeLastPos =
ImVec2(FLT_MAX, FLT_MAX);
1652 PlatformLocaleDecimalPoint =
'.';
1654 SettingsLoaded =
false;
1655 SettingsDirtyTimer = 0.0f;
1659 LogType = ImGuiLogType_None;
1660 LogNextPrefix = LogNextSuffix = NULL;
1662 LogLinePosY = FLT_MAX;
1663 LogLineFirstItem =
false;
1665 LogDepthToExpand = LogDepthToExpandDefault = 2;
1667 DebugItemPickerActive =
false;
1668 DebugItemPickerBreakId = 0;
1670 memset(FramerateSecPerFrame, 0,
sizeof(FramerateSecPerFrame));
1671 FramerateSecPerFrameIdx = 0;
1672 FramerateSecPerFrameAccum = 0.0f;
1673 WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
1674 memset(TempBuffer, 0,
sizeof(TempBuffer));
1689 ImVec2 CursorPosPrevLine;
1695 float CurrLineTextBaseOffset;
1696 float PrevLineTextBaseOffset;
1703 ImGuiItemStatusFlags LastItemStatusFlags;
1705 ImRect LastItemDisplayRect;
1708 ImGuiNavLayer NavLayerCurrent;
1709 int NavLayerActiveMask;
1710 int NavLayerActiveMaskNext;
1711 ImGuiID NavFocusScopeIdCurrent;
1712 bool NavHideHighlightOneFrame;
1716 bool MenuBarAppending;
1720 ImU32 TreeJumpToParentOnPopMask;
1724 int CurrentTableIdx;
1725 ImGuiLayoutType LayoutType;
1726 ImGuiLayoutType ParentLayoutType;
1727 int FocusCounterRegular;
1728 int FocusCounterTabStop;
1732 ImGuiItemFlags ItemFlags;
1745 ImGuiWindowFlags Flags;
1751 ImVec2 ContentSizeExplicit;
1753 float WindowRounding;
1754 float WindowBorderSize;
1761 ImVec2 ScrollTargetCenterRatio;
1762 ImVec2 ScrollTargetEdgeSnapDist;
1764 bool ScrollbarX, ScrollbarY;
1769 bool WantCollapseToggle;
1773 bool IsFallbackWindow;
1774 bool HasCloseButton;
1775 signed char ResizeBorderHeld;
1777 short BeginOrderWithinParent;
1778 short BeginOrderWithinContext;
1780 ImS8 AutoFitFramesX, AutoFitFramesY;
1781 ImS8 AutoFitChildAxises;
1782 bool AutoFitOnlyGrows;
1783 ImGuiDir AutoPosLastDirection;
1784 ImS8 HiddenFramesCanSkipItems;
1785 ImS8 HiddenFramesCannotSkipItems;
1786 ImS8 HiddenFramesForRenderOnly;
1787 ImGuiCond SetWindowPosAllowFlags : 8;
1788 ImGuiCond SetWindowSizeAllowFlags : 8;
1789 ImGuiCond SetWindowCollapsedAllowFlags : 8;
1791 ImVec2 SetWindowPosPivot;
1804 ImRect ContentRegionRect;
1808 int LastFrameActive;
1809 float LastTimeActive;
1810 float ItemWidthDefault;
1813 float FontWindowScale;
1824 ImGuiID NavLastIds[ImGuiNavLayer_COUNT];
1825 ImRect NavRectRel[ImGuiNavLayer_COUNT];
1827 int MemoryDrawListIdxCapacity;
1828 int MemoryDrawListVtxCapacity;
1829 bool MemoryCompacted;
1835 ImGuiID GetID(
const char* str,
const char* str_end = NULL);
1836 ImGuiID GetID(
const void* ptr);
1837 ImGuiID GetID(
int n);
1838 ImGuiID GetIDNoKeepAlive(
const char* str,
const char* str_end = NULL);
1839 ImGuiID GetIDNoKeepAlive(
const void* ptr);
1840 ImGuiID GetIDNoKeepAlive(
int n);
1841 ImGuiID GetIDFromRectangle(
const ImRect& r_abs);
1844 ImRect Rect()
const {
return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
1845 float CalcFontSize()
const {
ImGuiContext& g = *GImGui;
float scale = g.FontBaseSize * FontWindowScale;
if (ParentWindow) scale *= ParentWindow->FontWindowScale;
return scale; }
1846 float TitleBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
1847 ImRect TitleBarRect()
const {
return ImRect(Pos,
ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
1848 float MenuBarHeight()
const {
ImGuiContext& g = *GImGui;
return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
1849 ImRect MenuBarRect()
const {
float y1 = Pos.y + TitleBarHeight();
return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
1856 ImGuiItemStatusFlags LastItemStatusFlags;
1858 ImRect LastItemDisplayRect;
1861 void Backup() {
ImGuiWindow* window = GImGui->CurrentWindow; LastItemId = window->DC.LastItemId; LastItemStatusFlags = window->DC.LastItemStatusFlags; LastItemRect = window->DC.LastItemRect; LastItemDisplayRect = window->DC.LastItemDisplayRect; }
1862 void Restore()
const {
ImGuiWindow* window = GImGui->CurrentWindow; window->DC.LastItemId = LastItemId; window->DC.LastItemStatusFlags = LastItemStatusFlags; window->DC.LastItemRect = LastItemRect; window->DC.LastItemDisplayRect = LastItemDisplayRect; }
1870 enum ImGuiTabBarFlagsPrivate_
1872 ImGuiTabBarFlags_DockNode = 1 << 20,
1873 ImGuiTabBarFlags_IsFocused = 1 << 21,
1874 ImGuiTabBarFlags_SaveSettings = 1 << 22
1878 enum ImGuiTabItemFlagsPrivate_
1880 ImGuiTabItemFlags_NoCloseButton = 1 << 20,
1881 ImGuiTabItemFlags_Button = 1 << 21
1888 ImGuiTabItemFlags Flags;
1889 int LastFrameVisible;
1890 int LastFrameSelected;
1896 ImS16 IndexDuringLayout;
1899 ImGuiTabItem() { memset(
this, 0,
sizeof(*
this)); LastFrameVisible = LastFrameSelected = -1; NameOffset = BeginOrder = IndexDuringLayout = -1; }
1906 ImGuiTabBarFlags Flags;
1908 ImGuiID SelectedTabId;
1909 ImGuiID NextSelectedTabId;
1910 ImGuiID VisibleTabId;
1911 int CurrFrameVisible;
1912 int PrevFrameVisible;
1914 float CurrTabsContentsHeight;
1915 float PrevTabsContentsHeight;
1917 float WidthAllTabsIdeal;
1918 float ScrollingAnim;
1919 float ScrollingTarget;
1920 float ScrollingTargetDistToVisibility;
1921 float ScrollingSpeed;
1922 float ScrollingRectMinX;
1923 float ScrollingRectMaxX;
1924 ImGuiID ReorderRequestTabId;
1925 ImS8 ReorderRequestDir;
1928 bool VisibleTabWasSubmitted;
1930 ImS16 TabsActiveCount;
1931 ImS16 LastTabItemIdx;
1938 int GetTabOrder(
const ImGuiTabItem* tab)
const {
return Tabs.index_from_ptr(tab); }
1941 IM_ASSERT(tab->NameOffset != -1 && (
int)tab->NameOffset < TabsNames.Buf.Size);
1942 return TabsNames.Buf.Data + tab->NameOffset;
1950 #ifdef IMGUI_HAS_TABLE 1952 #define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color. 1953 #define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64. 1954 #define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels() 1957 typedef ImS8 ImGuiTableColumnIdx;
1958 typedef ImU8 ImGuiTableDrawChannelIdx;
1964 struct ImGuiTableColumn
1966 ImGuiTableColumnFlags Flags;
1972 float StretchWeight;
1973 float InitStretchWeightOrWidth;
1979 float ContentMaxXFrozen;
1980 float ContentMaxXUnfrozen;
1981 float ContentMaxXHeadersUsed;
1982 float ContentMaxXHeadersIdeal;
1984 ImGuiTableColumnIdx DisplayOrder;
1985 ImGuiTableColumnIdx IndexWithinEnabledSet;
1986 ImGuiTableColumnIdx PrevEnabledColumn;
1987 ImGuiTableColumnIdx NextEnabledColumn;
1988 ImGuiTableColumnIdx SortOrder;
1989 ImGuiTableDrawChannelIdx DrawChannelCurrent;
1990 ImGuiTableDrawChannelIdx DrawChannelFrozen;
1991 ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
1993 bool IsEnabledNextFrame;
1996 bool IsRequestOutput;
1998 bool IsPreserveWidthAuto;
1999 ImS8 NavLayerCurrent;
2001 ImU8 CannotSkipItemsQueue;
2002 ImU8 SortDirection : 2;
2003 ImU8 SortDirectionsAvailCount : 2;
2004 ImU8 SortDirectionsAvailMask : 4;
2005 ImU8 SortDirectionsAvailList;
2009 memset(
this, 0,
sizeof(*
this));
2010 StretchWeight = WidthRequest = -1.0f;
2012 DisplayOrder = IndexWithinEnabledSet = -1;
2013 PrevEnabledColumn = NextEnabledColumn = -1;
2015 SortDirection = ImGuiSortDirection_None;
2016 DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
2022 struct ImGuiTableCellData
2025 ImGuiTableColumnIdx Column;
2032 ImGuiTableFlags Flags;
2037 ImU64 EnabledMaskByDisplayOrder;
2038 ImU64 EnabledMaskByIndex;
2039 ImU64 VisibleMaskByIndex;
2040 ImU64 RequestOutputMaskByIndex;
2041 ImGuiTableFlags SettingsLoadedFlags;
2043 int LastFrameActive;
2047 ImS16 InstanceCurrent;
2048 ImS16 InstanceInteracted;
2052 float RowTextBaseline;
2053 float RowIndentOffsetX;
2054 ImGuiTableRowFlags RowFlags : 16;
2055 ImGuiTableRowFlags LastRowFlags : 16;
2056 int RowBgColorCounter;
2057 ImU32 RowBgColor[2];
2058 ImU32 BorderColorStrong;
2059 ImU32 BorderColorLight;
2063 float MinColumnWidth;
2064 float OuterPaddingX;
2067 float CellSpacingX1;
2068 float CellSpacingX2;
2069 float LastOuterHeight;
2070 float LastFirstRowHeight;
2072 float ColumnsGivenWidth;
2073 float ColumnsAutoFitWidth;
2074 float ResizedColumnNextWidth;
2075 float ResizeLockMinContentsX2;
2082 ImRect Bg0ClipRectForDrawCmd;
2083 ImRect Bg2ClipRectForDrawCmd;
2085 ImRect HostBackupWorkRect;
2086 ImRect HostBackupParentWorkRect;
2087 ImRect HostBackupInnerClipRect;
2088 ImVec2 HostBackupPrevLineSize;
2089 ImVec2 HostBackupCurrLineSize;
2090 ImVec2 HostBackupCursorMaxPos;
2092 ImVec1 HostBackupColumnsOffset;
2093 float HostBackupItemWidth;
2094 int HostBackupItemWidthStackSize;
2102 ImGuiTableColumnIdx SortSpecsCount;
2103 ImGuiTableColumnIdx ColumnsEnabledCount;
2104 ImGuiTableColumnIdx ColumnsEnabledFixedCount;
2105 ImGuiTableColumnIdx DeclColumnsCount;
2106 ImGuiTableColumnIdx HoveredColumnBody;
2107 ImGuiTableColumnIdx HoveredColumnBorder;
2108 ImGuiTableColumnIdx AutoFitSingleColumn;
2109 ImGuiTableColumnIdx ResizedColumn;
2110 ImGuiTableColumnIdx LastResizedColumn;
2111 ImGuiTableColumnIdx HeldHeaderColumn;
2112 ImGuiTableColumnIdx ReorderColumn;
2113 ImGuiTableColumnIdx ReorderColumnDir;
2114 ImGuiTableColumnIdx LeftMostEnabledColumn;
2115 ImGuiTableColumnIdx RightMostEnabledColumn;
2116 ImGuiTableColumnIdx LeftMostStretchedColumn;
2117 ImGuiTableColumnIdx RightMostStretchedColumn;
2118 ImGuiTableColumnIdx ContextPopupColumn;
2119 ImGuiTableColumnIdx FreezeRowsRequest;
2120 ImGuiTableColumnIdx FreezeRowsCount;
2121 ImGuiTableColumnIdx FreezeColumnsRequest;
2122 ImGuiTableColumnIdx FreezeColumnsCount;
2123 ImGuiTableColumnIdx RowCellDataCurrent;
2124 ImGuiTableDrawChannelIdx DummyDrawChannel;
2125 ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
2126 ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
2127 bool IsLayoutLocked;
2129 bool IsInitializing;
2130 bool IsSortSpecsDirty;
2131 bool IsUsingHeaders;
2132 bool IsContextPopupOpen;
2133 bool IsSettingsRequestLoad;
2134 bool IsSettingsDirty;
2135 bool IsDefaultDisplayOrder;
2136 bool IsResetAllRequest;
2137 bool IsResetDisplayOrderRequest;
2138 bool IsUnfrozenRows;
2139 bool IsDefaultSizingPolicy;
2140 bool MemoryCompacted;
2143 IMGUI_API ImGuiTable() { memset(
this, 0,
sizeof(*
this)); LastFrameActive = -1; }
2144 IMGUI_API ~ImGuiTable() { IM_FREE(RawData); }
2148 struct ImGuiTableColumnSettings
2150 float WidthOrWeight;
2152 ImGuiTableColumnIdx Index;
2153 ImGuiTableColumnIdx DisplayOrder;
2154 ImGuiTableColumnIdx SortOrder;
2155 ImU8 SortDirection : 2;
2159 ImGuiTableColumnSettings()
2161 WidthOrWeight = 0.0f;
2164 DisplayOrder = SortOrder = -1;
2165 SortDirection = ImGuiSortDirection_None;
2172 struct ImGuiTableSettings
2175 ImGuiTableFlags SaveFlags;
2177 ImGuiTableColumnIdx ColumnsCount;
2178 ImGuiTableColumnIdx ColumnsCountMax;
2181 ImGuiTableSettings() { memset(
this, 0,
sizeof(*
this)); }
2182 ImGuiTableColumnSettings* GetColumnSettings() {
return (ImGuiTableColumnSettings*)(
this + 1); }
2185 #endif // #ifdef IMGUI_HAS_TABLE 2200 inline ImGuiWindow* GetCurrentWindow() {
ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed =
true;
return g.CurrentWindow; }
2201 IMGUI_API
ImGuiWindow* FindWindowByID(ImGuiID
id);
2202 IMGUI_API
ImGuiWindow* FindWindowByName(
const char* name);
2203 IMGUI_API
void UpdateWindowParentAndRootLinks(
ImGuiWindow* window, ImGuiWindowFlags flags,
ImGuiWindow* parent_window);
2207 IMGUI_API
bool IsWindowNavFocusable(
ImGuiWindow* window);
2209 IMGUI_API
void SetWindowPos(
ImGuiWindow* window,
const ImVec2& pos, ImGuiCond cond = 0);
2210 IMGUI_API
void SetWindowSize(
ImGuiWindow* window,
const ImVec2& size, ImGuiCond cond = 0);
2211 IMGUI_API
void SetWindowCollapsed(
ImGuiWindow* window,
bool collapsed, ImGuiCond cond = 0);
2217 IMGUI_API
void BringWindowToFocusFront(
ImGuiWindow* window);
2218 IMGUI_API
void BringWindowToDisplayFront(
ImGuiWindow* window);
2219 IMGUI_API
void BringWindowToDisplayBack(
ImGuiWindow* window);
2222 IMGUI_API
void SetCurrentFont(
ImFont* font);
2223 inline ImFont* GetDefaultFont() {
ImGuiContext& g = *GImGui;
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
2224 inline ImDrawList* GetForegroundDrawList(
ImGuiWindow* window) { IM_UNUSED(window);
return GetForegroundDrawList(); }
2233 IMGUI_API
void UpdateHoveredWindowAndCaptureFlags();
2234 IMGUI_API
void StartMouseMovingWindow(
ImGuiWindow* window);
2235 IMGUI_API
void UpdateMouseMovingWindowNewFrame();
2236 IMGUI_API
void UpdateMouseMovingWindowEndFrame();
2240 IMGUI_API
void RemoveContextHook(
ImGuiContext* context, ImGuiID hook_to_remove);
2241 IMGUI_API
void CallContextHooks(
ImGuiContext* context, ImGuiContextHookType type);
2244 IMGUI_API
void MarkIniSettingsDirty();
2245 IMGUI_API
void MarkIniSettingsDirty(
ImGuiWindow* window);
2246 IMGUI_API
void ClearIniSettings();
2253 IMGUI_API
void SetNextWindowScroll(
const ImVec2& scroll);
2254 IMGUI_API
void SetScrollX(
ImGuiWindow* window,
float scroll_x);
2255 IMGUI_API
void SetScrollY(
ImGuiWindow* window,
float scroll_y);
2256 IMGUI_API
void SetScrollFromPosX(
ImGuiWindow* window,
float local_x,
float center_x_ratio);
2257 IMGUI_API
void SetScrollFromPosY(
ImGuiWindow* window,
float local_y,
float center_y_ratio);
2261 inline ImGuiID GetItemID() {
ImGuiContext& g = *GImGui;
return g.CurrentWindow->DC.LastItemId; }
2262 inline ImGuiItemStatusFlags GetItemStatusFlags() {
ImGuiContext& g = *GImGui;
return g.CurrentWindow->DC.LastItemStatusFlags; }
2263 inline ImGuiID GetActiveID() {
ImGuiContext& g = *GImGui;
return g.ActiveId; }
2264 inline ImGuiID GetFocusID() {
ImGuiContext& g = *GImGui;
return g.NavId; }
2265 inline ImGuiItemFlags GetItemsFlags() {
ImGuiContext& g = *GImGui;
return g.CurrentWindow->DC.ItemFlags; }
2266 IMGUI_API
void SetActiveID(ImGuiID
id,
ImGuiWindow* window);
2267 IMGUI_API
void SetFocusID(ImGuiID
id,
ImGuiWindow* window);
2268 IMGUI_API
void ClearActiveID();
2269 IMGUI_API ImGuiID GetHoveredID();
2270 IMGUI_API
void SetHoveredID(ImGuiID
id);
2271 IMGUI_API
void KeepAliveID(ImGuiID
id);
2272 IMGUI_API
void MarkItemEdited(ImGuiID
id);
2273 IMGUI_API
void PushOverrideID(ImGuiID
id);
2274 IMGUI_API ImGuiID GetIDWithSeed(
const char* str_id_begin,
const char* str_id_end, ImGuiID seed);
2277 IMGUI_API
void ItemSize(
const ImVec2& size,
float text_baseline_y = -1.0f);
2278 IMGUI_API
void ItemSize(
const ImRect& bb,
float text_baseline_y = -1.0f);
2279 IMGUI_API
bool ItemAdd(
const ImRect& bb, ImGuiID
id,
const ImRect* nav_bb = NULL);
2280 IMGUI_API
bool ItemHoverable(
const ImRect& bb, ImGuiID
id);
2281 IMGUI_API
bool IsClippedEx(
const ImRect& bb, ImGuiID
id,
bool clip_even_when_logged);
2282 IMGUI_API
void SetLastItemData(
ImGuiWindow* window, ImGuiID item_id, ImGuiItemStatusFlags status_flags,
const ImRect& item_rect);
2283 IMGUI_API
bool FocusableItemRegister(
ImGuiWindow* window, ImGuiID
id);
2284 IMGUI_API
void FocusableItemUnregister(
ImGuiWindow* window);
2285 IMGUI_API
ImVec2 CalcItemSize(
ImVec2 size,
float default_w,
float default_h);
2286 IMGUI_API
float CalcWrapWidthForPos(
const ImVec2& pos,
float wrap_pos_x);
2287 IMGUI_API
void PushMultiItemsWidths(
int components,
float width_full);
2288 IMGUI_API
void PushItemFlag(ImGuiItemFlags option,
bool enabled);
2289 IMGUI_API
void PopItemFlag();
2290 IMGUI_API
bool IsItemToggledSelection();
2291 IMGUI_API
ImVec2 GetContentRegionMaxAbs();
2295 IMGUI_API
void LogBegin(ImGuiLogType type,
int auto_open_depth);
2296 IMGUI_API
void LogToBuffer(
int auto_open_depth = -1);
2297 IMGUI_API
void LogRenderedText(
const ImVec2* ref_pos,
const char* text,
const char* text_end = NULL);
2298 IMGUI_API
void LogSetNextTextDecoration(
const char* prefix,
const char* suffix);
2301 IMGUI_API
bool BeginChildEx(
const char* name, ImGuiID
id,
const ImVec2& size_arg,
bool border, ImGuiWindowFlags flags);
2302 IMGUI_API
void OpenPopupEx(ImGuiID
id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
2303 IMGUI_API
void ClosePopupToLevel(
int remaining,
bool restore_focus_to_window_under_popup);
2304 IMGUI_API
void ClosePopupsOverWindow(
ImGuiWindow* ref_window,
bool restore_focus_to_window_under_popup);
2305 IMGUI_API
bool IsPopupOpen(ImGuiID
id, ImGuiPopupFlags popup_flags);
2306 IMGUI_API
bool BeginPopupEx(ImGuiID
id, ImGuiWindowFlags extra_flags);
2307 IMGUI_API
void BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags);
2310 IMGUI_API
ImVec2 FindBestWindowPosForPopupEx(
const ImVec2& ref_pos,
const ImVec2& size, ImGuiDir* last_dir,
const ImRect& r_outer,
const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
2313 IMGUI_API
void NavInitWindow(
ImGuiWindow* window,
bool force_reinit);
2314 IMGUI_API
bool NavMoveRequestButNoResultYet();
2315 IMGUI_API
void NavMoveRequestCancel();
2316 IMGUI_API
void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir,
const ImRect& bb_rel, ImGuiNavMoveFlags move_flags);
2317 IMGUI_API
void NavMoveRequestTryWrapping(
ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
2318 IMGUI_API
float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode);
2319 IMGUI_API
ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode,
float slow_factor = 0.0f,
float fast_factor = 0.0f);
2320 IMGUI_API
int CalcTypematicRepeatAmount(
float t0,
float t1,
float repeat_delay,
float repeat_rate);
2321 IMGUI_API
void ActivateItem(ImGuiID
id);
2322 IMGUI_API
void SetNavID(ImGuiID
id,
int nav_layer, ImGuiID focus_scope_id,
const ImRect& rect_rel);
2327 IMGUI_API
void PushFocusScope(ImGuiID
id);
2328 IMGUI_API
void PopFocusScope();
2329 inline ImGuiID GetFocusedFocusScope() {
ImGuiContext& g = *GImGui;
return g.NavFocusScopeId; }
2330 inline ImGuiID GetFocusScope() {
ImGuiContext& g = *GImGui;
return g.CurrentWindow->DC.NavFocusScopeIdCurrent; }
2334 IMGUI_API
void SetItemUsingMouseWheel();
2335 inline bool IsActiveIdUsingNavDir(ImGuiDir dir) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
2336 inline bool IsActiveIdUsingNavInput(ImGuiNavInput input) {
ImGuiContext& g = *GImGui;
return (g.ActiveIdUsingNavInputMask & (1 << input)) != 0; }
2337 inline bool IsActiveIdUsingKey(ImGuiKey key) {
ImGuiContext& g = *GImGui; IM_ASSERT(key < 64);
return (g.ActiveIdUsingKeyInputMask & ((ImU64)1 << key)) != 0; }
2338 IMGUI_API
bool IsMouseDragPastThreshold(ImGuiMouseButton button,
float lock_threshold = -1.0f);
2339 inline bool IsKeyPressedMap(ImGuiKey key,
bool repeat =
true) {
ImGuiContext& g = *GImGui;
const int key_index = g.IO.KeyMap[key];
return (key_index >= 0) ? IsKeyPressed(key_index, repeat) :
false; }
2340 inline bool IsNavInputDown(ImGuiNavInput n) {
ImGuiContext& g = *GImGui;
return g.IO.NavInputs[n] > 0.0f; }
2341 inline bool IsNavInputTest(ImGuiNavInput n, ImGuiInputReadMode rm) {
return (GetNavInputAmount(n, rm) > 0.0f); }
2342 IMGUI_API ImGuiKeyModFlags GetMergedKeyModFlags();
2345 IMGUI_API
bool BeginDragDropTargetCustom(
const ImRect& bb, ImGuiID
id);
2346 IMGUI_API
void ClearDragDrop();
2347 IMGUI_API
bool IsDragDropPayloadBeingAccepted();
2350 IMGUI_API
void SetWindowClipRectBeforeSetChannel(
ImGuiWindow* window,
const ImRect& clip_rect);
2351 IMGUI_API
void BeginColumns(
const char* str_id,
int count, ImGuiOldColumnFlags flags = 0);
2352 IMGUI_API
void EndColumns();
2353 IMGUI_API
void PushColumnClipRect(
int column_index);
2354 IMGUI_API
void PushColumnsBackground();
2355 IMGUI_API
void PopColumnsBackground();
2356 IMGUI_API ImGuiID GetColumnsID(
const char* str_id,
int count);
2358 IMGUI_API
float GetColumnOffsetFromNorm(
const ImGuiOldColumns* columns,
float offset_norm);
2359 IMGUI_API
float GetColumnNormFromOffset(
const ImGuiOldColumns* columns,
float offset);
2362 IMGUI_API
void TableOpenContextMenu(
int column_n = -1);
2363 IMGUI_API
void TableSetColumnEnabled(
int column_n,
bool enabled);
2364 IMGUI_API
void TableSetColumnWidth(
int column_n,
float width);
2365 IMGUI_API
void TableSetColumnSortDirection(
int column_n, ImGuiSortDirection sort_direction,
bool append_to_sort_specs);
2366 IMGUI_API
int TableGetHoveredColumn();
2367 IMGUI_API
float TableGetHeaderRowHeight();
2368 IMGUI_API
void TablePushBackgroundChannel();
2369 IMGUI_API
void TablePopBackgroundChannel();
2372 inline ImGuiTable* GetCurrentTable() {
ImGuiContext& g = *GImGui;
return g.CurrentTable; }
2373 IMGUI_API ImGuiTable* TableFindByID(ImGuiID
id);
2374 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);
2375 IMGUI_API
void TableBeginInitMemory(ImGuiTable* table,
int columns_count);
2376 IMGUI_API
void TableBeginApplyRequests(ImGuiTable* table);
2377 IMGUI_API
void TableSetupDrawChannels(ImGuiTable* table);
2378 IMGUI_API
void TableUpdateLayout(ImGuiTable* table);
2379 IMGUI_API
void TableUpdateBorders(ImGuiTable* table);
2380 IMGUI_API
void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
2381 IMGUI_API
void TableDrawBorders(ImGuiTable* table);
2382 IMGUI_API
void TableDrawContextMenu(ImGuiTable* table);
2383 IMGUI_API
void TableMergeDrawChannels(ImGuiTable* table);
2384 IMGUI_API
void TableSortSpecsSanitize(ImGuiTable* table);
2385 IMGUI_API
void TableSortSpecsBuild(ImGuiTable* table);
2386 IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
2387 IMGUI_API
void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);
2388 IMGUI_API
float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);
2389 IMGUI_API
void TableBeginRow(ImGuiTable* table);
2390 IMGUI_API
void TableEndRow(ImGuiTable* table);
2391 IMGUI_API
void TableBeginCell(ImGuiTable* table,
int column_n);
2392 IMGUI_API
void TableEndCell(ImGuiTable* table);
2393 IMGUI_API
ImRect TableGetCellBgRect(
const ImGuiTable* table,
int column_n);
2394 IMGUI_API
const char* TableGetColumnName(
const ImGuiTable* table,
int column_n);
2395 IMGUI_API ImGuiID TableGetColumnResizeID(
const ImGuiTable* table,
int column_n,
int instance_no = 0);
2396 IMGUI_API
float TableGetMaxColumnWidth(
const ImGuiTable* table,
int column_n);
2397 IMGUI_API
void TableSetColumnWidthAutoSingle(ImGuiTable* table,
int column_n);
2398 IMGUI_API
void TableSetColumnWidthAutoAll(ImGuiTable* table);
2399 IMGUI_API
void TableRemove(ImGuiTable* table);
2400 IMGUI_API
void TableGcCompactTransientBuffers(ImGuiTable* table);
2401 IMGUI_API
void TableGcCompactSettings();
2404 IMGUI_API
void TableLoadSettings(ImGuiTable* table);
2405 IMGUI_API
void TableSaveSettings(ImGuiTable* table);
2406 IMGUI_API
void TableResetSettings(ImGuiTable* table);
2407 IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
2408 IMGUI_API
void TableSettingsInstallHandler(
ImGuiContext* context);
2409 IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID
id,
int columns_count);
2410 IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID
id);
2413 IMGUI_API
bool BeginTabBarEx(
ImGuiTabBar* tab_bar,
const ImRect& bb, ImGuiTabBarFlags flags);
2415 IMGUI_API
void TabBarRemoveTab(
ImGuiTabBar* tab_bar, ImGuiID tab_id);
2418 IMGUI_API
bool TabBarProcessReorder(
ImGuiTabBar* tab_bar);
2419 IMGUI_API
bool TabItemEx(
ImGuiTabBar* tab_bar,
const char* label,
bool* p_open, ImGuiTabItemFlags flags);
2420 IMGUI_API
ImVec2 TabItemCalcSize(
const char* label,
bool has_close_button);
2421 IMGUI_API
void TabItemBackground(
ImDrawList* draw_list,
const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
2422 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);
2427 IMGUI_API
void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
2428 IMGUI_API
void RenderTextWrapped(
ImVec2 pos,
const char* text,
const char* text_end,
float wrap_width);
2429 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);
2430 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);
2431 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);
2432 IMGUI_API
void RenderFrame(
ImVec2 p_min,
ImVec2 p_max, ImU32 fill_col,
bool border =
true,
float rounding = 0.0f);
2433 IMGUI_API
void RenderFrameBorder(
ImVec2 p_min,
ImVec2 p_max,
float rounding = 0.0f);
2434 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);
2435 IMGUI_API
void RenderNavHighlight(
const ImRect& bb, ImGuiID
id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault);
2436 IMGUI_API
const char* FindRenderedTextEnd(
const char* text,
const char* text_end = NULL);
2439 IMGUI_API
void RenderArrow(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col, ImGuiDir dir,
float scale = 1.0f);
2441 IMGUI_API
void RenderCheckMark(
ImDrawList* draw_list,
ImVec2 pos, ImU32 col,
float sz);
2442 IMGUI_API
void RenderMouseCursor(
ImDrawList* draw_list,
ImVec2 pos,
float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
2443 IMGUI_API
void RenderArrowPointingAt(
ImDrawList* draw_list,
ImVec2 pos,
ImVec2 half_sz, ImGuiDir direction, ImU32 col);
2444 IMGUI_API
void RenderRectFilledRangeH(
ImDrawList* draw_list,
const ImRect& rect, ImU32 col,
float x_start_norm,
float x_end_norm,
float rounding);
2445 IMGUI_API
void RenderRectFilledWithHole(
ImDrawList* draw_list,
ImRect outer,
ImRect inner, ImU32 col,
float rounding);
2447 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 2449 inline void RenderArrow(
ImVec2 pos, ImGuiDir dir,
float scale=1.0f) {
ImGuiWindow* window = GetCurrentWindow(); RenderArrow(window->DrawList, pos, GetColorU32(ImGuiCol_Text), dir, scale); }
2450 inline void RenderBullet(
ImVec2 pos) {
ImGuiWindow* window = GetCurrentWindow(); RenderBullet(window->DrawList, pos, GetColorU32(ImGuiCol_Text)); }
2454 IMGUI_API
void TextEx(
const char* text,
const char* text_end = NULL, ImGuiTextFlags flags = 0);
2455 IMGUI_API
bool ButtonEx(
const char* label,
const ImVec2& size_arg =
ImVec2(0, 0), ImGuiButtonFlags flags = 0);
2456 IMGUI_API
bool CloseButton(ImGuiID
id,
const ImVec2& pos);
2457 IMGUI_API
bool CollapseButton(ImGuiID
id,
const ImVec2& pos);
2458 IMGUI_API
bool ArrowButtonEx(
const char* str_id, ImGuiDir dir,
ImVec2 size_arg, ImGuiButtonFlags flags = 0);
2459 IMGUI_API
void Scrollbar(ImGuiAxis axis);
2460 IMGUI_API
bool ScrollbarEx(
const ImRect& bb, ImGuiID
id, ImGuiAxis axis,
float* p_scroll_v,
float avail_v,
float contents_v, ImDrawFlags flags);
2461 IMGUI_API
bool ImageButtonEx(ImGuiID
id, ImTextureID texture_id,
const ImVec2& size,
const ImVec2& uv0,
const ImVec2& uv1,
const ImVec2& padding,
const ImVec4& bg_col,
const ImVec4& tint_col);
2463 IMGUI_API ImGuiID GetWindowScrollbarID(
ImGuiWindow* window, ImGuiAxis axis);
2464 IMGUI_API ImGuiID GetWindowResizeID(
ImGuiWindow* window,
int n);
2465 IMGUI_API
void SeparatorEx(ImGuiSeparatorFlags flags);
2466 IMGUI_API
bool CheckboxFlags(
const char* label, ImS64* flags, ImS64 flags_value);
2467 IMGUI_API
bool CheckboxFlags(
const char* label, ImU64* flags, ImU64 flags_value);
2470 IMGUI_API
bool ButtonBehavior(
const ImRect& bb, ImGuiID
id,
bool* out_hovered,
bool* out_held, ImGuiButtonFlags flags = 0);
2471 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);
2472 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);
2473 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);
2474 IMGUI_API
bool TreeNodeBehavior(ImGuiID
id, ImGuiTreeNodeFlags flags,
const char* label,
const char* label_end = NULL);
2475 IMGUI_API
bool TreeNodeBehaviorIsOpen(ImGuiID
id, ImGuiTreeNodeFlags flags = 0);
2476 IMGUI_API
void TreePushOverrideID(ImGuiID
id);
2481 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);
2482 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);
2483 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);
2484 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);
2485 template<
typename T,
typename SIGNED_T> IMGUI_API T RoundScalarWithFormatT(
const char* format, ImGuiDataType data_type, T v);
2486 template<
typename T> IMGUI_API
bool CheckboxFlagsT(
const char* label, T* flags, T flags_value);
2490 IMGUI_API
int DataTypeFormatString(
char* buf,
int buf_size, ImGuiDataType data_type,
const void* p_data,
const char* format);
2491 IMGUI_API
void DataTypeApplyOp(ImGuiDataType data_type,
int op,
void* output,
const void* arg_1,
const void* arg_2);
2492 IMGUI_API
bool DataTypeApplyOpFromText(
const char* buf,
const char* initial_value_buf, ImGuiDataType data_type,
void* p_data,
const char* format);
2493 IMGUI_API
int DataTypeCompare(ImGuiDataType data_type,
const void* arg_1,
const void* arg_2);
2494 IMGUI_API
bool DataTypeClamp(ImGuiDataType data_type,
void* p_data,
const void* p_min,
const void* p_max);
2497 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);
2498 IMGUI_API
bool TempInputText(
const ImRect& bb, ImGuiID
id,
const char* label,
char* buf,
int buf_size, ImGuiInputTextFlags flags);
2499 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);
2500 inline bool TempInputIsActive(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.ActiveId ==
id && g.TempInputId ==
id); }
2501 inline ImGuiInputTextState* GetInputTextState(ImGuiID
id) {
ImGuiContext& g = *GImGui;
return (g.InputTextState.ID ==
id) ? &g.InputTextState : NULL; }
2504 IMGUI_API
void ColorTooltip(
const char* text,
const float* col, ImGuiColorEditFlags flags);
2505 IMGUI_API
void ColorEditOptionsPopup(
const float* col, ImGuiColorEditFlags flags);
2506 IMGUI_API
void ColorPickerOptionsPopup(
const float* ref_col, ImGuiColorEditFlags flags);
2509 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,
ImVec2 frame_size);
2512 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);
2513 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);
2516 IMGUI_API
void GcCompactTransientMiscBuffers();
2517 IMGUI_API
void GcCompactTransientWindowBuffers(
ImGuiWindow* window);
2518 IMGUI_API
void GcAwakeTransientWindowBuffers(
ImGuiWindow* window);
2521 IMGUI_API
void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,
void* user_data = NULL);
2522 inline void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max, col); }
2523 inline void DebugStartItemPicker() {
ImGuiContext& g = *GImGui; g.DebugItemPickerActive =
true; }
2526 IMGUI_API
void DebugNodeDrawList(
ImGuiWindow* window,
const ImDrawList* draw_list,
const char* label);
2527 IMGUI_API
void DebugNodeDrawCmdShowMeshAndBoundingBox(
ImDrawList* out_draw_list,
const ImDrawList* draw_list,
const ImDrawCmd* draw_cmd,
bool show_mesh,
bool show_aabb);
2528 IMGUI_API
void DebugNodeStorage(
ImGuiStorage* storage,
const char* label);
2529 IMGUI_API
void DebugNodeTabBar(
ImGuiTabBar* tab_bar,
const char* label);
2530 IMGUI_API
void DebugNodeTable(ImGuiTable* table);
2531 IMGUI_API
void DebugNodeTableSettings(ImGuiTableSettings* settings);
2532 IMGUI_API
void DebugNodeWindow(
ImGuiWindow* window,
const char* label);
2552 IMGUI_API
const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
2553 IMGUI_API
void ImFontAtlasBuildInit(
ImFontAtlas* atlas);
2555 IMGUI_API
void ImFontAtlasBuildPackCustomRects(
ImFontAtlas* atlas,
void* stbrp_context_opaque);
2556 IMGUI_API
void ImFontAtlasBuildFinish(
ImFontAtlas* atlas);
2557 IMGUI_API
void ImFontAtlasBuildRender8bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned char in_marker_pixel_value);
2558 IMGUI_API
void ImFontAtlasBuildRender32bppRectFromString(
ImFontAtlas* atlas,
int x,
int y,
int w,
int h,
const char* in_str,
char in_marker_char,
unsigned int in_marker_pixel_value);
2559 IMGUI_API
void ImFontAtlasBuildMultiplyCalcLookupTable(
unsigned char out_table[256],
float in_multiply_factor);
2560 IMGUI_API
void ImFontAtlasBuildMultiplyRectAlpha8(
const unsigned char table[256],
unsigned char* pixels,
int x,
int y,
int w,
int h,
int stride);
2566 #ifdef IMGUI_ENABLE_TEST_ENGINE 2567 extern void ImGuiTestEngineHook_ItemAdd(
ImGuiContext* ctx,
const ImRect& bb, ImGuiID
id);
2568 extern void ImGuiTestEngineHook_ItemInfo(
ImGuiContext* ctx, ImGuiID
id,
const char* label, ImGuiItemStatusFlags flags);
2569 extern void ImGuiTestEngineHook_IdInfo(
ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID
id,
const void* data_id);
2570 extern void ImGuiTestEngineHook_IdInfo(
ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID
id,
const void* data_id,
const void* data_id_end);
2571 extern void ImGuiTestEngineHook_Log(
ImGuiContext* ctx,
const char* fmt, ...);
2572 #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box 2573 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) 2574 #define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log 2575 #define IMGUI_TEST_ENGINE_ID_INFO(_ID,_TYPE,_DATA) if (g.TestEngineHookIdInfo == id) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA)); 2576 #define IMGUI_TEST_ENGINE_ID_INFO2(_ID,_TYPE,_DATA,_DATA2) if (g.TestEngineHookIdInfo == id) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA), (const void*)(_DATA2)); 2578 #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) do { } while (0) 2579 #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) do { } while (0) 2580 #define IMGUI_TEST_ENGINE_LOG(_FMT,...) do { } while (0) 2581 #define IMGUI_TEST_ENGINE_ID_INFO(_ID,_TYPE,_DATA) do { } while (0) 2582 #define IMGUI_TEST_ENGINE_ID_INFO2(_ID,_TYPE,_DATA,_DATA2) do { } while (0) 2587 #if defined(__clang__) 2588 #pragma clang diagnostic pop 2589 #elif defined(__GNUC__) 2590 #pragma GCC diagnostic pop 2594 #pragma warning (pop) 2597 #endif // #ifndef IMGUI_DISABLE
Definition: imgui_internal.h:551
Definition: imgui_internal.h:1200
Definition: imgui_internal.h:601
Definition: imgui_internal.h:1231
Definition: imgui_internal.h:900
Definition: imgui_internal.h:428
Definition: imgui_internal.h:318
Definition: imgui_internal.h:1174
Definition: imgui_internal.h:521
Definition: imgui_internal.h:158
Definition: imgui_internal.h:1853
Definition: imgui_internal.h:1275
Definition: imgui_internal.h:1253
Definition: imgui_internal.h:894
Definition: imgui_internal.h:1741
Definition: imgui_internal.h:1212
Definition: imgui_internal.h:1069
Definition: imgui_internal.h:2546
Definition: imgui_internal.h:1903
Definition: imgui_internal.h:508
Definition: imgui_internal.h:494
Definition: imgui_internal.h:1685
Definition: imgui_internal.h:1121
Definition: imgui_internal.h:1012
Definition: imgui_internal.h:1885
Definition: imgui_internal.h:651
Definition: imgui_internal.h:924
Definition: imgui_internal.h:1131
Definition: imgui.cpp:889
Definition: imgui_internal.h:917
Definition: imgui_internal.h:1040
Definition: imgui_internal.h:574
Definition: imgui_internal.h:950
Definition: imgui_internal.h:934
Definition: imgui_internal.h:1087
Definition: imgui_internal.h:1081
Definition: imgui_internal.h:964
Definition: imgui_internal.h:438
Definition: imgui_internal.h:1290
Definition: imgui_internal.h:420
Definition: imgui_internal.h:671