yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
menu_orchestrator.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
2#define YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
3
4#include <functional>
5#include <string>
6
7#include "absl/status/status.h"
8#include "app/editor/editor.h"
13
14namespace yaze {
15namespace editor {
16
17// Forward declarations to avoid circular dependencies
18class EditorManager;
19class RomFileManager;
20class ProjectManager;
21class EditorRegistry;
22class PanelManager;
23class SessionCoordinator;
24class ToastManager;
25class PopupManager;
26
43 public:
44 // Constructor takes references to the managers it coordinates with
45 MenuOrchestrator(EditorManager* editor_manager, MenuBuilder& menu_builder,
46 RomFileManager& rom_manager, ProjectManager& project_manager,
47 EditorRegistry& editor_registry,
48 SessionCoordinator& session_coordinator,
49 ToastManager& toast_manager, PopupManager& popup_manager);
50 ~MenuOrchestrator() = default;
51
52 // Set optional dependencies for advanced features
53 void SetPanelManager(PanelManager* manager) { panel_manager_ = manager; }
54 void SetStatusBar(StatusBar* bar) { status_bar_ = bar; }
55 void SetUserSettings(UserSettings* settings) { user_settings_ = settings; }
56
57 // Non-copyable due to reference members
60
61 // Main menu building interface
62 void BuildMainMenu();
63 void BuildFileMenu();
64 void BuildEditMenu();
65 void BuildViewMenu();
66 void BuildToolsMenu(); // Also contains former Debug menu items
67 void BuildWindowMenu();
68 void BuildHelpMenu();
69
70 // Menu state management
71 void ClearMenu();
72 void RefreshMenu();
73
74 // Menu item callbacks (delegated to appropriate managers)
75 void OnOpenRom();
76 void OnSaveRom();
77 void OnSaveRomAs();
78 void OnCreateProject();
79 void OnOpenProject();
80 void OnSaveProject();
81 void OnSaveProjectAs();
84
85 // Edit menu actions (delegate to current editor)
86 void OnUndo();
87 void OnRedo();
88 void OnCut();
89 void OnCopy();
90 void OnPaste();
91 void OnFind();
92
93 // Editor-specific menu actions
94 void OnSwitchToEditor(EditorType editor_type);
96 void OnShowDisplaySettings(); // Display settings popup
97 void OnShowHexEditor();
98 void OnShowEmulator();
99 void OnShowPanelBrowser();
100 void OnShowWelcomeScreen();
102
103#ifdef YAZE_BUILD_AGENT_UI
104 void OnShowAIAgent();
105 void OnShowChatHistory();
106 void OnShowProposalDrawer();
107#endif
108
109 // Session management menu actions
110 void OnCreateNewSession();
113 void OnSwitchToSession(size_t session_index);
116
117 // Window management menu actions
118 void OnShowAllWindows();
119 void OnHideAllWindows();
123 void OnShowLayoutPresets();
126 void OnLoadModderLayout();
127
128 // Tool menu actions
129 void OnShowGlobalSearch();
132 void OnShowImGuiDemo();
133 void OnShowImGuiMetrics();
134 void OnShowMemoryEditor();
136
137 // ROM Analysis menu actions
138 void OnShowRomInfo();
139 void OnCreateBackup();
140 void OnValidateRom();
142 void OnTestSaveLoad();
143
144 // ZSCustomOverworld menu actions
145 void OnCheckRomVersion();
146 void OnUpgradeRom();
148
149 // Asar Integration menu actions
150 void OnToggleAsarPatch();
151 void OnLoadAsmFile();
152
153 // Editor launch actions
155
156#ifdef YAZE_ENABLE_TESTING
157 void OnShowTestDashboard();
158 void OnRunAllTests();
159 void OnRunUnitTests();
160 void OnRunIntegrationTests();
161 void OnRunE2ETests();
162#endif
163
164#ifdef YAZE_WITH_GRPC
165 void OnStartCollaboration();
166 void OnJoinCollaboration();
167 void OnShowNetworkStatus();
168#endif
169
170 // Help menu actions
171 void OnShowAbout();
177 void OnShowCLIUsage();
179 void OnShowContributing();
180 void OnShowWhatsNew();
182
183 // Additional File menu actions
184 void OnShowSettings();
185 void OnQuit();
186
187 private:
188 // References to coordinated managers
197
198 // Optional dependencies for advanced features
202
203 // Menu state
205
206 // Helper methods for menu construction
207 void AddFileMenuItems();
208 void AddEditMenuItems();
209 void AddViewMenuItems();
210 void AddToolsMenuItems(); // Also contains former Debug menu items
211 void AddWindowMenuItems();
212 void AddHelpMenuItems();
213
214 // Auto-generated menu helpers
215 void AddPanelsSubmenu();
216
217 // Menu item validation helpers
218 bool CanSaveRom() const;
219 bool CanSaveProject() const;
220 bool HasActiveRom() const;
221 bool HasActiveProject() const;
222 bool HasProjectFile() const;
223 bool HasCurrentEditor() const;
224 bool HasMultipleSessions() const;
225
226 // Menu item text generation
227 std::string GetRomFilename() const;
228 std::string GetProjectName() const;
229 std::string GetCurrentEditorName() const;
230
231 // Shortcut key management
232 std::string GetShortcutForAction(const std::string& action) const;
234};
235
236} // namespace editor
237} // namespace yaze
238
239#endif // YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
The EditorManager controls the main editor window and manages the various editor classes.
Manages editor types, categories, and lifecycle.
Fluent interface for building ImGui menus with icons.
Handles all menu building and UI coordination logic.
void OnSwitchToSession(size_t session_index)
void SetUserSettings(UserSettings *settings)
void OnSwitchToEditor(EditorType editor_type)
SessionCoordinator & session_coordinator_
void SetStatusBar(StatusBar *bar)
MenuOrchestrator & operator=(const MenuOrchestrator &)=delete
void SetPanelManager(PanelManager *manager)
MenuOrchestrator(EditorManager *editor_manager, MenuBuilder &menu_builder, RomFileManager &rom_manager, ProjectManager &project_manager, EditorRegistry &editor_registry, SessionCoordinator &session_coordinator, ToastManager &toast_manager, PopupManager &popup_manager)
std::string GetShortcutForAction(const std::string &action) const
MenuOrchestrator(const MenuOrchestrator &)=delete
Central registry for all editor cards with session awareness and dependency injection.
Handles all project file operations with ROM-first workflow.
Handles all ROM file I/O operations.
High-level orchestrator for multi-session UI.
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:38
Manages user preferences and settings persistence.