329 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
330 #define _CRT_SECURE_NO_WARNINGS
341 #pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
342 #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
347 #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
348 #pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
349 #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.
350 #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.
351 #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it.
352 #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness //
355 #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
362 struct ImGuiTextEditState;
368 #ifdef IMGUI_STB_NAMESPACE
369 namespace IMGUI_STB_NAMESPACE
374 #pragma clang diagnostic push
375 #pragma clang diagnostic ignored "-Wunused-function"
376 #pragma clang diagnostic ignored "-Wmissing-prototypes"
379 #define STBRP_ASSERT(x) IM_ASSERT(x)
380 #ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
382 #define STB_RECT_PACK_IMPLEMENTATION
386 #define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x))
387 #define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x))
388 #define STBTT_assert(x) IM_ASSERT(x)
389 #ifndef IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
391 #define STB_TRUETYPE_IMPLEMENTATION
395 #define STB_TEXTEDIT_STRING ImGuiTextEditState
396 #define STB_TEXTEDIT_CHARTYPE ImWchar
400 #pragma clang diagnostic pop
403 #ifdef IMGUI_STB_NAMESPACE
405 using namespace IMGUI_STB_NAMESPACE;
413 struct ImGuiStyleMod;
415 struct ImGuiDrawContext;
416 struct ImGuiTextEditState;
421 static bool ButtonBehaviour(
const ImGuiAabb& bb,
const ImGuiID&
id,
bool* out_hovered,
bool* out_held,
bool allow_key_modifiers,
bool repeat =
false,
bool pressed_on_click =
false);
422 static void LogText(
const ImVec2& ref_pos,
const char* text,
const char* text_end = NULL);
424 static void RenderText(
ImVec2 pos,
const char* text,
const char* text_end = NULL,
bool hide_text_after_hash =
true);
433 static void ItemSize(
const ImGuiAabb& bb,
ImVec2* adjust_start_offset = NULL);
435 static bool IsClipped(
const ImGuiAabb& bb);
440 static void Scrollbar(ImGuiWindow* window);
446 static int ImStricmp(
const char* str1,
const char* str2);
447 static int ImStrnicmp(
const char* str1,
const char* str2,
int count);
448 static char*
ImStrdup(
const char *str);
450 static const char*
ImStristr(
const char* haystack,
const char* needle,
const char* needle_end);
451 static size_t ImFormatString(
char* buf,
size_t buf_size,
const char* fmt, ...);
452 static size_t ImFormatStringV(
char* buf,
size_t buf_size,
const char* fmt, va_list args);
456 static bool ImLoadFileToMemory(
const char* filename,
const char* file_open_mode,
void** out_file_data,
size_t* out_file_size,
size_t padding_bytes = 0);
457 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; }
458 static inline bool ImCharIsSpace(
int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
461 static int ImTextCharToUtf8(
char* buf,
size_t buf_size,
unsigned int in_char);
463 static int ImTextCharFromUtf8(
unsigned int* out_char,
const char* in_text,
const char* in_text_end);
464 static ptrdiff_t
ImTextStrFromUtf8(
ImWchar* buf,
size_t buf_size,
const char* in_text,
const char* in_text_end,
const char** in_remaining = NULL);
494 WindowPadding =
ImVec2(8,8);
495 WindowMinSize =
ImVec2(32,32);
496 WindowRounding = 9.0f;
497 ChildWindowRounding = 0.0f;
498 FramePadding =
ImVec2(4,3);
499 FrameRounding = 0.0f;
500 ItemSpacing =
ImVec2(8,4);
501 ItemInnerSpacing =
ImVec2(4,4);
502 TouchExtraPadding =
ImVec2(0,0);
503 AutoFitPadding =
ImVec2(8,8);
504 WindowFillAlphaDefault = 0.70f;
505 TreeNodeSpacing = 22.0f;
506 ColumnsMinSpacing = 6.0f;
507 ScrollbarWidth = 16.0f;
558 memset(
this, 0,
sizeof(*
this));
560 DisplaySize =
ImVec2(-1.0f, -1.0f);
561 DeltaTime = 1.0f/60.0f;
562 IniSavingRate = 5.0f;
563 IniFilename =
"imgui.ini";
564 LogFilename =
"imgui_log.txt";
566 FontGlobalScale = 1.0f;
568 MousePosPrev =
ImVec2(-1,-1);
569 MouseDoubleClickTime = 0.30f;
570 MouseDoubleClickMaxDist = 6.0f;
574 RenderDrawListsFn = NULL;
587 const size_t n =
ImStrlenW(InputCharacters);
588 if (n + 1 <
sizeof(InputCharacters) /
sizeof(InputCharacters[0]))
590 InputCharacters[n] = c;
591 InputCharacters[n+1] = 0;
599 #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
602 const float PI = 3.14159265358979323846f;
605 #define IM_INT_MAX INT_MAX
607 #define IM_INT_MAX 2147483647
612 #define STR_NEWLINE "\r\n"
614 #define STR_NEWLINE "\n"
630 static inline int ImMin(
int lhs,
int rhs) {
return lhs < rhs ? lhs : rhs; }
631 static inline int ImMax(
int lhs,
int rhs) {
return lhs >= rhs ? lhs : rhs; }
632 static inline float ImMin(
float lhs,
float rhs) {
return lhs < rhs ? lhs : rhs; }
633 static inline float ImMax(
float lhs,
float rhs) {
return lhs >= rhs ? lhs : rhs; }
636 static inline int ImClamp(
int v,
int mn,
int mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
637 static inline float ImClamp(
float v,
float mn,
float mx) {
return (v < mn) ? mn : (v > mx) ? mx : v; }
639 static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
640 static inline float ImLerp(
float a,
float b,
float t) {
return a + (b - a) * t; }
644 static int ImStricmp(
const char* str1,
const char* str2)
647 while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
651 static int ImStrnicmp(
const char* str1,
const char* str2,
int count)
654 while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
673 static const char*
ImStristr(
const char* haystack,
const char* needle,
const char* needle_end)
676 needle_end = needle + strlen(needle);
678 const char un0 = (char)toupper(*needle);
681 if (toupper(*haystack) == un0)
683 const char* b = needle + 1;
684 for (
const char* a = haystack + 1; b < needle_end; a++, b++)
685 if (toupper(*a) != toupper(*b))
699 static ImU32 crc32_lut[256] = { 0 };
702 const ImU32 polynomial = 0xEDB88320;
703 for (
ImU32 i = 0; i < 256; i++)
706 for (
ImU32 j = 0; j < 8; j++)
707 crc = (crc >> 1) ^ (
ImU32(-
int(crc & 1)) & polynomial);
714 const unsigned char* current = (
const unsigned char*)data;
720 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
725 while (
unsigned char c = *current++)
731 if (c ==
'#' && current[0] ==
'#' && current[1] ==
'#')
734 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
744 int w = vsnprintf(buf, buf_size, fmt, args);
747 return (w == -1) ? buf_size : (size_t)w;
750 static size_t ImFormatStringV(
char* buf,
size_t buf_size,
const char* fmt, va_list args)
752 int w = vsnprintf(buf, buf_size, fmt, args);
754 return (w == -1) ? buf_size : (size_t)w;
773 const float tmp = g; g = b; b = tmp;
778 const float tmp = r; r = g; g = tmp;
782 const float chroma = r - (g < b ? g : b);
783 out_h = fabsf(K + (g - b) / (6.f * chroma + 1e-20f));
784 out_s = chroma / (r + 1e-20f);
795 out_r = out_g = out_b = v;
799 h = fmodf(h, 1.0f) / (60.0f/360.0f);
801 float f = h - (float)i;
802 float p = v * (1.0f - s);
803 float q = v * (1.0f - s * f);
804 float t = v * (1.0f - s * (1.0f - f));
808 case 0: out_r = v; out_g = t; out_b = p;
break;
809 case 1: out_r = q; out_g = v; out_b = p;
break;
810 case 2: out_r = p; out_g = v; out_b = t;
break;
811 case 3: out_r = p; out_g = q; out_b = v;
break;
812 case 4: out_r = t; out_g = p; out_b = v;
break;
813 case 5:
default: out_r = v; out_g = p; out_b = q;
break;
819 static bool ImLoadFileToMemory(
const char* filename,
const char* file_open_mode,
void** out_file_data,
size_t* out_file_size,
size_t padding_bytes)
821 IM_ASSERT(filename && file_open_mode && out_file_data && out_file_size);
823 *out_file_data = NULL;
827 if ((f = fopen(filename, file_open_mode)) == NULL)
830 long file_size_signed;
831 if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET))
837 size_t file_size = (size_t)file_size_signed;
839 if (file_data == NULL)
844 if (fread(file_data, 1, file_size, f) != file_size)
850 if (padding_bytes > 0)
851 memset((
void *)(((
char*)file_data) + file_size), 0, padding_bytes);
854 *out_file_data = file_data;
855 *out_file_size = file_size;
879 ImGuiAabb() { Min =
ImVec2(FLT_MAX,FLT_MAX); Max =
ImVec2(-FLT_MAX,-FLT_MAX); }
880 ImGuiAabb(
const ImVec2& min,
const ImVec2& max) { Min = min; Max = max; }
881 ImGuiAabb(
const ImVec4& v) { Min.
x = v.
x; Min.
y = v.
y; Max.
x = v.
z; Max.
y = v.
w; }
882 ImGuiAabb(
float x1,
float y1,
float x2,
float y2) { Min.
x = x1; Min.
y = y1; Max.
x = x2; Max.
y = y2; }
884 ImVec2 GetCenter()
const {
return Min + (Max-Min)*0.5f; }
885 ImVec2 GetSize()
const {
return Max-Min; }
886 float GetWidth()
const {
return (Max-Min).
x; }
887 float GetHeight()
const {
return (Max-Min).y; }
888 ImVec2 GetTL()
const {
return Min; }
891 ImVec2 GetBR()
const {
return Max; }
892 bool Contains(
const ImVec2& p)
const {
return p.
x >= Min.
x && p.
y >= Min.
y && p.
x <= Max.
x && p.
y <= Max.
y; }
893 bool Contains(
const ImGuiAabb& r)
const {
return r.Min.x >= Min.
x && r.Min.y >= Min.
y && r.Max.x <= Max.
x && r.Max.y <= Max.
y; }
894 bool Overlaps(
const ImGuiAabb& r)
const {
return r.Min.y <= Max.
y && r.Max.y >= Min.
y && r.Min.x <= Max.
x && r.Max.x >= Min.
x; }
896 void Add(
const ImGuiAabb& rhs) { Min.
x =
ImMin(Min.
x, rhs.Min.x); Min.
y =
ImMin(Min.
y, rhs.Min.y); Max.
x =
ImMax(Max.
x, rhs.Max.x); Max.
y =
ImMax(Max.
y, rhs.Max.y); }
897 void Expand(
const ImVec2& sz) { Min -= sz; Max += sz; }
898 void Clip(
const ImGuiAabb& clip) { Min.
x =
ImMax(Min.
x, clip.Min.x); Min.
y =
ImMax(Min.
y, clip.Min.y); Max.
x =
ImMin(Max.
x, clip.Max.x); Max.
y =
ImMin(Max.
y, clip.Max.y); }
902 struct ImGuiDrawContext
907 float CurrentLineHeight;
908 float PrevLineHeight;
912 ImGuiAabb LastItemAabb;
913 bool LastItemHovered;
922 float ColumnsOffsetX;
926 float ColumnsCellMinY;
927 float ColumnsCellMaxY;
928 bool ColumnsShowBorders;
934 CursorPos = CursorPosPrevLine = CursorStartPos =
ImVec2(0.0f, 0.0f);
935 CurrentLineHeight = PrevLineHeight = 0.0f;
936 LogLineHeight = -1.0f;
939 LastItemAabb = ImGuiAabb(0.0f,0.0f,0.0f,0.0f);
940 LastItemHovered =
false;
943 ColumnsStartX = 0.0f;
944 ColumnsOffsetX = 0.0f;
947 ColumnsStartPos =
ImVec2(0.0f, 0.0f);
948 ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
949 ColumnsShowBorders =
true;
955 struct ImGuiTextEditState
959 char InitialText[1024*4+1];
960 size_t CurLenA, CurLenW;
966 ImVec2 InputCursorScreenPos;
967 bool SelectedAllMouseLock;
971 ImGuiTextEditState() { memset(
this, 0,
sizeof(*
this)); }
973 void CursorAnimReset() { CursorAnim = -0.30f; }
974 bool CursorIsVisible()
const {
return CursorAnim <= 0.0f || fmodf(CursorAnim, 1.20f) <= 0.80f; }
978 void OnKeyPressed(
int key);
979 void UpdateScrollOffset();
980 ImVec2 CalcDisplayOffsetFromCharIdx(
int i)
const;
983 static const char* GetTextPointerClippedA(
ImFont* font,
float font_size,
const char* text,
float width,
ImVec2* out_text_size = NULL);
984 static const ImWchar* GetTextPointerClippedW(
ImFont* font,
float font_size,
const ImWchar* text,
float width,
ImVec2* out_text_size = NULL);
985 static void RenderTextScrolledClipped(
ImFont* font,
float font_size,
const char* text,
ImVec2 pos_base,
float width,
float scroll_x);
997 ImGuiIniData() { memset(
this, 0,
sizeof(*
this)); }
998 ~ImGuiIniData() {
if (Name) {
ImGui::MemFree(Name); Name = NULL; } }
1009 ImVec2 FontTexUvWhitePixel;
1013 int FrameCountRendered;
1015 ImGuiWindow* CurrentWindow;
1017 ImGuiWindow* FocusedWindow;
1018 ImGuiWindow* HoveredWindow;
1019 ImGuiWindow* HoveredRootWindow;
1022 ImGuiID ActiveIdPreviousFrame;
1023 bool ActiveIdIsAlive;
1024 bool ActiveIdIsFocusedOnly;
1025 ImGuiWindow* MovedWindow;
1026 float SettingsDirtyTimer;
1032 ImVec2 SetNextWindowPosVal;
1034 ImVec2 SetNextWindowSizeVal;
1036 bool SetNextWindowCollapsedVal;
1039 bool SetNextTreeNodeOpenedVal;
1047 ImGuiTextEditState InputTextState;
1051 float ScrollbarClickDeltaToGrabCenter;
1053 char* PrivateClipboard;
1060 int LogAutoExpandMaxDepth;
1063 float FramerateSecPerFrame[120];
1064 int FramerateSecPerFrameIdx;
1065 float FramerateSecPerFrameAccum;
1069 Initialized =
false;
1072 FontTexUvWhitePixel =
ImVec2(0.0f, 0.0f);
1076 FrameCountRendered = -1;
1077 CurrentWindow = NULL;
1078 FocusedWindow = NULL;
1079 HoveredWindow = NULL;
1080 HoveredRootWindow = NULL;
1083 ActiveIdPreviousFrame = 0;
1084 ActiveIdIsAlive =
false;
1085 ActiveIdIsFocusedOnly =
false;
1087 SettingsDirtyTimer = 0.0f;
1089 SetNextWindowPosVal =
ImVec2(0.0f, 0.0f);
1090 SetNextWindowPosCond = 0;
1091 SetNextWindowSizeVal =
ImVec2(0.0f, 0.0f);
1092 SetNextWindowSizeCond = 0;
1093 SetNextWindowCollapsedVal =
false;
1094 SetNextWindowCollapsedCond = 0;
1095 SetNextWindowFocus =
false;
1096 SetNextTreeNodeOpenedVal =
false;
1097 SetNextTreeNodeOpenedCond = 0;
1099 SliderAsInputTextId = 0;
1101 ScrollbarClickDeltaToGrabCenter = 0.0f;
1102 memset(Tooltip, 0,
sizeof(Tooltip));
1103 PrivateClipboard = NULL;
1107 LogClipboard = NULL;
1109 LogAutoExpandMaxDepth = 2;
1111 memset(FramerateSecPerFrame, 0,
sizeof(FramerateSecPerFrame));
1112 FramerateSecPerFrameIdx = 0;
1113 FramerateSecPerFrameAccum = 0.0f;
1130 ImVec2 SizeContentsCurrent;
1139 bool AutoFitOnlyGrows;
1140 int SetWindowPosAllowFlags;
1141 int SetWindowSizeAllowFlags;
1142 int SetWindowCollapsedAllowFlags;
1144 ImGuiDrawContext DC;
1147 ImGuiAabb ClippedAabb;
1149 float ItemWidthDefault;
1151 float FontWindowScale;
1153 ImGuiWindow* RootWindow;
1156 int FocusIdxAllCounter;
1157 int FocusIdxTabCounter;
1158 int FocusIdxAllRequestCurrent;
1159 int FocusIdxTabRequestCurrent;
1160 int FocusIdxAllRequestNext;
1161 int FocusIdxTabRequestNext;
1164 ImGuiWindow(
const char* name);
1170 void AddToRenderList();
1171 bool FocusItemRegister(
bool is_active,
bool tab_stop =
true);
1172 void FocusItemUnregister();
1174 ImGuiAabb Aabb()
const {
return ImGuiAabb(Pos, Pos+Size); }
1175 ImFont* Font()
const {
return GImGui->Font; }
1176 float FontSize()
const {
return GImGui->FontSize * FontWindowScale; }
1177 ImVec2 CursorPos()
const {
return DC.CursorPos; }
1178 float TitleBarHeight()
const {
return (Flags &
ImGuiWindowFlags_NoTitleBar) ? 0 : FontSize() + GImGui->Style.FramePadding.y * 2.0f; }
1179 ImGuiAabb TitleBarAabb()
const {
return ImGuiAabb(Pos, Pos +
ImVec2(SizeFull.
x, TitleBarHeight())); }
1189 g.CurrentWindow->Accessed =
true;
1190 return g.CurrentWindow;
1196 IM_ASSERT(g.CurrentWindowStack.size() >= 2);
1197 return g.CurrentWindowStack[g.CurrentWindowStack.size() - 2];
1204 g.ActiveIdIsFocusedOnly =
false;
1210 if (g.ActiveId ==
id)
1211 g.ActiveIdIsAlive =
true;
1227 int count = (int)(last - first);
1230 int count2 = count / 2;
1235 count -= count2 + 1;
1248 if (it == Data.
end() || it->key != key)
1256 if (it == Data.
end() || it->key != key)
1264 if (it == Data.
end() || it->key != key)
1273 if (it == Data.
end() || it->key != key)
1274 it = Data.
insert(it,
Pair(key, default_val));
1281 if (it == Data.
end() || it->key != key)
1282 it = Data.
insert(it,
Pair(key, default_val));
1291 if (it == Data.
end() || it->key != key)
1293 Data.insert(it,
Pair(key, val));
1302 if (it == Data.
end() || it->key != key)
1304 Data.insert(it,
Pair(key, val));
1313 if (it == Data.
end() || it->key != key)
1315 Data.insert(it,
Pair(key, val));
1323 for (
size_t i = 0; i < Data.size(); i++)
1358 const char* we = wb;
1361 if (*we == separator)
1375 TextRange input_range(InputBuf, InputBuf+strlen(InputBuf));
1376 input_range.
split(
',', Filters);
1379 for (
size_t i = 0; i != Filters.size(); i++)
1381 Filters[i].trim_blanks();
1382 if (Filters[i].empty())
1384 if (Filters[i].front() !=
'-')
1391 if (Filters.empty())
1397 for (
size_t i = 0; i != Filters.size(); i++)
1402 if (f.
front() ==
'-')
1428 #define va_copy(dest, src) (dest = src)
1437 int len = vsnprintf(NULL, 0, fmt, args);
1441 const size_t write_off = Buf.size();
1442 const size_t needed_sz = write_off + (size_t)len;
1443 if (write_off + (
size_t)len >= Buf.capacity())
1445 const size_t double_capacity = Buf.capacity() * 2;
1446 Buf.reserve(needed_sz > double_capacity ? needed_sz : double_capacity);
1449 Buf.resize(needed_sz);
1456 va_start(args, fmt);
1463 ImGuiWindow::ImGuiWindow(
const char* name)
1467 IDStack.push_back(ID);
1470 PosFloat = Pos =
ImVec2(0.0f, 0.0f);
1471 Size = SizeFull =
ImVec2(0.0f, 0.0f);
1472 SizeContents = SizeContentsCurrent =
ImVec2(0.0f, 0.0f);
1481 AutoFitOnlyGrows =
false;
1484 LastFrameDrawn = -1;
1485 ItemWidthDefault = 0.0f;
1486 FontWindowScale = 1.0f;
1491 AutoFitOnlyGrows =
true;
1498 FocusIdxAllCounter = FocusIdxTabCounter = -1;
1499 FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent =
IM_INT_MAX;
1500 FocusIdxAllRequestNext = FocusIdxTabRequestNext =
IM_INT_MAX;
1503 ImGuiWindow::~ImGuiWindow()
1505 DrawList->~ImDrawList();
1514 ImGuiID seed = IDStack.back();
1522 ImGuiID seed = IDStack.back();
1528 bool ImGuiWindow::FocusItemRegister(
bool is_active,
bool tab_stop)
1533 const bool allow_keyboard_focus = window->DC.AllowKeyboardFocus.back();
1534 FocusIdxAllCounter++;
1535 if (allow_keyboard_focus)
1536 FocusIdxTabCounter++;
1543 FocusIdxTabRequestNext = FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1);
1546 if (FocusIdxAllCounter == FocusIdxAllRequestCurrent)
1549 if (allow_keyboard_focus)
1550 if (FocusIdxTabCounter == FocusIdxTabRequestCurrent)
1556 void ImGuiWindow::FocusItemUnregister()
1558 FocusIdxAllCounter--;
1559 FocusIdxTabCounter--;
1562 void ImGuiWindow::AddToRenderList()
1566 if (!DrawList->commands.empty() && !DrawList->vtx_buffer.empty())
1568 if (DrawList->commands.back().vtx_count == 0)
1569 DrawList->commands.pop_back();
1570 g.RenderDrawLists.push_back(DrawList);
1572 for (
size_t i = 0; i < DC.ChildWindows.size(); i++)
1574 ImGuiWindow* child = DC.ChildWindows[i];
1576 child->AddToRenderList();
1584 return GImGui->IO.MemAllocFn(sz);
1589 return GImGui->IO.MemFreeFn(ptr);
1596 for (
size_t i = 0; i != g.Settings.size(); i++)
1598 ImGuiIniData* ini = g.Settings[i];
1607 ImGuiIniData* ini = (ImGuiIniData*)
ImGui::MemAlloc(
sizeof(ImGuiIniData));
1608 new(ini) ImGuiIniData();
1610 ini->ID =
ImHash(name, 0);
1611 ini->Collapsed =
false;
1612 ini->Pos =
ImVec2(FLT_MAX,FLT_MAX);
1614 GImGui->Settings.push_back(ini);
1623 const char* filename = g.IO.IniFilename;
1632 ImGuiIniData* settings = NULL;
1633 const char* buf_end = file_data + file_size;
1634 for (
const char* line_start = file_data; line_start < buf_end; )
1636 const char* line_end = line_start;
1637 while (line_end < buf_end && *line_end !=
'\n' && *line_end !=
'\r')
1640 if (line_start[0] ==
'[' && line_end > line_start && line_end[-1] ==
']')
1652 if (sscanf(line_start,
"Pos=%f,%f", &x, &y) == 2)
1653 settings->Pos =
ImVec2(x, y);
1654 else if (sscanf(line_start,
"Size=%f,%f", &x, &y) == 2)
1655 settings->Size =
ImMax(
ImVec2(x, y), g.Style.WindowMinSize);
1656 else if (sscanf(line_start,
"Collapsed=%d", &i) == 1)
1657 settings->Collapsed = (i != 0);
1660 line_start = line_end+1;
1669 const char* filename = g.IO.IniFilename;
1674 for (
size_t i = 0; i != g.Windows.size(); i++)
1676 ImGuiWindow* window = g.Windows[i];
1680 settings->Pos = window->Pos;
1681 settings->Size = window->SizeFull;
1682 settings->Collapsed = window->Collapsed;
1687 FILE* f = fopen(filename,
"wt");
1690 for (
size_t i = 0; i != g.Settings.size(); i++)
1692 const ImGuiIniData* settings = g.Settings[i];
1693 if (settings->Pos.x == FLT_MAX)
1695 const char* name = settings->Name;
1696 if (
const char* p = strstr(name,
"###"))
1698 fprintf(f,
"[%s]\n", name);
1699 fprintf(f,
"Pos=%d,%d\n", (
int)settings->Pos.x, (
int)settings->Pos.y);
1700 fprintf(f,
"Size=%d,%d\n", (
int)settings->Size.x, (
int)settings->Size.y);
1701 fprintf(f,
"Collapsed=%d\n", settings->Collapsed);
1712 if (g.SettingsDirtyTimer <= 0.0f)
1713 g.SettingsDirtyTimer = g.IO.IniSavingRate;
1725 return sizeof(ImGuiState);
1731 new (state) ImGuiState();
1733 GImGui = (ImGuiState*)state;
1743 return GImGui->Style;
1752 IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f);
1753 IM_ASSERT(g.IO.RenderDrawListsFn != NULL);
1754 IM_ASSERT(g.IO.Fonts->Fonts.size() > 0);
1755 IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded());
1765 g.Initialized =
true;
1768 SetFont(g.IO.Fonts->Fonts[0]);
1770 g.Time += g.IO.DeltaTime;
1772 g.Tooltip[0] =
'\0';
1775 if (g.IO.MousePos.x < 0 && g.IO.MousePos.y < 0)
1776 g.IO.MousePos =
ImVec2(-9999.0f, -9999.0f);
1777 if ((g.IO.MousePos.x < 0 && g.IO.MousePos.y < 0) || (g.IO.MousePosPrev.x < 0 && g.IO.MousePosPrev.y < 0))
1778 g.IO.MouseDelta =
ImVec2(0.0f, 0.0f);
1780 g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev;
1781 g.IO.MousePosPrev = g.IO.MousePos;
1782 for (
size_t i = 0; i <
IM_ARRAYSIZE(g.IO.MouseDown); i++)
1784 g.IO.MouseDownTime[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownTime[i] < 0.0f ? 0.0f : g.IO.MouseDownTime[i] + g.IO.DeltaTime) : -1.0f;
1785 g.IO.MouseClicked[i] = (g.IO.MouseDownTime[i] == 0.0f);
1786 g.IO.MouseDoubleClicked[i] =
false;
1787 if (g.IO.MouseClicked[i])
1789 if (g.Time - g.IO.MouseClickedTime[i] < g.IO.MouseDoubleClickTime)
1791 if (
ImLengthSqr(g.IO.MousePos - g.IO.MouseClickedPos[i]) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist)
1792 g.IO.MouseDoubleClicked[i] =
true;
1793 g.IO.MouseClickedTime[i] = -FLT_MAX;
1797 g.IO.MouseClickedTime[i] = g.Time;
1798 g.IO.MouseClickedPos[i] = g.IO.MousePos;
1802 for (
size_t i = 0; i <
IM_ARRAYSIZE(g.IO.KeysDown); i++)
1803 g.IO.KeysDownTime[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownTime[i] < 0.0f ? 0.0f : g.IO.KeysDownTime[i] + g.IO.DeltaTime) : -1.0f;
1806 g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx];
1807 g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx] = g.IO.DeltaTime;
1808 g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) %
IM_ARRAYSIZE(g.FramerateSecPerFrame);
1809 g.IO.Framerate = 1.0f / (g.FramerateSecPerFrameAccum / (float)
IM_ARRAYSIZE(g.FramerateSecPerFrame));
1813 if (!g.ActiveIdIsAlive && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
1815 g.ActiveIdPreviousFrame = g.ActiveId;
1816 g.ActiveIdIsAlive =
false;
1818 g.MovedWindow = NULL;
1821 if (g.SettingsDirtyTimer > 0.0f)
1823 g.SettingsDirtyTimer -= g.IO.DeltaTime;
1824 if (g.SettingsDirtyTimer <= 0.0f)
1831 g.HoveredRootWindow = g.HoveredWindow->RootWindow;
1837 int mouse_earliest_button_down = -1;
1840 if (g.IO.MouseClicked[i])
1841 g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL);
1842 if (g.IO.MouseDown[i])
1843 if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
1844 mouse_earliest_button_down = i;
1846 bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
1847 g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (g.ActiveId != 0);
1848 g.IO.WantCaptureKeyboard = (g.ActiveId != 0);
1851 if (mouse_owned_by_application)
1852 g.HoveredWindow = g.HoveredRootWindow = NULL;
1855 if (g.HoveredWindow && g.IO.MouseWheel != 0.0f)
1857 ImGuiWindow* window = g.HoveredWindow;
1860 if (g.IO.FontAllowUserScaling)
1863 float new_font_scale =
ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f);
1864 float scale = new_font_scale / window->FontWindowScale;
1865 window->FontWindowScale = new_font_scale;
1867 const ImVec2 offset = window->Size * (1.0f -
scale) * (g.IO.MousePos - window->Pos) / window->Size;
1868 window->Pos += offset;
1869 window->PosFloat += offset;
1870 window->Size *=
scale;
1871 window->SizeFull *=
scale;
1880 window->NextScrollY -= g.IO.MouseWheel * window->FontSize() * scroll_lines;
1889 g.FocusedWindow->FocusIdxTabRequestNext = 0;
1893 for (
size_t i = 0; i != g.Windows.size(); i++)
1895 ImGuiWindow* window = g.Windows[i];
1896 window->Visible =
false;
1897 window->Accessed =
false;
1902 g.CurrentWindowStack.resize(0);
1917 for (
size_t i = 0; i < g.Windows.size(); i++)
1919 g.Windows[i]->~ImGuiWindow();
1923 g.CurrentWindowStack.clear();
1924 g.RenderDrawLists.clear();
1925 g.FocusedWindow = NULL;
1926 g.HoveredWindow = NULL;
1927 g.HoveredRootWindow = NULL;
1928 for (
size_t i = 0; i < g.Settings.size(); i++)
1930 g.Settings[i]->~ImGuiIniData();
1934 g.ColorModifiers.clear();
1935 g.StyleModifiers.clear();
1936 g.FontStack.clear();
1937 g.ColorEditModeStorage.Clear();
1938 if (g.LogFile && g.LogFile != stdout)
1943 g.IO.Fonts->Clear();
1945 if (g.PrivateClipboard)
1948 g.PrivateClipboard = NULL;
1953 g.LogClipboard->~ImGuiTextBuffer();
1957 g.Initialized =
false;
1963 const ImGuiWindow* a = *(
const ImGuiWindow**)lhs;
1964 const ImGuiWindow* b = *(
const ImGuiWindow**)rhs;
1975 if (window->Visible)
1977 const size_t count = window->DC.ChildWindows.size();
1980 for (
size_t i = 0; i < count; i++)
1982 ImGuiWindow* child = window->DC.ChildWindows[i];
1994 if (clipped && !window->ClipRectStack.empty())
1997 const ImVec4 cur_cr = window->ClipRectStack.back();
2001 window->ClipRectStack.push_back(cr);
2002 window->DrawList->PushClipRect(cr);
2008 window->ClipRectStack.pop_back();
2009 window->DrawList->PopClipRect();
2017 const bool first_render_of_the_frame = (g.FrameCountRendered != g.FrameCount);
2018 g.FrameCountRendered = g.FrameCount;
2020 if (first_render_of_the_frame)
2023 IM_ASSERT(g.CurrentWindowStack.size() == 1);
2024 if (g.CurrentWindow && !g.CurrentWindow->Accessed)
2025 g.CurrentWindow->Visible =
false;
2029 if (g.ActiveId == 0 && g.HoveredId == 0 && g.HoveredRootWindow != NULL && g.IO.MouseClicked[0])
2032 g.MovedWindow = g.HoveredWindow;
2038 g.RenderSortedWindows.resize(0);
2039 g.RenderSortedWindows.reserve(g.Windows.size());
2040 for (
size_t i = 0; i != g.Windows.size(); i++)
2042 ImGuiWindow* window = g.Windows[i];
2044 if (window->Visible)
2048 IM_ASSERT(g.Windows.size() == g.RenderSortedWindows.size());
2049 g.Windows.swap(g.RenderSortedWindows);
2052 g.IO.MouseWheel = 0.0f;
2053 memset(g.IO.InputCharacters, 0,
sizeof(g.IO.InputCharacters));
2058 if (g.Style.Alpha > 0.0f)
2070 g.RenderDrawLists.resize(0);
2071 for (
size_t i = 0; i != g.Windows.size(); i++)
2073 ImGuiWindow* window = g.Windows[i];
2075 window->AddToRenderList();
2077 for (
size_t i = 0; i != g.Windows.size(); i++)
2079 ImGuiWindow* window = g.Windows[i];
2081 window->AddToRenderList();
2084 if (g.IO.MouseDrawCursor)
2086 const ImVec2 pos = g.IO.MousePos;
2089 const ImVec2 tex_uv_scale(1.0f/g.IO.Fonts->TexWidth, 1.0f/g.IO.Fonts->TexHeight);
2096 g.RenderDrawLists.push_back(&draw_list);
2100 if (!g.RenderDrawLists.empty())
2101 g.IO.RenderDrawListsFn(&g.RenderDrawLists[0], (
int)g.RenderDrawLists.size());
2102 g.RenderDrawLists.resize(0);
2109 const char* text_display_end = text;
2111 text_end = (
const char*)-1;
2112 while (text_display_end < text_end && *text_display_end !=
'\0' && (text_display_end[0] !=
'#' || text_display_end[1] !=
'#'))
2114 return text_display_end;
2125 va_start(args, fmt);
2128 vfprintf(g.LogFile, fmt, args);
2132 g.LogClipboard->appendv(fmt, args);
2139 static void LogText(
const ImVec2& ref_pos,
const char* text,
const char* text_end)
2147 const bool log_new_line = ref_pos.
y > window->DC.LogLineHeight+1;
2148 window->DC.LogLineHeight = ref_pos.
y;
2150 const char* text_remaining = text;
2151 if (g.LogStartDepth > window->DC.TreeDepth)
2152 g.LogStartDepth = window->DC.TreeDepth;
2153 const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth);
2157 const char* line_end = text_remaining;
2158 while (line_end < text_end)
2159 if (*line_end ==
'\n')
2163 if (line_end >= text_end)
2166 const bool is_first_line = (text == text_remaining);
2167 bool is_last_line =
false;
2168 if (line_end == NULL)
2170 is_last_line =
true;
2171 line_end = text_end;
2173 if (line_end != NULL && !(is_last_line && (line_end - text_remaining)==0))
2175 const int char_count = (int)(line_end - text_remaining);
2176 if (log_new_line || !is_first_line)
2184 text_remaining = line_end + 1;
2190 if (wrap_pos_x < 0.0f)
2194 if (wrap_pos_x == 0.0f)
2196 if (wrap_pos_x > 0.0f)
2197 wrap_pos_x += window->Pos.x;
2199 const float wrap_width = wrap_pos_x > 0.0f ?
ImMax(wrap_pos_x - pos.
x, 0.00001f) : 0.0f;
2205 static void RenderText(
ImVec2 pos,
const char* text,
const char* text_end,
bool hide_text_after_hash)
2211 const char* text_display_end;
2212 if (hide_text_after_hash)
2219 text_end = text + strlen(text);
2220 text_display_end = text_end;
2223 const int text_len = (int)(text_display_end - text);
2227 window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(
ImGuiCol_Text), text, text_display_end);
2231 LogText(pos, text, text_display_end);
2241 text_end = text + strlen(text);
2243 const int text_len = (int)(text_end - text);
2247 window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(
ImGuiCol_Text), text, text_end, wrap_width);
2262 const int text_len = (int)(text_display_end - text);
2265 const ImVec2 text_size = text_size_if_known ? *text_size_if_known :
ImGui::CalcTextSize(text, text_display_end,
false, 0.0f);
2268 const bool need_clipping = (pos.
x + text_size.
x >= clip_max.
x) || (pos.
y + text_size.
y >= clip_max.
y);
2271 window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(
ImGuiCol_Text), text, text_display_end, 0.0f, need_clipping ? &clip_max : NULL);
2275 LogText(pos, text, text_display_end);
2284 window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding);
2298 const float h = window->FontSize() * 1.00f;
2299 const float r = h * 0.40f *
scale;
2300 ImVec2 center = p_min +
ImVec2(h*0.50f, h*0.50f*scale);
2305 center.
y -= r*0.25f;
2306 a = center + ImVec2(0,1)*r;
2307 b = center + ImVec2(-0.866f,-0.5f)*r;
2308 c = center + ImVec2(0.866f,-0.5f)*r;
2312 a = center + ImVec2(1,0)*r;
2313 b = center + ImVec2(-0.500f,0.866f)*r;
2314 c = center + ImVec2(-0.500f,-0.866f)*r;
2318 window->DrawList->AddTriangleFilled(a+ImVec2(2,2), b+ImVec2(2,2), c+ImVec2(2,2), window->Color(
ImGuiCol_BorderShadow));
2319 window->DrawList->AddTriangleFilled(a, b, c, window->Color(
ImGuiCol_Text));
2328 const char* text_display_end;
2329 if (hide_text_after_double_hash)
2332 text_display_end = text_end;
2334 ImFont* font = window->Font();
2335 const float font_size = window->FontSize();
2336 ImVec2 text_size = font->
CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
2339 const float font_scale = font_size / font->
FontSize;
2340 const float character_spacing_x = 1.0f * font_scale;
2341 if (text_size.
x > 0.0f)
2342 text_size.
x -= character_spacing_x;
2366 *out_items_display_start = 0;
2367 *out_items_display_end = items_count;
2371 const ImVec2 pos = window->DC.CursorPos;
2372 const ImVec4 clip_rect = window->ClipRectStack.back();
2373 const float clip_y1 = clip_rect.
y;
2374 const float clip_y2 = clip_rect.
w;
2376 int start = (int)((clip_y1 - pos.
y) / items_height);
2377 int end = (int)((clip_y2 - pos.
y) / items_height);
2378 start =
ImClamp(start, 0, items_count);
2379 end =
ImClamp(end + 1, start, items_count);
2381 *out_items_display_start = start;
2382 *out_items_display_end = end;
2389 for (
int i = (
int)g.Windows.size()-1; i >= 0; i--)
2391 ImGuiWindow* window = g.Windows[(size_t)i];
2392 if (!window->Visible)
2398 ImGuiAabb bb(window->ClippedAabb.Min - g.Style.TouchExtraPadding, window->ClippedAabb.Max + g.Style.TouchExtraPadding);
2399 if (bb.Contains(pos))
2414 ImGuiAabb box_clipped = bb;
2415 if (!window->ClipRectStack.empty())
2417 const ImVec4 clip_rect = window->ClipRectStack.back();
2418 box_clipped.Clip(ImGuiAabb(
ImVec2(clip_rect.
x, clip_rect.
y),
ImVec2(clip_rect.
z, clip_rect.
w)));
2422 const ImGuiAabb box_for_touch(box_clipped.Min - g.Style.TouchExtraPadding, box_clipped.Max + g.Style.TouchExtraPadding);
2423 return box_for_touch.Contains(g.IO.MousePos);
2435 return g.HoveredWindow == window;
2441 return g.HoveredWindow != NULL;
2452 const int key_index = g.IO.KeyMap[key];
2460 const float t = g.IO.KeysDownTime[key_index];
2465 const float KEY_REPEAT_DELAY = 0.250f;
2466 const float KEY_REPEAT_RATE = 0.020f;
2467 if (repeat && t > KEY_REPEAT_DELAY)
2468 if ((fmodf(t - KEY_REPEAT_DELAY, KEY_REPEAT_RATE) > KEY_REPEAT_RATE*0.5f) != (fmodf(t - KEY_REPEAT_DELAY - g.IO.DeltaTime, KEY_REPEAT_RATE) > KEY_REPEAT_RATE*0.5f))
2478 const float t = g.IO.MouseDownTime[button];
2483 const float MOUSE_REPEAT_DELAY = 0.250f;
2484 const float MOUSE_REPEAT_RATE = 0.020f;
2485 if (repeat && t > MOUSE_REPEAT_DELAY)
2486 if ((fmodf(t - MOUSE_REPEAT_DELAY, MOUSE_REPEAT_RATE) > MOUSE_REPEAT_RATE*0.5f) != (fmodf(t - MOUSE_REPEAT_DELAY - g.IO.DeltaTime, MOUSE_REPEAT_RATE) > MOUSE_REPEAT_RATE*0.5f))
2496 return g.IO.MouseDoubleClicked[button];
2501 return GImGui->IO.MousePos;
2507 return window->DC.LastItemHovered;
2516 return g.ActiveId == window->DC.LastItemID;
2524 return g.ActiveId != 0;
2530 return window->DC.LastItemAabb.Min;
2536 return window->DC.LastItemAabb.Max;
2549 va_start(args, fmt);
2556 return GImGui->Time;
2561 return GImGui->FrameCount;
2591 size.
x =
ImMax(content_max.
x - cursor_pos.
x, g.Style.WindowMinSize.x) - fabsf(size.
x);
2597 size.
y =
ImMax(content_max.
y - cursor_pos.
y, g.Style.WindowMinSize.y) - fabsf(size.
y);
2601 flags |= extra_flags;
2606 const float alpha = 1.0f;
2607 bool ret =
ImGui::Begin(title, NULL, size, alpha, flags);
2644 ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + sz);
2672 for (
size_t i = 0; i < g.Windows.size(); i++)
2673 if (g.Windows[i]->ID ==
id)
2674 return g.Windows[i];
2683 ImGuiWindow* window = (ImGuiWindow*)
ImGui::MemAlloc(
sizeof(ImGuiWindow));
2684 new(window) ImGuiWindow(name);
2685 window->Flags = flags;
2690 window->Size = window->SizeFull = size;
2696 window->PosFloat =
ImVec2(60, 60);
2697 window->Pos =
ImVec2((
float)(
int)window->PosFloat.x, (
float)(
int)window->PosFloat.y);
2711 if (settings->Pos.x != FLT_MAX)
2713 window->PosFloat = settings->Pos;
2714 window->Pos =
ImVec2((
float)(
int)window->PosFloat.x, (
float)(
int)window->PosFloat.y);
2715 window->Collapsed = settings->Collapsed;
2719 size = settings->Size;
2720 window->Size = window->SizeFull = size;
2722 g.Windows.push_back(window);
2749 g.CurrentWindowStack.push_back(window);
2750 g.CurrentWindow = window;
2753 bool window_pos_set_by_api =
false;
2754 if (g.SetNextWindowPosCond)
2756 const ImVec2 backup_cursor_pos = window->DC.CursorPos;
2758 window->DC.CursorPos = backup_cursor_pos;
2759 window_pos_set_by_api =
true;
2760 g.SetNextWindowPosCond = 0;
2762 if (g.SetNextWindowSizeCond)
2765 g.SetNextWindowSizeCond = 0;
2767 if (g.SetNextWindowCollapsedCond)
2770 g.SetNextWindowCollapsedCond = 0;
2772 if (g.SetNextWindowFocus)
2775 g.SetNextWindowFocus =
false;
2782 size_t root_idx = g.CurrentWindowStack.size() - 1;
2783 while (root_idx > 0)
2789 window->RootWindow = g.CurrentWindowStack[root_idx];
2792 if (bg_alpha < 0.0f)
2797 const bool first_begin_of_the_frame = (window->LastFrameDrawn != current_frame);
2798 if (first_begin_of_the_frame)
2800 window->DrawList->Clear();
2801 window->Visible =
true;
2804 if (window->LastFrameDrawn < current_frame - 1)
2807 window->LastFrameDrawn = current_frame;
2808 window->ClipRectStack.resize(0);
2811 window->SizeContents = window->SizeContentsCurrent;
2812 window->SizeContentsCurrent =
ImVec2(0.0f, 0.0f);
2816 parent_window->DC.ChildWindows.push_back(window);
2817 window->Pos = window->PosFloat = parent_window->DC.CursorPos;
2818 window->SizeFull = size;
2823 window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
2828 else if (g.IO.DisplayVisibleMin.x != g.IO.DisplayVisibleMax.x && g.IO.DisplayVisibleMin.y != g.IO.DisplayVisibleMax.y)
2829 PushClipRect(
ImVec4(g.IO.DisplayVisibleMin.x, g.IO.DisplayVisibleMin.y, g.IO.DisplayVisibleMax.x, g.IO.DisplayVisibleMax.y));
2834 if (first_begin_of_the_frame)
2837 window->IDStack.resize(1);
2840 const ImGuiID move_id = window->GetID(
"#MOVE");
2842 if (g.ActiveId == move_id)
2844 if (g.IO.MouseDown[0])
2848 window->PosFloat += g.IO.MouseDelta;
2858 g.MovedWindow = NULL;
2872 const ImVec2 pad =
ImVec2(window->FontSize()*2.0f, window->FontSize()*2.0f);
2873 if (g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f)
2876 ImVec2 clip_max = g.IO.DisplaySize - pad;
2877 window->PosFloat =
ImMax(window->PosFloat + window->Size, clip_min) - window->Size;
2878 window->PosFloat =
ImMin(window->PosFloat, clip_max);
2882 window->Pos =
ImVec2((
float)(
int)window->PosFloat.x, (
float)(
int)window->PosFloat.y);
2886 window->ItemWidthDefault = (float)(
int)(window->Size.x * 0.65f);
2888 window->ItemWidthDefault = 200.0f;
2891 if (window->FocusIdxAllRequestNext ==
IM_INT_MAX || window->FocusIdxAllCounter == -1)
2892 window->FocusIdxAllRequestCurrent =
IM_INT_MAX;
2894 window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1);
2895 if (window->FocusIdxTabRequestNext ==
IM_INT_MAX || window->FocusIdxTabCounter == -1)
2896 window->FocusIdxTabRequestCurrent =
IM_INT_MAX;
2898 window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1);
2899 window->FocusIdxAllCounter = window->FocusIdxTabCounter = -1;
2900 window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext =
IM_INT_MAX;
2902 ImGuiAabb title_bar_aabb = window->TitleBarAabb();
2905 window->ScrollY = window->NextScrollY;
2906 window->ScrollY =
ImMax(window->ScrollY, 0.0f);
2907 if (!window->Collapsed && !window->SkipItems)
2908 window->ScrollY =
ImMin(window->ScrollY,
ImMax(0.0f, window->SizeContents.y - window->SizeFull.y));
2909 window->NextScrollY = window->ScrollY;
2917 window->Collapsed = !window->Collapsed;
2925 window->Collapsed =
false;
2929 if (window->Collapsed)
2932 window->Size = title_bar_aabb.GetSize();
2933 window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(
ImGuiCol_TitleBgCollapsed), window_rounding);
2937 window->DrawList->AddRect(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(
ImGuiCol_Border), window_rounding);
2942 window->Size = window->SizeFull;
2944 ImU32 resize_col = 0;
2949 window->SizeFull = size_auto_fit;
2957 window->SizeFull = size_auto_fit;
2959 else if (window->AutoFitFrames > 0)
2962 if (window->AutoFitOnlyGrows)
2963 window->SizeFull =
ImMax(window->SizeFull, size_auto_fit);
2965 window->SizeFull = size_auto_fit;
2972 const ImGuiAabb resize_aabb(window->Aabb().GetBR()-
ImVec2(18,18), window->Aabb().GetBR());
2973 const ImGuiID resize_id = window->GetID(
"#RESIZE");
2978 if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0])
2981 window->SizeFull = size_auto_fit;
2982 window->Size = window->SizeFull;
2990 window->Size = window->SizeFull;
2997 title_bar_aabb = window->TitleBarAabb();
3004 if (bg_alpha > 0.0f)
3006 if ((window->Flags & ImGuiWindowFlags_ComboBox) != 0)
3007 window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(
ImGuiCol_ComboBg, bg_alpha), window_rounding);
3009 window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(
ImGuiCol_TooltipBg, bg_alpha), window_rounding);
3010 else if ((window->Flags & ImGuiWindowFlags_ChildWindow) != 0)
3011 window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size-
ImVec2(window->ScrollbarY?style.
ScrollbarWidth:0.0f,0.0f), window->Color(
ImGuiCol_ChildWindowBg, bg_alpha), window_rounding, window->ScrollbarY ? (1|8) : (0xF));
3013 window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(
ImGuiCol_WindowBg, bg_alpha), window_rounding);
3018 window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(
ImGuiCol_TitleBg), window_rounding, 1|2);
3024 window->DrawList->AddRect(window->Pos, window->Pos+window->Size, window->Color(
ImGuiCol_Border), window_rounding);
3026 window->DrawList->AddLine(title_bar_aabb.GetBL(), title_bar_aabb.GetBR(), window->Color(
ImGuiCol_Border));
3030 if (window->ScrollbarY)
3037 const float r = window_rounding;
3038 const ImVec2 br = window->Aabb().GetBR();
3041 window->DrawList->AddTriangleFilled(br, br-
ImVec2(0,14), br-
ImVec2(14,0), resize_col);
3046 window->DrawList->AddArc(br -
ImVec2(r,r), r, resize_col, 6, 9,
true);
3047 window->DrawList->AddTriangleFilled(br+
ImVec2(0,-2*r),br+
ImVec2(0,-r),br+
ImVec2(-r,-r), resize_col);
3048 window->DrawList->AddTriangleFilled(br+
ImVec2(-r,-r), br+
ImVec2(-r,0),br+
ImVec2(-2*r,0), resize_col);
3054 window->DC.ColumnsStartX = window->WindowPadding().x;
3055 window->DC.ColumnsOffsetX = 0.0f;
3056 window->DC.CursorStartPos = window->Pos +
ImVec2(window->DC.ColumnsStartX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->WindowPadding().y) -
ImVec2(0.0f, window->ScrollY);
3057 window->DC.CursorPos = window->DC.CursorStartPos;
3058 window->DC.CursorPosPrevLine = window->DC.CursorPos;
3059 window->DC.CurrentLineHeight = window->DC.PrevLineHeight = 0.0f;
3060 window->DC.LogLineHeight = window->DC.CursorPos.y - 9999.0f;
3061 window->DC.ChildWindows.resize(0);
3062 window->DC.ItemWidth.resize(0);
3063 window->DC.ItemWidth.push_back(window->ItemWidthDefault);
3064 window->DC.AllowKeyboardFocus.resize(0);
3065 window->DC.AllowKeyboardFocus.push_back(
true);
3066 window->DC.TextWrapPos.resize(0);
3067 window->DC.TextWrapPos.push_back(-1.0f);
3069 window->DC.ColumnsCurrent = 0;
3070 window->DC.ColumnsCount = 1;
3071 window->DC.ColumnsStartPos = window->DC.CursorPos;
3072 window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.ColumnsStartPos.y;
3073 window->DC.TreeDepth = 0;
3074 window->DC.StateStorage = &window->StateStorage;
3076 if (window->AutoFitFrames > 0)
3077 window->AutoFitFrames--;
3082 if (p_opened != NULL)
3098 window->ClippedAabb = window->Aabb();
3099 window->ClippedAabb.Clip(window->ClipRectStack.front());
3104 const ImGuiAabb title_bar_aabb = window->TitleBarAabb();
3105 ImVec4 clip_rect(title_bar_aabb.Min.x+0.5f+window->WindowPadding().x*0.5f, title_bar_aabb.Max.y+0.5f, window->Aabb().Max.x+0.5f-window->WindowPadding().x*0.5f, window->Aabb().Max.y-1.5f);
3106 if (window->ScrollbarY)
3111 if (first_begin_of_the_frame)
3112 window->Accessed =
false;
3116 if (flags & ImGuiWindowFlags_ChildWindow)
3119 window->Collapsed = parent_window && parent_window->Collapsed;
3121 const ImVec4 clip_rect_t = window->ClipRectStack.back();
3122 window->Collapsed |= (clip_rect_t.
x >= clip_rect_t.
z || clip_rect_t.
y >= clip_rect_t.
w);
3126 if (window->Collapsed)
3127 window->Visible =
false;
3129 if (style.
Alpha <= 0.0f)
3130 window->Visible =
false;
3133 window->SkipItems = window->Collapsed || (!window->Visible && window->AutoFitFrames == 0);
3134 return !window->SkipItems;
3140 ImGuiWindow* window = g.CurrentWindow;
3145 window->DrawList->PopTextureID();
3153 g.CurrentWindowStack.pop_back();
3154 g.CurrentWindow = g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back();
3165 const ImGuiID id = window->GetID(
"#SCROLLY");
3168 ImGuiAabb bb(window->Aabb().Max.x - style.
ScrollbarWidth, window->Pos.y + window->TitleBarHeight()+1, window->Aabb().Max.x, window->Aabb().Max.y-1);
3170 bb.Expand(
ImVec2(-3,-3));
3171 const float scrollbar_height = bb.GetHeight();
3176 const float grab_h_norm = grab_h_pixels / scrollbar_height;
3180 bool hovered =
false;
3181 const bool previously_held = (g.ActiveId == id);
3184 const float scroll_max =
ImMax(1.0f, window->SizeContents.y - window->Size.y);
3185 float scroll_ratio =
ImSaturate(window->ScrollY / scroll_max);
3186 float grab_y_norm = scroll_ratio * (scrollbar_height - grab_h_pixels) / scrollbar_height;
3189 const float clicked_y_norm =
ImSaturate((g.IO.MousePos.y - bb.Min.y) / scrollbar_height);
3192 bool seek_absolute =
false;
3193 if (!previously_held)
3196 if (clicked_y_norm >= grab_y_norm && clicked_y_norm <= grab_y_norm + grab_h_norm)
3198 g.ScrollbarClickDeltaToGrabCenter = clicked_y_norm - grab_y_norm - grab_h_norm*0.5f;
3202 seek_absolute =
true;
3203 g.ScrollbarClickDeltaToGrabCenter = 0;
3208 const float scroll_y_norm =
ImSaturate((clicked_y_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm*0.5f) / (1.0f - grab_h_norm));
3209 window->ScrollY = (float)(
int)(0.5f + scroll_y_norm * (window->SizeContents.y - window->Size.y));
3210 window->NextScrollY = window->ScrollY;
3213 scroll_ratio =
ImSaturate(window->ScrollY / scroll_max);
3214 grab_y_norm = scroll_ratio * (scrollbar_height - grab_h_pixels) / scrollbar_height;
3218 g.ScrollbarClickDeltaToGrabCenter = clicked_y_norm - grab_y_norm - grab_h_norm*0.5f;
3223 window->DrawList->AddRectFilled(
ImVec2(bb.Min.x,
ImLerp(bb.Min.y, bb.Max.y, grab_y_norm)),
ImVec2(bb.Max.x,
ImLerp(bb.Min.y, bb.Max.y, grab_y_norm) + grab_h_pixels), grab_col);
3232 g.FocusedWindow = window;
3235 if (window->RootWindow)
3236 window = window->RootWindow;
3238 if (g.Windows.back() == window)
3241 for (
size_t i = 0; i < g.Windows.size(); i++)
3242 if (g.Windows[i] == window)
3244 g.Windows.erase(g.Windows.begin() + i);
3247 g.Windows.push_back(window);
3253 window->DC.ItemWidth.push_back(item_width == 0.0f ? window->ItemWidthDefault : item_width);
3259 window->DC.ItemWidth.pop_back();
3265 float w = window->DC.ItemWidth.back();
3272 w =
ImMax(1.0f, width_to_right_edge - w - g.Style.FramePadding.x * 2.0f);
3285 g.FontSize = g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale;
3286 g.FontTexUvWhitePixel = g.Font->ContainerAtlas->TexUvWhitePixel;
3294 font = g.IO.Fonts->Fonts[0];
3297 g.FontStack.push_back(font);
3305 g.CurrentWindow->DrawList->PopTextureID();
3306 g.FontStack.pop_back();
3307 SetFont(g.FontStack.empty() ? g.IO.Fonts->Fonts[0] : g.FontStack.back());
3313 window->DC.AllowKeyboardFocus.push_back(allow_keyboard_focus);
3319 window->DC.AllowKeyboardFocus.pop_back();
3325 window->DC.TextWrapPos.push_back(wrap_x);
3331 window->DC.TextWrapPos.pop_back();
3340 backup.PreviousValue = g.Style.Colors[idx];
3341 g.ColorModifiers.push_back(backup);
3342 g.Style.Colors[idx] = col;
3351 ImGuiColMod& backup = g.ColorModifiers.back();
3352 g.Style.Colors[backup.Col] = backup.PreviousValue;
3353 g.ColorModifiers.pop_back();
3391 ImGuiStyleMod backup;
3393 backup.PreviousValue =
ImVec2(*pvar, 0.0f);
3394 g.StyleModifiers.push_back(backup);
3405 ImGuiStyleMod backup;
3407 backup.PreviousValue = *pvar;
3408 g.StyleModifiers.push_back(backup);
3418 ImGuiStyleMod& backup = g.StyleModifiers.back();
3420 *pvar_f = backup.PreviousValue.x;
3422 *pvar_v = backup.PreviousValue;
3423 g.StyleModifiers.pop_back();
3481 return g.FocusedWindow == window;
3487 return window->Size.x;
3499 if (cond && (window->SetWindowPosAllowFlags & cond) == 0)
3504 const ImVec2 old_pos = window->Pos;
3505 window->PosFloat = pos;
3506 window->Pos =
ImVec2((
float)(
int)window->PosFloat.x, (
float)(
int)window->PosFloat.y);
3507 window->DC.CursorPos += (window->Pos - old_pos);
3526 return window->Size;
3532 if (cond && (window->SetWindowSizeAllowFlags & cond) == 0)
3539 window->SizeFull = size;
3540 window->AutoFitFrames = 0;
3545 window->AutoFitFrames = 2;
3546 window->AutoFitOnlyGrows =
false;
3566 if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0)
3571 window->Collapsed = collapsed;
3583 return window->Collapsed;
3609 g.SetNextWindowPosVal = pos;
3616 g.SetNextWindowSizeVal = size;
3623 g.SetNextWindowCollapsedVal = collapsed;
3630 g.SetNextWindowFocus =
true;
3636 ImVec2 window_padding = window->WindowPadding();
3637 ImVec2 mx = window->Size - window_padding;
3638 if (window->DC.ColumnsCount != 1)
3641 mx.
x -= window_padding.
x;
3645 if (window->ScrollbarY)
3646 mx.
x -= GImGui->Style.ScrollbarWidth;
3654 return ImVec2(0, window->TitleBarHeight()) + window->WindowPadding();
3660 ImVec2 m = window->Size - window->WindowPadding();
3661 if (window->ScrollbarY)
3662 m.
x -= GImGui->Style.ScrollbarWidth;
3669 return window->FontSize();
3676 return window->FontSize() + g.Style.ItemSpacing.y;
3682 return window->DrawList;
3688 return window->Font();
3694 return window->FontSize();
3700 window->FontWindowScale =
scale;
3708 return window->DC.CursorPos - window->Pos;
3724 window->DC.CursorPos = window->Pos + pos;
3725 window->SizeContentsCurrent =
ImMax(window->SizeContentsCurrent, pos +
ImVec2(0.0f, window->ScrollY));
3731 window->DC.CursorPos.x = window->Pos.x + x;
3732 window->SizeContentsCurrent.x =
ImMax(window->SizeContentsCurrent.x, x);
3738 window->DC.CursorPos.y = window->Pos.y + y;
3739 window->SizeContentsCurrent.y =
ImMax(window->SizeContentsCurrent.y, y + window->ScrollY);
3745 return window->DC.CursorPos;
3751 window->DC.CursorPos = screen_pos;
3757 return window->ScrollY;
3763 return window->SizeContents.y - window->SizeFull.y;
3769 window->NextScrollY = (window->DC.CursorPos.y + window->ScrollY) - (window->Pos.y + window->SizeFull.y * 0.5f) - (window->TitleBarHeight() + window->WindowPadding().y);
3775 window->FocusIdxAllRequestNext = window->FocusIdxAllCounter + 1 + offset;
3782 window->DC.StateStorage = tree ? tree : &window->StateStorage;
3788 return window->DC.StateStorage;
3794 if (window->SkipItems)
3797 static char buf[1024];
3805 va_start(args, fmt);
3820 va_start(args, fmt);
3835 va_start(args, fmt);
3844 if (window->SkipItems)
3848 const char* text_begin = text;
3849 if (text_end == NULL)
3850 text_end = text + strlen(text);
3852 const float wrap_pos_x = window->DC.TextWrapPos.back();
3853 const bool wrap_enabled = wrap_pos_x >= 0.0f;
3854 if (text_end - text > 2000 && !wrap_enabled)
3860 const char* line = text;
3862 const ImVec2 start_pos = window->DC.CursorPos;
3863 const ImVec4 clip_rect = window->ClipRectStack.back();
3866 if (start_pos.
y <= clip_rect.
w)
3873 int lines_skippable = (int)((clip_rect.
y - start_pos.
y) / line_height) - 1;
3874 if (lines_skippable > 0)
3876 int lines_skipped = 0;
3877 while (line < text_end && lines_skipped <= lines_skippable)
3879 const char* line_end = strchr(line,
'\n');
3880 line = line_end + 1;
3883 pos.
y += lines_skipped * line_height;
3888 if (line < text_end)
3891 while (line < text_end)
3893 const char* line_end = strchr(line,
'\n');
3898 text_size.
x =
ImMax(text_size.
x, line_size.
x);
3901 line_end = text_end;
3902 line = line_end + 1;
3903 line_box.Min.y += line_height;
3904 line_box.Max.y += line_height;
3905 pos.
y += line_height;
3909 int lines_skipped = 0;
3910 while (line < text_end)
3912 const char* line_end = strchr(line,
'\n');
3914 line_end = text_end;
3915 line = line_end + 1;
3918 pos.
y += lines_skipped * line_height;
3921 text_size.
y += (pos - start_pos).y;
3923 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + text_size);
3929 const float wrap_width = wrap_enabled ?
CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f;
3931 ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + text_size);
3945 if (window->SkipItems)
3949 ItemSize(
ImVec2(0, window->FontSize() + g.Style.FramePadding.y*2));
3958 if (window->SkipItems)
3963 static char buf[1024];
3964 const char* value_text_begin = &buf[0];
3968 const ImGuiAabb value_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(w + style.
FramePadding.
x*2, label_size.
y));
3975 RenderTextClipped(value_bb.Min, value_text_begin, value_text_end, NULL, value_bb.Max);
3982 va_start(args, fmt);
3990 if (g.HoveredId == 0)
3993 if (g.HoveredRootWindow == window->RootWindow)
3995 bool hovered = (g.ActiveId == 0 || g.ActiveId ==
id || g.ActiveIdIsFocusedOnly) &&
IsMouseHoveringBox(bb);
4002 static bool ButtonBehaviour(
const ImGuiAabb& bb,
const ImGuiID&
id,
bool* out_hovered,
bool* out_held,
bool allow_key_modifiers,
bool repeat,
bool pressed_on_click)
4008 bool pressed =
false;
4012 if (allow_key_modifiers || (!g.IO.KeyCtrl && !g.IO.KeyShift))
4014 if (g.IO.MouseClicked[0])
4016 if (pressed_on_click)
4035 if (g.ActiveId ==
id)
4037 if (g.IO.MouseDown[0])
4049 if (out_hovered) *out_hovered = hovered;
4050 if (out_held) *out_held = held;
4059 if (window->SkipItems)
4063 const ImGuiID id = window->GetID(label);
4066 const ImVec2 size(size_arg.
x != 0.0f ? size_arg.
x : label_size.
x, size_arg.
y != 0.0f ? size_arg.
y : label_size.
y);
4067 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + style.
FramePadding*2.0f);
4073 bool pressed =
ButtonBehaviour(bb,
id, &hovered, &held,
true, repeat_when_held);
4090 if (window->SkipItems)
4094 const ImGuiID id = window->GetID(label);
4097 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + label_size +
ImVec2(style.
FramePadding.
x*2,0));
4118 if (window->SkipItems)
4121 const ImGuiID id = window->GetID(str_id);
4122 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size);
4138 const ImGuiID id = window->GetID(
"#CLOSE");
4139 const float size = window->TitleBarHeight() - 4.0f;
4140 const ImGuiAabb bb(window->Aabb().GetTR() +
ImVec2(-3.0f-size,2.0f), window->Aabb().GetTR() +
ImVec2(-3.0f,2.0f+size));
4147 const ImVec2 center = bb.GetCenter();
4148 window->DrawList->AddCircleFilled(center,
ImMax(2.0f,size*0.5f), col, 16);
4150 const float cross_extent = (size * 0.5f * 0.7071f) - 1.0f;
4153 window->DrawList->AddLine(center +
ImVec2(+cross_extent,+cross_extent), center +
ImVec2(-cross_extent,-cross_extent), window->Color(
ImGuiCol_Text));
4154 window->DrawList->AddLine(center +
ImVec2(+cross_extent,-cross_extent), center +
ImVec2(-cross_extent,+cross_extent), window->Color(
ImGuiCol_Text));
4157 if (p_opened != NULL && pressed)
4158 *p_opened = !*p_opened;
4166 if (window->SkipItems)
4169 ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size);
4170 if (border_col.
w > 0.0f)
4176 if (border_col.
w > 0.0f)
4178 window->DrawList->AddRect(bb.Min, bb.Max, window->Color(border_col), 0.0f);
4179 window->DrawList->AddImage(user_texture_id, bb.Min+
ImVec2(1,1), bb.Max-
ImVec2(1,1), uv0, uv1, window->Color(tint_col));
4183 window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, window->Color(tint_col));
4195 if (window->SkipItems)
4203 const ImGuiID id = window->GetID(
"#image");
4206 const ImVec2 padding = (frame_padding >= 0) ?
ImVec2((
float)frame_padding, (float)frame_padding) : style.
FramePadding;
4207 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2);
4208 const ImGuiAabb image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
4218 if (padding.
x > 0.0f || padding.
y > 0.0f)
4220 if (bg_col.
w > 0.0f)
4221 window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, window->Color(bg_col));
4222 window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, window->Color(tint_col));
4235 g.LogEnabled =
true;
4237 g.LogStartDepth = window->DC.TreeDepth;
4239 g.LogAutoExpandMaxDepth = max_depth;
4250 filename = g.IO.LogFilename;
4252 g.LogFile = fopen(filename,
"ab");
4258 g.LogEnabled =
true;
4259 g.LogStartDepth = window->DC.TreeDepth;
4261 g.LogAutoExpandMaxDepth = max_depth;
4272 g.LogEnabled =
true;
4274 g.LogStartDepth = window->DC.TreeDepth;
4276 g.LogAutoExpandMaxDepth = max_depth;
4286 g.LogEnabled =
false;
4287 if (g.LogFile != NULL)
4289 if (g.LogFile == stdout)
4295 if (g.LogClipboard->size() > 1)
4297 if (g.IO.SetClipboardTextFn)
4298 g.IO.SetClipboardTextFn(g.LogClipboard->begin());
4299 g.LogClipboard->clear();
4313 const bool log_to_clipboard =
ImGui::Button(
"Log To Clipboard");
4327 LogToFile(g.LogAutoExpandMaxDepth, g.IO.LogFilename);
4328 if (log_to_clipboard)
4336 if (window->SkipItems)
4341 IM_ASSERT(str_id != NULL || label != NULL);
4346 const ImGuiID id = window->GetID(str_id);
4351 if (g.SetNextTreeNodeOpenedCond != 0)
4355 opened = g.SetNextTreeNodeOpenedVal;
4356 storage->
SetInt(
id, opened);
4361 const int stored_value = storage->
GetInt(
id, -1);
4362 if (stored_value == -1)
4364 opened = g.SetNextTreeNodeOpenedVal;
4365 storage->
SetInt(
id, opened);
4369 opened = stored_value != 0;
4372 g.SetNextTreeNodeOpenedCond = 0;
4376 opened = storage->
GetInt(
id, default_open) != 0;
4380 const ImVec2 window_padding = window->WindowPadding();
4382 const ImVec2 pos_min = window->DC.CursorPos;
4384 ImGuiAabb bb = ImGuiAabb(pos_min,
ImVec2(pos_max.
x, pos_min.
y + label_size.
y));
4387 bb.Min.x -= window_padding.
x*0.5f - 1;
4388 bb.Max.x += window_padding.
x*0.5f - 1;
4392 const ImGuiAabb text_bb(bb.Min, bb.Min +
ImVec2(window->FontSize() + style.
FramePadding.
x*2*2,0) + label_size);
4397 if (g.LogEnabled && !display_frame && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
4404 bool pressed =
ButtonBehaviour(display_frame ? bb : text_bb,
id, &hovered, &held,
false);
4408 storage->
SetInt(
id, opened);
4421 const char log_prefix[] =
"\n##";
4427 const char log_suffix[] =
"##";
4434 if ((held && hovered) || hovered)
4449 if (window->SkipItems)
4453 const float line_height = window->FontSize();
4454 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(line_height, line_height));
4460 const float bullet_size = line_height*0.15f;
4472 if (window->SkipItems)
4475 static char buf[1024];
4476 const char* text_begin = buf;
4480 const float line_height = window->FontSize();
4482 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(line_height + (label_size.
x > 0.0f ? (style.
FramePadding.
x*2) : 0.0f),0) + label_size);
4488 const float bullet_size = line_height*0.15f;
4496 va_start(args, fmt);
4504 static char buf[1024];
4507 if (!str_id || !str_id[0])
4523 va_start(args, fmt);
4532 static char buf[1024];
4551 va_start(args, fmt);
4559 return TreeNode(str_label_id,
"%s", str_label_id);
4565 g.SetNextTreeNodeOpenedVal = opened;
4572 window->IDStack.push_back(window->GetID(str_id));
4578 window->IDStack.push_back(window->GetID(ptr_id));
4583 const void* ptr_id = (
void*)(intptr_t)int_id;
4585 window->IDStack.push_back(window->GetID(ptr_id));
4591 window->IDStack.pop_back();
4597 return window->GetID(str_id);
4603 return window->GetID(ptr_id);
4616 if (op ==
'+' || op ==
'*' || op ==
'/')
4631 if (sscanf(GImGui->InputTextState.InitialText,
"%f", &ref_v) < 1)
4635 if (sscanf(buf,
"%f", &op_v) < 1)
4654 bool ImGui::SliderFloat(
const char* label,
float* v,
float v_min,
float v_max,
const char* display_format,
float power)
4658 if (window->SkipItems)
4662 const ImGuiID id = window->GetID(label);
4665 if (!display_format)
4666 display_format =
"%.3f";
4669 int decimal_precision = 3;
4670 if (
const char* p = strchr(display_format,
'%'))
4673 while (*p >=
'0' && *p <=
'9')
4677 decimal_precision = atoi(p+1);
4678 if (decimal_precision < 0 || decimal_precision > 10)
4679 decimal_precision = 3;
4684 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(w, label_size.
y) + style.
FramePadding*2.0f);
4686 const ImGuiAabb bb(frame_bb.Min, frame_bb.Max +
ImVec2(label_size.
x > 0.0f ? style.
ItemInnerSpacing.
x + label_size.
x : 0.0f, 0.0f));
4695 const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId ==
id);
4697 const bool is_unbound = v_min == -FLT_MAX || v_min == FLT_MAX || v_max == -FLT_MAX || v_max == FLT_MAX;
4699 const float grab_size_in_units = 1.0f;
4700 float grab_size_in_pixels;
4701 if (decimal_precision > 0 || is_unbound)
4704 grab_size_in_pixels =
ImMax(grab_size_in_units * (w / (v_max-v_min+1.0f)), style.
GrabMinSize);
4705 const float slider_effective_w = slider_bb.GetWidth() - grab_size_in_pixels;
4706 const float slider_effective_x1 = slider_bb.Min.x + grab_size_in_pixels*0.5f;
4707 const float slider_effective_x2 = slider_bb.Max.x - grab_size_in_pixels*0.5f;
4710 float linear_zero_pos = 0.0f;
4713 if (v_min * v_max < 0.0f)
4716 const float linear_dist_min_to_0 = powf(fabsf(0.0f - v_min), 1.0f/power);
4717 const float linear_dist_max_to_0 = powf(fabsf(v_max - 0.0f), 1.0f/power);
4718 linear_zero_pos = linear_dist_min_to_0 / (linear_dist_min_to_0+linear_dist_max_to_0);
4723 linear_zero_pos = v_min < 0.0f ? 1.0f : 0.0f;
4727 const bool hovered =
IsHovered(slider_bb,
id);
4731 bool start_text_input =
false;
4732 if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
4737 const bool is_ctrl_down = g.IO.KeyCtrl;
4738 if (tab_focus_requested || is_ctrl_down || is_unbound)
4740 start_text_input =
true;
4741 g.SliderAsInputTextId = 0;
4746 bool value_changed =
false;
4747 if (start_text_input || (g.ActiveId ==
id &&
id == g.SliderAsInputTextId))
4754 window->FocusItemUnregister();
4756 if (g.SliderAsInputTextId == 0)
4760 g.SliderAsInputTextId = g.ActiveId;
4763 else if (g.ActiveId != g.SliderAsInputTextId)
4766 g.SliderAsInputTextId = 0;
4772 return value_changed;
4779 if (g.ActiveId ==
id)
4781 if (g.IO.MouseDown[0])
4785 const float normalized_pos =
ImClamp((g.IO.MousePos.x - slider_effective_x1) / slider_effective_w, 0.0f, 1.0f);
4792 if (normalized_pos < linear_zero_pos)
4795 float a = 1.0f - (normalized_pos / linear_zero_pos);
4803 if (fabsf(linear_zero_pos - 1.0f) > 1.e-6)
4804 a = (normalized_pos - linear_zero_pos) / (1.0f - linear_zero_pos);
4814 const float min_step = 1.0f / powf(10.0f, (
float)decimal_precision);
4815 const float remainder = fmodf(new_value, min_step);
4816 if (remainder <= min_step*0.5f)
4817 new_value -= remainder;
4819 new_value += (min_step - remainder);
4821 if (*v != new_value)
4824 value_changed =
true;
4841 float v_clamped =
ImClamp(*v, v_min, v_max);
4842 if (v_clamped < 0.0f)
4844 const float f = 1.0f - (v_clamped - v_min) / (
ImMin(0.0f,v_max) - v_min);
4845 grab_t = (1.0f - powf(f, 1.0f/power)) * linear_zero_pos;
4849 const float f = (v_clamped -
ImMax(0.0f,v_min)) / (v_max -
ImMax(0.0f,v_min));
4850 grab_t = linear_zero_pos + powf(f, 1.0f/power) * (1.0f - linear_zero_pos);
4854 const float grab_x =
ImLerp(slider_effective_x1, slider_effective_x2, grab_t);
4855 const ImGuiAabb grab_bb(
ImVec2(grab_x-grab_size_in_pixels*0.5f,frame_bb.Min.y+2.0f),
ImVec2(grab_x+grab_size_in_pixels*0.5f,frame_bb.Max.y-2.0f));
4867 return value_changed;
4872 float v_deg = *v * 360.0f / (2*
PI);
4873 bool value_changed =
ImGui::SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max,
"%.0f deg", 1.0f);
4874 *v = v_deg * (2*
PI) / 360.0f;
4875 return value_changed;
4878 bool ImGui::SliderInt(
const char* label,
int* v,
int v_min,
int v_max,
const char* display_format)
4880 if (!display_format)
4881 display_format =
"%.0f";
4882 float v_f = (float)*v;
4883 bool value_changed =
ImGui::SliderFloat(label, &v_f, (
float)v_min, (
float)v_max, display_format, 1.0f);
4885 return value_changed;
4889 static bool SliderFloatN(
const char* label,
float v[3],
int components,
float v_min,
float v_max,
const char* display_format,
float power)
4893 if (window->SkipItems)
4901 bool value_changed =
false;
4904 for (
int i = 0; i < components; i++)
4907 if (i + 1 == components)
4912 value_changed |=
ImGui::SliderFloat(
"##v", &v[i], v_min, v_max, display_format, power);
4921 return value_changed;
4924 bool ImGui::SliderFloat2(
const char* label,
float v[2],
float v_min,
float v_max,
const char* display_format,
float power)
4926 return SliderFloatN(label, v, 2, v_min, v_max, display_format, power);
4929 bool ImGui::SliderFloat3(
const char* label,
float v[3],
float v_min,
float v_max,
const char* display_format,
float power)
4931 return SliderFloatN(label, v, 3, v_min, v_max, display_format, power);
4934 bool ImGui::SliderFloat4(
const char* label,
float v[4],
float v_min,
float v_max,
const char* display_format,
float power)
4936 return SliderFloatN(label, v, 4, v_min, v_max, display_format, power);
4939 static bool SliderIntN(
const char* label,
int v[3],
int components,
int v_min,
int v_max,
const char* display_format)
4943 if (window->SkipItems)
4951 bool value_changed =
false;
4954 for (
int i = 0; i < components; i++)
4957 if (i + 1 == components)
4962 value_changed |=
ImGui::SliderInt(
"##v", &v[i], v_min, v_max, display_format);
4971 return value_changed;
4974 bool ImGui::SliderInt2(
const char* label,
int v[2],
int v_min,
int v_max,
const char* display_format)
4976 return SliderIntN(label, v, 2, v_min, v_max, display_format);
4979 bool ImGui::SliderInt3(
const char* label,
int v[3],
int v_min,
int v_max,
const char* display_format)
4981 return SliderIntN(label, v, 3, v_min, v_max, display_format);
4984 bool ImGui::SliderInt4(
const char* label,
int v[4],
int v_min,
int v_max,
const char* display_format)
4986 return SliderIntN(label, v, 4, v_min, v_max, display_format);
4995 static void Plot(
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 graph_size)
4999 if (window->SkipItems)
5005 if (graph_size.
x == 0.0f)
5007 if (graph_size.
y == 0.0f)
5008 graph_size.
y = label_size.
y;
5010 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(graph_size.
x, graph_size.
y) + style.
FramePadding*2.0f);
5012 const ImGuiAabb bb(frame_bb.Min, frame_bb.Max +
ImVec2(label_size.
x > 0.0f ? style.
ItemInnerSpacing.
x + label_size.
x : 0.0f, 0));
5018 if (scale_min == FLT_MAX || scale_max == FLT_MAX)
5020 float v_min = FLT_MAX;
5021 float v_max = -FLT_MAX;
5022 for (
int i = 0; i < values_count; i++)
5024 const float v = values_getter(data, i);
5025 v_min =
ImMin(v_min, v);
5026 v_max =
ImMax(v_max, v);
5028 if (scale_min == FLT_MAX)
5030 if (scale_max == FLT_MAX)
5036 int res_w =
ImMin((
int)graph_size.
x, values_count);
5044 const float t =
ImClamp((g.IO.MousePos.x - graph_bb.Min.x) / (graph_bb.Max.x - graph_bb.Min.x), 0.0f, 0.9999f);
5045 const int v_idx = (int)(t * (values_count + ((plot_type ==
ImGuiPlotType_Lines) ? -1 : 0)));
5046 IM_ASSERT(v_idx >= 0 && v_idx < values_count);
5048 const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
5049 const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
5057 const float t_step = 1.0f / (float)res_w;
5059 float v0 = values_getter(data, (0 + values_offset) % values_count);
5066 for (
int n = 0; n < res_w; n++)
5068 const float t1 = t0 + t_step;
5069 const int v_idx = (int)(t0 * values_count);
5070 IM_ASSERT(v_idx >= 0 && v_idx < values_count);
5071 const float v1 = values_getter(data, (v_idx + values_offset + 1) % values_count);
5076 window->DrawList->AddLine(
ImLerp(graph_bb.Min, graph_bb.Max, p0),
ImLerp(graph_bb.Min, graph_bb.Max, p1), v_hovered == v_idx ? col_hovered : col_base);
5078 window->DrawList->AddRectFilled(
ImLerp(graph_bb.Min, graph_bb.Max, p0),
ImLerp(graph_bb.Min, graph_bb.Max,
ImVec2(p1.
x, 1.0f))+
ImVec2(-1,0), v_hovered == v_idx ? col_hovered : col_base);
5091 struct ImGuiPlotArrayGetterData
5093 const float* Values;
5096 ImGuiPlotArrayGetterData(
const float* values,
size_t stride) { Values = values; Stride = stride; }
5101 ImGuiPlotArrayGetterData* plot_data = (ImGuiPlotArrayGetterData*)data;
5102 const float v = *(
float*)(
void*)((
unsigned char*)plot_data->Values + (
size_t)idx * plot_data->Stride);
5106 void ImGui::PlotLines(
const char* label,
const float* values,
int values_count,
int values_offset,
const char* overlay_text,
float scale_min,
float scale_max,
ImVec2 graph_size,
size_t stride)
5108 ImGuiPlotArrayGetterData data(values, stride);
5112 void ImGui::PlotLines(
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 graph_size)
5114 Plot(
ImGuiPlotType_Lines, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
5117 void ImGui::PlotHistogram(
const char* label,
const float* values,
int values_count,
int values_offset,
const char* overlay_text,
float scale_min,
float scale_max,
ImVec2 graph_size,
size_t stride)
5119 ImGuiPlotArrayGetterData data(values, stride);
5123 void ImGui::PlotHistogram(
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 graph_size)
5125 Plot(
ImGuiPlotType_Histogram, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
5132 if (window->SkipItems)
5136 const ImGuiID id = window->GetID(label);
5142 ImGuiAabb total_bb = check_bb;
5143 if (label_size.
x > 0)
5146 if (label_size.
x > 0)
5149 total_bb = ImGuiAabb(
ImMin(check_bb.Min, text_bb.Min),
ImMax(check_bb.Max, text_bb.Max));
5163 const float check_sz =
ImMin(check_bb.GetWidth(), check_bb.GetHeight());
5164 const float pad = check_sz < 8.0f ? 1.0f : check_sz < 13.0f ? 2.0f : 3.0f;
5169 LogText(text_bb.GetTL(), *v ?
"[x]" :
"[ ]");
5177 bool v = (*flags & flags_value) ?
true :
false;
5180 *flags |= flags_value;
5182 *flags &= ~flags_value;
5190 if (window->SkipItems)
5194 const ImGuiID id = window->GetID(label);
5200 ImGuiAabb total_bb = check_bb;
5201 if (label_size.
x > 0)
5204 if (label_size.
x > 0)
5207 total_bb.Add(text_bb);
5213 ImVec2 center = check_bb.GetCenter();
5214 center.
x = (float)(
int)center.
x + 0.5f;
5215 center.
y = (float)(
int)center.
y + 0.5f;
5216 const float radius = check_bb.GetHeight() * 0.5f;
5224 const float check_sz =
ImMin(check_bb.GetWidth(), check_bb.GetHeight());
5225 const float pad = check_sz < 8.0f ? 1.0f : check_sz < 13.0f ? 2.0f : 3.0f;
5226 window->DrawList->AddCircleFilled(center, radius-pad, window->Color(
ImGuiCol_CheckMark), 16);
5232 window->DrawList->AddCircle(center, radius, window->Color(
ImGuiCol_Border), 16);
5236 LogText(text_bb.GetTL(), active ?
"(x)" :
"( )");
5255 static float STB_TEXTEDIT_GETWIDTH(
STB_TEXTEDIT_STRING* obj,
int line_start_idx,
int char_idx) { (void)line_start_idx;
return obj->Font->CalcTextSizeW(obj->FontSize, FLT_MAX, &obj->Text[char_idx], &obj->Text[char_idx]+1, NULL).x; }
5260 const ImWchar* text_remaining = NULL;
5261 const ImVec2 size = obj->Font->CalcTextSizeW(obj->FontSize, FLT_MAX, obj->Text + line_start_idx, NULL, &text_remaining);
5267 r->
num_chars = (int)(text_remaining - (obj->Text + line_start_idx));
5270 static bool is_separator(
unsigned int c) {
return c==
',' || c==
';' || c==
'(' || c==
')' || c==
'{' || c==
'}' || c==
'[' || c==
']' || c==
'|'; }
5271 #define STB_TEXTEDIT_IS_SPACE(CH) ( ImCharIsSpace((unsigned int)CH) || is_separator((unsigned int)CH) )
5274 ImWchar* dst = obj->Text + pos;
5281 const ImWchar* src = obj->Text + pos + n;
5289 const size_t text_len = obj->CurLenW;
5290 if ((
size_t)new_text_len + text_len + 1 >
IM_ARRAYSIZE(obj->Text))
5294 if ((
size_t)new_text_len_utf8 + obj->CurLenA + 1 > obj->BufSizeA)
5297 if (pos != (
int)text_len)
5298 memmove(obj->Text + (
size_t)pos + new_text_len, obj->Text + (
size_t)pos, (text_len - (
size_t)pos) *
sizeof(
ImWchar));
5299 memcpy(obj->Text + (
size_t)pos, new_text, (
size_t)new_text_len *
sizeof(
ImWchar));
5301 obj->CurLenW += new_text_len;
5302 obj->CurLenA += new_text_len_utf8;
5303 obj->Text[obj->CurLenW] =
'\0';
5327 #ifdef IMGUI_STB_NAMESPACE
5328 namespace IMGUI_STB_NAMESPACE
5331 #define STB_TEXTEDIT_IMPLEMENTATION
5333 #ifdef IMGUI_STB_NAMESPACE
5337 void ImGuiTextEditState::OnKeyPressed(
int key)
5339 stb_textedit_key(
this, &StbState, key);
5343 void ImGuiTextEditState::UpdateScrollOffset()
5346 const float scroll_x_increment = Width * 0.25f;
5347 const float cursor_offset_x = Font->
CalcTextSizeW(FontSize, FLT_MAX, Text, Text+StbState.
cursor, NULL).
x;
5348 if (ScrollX > cursor_offset_x)
5349 ScrollX =
ImMax(0.0f, cursor_offset_x - scroll_x_increment);
5350 else if (ScrollX < cursor_offset_x - Width)
5351 ScrollX = cursor_offset_x - Width + scroll_x_increment;
5354 ImVec2 ImGuiTextEditState::CalcDisplayOffsetFromCharIdx(
int i)
const
5356 const ImWchar* text_start = GetTextPointerClippedW(Font, FontSize, Text, ScrollX, NULL);
5357 const ImWchar* text_end = (Text+i >= text_start) ? Text+i : text_start;
5365 const char* ImGuiTextEditState::GetTextPointerClippedA(
ImFont* font,
float font_size,
const char* text,
float width,
ImVec2* out_text_size)
5370 const char* text_clipped_end = NULL;
5371 const ImVec2 text_size = font->
CalcTextSizeA(font_size, width, 0.0f, text, NULL, &text_clipped_end);
5373 *out_text_size = text_size;
5374 return text_clipped_end;
5378 const ImWchar* ImGuiTextEditState::GetTextPointerClippedW(
ImFont* font,
float font_size,
const ImWchar* text,
float width,
ImVec2* out_text_size)
5383 const ImWchar* text_clipped_end = NULL;
5384 const ImVec2 text_size = font->
CalcTextSizeW(font_size, width, text, NULL, &text_clipped_end);
5386 *out_text_size = text_size;
5387 return text_clipped_end;
5391 void ImGuiTextEditState::RenderTextScrolledClipped(
ImFont* font,
float font_size,
const char* buf,
ImVec2 pos,
float width,
float scroll_x)
5395 const char* text_start = GetTextPointerClippedA(font, font_size, buf, scroll_x, NULL);
5396 const char* text_end = GetTextPointerClippedA(font, font_size, text_start, width, &text_size);
5399 unsigned int text_end_char = 0;
5403 const char symbol_c =
'~';
5404 const float symbol_w = font_size*0.40f;
5405 const float clip_begin = (text_start > buf && text_start < text_end) ? symbol_w : 0.0f;
5406 const float clip_end = (text_end_char != 0 && text_end > text_start) ? symbol_w : 0.0f;
5409 RenderText(pos+
ImVec2(clip_begin,0), text_start+(clip_begin>0.0f?1:0), text_end-(clip_end>0.0f?1:0),
false);
5412 const char s[2] = {symbol_c,
'\0'};
5413 if (clip_begin > 0.0f)
5415 if (clip_end > 0.0f)
5423 if (window->SkipItems)
5429 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(w, label_size.
y) + style.
FramePadding*2.0f);
5432 const float button_sz = window->FontSize();
5437 if (decimal_precision < 0)
5441 bool value_changed =
false;
5446 value_changed =
true;
5456 *v -= g.IO.KeyCtrl && step_fast > 0.0f ? step_fast : step;
5457 value_changed =
true;
5462 *v += g.IO.KeyCtrl && step_fast > 0.0f ? step_fast : step;
5463 value_changed =
true;
5469 if (label_size.
x > 0)
5476 return value_changed;
5481 float f = (float)*v;
5482 const bool value_changed =
ImGui::InputFloat(label, &f, (
float)step, (
float)step_fast, 0, extra_flags);
5485 return value_changed;
5492 char* dst = Buf + pos;
5493 const char* src = Buf + pos + bytes_count;
5494 while (
char c = *src++)
5499 if (CursorPos + bytes_count >= pos)
5500 CursorPos -= bytes_count;
5501 else if (CursorPos >= pos)
5503 SelectionStart = SelectionEnd = CursorPos;
5508 const size_t text_len = strlen(Buf);
5510 new_text_end = new_text + strlen(new_text);
5511 const size_t new_text_len = (size_t)(new_text_end - new_text);
5513 if (new_text_len + text_len + 1 >= BufSize)
5516 size_t upos = (size_t)pos;
5517 if (text_len != upos)
5518 memmove(Buf + upos + new_text_len, Buf + upos, text_len - upos);
5519 memcpy(Buf + upos, new_text, new_text_len *
sizeof(
char));
5520 Buf[text_len + new_text_len] =
'\0';
5523 if (CursorPos >= pos)
5524 CursorPos += (int)new_text_len;
5525 SelectionStart = SelectionEnd = CursorPos;
5531 unsigned int c = *p_char;
5533 if (c < 128 && c !=
' ' && !isprint((
int)(c & 0xFF)))
5536 if (c >= 0xE000 && c <= 0xF8FF)
5542 if (!(c >=
'0' && c <=
'9') && (c !=
'.') && (c !=
'-') && (c !=
'+') && (c !=
'*') && (c !=
'/'))
5546 if (!(c >=
'0' && c <=
'9') && !(c >=
'a' && c <=
'f') && !(c >=
'A' && c <=
'F'))
5550 if (c >=
'a' && c <=
'z')
5551 *p_char = (c += (
unsigned int)(
'A'-
'a'));
5564 callback_data.
Flags = flags;
5565 callback_data.
UserData = user_data;
5566 if (callback(&callback_data) != 0)
5581 if (window->SkipItems)
5587 const ImGuiID id = window->GetID(label);
5591 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(w, label_size.
y) + style.
FramePadding*2.0f);
5592 const ImGuiAabb bb(frame_bb.Min, frame_bb.Max +
ImVec2(label_size.
x > 0.0f ? (style.
ItemInnerSpacing.
x + label_size.
x) : 0.0f, 0.0f));
5598 ImGuiTextEditState& edit_state = g.InputTextState;
5600 const bool is_ctrl_down = io.
KeyCtrl;
5601 const bool is_shift_down = io.
KeyShift;
5603 const bool focus_requested_by_code = focus_requested && (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent);
5604 const bool focus_requested_by_tab = focus_requested && !focus_requested_by_code;
5606 const bool hovered =
IsHovered(frame_bb,
id);
5609 const bool user_clicked = hovered && io.
MouseClicked[0];
5612 if (focus_requested || user_clicked)
5614 if (g.ActiveId !=
id)
5620 const char* buf_end = NULL;
5622 edit_state.CurLenA = buf_end - buf;
5623 edit_state.Width = w;
5624 edit_state.InputCursorScreenPos =
ImVec2(-1.f,-1.f);
5625 edit_state.CursorAnimReset();
5627 if (edit_state.Id !=
id)
5630 edit_state.ScrollX = 0.0f;
5631 stb_textedit_initialize_state(&edit_state.StbState,
true);
5632 if (focus_requested_by_code)
5639 edit_state.StbState.cursor =
ImMin(edit_state.StbState.cursor, (
int)edit_state.CurLenW);
5640 edit_state.StbState.select_start =
ImMin(edit_state.StbState.select_start, (
int)edit_state.CurLenW);
5641 edit_state.StbState.select_end =
ImMin(edit_state.StbState.select_end, (
int)edit_state.CurLenW);
5643 if (focus_requested_by_tab || (user_clicked && is_ctrl_down))
5652 if (g.ActiveId ==
id)
5660 if (g.ActiveId ==
id)
5661 g.ActiveIdIsFocusedOnly = !io.
MouseDown[0];
5663 bool value_changed =
false;
5664 bool cancel_edit =
false;
5665 bool enter_pressed =
false;
5666 static char text_tmp_utf8[
IM_ARRAYSIZE(edit_state.InitialText)];
5667 if (g.ActiveId ==
id)
5670 edit_state.BufSizeA = buf_size;
5671 edit_state.Font = window->Font();
5672 edit_state.FontSize = window->FontSize();
5674 const float mx = g.IO.MousePos.x - frame_bb.Min.x - style.
FramePadding.
x;
5675 const float my = window->FontSize()*0.5f;
5677 edit_state.UpdateScrollOffset();
5680 edit_state.SelectAll();
5681 edit_state.SelectedAllMouseLock =
true;
5683 else if (io.
MouseClicked[0] && !edit_state.SelectedAllMouseLock)
5685 stb_textedit_click(&edit_state, &edit_state.StbState, mx + edit_state.ScrollX, my);
5686 edit_state.CursorAnimReset();
5689 else if (io.
MouseDown[0] && !edit_state.SelectedAllMouseLock)
5691 stb_textedit_drag(&edit_state, &edit_state.StbState, mx + edit_state.ScrollX, my);
5692 edit_state.CursorAnimReset();
5694 if (edit_state.SelectedAllMouseLock && !io.
MouseDown[0])
5695 edit_state.SelectedAllMouseLock =
false;
5697 if (g.IO.InputCharacters[0])
5700 for (
int n = 0; n <
IM_ARRAYSIZE(g.IO.InputCharacters) && g.IO.InputCharacters[n]; n++)
5702 unsigned int c = (
unsigned int)g.IO.InputCharacters[n];
5708 edit_state.OnKeyPressed((
int)c);
5713 memset(g.IO.InputCharacters, 0,
sizeof(g.IO.InputCharacters));
5732 if (cut && !edit_state.HasSelection())
5733 edit_state.SelectAll();
5735 if (g.IO.SetClipboardTextFn)
5737 const int ib = edit_state.HasSelection() ?
ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end) : 0;
5738 const int ie = edit_state.HasSelection() ?
ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end) : (int)edit_state.CurLenW;
5740 g.IO.SetClipboardTextFn(text_tmp_utf8);
5744 stb_textedit_cut(&edit_state, &edit_state.StbState);
5749 if (g.IO.GetClipboardTextFn)
5751 if (
const char* clipboard = g.IO.GetClipboardTextFn())
5754 const size_t clipboard_len = strlen(clipboard);
5756 int clipboard_filtered_len = 0;
5757 for (
const char* s = clipboard; *s; )
5767 clipboard_filtered[clipboard_filtered_len++] = (
ImWchar)c;
5769 clipboard_filtered[clipboard_filtered_len] = 0;
5770 if (clipboard_filtered_len > 0)
5771 stb_textedit_paste(&edit_state, &edit_state.StbState, clipboard_filtered, clipboard_filtered_len);
5777 edit_state.CursorAnim += g.IO.DeltaTime;
5778 edit_state.UpdateScrollOffset();
5784 value_changed =
true;
5822 callback_data.
EventKey = event_key;
5823 callback_data.
Buf = text_tmp_utf8;
5824 callback_data.
BufSize = edit_state.BufSizeA;
5826 callback_data.
Flags = flags;
5827 callback_data.
UserData = user_data;
5835 callback(&callback_data);
5847 edit_state.CursorAnimReset();
5852 if (strcmp(text_tmp_utf8, buf) != 0)
5855 value_changed =
true;
5862 const ImVec2 font_off_up =
ImVec2(0.0f,window->FontSize()+1.0f);
5865 if (g.ActiveId ==
id)
5868 const int select_begin_idx = edit_state.StbState.select_start;
5869 const int select_end_idx = edit_state.StbState.select_end;
5870 if (select_begin_idx != select_end_idx)
5872 const ImVec2 select_begin_pos = frame_bb.Min + style.
FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(
ImMin(select_begin_idx,select_end_idx));
5873 const ImVec2 select_end_pos = frame_bb.Min + style.
FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(
ImMax(select_begin_idx,select_end_idx));
5874 window->DrawList->AddRectFilled(select_begin_pos - font_off_up, select_end_pos + font_off_dn, window->Color(
ImGuiCol_TextSelectedBg));
5878 ImGuiTextEditState::RenderTextScrolledClipped(window->Font(), window->FontSize(), buf, frame_bb.Min + style.
FramePadding, w, (g.ActiveId == id) ? edit_state.ScrollX : 0.0f);
5880 if (g.ActiveId ==
id)
5882 const ImVec2 cursor_pos = frame_bb.Min + style.
FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(edit_state.StbState.cursor);
5885 if (g.InputTextState.CursorIsVisible())
5886 window->DrawList->AddRect(cursor_pos - font_off_up +
ImVec2(0,2), cursor_pos + font_off_dn -
ImVec2(0,3), window->Color(
ImGuiCol_Text));
5892 edit_state.InputCursorScreenPos = cursor_pos;
5895 if (label_size.
x > 0)
5899 return enter_pressed;
5901 return value_changed;
5904 static bool InputFloatN(
const char* label,
float* v,
int components,
int decimal_precision)
5908 if (window->SkipItems)
5916 bool value_changed =
false;
5919 for (
int i = 0; i < components; i++)
5922 if (i + 1 == components)
5936 return value_changed;
5941 return InputFloatN(label, v, 2, decimal_precision);
5946 return InputFloatN(label, v, 3, decimal_precision);
5951 return InputFloatN(label, v, 4, decimal_precision);
5956 const char** items = (
const char**)data;
5958 *out_text = items[idx];
5965 const char* items_separated_by_zeros = (
const char*)data;
5966 int items_count = 0;
5967 const char* p = items_separated_by_zeros;
5970 if (idx == items_count)
5983 bool ImGui::Combo(
const char* label,
int* current_item,
const char** items,
int items_count,
int height_in_items)
5985 const bool value_changed =
Combo(label, current_item,
Items_ArrayGetter, (
void*)items, items_count, height_in_items);
5986 return value_changed;
5990 bool ImGui::Combo(
const char* label,
int* current_item,
const char* items_separated_by_zeros,
int height_in_items)
5992 int items_count = 0;
5993 const char* p = items_separated_by_zeros;
6000 return value_changed;
6004 bool ImGui::Combo(
const char* label,
int* current_item,
bool (*items_getter)(
void*,
int,
const char**),
void* data,
int items_count,
int height_in_items)
6008 if (window->SkipItems)
6012 const ImGuiID id = window->GetID(label);
6016 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(w, label_size.
y) + style.
FramePadding*2.0f);
6022 const float arrow_size = (window->FontSize() + style.
FramePadding.
x * 2.0f);
6023 const bool hovered =
IsHovered(frame_bb,
id);
6025 bool value_changed =
false;
6026 const ImGuiAabb value_bb(frame_bb.Min, frame_bb.Max -
ImVec2(arrow_size, 0.0f));
6031 if (*current_item >= 0 && *current_item < items_count)
6033 const char* item_text;
6034 if (items_getter(data, *current_item, &item_text))
6038 if (label_size.
x > 0)
6042 bool menu_toggled =
false;
6046 if (g.IO.MouseClicked[0])
6048 menu_toggled =
true;
6049 g.ActiveComboID = (g.ActiveComboID == id) ? 0 :
id;
6050 if (g.ActiveComboID)
6055 if (g.ActiveComboID ==
id)
6058 if (height_in_items < 0)
6059 height_in_items = 7;
6062 const float popup_off_x = 0.0f;
6064 const ImGuiAabb popup_aabb(
ImVec2(frame_bb.Min.x+popup_off_x, frame_bb.Max.y),
ImVec2(frame_bb.Max.x+popup_off_x, frame_bb.Max.y + popup_height));
6071 bool combo_item_active =
false;
6072 combo_item_active |= (g.ActiveId ==
GetCurrentWindow()->GetID(
"#SCROLLY"));
6075 for (
int i = 0; i < items_count; i++)
6078 const bool item_selected = (i == *current_item);
6079 const char* item_text;
6080 if (!items_getter(data, i, &item_text))
6081 item_text =
"*Unknown item*";
6085 g.ActiveComboID = 0;
6086 value_changed =
true;
6089 if (item_selected && menu_toggled)
6097 if (!combo_item_active && g.ActiveId != 0)
6098 g.ActiveComboID = 0;
6103 return value_changed;
6112 if (window->SkipItems)
6116 const ImGuiID id = window->GetID(label);
6120 const ImVec2 size(size_arg.
x != 0.0f ? size_arg.
x : w, size_arg.
y != 0.0f ? size_arg.
y : label_size.
y);
6121 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size);
6125 ImGuiAabb bb_with_spacing = bb;
6126 const float spacing_L = (float)(
int)(style.
ItemSpacing.
x * 0.5f);
6127 const float spacing_U = (float)(
int)(style.
ItemSpacing.
y * 0.5f);
6128 const float spacing_R = style.
ItemSpacing.
x - spacing_L;
6129 const float spacing_D = style.
ItemSpacing.
y - spacing_U;
6130 bb_with_spacing.Min.x -= spacing_L;
6131 bb_with_spacing.Min.y -= spacing_U;
6132 bb_with_spacing.Max.x += spacing_R;
6133 bb_with_spacing.Max.y += spacing_D;
6134 if (!
ItemAdd(bb_with_spacing, &
id))
6138 bool pressed =
ButtonBehaviour(bb_with_spacing,
id, &hovered, &held,
true,
false,
false);
6141 if (hovered || selected)
6157 *p_selected = !*p_selected;
6178 const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
6179 const ImGuiAabb bb(frame_bb.Min, frame_bb.Max +
ImVec2(label_size.
x > 0.0f ? style.
ItemInnerSpacing.
x + label_size.
x : 0.0f, 0.0f));
6180 window->DC.LastItemAabb = bb;
6182 if (label_size.
x > 0)
6194 if (height_in_items < 0)
6195 height_in_items =
ImMin(items_count, 7);
6196 float height_in_items_f = height_in_items < items_count ? (height_in_items + 0.40f) : (height_in_items + 0.00f);
6208 const ImGuiAabb bb = parent_window->DC.LastItemAabb;
6212 parent_window->DC.CursorPos = bb.Min;
6216 bool ImGui::ListBox(
const char* label,
int* current_item,
const char** items,
int items_count,
int height_items)
6218 const bool value_changed =
ListBox(label, current_item,
Items_ArrayGetter, (
void*)items, items_count, height_items);
6219 return value_changed;
6222 bool ImGui::ListBox(
const char* label,
int* current_item,
bool (*items_getter)(
void*,
int,
const char**),
void* data,
int items_count,
int height_in_items)
6225 if (window->SkipItems)
6231 bool value_changed =
false;
6232 for (
int i = 0; i < items_count; i++)
6234 const bool item_selected = (i == *current_item);
6235 const char* item_text;
6236 if (!items_getter(data, i, &item_text))
6237 item_text =
"*Unknown item*";
6243 value_changed =
true;
6249 return value_changed;
6257 if (window->SkipItems)
6261 const ImGuiID id = window->GetID(
"#colorbutton");
6262 const float square_size = window->FontSize();
6263 const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos +
ImVec2(square_size + style.
FramePadding.
x*2, square_size + (small_height ? 0 : style.
FramePadding.
y*2)));
6274 int ix = (int)(col.
x * 255.0f + 0.5f);
6275 int iy = (int)(col.
y * 255.0f + 0.5f);
6276 int iz = (int)(col.
z * 255.0f + 0.5f);
6277 int iw = (int)(col.
w * 255.0f + 0.5f);
6278 ImGui::SetTooltip(
"Color:\n(%.2f,%.2f,%.2f,%.2f)\n#%02X%02X%02X%02X", col.
x, col.
y, col.
z, col.
w, ix, iy, iz, iw);
6295 return value_changed;
6304 if (window->SkipItems)
6308 const ImGuiID id = window->GetID(label);
6310 const float square_sz = (window->FontSize() + style.
FramePadding.
x * 2.0f);
6314 edit_mode = g.ColorEditModeStorage.GetInt(
id, 0) % 3;
6320 const ImVec4 col_display(fx, fy, fz, 1.0f);
6325 int ix = (int)(fx * 255.0f + 0.5f);
6326 int iy = (int)(fy * 255.0f + 0.5f);
6327 int iz = (int)(fz * 255.0f + 0.5f);
6328 int iw = (int)(fw * 255.0f + 0.5f);
6330 int components = alpha ? 4 : 3;
6331 bool value_changed =
false;
6335 bool hsv = (edit_mode == 1);
6348 value_changed |=
ImGui::SliderInt(
"##X", &ix, 0, 255, hsv ?
"H:%3.0f" :
"R:%3.0f");
6350 value_changed |=
ImGui::SliderInt(
"##Y", &iy, 0, 255, hsv ?
"S:%3.0f" :
"G:%3.0f");
6354 value_changed |=
ImGui::SliderInt(
"##Z", &iz, 0, 255, hsv ?
"V:%3.0f" :
"B:%3.0f");
6362 value_changed |=
ImGui::SliderInt(
"##Z", &iz, 0, 255, hsv ?
"V:%3.0f" :
"B:%3.0f");
6371 const float w_slider_all = w_full - square_sz;
6374 sprintf(buf,
"#%02X%02X%02X%02X", ix, iy, iz, iw);
6376 sprintf(buf,
"#%02X%02X%02X", ix, iy, iz);
6385 ix = iy = iz = iw = 0;
6387 sscanf(p,
"%02X%02X%02X%02X", (
unsigned int*)&ix, (
unsigned int*)&iy, (
unsigned int*)&iz, (
unsigned int*)&iw);
6389 sscanf(p,
"%02X%02X%02X", (
unsigned int*)&ix, (
unsigned int*)&iy, (
unsigned int*)&iz);
6398 g.ColorEditModeStorage.SetInt(
id, (edit_mode + 1) % 3);
6404 const char* button_titles[3] = {
"RGB",
"HSV",
"HEX" };
6408 g.ColorEditModeStorage.SetInt(
id, (edit_mode + 1) % 3);
6438 return value_changed;
6444 window->DC.ColorEditMode = mode;
6451 if (window->SkipItems)
6454 if (window->DC.ColumnsCount > 1)
6457 const ImGuiAabb bb(
ImVec2(window->Pos.x, window->DC.CursorPos.y),
ImVec2(window->Pos.x + window->Size.x, window->DC.CursorPos.y));
6461 if (window->DC.ColumnsCount > 1)
6466 window->DrawList->AddLine(bb.Min, bb.Max, window->Color(
ImGuiCol_Border));
6468 if (window->DC.ColumnsCount > 1)
6471 window->DC.ColumnsCellMinY = window->DC.CursorPos.y;
6479 if (window->SkipItems)
6490 if (window->SkipItems)
6493 const float line_height =
ImMax(window->DC.CurrentLineHeight, size.
y);
6494 if (adjust_vertical_offset)
6495 adjust_vertical_offset->
y = adjust_vertical_offset->
y + (line_height - size.
y) * 0.5f;
6498 window->DC.CursorPosPrevLine =
ImVec2(window->DC.CursorPos.x + size.
x, window->DC.CursorPos.y);
6499 window->DC.CursorPos =
ImVec2((
float)(
int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX), (
float)(
int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y));
6501 window->SizeContentsCurrent =
ImMax(window->SizeContentsCurrent,
ImVec2(window->DC.CursorPosPrevLine.x - window->Pos.x, window->DC.CursorPos.y + window->ScrollY - window->Pos.y));
6503 window->DC.PrevLineHeight = line_height;
6504 window->DC.CurrentLineHeight = 0.0f;
6509 ItemSize(bb.GetSize(), adjust_start_offset);
6517 if (!bb.Overlaps(ImGuiAabb(window->ClipRectStack.back())) && !g.LogEnabled)
6525 return IsClipped(ImGuiAabb(window->DC.CursorPos, window->DC.CursorPos + item_size));
6531 window->DC.LastItemID =
id ? *
id : 0;
6532 window->DC.LastItemAabb = bb;
6535 window->DC.LastItemHovered =
false;
6542 window->DC.LastItemHovered = hovered;
6555 if (window->SkipItems)
6561 if (spacing_w < 0) spacing_w = 0;
6562 x = window->Pos.x + (float)column_x + (
float)spacing_w;
6563 y = window->DC.CursorPosPrevLine.y;
6567 if (spacing_w < 0) spacing_w = (int)g.Style.ItemSpacing.x;
6568 x = window->DC.CursorPosPrevLine.x + (
float)spacing_w;
6569 y = window->DC.CursorPosPrevLine.y;
6571 window->DC.CurrentLineHeight = window->DC.PrevLineHeight;
6572 window->DC.CursorPos =
ImVec2(x, y);
6579 if (window->SkipItems)
6582 if (window->DC.ColumnsCount > 1)
6587 window->DC.ColumnsCellMaxY =
ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
6588 if (++window->DC.ColumnsCurrent < window->DC.ColumnsCount)
6590 window->DC.ColumnsOffsetX =
ImGui::GetColumnOffset(window->DC.ColumnsCurrent) - window->DC.ColumnsStartX + g.Style.ItemSpacing.x;
6594 window->DC.ColumnsCurrent = 0;
6595 window->DC.ColumnsOffsetX = 0.0f;
6596 window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY;
6598 window->DC.CursorPos.x = (float)(
int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX);
6599 window->DC.CursorPos.y = window->DC.ColumnsCellMinY;
6600 window->DC.CurrentLineHeight = 0.0f;
6610 return window->DC.ColumnsCurrent;
6616 return window->DC.ColumnsCount;
6623 if (column_index < 0)
6624 column_index = window->DC.ColumnsCurrent;
6627 IM_ASSERT(column_index < (
int)window->DC.ColumnsOffsetsT.size());
6628 const float t = window->DC.ColumnsOffsetsT[column_index];
6630 const float min_x = window->DC.ColumnsStartX;
6631 const float max_x = window->Size.x - (g.Style.ScrollbarWidth);
6632 const float offset = min_x + t * (max_x - min_x);
6640 if (column_index < 0)
6641 column_index = window->DC.ColumnsCurrent;
6643 IM_ASSERT(column_index < (
int)window->DC.ColumnsOffsetsT.size());
6644 const ImGuiID column_id = window->DC.ColumnsSetID +
ImGuiID(column_index);
6646 const float min_x = window->DC.ColumnsStartX;
6647 const float max_x = window->Size.x - (g.Style.ScrollbarWidth);
6648 const float t = (offset - min_x) / (max_x - min_x);
6649 window->DC.StateStorage->SetFloat(column_id, t);
6650 window->DC.ColumnsOffsetsT[column_index] = t;
6656 if (column_index < 0)
6657 column_index = window->DC.ColumnsCurrent;
6666 if (column_index < 0)
6667 column_index = window->DC.ColumnsCurrent;
6679 if (window->DC.ColumnsCount != 1)
6681 if (window->DC.ColumnsCurrent != 0)
6686 window->DC.ColumnsCellMaxY =
ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
6687 window->DC.CursorPos.y = window->DC.ColumnsCellMaxY;
6691 if (window->DC.ColumnsCount != columns_count && window->DC.ColumnsCount != 1 && window->DC.ColumnsShowBorders && !window->SkipItems)
6693 const float y1 = window->DC.ColumnsStartPos.y;
6694 const float y2 = window->DC.CursorPos.y;
6695 for (
int i = 1; i < window->DC.ColumnsCount; i++)
6700 const ImGuiAabb column_aabb(
ImVec2(x-4,y1),
ImVec2(x+4,y2));
6710 const float xi = (float)(
int)x;
6711 window->DrawList->AddLine(
ImVec2(xi, y1),
ImVec2(xi, y2), col);
6724 window->DC.ColumnsSetID = window->GetID(
id ?
id :
"");
6725 window->DC.ColumnsCurrent = 0;
6726 window->DC.ColumnsCount = columns_count;
6727 window->DC.ColumnsShowBorders = border;
6728 window->DC.ColumnsStartPos = window->DC.CursorPos;
6729 window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.CursorPos.y;
6730 window->DC.ColumnsOffsetX = 0.0f;
6731 window->DC.CursorPos.x = (float)(
int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX);
6733 if (window->DC.ColumnsCount != 1)
6736 window->DC.ColumnsOffsetsT.resize((
size_t)columns_count + 1);
6737 for (
int column_index = 0; column_index < columns_count + 1; column_index++)
6739 const ImGuiID column_id = window->DC.ColumnsSetID +
ImGuiID(column_index);
6741 const float default_t = column_index / (float)window->DC.ColumnsCount;
6742 const float t = window->DC.StateStorage->GetFloat(column_id, default_t);
6743 window->DC.ColumnsOffsetsT[column_index] = t;
6751 window->DC.ColumnsOffsetsT.resize(2);
6752 window->DC.ColumnsOffsetsT[0] = 0.0f;
6753 window->DC.ColumnsOffsetsT[1] = 1.0f;
6761 window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
6762 window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
6763 window->DC.TreeDepth++;
6764 PushID(str_id ? str_id :
"#TreePush");
6771 window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
6772 window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
6773 window->DC.TreeDepth++;
6774 PushID(ptr_id ? ptr_id : (
const void*)
"#TreePush");
6781 window->DC.ColumnsStartX -= g.Style.TreeNodeSpacing;
6782 window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
6783 window->DC.TreeDepth--;
6789 ImGui::Text(
"%s: %s", prefix, (b ?
"true" :
"false"));
6807 sprintf(fmt,
"%%s: %s", float_format);
6829 col.
x = (float)((v >> 0) & 0xFF) / 255.0f;
6830 col.
y = (float)((v >> 8) & 0xFF) / 255.0f;
6831 col.
z = (float)((v >> 16) & 0xFF) / 255.0f;
6832 col.
w = (float)((v >> 24) & 0xFF) / 255.0f;
6845 vtx_buffer.resize(0);
6847 clip_rect_stack.resize(0);
6848 texture_id_stack.resize(0);
6856 draw_cmd.
texture_id = texture_id_stack.empty() ? NULL : texture_id_stack.back();
6859 commands.push_back(draw_cmd);
6864 ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
6868 current_cmd = &commands.back();
6880 ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
6894 clip_rect_stack.push_back(clip_rect);
6901 clip_rect_stack.pop_back();
6907 ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
6908 const ImTextureID texture_id = texture_id_stack.empty() ? NULL : texture_id_stack.back();
6921 texture_id_stack.push_back(texture_id);
6928 texture_id_stack.pop_back();
6938 vtx_buffer.resize(vtx_buffer.size() + vtx_count);
6939 vtx_write = &vtx_buffer[vtx_buffer.size() - vtx_count];
6945 vtx_write->pos = pos;
6946 vtx_write->col = col;
6947 vtx_write->uv = GImGui->FontTexUvWhitePixel;
6953 vtx_write->pos = pos;
6954 vtx_write->col = col;
6963 const ImVec2 hn = (b - a) * (0.50f / length);
6968 AddVtx(a + hp0, col);
6969 AddVtx(b + hp0, col);
6970 AddVtx(a + hp1, col);
6971 AddVtx(b + hp0, col);
6972 AddVtx(b + hp1, col);
6973 AddVtx(a + hp1, col);
6978 if ((col >> 24) == 0)
6982 AddVtxLine(a, b, col);
6987 if ((col >> 24) == 0)
6990 static ImVec2 circle_vtx[12];
6991 static bool circle_vtx_builds =
false;
6992 if (!circle_vtx_builds)
6996 const float a = ((float)i / (
float)
IM_ARRAYSIZE(circle_vtx)) * 2*
PI;
6997 circle_vtx[i].
x = cosf(a +
PI);
6998 circle_vtx[i].
y = sinf(a +
PI);
7000 circle_vtx_builds =
true;
7005 ReserveVertices((
unsigned int)(a_max-a_min) * 3);
7006 for (
int a = a_min; a < a_max; a++)
7008 AddVtx(center + circle_vtx[a %
IM_ARRAYSIZE(circle_vtx)] * rad, col);
7009 AddVtx(center + circle_vtx[(a+1) %
IM_ARRAYSIZE(circle_vtx)] * rad, col);
7010 AddVtx(center + third_point_offset, col);
7015 ReserveVertices((
unsigned int)(a_max-a_min) * 6);
7016 for (
int a = a_min; a < a_max; a++)
7017 AddVtxLine(center + circle_vtx[a %
IM_ARRAYSIZE(circle_vtx)] * rad, center + circle_vtx[(a+1) %
IM_ARRAYSIZE(circle_vtx)] * rad, col);
7023 if ((col >> 24) == 0)
7027 r =
ImMin(r, fabsf(b.
x-a.
x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ));
7028 r =
ImMin(r, fabsf(b.
y-a.
y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ));
7030 if (r == 0.0f || rounding_corners == 0)
7032 ReserveVertices(4*6);
7040 ReserveVertices(4*6);
7041 AddVtxLine(
ImVec2(a.
x + ((rounding_corners & 1)?r:0), a.
y),
ImVec2(b.
x - ((rounding_corners & 2)?r:0), a.
y), col);
7042 AddVtxLine(
ImVec2(b.
x, a.
y + ((rounding_corners & 2)?r:0)),
ImVec2(b.
x, b.
y - ((rounding_corners & 4)?r:0)), col);
7043 AddVtxLine(
ImVec2(b.
x - ((rounding_corners & 4)?r:0), b.
y),
ImVec2(a.
x + ((rounding_corners & 8)?r:0), b.
y), col);
7044 AddVtxLine(
ImVec2(a.
x, b.
y - ((rounding_corners & 8)?r:0)),
ImVec2(a.
x, a.
y + ((rounding_corners & 1)?r:0)), col);
7046 if (rounding_corners & 1) AddArc(
ImVec2(a.
x+r,a.
y+r), r, col, 0, 3);
7047 if (rounding_corners & 2) AddArc(
ImVec2(b.
x-r,a.
y+r), r, col, 3, 6);
7048 if (rounding_corners & 4) AddArc(
ImVec2(b.
x-r,b.
y-r), r, col, 6, 9);
7049 if (rounding_corners & 8) AddArc(
ImVec2(a.
x+r,b.
y-r), r, col, 9, 12);
7055 if ((col >> 24) == 0)
7059 r =
ImMin(r, fabsf(b.
x-a.
x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ));
7060 r =
ImMin(r, fabsf(b.
y-a.
y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ));
7062 if (r == 0.0f || rounding_corners == 0)
7075 ReserveVertices(6+6*2);
7083 float top_y = (rounding_corners & 1) ? a.
y+r : a.
y;
7084 float bot_y = (rounding_corners & 8) ? b.
y-r : b.
y;
7085 AddVtx(
ImVec2(a.
x,top_y), col);
7086 AddVtx(
ImVec2(a.
x+r,top_y), col);
7087 AddVtx(
ImVec2(a.
x+r,bot_y), col);
7088 AddVtx(
ImVec2(a.
x,top_y), col);
7089 AddVtx(
ImVec2(a.
x+r,bot_y), col);
7090 AddVtx(
ImVec2(a.
x,bot_y), col);
7092 top_y = (rounding_corners & 2) ? a.
y+r : a.
y;
7093 bot_y = (rounding_corners & 4) ? b.
y-r : b.
y;
7094 AddVtx(
ImVec2(b.
x-r,top_y), col);
7095 AddVtx(
ImVec2(b.
x,top_y), col);
7096 AddVtx(
ImVec2(b.
x,bot_y), col);
7097 AddVtx(
ImVec2(b.
x-r,top_y), col);
7098 AddVtx(
ImVec2(b.
x,bot_y), col);
7099 AddVtx(
ImVec2(b.
x-r,bot_y), col);
7101 if (rounding_corners & 1) AddArc(
ImVec2(a.
x+r,a.
y+r), r, col, 0, 3,
true);
7102 if (rounding_corners & 2) AddArc(
ImVec2(b.
x-r,a.
y+r), r, col, 3, 6,
true);
7103 if (rounding_corners & 4) AddArc(
ImVec2(b.
x-r,b.
y-r), r, col, 6, 9,
true);
7104 if (rounding_corners & 8) AddArc(
ImVec2(a.
x+r,b.
y-r), r, col, 9, 12,
true);
7110 if ((col >> 24) == 0)
7121 if ((col >> 24) == 0)
7124 ReserveVertices((
unsigned int)num_segments*6);
7125 const float a_step = 2*
PI/(float)num_segments;
7127 for (
int i = 0; i < num_segments; i++)
7129 const float a1 = (i + 1) == num_segments ? 0.0f : a0 + a_step;
7130 AddVtxLine(centre +
ImVec2(cosf(a0), sinf(a0))*radius, centre +
ImVec2(cosf(a1), sinf(a1))*radius, col);
7137 if ((col >> 24) == 0)
7140 ReserveVertices((
unsigned int)num_segments*3);
7141 const float a_step = 2*
PI/(float)num_segments;
7143 for (
int i = 0; i < num_segments; i++)
7145 const float a1 = (i + 1) == num_segments ? 0.0f : a0 + a_step;
7146 AddVtx(centre +
ImVec2(cosf(a0), sinf(a0))*radius, col);
7147 AddVtx(centre +
ImVec2(cosf(a1), sinf(a1))*radius, col);
7148 AddVtx(centre, col);
7155 if ((col >> 24) == 0)
7158 if (text_end == NULL)
7159 text_end = text_begin + strlen(text_begin);
7164 const unsigned int char_count = (
unsigned int)(text_end - text_begin);
7165 const unsigned int vtx_count_max = char_count * 6;
7166 const size_t vtx_begin = vtx_buffer.size();
7167 ReserveVertices(vtx_count_max);
7169 font->
RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, vtx_write, wrap_width, cpu_clip_max);
7172 vtx_buffer.resize((
size_t)(vtx_write - &vtx_buffer.front()));
7173 const size_t vtx_count = vtx_buffer.size() - vtx_begin;
7174 commands.back().vtx_count -= (
unsigned int)(vtx_count_max - vtx_count);
7175 vtx_write -= (vtx_count_max - vtx_count);
7180 if ((col >> 24) == 0)
7183 const bool push_texture_id = texture_id_stack.empty() || user_texture_id != texture_id_stack.back();
7184 if (push_texture_id)
7185 PushTextureID(user_texture_id);
7188 AddVtxUV(
ImVec2(a.
x,a.
y), col, uv0);
7190 AddVtxUV(
ImVec2(b.
x,b.
y), col, uv1);
7192 AddVtxUV(
ImVec2(b.
x,b.
y), col, uv1);
7195 if (push_texture_id)
7203 struct ImFontAtlas::ImFontAtlasData
7223 TexPixelsAlpha8 = NULL;
7224 TexPixelsRGBA32 = NULL;
7225 TexWidth = TexHeight = 0;
7226 TexExtraDataPos = TexUvWhitePixel =
ImVec2(0, 0);
7236 for (
size_t i = 0; i < InputData.size(); i++)
7238 if (InputData[i]->TTFData)
7247 if (TexPixelsAlpha8)
7249 if (TexPixelsRGBA32)
7251 TexPixelsAlpha8 = NULL;
7252 TexPixelsRGBA32 = NULL;
7259 for (
size_t i = 0; i < Fonts.size(); i++)
7261 Fonts[i]->~ImFont();
7269 printf(
"GetDefaultFontData() is obsoleted in ImGui 1.30.\n");
7270 printf(
"Please use ImGui::GetIO().Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8() functions to retrieve uncompressed texture data.\n");
7271 if (fnt_data) *fnt_data = NULL;
7272 if (fnt_size) *fnt_size = 0;
7273 if (png_data) *png_data = NULL;
7274 if (png_size) *png_size = 0;
7281 if (TexPixelsAlpha8 == NULL)
7283 if (InputData.empty())
7288 *out_pixels = TexPixelsAlpha8;
7289 if (out_width) *out_width = TexWidth;
7290 if (out_height) *out_height = TexHeight;
7291 if (out_bytes_per_pixel) *out_bytes_per_pixel = 1;
7298 if (!TexPixelsRGBA32)
7300 unsigned char* pixels;
7301 GetTexDataAsAlpha8(&pixels, NULL, NULL);
7302 TexPixelsRGBA32 = (
unsigned int*)
ImGui::MemAlloc((
size_t)(TexWidth * TexHeight * 4));
7303 const unsigned char* src = pixels;
7304 unsigned int* dst = TexPixelsRGBA32;
7305 for (
int n = TexWidth * TexHeight; n > 0; n--)
7306 *dst++ = ((
unsigned int)(*src++) << 24) | 0x00FFFFFF;
7309 *out_pixels = (
unsigned char*)TexPixelsRGBA32;
7310 if (out_width) *out_width = TexWidth;
7311 if (out_height) *out_height = TexHeight;
7312 if (out_bytes_per_pixel) *out_bytes_per_pixel = 4;
7317 static unsigned int stb_decompress(
unsigned char *output,
unsigned char *i,
unsigned int length);
7323 unsigned int ttf_compressed_size;
7324 const void* ttf_compressed;
7329 unsigned char* buf_decompressed = (
unsigned char *)
ImGui::MemAlloc(buf_decompressed_size);
7330 stb_decompress(buf_decompressed, (
unsigned char*)ttf_compressed, ttf_compressed_size);
7333 ImFont* font = AddFontFromMemoryTTF(buf_decompressed, buf_decompressed_size, 13.0f, GetGlyphRangesDefault(), 0);
7341 size_t data_size = 0;
7349 ImFont* font = AddFontFromMemoryTTF(data, data_size, size_pixels, glyph_ranges, font_no);
7359 Fonts.push_back(font);
7362 ImFontAtlasData* data = (ImFontAtlasData*)
ImGui::MemAlloc(
sizeof(ImFontAtlasData));
7363 memset(data, 0,
sizeof(ImFontAtlasData));
7364 data->OutFont = font;
7365 data->TTFData = in_ttf_data;
7366 data->TTFDataSize = in_ttf_data_size;
7367 data->SizePixels = size_pixels;
7368 data->GlyphRanges = glyph_ranges;
7369 data->FontNo = font_no;
7370 InputData.push_back(data);
7383 TexWidth = TexHeight = 0;
7384 TexExtraDataPos = TexUvWhitePixel =
ImVec2(0, 0);
7388 int total_glyph_count = 0;
7389 int total_glyph_range_count = 0;
7390 for (
size_t input_i = 0; input_i < InputData.size(); input_i++)
7392 ImFontAtlasData& data = *InputData[input_i];
7393 IM_ASSERT(data.OutFont && !data.OutFont->IsLoaded());
7396 if (!
stbtt_InitFont(&data.FontInfo, (
unsigned char*)data.TTFData, font_offset))
7399 if (!data.GlyphRanges)
7400 data.GlyphRanges = GetGlyphRangesDefault();
7401 for (
const ImWchar* in_range = data.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
7403 total_glyph_count += (in_range[1] - in_range[0]) + 1;
7404 total_glyph_range_count++;
7409 TexWidth = (total_glyph_count > 1000) ? 1024 : 512;
7411 const int max_tex_height = 1024*32;
7413 int ret =
stbtt_PackBegin(&spc, NULL, TexWidth, max_tex_height, 0, 1, NULL);
7422 TexExtraDataPos =
ImVec2(extra_rect.
x, extra_rect.
y);
7425 int buf_packedchars_n = 0, buf_rects_n = 0, buf_ranges_n = 0;
7430 memset(buf_rects, 0, total_glyph_count *
sizeof(
stbrp_rect));
7434 int tex_height = extra_rect.
y + extra_rect.
h;
7435 for (
size_t input_i = 0; input_i < InputData.size(); input_i++)
7437 ImFontAtlasData& data = *InputData[input_i];
7440 int glyph_count = 0;
7441 int glyph_ranges_count = 0;
7442 for (
const ImWchar* in_range = data.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
7444 glyph_count += (in_range[1] - in_range[0]) + 1;
7445 glyph_ranges_count++;
7447 data.Ranges = buf_ranges + buf_ranges_n;
7448 data.RangesCount = glyph_ranges_count;
7449 buf_ranges_n += glyph_ranges_count;
7450 for (
int i = 0; i < glyph_ranges_count; i++)
7452 const ImWchar* in_range = &data.GlyphRanges[i * 2];
7462 data.Rects = buf_rects + buf_rects_n;
7463 buf_rects_n += glyph_count;
7468 for (
int i = 0; i < n; i++)
7469 if (data.Rects[i].was_packed)
7470 tex_height =
ImMax(tex_height, data.Rects[i].y + data.Rects[i].h);
7472 IM_ASSERT(buf_rects_n == total_glyph_count);
7473 IM_ASSERT(buf_packedchars_n == total_glyph_count);
7474 IM_ASSERT(buf_ranges_n == total_glyph_range_count);
7478 TexPixelsAlpha8 = (
unsigned char*)
ImGui::MemAlloc(TexWidth * TexHeight);
7479 memset(TexPixelsAlpha8, 0, TexWidth * TexHeight);
7480 spc.
pixels = TexPixelsAlpha8;
7484 for (
size_t input_i = 0; input_i < InputData.size(); input_i++)
7486 ImFontAtlasData& data = *InputData[input_i];
7497 for (
size_t input_i = 0; input_i < InputData.size(); input_i++)
7499 ImFontAtlasData& data = *InputData[input_i];
7500 data.OutFont->ContainerAtlas =
this;
7501 data.OutFont->FontSize = data.SizePixels;
7504 int font_ascent, font_descent, font_line_gap;
7507 const float uv_scale_x = 1.0f / TexWidth;
7508 const float uv_scale_y = 1.0f / TexHeight;
7509 const int character_spacing_x = 1;
7510 for (
int i = 0; i < data.RangesCount; i++)
7517 if (!pc.
x0 && !pc.
x1 && !pc.
y0 && !pc.
y1)
7520 data.OutFont->Glyphs.resize(data.OutFont->Glyphs.size() + 1);
7523 glyph.
Width = (
signed short)pc.
x1 - pc.
x0 + 1;
7524 glyph.
Height = (
signed short)pc.
y1 - pc.
y0 + 1;
7526 glyph.
YOffset = (
signed short)(pc.
yoff + (
int)(font_ascent * font_scale));
7528 glyph.
U0 = ((float)pc.
x0 - 0.5f) * uv_scale_x;
7529 glyph.
V0 = ((float)pc.
y0 - 0.5f) * uv_scale_y;
7530 glyph.
U1 = ((float)pc.
x0 - 0.5f + glyph.
Width) * uv_scale_x;
7531 glyph.
V1 = ((float)pc.
y0 - 0.5f + glyph.
Height) * uv_scale_y;
7535 data.OutFont->BuildLookupTable();
7541 buf_packedchars = NULL;
7546 RenderCustomTexData();
7553 IM_ASSERT(TexExtraDataPos.x == 0.0f && TexExtraDataPos.y == 0.0f);
7556 TexPixelsAlpha8[0] = TexPixelsAlpha8[1] = TexPixelsAlpha8[TexWidth+0] = TexPixelsAlpha8[TexWidth+1] = 0xFF;
7557 TexUvWhitePixel =
ImVec2((TexExtraDataPos.x + 0.5f) / TexWidth, (TexExtraDataPos.y + 0.5f) / TexHeight);
7561 const char cursor_pixels[] =
7584 for (
int y = 0, n = 0; y < 19; y++)
7585 for (
int x = 0; x < 12; x++, n++)
7606 DisplayOffset =
ImVec2(-0.5f, 0.5f);
7607 ContainerAtlas = NULL;
7609 FallbackGlyph = NULL;
7610 FallbackXAdvance = 0.0f;
7611 IndexXAdvance.clear();
7612 IndexLookup.clear();
7618 static const ImWchar ranges[] =
7628 static const ImWchar ranges[] =
7644 static const short offsets_from_0x4E00[] =
7646 -1,0,1,3,0,0,0,0,1,0,5,1,1,0,7,4,6,10,0,1,9,9,7,1,3,19,1,10,7,1,0,1,0,5,1,0,6,4,2,6,0,0,12,6,8,0,3,5,0,1,0,9,0,0,8,1,1,3,4,5,13,0,0,8,2,17,
7647 4,3,1,1,9,6,0,0,0,2,1,3,2,22,1,9,11,1,13,1,3,12,0,5,9,2,0,6,12,5,3,12,4,1,2,16,1,1,4,6,5,3,0,6,13,15,5,12,8,14,0,0,6,15,3,6,0,18,8,1,6,14,1,
7648 5,4,12,24,3,13,12,10,24,0,0,0,1,0,1,1,2,9,10,2,2,0,0,3,3,1,0,3,8,0,3,2,4,4,1,6,11,10,14,6,15,3,4,15,1,0,0,5,2,2,0,0,1,6,5,5,6,0,3,6,5,0,0,1,0,
7649 11,2,2,8,4,7,0,10,0,1,2,17,19,3,0,2,5,0,6,2,4,4,6,1,1,11,2,0,3,1,2,1,2,10,7,6,3,16,0,8,24,0,0,3,1,1,3,0,1,6,0,0,0,2,0,1,5,15,0,1,0,0,2,11,19,
7650 1,4,19,7,6,5,1,0,0,0,0,5,1,0,1,9,0,0,5,0,2,0,1,0,3,0,11,3,0,2,0,0,0,0,0,9,3,6,4,12,0,14,0,0,29,10,8,0,14,37,13,0,31,16,19,0,8,30,1,20,8,3,48,
7651 21,1,0,12,0,10,44,34,42,54,11,18,82,0,2,1,2,12,1,0,6,2,17,2,12,7,0,7,17,4,2,6,24,23,8,23,39,2,16,23,1,0,5,1,2,15,14,5,6,2,11,0,8,6,2,2,2,14,
7652 20,4,15,3,4,11,10,10,2,5,2,1,30,2,1,0,0,22,5,5,0,3,1,5,4,1,0,0,2,2,21,1,5,1,2,16,2,1,3,4,0,8,4,0,0,5,14,11,2,16,1,13,1,7,0,22,15,3,1,22,7,14,
7653 22,19,11,24,18,46,10,20,64,45,3,2,0,4,5,0,1,4,25,1,0,0,2,10,0,0,0,1,0,1,2,0,0,9,1,2,0,0,0,2,5,2,1,1,5,5,8,1,1,1,5,1,4,9,1,3,0,1,0,1,1,2,0,0,
7654 2,0,1,8,22,8,1,0,0,0,0,4,2,1,0,9,8,5,0,9,1,30,24,2,6,4,39,0,14,5,16,6,26,179,0,2,1,1,0,0,0,5,2,9,6,0,2,5,16,7,5,1,1,0,2,4,4,7,15,13,14,0,0,
7655 3,0,1,0,0,0,2,1,6,4,5,1,4,9,0,3,1,8,0,0,10,5,0,43,0,2,6,8,4,0,2,0,0,9,6,0,9,3,1,6,20,14,6,1,4,0,7,2,3,0,2,0,5,0,3,1,0,3,9,7,0,3,4,0,4,9,1,6,0,
7656 9,0,0,2,3,10,9,28,3,6,2,4,1,2,32,4,1,18,2,0,3,1,5,30,10,0,2,2,2,0,7,9,8,11,10,11,7,2,13,7,5,10,0,3,40,2,0,1,6,12,0,4,5,1,5,11,11,21,4,8,3,7,
7657 8,8,33,5,23,0,0,19,8,8,2,3,0,6,1,1,1,5,1,27,4,2,5,0,3,5,6,3,1,0,3,1,12,5,3,3,2,0,7,7,2,1,0,4,0,1,1,2,0,10,10,6,2,5,9,7,5,15,15,21,6,11,5,20,
7658 4,3,5,5,2,5,0,2,1,0,1,7,28,0,9,0,5,12,5,5,18,30,0,12,3,3,21,16,25,32,9,3,14,11,24,5,66,9,1,2,0,5,9,1,5,1,8,0,8,3,3,0,1,15,1,4,8,1,2,7,0,7,2,
7659 8,3,7,5,3,7,10,2,1,0,0,2,25,0,6,4,0,10,0,4,2,4,1,12,5,38,4,0,4,1,10,5,9,4,0,14,4,2,5,18,20,21,1,3,0,5,0,7,0,3,7,1,3,1,1,8,1,0,0,0,3,2,5,2,11,
7660 6,0,13,1,3,9,1,12,0,16,6,2,1,0,2,1,12,6,13,11,2,0,28,1,7,8,14,13,8,13,0,2,0,5,4,8,10,2,37,42,19,6,6,7,4,14,11,18,14,80,7,6,0,4,72,12,36,27,
7661 7,7,0,14,17,19,164,27,0,5,10,7,3,13,6,14,0,2,2,5,3,0,6,13,0,0,10,29,0,4,0,3,13,0,3,1,6,51,1,5,28,2,0,8,0,20,2,4,0,25,2,10,13,10,0,16,4,0,1,0,
7662 2,1,7,0,1,8,11,0,0,1,2,7,2,23,11,6,6,4,16,2,2,2,0,22,9,3,3,5,2,0,15,16,21,2,9,20,15,15,5,3,9,1,0,0,1,7,7,5,4,2,2,2,38,24,14,0,0,15,5,6,24,14,
7663 5,5,11,0,21,12,0,3,8,4,11,1,8,0,11,27,7,2,4,9,21,59,0,1,39,3,60,62,3,0,12,11,0,3,30,11,0,13,88,4,15,5,28,13,1,4,48,17,17,4,28,32,46,0,16,0,
7664 18,11,1,8,6,38,11,2,6,11,38,2,0,45,3,11,2,7,8,4,30,14,17,2,1,1,65,18,12,16,4,2,45,123,12,56,33,1,4,3,4,7,0,0,0,3,2,0,16,4,2,4,2,0,7,4,5,2,26,
7665 2,25,6,11,6,1,16,2,6,17,77,15,3,35,0,1,0,5,1,0,38,16,6,3,12,3,3,3,0,9,3,1,3,5,2,9,0,18,0,25,1,3,32,1,72,46,6,2,7,1,3,14,17,0,28,1,40,13,0,20,
7666 15,40,6,38,24,12,43,1,1,9,0,12,6,0,6,2,4,19,3,7,1,48,0,9,5,0,5,6,9,6,10,15,2,11,19,3,9,2,0,1,10,1,27,8,1,3,6,1,14,0,26,0,27,16,3,4,9,6,2,23,
7667 9,10,5,25,2,1,6,1,1,48,15,9,15,14,3,4,26,60,29,13,37,21,1,6,4,0,2,11,22,23,16,16,2,2,1,3,0,5,1,6,4,0,0,4,0,0,8,3,0,2,5,0,7,1,7,3,13,2,4,10,
7668 3,0,2,31,0,18,3,0,12,10,4,1,0,7,5,7,0,5,4,12,2,22,10,4,2,15,2,8,9,0,23,2,197,51,3,1,1,4,13,4,3,21,4,19,3,10,5,40,0,4,1,1,10,4,1,27,34,7,21,
7669 2,17,2,9,6,4,2,3,0,4,2,7,8,2,5,1,15,21,3,4,4,2,2,17,22,1,5,22,4,26,7,0,32,1,11,42,15,4,1,2,5,0,19,3,1,8,6,0,10,1,9,2,13,30,8,2,24,17,19,1,4,
7670 4,25,13,0,10,16,11,39,18,8,5,30,82,1,6,8,18,77,11,13,20,75,11,112,78,33,3,0,0,60,17,84,9,1,1,12,30,10,49,5,32,158,178,5,5,6,3,3,1,3,1,4,7,6,
7671 19,31,21,0,2,9,5,6,27,4,9,8,1,76,18,12,1,4,0,3,3,6,3,12,2,8,30,16,2,25,1,5,5,4,3,0,6,10,2,3,1,0,5,1,19,3,0,8,1,5,2,6,0,0,0,19,1,2,0,5,1,2,5,
7672 1,3,7,0,4,12,7,3,10,22,0,9,5,1,0,2,20,1,1,3,23,30,3,9,9,1,4,191,14,3,15,6,8,50,0,1,0,0,4,0,0,1,0,2,4,2,0,2,3,0,2,0,2,2,8,7,0,1,1,1,3,3,17,11,
7673 91,1,9,3,2,13,4,24,15,41,3,13,3,1,20,4,125,29,30,1,0,4,12,2,21,4,5,5,19,11,0,13,11,86,2,18,0,7,1,8,8,2,2,22,1,2,6,5,2,0,1,2,8,0,2,0,5,2,1,0,
7674 2,10,2,0,5,9,2,1,2,0,1,0,4,0,0,10,2,5,3,0,6,1,0,1,4,4,33,3,13,17,3,18,6,4,7,1,5,78,0,4,1,13,7,1,8,1,0,35,27,15,3,0,0,0,1,11,5,41,38,15,22,6,
7675 14,14,2,1,11,6,20,63,5,8,27,7,11,2,2,40,58,23,50,54,56,293,8,8,1,5,1,14,0,1,12,37,89,8,8,8,2,10,6,0,0,0,4,5,2,1,0,1,1,2,7,0,3,3,0,4,6,0,3,2,
7676 19,3,8,0,0,0,4,4,16,0,4,1,5,1,3,0,3,4,6,2,17,10,10,31,6,4,3,6,10,126,7,3,2,2,0,9,0,0,5,20,13,0,15,0,6,0,2,5,8,64,50,3,2,12,2,9,0,0,11,8,20,
7677 109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38,
7679 static int ranges_unpacked =
false;
7687 if (!ranges_unpacked)
7690 int codepoint = 0x4e00;
7692 for (
int n = 0; n <
IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2)
7693 dst[0] = dst[1] = (
ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1));
7695 ranges_unpacked =
true;
7702 int max_codepoint = 0;
7703 for (
size_t i = 0; i != Glyphs.size(); i++)
7704 max_codepoint =
ImMax(max_codepoint, (
int)Glyphs[i].Codepoint);
7706 IndexXAdvance.clear();
7707 IndexXAdvance.resize((
size_t)max_codepoint + 1);
7708 IndexLookup.clear();
7709 IndexLookup.resize((
size_t)max_codepoint + 1);
7710 for (
size_t i = 0; i < (size_t)max_codepoint + 1; i++)
7712 IndexXAdvance[i] = -1.0f;
7713 IndexLookup[i] = -1;
7715 for (
size_t i = 0; i < Glyphs.size(); i++)
7717 const size_t codepoint = (int)Glyphs[i].Codepoint;
7718 IndexXAdvance[codepoint] = Glyphs[i].XAdvance;
7719 IndexLookup[codepoint] = (int)i;
7724 if (FindGlyph((
unsigned short)
' '))
7726 if (Glyphs.back().Codepoint !=
'\t')
7727 Glyphs.resize(Glyphs.size() + 1);
7729 tab_glyph = *FindGlyph((
unsigned short)
' ');
7733 IndexLookup[(size_t)tab_glyph.
Codepoint] = (
int)(Glyphs.size()-1);
7736 FallbackGlyph = NULL;
7737 FallbackGlyph = FindGlyph(FallbackChar);
7738 FallbackXAdvance = FallbackGlyph ? FallbackGlyph->XAdvance : 0.0f;
7739 for (
size_t i = 0; i < (size_t)max_codepoint + 1; i++)
7740 if (IndexXAdvance[i] < 0.0f)
7741 IndexXAdvance[i] = FallbackXAdvance;
7752 if (c < (
int)IndexLookup.size())
7754 const int i = IndexLookup[c];
7758 return FallbackGlyph;
7766 unsigned int c = (
unsigned int)-1;
7767 const unsigned char* str = (
const unsigned char*)in_text;
7770 c = (
unsigned int)(*str++);
7774 if ((*str & 0xe0) == 0xc0)
7777 if (in_text_end && in_text_end - (
const char*)str < 2)
return 0;
7778 if (*str < 0xc2)
return 0;
7779 c = (
unsigned int)((*str++ & 0x1f) << 6);
7780 if ((*str & 0xc0) != 0x80)
return 0;
7781 c += (*str++ & 0x3f);
7785 if ((*str & 0xf0) == 0xe0)
7788 if (in_text_end && in_text_end - (
const char*)str < 3)
return 0;
7789 if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf))
return 0;
7790 if (*str == 0xed && str[1] > 0x9f)
return 0;
7791 c = (
unsigned int)((*str++ & 0x0f) << 12);
7792 if ((*str & 0xc0) != 0x80)
return 0;
7793 c += (
unsigned int)((*str++ & 0x3f) << 6);
7794 if ((*str & 0xc0) != 0x80)
return 0;
7795 c += (*str++ & 0x3f);
7799 if ((*str & 0xf8) == 0xf0)
7802 if (in_text_end && in_text_end - (
const char*)str < 4)
return 0;
7803 if (*str > 0xf4)
return 0;
7804 if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf))
return 0;
7805 if (*str == 0xf4 && str[1] > 0x8f)
return 0;
7806 c = (
unsigned int)((*str++ & 0x07) << 18);
7807 if ((*str & 0xc0) != 0x80)
return 0;
7808 c += (
unsigned int)((*str++ & 0x3f) << 12);
7809 if ((*str & 0xc0) != 0x80)
return 0;
7810 c += (
unsigned int)((*str++ & 0x3f) << 6);
7811 if ((*str & 0xc0) != 0x80)
return 0;
7812 c += (*str++ & 0x3f);
7814 if ((c & 0xFFFFF800) == 0xD800)
return 0;
7822 static ptrdiff_t
ImTextStrFromUtf8(
ImWchar* buf,
size_t buf_size,
const char* in_text,
const char* in_text_end,
const char** in_text_remaining)
7825 ImWchar* buf_end = buf + buf_size;
7826 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
7836 if (in_text_remaining)
7837 *in_text_remaining = in_text;
7838 return buf_out - buf;
7844 while ((!in_text_end || in_text < in_text_end) && *in_text)
7862 size_t n = buf_size;
7865 if (i+1 > n)
return 0;
7871 if (i+2 > n)
return 0;
7872 buf[i++] = (char)(0xc0 + (c >> 6));
7873 buf[i++] = (char)(0x80 + (c & 0x3f));
7876 else if (c >= 0xdc00 && c < 0xe000)
7880 else if (c >= 0xd800 && c < 0xdc00)
7882 if (i+4 > n)
return 0;
7883 buf[i++] = (char)(0xf0 + (c >> 18));
7884 buf[i++] = (char)(0x80 + ((c >> 12) & 0x3f));
7885 buf[i++] = (char)(0x80 + ((c >> 6) & 0x3f));
7886 buf[i++] = (char)(0x80 + ((c ) & 0x3f));
7891 if (i+3 > n)
return 0;
7892 buf[i++] = (char)(0xe0 + (c >> 12));
7893 buf[i++] = (char)(0x80 + ((c>> 6) & 0x3f));
7894 buf[i++] = (char)(0x80 + ((c ) & 0x3f));
7903 char* buf_out = buf;
7904 const char* buf_end = buf + buf_size;
7905 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
7907 buf_out +=
ImTextCharToUtf8(buf_out, (uintptr_t)(buf_end-buf_out-1), (
unsigned int)*in_text);
7911 return buf_out - buf;
7916 int bytes_count = 0;
7917 while ((!in_text_end || in_text < in_text_end) && *in_text)
7943 float line_width = 0.0f;
7944 float word_width = 0.0f;
7945 float blank_width = 0.0f;
7947 const char* word_end = text;
7948 const char* prev_word_end = NULL;
7949 bool inside_word =
true;
7951 const char* s = text;
7952 while (s < text_end)
7954 unsigned int c = (
unsigned int)*s;
7965 line_width = word_width = blank_width = 0.0f;
7971 const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(
size_t)c] * scale : FallbackXAdvance;
7976 line_width += blank_width;
7979 blank_width += char_width;
7980 inside_word =
false;
7984 word_width += char_width;
7991 prev_word_end = word_end;
7992 line_width += word_width + blank_width;
7993 word_width = blank_width = 0.0f;
7997 inside_word = !(c ==
'.' || c ==
',' || c ==
';' || c ==
'!' || c ==
'?' || c ==
'\"');
8001 if (line_width + word_width >= wrap_width)
8004 if (word_width < wrap_width)
8005 s = prev_word_end ? prev_word_end : word_end;
8015 ImVec2 ImFont::CalcTextSizeA(
float size,
float max_width,
float wrap_width,
const char* text_begin,
const char* text_end,
const char** remaining)
const
8018 text_end = text_begin + strlen(text_begin);
8020 const float scale = size / FontSize;
8021 const float line_height = FontSize *
scale;
8024 float line_width = 0.0f;
8026 const bool word_wrap_enabled = (wrap_width > 0.0f);
8027 const char* word_wrap_eol = NULL;
8029 const char* s = text_begin;
8030 while (s < text_end)
8032 if (word_wrap_enabled)
8037 word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
8038 if (word_wrap_eol == s)
8042 if (s >= word_wrap_eol)
8044 if (text_size.
x < line_width)
8045 text_size.
x = line_width;
8046 text_size.
y += line_height;
8048 word_wrap_eol = NULL;
8051 while (s < text_end)
8054 if (
ImCharIsSpace(c)) { s++; }
else if (c ==
'\n') { s++;
break; }
else {
break; }
8061 unsigned int c = (
unsigned int)*s;
8075 text_size.
x =
ImMax(text_size.
x, line_width);
8076 text_size.
y += line_height;
8081 const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(
size_t)c] * scale : FallbackXAdvance;
8082 if (line_width + char_width >= max_width)
8085 line_width += char_width;
8088 if (line_width > 0 || text_size.
y == 0.0f)
8090 if (text_size.
x < line_width)
8091 text_size.
x = line_width;
8092 text_size.
y += line_height;
8104 text_end = text_begin +
ImStrlenW(text_begin);
8106 const float scale = size / FontSize;
8107 const float line_height = FontSize *
scale;
8110 float line_width = 0.0f;
8112 const ImWchar* s = text_begin;
8113 while (s < text_end)
8115 const unsigned int c = (
unsigned int)(*s++);
8119 text_size.
x =
ImMax(text_size.
x, line_width);
8120 text_size.
y += line_height;
8125 const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(
size_t)c] * scale : FallbackXAdvance;
8126 if (line_width + char_width >= max_width)
8129 line_width += char_width;
8132 if (line_width > 0 || text_size.
y == 0.0f)
8134 if (text_size.
x < line_width)
8135 text_size.
x = line_width;
8136 text_size.
y += line_height;
8148 text_end = text_begin + strlen(text_begin);
8150 const float scale = size / FontSize;
8151 const float line_height = FontSize *
scale;
8154 pos.
x = (float)(
int)pos.
x + DisplayOffset.x;
8155 pos.
y = (float)(
int)pos.
y + DisplayOffset.y;
8157 const bool word_wrap_enabled = (wrap_width > 0.0f);
8158 const char* word_wrap_eol = NULL;
8160 ImVec4 clip_rect = clip_rect_ref;
8163 clip_rect.
z =
ImMin(clip_rect.
z, cpu_clip_max->
x);
8164 clip_rect.
w =
ImMin(clip_rect.
w, cpu_clip_max->
y);
8169 const char* s = text_begin;
8170 while (s < text_end)
8172 if (word_wrap_enabled)
8177 word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.
x));
8178 if (word_wrap_eol == s)
8182 if (s >= word_wrap_eol)
8186 word_wrap_eol = NULL;
8189 while (s < text_end)
8192 if (
ImCharIsSpace(c)) { s++; }
else if (c ==
'\n') { s++;
break; }
else {
break; }
8199 unsigned int c = (
unsigned int)*s;
8218 float char_width = 0.0f;
8219 if (
const Glyph* glyph = FindGlyph((
unsigned short)c))
8221 char_width = glyph->XAdvance *
scale;
8222 if (c !=
' ' && c !=
'\t')
8225 float y1 = (float)(y + glyph->YOffset * scale);
8226 float y2 = (float)(y1 + glyph->Height * scale);
8227 if (y1 <= clip_rect.w && y2 >= clip_rect.
y)
8229 float x1 = (float)(x + glyph->XOffset * scale);
8230 float x2 = (float)(x1 + glyph->Width * scale);
8231 if (x1 <= clip_rect.z && x2 >= clip_rect.
x)
8234 float u1 = glyph->U0;
8235 float v1 = glyph->V0;
8236 float u2 = glyph->U1;
8237 float v2 = glyph->V1;
8242 if (x2 > cpu_clip_max->
x)
8244 const float clip_tx = (cpu_clip_max->
x - x1) / (x2 - x1);
8245 x2 = cpu_clip_max->
x;
8246 u2 = u1 + clip_tx * (u2 - u1);
8248 if (y2 > cpu_clip_max->
y)
8250 const float clip_ty = (cpu_clip_max->
y - y1) / (y2 - y1);
8251 y2 = cpu_clip_max->
y;
8252 v2 = v1 + clip_ty * (v2 - v1);
8257 out_vertices[0].
uv =
ImVec2(u1, v1);
8258 out_vertices[0].
col = col;
8261 out_vertices[1].
uv =
ImVec2(u2, v1);
8262 out_vertices[1].
col = col;
8265 out_vertices[2].
uv =
ImVec2(u2, v2);
8266 out_vertices[2].
col = col;
8268 out_vertices[3] = out_vertices[0];
8269 out_vertices[4] = out_vertices[2];
8272 out_vertices[5].
uv =
ImVec2(u1, v2);
8273 out_vertices[5].
col = col;
8289 #if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS)
8292 #define WIN32_LEAN_AND_MEAN
8293 #include <windows.h>
8299 static char* buf_local = NULL;
8305 if (!OpenClipboard(NULL))
8307 HANDLE wbuf_handle = GetClipboardData(CF_UNICODETEXT);
8308 if (wbuf_handle == NULL)
8316 GlobalUnlock(wbuf_handle);
8324 if (!OpenClipboard(NULL))
8328 HGLOBAL wbuf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length *
sizeof(
ImWchar));
8329 if (wbuf_handle == NULL)
8333 GlobalUnlock(wbuf_handle);
8335 SetClipboardData(CF_UNICODETEXT, wbuf_handle);
8344 return GImGui->PrivateClipboard;
8351 if (g.PrivateClipboard)
8354 g.PrivateClipboard = NULL;
8356 const char* text_end = text + strlen(text);
8357 g.PrivateClipboard = (
char*)
ImGui::MemAlloc((
size_t)(text_end - text) + 1);
8358 memcpy(g.PrivateClipboard, text, (
size_t)(text_end - text));
8359 g.PrivateClipboard[(size_t)(text_end - text)] = 0;
8364 #if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)
8367 #define WIN32_LEAN_AND_MEAN
8368 #include <windows.h>
8371 #pragma comment(lib, "imm32")
8376 if (HWND hwnd = (HWND)GImGui->IO.ImeWindowHandle)
8377 if (HIMC himc = ImmGetContext(hwnd))
8380 cf.ptCurrentPos.x = x;
8381 cf.ptCurrentPos.y = y;
8382 cf.dwStyle = CFS_FORCE_POSITION;
8383 ImmSetCompositionWindow(himc, &cf);
8407 if (g.IO.FontAllowUserScaling)
8412 "While editing text:\n"
8413 "- Hold SHIFT or use mouse to select text\n"
8414 "- CTRL+Left/Right to word jump\n"
8415 "- CTRL+A select all\n"
8416 "- CTRL+X,CTRL+C,CTRL+V clipboard\n"
8417 "- CTRL+Z,CTRL+Y undo/redo\n"
8418 "- ESCAPE to revert\n"
8419 "- You can apply arithmetic operators +,*,/ on numerical values.\n"
8420 " Use +- to subtract.\n");
8431 g.Style = ref ? *ref : def;
8460 static int output_dest = 0;
8461 static bool output_only_modified =
false;
8464 if (output_dest == 0)
8473 if (!output_only_modified || memcmp(&col, (ref ? &ref->
Colors[i] : &def.
Colors[i]),
sizeof(
ImVec4)) != 0)
8474 ImGui::LogText(
"style.Colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" STR_NEWLINE, name, 22 - strlen(name),
"", col.
x, col.
y, col.
z, col.
w);
8490 filter.
Draw(
"Filter colors", 200);
8532 static bool show_app_console =
false;
8533 static bool show_app_long_text =
false;
8534 static bool show_app_auto_resize =
false;
8535 static bool show_app_fixed_overlay =
false;
8536 static bool show_app_custom_rendering =
false;
8537 static bool show_app_manipulating_window_title =
false;
8538 if (show_app_console)
8540 if (show_app_long_text)
8542 if (show_app_auto_resize)
8544 if (show_app_fixed_overlay)
8546 if (show_app_manipulating_window_title)
8548 if (show_app_custom_rendering)
8551 static bool no_titlebar =
false;
8552 static bool no_border =
true;
8553 static bool no_resize =
false;
8554 static bool no_move =
false;
8555 static bool no_scrollbar =
false;
8556 static bool no_collapse =
false;
8557 static float bg_alpha = 0.65f;
8586 ImGui::TextWrapped(
"This window is being created by the ShowTestWindow() function. Please refer to the code for programming reference.\n\nUser Guide:");
8615 ImGui::Text(
"The quick brown fox jumps over the lazy dog");
8625 static float window_scale = 1.0f;
8641 static bool a=
false;
8642 if (
ImGui::Button(
"Button")) { printf(
"Clicked\n"); a ^= 1; }
8651 for (
size_t i = 0; i < 5; i++)
8658 printf(
"Child %d pressed", (
int)i);
8686 ImGui::TextWrapped(
"This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules that works for English and possibly other languages.");
8689 static float wrap_width = 200.0f;
8695 ImGui::Text(
"lazy dog. This paragraph is made to fit within %.0f pixels. The quick brown fox jumps over the lazy dog.", wrap_width);
8702 ImGui::Text(
"aaaaaaaa bbbbbbbb, cccccccc,dddddddd. eeeeeeee ffffffff. gggggggg!hhhhhhhh");
8717 ImGui::TextWrapped(
"CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges.");
8718 ImGui::Text(
"Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
8719 ImGui::Text(
"Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
8720 static char buf[32] =
"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
8727 static ImVec2 size(80, 20);
8728 ImGui::TextWrapped(
"On a per-widget basis we are occasionally clipping text if it won't fit in its frame.");
8731 ImGui::TextWrapped(
"Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and rendering cost.");
8737 ImGui::TextWrapped(
"Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
8742 ImGui::Image(tex_id,
ImVec2(tex_w, tex_h),
ImVec2(0,0),
ImVec2(1,1),
ImColor(255,255,255,255),
ImColor(255,255,255,128));
8746 float focus_sz = 32.0f;
8749 ImGui::Text(
"Min: (%.2f, %.2f)", focus_x, focus_y);
8750 ImGui::Text(
"Max: (%.2f, %.2f)", focus_x + focus_sz, focus_y + focus_sz);
8751 ImVec2 uv0 =
ImVec2((focus_x) / tex_w, (focus_y) / tex_h);
8752 ImVec2 uv1 =
ImVec2((focus_x + focus_sz) / tex_w, (focus_y + focus_sz) / tex_h);
8753 ImGui::Image(tex_id,
ImVec2(128,128), uv0, uv1,
ImColor(255,255,255,255),
ImColor(255,255,255,128));
8757 static int pressed_count = 0;
8758 for (
int i = 0; i < 8; i++)
8763 int frame_padding = -1 + i;
8776 static bool selected[3] = {
false,
true,
false };
8785 static bool selected[3] = {
false,
false,
false };
8793 static bool selected[16] = {
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true };
8794 for (
int i = 0; i < 16; i++)
8799 int x = i % 4, y = i / 4;
8800 if (x > 0) selected[i - 1] ^= 1;
8801 if (x < 3) selected[i + 1] ^= 1;
8802 if (y > 0) selected[i - 4] ^= 1;
8803 if (y < 3) selected[i + 4] ^= 1;
8825 static bool check =
true;
8834 for (
int i = 0; i < 7; i++)
8856 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
8872 static int item = 1;
8873 ImGui::Combo(
"combo", &item,
"aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
8875 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG",
"HHHH",
"IIII",
"JJJJ",
"KKKK" };
8876 static int item2 = -1;
8879 static char str0[128] =
"Hello, world!";
8881 static float f0=0.001f;
8886 static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
8896 static float f1=1.123f;
8899 static float f4=123456789.0f;
8904 static float angle = 0.0f;
8907 static float vec4b[4] = { 0.10f, 0.20f, 0.30f, 0.40f };
8917 static float col1[3] = { 1.0f,0.0f,0.2f };
8918 static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
8922 const char* listbox_items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi",
"Mango",
"Orange",
"Pineapple",
"Strawberry",
"Watermelon" };
8923 static int listbox_item_current = 1;
8934 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
8939 static size_t values_offset = 0;
8943 static float refresh_time = -1.0f;
8947 static float phase = 0.0f;
8948 values[values_offset] = cosf(phase);
8949 values_offset = (values_offset+1)%values.
size();
8950 phase += 0.10f*values_offset;
8981 static bool c1=
false,c2=
false,c3=
false,c4=
false;
8991 static float f0=1.0f,
f1=2.0f,
f2=3.0f;
8993 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD" };
8994 static int item = -1;
9006 static int selection[4] = { 0, 1, 2, 3 };
9007 for (
int i = 0; i < 4; i++)
9021 static int line = 50;
9028 for (
int i = 0; i < 100; i++)
9031 if (goto_line && line == i)
9034 if (goto_line && line >= 100)
9044 for (
int i = 0; i < 100; i++)
9066 const char* names[3] = {
"Robert",
"Stephanie",
"C64" };
9067 const char* paths[3] = {
"/path/robert",
"/path/stephanie",
"/path/computer" };
9068 for (
int i = 0; i < 3; i++)
9120 static float foo = 1.0f;
9128 static float bar = 1.0f;
9170 for (
int i = 0; i < 8; i++)
9181 for (
int i = 0; i < 8; i++)
9197 " \"\" display all lines\n"
9198 " \"xxx\" display lines containing \"xxx\"\n"
9199 " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
9200 " \"-xxx\" hide lines containing \"xxx\"");
9202 const char* lines[] = {
"aaa1.c",
"bbb1.c",
"ccc1.c",
"aaa2.cpp",
"bbb2.cpp",
"ccc2.cpp",
"abc.h",
"hello, world" };
9212 ImGui::Text(
"Use TAB/SHIFT+TAB to cycle thru keyboard editable fields.");
9213 static char buf[32] =
"dummy";
9231 static char buf[128] =
"click on a button to set focus";
9250 ImGui::TextWrapped(
"Cursor & selection are preserved when refocusing last used item in code.");
9261 ImGui::Checkbox(
"Manipulating window title", &show_app_manipulating_window_title);
9276 static int lines = 10;
9277 ImGui::TextWrapped(
"Window will resize every-frame to the size of its content. Note that you don't want to query the window size to output your content because that would create a feedback loop.");
9279 for (
int i = 0; i < lines; i++)
9294 ImGui::Text(
"Simple overlay\non the top-left side of the screen.");
9311 ImGui::Text(
"This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
9316 ImGui::Text(
"This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
9331 if (!
ImGui::Begin(
"Example: Custom Rendering", opened))
9343 static bool adding_line =
false;
9356 draw_list->
AddRect(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y), 0xFFFFFFFF);
9357 bool adding_preview =
false;
9369 adding_preview =
true;
9372 adding_line = adding_preview =
false;
9376 adding_line =
false;
9381 draw_list->
PushClipRect(
ImVec4(canvas_pos.
x, canvas_pos.
y, canvas_pos.
x+canvas_size.
x, canvas_pos.
y+canvas_size.
y));
9382 for (
int i = 0; i < (int)points.
size() - 1; i += 2)
9383 draw_list->
AddLine(
ImVec2(canvas_pos.
x + points[i].x, canvas_pos.
y + points[i].y),
ImVec2(canvas_pos.
x + points[i+1].x, canvas_pos.
y + points[i+1].y), 0xFF00FFFF);
9390 struct ExampleAppConsole
9394 bool ScrollToBottom;
9408 ~ExampleAppConsole()
9411 for (
size_t i = 0; i < Items.
size(); i++)
9417 for (
size_t i = 0; i < Items.
size(); i++)
9420 ScrollToBottom =
true;
9423 void AddLog(
const char* fmt, ...)
9427 va_start(args, fmt);
9431 ScrollToBottom =
true;
9434 void Run(
const char* title,
bool* opened)
9442 ImGui::TextWrapped(
"This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
9457 filter.
Draw(
"Filter (\"incl,-excl\") (\"error\")", 180);
9467 for (
size_t i = 0; i < Items.
size(); i++)
9469 const char* item = Items[i];
9473 if (strstr(item,
"[error]")) col =
ImVec4(1.0f,0.4f,0.4f,1.0f);
9474 else if (strncmp(item,
"# ", 2) == 0) col =
ImVec4(1.0f,0.8f,0.6f,1.0f);
9481 ScrollToBottom =
false;
9489 char* input_end = InputBuf+strlen(InputBuf);
9490 while (input_end > InputBuf && input_end[-1] ==
' ') input_end--; *input_end = 0;
9492 ExecCommand(InputBuf);
9493 strcpy(InputBuf,
"");
9501 void ExecCommand(
const char* command_line)
9503 AddLog(
"# %s\n", command_line);
9507 for (
int i = (
int)History.
size()-1; i >= 0; i--)
9508 if (
ImStricmp(History[i], command_line) == 0)
9517 if (
ImStricmp(command_line,
"CLEAR") == 0)
9521 else if (
ImStricmp(command_line,
"HELP") == 0)
9523 AddLog(
"Commands:");
9524 for (
size_t i = 0; i < Commands.
size(); i++)
9525 AddLog(
"- %s", Commands[i]);
9527 else if (
ImStricmp(command_line,
"HISTORY") == 0)
9529 for (
size_t i = History.
size() >= 10 ? History.
size() - 10 : 0; i < History.
size(); i++)
9530 AddLog(
"%3d: %s\n", i, History[i]);
9534 AddLog(
"Unknown command: '%s'\n", command_line);
9540 ExampleAppConsole* console = (ExampleAppConsole*)data->
UserData;
9541 return console->TextEditCallback(data);
9555 const char* word_start = word_end;
9556 while (word_start > data->
Buf)
9558 const char c = word_start[-1];
9566 for (
size_t i = 0; i < Commands.
size(); i++)
9567 if (
ImStrnicmp(Commands[i], word_start, (
int)(word_end-word_start)) == 0)
9570 if (candidates.
size() == 0)
9573 AddLog(
"No match for \"%.*s\"!\n", word_end-word_start, word_start);
9575 else if (candidates.
size() == 1)
9578 data->
DeleteChars((
int)(word_start-data->
Buf), (
int)(word_end-word_start));
9585 int match_len = (int)(word_end - word_start);
9589 bool all_candidates_matches =
true;
9590 for (
size_t i = 0; i < candidates.
size() && all_candidates_matches; i++)
9592 c = toupper(candidates[i][match_len]);
9593 else if (c != toupper(candidates[i][match_len]))
9594 all_candidates_matches =
false;
9595 if (!all_candidates_matches)
9602 data->
DeleteChars((
int)(word_start - data->
Buf), (
int)(word_end-word_start));
9607 AddLog(
"Possible matches:\n");
9608 for (
size_t i = 0; i < candidates.
size(); i++)
9609 AddLog(
"- %s\n", candidates[i]);
9617 const int prev_history_pos = HistoryPos;
9620 if (HistoryPos == -1)
9621 HistoryPos = (int)(History.
size() - 1);
9622 else if (HistoryPos > 0)
9627 if (HistoryPos != -1)
9628 if (++HistoryPos >= (
int)History.
size())
9633 if (prev_history_pos != HistoryPos)
9647 static ExampleAppConsole console;
9648 console.Run(
"Example: Console", opened);
9659 static int test_type = 0;
9661 static int lines = 0;
9662 ImGui::Text(
"Printing unusually long amount of text.");
9663 ImGui::Combo(
"Test type", &test_type,
"Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped");
9664 ImGui::Text(
"Buffer contents: %d lines, %d bytes", lines, log.
size());
9669 for (
int i = 0; i < 1000; i++)
9670 log.
append(
"%i The quick brown fox jumps over the lazy dog\n", lines+i);
9683 int display_start, display_end;
9686 for (
int i = display_start; i < display_end; i++)
9687 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog\n", i);
9694 for (
int i = 0; i < lines; i++)
9695 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog\n", i);
9722 return (input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11];
9731 assert (stb__dout + length <= stb__barrier);
9732 if (stb__dout + length > stb__barrier) { stb__dout += length;
return; }
9733 if (data < stb__barrier4) { stb__dout = stb__barrier+1;
return; }
9734 while (length--) *stb__dout++ = *data++;
9737 static void stb__lit(
unsigned char *data,
unsigned int length)
9739 assert (stb__dout + length <= stb__barrier);
9740 if (stb__dout + length > stb__barrier) { stb__dout += length;
return; }
9741 if (data < stb__barrier2) { stb__dout = stb__barrier+1;
return; }
9742 memcpy(stb__dout, data, length);
9743 stb__dout += length;
9746 #define stb__in2(x) ((i[x] << 8) + i[(x)+1])
9747 #define stb__in3(x) ((i[x] << 16) + stb__in2((x)+1))
9748 #define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1))
9753 if (*i >= 0x80)
stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2;
9754 else if (*i >= 0x40)
stb__match(stb__dout-(
stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3;
9755 else stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
9767 static unsigned int stb_adler32(
unsigned int adler32,
unsigned char *buffer,
unsigned int buflen)
9769 const unsigned long ADLER_MOD = 65521;
9770 unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
9771 unsigned long blocklen, i;
9773 blocklen = buflen % 5552;
9775 for (i=0; i + 7 < blocklen; i += 8) {
9776 s1 += buffer[0], s2 += s1;
9777 s1 += buffer[1], s2 += s1;
9778 s1 += buffer[2], s2 += s1;
9779 s1 += buffer[3], s2 += s1;
9780 s1 += buffer[4], s2 += s1;
9781 s1 += buffer[5], s2 += s1;
9782 s1 += buffer[6], s2 += s1;
9783 s1 += buffer[7], s2 += s1;
9788 for (; i < blocklen; ++i)
9789 s1 += *buffer++, s2 += s1;
9791 s1 %= ADLER_MOD, s2 %= ADLER_MOD;
9795 return (
unsigned int)(s2 << 16) + (
unsigned int)s1;
9798 static unsigned int stb_decompress(
unsigned char *output,
unsigned char *i,
unsigned int length)
9801 if (
stb__in4(0) != 0x57bC0000)
return 0;
9805 stb__barrier3 = i+length;
9806 stb__barrier = output + olen;
9807 stb__barrier4 = output;
9812 unsigned char *old_i = i;
9815 if (*i == 0x05 && i[1] == 0xfa) {
9816 assert(stb__dout == output + olen);
9817 if (stb__dout != output + olen)
return 0;
9826 assert(stb__dout <= output + olen);
9827 if (stb__dout > output + olen)
9835 0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
9836 0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
9837 0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
9838 0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
9839 0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
9840 0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
9841 0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
9842 0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
9843 0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
9844 0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
9845 0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
9846 0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
9847 0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
9848 0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
9849 0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
9850 0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
9851 0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
9852 0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
9853 0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
9854 0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
9855 0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
9856 0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
9857 0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
9858 0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
9859 0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
9860 0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
9861 0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
9862 0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
9863 0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
9864 0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
9865 0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
9866 0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
9867 0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
9868 0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
9869 0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
9870 0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
9871 0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
9872 0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
9873 0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
9874 0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
9875 0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
9876 0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
9877 0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
9878 0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
9879 0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
9880 0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
9881 0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
9882 0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
9883 0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
9884 0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
9885 0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
9886 0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
9887 0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
9888 0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
9889 0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
9890 0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
9891 0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
9892 0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
9893 0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
9894 0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
9895 0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
9896 0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
9897 0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
9898 0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
9899 0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
9900 0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
9901 0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
9902 0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
9903 0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
9904 0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
9905 0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
9906 0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
9907 0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
9908 0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
9909 0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
9910 0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
9911 0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
9912 0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
9913 0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
9914 0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
9915 0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
9916 0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
9917 0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
9918 0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
9919 0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
9920 0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
9921 0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
9922 0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
9923 0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
9924 0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
9925 0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
9926 0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
9927 0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
9928 0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
9929 0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
9930 0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
9931 0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
9932 0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
9933 0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
9934 0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
9935 0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
9936 0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
9937 0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
9938 0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
9939 0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
9940 0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
9941 0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
9942 0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
9943 0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
9944 0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
9945 0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
9946 0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
9947 0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
9948 0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
9949 0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
9950 0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
9951 0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
9952 0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
9953 0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
9954 0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
9955 0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
9956 0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
9957 0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
9958 0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
9959 0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
9960 0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
9961 0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
9962 0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
9963 0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
9964 0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
9965 0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
9966 0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
9967 0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
9968 0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
9969 0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
9970 0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
9971 0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
9972 0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
9973 0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
9974 0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
9975 0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
9976 0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
9977 0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
9978 0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
9979 0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
9980 0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
9981 0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
9982 0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
9983 0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
9984 0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
9985 0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
9986 0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
9987 0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
9988 0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
9989 0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
9990 0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
9991 0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
9992 0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
9993 0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
9994 0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
9995 0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
9996 0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
9997 0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
9998 0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
9999 0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
10000 0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
10001 0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
10002 0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
10003 0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
10004 0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
10005 0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
10006 0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
10007 0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
10008 0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
10009 0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
10010 0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
10011 0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
10012 0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
10013 0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
10014 0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
10015 0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
10016 0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
10017 0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
10018 0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
10019 0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
10020 0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
10021 0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
10022 0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
10023 0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
10024 0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
10025 0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
10026 0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
10027 0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
10028 0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
10029 0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
10030 0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
10031 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
10032 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
10033 0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
10034 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
10047 #ifdef IMGUI_INCLUDE_IMGUI_USER_INL
static bool InputTextFilterCharacter(unsigned int *p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void *user_data)
IMGUI_API void PlotHistogram(const char *label, const float *values, int values_count, int values_offset=0, const char *overlay_text=NULL, float scale_min=FLT_MAX, float scale_max=FLT_MAX, ImVec2 graph_size=ImVec2(0, 0), size_t stride=sizeof(float))
static const ImVec2 TEX_ATLAS_POS_MOUSE_CURSOR_WHITE(14, 3)
static bool ItemAdd(const ImGuiAabb &bb, const ImGuiID *id)
IMGUI_API void SetNextWindowFocus()
static void RenderTextClipped(ImVec2 pos, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &clip_max)
IMGUI_API bool RadioButton(const char *label, bool active)
IMGUI_API void SetWindowFocus()
static int ChildWindowComparer(const void *lhs, const void *rhs)
IMGUI_API void PopItemWidth()
static float CalcWrapWidthForPos(const ImVec2 &pos, float wrap_pos_x)
IMGUI_API void GetTexDataAsAlpha8(unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
IMGUI_API ImVec2 GetWindowSize()
static const char * GetClipboardTextFn_DefaultImpl()
IMGUI_API void BeginTooltip()
IMGUI_API int GetInt(ImGuiID key, int default_val=0) const
#define STB_TEXTEDIT_STRING
IMGUI_API bool Checkbox(const char *label, bool *v)
static ImVector< ImGuiStorage::Pair >::iterator LowerBound(ImVector< ImGuiStorage::Pair > &data, ImU32 key)
static float ImSaturate(float f)
IMGUI_API void TextWrappedV(const char *fmt, va_list args)
IMGUI_API bool CollapsingHeader(const char *label, const char *str_id=NULL, bool display_frame=true, bool default_open=false)
static ImGuiWindow * FindHoveredWindow(ImVec2 pos, bool excluding_childs)
IMGUI_API bool IsMouseHoveringBox(const ImVec2 &box_min, const ImVec2 &box_max)
float ChildWindowRounding
IMGUI_API void ClearInputData()
static float ImLerp(float a, float b, float t)
static ImVec2 & operator-=(ImVec2 &lhs, const ImVec2 &rhs)
IMGUI_API void PushTextureID(const ImTextureID &texture_id)
static void ShowExampleAppConsole(bool *opened)
static bool InputFloatN(const char *label, float *v, int components, int decimal_precision)
IMGUI_API void appendv(const char *fmt, va_list args)
IMGUI_API void SetWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
static bool SliderFloatN(const char *label, float v[3], int components, float v_min, float v_max, const char *display_format, float power)
IMGUI_API void PopTextureID()
IMGUI_API void SetCursorPos(const ImVec2 &pos)
IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond=0)
void(* ImDrawCallback)(const ImDrawList *parent_list, const ImDrawCmd *cmd)
IMGUI_API void PopStyleColor(int count=1)
static void ApplyNumericalTextInput(const char *buf, float *v)
static ImVec2 & operator*=(ImVec2 &lhs, const float rhs)
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
IMGUI_API void CalcListClipping(int items_count, float items_height, int *out_items_display_start, int *out_items_display_end)
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCond cond=0)
IMGUI_API void SetFallbackChar(ImWchar c)
IMGUI_API void NextColumn()
const char * begin() const
IMGUI_API bool IsMouseHoveringAnyWindow()
static ImVec2 operator/(const ImVec2 &lhs, const ImVec2 rhs)
IMGUI_API ImVec2 GetCursorPos()
IMGUI_API void split(char separator, ImVector< TextRange > &out)
IMGUI_API void GetTexDataAsRGBA32(unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
IMGUI_API bool ColorEdit3(const char *label, float col[3])
static ptrdiff_t ImTextStrFromUtf8(ImWchar *buf, size_t buf_size, const char *in_text, const char *in_text_end, const char **in_remaining=NULL)
IMGUI_API void SetColumnOffset(int column_index, float offset_x)
IMGUI_API const char * CalcWordWrapPositionA(float scale, const char *text, const char *text_end, float wrap_width) const
IMGUI_API void LogToTTY(int max_depth=-1)
IMGUI_API bool IsMouseClicked(int button, bool repeat=false)
IMGUI_API float GetTextLineHeight()
IMGUI_API void AddRect(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners=0x0F)
static void PushClipRect(const ImVec4 &clip_rect, bool clipped=true)
static bool Items_SingleStringGetter(void *data, int idx, const char **out_text)
static ImGuiWindow * FindWindowByName(const char *name)
IMGUI_API void TextWrapped(const char *fmt,...)
IMGUI_API void * GetInternalState()
static bool is_separator(unsigned int c)
static float * GetStyleVarFloatAddr(ImGuiStyleVar idx)
static void ShowExampleAppManipulatingWindowTitle(bool *opened)
STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
IMGUI_API bool SliderFloat2(const char *label, float v[2], float v_min, float v_max, const char *display_format="%.3f", float power=1.0f)
IMGUI_API void SetTooltipV(const char *fmt, va_list args)
static void AddWindowToSortedBuffer(ImGuiWindow *window, ImVector< ImGuiWindow * > &sorted_windows)
IMGUI_API float GetCursorPosY()
IMGUI_API void ListBoxFooter()
static void ItemSize(ImVec2 size, ImVec2 *adjust_start_offset=NULL)
IMGUI_API bool SliderInt2(const char *label, int v[2], int v_min, int v_max, const char *display_format="%.0f")
IMGUI_API bool TreeNodeV(const char *str_id, const char *fmt, va_list args)
IMGUI_API float CalcItemWidth()
IMGUI_API ImVec2 GetMousePos()
static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING *obj, int idx)
IMGUI_API void TreePush(const char *str_id=NULL)
static unsigned char * stb__barrier2
int(* ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data)
IMGUI_API bool SliderFloat(const char *label, float *v, float v_min, float v_max, const char *display_format="%.3f", float power=1.0f)
IMGUI_API const ImWchar * GetGlyphRangesJapanese()
const char * begin() const
IMGUI_API void BeginChildFrame(ImGuiID id, const ImVec2 &size)
IMGUI_API void SetCursorPosX(float x)
IMGUI_API bool IsAnyItemActive()
static void ShowExampleAppFixedOverlay(bool *opened)
STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap)
static void LoadSettings()
IMGUI_API bool IsMouseHoveringWindow()
IMGUI_API void SetInternalState(void *state, bool construct=false)
static int ImUpperPowerOfTwo(int v)
IMGUI_API void Shutdown()
IMGUI_API void PushClipRect(const ImVec4 &clip_rect)
static ImGuiIniData * AddWindowSettings(const char *name)
static void SetWindowSize(ImGuiWindow *window, const ImVec2 &size, ImGuiSetCond cond)
#define IM_ARRAYSIZE(_ARR)
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING *obj, int line_start_idx, int char_idx)
IMGUI_API ImVec2 GetContentRegionMax()
stbtt_packedchar * chardata_for_range
IMGUI_API bool InputFloat4(const char *label, float v[4], int decimal_precision=-1)
IMGUI_API void PopStyleVar(int count=1)
static bool IsMouseHoveringBox(const ImGuiAabb &bb)
static int STB_TEXTEDIT_KEYTOTEXT(int key)
static int ImStricmp(const char *str1, const char *str2)
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float &out_h, float &out_s, float &out_v)
IMGUI_API void SetCursorPosY(float y)
IMGUI_API void LogText(const char *fmt,...)
static int ImStrnicmp(const char *str1, const char *str2, int count)
static bool IsClipped(const ImGuiAabb &bb)
static void stb__lit(unsigned char *data, unsigned int length)
IMGUI_API ImFont * AddFontDefault()
static void ShowExampleAppAutoResize(bool *opened)
IMGUI_API void TextColoredV(const ImVec4 &col, const char *fmt, va_list args)
STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context)
IMGUI_API bool SmallButton(const char *label)
static int ImClamp(int v, int mn, int mx)
static void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
static ImGuiState GImDefaultState
STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
void * user_callback_data
static ImGuiWindow * CreateNewWindow(const char *name, ImVec2 size, ImGuiWindowFlags flags)
IMGUI_API ImFont * GetWindowFont()
IMGUI_API ImVec2 GetWindowContentRegionMax()
static void stb__match(unsigned char *data, unsigned int length)
IMGUI_API size_t GetInternalStateSize()
static const ImVec2 TEX_ATLAS_SIZE(32, 32)
IMGUI_API bool CheckboxFlags(const char *label, unsigned int *flags, unsigned int flags_value)
IMGUI_API bool IsClipped(const ImVec2 &item_size)
IMGUI_API ImVec2 GetWindowContentRegionMin()
IMGUI_API void Color(const char *prefix, const ImVec4 &v)
static const ImVec2 TEX_ATLAS_SIZE_MOUSE_CURSOR(12, 19)
ImGuiInputTextFlags Flags
IMGUI_API float GetTextLineHeightWithSpacing()
static ImVec2 & operator+=(ImVec2 &lhs, const ImVec2 &rhs)
static bool ImCharIsSpace(int c)
IMGUI_API int GetFrameCount()
IMGUI_API void * GetVoidPtr(ImGuiID key) const
IMGUI_API bool InputFloat2(const char *label, float v[2], int decimal_precision=-1)
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2 &pos)
IMGUI_API void AddText(ImFont *font, float font_size, const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL, float wrap_width=0.0f, const ImVec2 *cpu_clip_max=NULL)
IMGUI_API float GetCursorPosX()
IMGUI_API float GetColumnOffset(int column_index=-1)
IMGUI_API bool ColorEdit4(const char *label, float col[4], bool show_alpha=true)
IMGUI_API bool ColorButton(const ImVec4 &col, bool small_height=false, bool outline_border=true)
IMGUI_API bool InvisibleButton(const char *str_id, const ImVec2 &size)
STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels)
IMGUI_API void AddRectFilled(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners=0x0F)
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...)
IMGUI_API bool GetWindowCollapsed()
IMGUI_API bool InputFloat(const char *label, float *v, float step=0.0f, float step_fast=0.0f, int decimal_precision=-1, ImGuiInputTextFlags extra_flags=0)
IMGUI_API void AlignFirstTextHeightToWidgets()
IMGUI_API ImDrawList * GetWindowDrawList()
IMGUI_API void GetDefaultFontData(const void **fnt_data, unsigned int *fnt_size, const void **png_data, unsigned int *png_size)
IMGUI_API float GetScrollPosY()
IMGUI_API bool IsLoaded() const
IMGUI_API bool ListBox(const char *label, int *current_item, const char **items, int items_count, int height_in_items=-1)
IMGUI_API void ColorEditMode(ImGuiColorEditMode mode)
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiTextEditCallback callback=NULL, void *user_data=NULL)
void DeleteChars(int pos, int bytes_count)
static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING *obj)
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
IMGUI_API ImFont * AddFontFromFileTTF(const char *filename, float size_pixels, const ImWchar *glyph_ranges=NULL, int font_no=0)
static size_t ImStrlenW(const ImWchar *str)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0), bool repeat_when_held=false)
IMGUI_API void SetKeyboardFocusHere(int offset=0)
IMGUI_API void PopTextWrapPos()
static ImWchar STB_TEXTEDIT_NEWLINE
IMGUI_API bool IsItemActive()
IMGUI_API int * GetIntRef(ImGuiID key, int default_val=0)
IMGUI_API void AddVtx(const ImVec2 &pos, ImU32 col)
static void RenderText(ImVec2 pos, const char *text, const char *text_end=NULL, bool hide_text_after_hash=true)
IMGUI_API ImVec2 GetCursorScreenPos()
static void SetFont(ImFont *font)
static void SetWindowCollapsed(ImGuiWindow *window, bool collapsed, ImGuiSetCond cond)
static bool Items_ArrayGetter(void *data, int idx, const char **out_text)
static int ImTextCountUtf8BytesFromStr(const ImWchar *in_text, const ImWchar *in_text_end)
IMGUI_API void SetWindowFontScale(float scale)
IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar *text_begin, const ImWchar *text_end, const ImWchar **remaining=NULL) const
IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), int frame_padding=-1, const ImVec4 &bg_col=ImVec4(0, 0, 0, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1))
IMGUI_API float GetFloat(ImGuiID key, float default_val=0.0f) const
IMGUI_API ImVec2 GetItemBoxMin()
static ImGuiWindow * GetCurrentWindow()
IMGUI_API void ClearTexData()
static const unsigned int proggy_clean_ttf_compressed_size
void push_back(const value_type &v)
static bool IsKeyPressedMap(ImGuiKey key, bool repeat=true)
IMGUI_API void PopAllowKeyboardFocus()
IMGUI_API float GetColumnWidth(int column_index=-1)
IMGUI_API bool SliderFloat3(const char *label, float v[3], float v_min, float v_max, const char *display_format="%.3f", float power=1.0f)
static void ShowExampleAppLongText(bool *opened)
static bool SliderIntN(const char *label, int v[3], int components, int v_min, int v_max, const char *display_format)
static const ImVec2 TEX_ATLAS_POS_MOUSE_CURSOR_BLACK(1, 3)
IMGUI_API bool SliderFloat4(const char *label, float v[4], float v_min, float v_max, const char *display_format="%.3f", float power=1.0f)
IMGUI_API void AddCircleFilled(const ImVec2 ¢re, float radius, ImU32 col, int num_segments=12)
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
static size_t ImFormatStringV(char *buf, size_t buf_size, const char *fmt, va_list args)
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
IMGUI_API ImGuiIO & GetIO()
static void RegisterAliveId(const ImGuiID &id)
ImDrawCallback user_callback
static void Plot(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 graph_size)
static void LogText(const ImVec2 &ref_pos, const char *text, const char *text_end=NULL)
static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale=1.0f, bool shadow=false)
IMGUI_API void EndTooltip()
IMGUI_API void AddCircle(const ImVec2 ¢re, float radius, ImU32 col, int num_segments=12)
IMGUI_API void AddDrawCmd()
IMGUI_API void BulletText(const char *fmt,...)
iterator insert(const_iterator it, const value_type &v)
IMGUI_API bool GetWindowIsFocused()
static bool IsHovered(const ImGuiAabb &bb, const ImGuiID &id)
IMGUI_API void SetAllInt(int val)
IMGUI_API void PopClipRect()
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond=0)
static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length)
IMGUI_API void PushFont(ImFont *font)
IMGUI_API const ImWchar * GetGlyphRangesChinese()
float WindowFillAlphaDefault
IMGUI_API ImGuiStyle & GetStyle()
IMGUI_API void SetTooltip(const char *fmt,...)
static unsigned int stb_decompress_length(unsigned char *input)
STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset)
IMGUI_API void PushAllowKeyboardFocus(bool v)
#define va_copy(dest, src)
IMGUI_API void Columns(int count=1, const char *id=NULL, bool border=true)
static int ImMax(int lhs, int rhs)
static void RenderTextWrapped(ImVec2 pos, const char *text, const char *text_end, float wrap_width)
IMGUI_API void AddArc(const ImVec2 ¢er, float rad, ImU32 col, int a_min, int a_max, bool tris=false, const ImVec2 &third_point_offset=ImVec2(0, 0))
static bool ButtonBehaviour(const ImGuiAabb &bb, const ImGuiID &id, bool *out_hovered, bool *out_held, bool allow_key_modifiers, bool repeat=false, bool pressed_on_click=false)
static float ImLengthSqr(const ImVec2 &lhs)
IMGUI_API void SetInt(ImGuiID key, int val)
IMGUI_API void BuildLookupTable()
IMGUI_API void RenderCustomTexData()
IMGUI_API void AddCallback(ImDrawCallback callback, void *callback_data)
IMGUI_API void SameLine(int column_x=0, int spacing_w=-1)
static ImVec2 operator*(const ImVec2 &lhs, const float rhs)
static int ImTextCharToUtf8(char *buf, size_t buf_size, unsigned int in_char)
IMGUI_API void ShowStyleEditor(ImGuiStyle *ref=NULL)
IMGUI_API void LogButtons()
IMGUI_API void EndChild()
static void MarkSettingsDirty()
static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow *r, STB_TEXTEDIT_STRING *obj, int line_start_idx)
IMGUI_API bool IsItemHovered()
IMGUI_API void MemFree(void *ptr)
static const unsigned int proggy_clean_ttf_compressed_data[9584/4]
IMGUI_API void SetFloat(ImGuiID key, float val)
IMGUI_API void PushTextWrapPos(float wrap_pos_x=0.0f)
STBTT_DEF void stbtt_PackEnd(stbtt_pack_context *spc)
IMGUI_API int GetColumnsCount()
IMGUI_API float * GetFloatRef(ImGuiID key, float default_val=0)
IMGUI_API void ShowUserGuide()
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4 &in)
static int ImMin(int lhs, int rhs)
IMGUI_API void SetVoidPtr(ImGuiID key, void *val)
static unsigned char * stb__dout
ImFontAtlas * ContainerAtlas
STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
IMGUI_API void UpdateClipRect()
static float Plot_ArrayGetter(void *data, int idx)
ImVec4 Colors[ImGuiCol_COUNT]
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 size_t ImFormatString(char *buf, size_t buf_size, const char *fmt,...)
ImVector< ImFont * > Fonts
IMGUI_API void AddVtxUV(const ImVec2 &pos, ImU32 col, const ImVec2 &uv)
IMGUI_API bool Combo(const char *label, int *current_item, const char **items, int items_count, int height_in_items=-1)
IMGUI_API void * MemAlloc(size_t sz)
IMGUI_API void AddVtxLine(const ImVec2 &a, const ImVec2 &b, ImU32 col)
IMGUI_API const ImWchar * GetGlyphRangesDefault()
static ptrdiff_t ImTextStrToUtf8(char *buf, size_t buf_size, const ImWchar *in_text, const ImWchar *in_text_end)
IMGUI_API void Text(const char *fmt,...)
IMGUI_API void append(const char *fmt,...)
static ImVec2 operator-(const ImVec2 &lhs, const ImVec2 &rhs)
iterator erase(const_iterator it)
static ImGuiWindow * GetParentWindow()
STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index)
static ImColor HSV(float h, float s, float v, float a=1.0f)
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2 &a, const ImVec2 &b, const ImVec2 &uv0, const ImVec2 &uv1, ImU32 col=0xFFFFFFFF)
IMGUI_API bool IsMouseDoubleClicked(int button)
static void FocusWindow(ImGuiWindow *window)
IMGUI_API void SetScrollPosHere()
static void SaveSettings()
IMGUI_API int GetColumnIndex()
static void GetDefaultCompressedFontDataTTF(const void **ttf_compressed_data, unsigned int *ttf_compressed_size)
void InsertChars(int pos, const char *text, const char *text_end=NULL)
static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING *obj, int pos, int n)
static const char * FindTextDisplayEnd(const char *text, const char *text_end=NULL)
IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4 &clip_rect, const char *text_begin, const char *text_end, ImDrawVert *&out_vertices, float wrap_width=0.0f, const ImVec2 *cpu_clip_max=NULL) const
IMGUI_API void SetWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
IMGUI_API bool Selectable(const char *label, bool selected, const ImVec2 &size=ImVec2(0, 0))
static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
static void SetClipboardTextFn_DefaultImpl(const char *text)
IMGUI_API void Separator()
static int ImTextCountCharsFromUtf8(const char *in_text, const char *in_text_end)
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
IMGUI_API ImVec2 GetWindowPos()
IMGUI_API const char * GetStyleColName(ImGuiCol idx)
static char * ImStrdup(const char *str)
static void PopClipRect()
IMGUI_API bool SliderInt4(const char *label, int v[4], int v_min, int v_max, const char *display_format="%.0f")
static void PushColumnClipRect(int column_index=-1)
static bool ImLoadFileToMemory(const char *filename, const char *file_open_mode, void **out_file_data, size_t *out_file_size, size_t padding_bytes=0)
IMGUI_API void LogFinish()
static ImVec2 operator+(const ImVec2 &lhs, const ImVec2 &rhs)
IMGUI_API void ReserveVertices(unsigned int vtx_count)
static ImGuiState * GImGui
ImGuiTextFilter(const char *default_filter="")
IMGUI_API float GetTime()
ImGuiInputTextFlags EventFlag
IMGUI_API float GetWindowFontSize()
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample)
IMGUI_API void EndChildFrame()
void resize(size_t new_size)
IMGUI_API float GetScrollMaxY()
IMGUI_API void LabelTextV(const char *label, const char *fmt, va_list args)
IMGUI_API bool SliderAngle(const char *label, float *v, float v_degrees_min=-360.0f, float v_degrees_max=+360.0f)
IMGUI_API void NewFrame()
bool MouseDoubleClicked[5]
IMGUI_API void BulletTextV(const char *fmt, va_list args)
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
IMGUI_API void LogToClipboard(int max_depth=-1)
static unsigned char * stb__barrier4
IMGUI_API void LabelText(const char *label, const char *fmt,...)
IMGUI_API void LogToFile(int max_depth=-1, const char *filename=NULL)
static unsigned char * stb__barrier3
IMGUI_API bool ListBoxHeader(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API ImGuiStorage * GetStateStorage()
static const char * ImStristr(const char *haystack, const char *needle, const char *needle_end)
IMGUI_API ImGuiID GetID(const char *str_id)
int first_unicode_char_in_range
IMGUI_API void ShowTestWindow(bool *open=NULL)
IMGUI_API void PlotLines(const char *label, const float *values, int values_count, int values_offset=0, const char *overlay_text=NULL, float scale_min=FLT_MAX, float scale_max=FLT_MAX, ImVec2 graph_size=ImVec2(0, 0), size_t stride=sizeof(float))
IMGUI_API void UpdateTextureID()
static void SetActiveId(ImGuiID id)
IMGUI_API bool InputFloat3(const char *label, float v[3], int decimal_precision=-1)
unsigned short stbrp_coord
IMGUI_API void SetStateStorage(ImGuiStorage *tree)
static int ImTextCharFromUtf8(unsigned int *out_char, const char *in_text, const char *in_text_end)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags extra_flags=0)
IMGUI_API bool Begin(const char *name="Debug", bool *p_opened=NULL, const ImVec2 &initial_size=ImVec2(0, 0), float bg_alpha=-1.0f, ImGuiWindowFlags flags=0)
bool PassFilter(const char *val) const
IMGUI_API bool SliderInt3(const char *label, int v[3], int v_min, int v_max, const char *display_format="%.0f")
IMGUI_API ImFont * AddFontFromMemoryTTF(void *in_ttf_data, size_t in_ttf_data_size, float size_pixels, const ImWchar *glyph_ranges=NULL, int font_no=0)
static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING *obj, int pos, const ImWchar *new_text, int new_text_len)
IMGUI_API bool InputInt(const char *label, int *v, int step=1, int step_fast=100, ImGuiInputTextFlags extra_flags=0)
IMGUI_API void TextV(const char *fmt, va_list args)
IMGUI_API bool IsKeyPressed(int key_index, bool repeat=true)
IMGUI_API void AddTriangleFilled(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, ImU32 col)
IMGUI_API void Value(const char *prefix, bool b)
IMGUI_API float GetWindowWidth()
static ImFontAtlas GDefaultFontAtlas
static unsigned char * stb__barrier
IMGUI_API ImVec2 GetItemBoxMax()
static void Scrollbar(ImGuiWindow *window)
static void SetWindowPos(ImGuiWindow *window, const ImVec2 &pos, ImGuiSetCond cond)
static unsigned char * stb_decompress_token(unsigned char *i)
IMGUI_API void AddLine(const ImVec2 &a, const ImVec2 &b, ImU32 col)
void Draw(const char *label="Filter (inc,-exc)", float width=-1.0f)
unsigned char has_preferred_x
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *display_format="%.0f")
IMGUI_API void PushItemWidth(float item_width)
static ImVec2 * GetStyleVarVec2Addr(ImGuiStyleVar idx)
IMGUI_API void AddInputCharacter(ImWchar c)
static ImVec4 GNullClipRect(-9999.0f,-9999.0f,+9999.0f,+9999.0f)
static void ShowExampleAppCustomRendering(bool *opened)
IMGUI_API const Glyph * FindGlyph(unsigned short c) const
IMGUI_API bool TreeNode(const char *str_label_id)
void(* ImeSetInputScreenPosFn)(int x, int y)
static bool CloseWindowButton(bool *p_opened=NULL)
static ImGuiIniData * FindWindowSettings(const char *name)
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
static ImU32 ImHash(const void *data, size_t data_size, ImU32 seed)
IMGUI_API void PushID(const char *str_id)