11 #error Must include imgui.h before imgui_internal.h 18 #pragma warning (push) 19 #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) 23 #pragma clang diagnostic push 24 #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h 25 #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h 26 #pragma clang diagnostic ignored "-Wold-style-cast" 57 #undef STB_TEXTEDIT_STRING 58 #undef STB_TEXTEDIT_CHARTYPE 59 #define STB_TEXTEDIT_STRING ImGuiTextEditState 60 #define STB_TEXTEDIT_CHARTYPE ImWchar 61 #define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f 76 #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR))) 77 #define IM_PI 3.14159265358979323846f 90 static inline bool ImCharIsSpace(
int c) {
return c ==
' ' || c ==
'\t' || c == 0x3000; }
91 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; }
99 IMGUI_API const char*
ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end);
105 #ifdef IMGUI_DEFINE_MATH_OPERATORS 114 static inline ImVec2& operator*=(
ImVec2& lhs,
const float rhs) { lhs.
x *= rhs; lhs.
y *= rhs;
return lhs; }
115 static inline ImVec2& operator/=(
ImVec2& lhs,
const float rhs) { lhs.
x /= rhs; lhs.
y /= rhs;
return lhs; }
119 static inline int ImMin(
int lhs,
int rhs) {
return lhs < rhs ? lhs : rhs; }
120 static inline int ImMax(
int lhs,
int rhs) {
return lhs >= rhs ? lhs : rhs; }
121 static inline float ImMin(
float lhs,
float rhs) {
return lhs < rhs ? lhs : rhs; }
122 static inline float ImMax(
float lhs,
float rhs) {
return lhs >= rhs ? lhs : rhs; }
125 static inline int ImClamp(
int v,
int mn,
int mx) {
return (v < mn) ? mn : (v >
mx) ? mx : v; }
126 static inline float ImClamp(
float v,
float mn,
float mx) {
return (v < mn) ? mn : (v >
mx) ? mx : v; }
128 static inline float ImSaturate(
float f) {
return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
129 static inline float ImLerp(
float a,
float b,
float t) {
return a + (b -
a) * t; }
133 static inline float ImInvLength(
const ImVec2& lhs,
float fail_value) {
float d = lhs.
x*lhs.
x + lhs.
y*lhs.
y;
if (d > 0.0
f)
return 1.0f / sqrtf(d);
return fail_value; }
134 static inline float ImFloor(
float f) {
return (
float)(int)f; }
139 #ifdef IMGUI_DEFINE_PLACEMENT_NEW 140 struct ImPlacementNewDummy {};
141 inline void*
operator new(
size_t, ImPlacementNewDummy,
void* ptr) {
return ptr; }
142 inline void operator delete(
void*, ImPlacementNewDummy,
void*) {}
143 #define IM_PLACEMENT_NEW(_PTR) new(ImPlacementNewDummy(), _PTR) 205 ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {}
221 void Add(
const ImVec2& rhs) {
if (Min.
x > rhs.
x) Min.
x = rhs.
x;
if (Min.
y > rhs.
y) Min.
y = rhs.
y;
if (Max.
x < rhs.
x) Max.
x = rhs.
x;
if (Max.
y < rhs.
y) Max.
y = rhs.
y; }
223 void Expand(
const float amount) { Min.
x -= amount; Min.
y -= amount; Max.
x += amount; Max.
y += amount; }
224 void Expand(
const ImVec2& amount) { Min.
x -= amount.
x; Min.
y -= amount.
y; Max.
x += amount.
x; Max.
y += amount.
y; }
225 void Reduce(
const ImVec2& amount) { Min.
x += amount.
x; Min.
y += amount.
y; Max.
x -= amount.
x; Max.
y -= amount.
y; }
227 void Floor() { Min.
x = (float)(
int)Min.
x; Min.
y = (float)(
int)Min.
y; Max.
x = (float)(
int)Max.
x; Max.
y = (float)(
int)Max.
y; }
232 if (p.
x > Max.
x) p.
x = Max.
x;
233 else if (p.
x < Min.
x) p.
x = Min.
x;
234 if (p.
y > Max.
y) p.
y = Max.
y;
235 else if (p.
y < Min.
y) p.
y = Min.
y;
279 float Pos[8], NextWidths[8];
282 void Update(
int count,
float spacing,
bool clear);
283 float DeclColumns(
float w0,
float w1,
float w2);
284 float CalcExtraSpace(
float avail_w);
308 void OnKeyPressed(
int key);
357 int FrameCountRendered;
433 float FramerateSecPerFrame[120];
438 char TempBuffer[1024*3+1];
444 FontSize = FontBaseSize = 0.0f;
445 FontTexUvWhitePixel =
ImVec2(0.0
f, 0.0
f);
449 FrameCountEnded = FrameCountRendered = -1;
450 CurrentWindow =
NULL;
451 FocusedWindow =
NULL;
452 HoveredWindow =
NULL;
453 HoveredRootWindow =
NULL;
455 HoveredIdAllowOverlap =
false;
456 HoveredIdPreviousFrame = 0;
458 ActiveIdPreviousFrame = 0;
459 ActiveIdIsAlive =
false;
460 ActiveIdIsJustActivated =
false;
461 ActiveIdAllowOverlap =
false;
462 ActiveIdClickOffset =
ImVec2(-1,-1);
463 ActiveIdWindow =
NULL;
465 MovedWindowMoveId = 0;
466 SettingsDirtyTimer = 0.0f;
468 SetNextWindowPosVal =
ImVec2(0.0
f, 0.0
f);
469 SetNextWindowSizeVal =
ImVec2(0.0
f, 0.0
f);
470 SetNextWindowCollapsedVal =
false;
471 SetNextWindowPosCond = 0;
472 SetNextWindowSizeCond = 0;
473 SetNextWindowContentSizeCond = 0;
474 SetNextWindowCollapsedCond = 0;
475 SetNextWindowFocus =
false;
476 SetNextWindowSizeConstraintCallback =
NULL;
477 SetNextWindowSizeConstraintCallbackUserData =
NULL;
478 SetNextTreeNodeOpenVal =
false;
479 SetNextTreeNodeOpenCond = 0;
481 ScalarAsInputTextId = 0;
482 DragCurrentValue = 0.0f;
483 DragLastMouseDelta =
ImVec2(0.0
f, 0.0
f);
484 DragSpeedDefaultRatio = 0.01f;
485 DragSpeedScaleSlow = 0.01f;
486 DragSpeedScaleFast = 10.0f;
487 ScrollbarClickDeltaToGrabCenter =
ImVec2(0.0
f, 0.0
f);
488 memset(Tooltip, 0,
sizeof(Tooltip));
489 PrivateClipboard =
NULL;
490 OsImePosRequest = OsImePosSet =
ImVec2(-1.0
f, -1.0
f);
492 ModalWindowDarkeningRatio = 0.0f;
495 memset(MouseCursorData, 0,
sizeof(MouseCursorData));
501 LogAutoExpandMaxDepth = 2;
503 memset(FramerateSecPerFrame, 0,
sizeof(FramerateSecPerFrame));
504 FramerateSecPerFrameIdx = 0;
505 FramerateSecPerFrameAccum = 0.0f;
506 CaptureMouseNextFrame = CaptureKeyboardNextFrame = -1;
507 memset(TempBuffer, 0,
sizeof(TempBuffer));
546 int StackSizesBackup[6];
563 CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos =
ImVec2(0.0
f, 0.0
f);
564 CurrentLineHeight = PrevLineHeight = 0.0f;
565 CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
570 LastItemHoveredAndUsable = LastItemHoveredRect =
false;
571 MenuBarAppending =
false;
572 MenuBarOffsetX = 0.0f;
576 ButtonRepeat =
false;
577 AllowKeyboardFocus =
true;
580 memset(StackSizesBackup, 0,
sizeof(StackSizesBackup));
583 ColumnsOffsetX = 0.0f;
586 ColumnsMinX = ColumnsMaxX = 0.0f;
587 ColumnsStartPosY = 0.0f;
588 ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
589 ColumnsShowBorders =
true;
725 IMGUI_API bool SliderIntN(
const char* label,
int* v,
int components,
int v_min,
int v_max,
const char* display_format);
728 IMGUI_API bool DragFloatN(
const char* label,
float* v,
int components,
float v_speed,
float v_min,
float v_max,
const char* display_format,
float power);
729 IMGUI_API bool DragIntN(
const char* label,
int* v,
int components,
float v_speed,
int v_min,
int v_max,
const char* display_format);
741 IMGUI_API void PlotEx(
ImGuiPlotType plot_type,
const char* label,
float (*values_getter)(
void*
data,
int idx),
void* data,
int values_count,
int values_offset,
const char* overlay_text,
float scale_min,
float scale_max,
ImVec2 graph_size);
749 #pragma clang diagnostic pop 753 #pragma warning (pop)
void Add(const ImVec2 &rhs)
ImRect SetNextWindowSizeConstraintRect
static int ImMax(int lhs, int rhs)
IMGUI_API void RenderTextClipped(const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, ImGuiAlign align=ImGuiAlign_Default, const ImVec2 *clip_min=NULL, const ImVec2 *clip_max=NULL)
ImGuiSetCond SetNextTreeNodeOpenCond
IMGUI_API bool FocusableItemRegister(ImGuiWindow *window, bool is_active, bool tab_stop=true)
ImGuiWindow * RootNonPopupWindow
int FocusIdxTabRequestNext
bool HasSelection() const
IMGUI_API void RenderText(ImVec2 pos, const char *text, const char *text_end=NULL, bool hide_text_after_hash=true)
GLboolean GLboolean GLboolean b
void Clip(const ImRect &clip)
IMGUI_API void OpenPopupEx(const char *str_id, bool reopen_existing)
#define IM_PRINTFARGS(FMT)
GLuint const GLchar * name
bool ActiveIdIsJustActivated
bool Contains(const ImRect &r) const
ImRect TitleBarRect() const
float ModalWindowDarkeningRatio
ImGuiWindow * ParentWindow
ImGuiWindow * FocusedWindow
ImVec2 ActiveIdClickOffset
IMGUI_API float RoundScalar(float value, int decimal_precision)
IMGUI_API const char * FindRenderedTextEnd(const char *text, const char *text_end=NULL)
ImGuiLayoutType LayoutType
ImGuiSetCond SetNextWindowPosCond
ImVec2 SetNextWindowContentSizeVal
GLenum GLenum GLenum GLenum GLenum scale
bool SetNextWindowCollapsedVal
GLdouble GLdouble GLdouble y2
bool ActiveIdAllowOverlap
ImGuiStorage ColorEditModeStorage
int CaptureKeyboardNextFrame
ImVec2 ScrollbarClickDeltaToGrabCenter
int FramerateSecPerFrameIdx
IMGUI_API void SetHoveredID(ImGuiID id)
ImDrawList OverlayDrawList
int FocusIdxAllRequestCurrent
ImVec4 operator*(const ImVec4 &color, float t)
IMGUI_API int ImStrnicmp(const char *str1, const char *str2, int count)
ImVector< ImGuiIniData > Settings
ImGuiID MovedWindowMoveId
float TitleBarHeight() const
int(* ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data)
float FramerateSecPerFrameAccum
ImGuiSetCond SetNextWindowContentSizeCond
IMGUI_API int ImTextStrToUtf8(char *buf, int buf_size, const ImWchar *in_text, const ImWchar *in_text_end)
ImVec2 SetNextWindowSizeVal
bool LastItemHoveredAndUsable
GLdouble GLdouble GLdouble w
float BackupCurrentLineTextBaseOffset
ImVec2 SetNextWindowPosVal
static float ImFloor(float f)
ImGuiStorage StateStorage
ImGuiColorEditMode ColorEditMode
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char *label, const char *label_end=NULL)
unsigned char has_preferred_x
IMGUI_API int ImStrlenW(const ImWchar *str)
ImVector< ImGuiWindow * > CurrentWindowStack
ImVector< ImFont * > FontStack
IMGUI_API bool DragBehavior(const ImRect &frame_bb, ImGuiID id, float *v, float v_speed, float v_min, float v_max, int decimal_precision, float power)
GLboolean GLboolean GLboolean GLboolean a
ImGuiSetCond SetNextWindowCollapsedCond
GLenum GLuint GLenum GLsizei const GLchar * buf
ImGuiTextBuffer * LogClipboard
IMGUI_API void ItemSize(const ImRect &bb, float text_offset_y=0.0f)
IMGUI_API bool IsClippedEx(const ImRect &bb, const ImGuiID *id, bool clip_even_when_logged)
ImDrawData RenderDrawData
ImRect MenuBarRect() const
ImGuiSimpleColumns MenuColumns
bool SetNextTreeNodeOpenVal
float CurrentLineTextBaseOffset
float DragSpeedDefaultRatio
IMGUI_API ImU32 ImHash(const void *data, int data_size, ImU32 seed=0)
StdString::ContainsMatcher Contains(std::string const &str, CaseSensitive::Choice caseSensitivity=CaseSensitive::Yes)
IMGUI_API bool ItemAdd(const ImRect &bb, const ImGuiID *id)
ImVector< ImGuiWindow * > Windows
ImVec2 SizeContentsExplicit
IMGUI_API void KeepAliveID(ImGuiID id)
const char * str_end(const char *s, const char *)
static bool ImCharIsSpace(int c)
void Expand(const float amount)
ImVector< char > TempTextBuffer
ImVec4 operator+(const ImVec4 &c, float v)
ImFont InputTextPasswordFont
static float ImLengthSqr(const ImVec2 &lhs)
IMGUI_API bool SliderIntN(const char *label, int *v, int components, int v_min, int v_max, const char *display_format)
ImGuiTextEditState InputTextState
IMGUI_API void TreePushRawID(ImGuiID id)
ImVector< ImGuiColMod > ColorModifiers
ImGuiWindow * MovedWindow
IMGUI_API int ImStricmp(const char *str1, const char *str2)
IMGUI_API bool InputIntN(const char *label, int *v, int components, ImGuiInputTextFlags extra_flags)
float3 operator-(const float3 &a, const float3 &b)
IMGUI_API void FocusWindow(ImGuiWindow *window)
ImGuiWindow * ActiveIdWindow
ImVector< ImGuiStyleMod > StyleModifiers
bool Contains(const ImVec2 &p) const
ImRect ContentsRegionRect
ImGuiID HoveredIdPreviousFrame
void(* ImGuiSizeConstraintCallback)(ImGuiSizeConstraintCallbackData *data)
IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect &aabb, const char *label, ImGuiDataType data_type, void *data_ptr, ImGuiID id, int decimal_precision)
ImGuiID ActiveIdPreviousFrame
ImVector< bool > ButtonRepeatStack
GLint GLint GLsizei GLint border
static float ImInvLength(const ImVec2 &lhs, float fail_value)
float CalcFontSize() const
ImVec2 ScrollTargetCenterRatio
ImGuiWindow * HoveredRootWindow
int FocusIdxTabRequestCurrent
IMGUI_API ImGuiWindow * GetParentWindow()
ImVector< bool > AllowKeyboardFocusStack
IMGUI_API int ImTextStrFromUtf8(ImWchar *buf, int buf_size, const char *in_text, const char *in_text_end, const char **in_remaining=NULL)
IMGUI_API void FocusableItemUnregister(ImGuiWindow *window)
ImRect(float x1, float y1, float x2, float y2)
ImVector< ImGuiColumnData > ColumnsData
ImGuiID ScalarAsInputTextId
IMGUI_API bool IsHovered(const ImRect &bb, ImGuiID id, bool flatten_childs=false)
GLenum GLenum GLuint components
float PrevLineTextBaseOffset
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col)
ImGuiSelectableFlagsPrivate_
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char *text, const char *text_end, float wrap_width)
IMGUI_API void RenderBullet(ImVec2 pos)
ImRect(const ImVec2 &min, const ImVec2 &max)
ImVector< ImGuiPopupRef > OpenPopupStack
IMGUI_API void RenderCollapseTriangle(ImVec2 pos, bool is_open, float scale=1.0f, bool shadow=false)
auto operator+=(std::string &lhs, StringRef const &sr) -> std::string &
IMGUI_API bool ImIsPointInTriangle(const ImVec2 &p, const ImVec2 &a, const ImVec2 &b, const ImVec2 &c)
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4 &in)
IMGUI_API bool SliderFloatN(const char *label, float *v, int components, float v_min, float v_max, const char *display_format, float power)
ImGuiWindow * CurrentWindow
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar *in_text, const ImWchar *in_text_end)
ImGuiSizeConstraintCallback SetNextWindowSizeConstraintCallback
int LogAutoExpandMaxDepth
IMGUI_API bool SliderBehavior(const ImRect &frame_bb, ImGuiID id, float *v, float v_min, float v_max, float power, int decimal_precision, ImGuiSliderFlags flags=0, bool render_bg=false)
bool SetNextWindowSizeConstraint
ImVec4 Colors[ImGuiCol_COUNT]
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
static int ImMin(int lhs, int rhs)
IMGUI_API const ImWchar * ImStrbolW(const ImWchar *buf_mid_line, const ImWchar *buf_begin)
GLuint GLfloat GLfloat GLfloat x1
int SetWindowSizeAllowFlags
IMGUI_API ImGuiWindow * FindWindowByName(const char *name)
IMGUI_API char * ImStrdup(const char *str)
IMGUI_API bool DragIntN(const char *label, int *v, int components, float v_speed, int v_min, int v_max, const char *display_format)
IMGUI_API const char * ImStristr(const char *haystack, const char *haystack_end, const char *needle, const char *needle_end)
IMGUI_API bool DragFloatN(const char *label, float *v, int components, float v_speed, float v_min, float v_max, const char *display_format, float power)
int FocusIdxAllRequestNext
IMGUI_API bool InputScalarEx(const char *label, ImGuiDataType data_type, void *data_ptr, void *step_ptr, void *step_fast_ptr, const char *scalar_format, ImGuiInputTextFlags extra_flags)
static float ImSaturate(float f)
IMGUI_API bool ButtonBehavior(const ImRect &bb, ImGuiID id, bool *out_hovered, bool *out_held, ImGuiButtonFlags flags=0)
ImGuiSetCond SetNextWindowSizeCond
ImVector< float > TextWrapPosStack
IMGUI_API void EndFrame()
GLuint GLsizei const GLchar * label
int SetWindowPosAllowFlags
IMGUI_API void PlotEx(ImGuiPlotType plot_type, const char *label, float(*values_getter)(void *data, int idx), void *data, int values_count, int values_offset, const char *overlay_text, float scale_min, float scale_max, ImVec2 graph_size)
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow *window)
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2 &pos, float radius)
IMGUI_API int ImFormatStringV(char *buf, int buf_size, const char *fmt, va_list args)
bool HoveredIdAllowOverlap
IMGUI_API void * ImLoadFileToMemory(const char *filename, const char *file_open_mode, int *out_file_size=NULL, int padding_bytes=0)
ImVec2 GetClosestPoint(ImVec2 p, bool on_edge) const
IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags=0)
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
IMGUI_API float CalcWrapWidthForPos(const ImVec2 &pos, float wrap_pos_x)
int SetWindowCollapsedAllowFlags
IMGUI_API bool InputFloatN(const char *label, float *v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags)
float MenuBarHeight() const
bool SetWindowPosCenterWanted
IMGUI_API int ImTextCharFromUtf8(unsigned int *out_char, const char *in_text, const char *in_text_end)
ImVector< ImGuiGroupData > GroupStack
IMGUI_API ImGuiID GetID(const char *str_id)
void Expand(const ImVec2 &amount)
IMGUI_API bool InputTextEx(const char *label, char *buf, int buf_size, const ImVec2 &size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback=NULL, void *user_data=NULL)
ImVector< ImGuiID > IDStack
ImGuiMouseCursor MouseCursor
bool SelectedAllMouseLock
IMGUI_API int ImTextCountCharsFromUtf8(const char *in_text, const char *in_text_end)
ImGuiWindow * GetCurrentWindow()
static int ImClamp(int v, int mn, int mx)
void * SetNextWindowSizeConstraintCallbackUserData
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y)
IMGUI_API int ImFormatString(char *buf, int buf_size, const char *fmt,...) IM_PRINTFARGS(3)
ImVector< char > InitialText
IMGUI_API ImGuiContext * GImGui
ImVec2 DragLastMouseDelta
ImVec2 BackupCursorMaxPos
rs2_intrinsics operator/(const rs2_intrinsics &i, int f)
ImGuiStorage * StateStorage
void Add(const ImRect &rhs)
ImVec2 FontTexUvWhitePixel
static float ImLerp(float a, float b, float t)
ImGuiWindow * HoveredWindow
bool Overlaps(const ImRect &r) const
float BackupCurrentLineHeight
static int ImUpperPowerOfTwo(int v)
int CaptureMouseNextFrame
IMGUI_API int ParseFormatPrecision(const char *fmt, int default_value)
ImGuiWindow * GetCurrentWindowRead()
ImVector< ImGuiPopupRef > CurrentPopupStack
ImVector< float > ItemWidthStack
ImVector< ImGuiWindow * > ChildWindows
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
void Reduce(const ImVec2 &amount)