Files
ox/src/nostalgia/studio/studioapp.hpp
T

52 lines
1.2 KiB
C++

/*
* 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 <ox/event/signal.hpp>
#include <ox/std/memory.hpp>
#include <ox/std/string.hpp>
#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<studio::Project> m_project;
studio::TaskRunner m_taskRunner;
ox::Vector<studio::Widget*> m_widgets;
ox::UniquePtr<ProjectTreeModel> 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;
};
}