/* * Copyright 2016 - 2021 gary@drinkingtea.net * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include #include "lib/project.hpp" #include "lib/task.hpp" #include "projectexplorer.hpp" #include "projecttreemodel.hpp" namespace nostalgia { class StudioUI: public ox::SignalHandler { friend class StudioUIDrawer; private: ox::UniquePtr m_project; studio::TaskRunner m_taskRunner; ox::Vector m_widgets; ox::UniquePtr m_treeModel; ProjectExplorer m_projectExplorer; bool m_saveEnabled = false; bool m_aboutEnabled = false; public: StudioUI() noexcept; void update(core::Context *ctx) noexcept; protected: void draw(core::Context *ctx) noexcept; private: void drawMenu(core::Context *ctx) noexcept; void drawToolbar(core::Context *ctx) noexcept; ox::Error openProject(const ox::String &path) noexcept; ox::Error refreshProjectTreeModel(const ox::String& = {}) noexcept; }; }