920 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) 921 #define _CRT_SECURE_NO_WARNINGS 925 #ifndef IMGUI_DEFINE_MATH_OPERATORS 926 #define IMGUI_DEFINE_MATH_OPERATORS 932 #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier 939 #define IMGUI_DEBUG_NAV_SCORING 0 940 #define IMGUI_DEBUG_NAV_RECTS 0 944 #pragma warning (disable: 4127) // condition expression is constant 945 #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen 950 #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wformat-pedantic *' // not all warnings are known by all clang versions.. so ignoring warnings triggers new warnings on some configuration. great! 951 #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. 952 #pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok. 953 #pragma clang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code. 954 #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. 955 #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it. 956 #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // 957 #pragma clang diagnostic ignored "-Wformat-pedantic" // warning : format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic. 958 #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' 959 #elif defined(__GNUC__) 960 #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used 961 #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size 962 #pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*' 963 #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function 964 #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value 965 #pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked 966 #pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false 968 #pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead 1048 #ifndef IMGUI_DISABLE_DEFAULT_ALLOCATORS 1056 static void* (*GImAllocatorAllocFunc)(
size_t size,
void* user_data) =
MallocWrapper;
1067 WindowPadding =
ImVec2(8,8);
1068 WindowRounding = 7.0f;
1069 WindowBorderSize = 1.0f;
1070 WindowMinSize =
ImVec2(32,32);
1071 WindowTitleAlign =
ImVec2(0.0
f,0.5
f);
1072 ChildRounding = 0.0f;
1073 ChildBorderSize = 1.0f;
1074 PopupRounding = 0.0f;
1075 PopupBorderSize = 1.0f;
1076 FramePadding =
ImVec2(4,3);
1077 FrameRounding = 0.0f;
1078 FrameBorderSize = 0.0f;
1079 ItemSpacing =
ImVec2(8,4);
1080 ItemInnerSpacing =
ImVec2(4,4);
1081 TouchExtraPadding =
ImVec2(0,0);
1082 IndentSpacing = 21.0f;
1083 ColumnsMinSpacing = 6.0f;
1084 ScrollbarSize = 16.0f;
1085 ScrollbarRounding = 9.0f;
1086 GrabMinSize = 10.0f;
1087 GrabRounding = 0.0f;
1089 TabBorderSize = 0.0f;
1090 ButtonTextAlign =
ImVec2(0.5
f,0.5
f);
1091 DisplayWindowPadding =
ImVec2(19,19);
1092 DisplaySafeAreaPadding =
ImVec2(3,3);
1093 MouseCursorScale = 1.0f;
1094 AntiAliasedLines =
true;
1095 AntiAliasedFill =
true;
1096 CurveTessellationTol = 1.25f;
1106 WindowPadding =
ImFloor(WindowPadding * scale_factor);
1107 WindowRounding =
ImFloor(WindowRounding * scale_factor);
1108 WindowMinSize =
ImFloor(WindowMinSize * scale_factor);
1109 ChildRounding =
ImFloor(ChildRounding * scale_factor);
1110 PopupRounding =
ImFloor(PopupRounding * scale_factor);
1111 FramePadding =
ImFloor(FramePadding * scale_factor);
1112 FrameRounding =
ImFloor(FrameRounding * scale_factor);
1113 TabRounding =
ImFloor(TabRounding * scale_factor);
1114 ItemSpacing =
ImFloor(ItemSpacing * scale_factor);
1115 ItemInnerSpacing =
ImFloor(ItemInnerSpacing * scale_factor);
1116 TouchExtraPadding =
ImFloor(TouchExtraPadding * scale_factor);
1117 IndentSpacing =
ImFloor(IndentSpacing * scale_factor);
1118 ColumnsMinSpacing =
ImFloor(ColumnsMinSpacing * scale_factor);
1119 ScrollbarSize =
ImFloor(ScrollbarSize * scale_factor);
1120 ScrollbarRounding =
ImFloor(ScrollbarRounding * scale_factor);
1121 GrabMinSize =
ImFloor(GrabMinSize * scale_factor);
1122 GrabRounding =
ImFloor(GrabRounding * scale_factor);
1123 DisplayWindowPadding =
ImFloor(DisplayWindowPadding * scale_factor);
1124 DisplaySafeAreaPadding =
ImFloor(DisplaySafeAreaPadding * scale_factor);
1125 MouseCursorScale =
ImFloor(MouseCursorScale * scale_factor);
1131 memset(
this, 0,
sizeof(*
this));
1136 DisplaySize =
ImVec2(-1.0
f, -1.0
f);
1137 DeltaTime = 1.0f/60.0f;
1138 IniSavingRate = 5.0f;
1139 IniFilename =
"imgui.ini";
1140 LogFilename =
"imgui_log.txt";
1141 MouseDoubleClickTime = 0.30f;
1142 MouseDoubleClickMaxDist = 6.0f;
1145 KeyRepeatDelay = 0.250f;
1146 KeyRepeatRate = 0.050f;
1150 FontGlobalScale = 1.0f;
1152 FontAllowUserScaling =
false;
1153 DisplayFramebufferScale =
ImVec2(1.0
f, 1.0
f);
1154 DisplayVisibleMin = DisplayVisibleMax =
ImVec2(0.0
f, 0.0
f);
1158 ConfigMacOSXBehaviors =
true;
1160 ConfigMacOSXBehaviors =
false;
1162 ConfigInputTextCursorBlink =
true;
1163 ConfigWindowsResizeFromEdges =
true;
1164 ConfigWindowsMoveFromTitleBarOnly =
false;
1167 BackendPlatformName = BackendRendererName = NULL;
1168 BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL;
1171 ClipboardUserData = NULL;
1173 ImeWindowHandle = NULL;
1175 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1176 RenderDrawListsFn = NULL;
1180 MousePos =
ImVec2(-FLT_MAX, -FLT_MAX);
1181 MousePosPrev =
ImVec2(-FLT_MAX, -FLT_MAX);
1182 MouseDragThreshold = 6.0f;
1183 for (
int i = 0; i <
IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0
f;
1184 for (
int i = 0; i <
IM_ARRAYSIZE(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0
f;
1185 for (
int i = 0; i <
IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0
f;
1193 InputQueueCharacters.push_back(c);
1198 while (*utf8_chars != 0)
1202 if (c > 0 && c <= 0xFFFF)
1203 InputQueueCharacters.push_back((
ImWchar)c);
1209 InputQueueCharacters.resize(0);
1220 float dot = ap.
x * ab_dir.
x + ap.
y * ab_dir.
y;
1223 float ab_len_sqr = ab_dir.
x * ab_dir.
x + ab_dir.
y * ab_dir.
y;
1224 if (dot > ab_len_sqr)
1226 return a + ab_dir * dot / ab_len_sqr;
1231 bool b1 = ((p.
x - b.
x) * (a.
y - b.
y) - (p.
y - b.
y) * (a.
x - b.
x)) < 0.0
f;
1232 bool b2 = ((p.
x - c.
x) * (b.
y - c.
y) - (p.
y - c.
y) * (b.
x - c.
x)) < 0.0
f;
1233 bool b3 = ((p.
x - a.
x) * (c.
y - a.
y) - (p.
y - a.
y) * (c.
x - a.
x)) < 0.0
f;
1234 return ((b1 == b2) && (b2 == b3));
1242 const float denom = v0.
x * v1.
y - v1.
x * v0.
y;
1243 out_v = (v2.
x * v1.
y - v1.
x * v2.
y) / denom;
1244 out_w = (v0.
x * v2.
y - v2.
x * v0.
y) / denom;
1245 out_u = 1.0f - out_v - out_w;
1256 float m =
ImMin(dist2_ab,
ImMin(dist2_bc, dist2_ca));
1267 while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
1274 while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
1280 if (count < 1)
return;
1281 strncpy(dst, src, count);
1287 size_t len = strlen(str);
1289 return (
char*)memcpy(buf, (
const void*)str, len + 1);
1294 size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1;
1295 size_t src_size = strlen(src) + 1;
1296 if (dst_buf_size < src_size)
1301 *p_dst_size = src_size;
1303 return (
char*)memcpy(dst, (
const void*)src, src_size);
1308 const char* p = (
const char*)memchr(str, (
int)c, str_end - str);
1323 const char* p = (
const char*)memchr(str,
'\n', str_end - str);
1324 return p ? p : str_end;
1329 while (buf_mid_line > buf_begin && buf_mid_line[-1] !=
'\n')
1331 return buf_mid_line;
1334 const char*
ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end)
1337 needle_end = needle + strlen(needle);
1339 const char un0 = (char)toupper(*needle);
1340 while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
1342 if (toupper(*haystack) == un0)
1344 const char* b = needle + 1;
1345 for (
const char* a = haystack + 1; b < needle_end; a++, b++)
1346 if (toupper(*a) != toupper(*b))
1348 if (b == needle_end)
1360 while (p[0] ==
' ' || p[0] ==
'\t')
1365 while (p > p_start && (p[-1] ==
' ' || p[-1] ==
'\t'))
1368 memmove(buf, p_start, p - p_start);
1369 buf[p - p_start] = 0;
1375 #ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS 1378 #ifdef IMGUI_USE_STB_SPRINTF 1379 #define STB_SPRINTF_IMPLEMENTATION 1380 #include "imstb_sprintf.h" 1383 #if defined(_MSC_VER) && !defined(vsnprintf) 1384 #define vsnprintf _vsnprintf 1390 va_start(args, fmt);
1391 #ifdef IMGUI_USE_STB_SPRINTF 1392 int w = stbsp_vsnprintf(buf, (
int)buf_size, fmt, args);
1394 int w = vsnprintf(buf, buf_size, fmt, args);
1399 if (w == -1 || w >= (
int)buf_size)
1400 w = (int)buf_size - 1;
1407 #ifdef IMGUI_USE_STB_SPRINTF 1408 int w = stbsp_vsnprintf(buf, (
int)buf_size, fmt, args);
1410 int w = vsnprintf(buf, buf_size, fmt, args);
1414 if (w == -1 || w >= (
int)buf_size)
1415 w = (int)buf_size - 1;
1419 #endif // #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS 1427 static ImU32 crc32_lut[256] = { 0 };
1430 const ImU32 polynomial = 0xEDB88320;
1431 for (
ImU32 i = 0; i < 256; i++)
1434 for (
ImU32 j = 0; j < 8; j++)
1435 crc = (crc >> 1) ^ (
ImU32(-
int(crc & 1)) & polynomial);
1442 const unsigned char* current = (
const unsigned char*)data;
1448 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
1453 while (
unsigned char c = *current++)
1459 if (c ==
'#' && current[0] ==
'#' && current[1] ==
'#')
1461 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
1469 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__GNUC__) 1474 buf.
resize(filename_wsize + mode_wsize);
1477 return _wfopen((
wchar_t*)&buf[0], (
wchar_t*)&buf[filename_wsize]);
1479 return fopen(filename, mode);
1485 void*
ImFileLoadToMemory(
const char* filename,
const char* file_open_mode,
size_t* out_file_size,
int padding_bytes)
1492 if ((f =
ImFileOpen(filename, file_open_mode)) == NULL)
1495 long file_size_signed;
1496 if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET))
1502 size_t file_size = (size_t)file_size_signed;
1504 if (file_data == NULL)
1509 if (fread(file_data, 1, file_size, f) != file_size)
1515 if (padding_bytes > 0)
1516 memset((
void*)(((
char*)file_data) + file_size), 0, (
size_t)padding_bytes);
1520 *out_file_size = file_size;
1534 unsigned int c = (
unsigned int)-1;
1535 const unsigned char* str = (
const unsigned char*)in_text;
1538 c = (
unsigned int)(*str++);
1542 if ((*str & 0xe0) == 0xc0)
1545 if (in_text_end && in_text_end - (
const char*)str < 2)
return 1;
1546 if (*str < 0xc2)
return 2;
1547 c = (
unsigned int)((*str++ & 0x1f) << 6);
1548 if ((*str & 0xc0) != 0x80)
return 2;
1549 c += (*str++ & 0x3f);
1553 if ((*str & 0xf0) == 0xe0)
1556 if (in_text_end && in_text_end - (
const char*)str < 3)
return 1;
1557 if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf))
return 3;
1558 if (*str == 0xed && str[1] > 0x9f)
return 3;
1559 c = (
unsigned int)((*str++ & 0x0f) << 12);
1560 if ((*str & 0xc0) != 0x80)
return 3;
1561 c += (
unsigned int)((*str++ & 0x3f) << 6);
1562 if ((*str & 0xc0) != 0x80)
return 3;
1563 c += (*str++ & 0x3f);
1567 if ((*str & 0xf8) == 0xf0)
1570 if (in_text_end && in_text_end - (
const char*)str < 4)
return 1;
1571 if (*str > 0xf4)
return 4;
1572 if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf))
return 4;
1573 if (*str == 0xf4 && str[1] > 0x8f)
return 4;
1574 c = (
unsigned int)((*str++ & 0x07) << 18);
1575 if ((*str & 0xc0) != 0x80)
return 4;
1576 c += (
unsigned int)((*str++ & 0x3f) << 12);
1577 if ((*str & 0xc0) != 0x80)
return 4;
1578 c += (
unsigned int)((*str++ & 0x3f) << 6);
1579 if ((*str & 0xc0) != 0x80)
return 4;
1580 c += (*str++ & 0x3f);
1582 if ((c & 0xFFFFF800) == 0xD800)
return 4;
1593 ImWchar* buf_end = buf + buf_size;
1594 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
1604 if (in_text_remaining)
1605 *in_text_remaining = in_text;
1606 return (
int)(buf_out - buf);
1612 while ((!in_text_end || in_text < in_text_end) && *in_text)
1634 if (buf_size < 2)
return 0;
1635 buf[0] = (char)(0xc0 + (c >> 6));
1636 buf[1] = (char)(0x80 + (c & 0x3f));
1639 if (c >= 0xdc00 && c < 0xe000)
1643 if (c >= 0xd800 && c < 0xdc00)
1645 if (buf_size < 4)
return 0;
1646 buf[0] = (char)(0xf0 + (c >> 18));
1647 buf[1] = (char)(0x80 + ((c >> 12) & 0x3f));
1648 buf[2] = (char)(0x80 + ((c >> 6) & 0x3f));
1649 buf[3] = (char)(0x80 + ((c ) & 0x3f));
1654 if (buf_size < 3)
return 0;
1655 buf[0] = (char)(0xe0 + (c >> 12));
1656 buf[1] = (char)(0x80 + ((c>> 6) & 0x3f));
1657 buf[2] = (char)(0x80 + ((c ) & 0x3f));
1665 unsigned int dummy = 0;
1671 if (c < 0x80)
return 1;
1672 if (c < 0x800)
return 2;
1673 if (c >= 0xdc00 && c < 0xe000)
return 0;
1674 if (c >= 0xd800 && c < 0xdc00)
return 4;
1680 char* buf_out = buf;
1681 const char* buf_end = buf + buf_size;
1682 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
1684 unsigned int c = (
unsigned int)(*in_text++);
1686 *buf_out++ = (char)c;
1691 return (
int)(buf_out - buf);
1696 int bytes_count = 0;
1697 while ((!in_text_end || in_text < in_text_end) && *in_text)
1699 unsigned int c = (
unsigned int)(*in_text++);
1715 float s = 1.0f/255.0f;
1749 const float chroma = r - (g < b ? g : b);
1750 out_h =
ImFabs(K + (g - b) / (6.
f * chroma + 1e-20
f));
1751 out_s = chroma / (r + 1e-20
f);
1762 out_r = out_g = out_b = v;
1766 h =
ImFmod(h, 1.0
f) / (60.0f/360.0f);
1768 float f = h - (float)i;
1769 float p = v * (1.0f - s);
1770 float q = v * (1.0f - s * f);
1771 float t = v * (1.0f - s * (1.0f - f));
1775 case 0: out_r = v; out_g = t; out_b = p;
break;
1776 case 1: out_r = q; out_g = v; out_b = p;
break;
1777 case 2: out_r = p; out_g = v; out_b = t;
break;
1778 case 3: out_r = p; out_g = q; out_b = v;
break;
1779 case 4: out_r = t; out_g = p; out_b = v;
break;
1780 case 5:
default: out_r = v; out_g = p; out_b = q;
break;
1788 c.
w *= style.
Alpha * alpha_mul;
1803 return style.
Colors[idx];
1809 if (style_alpha >= 1.0
f)
1812 a = (
ImU32)(a * style_alpha);
1826 size_t count = (size_t)(last - first);
1829 size_t count2 = count >> 1;
1834 count -= count2 + 1;
1849 static int IMGUI_CDECL PairCompareByID(
const void* lhs,
const void* rhs)
1852 if (((
const Pair*)lhs)->key > ((
const Pair*)rhs)->key)
return +1;
1853 if (((
const Pair*)lhs)->key < ((
const Pair*)rhs)->key)
return -1;
1858 ImQsort(Data.Data, (
size_t)Data.Size,
sizeof(
Pair), StaticFunc::PairCompareByID);
1864 if (it == Data.end() || it->
key != key)
1871 return GetInt(key, default_val ? 1 : 0) != 0;
1877 if (it == Data.end() || it->
key != key)
1885 if (it == Data.end() || it->
key != key)
1894 if (it == Data.end() || it->
key != key)
1895 it = Data.insert(it,
Pair(key, default_val));
1901 return (
bool*)GetIntRef(key, default_val ? 1 : 0);
1907 if (it == Data.end() || it->
key != key)
1908 it = Data.insert(it,
Pair(key, default_val));
1915 if (it == Data.end() || it->
key != key)
1916 it = Data.insert(it,
Pair(key, default_val));
1924 if (it == Data.end() || it->
key != key)
1926 Data.insert(it,
Pair(key, val));
1934 SetInt(key, val ? 1 : 0);
1940 if (it == Data.end() || it->
key != key)
1942 Data.insert(it,
Pair(key, val));
1951 if (it == Data.end() || it->
key != key)
1953 Data.insert(it,
Pair(key, val));
1961 for (
int i = 0; i < Data.Size; i++)
1993 return value_changed;
2000 const char* we = wb;
2003 if (*we == separator)
2017 TextRange input_range(InputBuf, InputBuf+strlen(InputBuf));
2018 input_range.
split(
',', &Filters);
2021 for (
int i = 0; i != Filters.Size; i++)
2030 if (Filters[i].b[0] !=
'-')
2037 if (Filters.empty())
2043 for (
int i = 0; i != Filters.Size; i++)
2076 #if defined(__GNUC__) || defined(__clang__) 2077 #define va_copy(dest, src) __builtin_va_copy(dest, src) 2079 #define va_copy(dest, src) (dest = src) 2099 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2100 const int needed_sz = write_off + len;
2101 if (write_off + len >= Buf.Capacity)
2103 int double_capacity = Buf.Capacity * 2;
2104 Buf.reserve(needed_sz > double_capacity ? needed_sz : double_capacity);
2107 Buf.resize(needed_sz);
2108 ImFormatStringV(&Buf[write_off - 1], (
size_t)len + 1, fmt, args_copy);
2115 va_start(args, fmt);
2116 appendfv(fmt, args);
2144 ItemsHeight = items_height;
2147 DisplayEnd = DisplayStart = -1;
2148 if (ItemsHeight > 0.0
f)
2151 if (DisplayStart > 0)
2162 if (ItemsCount < INT_MAX)
2185 if (ItemsCount == 1) { ItemsCount = -1;
return false; }
2188 Begin(ItemsCount-1, items_height);
2196 IM_ASSERT(DisplayStart >= 0 && DisplayEnd >= 0);
2213 const char* text_display_end = text;
2215 text_end = (
const char*)-1;
2217 while (text_display_end < text_end && *text_display_end !=
'\0' && (text_display_end[0] !=
'#' || text_display_end[1] !=
'#'))
2219 return text_display_end;
2230 const char* text_display_end;
2231 if (hide_text_after_hash)
2238 text_end = text + strlen(text);
2239 text_display_end = text_end;
2242 if (text != text_display_end)
2256 text_end = text + strlen(text);
2258 if (text != text_end)
2272 const ImVec2 text_size = text_size_if_known ? *text_size_if_known :
CalcTextSize(text, text_display_end,
false, 0.0
f);
2274 const ImVec2* clip_min = clip_rect ? &clip_rect->
Min : &pos_min;
2275 const ImVec2* clip_max = clip_rect ? &clip_rect->
Max : &pos_max;
2276 bool need_clipping = (pos.
x + text_size.
x >= clip_max->
x) || (pos.
y + text_size.
y >= clip_max->
y);
2278 need_clipping |= (pos.
x < clip_min->
x) || (pos.
y < clip_min->
y);
2281 if (align.
x > 0.0f) pos.
x =
ImMax(pos.
x, pos.
x + (pos_max.
x - pos.
x - text_size.
x) * align.
x);
2282 if (align.
y > 0.0f) pos.
y =
ImMax(pos.
y, pos.
y + (pos_max.
y - pos.
y - text_size.
y) * align.
y);
2287 ImVec4 fine_clip_rect(clip_min->
x, clip_min->
y, clip_max->
x, clip_max->
y);
2300 const int text_len = (int)(text_display_end - text);
2318 if (border && border_size > 0.0
f)
2330 if (border_size > 0.0
f)
2342 const float h = g.
FontSize * 1.00f;
2343 float r = h * 0.40f * scale;
2344 ImVec2 center = p_min +
ImVec2(h * 0.50
f, h * 0.50f * scale);
2352 a = ImVec2(+0.000f,+0.750f) * r;
2353 b = ImVec2(-0.866f,-0.750f) * r;
2354 c = ImVec2(+0.866f,-0.750f) * r;
2359 a = ImVec2(+0.750f,+0.000f) * r;
2360 b = ImVec2(-0.750f,+0.866f) * r;
2361 c = ImVec2(-0.750f,-0.866f) * r;
2384 float thickness =
ImMax(sz / 5.0
f, 1.0
f);
2385 sz -= thickness*0.5f;
2386 pos +=
ImVec2(thickness*0.25
f, thickness*0.25f);
2388 float third = sz / 3.0f;
2389 float bx = pos.
x + third;
2390 float by = pos.
y + sz - third*0.5f;
2409 ImRect display_rect = bb;
2413 const float THICKNESS = 2.0f;
2414 const float DISTANCE = 3.0f + THICKNESS * 0.5f;
2415 display_rect.Expand(
ImVec2(DISTANCE,DISTANCE));
2435 : DrawListInst(&context->DrawListSharedData)
2507 ImGuiID id =
ImHash(str, str_end ? (
int)(str_end - str) : 0, seed);
2523 return ImHash(str, str_end ? (
int)(str_end - str) : 0, seed);
2529 return ImHash(&ptr,
sizeof(
void*), seed);
2554 IM_ASSERT(nav_layer == 0 || nav_layer == 1);
2665 if (focused_root_window->WasActive && focused_root_window != window->
RootWindow)
2737 #ifdef IMGUI_ENABLE_TEST_ENGINE 2739 ImGuiTestEngineHook_ItemAdd(&g, bb,
id);
2743 const bool is_clipped =
IsClippedEx(bb,
id,
false);
2865 if (size.
x < 0.0f || size.
y < 0.0f)
2876 if (wrap_pos_x < 0.0
f)
2880 if (wrap_pos_x == 0.0
f)
2882 else if (wrap_pos_x > 0.0
f)
2885 return ImMax(wrap_pos_x - pos.
x, 1.0f);
2891 ctx->IO.MetricsActiveAllocations++;
2899 ctx->IO.MetricsActiveAllocations--;
2928 #ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC 2929 IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx);
2941 if (sz_io !=
sizeof(
ImGuiIO)) { error =
true;
IM_ASSERT(sz_io ==
sizeof(
ImGuiIO) &&
"Mismatched struct layout!"); }
2943 if (sz_vec2 !=
sizeof(
ImVec2)) { error =
true;
IM_ASSERT(sz_vec2 ==
sizeof(
ImVec2) &&
"Mismatched struct layout!"); }
2944 if (sz_vec4 !=
sizeof(
ImVec4)) { error =
true;
IM_ASSERT(sz_vec4 ==
sizeof(
ImVec4) &&
"Mismatched struct layout!"); }
2977 IM_ASSERT(GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
2983 IM_ASSERT(GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
2984 return GImGui->
Style;
2996 return GImGui->
Time;
3049 if (moving_window->
Pos.
x != pos.
x || moving_window->
Pos.
y != pos.
y)
3109 bool hovered_window_above_modal =
false;
3111 hovered_window_above_modal =
true;
3112 for (
int i = g.
Windows.
Size - 1; i >= 0 && hovered_window_above_modal ==
false; i--)
3115 if (window == modal)
3118 hovered_window_above_modal =
true;
3208 window->
Pos += offset;
3209 window->
Size *= scale;
3212 else if (!g.
IO.
KeyCtrl && scroll_allowed)
3215 float scroll_amount = 5 * scroll_window->
CalcFontSize();
3250 int mouse_earliest_button_down = -1;
3251 bool mouse_any_down =
false;
3259 mouse_earliest_button_down = i;
3261 const bool mouse_avail_to_imgui = (mouse_earliest_button_down == -1) || g.
IO.
MouseDownOwned[mouse_earliest_button_down];
3266 if (!mouse_avail_to_imgui && !mouse_dragging_extern_payload)
3289 IM_ASSERT(GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
3292 #ifdef IMGUI_ENABLE_TEST_ENGINE 3293 ImGuiTestEngineHook_PreNewFrame(&g);
3299 IM_ASSERT(g.
IO.
DeltaTime >= 0.0f &&
"Need a positive DeltaTime (zero is tolerated but will cause some timing issues)");
3301 IM_ASSERT(g.
IO.
Fonts->
Fonts.
Size > 0 &&
"Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?");
3302 IM_ASSERT(g.
IO.
Fonts->
Fonts[0]->IsLoaded() &&
"Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?");
3304 IM_ASSERT(g.
Style.
Alpha >= 0.0f && g.
Style.
Alpha <= 1.0f &&
"Invalid style setting. Alpha cannot be negative (allows us to avoid a few clamps in color computations)");
3465 Begin(
"Debug##Default");
3468 #ifdef IMGUI_ENABLE_TEST_ENGINE 3469 ImGuiTestEngineHook_PostNewFrame(&g);
3576 for (
int i = 0; i < count; i++)
3613 IM_ASSERT(draw_list->
_VtxCurrentIdx < (1 << 16) &&
"Too many vertices in ImDrawList using 16-bit indices. Read comment above");
3642 int n = Layers[0].Size;
3645 size += Layers[i].
Size;
3646 Layers[0].resize(size);
3647 for (
int layer_n = 1; layer_n <
IM_ARRAYSIZE(Layers); layer_n++)
3652 memcpy(&Layers[0][n], &layer[0], layer.
Size *
sizeof(
ImDrawList*));
3661 draw_data->
Valid =
true;
3667 for (
int n = 0; n < draw_lists->
Size; n++)
3678 window->
DrawList->
PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect);
3736 if (is_delivered || is_elapsed)
3801 for (
int n = 0; n <
IM_ARRAYSIZE(windows_to_render_front_most); n++)
3819 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 3831 const char* text_display_end;
3832 if (hide_text_after_double_hash)
3835 text_display_end = text_end;
3838 const float font_size = g.
FontSize;
3839 if (text == text_display_end)
3840 return ImVec2(0.0
f, font_size);
3841 ImVec2 text_size = font->
CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
3844 const float font_scale = font_size / font->
FontSize;
3845 const float character_spacing_x = 1.0f * font_scale;
3846 if (text_size.
x > 0.0f)
3847 text_size.
x -= character_spacing_x;
3848 text_size.
x = (float)(
int)(text_size.
x + 0.95f);
3863 *out_items_display_start = 0;
3864 *out_items_display_end = items_count;
3869 *out_items_display_start = *out_items_display_end = 0;
3879 int start = (int)((unclipped_rect.
Min.
y - pos.
y) / items_height);
3880 int end = (int)((unclipped_rect.
Max.
y - pos.
y) / items_height);
3888 start =
ImClamp(start, 0, items_count);
3889 end =
ImClamp(end + 1, start, items_count);
3890 *out_items_display_start = start;
3891 *out_items_display_end = end;
3919 bb.
Expand(padding_regular);
3921 bb.
Expand(padding_for_resize_from_edges);
3926 if (hovered_window == NULL)
3927 hovered_window = window;
3945 ImRect rect_clipped(r_min, r_max);
3959 return GImGui->
IO.
KeyMap[imgui_key];
3965 if (user_key_index < 0)
return false;
3974 if (t <= repeat_delay || repeat_rate <= 0.0
f)
3976 const int count = (int)((t - repeat_delay) / repeat_rate) - (
int)((t_prev - repeat_delay) / repeat_rate);
3977 return (count > 0) ? count : 0;
3983 if (key_index < 0)
return false;
3992 if (user_key_index < 0)
return false;
4005 if (user_key_index < 0)
return false;
4064 if (lock_threshold < 0.0
f)
4086 if (mouse_pos == NULL)
4088 const float MOUSE_INVALID = -256000.0f;
4089 return mouse_pos->
x >= MOUSE_INVALID && mouse_pos->
y >= MOUSE_INVALID;
4099 if (lock_threshold < 0.0
f)
4248 const int auto_fit_axises = ((size.
x == 0.0f) ? (1 <<
ImGuiAxis_X) : 0x00) | ((size.
y == 0.0f) ? (1 <<
ImGuiAxis_Y) : 0x00);
4250 size.
x =
ImMax(content_avail.
x + size.
x, 4.0f);
4252 size.
y =
ImMax(content_avail.
y + size.
y, 4.0f);
4265 bool ret =
Begin(title, NULL, flags);
4290 return BeginChildEx(str_id, window->
GetID(str_id), size_arg, border, extra_flags);
4296 return BeginChildEx(NULL,
id, size_arg, border, extra_flags);
4364 {
int current = window->
IDStack.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup == current &&
"PushID/PopID or TreeNode/TreePop Mismatch!"); p_backup++; }
4365 {
int current = window->
DC.
GroupStack.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup == current &&
"BeginGroup/EndGroup Mismatch!"); p_backup++; }
4366 {
int current = g.
BeginPopupStack.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup == current &&
"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch"); p_backup++;}
4368 {
int current = g.
ColorModifiers.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup >= current &&
"PushStyleColor/PopStyleColor Mismatch!"); p_backup++; }
4369 {
int current = g.
StyleModifiers.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup >= current &&
"PushStyleVar/PopStyleVar Mismatch!"); p_backup++; }
4370 {
int current = g.
FontStack.
Size;
if (write) *p_backup = (short)current;
else IM_ASSERT(*p_backup >= current &&
"PushFont/PopFont Mismatch!"); p_backup++; }
4399 window->
Flags = flags;
4413 window->
Collapsed = settings->Collapsed;
4415 size =
ImFloor(settings->Size);
4427 if (window->
Size.
x <= 0.0f)
4429 if (window->
Size.
y <= 0.0f)
4492 return size_contents;
4500 if (is_popup || is_menu)
4508 return size_auto_fit;
4542 if (snap_on_edges && cr_y <= 0.0
f && target_y <= window->
WindowPadding.
y)
4570 ImVec2 size_expected = pos_max - pos_min;
4573 if (corner_norm.
x == 0.0f)
4574 out_pos->
x -= (size_constrained.
x - size_expected.
x);
4575 if (corner_norm.
y == 0.0f)
4576 out_pos->
y -= (size_constrained.
y - size_expected.
y);
4577 *out_size = size_constrained;
4598 if (thickness == 0.0
f) rect.
Max -=
ImVec2(1,1);
4599 if (border_n == 0)
return ImRect(rect.
Min.
x + perp_padding, rect.
Min.
y - thickness, rect.
Max.
x - perp_padding, rect.
Min.
y + thickness);
4600 if (border_n == 1)
return ImRect(rect.
Max.
x - thickness, rect.
Min.
y + perp_padding, rect.
Max.
x + thickness, rect.
Max.
y - perp_padding);
4601 if (border_n == 2)
return ImRect(rect.
Min.
x + perp_padding, rect.
Max.
y - thickness, rect.
Max.
x - perp_padding, rect.
Max.
y + thickness);
4602 if (border_n == 3)
return ImRect(rect.
Min.
x - thickness, rect.
Min.
y + perp_padding, rect.
Min.
x + thickness, rect.
Max.
y - perp_padding);
4619 const float grip_hover_inner_size = (float)(
int)(grip_draw_size * 0.75f);
4622 ImVec2 pos_target(FLT_MAX, FLT_MAX);
4623 ImVec2 size_target(FLT_MAX, FLT_MAX);
4627 for (
int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++)
4633 ImRect resize_rect(corner - grip.
InnerDir * grip_hover_outer_size, corner + grip.
InnerDir * grip_hover_inner_size);
4639 if (hovered || held)
4655 if (resize_grip_n == 0 || held || hovered)
4658 for (
int border_n = 0; border_n < resize_border_count; border_n++)
4667 if (held) *border_held = border_n;
4690 if (nav_resize_delta.
x != 0.0f || nav_resize_delta.
y != 0.0f)
4692 const float NAV_RESIZE_SPEED = 600.0f;
4703 if (size_target.
x != FLT_MAX)
4708 if (pos_target.
x != FLT_MAX)
4740 IM_ASSERT(name != NULL && name[0] !=
'\0');
4746 const bool window_just_created = (window == NULL);
4747 if (window_just_created)
4761 const bool first_begin_of_the_frame = (window->
LastFrameActive != current_frame);
4764 if (first_begin_of_the_frame)
4767 flags = window->
Flags;
4772 IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow));
4776 bool window_just_activated_by_user = (window->
LastFrameActive < current_frame - 1);
4781 window_just_activated_by_user |= (window->
PopupId != popup_ref.
PopupId);
4782 window_just_activated_by_user |= (window != popup_ref.
Window);
4784 window->
Appearing = (window_just_activated_by_user || window_just_appearing_after_hidden_for_resize);
4792 if (flags & ImGuiWindowFlags_Popup)
4795 popup_ref.
Window = window;
4800 if (window_just_appearing_after_hidden_for_resize && !(flags & ImGuiWindowFlags_ChildWindow))
4804 bool window_pos_set_by_api =
false;
4805 bool window_size_x_set_by_api =
false, window_size_y_set_by_api =
false;
4835 else if (first_begin_of_the_frame)
4847 if (first_begin_of_the_frame)
4863 bool window_title_visible_elsewhere =
false;
4865 window_title_visible_elsewhere =
true;
4866 if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->
Name) != 0)
4883 if (window_just_created && (!window_size_x_set_by_api || !window_size_y_set_by_api))
4888 if (window_just_activated_by_user && (flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0)
4893 if (!window_size_x_set_by_api)
4895 if (!window_size_y_set_by_api)
4936 ImVec2 size_full_modified(FLT_MAX, FLT_MAX);
4940 if (!window_size_x_set_by_api)
4941 window->
SizeFull.
x = size_full_modified.
x = size_auto_fit.
x;
4942 if (!window_size_y_set_by_api)
4943 window->
SizeFull.
y = size_full_modified.
y = size_auto_fit.
y;
4979 if (window_just_activated_by_user)
4982 if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
4987 if (flags & ImGuiWindowFlags_ChildWindow)
4992 if (!(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api && !window_is_child_tooltip)
4997 if (window_pos_with_pivot)
5001 else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_just_appearing_after_hidden_for_resize)
5003 else if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api && !window_is_child_tooltip)
5007 if (!(flags & ImGuiWindowFlags_ChildWindow))
5013 window->
Pos =
ImMax(window->
Pos + size_for_clamping, padding) - size_for_clamping;
5033 bool want_focus =
false;
5035 if (!(flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) || (flags & ImGuiWindowFlags_Popup))
5039 int border_held = -1;
5040 ImU32 resize_grip_col[4] = { 0 };
5044 UpdateManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0]);
5047 if (window->
Size.
x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize))
5059 if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip)
5067 if (dim_bg_for_modal || dim_bg_for_window_list)
5094 RenderFrame(title_bar_rect.
Min, title_bar_rect.
Max, title_bar_col,
true, window_rounding);
5110 if (!(flags & ImGuiWindowFlags_NoTitleBar))
5117 if (flags & ImGuiWindowFlags_MenuBar)
5135 for (
int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++)
5147 if (window_border_size > 0.0
f && !(flags & ImGuiWindowFlags_NoBackground))
5149 if (border_held != -1)
5154 if (style.
FrameBorderSize > 0 && !(flags & ImGuiWindowFlags_NoTitleBar))
5234 if (!(flags & ImGuiWindowFlags_NoTitleBar))
5243 if (!(flags & ImGuiWindowFlags_NoCollapse))
5251 const float rad = g.
FontSize * 0.5f;
5262 const char* UNSAVED_DOCUMENT_MARKER =
"*";
5265 ImRect text_r = title_bar_rect;
5270 text_r.
Min.
x += pad_left;
5271 text_r.
Max.
x -= pad_right;
5272 ImRect clip_rect = text_r;
5321 if (first_begin_of_the_frame)
5327 if (flags & ImGuiWindowFlags_ChildWindow)
5338 if (parent_window && (parent_window->
Collapsed || parent_window->
Hidden))
5343 if (style.
Alpha <= 0.0f)
5356 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 5360 if (size_first_use.
x != 0.0f || size_first_use.
y != 0.0f)
5364 if (bg_alpha_override >= 0.0
f)
5367 return Begin(name, p_open, flags);
5369 #endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS 5418 if (current_front_window == window || current_front_window->
RootWindow == window)
5509 const float w_item_one =
ImMax(1.0
f, (
float)(
int)((w_full - (style.
ItemInnerSpacing.
x) * (components-1)) / (
float)components));
5510 const float w_item_last =
ImMax(1.0
f, (
float)(
int)(w_full - (w_item_one + style.
ItemInnerSpacing.
x) * (components-1)));
5512 for (
int i = 0; i < components-1; i++)
5532 w =
ImMax(1.0
f, width_to_right_edge + w);
5694 return &GStyleVarInfo[idx];
5803 while (window != NULL)
5805 if (window == potential_parent)
5885 return window->
Size.
x;
5891 return window->
Size.
y;
5904 window->
Scroll.
x = new_scroll_x;
5911 window->
Scroll.
y = new_scroll_y;
5947 return window->
Size;
6171 return GImGui->
Font;
6290 IM_ASSERT(center_y_ratio >= 0.0
f && center_y_ratio <= 1.0
f);
6367 const void* ptr_id = (
void*)(intptr_t)int_id;
6442 window->
DC.
CursorPos = group_data.BackupCursorPos;
6444 window->
DC.
Indent = group_data.BackupIndent;
6450 if (group_data.AdvanceCursor)
6453 ItemSize(group_bb.
GetSize(), group_data.BackupCurrentLineTextBaseOffset);
6485 if (spacing_w < 0.0
f) spacing_w = 0.0f;
6544 char window_name[16];
6546 if (override_previous_tooltip)
6551 window->Hidden =
true;
6552 window->HiddenFramesRegular = 1;
6556 Begin(window_name, NULL, flags | extra_flags);
6579 va_start(args, fmt);
6683 int popup_count_to_keep = 0;
6697 bool popup_or_descendent_has_focus =
false;
6698 for (
int m = popup_count_to_keep; m < g.
OpenPopupStack.
Size && !popup_or_descendent_has_focus; m++)
6700 popup_or_descendent_has_focus =
true;
6701 if (!popup_or_descendent_has_focus)
6727 if (apply_focus_to_window_under)
6750 window->DC.NavHideHighlightOneFrame =
true;
6806 const bool is_open =
Begin(name, p_open, flags);
6807 if (!is_open || (p_open && !*p_open))
6845 str_id =
"window_context";
6856 str_id =
"void_context";
6885 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n];
6886 if (n != -1 && dir == *last_dir)
6892 if (dir == ImGuiDir_Up) pos =
ImVec2(r_avoid.
Max.
x - size.
x, r_avoid.
Min.
y - size.
y);
6904 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n];
6905 if (n != -1 && dir == *last_dir)
6909 if (avail_w < size.
x || avail_h < size.
y)
6942 r_avoid =
ImRect(parent_window->
Pos.
x + horizontal_overlap, -FLT_MAX, parent_window->
Pos.
x + parent_window->
Size.
x - horizontal_overlap - parent_window->
ScrollbarSizes.
x, FLT_MAX);
6957 r_avoid =
ImRect(ref_pos.
x - 16, ref_pos.
y - 8, ref_pos.
x + 16, ref_pos.
y + 8);
6959 r_avoid =
ImRect(ref_pos.
x - 16, ref_pos.
y - 8, ref_pos.
x + 24 * sc, ref_pos.
y + 24 * sc);
6962 pos = ref_pos +
ImVec2(2, 2);
7036 float dby =
NavScoreItemDistInterval(
ImLerp(cand.
Min.
y, cand.
Max.
y, 0.2f),
ImLerp(cand.
Min.
y, cand.
Max.
y, 0.8f),
ImLerp(curr.
Min.
y, curr.
Max.
y, 0.2f),
ImLerp(curr.
Min.
y, curr.
Max.
y, 0.8f));
7037 if (dby != 0.0
f && dbx != 0.0
f)
7038 dbx = (dbx/1000.0f) + ((dbx > 0.0
f) ? +1.0f : -1.0f);
7048 float dax = 0.0f, day = 0.0f, dist_axial = 0.0f;
7049 if (dbx != 0.0
f || dby != 0.0
f)
7054 dist_axial = dist_box;
7057 else if (dcx != 0.0
f || dcy != 0.0
f)
7062 dist_axial = dist_center;
7071 #if IMGUI_DEBUG_NAV_SCORING 7075 ImFormatString(buf,
IM_ARRAYSIZE(buf),
"dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial,
"WENS"[g.
NavMoveDir],
"WENS"[quadrant]);
7096 bool new_best =
false;
7100 if (dist_box < result->DistBox)
7106 if (dist_box == result->
DistBox)
7109 if (dist_center < result->DistCenter)
7130 if (result->
DistBox == FLT_MAX && dist_axial < result->DistAxial)
7160 if (!(item_flags & ImGuiItemFlags_NoNavDefaultFocus))
7187 const float VISIBLE_RATIO = 0.70f;
7275 if (parent_window && parent_window != nav_window)
7310 bool init_for_nav =
false;
7313 init_for_nav =
true;
7361 return (t == 0.0
f) ? 1.0f : 0.0f;
7381 delta *= slow_factor;
7383 delta *= fast_factor;
7393 if (window_rect.
Contains(item_rect))
7407 if (item_rect.
Min.
y < window_rect.
Min.
y)
7412 else if (item_rect.
Max.
y >= window_rect.
Max.
y)
7430 if (nav_gamepad_active)
7435 if (nav_keyboard_active)
7437 #define NAV_MAP_KEY(_KEY, _NAV_INPUT) if (IsKeyDown(g.IO.KeyMap[_KEY])) { g.IO.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_NavKeyboard; } 7559 if (g.
ActiveId == 0 && activate_pressed)
7604 float nav_scoring_rect_offset_y = 0.0f;
7605 if (nav_keyboard_active)
7644 if (scroll_dir.
y != 0.0f)
7680 #if IMGUI_DEBUG_NAV_RECTS 7682 if (g.
NavWindow) {
ImU32 col = (!g.
NavWindow->
Hidden) ?
IM_COL32(255,0,255,255) :
IM_COL32(255,0,0,255);
ImVec2 p =
NavCalcPreferredRefPos();
char buf[32];
ImFormatString(buf, 32,
"%d", g.
NavLayer);
GetOverlayDrawList(g.
NavWindow)->
AddCircleFilled(p, 3.0
f, col);
GetOverlayDrawList(g.
NavWindow)->
AddText(NULL, 13.0
f, p +
ImVec2(8,-4), col, buf); }
7746 if ((page_up_held && !page_down_held) || (page_down_held && !page_up_held))
7760 float nav_scoring_rect_offset_y = 0.0f;
7763 nav_scoring_rect_offset_y = -page_offset_y;
7770 nav_scoring_rect_offset_y = +page_offset_y;
7775 return nav_scoring_rect_offset_y;
7821 bool apply_toggle_layer =
false;
7824 if (modal_window != NULL)
7841 if (start_windowing_with_gamepad || start_windowing_with_keyboard)
7859 if (focus_change_dir != 0)
7870 apply_toggle_layer =
true;
7892 apply_toggle_layer =
true;
7902 if (move_delta.
x != 0.0f || move_delta.
y != 0.0f)
7904 const float NAV_MOVE_SPEED = 800.0f;
7927 if (apply_focus_window)
7957 return "(Main menu bar)";
7958 return "(Untitled)";
7981 const char* label = window->
Name;
8043 return offset_norm * (columns->
MaxX - columns->
MinX);
8048 return offset / (columns->
MaxX - columns->
MinX);
8076 if (column_index < 0)
8077 column_index = columns->
Current;
8080 const float t = columns->
Columns[column_index].OffsetNorm;
8087 if (column_index < 0)
8088 column_index = columns->
Current;
8092 offset_norm = columns->
Columns[column_index + 1].OffsetNormBeforeResize - columns->
Columns[column_index].OffsetNormBeforeResize;
8094 offset_norm = columns->
Columns[column_index + 1].OffsetNorm - columns->
Columns[column_index].OffsetNorm;
8104 if (column_index < 0)
8105 column_index = columns->
Current;
8116 if (column_index < 0)
8117 column_index = columns->
Current;
8137 if (column_index < 0)
8138 column_index = columns->
Current;
8146 if (column_index < 0)
8147 column_index = columns->
Current;
8174 PushID(0x11223347 + (str_id ? 0 : columns_count));
8175 ImGuiID id = window->
GetID(str_id ? str_id :
"columns");
8182 columns->
Count = columns_count;
8183 columns->
Flags = flags;
8205 for (
int n = 0; n < columns_count + 1; n++)
8208 column.
OffsetNorm = n / (float)columns_count;
8213 for (
int n = 0; n < columns_count; n++)
8245 bool is_being_resized =
false;
8250 int dragging_column = -1;
8251 for (
int n = 1; n < columns->
Count; n++)
8261 bool hovered =
false, held =
false;
8265 if (hovered || held)
8268 dragging_column = n;
8273 const float xi = (float)(
int)x;
8278 if (dragging_column != -1)
8281 for (
int n = 0; n < columns->
Count + 1; n++)
8282 columns->
Columns[n].OffsetNormBeforeResize = columns->
Columns[n].OffsetNorm;
8309 if (columns_count != 1)
8338 bool source_drag_active =
false;
8341 int mouse_button = 0;
8345 if (source_id != 0 && g.
ActiveId != source_id)
8390 source_id =
ImHash(
"#SourceExtern", 0);
8391 source_drag_active =
true;
8394 if (source_drag_active)
8456 IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0));
8470 memcpy(payload.
Data, data, data_size);
8472 else if (data_size > 0)
8477 memcpy(payload.
Data, data, data_size);
8481 payload.
Data = NULL;
8555 if (type != NULL && !payload.
IsDataType(type))
8571 payload.
Preview = was_accepted_previously;
8624 va_start(args, fmt);
8626 vfprintf(g.
LogFile, fmt, args);
8642 const bool log_new_line = ref_pos && (ref_pos->
y > window->
DC.
LogLinePosY + 1);
8646 const char* text_remaining = text;
8653 const char* line_start = text_remaining;
8655 const bool is_first_line = (line_start == text);
8656 const bool is_last_line = (line_end == text_end);
8657 if (!is_last_line || (line_start != line_end))
8659 const int char_count = (int)(line_end - line_start);
8660 if (log_new_line || !is_first_line)
8663 LogText(
" %.*s", char_count, line_start);
8668 text_remaining = line_end + 1;
8763 const bool log_to_clipboard =
Button(
"Log To Clipboard");
SameLine();
8776 if (log_to_clipboard)
8820 size_t file_data_size = 0;
8848 ini_size = strlen(ini_data);
8850 char* buf_end = buf + ini_size;
8851 memcpy(buf, ini_data, ini_size);
8854 void* entry_data = NULL;
8857 char* line_end = NULL;
8858 for (
char* line = buf; line < buf_end; line = line_end + 1)
8861 while (*line ==
'\n' || *line ==
'\r')
8864 while (line_end < buf_end && *line_end !=
'\n' && *line_end !=
'\r')
8869 if (line[0] ==
'[' && line_end > line && line_end[-1] ==
']')
8873 const char* name_end = line_end - 1;
8874 const char* type_start = line + 1;
8875 char* type_end = (
char*)(intptr_t)
ImStrchrRange(type_start, name_end,
']');
8876 const char* name_start = type_end ?
ImStrchrRange(type_end + 1, name_end,
'[') : NULL;
8877 if (!type_end || !name_start)
8879 name_start = type_start;
8880 type_start =
"Window";
8888 entry_data = entry_handler ? entry_handler->
ReadOpenFn(&g, entry_handler, name_start) : NULL;
8890 else if (entry_handler != NULL && entry_data != NULL)
8893 entry_handler->
ReadLineFn(&g, entry_handler, entry_data, line);
8907 size_t ini_data_size = 0;
8912 fwrite(ini_data,
sizeof(
char), ini_data_size, f);
8938 return (
void*)settings;
8946 if (sscanf(line,
"Pos=%f,%f", &x, &y) == 2) settings->
Pos =
ImVec2(x, y);
8948 else if (sscanf(line,
"Collapsed=%d", &i) == 1) settings->
Collapsed = (i != 0);
8969 settings->
Pos = window->
Pos;
8979 if (settings->
Pos.
x == FLT_MAX)
8981 const char* name = settings->
Name;
8982 if (
const char* p = strstr(name,
"###"))
8985 buf->
appendf(
"Pos=%d,%d\n", (
int)settings->
Pos.
x, (
int)settings->
Pos.
y);
8996 #if defined(_WIN32) && !defined(_WINDOWS_) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && (!defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) || !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)) 8997 #ifndef WIN32_LEAN_AND_MEAN 8998 #define WIN32_LEAN_AND_MEAN 9001 #include <Windows.h> 9003 #include <windows.h> 9008 #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) 9011 #pragma comment(lib, "user32") 9018 if (!::OpenClipboard(NULL))
9020 HANDLE wbuf_handle = ::GetClipboardData(CF_UNICODETEXT);
9021 if (wbuf_handle == NULL)
9029 buf_local.
resize(buf_len);
9032 ::GlobalUnlock(wbuf_handle);
9034 return buf_local.
Data;
9039 if (!::OpenClipboard(NULL))
9042 HGLOBAL wbuf_handle = ::GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length *
sizeof(
ImWchar));
9043 if (wbuf_handle == NULL)
9050 ::GlobalUnlock(wbuf_handle);
9052 if (::SetClipboardData(CF_UNICODETEXT, wbuf_handle) == NULL)
9053 ::GlobalFree(wbuf_handle);
9071 const char* text_end = text + strlen(text);
9080 #if defined(_WIN32) && !defined(__GNUC__) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) 9084 #pragma comment(lib, "imm32") 9091 if (HIMC himc = ::ImmGetContext(hwnd))
9094 cf.ptCurrentPos.x = x;
9095 cf.ptCurrentPos.y = y;
9096 cf.dwStyle = CFS_FORCE_POSITION;
9097 ::ImmSetCompositionWindow(himc, &cf);
9098 ::ImmReleaseContext(hwnd, himc);
9120 static bool show_draw_cmd_clip_rects =
true;
9121 static bool show_window_begin_order =
false;
9128 ImGui::Checkbox(
"Show clipping rectangles when hovering draw commands", &show_draw_cmd_clip_rects);
9129 ImGui::Checkbox(
"Ctrl shows window begin order", &show_window_begin_order);
9151 int elem_offset = 0;
9154 if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0)
9156 if (pcmd->UserCallback)
9158 ImGui::BulletText(
"Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData);
9162 bool pcmd_node_open =
ImGui::TreeNode((
void*)(pcmd - draw_list->
CmdBuffer.
begin()),
"Draw %4d %s vtx, tex 0x%p, clip_rect (%4.0f,%4.0f)-(%4.0f,%4.0f)", pcmd->ElemCount, draw_list->
IdxBuffer.
Size > 0 ?
"indexed" :
"non-indexed", pcmd->TextureId, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
9165 ImRect clip_rect = pcmd->ClipRect;
9167 for (
int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
9168 vtxs_rect.
Add(draw_list->
VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos);
9172 if (!pcmd_node_open)
9177 while (clipper.
Step())
9183 for (
int n = 0; n < 3; n++, vtx_i++)
9186 triangles_pos[n] = v.
pos;
9187 buf_p +=
ImFormatString(buf_p, (
int)(buf_end - buf_p),
"%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n", (n == 0) ?
"vtx" :
" ", vtx_i, v.
pos.
x, v.
pos.
y, v.
uv.
x, v.
uv.
y, v.
col);
9195 overlay_draw_list->
Flags = backup_flags;
9207 for (
int i = 0; i < windows.
Size; i++)
9208 Funcs::NodeWindow(windows[i],
"Window");
9212 static void NodeWindow(
ImGuiWindow* window,
const char* label)
9217 NodeDrawList(window, window->
DrawList,
"DrawList");
9218 ImGui::BulletText(
"Pos: (%.1f,%.1f), Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->
Pos.
x, window->
Pos.
y, window->
Size.
x, window->
Size.
y, window->
SizeContents.
x, window->
SizeContents.
y);
9240 if (
ImGui::TreeNode((
void*)(uintptr_t)columns->
ID,
"Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->
ID, columns->
Count, columns->
Flags))
9243 for (
int column_n = 0; column_n < columns->
Columns.
Size; column_n++)
9264 for (
int tab_n = 0; tab_n < tab_bar->
Tabs.
Size; tab_n++)
9280 Funcs::NodeWindows(g.
Windows,
"Windows");
9323 if (g.
IO.
KeyCtrl && show_window_begin_order)
9335 overlay_draw_list->
AddText(NULL, font_size, window->
Pos,
IM_COL32(255, 255, 255, 255), buf);
9345 #ifdef IMGUI_INCLUDE_IMGUI_USER_INL 9346 #include "imgui_user.inl"
float NavInputs[ImGuiNavInput_COUNT]
static void SettingsHandlerWindow_ReadLine(ImGuiContext *, ImGuiSettingsHandler *, void *entry, const char *line)
IMGUI_API bool BeginPopupContextItem(const char *str_id=NULL, int mouse_button=1)
#define IMGUI_DEBUG_NAV_SCORING
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
static void UpdateManualResize(ImGuiWindow *window, const ImVec2 &size_auto_fit, int *border_held, int resize_grip_count, ImU32 resize_grip_col[4])
int ImFormatString(char *buf, size_t buf_size, const char *fmt,...)
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiCond cond=0)
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow *window, ImGuiNavMoveFlags move_flags)
ImRect MenuBarRect() const
#define NAV_MAP_KEY(_KEY, _NAV_INPUT)
const char *(* GetClipboardTextFn)(void *user_data)
ImU32 TreeDepthMayJumpToParentOnPop
int FocusIdxTabRequestNext
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0)
bool NavHideHighlightOneFrame
IMGUI_API float GetCursorPosX()
IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value=true)
void PathStroke(ImU32 col, bool closed, float thickness=1.0f)
void(* WriteAllFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *out_buf)
IMGUI_API float * GetFloatRef(ImGuiID key, float default_val=0.0f)
ImGuiWindow * RootWindowForTitleBarHighlight
IMGUI_API ImVec2 GetCursorStartPos()
IMGUI_API void ClosePopupToLevel(int remaining, bool apply_focus_to_window_under)
IMGUI_API void SetTooltip(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void RenderText(ImVec2 pos, const char *text, const char *text_end=NULL, bool hide_text_after_hash=true)
IMGUI_API bool IsMouseReleased(int button)
ImRect NavInitResultRectRel
IMGUI_API void LoadIniSettingsFromMemory(const char *ini_data, size_t ini_size=0)
IMGUI_API bool DebugCheckVersionAndDataLayout(const char *version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert)
static void FreeWrapper(void *ptr, void *user_data)
void * GetVarPtr(ImGuiStyle *style) const
IMGUI_API void UpdateMouseMovingWindowNewFrame()
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond=0)
IMGUI_API ImVec2 GetCursorPos()
static void AddWindowToSortBuffer(ImVector< ImGuiWindow *> *out_sorted_windows, ImGuiWindow *window)
bool ConfigWindowsResizeFromEdges
int ActiveIdAllowNavDirFlags
ImGuiCond SetWindowPosAllowFlags
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow *window)
ImGuiNavMoveResult NavMoveResultLocalVisibleSet
int DragDropSourceFrameCount
bool ActiveIdIsJustActivated
IMGUI_API float GetFontSize()
static void(* GImAllocatorFreeFunc)(void *ptr, void *user_data)
static ImGuiColumnsSet * FindOrAddColumnsSet(ImGuiWindow *window, ImGuiID id)
IMGUI_API void RenderMouseCursor(ImDrawList *draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor=ImGuiMouseCursor_Arrow)
int ImTextCharFromUtf8(unsigned int *out_char, const char *in_text, const char *in_text_end)
IMGUI_API void MarkIniSettingsDirty()
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col, float sz)
IMGUI_API void SetVoidPtr(ImGuiID key, void *val)
static void FindHoveredWindow()
char * ImStrdupcpy(char *dst, size_t *p_dst_size, const char *src)
ImGuiWindow * ParentWindow
IMGUI_API void PushColumnClipRect(int column_index=-1)
static float NavUpdatePageUpPageDown(int allowed_dir_flags)
static void NavRestoreLayer(ImGuiNavLayer layer)
IMGUI_API void PopTextureID()
ImVec2 ActiveIdClickOffset
IMGUI_API void AddInputCharacter(ImWchar c)
IMGUI_API void SetColumnWidth(int column_index, float width)
static void SetCursorPosYAndSetupDummyPrevLine(float pos_y, float line_height)
IMGUI_API ImGuiStorage * GetStateStorage()
IMGUI_API void PopClipRect()
double MouseClickedTime[5]
void(* SetClipboardTextFn)(void *user_data, const char *text)
void reserve(int capacity)
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow *ref_window)
IMGUI_API const char * FindRenderedTextEnd(const char *text, const char *text_end=NULL)
int WantCaptureMouseNextFrame
IMGUI_API ImGuiWindowSettings * FindWindowSettings(ImGuiID id)
IMGUI_API bool IsWindowChildOf(ImGuiWindow *window, ImGuiWindow *potential_parent)
IMGUI_API void ChannelsSetCurrent(int channel_index)
IMGUI_API void StyleColorsDark(ImGuiStyle *dst=NULL)
IMGUI_API void PopItemFlag()
void TranslateX(float dx)
void PathFillConvex(ImU32 col)
IMGUI_API void appendf(const char *fmt,...) IM_FMTARGS(2)
IMGUI_API bool OpenPopupOnItemClick(const char *str_id=NULL, int mouse_button=1)
IMGUI_API void SetCursorPos(const ImVec2 &local_pos)
ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
bool ImTriangleContainsPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
IMGUI_API void SaveIniSettingsToDisk(const char *ini_filename)
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)
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
void * SizeCallbackUserData
IMGUI_API void LogRenderedText(const ImVec2 *ref_pos, const char *text, const char *text_end=NULL)
short StackSizesBackup[6]
int ImTextStrToUtf8(char *buf, int buf_size, const ImWchar *in_text, const ImWchar *in_text_end)
IMGUI_API const ImGuiPayload * AcceptDragDropPayload(const char *type, ImGuiDragDropFlags flags=0)
IMGUI_API bool IsItemDeactivatedAfterEdit()
T * GetByIndex(ImPoolIdx n)
int ImStrlenW(const ImWchar *str)
IMGUI_API bool IsMouseClicked(int button, bool repeat=false)
IMGUI_API bool IsItemClicked(int mouse_button=0)
IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat=true)
static void NavSaveLastChildNavWindow(ImGuiWindow *nav_window)
float CurveTessellationTol
IMGUI_API void * GetVoidPtr(ImGuiID key) const
ImVector< float > ItemWidthStack
IMGUI_API void PushMultiItemsWidths(int components, float width_full=0.0f)
bool ActiveIdAllowOverlap
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding=0.0f)
IMGUI_API void PopTextWrapPos()
void push_back(const T &v)
IMGUI_API void CalcListClipping(int items_count, float items_height, int *out_items_display_start, int *out_items_display_end)
static const float NAV_WINDOWING_LIST_APPEAR_DELAY
IMGUI_API bool IsMouseDown(int button)
IMGUI_API bool IsItemEdited()
int FramerateSecPerFrameIdx
IMGUI_API void ClearFreeMemory()
IMGUI_API ImVec2 GetItemRectMin()
IMGUI_API bool IsItemActive()
void(* ImGuiSizeCallback)(ImGuiSizeCallbackData *data)
IMGUI_API ImGuiWindow * FindWindowByID(ImGuiID id)
IMGUI_API void SetHoveredID(ImGuiID id)
const char * ImStrchrRange(const char *str, const char *str_end, char c)
ImDrawList OverlayDrawList
static void UpdateMouseInputs()
int FocusIdxAllRequestCurrent
IMGUI_API void SetNextWindowFocus()
float NavInputsDownDurationPrev[ImGuiNavInput_COUNT]
IMGUI_API ImVec2 GetMouseDragDelta(int button=0, float lock_threshold=-1.0f)
ImGuiNavMoveResult NavMoveResultLocal
static float OffsetNormToPixels(const ImGuiColumnsSet *columns, float offset_norm)
IMGUI_API void NewFrame()
#define IMGUI_DEBUG_LOG(_FMT,...)
IMGUI_API void AddPolyline(const ImVec2 *points, const int num_points, ImU32 col, bool closed, float thickness)
float CurrentLineTextBaseOffset
static void NavUpdateMoveResult()
IMGUI_API void SetItemDefaultFocus()
IMGUI_API void EndTooltip()
static T ImClamp(T v, T mn, T mx)
IMGUI_API bool FocusableItemRegister(ImGuiWindow *window, ImGuiID id, bool tab_stop=true)
IMGUI_API void LogButtons()
ImRect DragDropTargetRect
ImGuiWindow * RootWindowForNav
static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER
float FramerateSecPerFrameAccum
IMGUI_API void SetAllocatorFunctions(void *(*alloc_func)(size_t sz, void *user_data), void(*free_func)(void *ptr, void *user_data), void *user_data=NULL)
IMGUI_API void PopAllowKeyboardFocus()
IMGUI_API bool SmallButton(const char *label)
IMGUI_API bool IsMouseHoveringRect(const ImVec2 &r_min, const ImVec2 &r_max, bool clip=true)
static void AddWindowToDrawDataSelectLayer(ImGuiWindow *window)
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow *window)
IMGUI_API void PushClipRect(const ImVec2 &clip_rect_min, const ImVec2 &clip_rect_max, bool intersect_with_current_clip_rect)
IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value=true)
IMGUI_API void BuildSortByKey()
IMGUI_API bool BeginPopup(const char *str_id, ImGuiWindowFlags flags=0)
ImPool< ImGuiTabBar > TabBars
ImGuiSizeCallback SizeCallback
IMGUI_API void PathArcToFast(const ImVec2 ¢re, float radius, int a_min_of_12, int a_max_of_12)
IMGUI_API ImVec2 CalcWindowExpectedSize(ImGuiWindow *window)
IMGUI_API void ShowMetricsWindow(bool *p_open=NULL)
IMGUI_API bool Draw(const char *label="Filter (inc,-exc)", float width=0.0f)
IMGUI_API bool IsDragDropPayloadBeingAccepted()
static void NavUpdateWindowingHighlightWindow(int focus_change_dir)
IMGUI_API ImRect GetWindowAllowedExtentRect(ImGuiWindow *window)
static ImGuiWindow * CreateNewWindow(const char *name, ImVec2 size, ImGuiWindowFlags flags)
ImGuiLayoutType LayoutType
ImVector< ImGuiItemFlags > ItemFlagsStack
IMGUI_API void BeginTooltip()
IMGUI_API bool IsWindowAppearing()
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char *text_begin, const char *text_end=NULL, const char **remaining=NULL) const
float KeysDownDuration[512]
IMGUI_API void PushTextureID(ImTextureID texture_id)
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2 &size_min, const ImVec2 &size_max, ImGuiSizeCallback custom_callback=NULL, void *custom_callback_data=NULL)
IMGUI_API void * MemAlloc(size_t size)
ImGuiDragDropFlags DragDropSourceFlags
static int IMGUI_CDECL ChildWindowComparer(const void *lhs, const void *rhs)
bool FontAtlasOwnedByContext
IMGUI_API bool * GetBoolRef(ImGuiID key, bool default_val=false)
ImVector< ImGuiTabItem > Tabs
static bool ImIsPowerOfTwo(int v)
void resize(int new_size)
IMGUI_API void Indent(float indent_w=0.0f)
#define IM_ARRAYSIZE(_ARR)
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0)
IMGUI_API void AddTriangleFilled(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, ImU32 col)
float BackupCurrentLineTextBaseOffset
void swap(ImVector< T > &rhs)
IMGUI_API void PushButtonRepeat(bool repeat)
ImRect TitleBarRect() const
static float ImFloor(float f)
ImGuiStorage StateStorage
ImVec2 MouseClickedPos[5]
ImRect NavScoringRectScreen
bool IsDataType(const char *type) const
IMGUI_API void ResetMouseDragDelta(int button=0)
IMGUI_API float GetFloat(ImGuiID key, float default_val=0.0f) const
IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor=0.0f, float fast_factor=0.0f)
IMGUI_API void AddRect(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners_flags=ImDrawCornerFlags_All, float thickness=1.0f)
IMGUI_API void SetCurrentFont(ImFont *font)
bool MouseDoubleClicked[5]
bool ActiveIdPreviousFrameIsAlive
int ImStricmp(const char *str1, const char *str2)
char * ImStrdup(const char *str)
static void CalcResizePosSizeFromAnyCorner(ImGuiWindow *window, const ImVec2 &corner_target, const ImVec2 &corner_norm, ImVec2 *out_pos, ImVec2 *out_size)
ImFont * GetDefaultFont()
unsigned char DragDropPayloadBufLocal[8]
IMGUI_API ImGuiMouseCursor GetMouseCursor()
static ImGuiCol GetWindowBgColorIdxFromFlags(ImGuiWindowFlags flags)
IMGUI_API float GetColumnOffset(int column_index=-1)
IMGUI_API void SetScrollHereY(float center_y_ratio=0.5f)
float CalcFontSize() const
ImGuiMenuColumns MenuColumns
int ImTextCountUtf8BytesFromStr(const ImWchar *in_text, const ImWchar *in_text_end)
ImVec2 ImTriangleClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
IMGUI_API void UpdateHoveredWindowAndCaptureFlags()
static ImGuiWindow * NavRestoreLastChildNavWindow(ImGuiWindow *window)
static ImVec2 CalcSizeContents(ImGuiWindow *window)
IMGUI_API void AddLine(const ImVec2 &a, const ImVec2 &b, ImU32 col, float thickness=1.0f)
ImGuiInputSource NavInputSource
IMGUI_API bool PassFilter(const char *text, const char *text_end=NULL) const
static void SetWindowCollapsed(ImGuiWindow *window, bool collapsed, ImGuiCond cond)
IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect=false)
float NavInputsDownDuration[ImGuiNavInput_COUNT]
IMGUI_API void SetNavID(ImGuiID id, int nav_layer)
IMGUI_API void DestroyContext(ImGuiContext *ctx=NULL)
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags=0)
ImVector< ImFont * > Fonts
IMGUI_API ImVec2 GetItemRectSize()
IMGUI_API float GetWindowScrollMaxY(ImGuiWindow *window)
IMGUI_API float GetWindowWidth()
IMGUI_API void ** GetVoidPtrRef(ImGuiID key, void *default_val=NULL)
IMGUI_API bool IsAnyItemFocused()
static void * MallocWrapper(size_t size, void *user_data)
ImVec4 ClipRectFullscreen
ImVector< ImGuiColorMod > ColorModifiers
float HoveredIdNotActiveTimer
IMGUI_API bool TreeNode(const char *label)
IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode)
IMGUI_API ImVec2 GetContentRegionMax()
ImVector< ImGuiWindow * > CurrentWindowStack
static T ImLerp(T a, T b, float t)
static const char * GetFallbackWindowNameForWindowingList(ImGuiWindow *window)
int KeyMap[ImGuiKey_COUNT]
geometry_msgs::TransformStamped t
IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2 &size, ImGuiWindowFlags flags=0)
IMGUI_API void ClearInputCharacters()
ImVector< ImFont * > FontStack
void(* ImeSetInputScreenPosFn)(int x, int y)
ImGuiID NavActivatePressedId
doubleAcc dot(const VectorAcc &lhs, const VectorAcc &rhs)
IMGUI_API void ActivateItem(ImGuiID id)
IMGUI_API void SetWindowPos(const ImVec2 &pos, ImGuiCond cond=0)
static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow *window, bool snap_on_edges)
IMGUI_API ImGuiTextFilter(const char *default_filter="")
static bool IsWindowActiveAndVisible(ImGuiWindow *window)
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2 &ref_pos, const ImVec2 &size, ImGuiDir *last_dir, const ImRect &r_outer, const ImRect &r_avoid, ImGuiPopupPositionPolicy policy=ImGuiPopupPositionPolicy_Default)
IMGUI_API void MemFree(void *ptr)
IMGUI_API bool IsMousePosValid(const ImVec2 *mouse_pos=NULL)
ImGuiNavMoveFlags NavMoveRequestFlags
IMGUI_API void SetStateStorage(ImGuiStorage *storage)
IMGUI_API void FlattenIntoSingleLayer()
IMGUI_API ImVec2 GetMousePos()
IMGUI_API bool BeginDragDropTargetCustom(const ImRect &bb, ImGuiID id)
ImDrawDataBuilder DrawDataBuilder
IMGUI_API ImGuiWindowSettings * CreateNewWindowSettings(const char *name)
IMGUI_API ImGuiID GetHoveredID()
ImGuiWindow(ImGuiContext *context, const char *name)
bool IsNavInputPressed(ImGuiNavInput n, ImGuiInputReadMode mode)
static ImVec2 CalcSizeAutoFit(ImGuiWindow *window, const ImVec2 &size_contents)
IMGUI_API float GetWindowScrollMaxX(ImGuiWindow *window)
IMGUI_API void EndDragDropSource()
ImGuiID GetIDNoKeepAlive(const char *str, const char *str_end=NULL)
IMGUI_API void EndDragDropTarget()
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type)
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow *window)
IMGUI_API ImVec2 GetContentRegionAvail()
ImVec2 BackupCurrentLineSize
ImGuiID GetIDFromRectangle(const ImRect &r_abs)
ImGuiLayoutType ParentLayoutType
static void NavProcessItem(ImGuiWindow *window, const ImRect &nav_bb, const ImGuiID id)
void * ImFileLoadToMemory(const char *filename, const char *file_open_mode, size_t *out_file_size, int padding_bytes)
IMGUI_API void SetFloat(ImGuiID key, float val)
static void NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir, ImRect &r, const ImRect &clip_rect)
IMGUI_API float GetScrollMaxY()
IMGUI_API void SetCurrentContext(ImGuiContext *ctx)
static const float NAV_WINDOWING_HIGHLIGHT_DELAY
IMGUI_API void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale=1.0f)
ImFontAtlas * ContainerAtlas
IMGUI_API ImDrawList * GetWindowDrawList()
ImGuiWindow * NavLastChildNavWindow
ImVector< ImGuiWindow * > Windows
int ImTextCountUtf8BytesFromChar(const char *in_text, const char *in_text_end)
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
int WantTextInputNextFrame
bool NavWindowingToggleLayer
IMGUI_API bool IsKeyDown(int user_key_index)
IMGUI_API void PopStyleVar(int count=1)
static void SetClipboardTextFn_DefaultImpl(void *user_data, const char *text)
IMGUI_API void SetScrollY(float scroll_y)
ImVec2 MouseDragMaxDistanceAbs[5]
ImVec2 SizeContentsExplicit
ImGuiNavForward NavMoveRequestForward
IMGUI_API void SetTooltipV(const char *fmt, va_list args) IM_FMTLIST(1)
ImGuiID GetID(const char *str, const char *str_end=NULL)
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
static void CheckStacksSize(ImGuiWindow *window, bool write)
IMGUI_API ImVec2 GetWindowContentRegionMin()
IMGUI_API bool BeginPopupContextWindow(const char *str_id=NULL, int mouse_button=1, bool also_over_items=true)
IMGUI_API void KeepAliveID(ImGuiID id)
void Expand(const float amount)
IMGUI_API void BulletText(const char *fmt,...) IM_FMTARGS(1)
ImVector< ImWchar > InputQueueCharacters
int MetricsActiveAllocations
IMGUI_API bool IsAnyItemHovered()
ImGuiInputTextState InputTextState
static void SetWindowSize(ImGuiWindow *window, const ImVec2 &size, ImGuiCond cond)
static void UpdateMouseWheel()
int ImTextStrFromUtf8(ImWchar *buf, int buf_size, const char *in_text, const char *in_text_end, const char **in_text_remaining)
const char * ImStristr(const char *haystack, const char *haystack_end, const char *needle, const char *needle_end)
static void ImSwap(T &a, T &b)
IMGUI_API const char * GetStyleColorName(ImGuiCol idx)
IMGUI_API bool IsMouseDragging(int button=0, float lock_threshold=-1.0f)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags flags=0)
#define IM_F32_TO_INT8_SAT(_VAL)
static float ImLengthSqr(const ImVec2 &lhs)
IMGUI_API ImVec2 GetWindowContentRegionMax()
IMGUI_API int GetInt(ImGuiID key, int default_val=0) const
bool NavInitRequestFromMove
IMGUI_API bool IsRectVisible(const ImVec2 &size)
void ClipWith(const ImRect &r)
ImVec2 SizeFullAtLastBegin
IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio=0.5f)
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled)
ImGuiWindow * NavWindowingTargetAnim
ImU32 ImHash(const void *data, int data_size, ImU32 seed)
float MouseDownDuration[5]
IMGUI_API void Scrollbar(ImGuiLayoutType direction)
IMGUI_API void SetColumnOffset(int column_index, float offset_x)
IMGUI_API void Unindent(float indent_w=0.0f)
void push_front(const T &v)
bool BackupActiveIdPreviousFrameIsAlive
IMGUI_API int GetColumnsCount()
#define IM_COL32(R, G, B, A)
static float ImFabs(float x)
IMGUI_API void FocusWindow(ImGuiWindow *window)
ImVector< ImDrawCmd > CmdBuffer
ImGuiWindow * ActiveIdWindow
ImGuiTextBuffer SettingsIniData
ImGuiWindow * NavWindowingTarget
ImVector< ImGuiStyleMod > StyleModifiers
IMGUI_API void RenderNavHighlight(const ImRect &bb, ImGuiID id, ImGuiNavHighlightFlags flags=ImGuiNavHighlightFlags_TypeDefault)
IMGUI_API void AddText(const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL)
ImGuiDir AutoPosLastDirection
ImRect ContentsRegionRect
ImDrawListSharedData DrawListSharedData
ImGuiID HoveredIdPreviousFrame
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup()
IMGUI_API bool ItemAdd(const ImRect &bb, ImGuiID id, const ImRect *nav_bb=NULL)
float MouseDoubleClickTime
float KeysDownDurationPrev[512]
IMGUI_API ImGuiIO & GetIO()
void ImTriangleBarycentricCoords(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p, float &out_u, float &out_v, float &out_w)
ImVector< ImGuiColumnData > Columns
static T ImMax(T lhs, T rhs)
IMGUI_API void Shutdown(ImGuiContext *context)
IMGUI_API ImGuiWindow * GetFrontMostPopupModal()
int ImGuiNavDirSourceFlags
IMGUI_API ImFont * GetFont()
const char * c_str() const
bool FrameScopePushedImplicitWindow
IMGUI_API void EndGroup()
static int ImTextCharToUtf8(char *buf, int buf_size, unsigned int c)
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow *window)
IMGUI_API int GetColumnIndex()
IMGUI_API bool IsItemDeactivated()
IMGUI_API void ChannelsMerge()
IMGUI_API bool IsKeyReleased(int user_key_index)
IMGUI_API void LogToFile(int max_depth=-1, const char *filename=NULL)
ImGuiID ActiveIdPreviousFrame
short BeginOrderWithinParent
IMGUI_API ImGuiContext * GetCurrentContext()
void ImStrncpy(char *dst, const char *src, size_t count)
IMGUI_API void SetWindowFocus()
ImVector< ImGuiWindow * > WindowsFocusOrder
IMGUI_API bool IsWindowCollapsed()
IMGUI_API void SetNavIDWithRectRel(ImGuiID id, int nav_layer, const ImRect &rect_rel)
static int FindWindowFocusIndex(ImGuiWindow *window)
IMGUI_API void Initialize(ImGuiContext *context)
IMGUI_API float GetContentRegionAvailWidth()
int ImTextCountCharsFromUtf8(const char *in_text, const char *in_text_end)
ImVector< ImGuiWindowSettings > SettingsWindows
IMGUI_API void PushItemWidth(float item_width)
IMGUI_API ImGuiContext * CreateContext(ImFontAtlas *shared_font_atlas=NULL)
IMGUI_API void StartMouseMovingWindow(ImGuiWindow *window)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
ImVec2 ScrollTargetCenterRatio
IMGUI_API void MarkItemEdited(ImGuiID id)
IMGUI_API bool IsItemFocused()
ImGuiWindow * HoveredRootWindow
int FocusIdxTabRequestCurrent
IMGUI_API void Separator()
bool ConfigWindowsMoveFromTitleBarOnly
IMGUI_API void FocusableItemUnregister(ImGuiWindow *window)
IMGUI_API void ItemSize(const ImVec2 &size, float text_offset_y=0.0f)
ImGuiWindow * MovingWindow
IMGUI_API void BeginGroup()
bool FontAllowUserScaling
IMGUI_API void AddCircleFilled(const ImVec2 ¢re, float radius, ImU32 col, int num_segments=12)
const ImWchar * ImStrbolW(const ImWchar *buf_mid_line, const ImWchar *buf_begin)
IMGUI_API float GetScrollX()
IMGUI_API void Begin(int items_count, float items_height=-1.0f)
ImGuiID ScalarAsInputTextId
IMGUI_API void BringWindowToFocusFront(ImGuiWindow *window)
IMGUI_API const ImGuiPayload * GetDragDropPayload()
static void SettingsHandlerWindow_WriteAll(ImGuiContext *imgui_ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf)
ImGuiTextBuffer LogClipboard
#define va_copy(dest, src)
IMGUI_API bool BeginPopupContextVoid(const char *str_id=NULL, int mouse_button=1)
IMGUI_API void SetCursorPosX(float local_x)
float DragDropAcceptIdCurrRectSurface
unsigned int _VtxCurrentIdx
IMGUI_API void SameLine(float local_pos_x=0.0f, float spacing_w=-1.0f)
IMGUI_API float GetColumnWidth(int column_index=-1)
int ImFormatStringV(char *buf, size_t buf_size, const char *fmt, va_list args)
IMGUI_API ImVec2 GetWindowSize()
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow *window)
IMGUI_API void EndPopup()
int HiddenFramesForResize
ImVec2 ImLineClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &p)
void TranslateY(float dy)
ImGuiWindow * NavWindowingList
IMGUI_API ImVec2 GetFontTexUvWhitePixel()
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char *text, const char *text_end, float wrap_width)
short BeginOrderWithinContext
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2 &pos)
static bool ImCharIsBlankA(char c)
IMGUI_API void ClearDragDrop()
IMGUI_API void TextV(const char *fmt, va_list args) IM_FMTLIST(1)
IMGUI_API void RenderBullet(ImVec2 pos)
IMGUI_API void NextColumn()
static float GetColumnWidthEx(ImGuiColumnsSet *columns, int column_index, bool before_resize=false)
ImVector< ImGuiPopupRef > OpenPopupStack
const char * begin() const
ImGuiID BackupActiveIdIsAlive
IMGUI_API float GetWindowHeight()
ImGuiID DragDropAcceptIdPrev
ImGuiCond ContentSizeCond
ImVector< char > PrivateClipboard
static const float WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4 &in)
ImVec2 DisplaySafeAreaPadding
ImGuiCond SetWindowCollapsedAllowFlags
IMGUI_API void AddInputCharactersUTF8(const char *str)
ImRect SizeConstraintRect
IMGUI_API void BeginColumns(const char *str_id, int count, ImGuiColumnsFlags flags=0)
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
IMGUI_API void AddRectFilled(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners_flags=ImDrawCornerFlags_All)
IMGUI_API void PushFont(ImFont *font)
static ImGuiWindow * FindWindowNavFocusable(int i_start, int i_stop, int dir)
ImGuiWindow * CurrentWindow
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiCond cond=0, const ImVec2 &pivot=ImVec2(0, 0))
ImVec2 DisplayWindowPadding
IMGUI_API void SetClipboardText(const char *text)
IMGUI_API void SetBool(ImGuiID key, bool val)
int MetricsRenderVertices
IMGUI_API void appendfv(const char *fmt, va_list args) IM_FMTLIST(2)
IMGUI_API void EndChild()
void Update(int count, float spacing, bool clear)
IMGUI_API float GetWindowContentRegionWidth()
IMGUI_API float GetScrollMaxX()
int DragDropAcceptFrameCount
IMGUI_API float GetTextLineHeightWithSpacing()
IMGUI_API void FocusPreviousWindowIgnoringOne(ImGuiWindow *ignore_window)
int ImStrnicmp(const char *str1, const char *str2, size_t count)
int LogAutoExpandMaxDepth
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
float FramerateSecPerFrame[120]
bool IsNavInputPressedAnyOfTwo(ImGuiNavInput n1, ImGuiNavInput n2, ImGuiInputReadMode mode)
ImVec4 Colors[ImGuiCol_COUNT]
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *format="%d")
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
IMGUI_API float CalcItemWidth()
IMGUI_API void SetInt(ImGuiID key, int val)
ImDrawCallback UserCallback
IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate)
ImRect LastItemDisplayRect
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void LogToTTY(int max_depth=-1)
float MouseDoubleClickMaxDist
ImDrawVert * _VtxWritePtr
ImGuiBackendFlags BackendFlags
IMGUI_API ImVec2 GetCursorScreenPos()
IMGUI_API ImGuiWindow * FindWindowByName(const char *name)
IMGUI_API void NavMoveRequestCancel()
IMGUI_API void PushTextWrapPos(float wrap_local_pos_x=0.0f)
static float GetDraggedColumnOffset(ImGuiColumnsSet *columns, int column_index)
static void NavUpdateAnyRequestFlag()
void(* RenderDrawListsFn)(ImDrawData *data)
IMGUI_API void EndChildFrame()
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags=0)
IMGUI_API void OpenPopupEx(ImGuiID id)
ImGuiDragDropFlags DragDropAcceptFlags
IMGUI_API bool NavMoveRequestButNoResultYet()
IMGUI_API void UpdateMouseMovingWindowEndFrame()
ImVector< ImGuiWindow * > WindowsSortBuffer
IMGUI_API void PopItemWidth()
ImVector< ImGuiSettingsHandler > SettingsHandlers
static ImRect GetViewportRect()
IMGUI_API void SetNextWindowBgAlpha(float alpha)
ImVector< float > TextWrapPosStack
static void SetWindowConditionAllowFlags(ImGuiWindow *window, ImGuiCond flags, bool enabled)
IMGUI_API void SetWindowScrollY(ImGuiWindow *window, float new_scroll_y)
static void AddDrawListToDrawData(ImVector< ImDrawList *> *out_list, ImDrawList *draw_list)
static char EmptyString[1]
IMGUI_API void ScaleAllSizes(float scale_factor)
ImVector< char > InitialText
static void SetupDrawData(ImVector< ImDrawList *> *draw_lists, ImDrawData *draw_data)
ImGuiNavMoveResult NavMoveResultOther
IMGUI_API ImDrawList * GetOverlayDrawList()
static bool IsWindowContentHoverable(ImGuiWindow *window, ImGuiHoveredFlags flags)
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip=true)
IMGUI_API void EndColumns()
ImGuiWindow * ActiveIdPreviousFrameWindow
int FocusIdxAllRequestNext
static void SetCurrentWindow(ImGuiWindow *window)
IMGUI_API void LogText(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool IsItemVisible()
static void NavScrollToBringItemIntoView(ImGuiWindow *window, const ImRect &item_rect)
IMGUI_API double GetTime()
IMGUI_API int * GetIntRef(ImGuiID key, int default_val=0)
static float ImSaturate(float f)
IMGUI_API bool ButtonBehavior(const ImRect &bb, ImGuiID id, bool *out_hovered, bool *out_held, ImGuiButtonFlags flags=0)
void ClipWithFull(const ImRect &r)
IMGUI_API bool BeginDragDropTarget()
static const ImGuiStyleVarInfo GStyleVarInfo[]
IMGUI_API void EndFrame()
IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate)
IMGUI_API float GetTextLineHeight()
static void AddWindowToDrawData(ImVector< ImDrawList *> *out_list, ImGuiWindow *window)
ImGuiID NavActivateDownId
IMGUI_API bool ItemHoverable(const ImRect &bb, ImGuiID id)
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col)
ImVector< ImDrawList * > Layers[2]
static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
ImGuiConfigFlags ConfigFlags
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow *window)
#define IM_OFFSETOF(_TYPE, _MEMBER)
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2 &pos, float radius)
void PathLineTo(const ImVec2 &pos)
ImVector< ImGuiPopupRef > BeginPopupStack
void *(* ReadOpenFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, const char *name)
IMGUI_API int GetFrameCount()
bool HoveredIdAllowOverlap
int NavLayerActiveMaskNext
int WantCaptureKeyboardNextFrame
IMGUI_API const char * GetClipboardText()
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
bool NavMoveFromClampedRefRect
IMGUI_API void SetNextWindowContentSize(const ImVec2 &size)
int index_from_ptr(const T *it) const
static void * GImAllocatorUserData
IMGUI_API void NavInitWindow(ImGuiWindow *window, bool force_reinit)
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key)
IMGUI_API void PopButtonRepeat()
IMGUI_API bool Checkbox(const char *label, bool *v)
IMGUI_API void SetWindowScrollX(ImGuiWindow *window, float new_scroll_x)
ImVector< ImDrawVert > VtxBuffer
static void * SettingsHandlerWindow_ReadOpen(ImGuiContext *, ImGuiSettingsHandler *, const char *name)
static float ImFmod(float x, float y)
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond=0)
IMGUI_API void LoadIniSettingsFromDisk(const char *ini_filename)
ImVec2 MenuBarOffsetMinVal
IMGUI_API float CalcWrapWidthForPos(const ImVec2 &pos, float wrap_pos_x)
ImVector< ImGuiGroupData > GroupStack
ImGuiID NavLastIds[ImGuiNavLayer_COUNT]
IMGUI_API ImVec2 GetItemRectMax()
const ImGuiResizeGripDef resize_grip_def[4]
ImVector< ImGuiColumnsSet > ColumnsStorage
float MouseDragMaxDistanceSqr[5]
IMGUI_API float GetScrollY()
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
ImGuiPayload DragDropPayload
ImVec2 DisplayFramebufferScale
IMGUI_API void LogToClipboard(int max_depth=-1)
static float PixelsToOffsetNorm(const ImGuiColumnsSet *columns, float offset)
IMGUI_API void TabBarQueueChangeTabOrder(ImGuiTabBar *tab_bar, const ImGuiTabItem *tab, int dir)
static ImGuiStorage::Pair * LowerBound(ImVector< ImGuiStorage::Pair > &data, ImGuiID key)
ImRect NavRectRel[ImGuiNavLayer_COUNT]
IMGUI_API const char * GetVersion()
IMGUI_API float GetFrameHeight()
static void NavUpdateWindowingList()
ImGuiItemStatusFlags LastItemStatusFlags
IMGUI_API void PushID(const char *str_id)
bool ActiveIdHasBeenEdited
IMGUI_API ImGuiID GetID(const char *str_id)
IMGUI_API void SetCursorPosY(float local_y)
IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus)
float TitleBarHeight() const
bool Overlaps(const ImRect &r) const
ImVector< ImGuiID > IDStack
ImGuiMouseCursor MouseCursor
ImGuiNextWindowData NextWindowData
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)
static ImVec2 CalcSizeAfterConstraint(ImGuiWindow *window, ImVec2 new_size)
ImGuiWindow * GetCurrentWindow()
IMGUI_API void SetAllInt(int val)
IMGUI_API ImVec2 GetWindowPos()
ImGuiStorage * StateStorage
void(* ReadLineFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, void *entry, const char *line)
IMGUI_API ImGuiStyle & GetStyle()
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float &out_h, float &out_s, float &out_v)
ImVector< ImGuiWindow * > ChildWindows
float CurveTessellationTol
static const ImGuiStyleVarInfo * GetStyleVarInfo(ImGuiStyleVar idx)
IMGUI_API void SetItemAllowOverlap()
IMGUI_API void CloseCurrentPopup()
IMGUI_API void PushClipRectFullScreen()
static void *(* GImAllocatorAllocFunc)(size_t size, void *user_data)
IMGUI_API void PopClipRect()
ImGuiColumnsSet * ColumnsSet
float MouseDownDurationPrev[5]
void ImStrTrimBlanks(char *buf)
IMGUI_API void OpenPopup(const char *str_id)
ImGuiCond SizeConstraintCond
IMGUI_API const char * SaveIniSettingsToMemory(size_t *out_ini_size=NULL)
static bool NavScoreItem(ImGuiNavMoveResult *result, ImRect cand)
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y)
void Translate(const ImVec2 &d)
IMGUI_API ImGuiSettingsHandler * FindSettingsHandler(const char *type_name)
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
FILE * ImFileOpen(const char *filename, const char *mode)
static ImDrawList * GetOverlayDrawList(ImGuiWindow *)
ImGuiNavLayer NavLayerCurrent
static bool BeginChildEx(const char *name, ImGuiID id, const ImVec2 &size_arg, bool border, ImGuiWindowFlags flags)
static const char * GetClipboardTextFn_DefaultImpl(void *user_data)
int ImGuiNavHighlightFlags
ImVec2 BackupCursorMaxPos
bool IsKeyPressedMap(ImGuiKey key, bool repeat=true)
ImVector< ImDrawIdx > IdxBuffer
void reserve(int new_capacity)
static ImVec2 NavCalcPreferredRefPos()
float PrevLineTextBaseOffset
IMGUI_API ImDrawData * GetDrawData()
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow *window, ImGuiWindowFlags flags, ImGuiWindow *parent_window)
ImVector< char > TempBuffer
IMGUI_API void ClearActiveID()
IMGUI_API const ImVec4 & GetStyleColorVec4(ImGuiCol idx)
static ImRect GetResizeBorderRect(ImGuiWindow *window, int border_n, float perp_padding, float thickness)
IMGUI_API void Columns(int count=1, const char *id=NULL, bool border=true)
IMGUI_API void SetWindowFontScale(float scale)
const char * ImStreolRange(const char *str, const char *str_end)
error
Error code indicating why parse failed.
IMGUI_API float GetFrameHeightWithSpacing()
bool DragDropWithinSourceOrTarget
IMGUI_API bool IsMouseDoubleClicked(int button)
static float NavScoreItemDistInterval(float a0, float a1, float b0, float b1)
bool Contains(const ImVec2 &p) const
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, const ImRect &bb_rel, ImGuiNavMoveFlags move_flags)
ImGuiWindow * HoveredWindow
ImGuiID DragDropAcceptIdCurr
IMGUI_API bool IsAnyItemActive()
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
bool NavDisableMouseHover
IMGUI_API bool SetDragDropPayload(const char *type, const void *data, size_t size, ImGuiCond cond=0)
IMGUI_API ImDrawListSharedData * GetDrawListSharedData()
ImVector< unsigned char > DragDropPayloadBufHeap
IMGUI_API void ChannelsSplit(int channels_count)
IMGUI_API float GetCursorPosY()
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
static float GetColumnsRectHalfWidth()
ImVec2 PlatformImeLastPos
IMGUI_API void SetKeyboardFocusHere(int offset=0)
void Add(const ImVec2 &p)
IMGUI_API bool IsClippedEx(const ImRect &bb, ImGuiID id, bool clip_even_when_logged)
IMGUI_API void LogFinish()
ImGuiWindow * GetCurrentWindowRead()
IMGUI_API void SetScrollX(float scroll_x)
bool IsNavInputDown(ImGuiNavInput n)
IMGUI_API bool GetBool(ImGuiID key, bool default_val=false) const
bool ActiveIdPreviousFrameHasBeenEdited
ImGuiCond SetWindowSizeAllowFlags
IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in)
float MenuBarHeight() const
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
static void NavUpdateWindowing()
IMGUI_API void PopStyleColor(int count=1)
ImVector< ImWchar > TextW
static void SetWindowPos(ImGuiWindow *window, const ImVec2 &pos, ImGuiCond cond)
static T ImMin(T lhs, T rhs)
ImGuiID NavNextActivateId
ImGuiInputSource ActiveIdSource
ImVector< ImVec4 > _ClipRectStack
IMGUI_API bool IsAnyMouseDown()
IMGUI_API bool IsPopupOpen(const char *str_id)
IMGUI_API void SetWindowSize(const ImVec2 &size, ImGuiCond cond=0)
float NavWindowingHighlightAlpha