diff --git a/src/studio/applib/src/aboutpopup.cpp b/src/studio/applib/src/aboutpopup.cpp index 56ae3e52..e3eac746 100644 --- a/src/studio/applib/src/aboutpopup.cpp +++ b/src/studio/applib/src/aboutpopup.cpp @@ -7,6 +7,8 @@ #include #include "aboutpopup.hpp" +namespace studio { + AboutPopup::AboutPopup(turbine::Context &ctx) noexcept { m_text = ox::sfmt("{} - dev build", ctx.appName); } @@ -55,3 +57,5 @@ void AboutPopup::draw(turbine::Context *ctx) noexcept { } } } + +} diff --git a/src/studio/applib/src/aboutpopup.hpp b/src/studio/applib/src/aboutpopup.hpp index 8580a8d6..0f363f14 100644 --- a/src/studio/applib/src/aboutpopup.hpp +++ b/src/studio/applib/src/aboutpopup.hpp @@ -11,6 +11,8 @@ #include +namespace studio { + class AboutPopup: public studio::Popup { public: enum class Stage { @@ -35,4 +37,6 @@ class AboutPopup: public studio::Popup { void draw(turbine::Context *ctx) noexcept override; -}; \ No newline at end of file +}; + +} diff --git a/src/studio/applib/src/clawviewer.cpp b/src/studio/applib/src/clawviewer.cpp index f88a9279..deef325b 100644 --- a/src/studio/applib/src/clawviewer.cpp +++ b/src/studio/applib/src/clawviewer.cpp @@ -6,6 +6,8 @@ #include "clawviewer.hpp" +namespace studio { + ClawEditor::ClawEditor(ox::CRStringView path, ox::ModelObject obj) noexcept: m_itemName(path), m_itemDisplayName(pathToItemName(path)), @@ -179,4 +181,6 @@ void ClawEditor::drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept { } path->pop_back(); } -} \ No newline at end of file +} + +} diff --git a/src/studio/applib/src/clawviewer.hpp b/src/studio/applib/src/clawviewer.hpp index a136f49b..01d8acc6 100644 --- a/src/studio/applib/src/clawviewer.hpp +++ b/src/studio/applib/src/clawviewer.hpp @@ -9,6 +9,8 @@ #include +namespace studio { + class ClawEditor: public studio::Editor { private: using ObjPath = ox::Vector; @@ -35,3 +37,4 @@ class ClawEditor: public studio::Editor { void drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept; }; +} diff --git a/src/studio/applib/src/filedialogmanager.cpp b/src/studio/applib/src/filedialogmanager.cpp index 3cc88f98..29c8021f 100644 --- a/src/studio/applib/src/filedialogmanager.cpp +++ b/src/studio/applib/src/filedialogmanager.cpp @@ -6,6 +6,8 @@ #include "filedialogmanager.hpp" +namespace studio { + studio::TaskState FileDialogManager::update(turbine::Context *ctx) noexcept { switch (m_state) { case UpdateProjectPathState::EnableSystemCursor: { @@ -32,3 +34,4 @@ studio::TaskState FileDialogManager::update(turbine::Context *ctx) noexcept { return studio::TaskState::Running; } +} diff --git a/src/studio/applib/src/filedialogmanager.hpp b/src/studio/applib/src/filedialogmanager.hpp index 82ba309f..fa2eea10 100644 --- a/src/studio/applib/src/filedialogmanager.hpp +++ b/src/studio/applib/src/filedialogmanager.hpp @@ -12,6 +12,8 @@ #include #include +namespace studio { + class FileDialogManager : public studio::Task { private: enum class UpdateProjectPathState { @@ -36,4 +38,6 @@ class FileDialogManager : public studio::Task { // signals ox::Signal pathChosen; -}; \ No newline at end of file +}; + +} diff --git a/src/studio/applib/src/main.cpp b/src/studio/applib/src/main.cpp index 03cc052f..5d79b461 100644 --- a/src/studio/applib/src/main.cpp +++ b/src/studio/applib/src/main.cpp @@ -13,6 +13,8 @@ #include #include "studioapp.hpp" +namespace studio { + class StudioUIDrawer: public turbine::gl::Drawer { private: StudioUI *m_ui = nullptr; @@ -58,8 +60,6 @@ static ox::Error runApp( return err; } -namespace studio { - int main( const char *appName, ox::String projectDataDir, @@ -87,3 +87,4 @@ int main( } } + diff --git a/src/studio/applib/src/newmenu.cpp b/src/studio/applib/src/newmenu.cpp index dd3b6111..cc43951f 100644 --- a/src/studio/applib/src/newmenu.cpp +++ b/src/studio/applib/src/newmenu.cpp @@ -9,6 +9,8 @@ #include "newmenu.hpp" +namespace studio { + NewMenu::NewMenu() noexcept { setTitle("New Item"); setSize({225, 110}); @@ -115,3 +117,5 @@ void NewMenu::finish(turbine::Context *ctx) noexcept { finished.emit(""); m_stage = Stage::Closed; } + +} diff --git a/src/studio/applib/src/newmenu.hpp b/src/studio/applib/src/newmenu.hpp index 942a674b..e134016b 100644 --- a/src/studio/applib/src/newmenu.hpp +++ b/src/studio/applib/src/newmenu.hpp @@ -11,6 +11,8 @@ #include #include +namespace studio { + class NewMenu: public studio::Popup { public: enum class Stage { @@ -73,3 +75,5 @@ template void NewMenu::addItemType(ox::String displayName, ox::String parentDir, ox::String fileExt, ox::ClawFormat pFmt) noexcept { m_types.emplace_back(ox::make>(std::move(displayName), std::move(parentDir), std::move(fileExt), pFmt)); } + +} diff --git a/src/studio/applib/src/projectexplorer.cpp b/src/studio/applib/src/projectexplorer.cpp index 8b271ded..4c8821fc 100644 --- a/src/studio/applib/src/projectexplorer.cpp +++ b/src/studio/applib/src/projectexplorer.cpp @@ -8,6 +8,8 @@ #include "projectexplorer.hpp" +namespace studio { + static ox::Result> buildProjectTreeModel(ProjectExplorer *explorer, ox::CRStringView name, ox::CRStringView path, ProjectTreeModel *parent) noexcept { const auto fs = explorer->romFs(); @@ -59,3 +61,5 @@ ox::Error ProjectExplorer::refreshProjectTreeModel(ox::CRStringView) noexcept { setModel(std::move(model)); return OxError(0); } + +} diff --git a/src/studio/applib/src/projectexplorer.hpp b/src/studio/applib/src/projectexplorer.hpp index df25f0d9..64f92f36 100644 --- a/src/studio/applib/src/projectexplorer.hpp +++ b/src/studio/applib/src/projectexplorer.hpp @@ -10,6 +10,8 @@ #include #include "projecttreemodel.hpp" +namespace studio { + class ProjectExplorer: public studio::Widget { private: ox::UniquePtr m_treeModel; @@ -31,4 +33,6 @@ class ProjectExplorer: public studio::Widget { // slots public: ox::Signal fileChosen; -}; \ No newline at end of file +}; + +} diff --git a/src/studio/applib/src/projecttreemodel.cpp b/src/studio/applib/src/projecttreemodel.cpp index cf0d6106..ba9d3ec2 100644 --- a/src/studio/applib/src/projecttreemodel.cpp +++ b/src/studio/applib/src/projecttreemodel.cpp @@ -7,6 +7,8 @@ #include "projectexplorer.hpp" #include "projecttreemodel.hpp" +namespace studio { + ProjectTreeModel::ProjectTreeModel(ProjectExplorer *explorer, ox::String name, ProjectTreeModel *parent) noexcept: m_explorer(explorer), @@ -51,4 +53,6 @@ ox::BasicString<255> ProjectTreeModel::fullPath() const noexcept { return m_parent->fullPath() + "/" + ox::StringView(m_name); } return ""; -} \ No newline at end of file +} + +} diff --git a/src/studio/applib/src/projecttreemodel.hpp b/src/studio/applib/src/projecttreemodel.hpp index a8290592..fb994e27 100644 --- a/src/studio/applib/src/projecttreemodel.hpp +++ b/src/studio/applib/src/projecttreemodel.hpp @@ -9,6 +9,8 @@ #include +namespace studio { + class ProjectTreeModel { private: class ProjectExplorer *m_explorer = nullptr; @@ -28,4 +30,6 @@ class ProjectTreeModel { private: [[nodiscard]] ox::BasicString<255> fullPath() const noexcept; -}; \ No newline at end of file +}; + +} diff --git a/src/studio/applib/src/studioapp.cpp b/src/studio/applib/src/studioapp.cpp index 1b64625d..0ef7cc38 100644 --- a/src/studio/applib/src/studioapp.cpp +++ b/src/studio/applib/src/studioapp.cpp @@ -13,6 +13,8 @@ #include "filedialogmanager.hpp" #include "studioapp.hpp" +namespace studio { + ox::Vector modules; struct StudioConfig { @@ -371,8 +373,6 @@ ox::Error StudioUI::closeFile(const ox::String &path) noexcept { return OxError(0); } -namespace studio { - void registerModule(const studio::Module *mod) noexcept { modules.emplace_back(mod); } diff --git a/src/studio/applib/src/studioapp.hpp b/src/studio/applib/src/studioapp.hpp index 0be512b0..2ca55a62 100644 --- a/src/studio/applib/src/studioapp.hpp +++ b/src/studio/applib/src/studioapp.hpp @@ -17,6 +17,8 @@ #include "projectexplorer.hpp" #include "projecttreemodel.hpp" +namespace studio { + class StudioUI: public ox::SignalHandler { friend class StudioUIDrawer; @@ -86,8 +88,6 @@ class StudioUI: public ox::SignalHandler { ox::Error closeFile(const ox::String &path) noexcept; }; -namespace studio { - int main( const char *appName, ox::String projectDataDir, diff --git a/src/studio/modlib/include/studio/editor.hpp b/src/studio/modlib/include/studio/editor.hpp index 2787cd6f..47a163c2 100644 --- a/src/studio/modlib/include/studio/editor.hpp +++ b/src/studio/modlib/include/studio/editor.hpp @@ -9,10 +9,10 @@ #include "undostack.hpp" #include "widget.hpp" -class StudioUI; - namespace studio { +class StudioUI; + class BaseEditor: public Widget { friend StudioUI;