|
1 |
| -// dear imgui, v1.66 WIP |
| 1 | +// dear imgui, v1.65 |
2 | 2 | // (headers)
|
3 | 3 |
|
4 | 4 | // See imgui.cpp file for documentation.
|
|
23 | 23 |
|
24 | 24 | // Version
|
25 | 25 | // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY00 then bounced up to XYY01 when release tagging happens)
|
26 |
| -#define IMGUI_VERSION "1.66 WIP" |
27 |
| -#define IMGUI_VERSION_NUM 16600 |
| 26 | +#define IMGUI_VERSION "1.65" |
| 27 | +#define IMGUI_VERSION_NUM 16501 |
28 | 28 | #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert))
|
29 | 29 |
|
30 | 30 | // Define attributes of all API symbols declarations (e.g. for DLL under Windows)
|
@@ -189,20 +189,14 @@ namespace ImGui
|
189 | 189 | IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL); // best used with borders and a custom, thicker font
|
190 | 190 |
|
191 | 191 | // Windows
|
192 |
| - // - Begin() = push window to the stack and start appending to it. End() = pop window from the stack. |
193 |
| - // - You may append multiple times to the same window during the same frame. |
194 |
| - // - Passing 'bool* p_open != NULL' shows a window-closing widget in the upper-right corner of the window, which clicking will set the boolean to false when clicked. |
195 |
| - // - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. |
196 |
| - // Always call a matching End() for each Begin() call, regardless of its return value [this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.] |
| 192 | + // (Begin = push window to the stack and start appending to it. End = pop window from the stack. You may append multiple times to the same window during the same frame) |
| 193 | + // Begin()/BeginChild() return false to indicate the window being collapsed or fully clipped, so you may early out and omit submitting anything to the window. |
| 194 | + // You need to always call a matching End()/EndChild() for a Begin()/BeginChild() call, regardless of its return value (this is due to legacy reason and is inconsistent with BeginMenu/EndMenu, BeginPopup/EndPopup and other functions where the End call should only be called if the corresponding Begin function returned true.) |
| 195 | + // Passing 'bool* p_open != NULL' shows a close widget in the upper-right corner of the window, which when clicking will set the boolean to false. |
| 196 | + // Use child windows to introduce independent scrolling/clipping regions within a host window. Child windows can embed their own child. |
197 | 197 | IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);
|
198 | 198 | IMGUI_API void End();
|
199 |
| - |
200 |
| - // Child Windows |
201 |
| - // - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child. |
202 |
| - // - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400). |
203 |
| - // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. |
204 |
| - // Always call a matching EndChild() for each BeginChild() call, regardless of its return value [this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.] |
205 |
| - IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); |
| 199 | + IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); // Begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400). |
206 | 200 | IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0);
|
207 | 201 | IMGUI_API void EndChild();
|
208 | 202 |
|
@@ -247,7 +241,7 @@ namespace ImGui
|
247 | 241 | IMGUI_API float GetScrollMaxY(); // get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y
|
248 | 242 | IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()]
|
249 | 243 | IMGUI_API void SetScrollY(float scroll_y); // set scrolling amount [0..GetScrollMaxY()]
|
250 |
| - IMGUI_API void SetScrollHereY(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. |
| 244 | + IMGUI_API void SetScrollHere(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. |
251 | 245 | IMGUI_API void SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position valid. use GetCursorPos() or GetCursorStartPos()+offset to get valid positions.
|
252 | 246 |
|
253 | 247 | // Parameters stacks (shared)
|
@@ -521,8 +515,8 @@ namespace ImGui
|
521 | 515 | IMGUI_API void PopClipRect();
|
522 | 516 |
|
523 | 517 | // Focus, Activation
|
524 |
| - // (Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHereY()" when applicable to signify "this is the default item") |
525 |
| - IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. |
| 518 | + // (Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHere()" when applicable, to make your code more forward compatible when navigation branch is merged) |
| 519 | + IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. Please use instead of "if (IsWindowAppearing()) SetScrollHere()" to signify "default item". |
526 | 520 | IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
|
527 | 521 |
|
528 | 522 | // Utilities
|
@@ -1210,8 +1204,6 @@ struct ImGuiIO
|
1210 | 1204 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
1211 | 1205 | namespace ImGui
|
1212 | 1206 | {
|
1213 |
| - // OBSOLETED in 1.66 (from Sep 2018) |
1214 |
| - static inline void SetScrollHere(float center_ratio=0.5f){ SetScrollHereY(center_ratio); } |
1215 | 1207 | // OBSOLETED in 1.63 (from Aug 2018)
|
1216 | 1208 | static inline bool IsItemDeactivatedAfterChange() { return IsItemDeactivatedAfterEdit(); }
|
1217 | 1209 | // OBSOLETED in 1.61 (from Apr 2018)
|
@@ -1263,7 +1255,7 @@ class ImVector
|
1263 | 1255 | inline ImVector() { Size = Capacity = 0; Data = NULL; }
|
1264 | 1256 | inline ~ImVector() { if (Data) ImGui::MemFree(Data); }
|
1265 | 1257 | inline ImVector(const ImVector<T>& src) { Size = Capacity = 0; Data = NULL; operator=(src); }
|
1266 |
| - inline ImVector<T>& operator=(const ImVector<T>& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(value_type)); return *this; } |
| 1258 | + inline ImVector& operator=(const ImVector<T>& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(value_type)); return *this; } |
1267 | 1259 |
|
1268 | 1260 | inline bool empty() const { return Size == 0; }
|
1269 | 1261 | inline int size() const { return Size; }
|
@@ -1456,7 +1448,7 @@ struct ImGuiInputTextCallbackData
|
1456 | 1448 |
|
1457 | 1449 | // Helper functions for text manipulation.
|
1458 | 1450 | // Use those function to benefit from the CallbackResize behaviors. Calling those function reset the selection.
|
1459 |
| - IMGUI_API ImGuiInputTextCallbackData(); |
| 1451 | + ImGuiInputTextCallbackData(); |
1460 | 1452 | IMGUI_API void DeleteChars(int pos, int bytes_count);
|
1461 | 1453 | IMGUI_API void InsertChars(int pos, const char* text, const char* text_end = NULL);
|
1462 | 1454 | bool HasSelection() const { return SelectionStart != SelectionEnd; }
|
@@ -1928,7 +1920,7 @@ struct ImFont
|
1928 | 1920 | ImVec2 DisplayOffset; // = (0.f,0.f) // Offset font rendering by xx pixels
|
1929 | 1921 | ImVector<ImFontGlyph> Glyphs; // // All glyphs.
|
1930 | 1922 | ImVector<float> IndexAdvanceX; // // Sparse. Glyphs->AdvanceX in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI).
|
1931 |
| - ImVector<ImWchar> IndexLookup; // // Sparse. Index glyphs by Unicode code-point. |
| 1923 | + ImVector<unsigned short> IndexLookup; // // Sparse. Index glyphs by Unicode code-point. |
1932 | 1924 | const ImFontGlyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
|
1933 | 1925 | float FallbackAdvanceX; // == FallbackGlyph->AdvanceX
|
1934 | 1926 | ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
|
@@ -1957,7 +1949,7 @@ struct ImFont
|
1957 | 1949 | // 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
1958 | 1950 | 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; // utf8
|
1959 | 1951 | IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
|
1960 |
| - IMGUI_API void RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const; |
| 1952 | + IMGUI_API void RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, unsigned short c) const; |
1961 | 1953 | IMGUI_API void RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const;
|
1962 | 1954 |
|
1963 | 1955 | // [Internal]
|
|
0 commit comments