yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
enhanced_status_panel.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_TUI_ENHANCED_STATUS_PANEL_H
2#define YAZE_CLI_TUI_ENHANCED_STATUS_PANEL_H
3
4#include <ftxui/component/component.hpp>
5#include <ftxui/dom/elements.hpp>
6#include <memory>
7#include <string>
8#include <vector>
9
10#include "app/rom.h"
11
12namespace yaze {
13namespace cli {
14
15// Enhanced status panel with comprehensive system information
17 public:
18 explicit EnhancedStatusPanel(Rom* rom_context = nullptr);
19
20 // Component interface
21 ftxui::Component GetComponent();
22 void SetRomContext(Rom* rom_context);
23
24 // Status updates
25 void UpdateRomInfo();
26 void UpdateSystemInfo();
27 void UpdateLayoutInfo();
28 void SetError(const std::string& error);
29 void ClearError();
30
31 // Configuration
32 void SetShowDetailedInfo(bool show) { show_detailed_info_ = show; }
34
35 // State management
36 bool IsExpanded() const { return expanded_; }
37 void SetExpanded(bool expanded) { expanded_ = expanded; }
38
39 private:
40 // Component creation
41 ftxui::Component CreateStatusContainer();
42 ftxui::Component CreateRomInfoSection();
43 ftxui::Component CreateSystemInfoSection();
44 ftxui::Component CreateLayoutInfoSection();
45 ftxui::Component CreateErrorSection();
46
47 // Event handling
48 bool HandleStatusEvents(const ftxui::Event& event);
49
50 // Rendering
51 ftxui::Element RenderRomInfo();
52 ftxui::Element RenderSystemInfo();
53 ftxui::Element RenderLayoutInfo();
54 ftxui::Element RenderErrorInfo();
55 ftxui::Element RenderStatusBar();
56
57 // Data collection
58 void CollectRomInfo();
59 void CollectSystemInfo();
60 void CollectLayoutInfo();
61
62 // State
64 bool expanded_ = false;
66
67 // Status data
68 struct RomInfo {
69 std::string title;
70 std::string size;
71 std::string checksum;
72 std::string region;
73 bool loaded = false;
75
76 struct SystemInfo {
77 std::string current_time;
78 std::string memory_usage;
79 std::string cpu_usage;
80 std::string disk_space;
82
83 struct LayoutInfo {
84 std::string active_panel;
85 std::string panel_count;
86 std::string layout_mode;
87 std::string focus_state;
89
90 std::string current_error_;
91
92 // Components
93 ftxui::Component status_container_;
94 ftxui::Component rom_info_section_;
95 ftxui::Component system_info_section_;
96 ftxui::Component layout_info_section_;
97 ftxui::Component error_section_;
98
99 // Event handlers
100 std::function<bool(const ftxui::Event&)> status_event_handler_;
101};
102
103} // namespace cli
104} // namespace yaze
105
106#endif // YAZE_CLI_TUI_ENHANCED_STATUS_PANEL_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
std::function< bool(const ftxui::Event &)> status_event_handler_
struct yaze::cli::EnhancedStatusPanel::LayoutInfo layout_info_
bool HandleStatusEvents(const ftxui::Event &event)
struct yaze::cli::EnhancedStatusPanel::SystemInfo system_info_
void SetError(const std::string &error)
struct yaze::cli::EnhancedStatusPanel::RomInfo rom_info_
Main namespace for the application.