[studio] Put StudioAppLib in studio namespace
This commit is contained in:
parent
6137a2b892
commit
ff242e3488
@ -7,6 +7,8 @@
|
||||
#include <studio/imguiuitl.hpp>
|
||||
#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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
#include <studio/popup.hpp>
|
||||
|
||||
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;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <studio/editor.hpp>
|
||||
|
||||
namespace studio {
|
||||
|
||||
class ClawEditor: public studio::Editor {
|
||||
private:
|
||||
using ObjPath = ox::Vector<ox::StringView, 8>;
|
||||
@ -35,3 +37,4 @@ class ClawEditor: public studio::Editor {
|
||||
void drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include <studio/filedialog.hpp>
|
||||
#include <studio/task.hpp>
|
||||
|
||||
namespace studio {
|
||||
|
||||
class FileDialogManager : public studio::Task {
|
||||
private:
|
||||
enum class UpdateProjectPathState {
|
||||
@ -36,4 +38,6 @@ class FileDialogManager : public studio::Task {
|
||||
// signals
|
||||
ox::Signal<ox::Error(const ox::String &)> pathChosen;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <studio/context.hpp>
|
||||
#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(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include <studio/itemmaker.hpp>
|
||||
#include <studio/popup.hpp>
|
||||
|
||||
namespace studio {
|
||||
|
||||
class NewMenu: public studio::Popup {
|
||||
public:
|
||||
enum class Stage {
|
||||
@ -73,3 +75,5 @@ template<typename T>
|
||||
void NewMenu::addItemType(ox::String displayName, ox::String parentDir, ox::String fileExt, ox::ClawFormat pFmt) noexcept {
|
||||
m_types.emplace_back(ox::make<studio::ItemMakerT<T>>(std::move(displayName), std::move(parentDir), std::move(fileExt), pFmt));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
#include "projectexplorer.hpp"
|
||||
|
||||
namespace studio {
|
||||
|
||||
static ox::Result<ox::UniquePtr<ProjectTreeModel>>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include <studio/widget.hpp>
|
||||
#include "projecttreemodel.hpp"
|
||||
|
||||
namespace studio {
|
||||
|
||||
class ProjectExplorer: public studio::Widget {
|
||||
private:
|
||||
ox::UniquePtr<ProjectTreeModel> m_treeModel;
|
||||
@ -31,4 +33,6 @@ class ProjectExplorer: public studio::Widget {
|
||||
// slots
|
||||
public:
|
||||
ox::Signal<ox::Error(const ox::StringView&)> fileChosen;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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 "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <turbine/context.hpp>
|
||||
|
||||
namespace studio {
|
||||
|
||||
class ProjectTreeModel {
|
||||
private:
|
||||
class ProjectExplorer *m_explorer = nullptr;
|
||||
@ -28,4 +30,6 @@ class ProjectTreeModel {
|
||||
private:
|
||||
[[nodiscard]]
|
||||
ox::BasicString<255> fullPath() const noexcept;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "filedialogmanager.hpp"
|
||||
#include "studioapp.hpp"
|
||||
|
||||
namespace studio {
|
||||
|
||||
ox::Vector<const studio::Module*> 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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -9,10 +9,10 @@
|
||||
#include "undostack.hpp"
|
||||
#include "widget.hpp"
|
||||
|
||||
class StudioUI;
|
||||
|
||||
namespace studio {
|
||||
|
||||
class StudioUI;
|
||||
|
||||
class BaseEditor: public Widget {
|
||||
|
||||
friend StudioUI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user