refactor(app): reorganize application structure and update includes
- Moved core components such as `Controller` and `Window` from `src/app/core/` to `src/app/` and `src/app/platform/`, respectively, to improve modularity and clarity. - Updated include paths across the codebase to reflect the new locations of these components. - Introduced a new foundational core library in `src/core/` for project management and ROM patching logic, enhancing the separation of concerns. - Adjusted CMake configurations to ensure proper compilation of the new core library and updated dependencies in various modules. Benefits: - Streamlines the application structure, making it easier to navigate and maintain. - Enhances code organization by clearly delineating core functionalities from application-specific logic. - Improves overall architecture by promoting a clearer separation of concerns between different components.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include "absl/strings/str_join.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/agent/agent_chat_history_codec.h"
|
||||
#include "app/editor/agent/agent_ui_theme.h"
|
||||
#include "app/editor/agent/agent_chat_history_popup.h"
|
||||
@@ -136,7 +136,7 @@ void AgentChatWidget::SetRomContext(Rom* rom) {
|
||||
|
||||
// Only initialize labels ONCE per ROM instance
|
||||
if (rom && rom->is_loaded() && rom->resource_label() && last_rom_initialized != rom) {
|
||||
core::YazeProject project;
|
||||
project::YazeProject project;
|
||||
project.use_embedded_labels = true;
|
||||
|
||||
auto labels_status = project.InitializeEmbeddedLabels();
|
||||
@@ -2757,7 +2757,7 @@ void AgentChatWidget::CreateNewFileInEditor(const std::string& filename) {
|
||||
}
|
||||
|
||||
void AgentChatWidget::LoadAgentSettingsFromProject(
|
||||
const core::YazeProject& project) {
|
||||
const project::YazeProject& project) {
|
||||
// Load AI provider settings from project
|
||||
agent_config_.ai_provider = project.agent_settings.ai_provider;
|
||||
agent_config_.ai_model = project.agent_settings.ai_model;
|
||||
@@ -2816,7 +2816,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(
|
||||
}
|
||||
}
|
||||
|
||||
void AgentChatWidget::SaveAgentSettingsToProject(core::YazeProject& project) {
|
||||
void AgentChatWidget::SaveAgentSettingsToProject(project::YazeProject& project) {
|
||||
// Save AI provider settings to project
|
||||
project.agent_settings.ai_provider = agent_config_.ai_provider;
|
||||
project.agent_settings.ai_model = agent_config_.ai_model;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "cli/service/agent/advanced_routing.h"
|
||||
#include "cli/service/agent/agent_pretraining.h"
|
||||
#include "cli/service/agent/prompt_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
|
||||
@@ -254,8 +254,8 @@ public:
|
||||
void UpdateAgentConfig(const AgentConfigState& config);
|
||||
|
||||
// Load agent settings from project
|
||||
void LoadAgentSettingsFromProject(const core::YazeProject& project);
|
||||
void SaveAgentSettingsToProject(core::YazeProject& project);
|
||||
void LoadAgentSettingsFromProject(const project::YazeProject& project);
|
||||
void SaveAgentSettingsToProject(project::YazeProject& project);
|
||||
|
||||
// Collaboration history management (public so EditorManager can call them)
|
||||
void SwitchToSharedHistory(const std::string& session_id);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/str_split.h"
|
||||
#include "core/project.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/editor/system/toast_manager.h"
|
||||
#include "app/gui/core/icons.h"
|
||||
@@ -170,7 +171,7 @@ absl::Status ProjectFileEditor::SaveFileAs(const std::string& filepath) {
|
||||
modified_ = false;
|
||||
|
||||
// Add to recent files
|
||||
auto& recent_mgr = core::RecentFilesManager::GetInstance();
|
||||
auto& recent_mgr = project::RecentFilesManager::GetInstance();
|
||||
recent_mgr.AddFile(filepath_);
|
||||
recent_mgr.Save();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/gui/widgets/text_editor.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -20,7 +20,7 @@ class ToastManager;
|
||||
* - Syntax highlighting for INI-style format
|
||||
* - Real-time validation
|
||||
* - Auto-save capability
|
||||
* - Integration with core::YazeProject
|
||||
* - Integration with project::YazeProject
|
||||
*/
|
||||
class ProjectFileEditor {
|
||||
public:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <iterator>
|
||||
#include <cstring>
|
||||
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/gfx/resource/arena.h"
|
||||
#include "app/gfx/types/snes_palette.h"
|
||||
#include "app/gui/canvas/canvas.h"
|
||||
|
||||
@@ -83,7 +83,7 @@ endif()
|
||||
# - System editors (settings, commands, extensions)
|
||||
# - Testing infrastructure
|
||||
#
|
||||
# Dependencies: yaze_core_lib, yaze_gfx, yaze_gui, yaze_zelda3, ImGui
|
||||
# Dependencies: yaze_app_core_lib, yaze_gfx, yaze_gui, yaze_zelda3, ImGui
|
||||
# ==============================================================================
|
||||
|
||||
add_library(yaze_editor STATIC ${YAZE_APP_EDITOR_SRC})
|
||||
@@ -103,7 +103,7 @@ target_include_directories(yaze_editor PUBLIC
|
||||
)
|
||||
|
||||
target_link_libraries(yaze_editor PUBLIC
|
||||
yaze_core_lib
|
||||
yaze_app_core_lib
|
||||
yaze_gfx
|
||||
yaze_gui
|
||||
yaze_zelda3
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "app/core/project.h"
|
||||
#include "app/core/timing.h"
|
||||
#include "core/features.h"
|
||||
#include "core/project.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/editor/session_types.h"
|
||||
#include "app/editor/code/assembly_editor.h"
|
||||
#include "app/editor/dungeon/dungeon_editor_v2.h"
|
||||
@@ -65,7 +65,7 @@
|
||||
#include "app/gfx/debug/performance/performance_dashboard.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
#include "app/core/service/screenshot_utils.h"
|
||||
#include "app/service/screenshot_utils.h"
|
||||
#include "app/editor/agent/agent_chat_widget.h"
|
||||
#include "app/test/z3ed_test_suite.h"
|
||||
#include "cli/service/agent/agent_control_server.h"
|
||||
@@ -650,7 +650,7 @@ absl::Status EditorManager::Update() {
|
||||
|
||||
// Update timing manager for accurate delta time across the application
|
||||
// This fixes animation timing issues that occur when mouse isn't moving
|
||||
core::TimingManager::Get().Update();
|
||||
TimingManager::Get().Update();
|
||||
|
||||
// Delegate to PopupManager for modal dialog rendering
|
||||
popup_manager_->DrawPopups();
|
||||
@@ -1131,7 +1131,7 @@ absl::Status EditorManager::LoadRom() {
|
||||
test::TestManager::Get().SetCurrentRom(GetCurrentRom());
|
||||
#endif
|
||||
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(file_name);
|
||||
manager.Save();
|
||||
|
||||
@@ -1257,7 +1257,7 @@ absl::Status EditorManager::SaveRomAs(const std::string& filename) {
|
||||
sessions_[current_session_idx].filepath = filename;
|
||||
}
|
||||
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(filename);
|
||||
manager.Save();
|
||||
}
|
||||
@@ -1327,7 +1327,7 @@ absl::Status EditorManager::OpenProject() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
core::YazeProject new_project;
|
||||
project::YazeProject new_project;
|
||||
RETURN_IF_ERROR(new_project.Open(file_path));
|
||||
|
||||
// Validate project
|
||||
@@ -1391,7 +1391,7 @@ absl::Status EditorManager::OpenProject() {
|
||||
ImGui::GetIO().FontGlobalScale = user_settings_.prefs().font_global_scale;
|
||||
|
||||
// Add to recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(current_project_.filepath);
|
||||
manager.Save();
|
||||
|
||||
@@ -1422,7 +1422,7 @@ absl::Status EditorManager::SaveProject() {
|
||||
user_settings_.prefs().autosave_interval;
|
||||
|
||||
// Save recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
current_project_.workspace_settings.recent_files.clear();
|
||||
for (const auto& file : manager.GetRecentFiles()) {
|
||||
current_project_.workspace_settings.recent_files.push_back(file);
|
||||
@@ -1456,7 +1456,7 @@ absl::Status EditorManager::SaveProjectAs() {
|
||||
auto save_status = current_project_.Save();
|
||||
if (save_status.ok()) {
|
||||
// Add to recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(file_path);
|
||||
manager.Save();
|
||||
|
||||
@@ -1474,7 +1474,7 @@ absl::Status EditorManager::SaveProjectAs() {
|
||||
}
|
||||
|
||||
absl::Status EditorManager::ImportProject(const std::string& project_path) {
|
||||
core::YazeProject imported_project;
|
||||
project::YazeProject imported_project;
|
||||
|
||||
if (project_path.ends_with(".zsproj")) {
|
||||
RETURN_IF_ERROR(imported_project.ImportZScreamProject(project_path));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/agent/agent_chat_history_popup.h"
|
||||
#include "app/editor/code/project_file_editor.h"
|
||||
#include "app/editor/system/editor_card_registry.h"
|
||||
@@ -302,7 +302,7 @@ class EditorManager {
|
||||
|
||||
gfx::IRenderer* renderer_ = nullptr;
|
||||
|
||||
core::YazeProject current_project_;
|
||||
project::YazeProject current_project_;
|
||||
EditorDependencies::SharedClipboard shared_clipboard_;
|
||||
std::unique_ptr<PopupManager> popup_manager_;
|
||||
ToastManager toast_manager_;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "app/gui/core/ui_helpers.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/gfx/resource/arena.h"
|
||||
#include "app/gfx/core/bitmap.h"
|
||||
#include "app/gfx/util/compression.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "core/asar_wrapper.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/overworld/map_properties.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/editor/overworld/tile16_editor.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "overworld_entity_renderer.h"
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/gui/canvas/canvas.h"
|
||||
#include "zelda3/common.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "core/asar_wrapper.h"
|
||||
#include "app/gfx/debug/performance/performance_profiler.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/editor/overworld/map_properties.h"
|
||||
#include "app/editor/overworld/tile16_editor.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef YAZE_APP_EDITOR_SESSION_TYPES_H_
|
||||
#define YAZE_APP_EDITOR_SESSION_TYPES_H_
|
||||
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/code/assembly_editor.h"
|
||||
#include "app/editor/code/memory_editor.h"
|
||||
#include "app/editor/dungeon/dungeon_editor_v2.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "menu_orchestrator.h"
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/editor.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/editor/system/editor_registry.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/editor/system/toast_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace editor {
|
||||
@@ -17,7 +17,7 @@ ProjectManager::ProjectManager(ToastManager* toast_manager)
|
||||
absl::Status ProjectManager::CreateNewProject(const std::string& template_name) {
|
||||
if (template_name.empty()) {
|
||||
// Create default project
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.name = "New Project";
|
||||
current_project_.filepath = GenerateProjectFilename("New Project");
|
||||
|
||||
@@ -49,7 +49,7 @@ absl::Status ProjectManager::LoadProjectFromFile(const std::string& filename) {
|
||||
// TODO: Implement actual project loading from JSON/YAML
|
||||
// For now, create a basic project structure
|
||||
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.filepath = filename;
|
||||
current_project_.name = std::filesystem::path(filename).stem().string();
|
||||
|
||||
@@ -223,7 +223,7 @@ absl::Status ProjectManager::CreateFromTemplate(const std::string& template_name
|
||||
// TODO: Implement template-based project creation
|
||||
// This would copy template files and customize them
|
||||
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.name = project_name;
|
||||
current_project_.filepath = GenerateProjectFilename(project_name);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace editor {
|
||||
@@ -41,8 +41,8 @@ class ProjectManager {
|
||||
absl::Status ValidateProject();
|
||||
|
||||
// Project information
|
||||
core::YazeProject& GetCurrentProject() { return current_project_; }
|
||||
const core::YazeProject& GetCurrentProject() const { return current_project_; }
|
||||
project::YazeProject& GetCurrentProject() { return current_project_; }
|
||||
const project::YazeProject& GetCurrentProject() const { return current_project_; }
|
||||
bool HasActiveProject() const { return !current_project_.filepath.empty(); }
|
||||
std::string GetProjectName() const;
|
||||
std::string GetProjectPath() const;
|
||||
@@ -53,7 +53,7 @@ class ProjectManager {
|
||||
const std::string& project_name);
|
||||
|
||||
private:
|
||||
core::YazeProject current_project_;
|
||||
project::YazeProject current_project_;
|
||||
ToastManager* toast_manager_ = nullptr;
|
||||
|
||||
// Helper methods
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "app/editor/ui/ui_coordinator.h"
|
||||
#include "app/editor/ui/workspace_manager.h"
|
||||
#include "app/editor/system/popup_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze::editor {
|
||||
|
||||
@@ -164,7 +164,7 @@ void ConfigureEditorShortcuts(const ShortcutDependencies& deps,
|
||||
RegisterIfValid(shortcut_manager, "Load Last ROM",
|
||||
{ImGuiMod_Ctrl, ImGuiKey_R},
|
||||
[editor_manager]() {
|
||||
auto& recent = core::RecentFilesManager::GetInstance();
|
||||
auto& recent = project::RecentFilesManager::GetInstance();
|
||||
if (!recent.GetRecentFiles().empty() && editor_manager) {
|
||||
editor_manager->OpenRomOrProject(
|
||||
recent.GetRecentFiles().front());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/editor.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/editor/system/editor_registry.h"
|
||||
@@ -706,7 +706,7 @@ void UICoordinator::DrawGlobalSearch() {
|
||||
// Recent Files Tab
|
||||
if (ImGui::BeginTabItem(
|
||||
absl::StrFormat("%s Recent Files", ICON_MD_HISTORY).c_str())) {
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
auto recent_files = manager.GetRecentFiles();
|
||||
|
||||
if (ImGui::BeginTable("RecentFilesTable", 3,
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/project.h"
|
||||
#include "app/core/timing.h"
|
||||
#include "core/project.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/gui/core/icons.h"
|
||||
#include "app/gui/core/theme_manager.h"
|
||||
#include "imgui/imgui.h"
|
||||
@@ -255,7 +255,7 @@ bool WelcomeScreen::Show(bool* p_open) {
|
||||
|
||||
// Smooth interpolation to target position (faster response)
|
||||
// Use TimingManager for accurate delta time
|
||||
float lerp_speed = 8.0f * yaze::core::TimingManager::Get().GetDeltaTime();
|
||||
float lerp_speed = 8.0f * yaze::TimingManager::Get().GetDeltaTime();
|
||||
triforce_positions_[i].x += (target_pos.x - triforce_positions_[i].x) * lerp_speed;
|
||||
triforce_positions_[i].y += (target_pos.y - triforce_positions_[i].y) * lerp_speed;
|
||||
|
||||
@@ -424,7 +424,7 @@ void WelcomeScreen::RefreshRecentProjects() {
|
||||
recent_projects_.clear();
|
||||
|
||||
// Use the ProjectManager singleton to get recent files
|
||||
auto& recent_files = core::RecentFilesManager::GetInstance().GetRecentFiles();
|
||||
auto& recent_files = project::RecentFilesManager::GetInstance().GetRecentFiles();
|
||||
|
||||
for (const auto& filepath : recent_files) {
|
||||
if (recent_projects_.size() >= kMaxRecentProjects) break;
|
||||
|
||||
Reference in New Issue
Block a user