[nostalgia,olympic] Change macro names to comply with broader conventions

This commit is contained in:
2024-12-21 02:41:19 -06:00
parent dc72500b98
commit 462f2bca4c
51 changed files with 383 additions and 383 deletions

View File

@ -37,7 +37,7 @@ static ox::Error runApp(
ox::StringViewCR appName,
ox::StringViewCR projectDataDir,
ox::UPtr<ox::FileSystem> &&fs) noexcept {
oxRequireM(ctx, turbine::init(std::move(fs), appName));
OX_REQUIRE_M(ctx, turbine::init(std::move(fs), appName));
turbine::setWindowTitle(*ctx, keelCtx(*ctx).appName);
turbine::setKeyEventHandler(*ctx, keyEventHandler);
turbine::setRefreshWithin(*ctx, 0);

View File

@ -16,16 +16,16 @@ static ox::Result<ox::UniquePtr<ProjectTreeModel>> buildProjectTreeModel(
ox::StringView path,
ProjectTreeModel *parent) noexcept {
auto const fs = explorer.romFs();
oxRequire(stat, fs->stat(path));
OX_REQUIRE(stat, fs->stat(path));
auto out = ox::make_unique<ProjectTreeModel>(explorer, ox::String(name), parent);
if (stat.fileType == ox::FileType::Directory) {
oxRequireM(children, fs->ls(path));
OX_REQUIRE_M(children, fs->ls(path));
std::sort(children.begin(), children.end());
ox::Vector<ox::UniquePtr<ProjectTreeModel>> outChildren;
for (auto const&childName : children) {
if (childName[0] != '.') {
auto const childPath = ox::sfmt("{}/{}", path, childName);
oxRequireM(child, buildProjectTreeModel(explorer, childName, childPath, out.get()));
OX_REQUIRE_M(child, buildProjectTreeModel(explorer, childName, childPath, out.get()));
outChildren.emplace_back(std::move(child));
}
}
@ -52,7 +52,7 @@ void ProjectExplorer::setModel(ox::UPtr<ProjectTreeModel> &&model) noexcept {
}
ox::Error ProjectExplorer::refreshProjectTreeModel(ox::StringViewCR) noexcept {
oxRequireM(model, buildProjectTreeModel(*this, "Project", "/", nullptr));
OX_REQUIRE_M(model, buildProjectTreeModel(*this, "Project", "/", nullptr));
setModel(std::move(model));
return ox::Error(0);
}

View File

@ -36,12 +36,12 @@ struct StudioConfig {
bool showProjectExplorer = true;
};
oxModelBegin(StudioConfig)
oxModelFieldRename(activeTabItemName, active_tab_item_name)
oxModelFieldRename(projectPath, project_path)
oxModelFieldRename(openFiles, open_files)
oxModelFieldRename(showProjectExplorer, show_project_explorer)
oxModelEnd()
OX_MODEL_BEGIN(StudioConfig)
OX_MODEL_FIELD_RENAME(activeTabItemName, active_tab_item_name)
OX_MODEL_FIELD_RENAME(projectPath, project_path)
OX_MODEL_FIELD_RENAME(openFiles, open_files)
OX_MODEL_FIELD_RENAME(showProjectExplorer, show_project_explorer)
OX_MODEL_END()
StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexcept:
m_sctx(*this, ctx),
@ -222,7 +222,7 @@ void StudioUI::drawTabs() noexcept {
m_activeEditor = nullptr;
}
try {
oxThrowError(m_editors.erase(it).moveTo(it));
OX_THROW_ERROR(m_editors.erase(it).moveTo(it));
} catch (ox::Exception const&ex) {
oxErrf("Editor tab deletion failed: {} ({}:{})\n", ex.what(), ex.file, ex.line);
} catch (std::exception const&ex) {
@ -323,15 +323,15 @@ void StudioUI::handleKeyInput() noexcept {
ox::Error StudioUI::createOpenProject(ox::StringViewCR path) noexcept {
std::error_code ec;
std::filesystem::create_directories(toStdStringView(path), ec);
oxReturnError(ox::Error(ec.value() != 0, "Could not create project directory"));
oxReturnError(openProjectPath(path));
OX_RETURN_ERROR(ox::Error(ec.value() != 0, "Could not create project directory"));
OX_RETURN_ERROR(openProjectPath(path));
return m_project->writeTypeStore();
}
ox::Error StudioUI::openProjectPath(ox::StringParam path) noexcept {
oxRequireM(fs, keel::loadRomFs(path.view()));
oxReturnError(keel::setRomFs(keelCtx(m_ctx), std::move(fs)));
oxReturnError(
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<studio::Project>(keelCtx(m_ctx), std::move(path), m_projectDataDir)
.moveTo(m_project));
auto const sctx = applicationData<studio::StudioContext>(m_ctx);
@ -366,7 +366,7 @@ ox::Error StudioUI::openFileActiveTab(ox::StringViewCR path, bool makeActiveTab)
}
return {};
}
oxRequire(ext, studio::fileExt(path));
OX_REQUIRE(ext, studio::fileExt(path));
// create Editor
BaseEditor *editor = nullptr;
auto const err = m_editorMakers.contains(ext) ?