Merge branch 'viewport' into docking

# Conflicts:
#	imgui.cpp
This commit is contained in:
omar
2019-01-10 16:02:32 +01:00
9 changed files with 238 additions and 169 deletions

View File

@ -6,8 +6,27 @@
// #define IMGUI_DEFINE_MATH_OPERATORS
// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
/*
Index of this file:
// Header mess
// Forward declarations
// STB libraries includes
// Context pointer
// Generic helpers
// Misc data structures
// Main imgui context
// Tab bar, tab item
// Internal API
*/
#pragma once
//-----------------------------------------------------------------------------
// Header mess
//-----------------------------------------------------------------------------
#ifndef IMGUI_VERSION
#error Must include imgui.h before imgui_internal.h
#endif
@ -30,7 +49,7 @@
#endif
//-----------------------------------------------------------------------------
// Forward Declarations
// Forward declarations
//-----------------------------------------------------------------------------
struct ImRect; // An axis-aligned rectangle (2 points)
@ -71,7 +90,7 @@ typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags:
typedef int ImGuiDragFlags; // -> enum ImGuiDragFlags_ // Flags: for DragBehavior()
//-------------------------------------------------------------------------
// STB libraries
// STB libraries includes
//-------------------------------------------------------------------------
namespace ImGuiStb
@ -87,7 +106,7 @@ namespace ImGuiStb
} // namespace ImGuiStb
//-----------------------------------------------------------------------------
// Context
// Context pointer
//-----------------------------------------------------------------------------
#ifndef GImGui
@ -98,7 +117,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit ImGui context pointe
#define IMGUI_PAYLOAD_TYPE_WINDOW "_IMWINDOW" // Payload == ImGuiWindow*
//-----------------------------------------------------------------------------
// Helpers
// Generic helpers
//-----------------------------------------------------------------------------
#define IM_PI 3.14159265358979323846f
@ -150,6 +169,7 @@ IMGUI_API int ImStricmp(const char* str1, const char* str2);
IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count);
IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count);
IMGUI_API char* ImStrdup(const char* str);
IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str);
IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c);
IMGUI_API int ImStrlenW(const ImWchar* str);
IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line
@ -249,7 +269,7 @@ struct IMGUI_API ImPool
};
//-----------------------------------------------------------------------------
// Types
// Misc data structures
//-----------------------------------------------------------------------------
enum ImGuiButtonFlags_
@ -343,8 +363,8 @@ enum ImGuiItemStatusFlags_
// FIXME: this is in development, not exposed/functional as a generic feature yet.
enum ImGuiLayoutType_
{
ImGuiLayoutType_Vertical,
ImGuiLayoutType_Horizontal
ImGuiLayoutType_Vertical = 0,
ImGuiLayoutType_Horizontal = 1
};
enum ImGuiAxis
@ -1217,6 +1237,7 @@ struct IMGUI_API ImGuiWindow
ImVec2 WindowPadding; // Window padding at the time of begin.
float WindowRounding; // Window rounding at the time of begin.
float WindowBorderSize; // Window border size at the time of begin.
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
ImGuiID MoveId; // == window->GetID("#MOVE")
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
ImVec2 Scroll;
@ -1332,7 +1353,7 @@ struct ImGuiItemHoveredDataBackup
};
//-----------------------------------------------------------------------------
// Tab Bar, Tab Item
// Tab bar, tab item
//-----------------------------------------------------------------------------
enum ImGuiTabBarFlagsPrivate_
@ -1389,7 +1410,7 @@ struct ImGuiTabBar
short LastTabItemIdx; // For BeginTabItem()/EndTabItem()
ImGuiTabBar();
int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_pointer(tab); }
int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); }
};
//-----------------------------------------------------------------------------
@ -1638,11 +1659,11 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned ch
// Test engine hooks (imgui-test)
//#define IMGUI_ENABLE_TEST_ENGINE
#ifdef IMGUI_ENABLE_TEST_ENGINE
extern void ImGuiTestEngineHook_PreNewFrame();
extern void ImGuiTestEngineHook_PostNewFrame();
extern void ImGuiTestEngineHook_ItemAdd(const ImRect& bb, ImGuiID id);
extern void ImGuiTestEngineHook_ItemInfo(ImGuiID id, const char* label, int flags);
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(_ID, _LABEL, _FLAGS) // Register status flags
extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx);
extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx);
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, int flags);
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register status flags
#else
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) do { } while (0)
#endif