[nostalgia/studio] Start on ImGui version of Studio
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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/string.hpp>
|
||||
|
||||
#include <nostalgia/core/context.hpp>
|
||||
|
||||
#include "lib/filedialog.hpp"
|
||||
#include "lib/task.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
|
||||
class FileDialogManager : public nostalgia::studio::Task {
|
||||
private:
|
||||
enum class UpdateProjectPathState {
|
||||
None,
|
||||
EnableSystemCursor,
|
||||
RunFileDialog,
|
||||
Start = EnableSystemCursor,
|
||||
} m_state = UpdateProjectPathState::Start;
|
||||
|
||||
public:
|
||||
FileDialogManager() noexcept = default;
|
||||
|
||||
template<class... Args>
|
||||
explicit FileDialogManager(Args ...args) noexcept;
|
||||
|
||||
~FileDialogManager() noexcept override = default;
|
||||
|
||||
nostalgia::studio::TaskState update(nostalgia::core::Context *ctx) noexcept final;
|
||||
|
||||
// signals
|
||||
ox::Signal<ox::Error(const ox::String &)> pathChosen;
|
||||
|
||||
};
|
||||
|
||||
template<class... Args>
|
||||
FileDialogManager::FileDialogManager(Args ...args) noexcept {
|
||||
pathChosen.connect(args...);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user