[studio] Rename StudioContext to Context
All checks were successful
Build / build (push) Successful in 1m16s
All checks were successful
Build / build (push) Successful in 1m16s
This commit is contained in:
@@ -14,19 +14,19 @@ namespace studio {
|
||||
|
||||
class StudioUI;
|
||||
|
||||
struct StudioContext {
|
||||
struct Context {
|
||||
StudioUI &ui;
|
||||
Project *project = nullptr;
|
||||
turbine::Context &tctx;
|
||||
StudioContext(StudioUI &pUi, turbine::Context &pTctx) noexcept:
|
||||
Context(StudioUI &pUi, turbine::Context &pTctx) noexcept:
|
||||
ui(pUi), tctx(pTctx) {}
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
inline keel::Context &keelCtx(StudioContext &ctx) noexcept {
|
||||
inline keel::Context &keelCtx(Context &ctx) noexcept {
|
||||
return keelCtx(ctx.tctx);
|
||||
}
|
||||
|
||||
void navigateTo(StudioContext &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept;
|
||||
void navigateTo(Context &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept;
|
||||
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ class Editor: public studio::BaseEditor {
|
||||
ox::String m_itemName;
|
||||
|
||||
public:
|
||||
Editor(StudioContext &ctx, ox::StringParam itemPath) noexcept;
|
||||
Editor(Context &ctx, ox::StringParam itemPath) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ox::CStringView itemPath() const noexcept final;
|
||||
|
@@ -31,7 +31,7 @@ class FilePickerPopup {
|
||||
[[nodiscard]]
|
||||
bool isOpen() const noexcept;
|
||||
|
||||
ox::Optional<ox::String> draw(StudioContext &ctx) noexcept;
|
||||
ox::Optional<ox::String> draw(Context &ctx) noexcept;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class FileExplorer: public ox::SignalHandler {
|
||||
m_kctx{kctx},
|
||||
m_fileDraggable{fileDraggable} {}
|
||||
|
||||
void draw(StudioContext &ctx, ImVec2 const &sz) const noexcept;
|
||||
void draw(Context &ctx, ImVec2 const &sz) const noexcept;
|
||||
|
||||
void setModel(ox::UPtr<FileTreeModel> &&model, bool selectRoot = false) noexcept;
|
||||
|
||||
|
@@ -272,7 +272,7 @@ bool ComboBox(
|
||||
|
||||
bool FileComboBox(
|
||||
ox::CStringViewCR lbl,
|
||||
StudioContext &sctx,
|
||||
Context &sctx,
|
||||
ox::StringViewCR fileExt,
|
||||
size_t &selectedIdx) noexcept;
|
||||
|
||||
@@ -295,7 +295,7 @@ bool ListBox(ox::CStringViewCR name, ox::SpanView<ox::String> const&list, size_t
|
||||
class FilePicker {
|
||||
private:
|
||||
bool m_show{};
|
||||
StudioContext &m_sctx;
|
||||
Context &m_sctx;
|
||||
ox::String const m_title;
|
||||
ox::String const m_fileExt;
|
||||
ImVec2 const m_size;
|
||||
@@ -303,7 +303,7 @@ class FilePicker {
|
||||
ox::Signal<ox::Error(ox::StringView)> filePicked;
|
||||
|
||||
FilePicker(
|
||||
studio::StudioContext &sctx,
|
||||
studio::Context &sctx,
|
||||
ox::StringParam title,
|
||||
ox::StringParam fileExt,
|
||||
ImVec2 const&size = {}) noexcept;
|
||||
@@ -348,7 +348,7 @@ class QuestionPopup: public Popup {
|
||||
|
||||
QuestionPopup(ox::StringParam title, ox::StringParam question) noexcept;
|
||||
|
||||
void draw(StudioContext &ctx) noexcept override;
|
||||
void draw(Context &ctx) noexcept override;
|
||||
|
||||
};
|
||||
|
||||
@@ -363,7 +363,7 @@ class MessagePopup: public Popup {
|
||||
|
||||
void show(ox::StringParam msg) noexcept;
|
||||
|
||||
void draw(StudioContext &ctx) noexcept override;
|
||||
void draw(Context &ctx) noexcept override;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -162,7 +162,7 @@ class ItemMaker {
|
||||
* @return path of file or error in Result
|
||||
*/
|
||||
ox::Error write(
|
||||
StudioContext &ctx,
|
||||
Context &ctx,
|
||||
ox::StringViewCR pPath,
|
||||
size_t pTemplateIdx) const noexcept {
|
||||
return writeItem(ctx, pPath, pTemplateIdx);
|
||||
@@ -177,7 +177,7 @@ class ItemMaker {
|
||||
* @return path of file or error in Result
|
||||
*/
|
||||
ox::Error write(
|
||||
StudioContext &ctx,
|
||||
Context &ctx,
|
||||
ox::StringViewCR pPath,
|
||||
ox::StringViewCR pName,
|
||||
size_t pTemplateIdx) const noexcept {
|
||||
@@ -187,7 +187,7 @@ class ItemMaker {
|
||||
|
||||
protected:
|
||||
virtual ox::Error writeItem(
|
||||
StudioContext &ctx,
|
||||
Context &ctx,
|
||||
ox::StringViewCR pPath,
|
||||
size_t pTemplateIdx) const noexcept = 0;
|
||||
|
||||
@@ -249,7 +249,7 @@ class ItemMakerT final: public ItemMaker {
|
||||
}
|
||||
|
||||
ox::Error writeItem(
|
||||
StudioContext &ctx,
|
||||
Context &ctx,
|
||||
ox::StringViewCR pPath,
|
||||
size_t const pTemplateIdx) const noexcept override {
|
||||
createUuidMapping(keelCtx(ctx.tctx), pPath, ox::UUID::generate().unwrap());
|
||||
|
@@ -27,17 +27,17 @@ class Module {
|
||||
public:
|
||||
virtual ~Module() noexcept = default;
|
||||
|
||||
virtual ox::Vector<EditorMaker> editors(studio::StudioContext &ctx) const;
|
||||
virtual ox::Vector<EditorMaker> editors(studio::Context &ctx) const;
|
||||
|
||||
virtual ox::Vector<ox::UPtr<ItemMaker>> itemMakers(studio::StudioContext&) const;
|
||||
virtual ox::Vector<ox::UPtr<ItemMaker>> itemMakers(studio::Context&) const;
|
||||
|
||||
virtual ox::Vector<ox::UPtr<ItemTemplate>> itemTemplates(studio::StudioContext&) const;
|
||||
virtual ox::Vector<ox::UPtr<ItemTemplate>> itemTemplates(studio::Context&) const;
|
||||
|
||||
};
|
||||
|
||||
template<typename Editor>
|
||||
[[nodiscard]]
|
||||
EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept {
|
||||
EditorMaker editorMaker(Context &ctx, ox::StringParam ext) noexcept {
|
||||
return {
|
||||
{std::move(ext)},
|
||||
[&ctx](ox::StringViewCR path) -> ox::Result<BaseEditor*> {
|
||||
@@ -48,7 +48,7 @@ EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept {
|
||||
|
||||
template<typename Editor>
|
||||
[[nodiscard]]
|
||||
EditorMaker editorMaker(StudioContext &ctx, std::initializer_list<ox::StringView> exts) noexcept {
|
||||
EditorMaker editorMaker(Context &ctx, std::initializer_list<ox::StringView> exts) noexcept {
|
||||
return {
|
||||
[&exts] {
|
||||
ox::Vector<ox::String> fileTypes;
|
||||
|
@@ -15,7 +15,7 @@ namespace studio {
|
||||
class Widget: public ox::SignalHandler {
|
||||
public:
|
||||
~Widget() noexcept override = default;
|
||||
virtual void draw(StudioContext&) noexcept = 0;
|
||||
virtual void draw(Context&) noexcept = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user