|
@@ -723,6 +723,14 @@ struct ImGuiDataTypeInfo
|
|
|
const char* ScanFmt; // Default scanf format for the type
|
|
const char* ScanFmt; // Default scanf format for the type
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// Extend ImGuiDataType_
|
|
|
|
|
+enum ImGuiDataTypePrivate_
|
|
|
|
|
+{
|
|
|
|
|
+ ImGuiDataType_String = ImGuiDataType_COUNT + 1,
|
|
|
|
|
+ ImGuiDataType_Pointer,
|
|
|
|
|
+ ImGuiDataType_ID
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// Stacked color modifier, backup of modified data so we can restore it
|
|
// Stacked color modifier, backup of modified data so we can restore it
|
|
|
struct ImGuiColorMod
|
|
struct ImGuiColorMod
|
|
|
{
|
|
{
|
|
@@ -948,7 +956,8 @@ enum ImGuiNextWindowDataFlags_
|
|
|
ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
|
|
ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3,
|
|
|
ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
|
|
ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
|
|
|
ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
|
|
ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
|
|
|
- ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6
|
|
|
|
|
|
|
+ ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
|
|
|
|
|
+ ImGuiNextWindowDataFlags_HasScroll = 1 << 7
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Storage for SetNexWindow** functions
|
|
// Storage for SetNexWindow** functions
|
|
@@ -962,6 +971,7 @@ struct ImGuiNextWindowData
|
|
|
ImVec2 PosPivotVal;
|
|
ImVec2 PosPivotVal;
|
|
|
ImVec2 SizeVal;
|
|
ImVec2 SizeVal;
|
|
|
ImVec2 ContentSizeVal;
|
|
ImVec2 ContentSizeVal;
|
|
|
|
|
+ ImVec2 ScrollVal;
|
|
|
bool CollapsedVal;
|
|
bool CollapsedVal;
|
|
|
ImRect SizeConstraintRect;
|
|
ImRect SizeConstraintRect;
|
|
|
ImGuiSizeCallback SizeCallback;
|
|
ImGuiSizeCallback SizeCallback;
|
|
@@ -1032,6 +1042,9 @@ struct ImGuiContext
|
|
|
bool WithinFrameScope; // Set by NewFrame(), cleared by EndFrame()
|
|
bool WithinFrameScope; // Set by NewFrame(), cleared by EndFrame()
|
|
|
bool WithinFrameScopeWithImplicitWindow; // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
|
|
bool WithinFrameScopeWithImplicitWindow; // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
|
|
|
bool WithinEndChild; // Set within EndChild()
|
|
bool WithinEndChild; // Set within EndChild()
|
|
|
|
|
+ bool TestEngineHookItems; // Will call test engine hooks ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
|
|
|
|
|
+ ImGuiID TestEngineHookPushId;
|
|
|
|
|
+ void* TestEngine; // Test engine user data
|
|
|
|
|
|
|
|
// Windows state
|
|
// Windows state
|
|
|
ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
|
|
ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
|
|
@@ -1231,14 +1244,17 @@ struct ImGuiContext
|
|
|
ImGuiContext(ImFontAtlas* shared_font_atlas) : BackgroundDrawList(&DrawListSharedData), ForegroundDrawList(&DrawListSharedData)
|
|
ImGuiContext(ImFontAtlas* shared_font_atlas) : BackgroundDrawList(&DrawListSharedData), ForegroundDrawList(&DrawListSharedData)
|
|
|
{
|
|
{
|
|
|
Initialized = false;
|
|
Initialized = false;
|
|
|
|
|
+ FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
|
|
Font = NULL;
|
|
Font = NULL;
|
|
|
FontSize = FontBaseSize = 0.0f;
|
|
FontSize = FontBaseSize = 0.0f;
|
|
|
- FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
|
|
|
|
IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
|
|
IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
|
|
|
Time = 0.0f;
|
|
Time = 0.0f;
|
|
|
FrameCount = 0;
|
|
FrameCount = 0;
|
|
|
FrameCountEnded = FrameCountRendered = -1;
|
|
FrameCountEnded = FrameCountRendered = -1;
|
|
|
WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
|
|
WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
|
|
|
|
|
+ TestEngineHookItems = false;
|
|
|
|
|
+ TestEngineHookPushId = 0;
|
|
|
|
|
+ TestEngine = NULL;
|
|
|
|
|
|
|
|
WindowsActiveCount = 0;
|
|
WindowsActiveCount = 0;
|
|
|
CurrentWindow = NULL;
|
|
CurrentWindow = NULL;
|
|
@@ -1703,6 +1719,7 @@ namespace ImGui
|
|
|
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
|
|
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
|
|
|
|
|
|
|
|
// Scrolling
|
|
// Scrolling
|
|
|
|
|
+ IMGUI_API void SetNextWindowScroll(const ImVec2& scroll); // Use -1.0f on one axis to leave as-is
|
|
|
IMGUI_API void SetScrollX(ImGuiWindow* window, float new_scroll_x);
|
|
IMGUI_API void SetScrollX(ImGuiWindow* window, float new_scroll_x);
|
|
|
IMGUI_API void SetScrollY(ImGuiWindow* window, float new_scroll_y);
|
|
IMGUI_API void SetScrollY(ImGuiWindow* window, float new_scroll_y);
|
|
|
IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio = 0.5f);
|
|
IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio = 0.5f);
|
|
@@ -1934,14 +1951,20 @@ extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx);
|
|
|
extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx);
|
|
extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx);
|
|
|
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
|
|
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
|
|
|
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
|
|
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
|
|
|
|
|
+extern void ImGuiTestEngineHook_PushID(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id);
|
|
|
|
|
+extern void ImGuiTestEngineHook_PushID(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id, const void* data_id_end);
|
|
|
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
|
|
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
|
|
|
-#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB, _ID) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box
|
|
|
|
|
-#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
|
|
|
|
-#define IMGUI_TEST_ENGINE_LOG(_FMT, ...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
|
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_PUSH_ID(_ID,_TYPE,_DATA) if (g.TestEngineHookPushId == id) ImGuiTestEngineHook_PushID(&g, _TYPE, _ID, (const void*)(_DATA));
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_PUSH_ID2(_ID,_TYPE,_DATA,_DATA2) if (g.TestEngineHookPushId == id) ImGuiTestEngineHook_PushID(&g, _TYPE, _ID, (const void*)(_DATA), (const void*)(_DATA2));
|
|
|
#else
|
|
#else
|
|
|
-#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB, _ID) do { } while (0)
|
|
|
|
|
-#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) do { } while (0)
|
|
|
|
|
-#define IMGUI_TEST_ENGINE_LOG(_FMT, ...) do { } while (0)
|
|
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) do { } while (0)
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) do { } while (0)
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_LOG(_FMT,...) do { } while (0)
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_PUSH_ID(_ID,_TYPE,_DATA) do { } while (0)
|
|
|
|
|
+#define IMGUI_TEST_ENGINE_PUSH_ID2(_ID,_TYPE,_DATA,_DATA2) do { } while (0)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__clang__)
|
|
#if defined(__clang__)
|