2015-12-06 01:27:02 +00:00
|
|
|
#ifndef RUDE_VIEW_MANAGER_HPP
|
|
|
|
#define RUDE_VIEW_MANAGER_HPP
|
|
|
|
|
|
|
|
#include <HECL/CVarManager.hpp>
|
2015-12-13 21:01:32 +00:00
|
|
|
#include "ProjectManager.hpp"
|
2015-12-11 02:37:54 +00:00
|
|
|
#include "Space.hpp"
|
2015-12-06 01:27:02 +00:00
|
|
|
|
|
|
|
namespace RUDE
|
|
|
|
{
|
2015-12-13 02:27:34 +00:00
|
|
|
class SplashScreen;
|
2015-12-06 01:27:02 +00:00
|
|
|
|
2015-12-31 03:20:52 +00:00
|
|
|
class ViewManager : public Specter::IViewManager
|
2015-12-06 01:27:02 +00:00
|
|
|
{
|
2016-01-02 02:27:46 +00:00
|
|
|
HECL::Runtime::FileStoreManager& m_fileStoreManager;
|
2015-12-06 01:27:02 +00:00
|
|
|
HECL::CVarManager& m_cvarManager;
|
2015-12-13 21:01:32 +00:00
|
|
|
ProjectManager m_projManager;
|
2015-12-06 01:27:02 +00:00
|
|
|
Specter::FontCache m_fontCache;
|
|
|
|
Specter::ViewResources m_viewResources;
|
2015-12-31 03:20:52 +00:00
|
|
|
Specter::Translator m_translator;
|
2015-12-06 01:27:02 +00:00
|
|
|
std::unique_ptr<boo::IWindow> m_mainWindow;
|
|
|
|
std::unique_ptr<Specter::RootView> m_rootView;
|
2015-12-13 02:27:34 +00:00
|
|
|
std::unique_ptr<SplashScreen> m_splash;
|
2015-12-08 04:27:35 +00:00
|
|
|
|
2015-12-08 01:49:54 +00:00
|
|
|
HECL::CVar* m_cvPixelFactor;
|
2015-12-09 01:04:50 +00:00
|
|
|
|
2016-01-02 02:27:46 +00:00
|
|
|
std::vector<HECL::SystemString> m_recentProjects;
|
|
|
|
std::vector<HECL::SystemString> m_recentFiles;
|
|
|
|
|
2015-12-09 01:04:50 +00:00
|
|
|
bool m_updatePf = false;
|
|
|
|
float m_reqPf;
|
2015-12-06 01:27:02 +00:00
|
|
|
|
2015-12-12 00:37:32 +00:00
|
|
|
Specter::View* BuildSpaceViews(RUDE::Space* space);
|
2015-12-06 01:27:02 +00:00
|
|
|
void SetupRootView();
|
2015-12-13 02:27:34 +00:00
|
|
|
void SetupSplashView();
|
|
|
|
void SetupEditorView();
|
|
|
|
|
|
|
|
bool m_showSplash = false;
|
2015-12-06 01:27:02 +00:00
|
|
|
public:
|
2015-12-10 03:16:29 +00:00
|
|
|
struct SetTo1 : Specter::IButtonBinding
|
|
|
|
{
|
|
|
|
ViewManager& m_vm;
|
|
|
|
SetTo1(ViewManager& vm) : m_vm(vm) {}
|
|
|
|
|
2015-12-13 21:01:32 +00:00
|
|
|
const char* name() const {return "SetTo1";}
|
2015-12-30 02:20:52 +00:00
|
|
|
const char* help() const {return "Sets scale factor to 1.0";}
|
2015-12-14 04:56:25 +00:00
|
|
|
void activated(const boo::SWindowCoord& coord)
|
2015-12-10 03:16:29 +00:00
|
|
|
{
|
2016-01-03 04:06:18 +00:00
|
|
|
m_vm.requestPixelFactor(1.0);
|
2015-12-10 03:16:29 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
SetTo1 m_setTo1;
|
|
|
|
|
|
|
|
struct SetTo2 : Specter::IButtonBinding
|
|
|
|
{
|
|
|
|
ViewManager& m_vm;
|
|
|
|
SetTo2(ViewManager& vm) : m_vm(vm) {}
|
|
|
|
|
2015-12-13 21:01:32 +00:00
|
|
|
const char* name() const {return "SetTo2";}
|
|
|
|
const char* help() const {return "Sets scale factor to 2.0";}
|
2015-12-14 04:56:25 +00:00
|
|
|
void activated(const boo::SWindowCoord& coord)
|
2015-12-10 03:16:29 +00:00
|
|
|
{
|
2016-01-03 04:06:18 +00:00
|
|
|
m_vm.requestPixelFactor(2.0);
|
2015-12-10 03:16:29 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
SetTo2 m_setTo2;
|
2015-12-12 00:37:32 +00:00
|
|
|
|
|
|
|
SplitSpace m_split;
|
|
|
|
TestSpace m_space1;
|
|
|
|
TestSpace m_space2;
|
|
|
|
|
2015-12-13 02:27:34 +00:00
|
|
|
ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarManager& cvarMgr);
|
|
|
|
~ViewManager();
|
2015-12-12 00:37:32 +00:00
|
|
|
|
|
|
|
Specter::RootView& rootView() const {return *m_rootView;}
|
2016-01-03 04:06:18 +00:00
|
|
|
void requestPixelFactor(float pf)
|
2015-12-12 00:37:32 +00:00
|
|
|
{
|
|
|
|
m_reqPf = pf;
|
|
|
|
m_updatePf = true;
|
|
|
|
}
|
|
|
|
|
2015-12-13 21:01:32 +00:00
|
|
|
ProjectManager& projectManager() {return m_projManager;}
|
2015-12-31 03:20:52 +00:00
|
|
|
const Specter::Translator* getTranslator() const {return &m_translator;}
|
2015-12-13 21:01:32 +00:00
|
|
|
|
2016-01-02 02:27:46 +00:00
|
|
|
const std::vector<HECL::SystemString>* recentProjects() const {return &m_recentProjects;}
|
|
|
|
void pushRecentProject(const HECL::SystemString& path);
|
|
|
|
|
|
|
|
const std::vector<HECL::SystemString>* recentFiles() const {return &m_recentFiles;}
|
|
|
|
void pushRecentFile(const HECL::SystemString& path);
|
|
|
|
|
2015-12-12 00:37:32 +00:00
|
|
|
void init(boo::IApplication* app);
|
|
|
|
bool proc();
|
|
|
|
void stop();
|
2015-12-06 01:27:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // RUDE_VIEW_MANAGER_HPP
|