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_SYSTEM_MENU_ORCHESTRATOR_H_
2#define YAZE_APP_EDITOR_SYSTEM_MENU_ORCHESTRATOR_H_
3
4#include <functional>
5#include <string>
6
7#include "absl/status/status.h"
8#include "app/editor/editor.h"
11
12namespace yaze {
13namespace editor {
14
15// Forward declarations to avoid circular dependencies
16class EditorManager;
17class RomFileManager;
18class ProjectManager;
19class EditorRegistry;
20class SessionCoordinator;
21class ToastManager;
22class PopupManager;
23
40 public:
41 // Constructor takes references to the managers it coordinates with
42 MenuOrchestrator(EditorManager* editor_manager,
43 MenuBuilder& menu_builder,
44 RomFileManager& rom_manager,
45 ProjectManager& project_manager,
46 EditorRegistry& editor_registry,
47 SessionCoordinator& session_coordinator,
48 ToastManager& toast_manager,
49 PopupManager& popup_manager);
50 ~MenuOrchestrator() = default;
51
52 // Non-copyable due to reference members
55
56 // Main menu building interface
57 void BuildMainMenu();
58 void BuildFileMenu();
59 void BuildEditMenu();
60 void BuildViewMenu();
61 void BuildToolsMenu();
62 void BuildDebugMenu();
63 void BuildWindowMenu();
64 void BuildHelpMenu();
65
66 // Menu state management
67 void ClearMenu();
68 void RefreshMenu();
69
70 // Menu item callbacks (delegated to appropriate managers)
71 void OnOpenRom();
72 void OnSaveRom();
73 void OnSaveRomAs();
74 void OnCreateProject();
75 void OnOpenProject();
76 void OnSaveProject();
77 void OnSaveProjectAs();
78
79 // Edit menu actions (delegate to current editor)
80 void OnUndo();
81 void OnRedo();
82 void OnCut();
83 void OnCopy();
84 void OnPaste();
85 void OnFind();
86
87 // Editor-specific menu actions
88 void OnSwitchToEditor(EditorType editor_type);
90 void OnShowDisplaySettings(); // Display settings popup
91 void OnShowHexEditor();
92 void OnShowEmulator();
93 void OnShowCardBrowser();
95
96#ifdef YAZE_WITH_GRPC
97 void OnShowAIAgent();
98 void OnShowChatHistory();
99 void OnShowProposalDrawer();
100#endif
101
102 // Session management menu actions
103 void OnCreateNewSession();
106 void OnSwitchToSession(size_t session_index);
109
110 // Window management menu actions
111 void OnShowAllWindows();
112 void OnHideAllWindows();
116 void OnShowLayoutPresets();
119 void OnLoadModderLayout();
120
121 // Tool menu actions
122 void OnShowGlobalSearch();
125 void OnShowImGuiDemo();
126 void OnShowImGuiMetrics();
127 void OnShowMemoryEditor();
129
130 // ROM Analysis menu actions
131 void OnShowRomInfo();
132 void OnCreateBackup();
133 void OnValidateRom();
135 void OnTestSaveLoad();
136
137 // ZSCustomOverworld menu actions
138 void OnCheckRomVersion();
139 void OnUpgradeRom();
141
142 // Asar Integration menu actions
143 void OnToggleAsarPatch();
144 void OnLoadAsmFile();
145
146 // Editor launch actions
148
149#ifdef YAZE_ENABLE_TESTING
150 void OnShowTestDashboard();
151 void OnRunAllTests();
152 void OnRunUnitTests();
153 void OnRunIntegrationTests();
154 void OnRunE2ETests();
155#endif
156
157#ifdef YAZE_WITH_GRPC
158 void OnStartCollaboration();
159 void OnJoinCollaboration();
160 void OnShowNetworkStatus();
161#endif
162
163 // Help menu actions
164 void OnShowAbout();
170 void OnShowCLIUsage();
172 void OnShowContributing();
173 void OnShowWhatsNew();
175
176 // Additional File menu actions
177 void OnShowSettings();
178 void OnQuit();
179
180 private:
181 // References to coordinated managers
190
191 // Menu state
193
194 // Helper methods for menu construction
195 void AddFileMenuItems();
196 void AddEditMenuItems();
197 void AddViewMenuItems();
198 void AddToolsMenuItems();
199 void AddDebugMenuItems();
200 void AddWindowMenuItems();
201 void AddHelpMenuItems();
202
203 // Menu item validation helpers
204 bool CanSaveRom() const;
205 bool CanSaveProject() const;
206 bool HasActiveRom() const;
207 bool HasActiveProject() const;
208 bool HasCurrentEditor() const;
209 bool HasMultipleSessions() const;
210
211 // Menu item text generation
212 std::string GetRomFilename() const;
213 std::string GetProjectName() const;
214 std::string GetCurrentEditorName() const;
215
216 // Shortcut key management
217 std::string GetShortcutForAction(const std::string& action) const;
219};
220
221} // namespace editor
222} // namespace yaze
223
224#endif // YAZE_APP_EDITOR_SYSTEM_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 OnSwitchToEditor(EditorType editor_type)
SessionCoordinator & session_coordinator_
MenuOrchestrator & operator=(const MenuOrchestrator &)=delete
std::string GetCurrentEditorName() const
std::string GetShortcutForAction(const std::string &action) const
MenuOrchestrator(const MenuOrchestrator &)=delete
Handles all project file operations.
Handles all ROM file I/O operations.
High-level orchestrator for multi-session UI.
Main namespace for the application.
Definition controller.cc:20