yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
widget_state_capture.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_WIDGETS_WIDGET_STATE_CAPTURE_H_
2#define YAZE_APP_GUI_WIDGETS_WIDGET_STATE_CAPTURE_H_
3
4#include <string>
5#include <vector>
6
7#if defined(YAZE_ENABLE_IMGUI_TEST_ENGINE) && YAZE_ENABLE_IMGUI_TEST_ENGINE
8#include "imgui.h"
9#include "imgui_internal.h"
10#else
11#include "imgui/imgui.h"
12#endif
13
14namespace yaze {
15namespace core {
16
17// Widget state snapshot for debugging test failures
19 std::string focused_window;
20 std::string focused_widget;
21 std::string hovered_widget;
22 std::vector<std::string> visible_windows;
23 std::vector<std::string> open_popups;
24 int frame_count = 0;
25 float frame_rate = 0.0f;
26
27 // Navigation state
28 ImGuiID nav_id = 0;
29 bool nav_active = false;
30
31 // Input state
32 bool mouse_down[5] = {false};
33 float mouse_pos_x = 0.0f;
34 float mouse_pos_y = 0.0f;
35
36 // Keyboard state
37 bool ctrl_pressed = false;
38 bool shift_pressed = false;
39 bool alt_pressed = false;
40};
41
42// Capture current ImGui widget state for debugging
43// Returns JSON-formatted string representing the widget hierarchy and state
44// When ImGui internals are unavailable (UI test engine disabled), returns a
45// short diagnostic JSON payload.
46std::string CaptureWidgetState();
47
48// Serialize widget state to JSON format
49std::string SerializeWidgetStateToJson(const WidgetState& state);
50
51} // namespace core
52} // namespace yaze
53
54#endif // YAZE_APP_GUI_WIDGETS_WIDGET_STATE_CAPTURE_H_
std::string SerializeWidgetStateToJson(const WidgetState &state)
std::string CaptureWidgetState()
Main namespace for the application.
std::vector< std::string > visible_windows
std::vector< std::string > open_popups