diff --git a/src/olympic/studio/applib/src/studioapp.cpp b/src/olympic/studio/applib/src/studioapp.cpp index 3fb16812..cbf3fcd7 100644 --- a/src/olympic/studio/applib/src/studioapp.cpp +++ b/src/olympic/studio/applib/src/studioapp.cpp @@ -18,9 +18,9 @@ namespace studio { -static ox::Vector modules; +static ox::Vector modules; -void registerModule(studio::Module const*mod) noexcept { +void registerModule(Module const*mod) noexcept { if (mod) { modules.emplace_back(mod); } @@ -63,7 +63,7 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexce auto const openProjErr = openProjectPath(config.projectPath); if (!openProjErr) { for (auto const&f: config.openFiles) { - auto openFileErr = openFileActiveTab(f, config.activeTabItemName == f); + auto const openFileErr = openFileActiveTab(f, config.activeTabItemName == f); if (openFileErr) { oxErrorf("\nCould not open editor for file:\n\t{}\nReason:\n\t{}\n", f, toStr(openFileErr)); continue; @@ -238,13 +238,13 @@ void StudioUI::drawTabs() noexcept { } } -void StudioUI::loadEditorMaker(studio::EditorMaker const&editorMaker) noexcept { +void StudioUI::loadEditorMaker(EditorMaker const&editorMaker) noexcept { for (auto const&ext : editorMaker.fileTypes) { m_editorMakers[ext] = editorMaker.make; } } -void StudioUI::loadModule(studio::Module const&mod) noexcept { +void StudioUI::loadModule(Module const&mod) noexcept { for (auto const&editorMaker : mod.editors(m_sctx)) { loadEditorMaker(editorMaker); } @@ -261,20 +261,20 @@ void StudioUI::loadModules() noexcept { void StudioUI::toggleProjectExplorer() noexcept { m_showProjectExplorer = !m_showProjectExplorer; - studio::editConfig(keelCtx(m_ctx), [&](StudioConfig &config) { + editConfig(keelCtx(m_ctx), [&](StudioConfig &config) { config.showProjectExplorer = m_showProjectExplorer; }); } void StudioUI::redo() noexcept { - auto undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr; + auto const undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr; if (undoStack && undoStack->canRedo()) { oxLogError(m_activeEditor->undoStack()->redo()); } } void StudioUI::undo() noexcept { - auto undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr; + auto const undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr; if (undoStack && undoStack->canUndo()) { oxLogError(m_activeEditor->undoStack()->undo()); } @@ -350,9 +350,9 @@ ox::Error StudioUI::openProjectPath(ox::StringParam path) noexcept { OX_REQUIRE_M(fs, keel::loadRomFs(path.view())); OX_RETURN_ERROR(keel::setRomFs(keelCtx(m_ctx), std::move(fs))); OX_RETURN_ERROR( - ox::make_unique_catch(keelCtx(m_ctx), std::move(path), m_projectDataDir) + ox::make_unique_catch(keelCtx(m_ctx), std::move(path), m_projectDataDir) .moveTo(m_project)); - auto const sctx = applicationData(m_ctx); + auto const sctx = applicationData(m_ctx); sctx->project = m_project.get(); turbine::setWindowTitle(m_ctx, ox::sfmt("{} - {}", keelCtx(m_ctx).appName, m_project->projectPath())); m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel); @@ -370,7 +370,7 @@ ox::Error StudioUI::openFile(ox::StringViewCR path) noexcept { return openFileActiveTab(path, true); } -ox::Error StudioUI::openFileActiveTab(ox::StringViewCR path, bool makeActiveTab) noexcept { +ox::Error StudioUI::openFileActiveTab(ox::StringViewCR path, bool const makeActiveTab) noexcept { if (!m_project) { return ox::Error(1, "No project open to open a file from"); } @@ -384,7 +384,7 @@ ox::Error StudioUI::openFileActiveTab(ox::StringViewCR path, bool makeActiveTab) } return {}; } - OX_REQUIRE(ext, studio::fileExt(path)); + OX_REQUIRE(ext, fileExt(path)); // create Editor BaseEditor *editor = nullptr; auto const err = m_editorMakers.contains(ext) ? diff --git a/src/olympic/studio/applib/src/studioapp.hpp b/src/olympic/studio/applib/src/studioapp.hpp index 92cefaa1..17382609 100644 --- a/src/olympic/studio/applib/src/studioapp.hpp +++ b/src/olympic/studio/applib/src/studioapp.hpp @@ -24,23 +24,23 @@ class StudioUI: public ox::SignalHandler { friend class StudioUIDrawer; private: - studio::StudioContext m_sctx; + StudioContext m_sctx; turbine::Context &m_ctx; ox::String m_projectDataDir; - ox::UPtr m_project; - studio::TaskRunner m_taskRunner; - ox::Vector> m_editors; - ox::Vector> m_widgets; - ox::HashMap m_editorMakers; + ox::UPtr m_project; + TaskRunner m_taskRunner; + ox::Vector> m_editors; + ox::Vector> m_widgets; + ox::HashMap m_editorMakers; ProjectExplorer m_projectExplorer; ox::Vector m_openFiles; - studio::BaseEditor *m_activeEditorOnLastDraw = nullptr; - studio::BaseEditor *m_activeEditor = nullptr; - studio::BaseEditor *m_activeEditorUpdatePending = nullptr; + BaseEditor *m_activeEditorOnLastDraw = nullptr; + BaseEditor *m_activeEditor = nullptr; + BaseEditor *m_activeEditorUpdatePending = nullptr; NewMenu m_newMenu; NewProject m_newProject; AboutPopup m_aboutPopup; - ox::Array const m_popups = { + ox::Array const m_popups = { &m_newMenu, &m_newProject, &m_aboutPopup @@ -53,7 +53,7 @@ class StudioUI: public ox::SignalHandler { void handleKeyEvent(turbine::Key, bool down) noexcept; [[nodiscard]] - constexpr studio::Project *project() noexcept { + constexpr Project *project() noexcept { return m_project.get(); } @@ -67,9 +67,9 @@ class StudioUI: public ox::SignalHandler { void drawTabs() noexcept; - void loadEditorMaker(studio::EditorMaker const&editorMaker) noexcept; + void loadEditorMaker(EditorMaker const&editorMaker) noexcept; - void loadModule(studio::Module const&mod) noexcept; + void loadModule(Module const&mod) noexcept; void loadModules() noexcept;