2015-12-02 01:32:15 +00:00
|
|
|
#ifndef SPECTER_VIEWRESOURCES_HPP
|
|
|
|
#define SPECTER_VIEWRESOURCES_HPP
|
|
|
|
|
|
|
|
#include "TextView.hpp"
|
|
|
|
#include "RootView.hpp"
|
2015-12-03 03:26:50 +00:00
|
|
|
#include "Toolbar.hpp"
|
2015-12-02 01:32:15 +00:00
|
|
|
|
|
|
|
namespace Specter
|
|
|
|
{
|
2015-12-04 01:35:01 +00:00
|
|
|
class ThemeData
|
|
|
|
{
|
|
|
|
Zeus::CColor m_vpBg = {0.2,0.2,0.2,1.0};
|
|
|
|
Zeus::CColor m_tbBg = {0.4,0.4,0.4,1.0};
|
|
|
|
Zeus::CColor m_uiText = Zeus::CColor::skWhite;
|
|
|
|
public:
|
|
|
|
virtual const Zeus::CColor& viewportBackground() const {return m_vpBg;}
|
|
|
|
virtual const Zeus::CColor& toolbarBackground() const {return m_tbBg;}
|
|
|
|
virtual const Zeus::CColor& uiText() const {return m_uiText;}
|
|
|
|
};
|
|
|
|
|
2015-12-02 01:32:15 +00:00
|
|
|
class ViewResources
|
|
|
|
{
|
|
|
|
template <class Factory>
|
2015-12-04 01:35:01 +00:00
|
|
|
void init(Factory* factory, FontCache* fcache, const ThemeData& theme)
|
2015-12-02 01:32:15 +00:00
|
|
|
{
|
2015-12-04 01:35:01 +00:00
|
|
|
m_viewRes.init(factory, theme);
|
2015-12-02 01:32:15 +00:00
|
|
|
m_textRes.init(factory, fcache);
|
2015-12-04 01:35:01 +00:00
|
|
|
m_splitRes.init(factory, theme);
|
|
|
|
m_toolbarRes.init(factory, theme);
|
2015-12-02 01:32:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
boo::IGraphicsDataFactory* m_factory = nullptr;
|
2015-12-04 01:35:01 +00:00
|
|
|
FontCache* m_fcache = nullptr;
|
2015-12-02 01:32:15 +00:00
|
|
|
View::Resources m_viewRes;
|
|
|
|
TextView::Resources m_textRes;
|
2015-12-03 03:26:50 +00:00
|
|
|
SplitView::Resources m_splitRes;
|
|
|
|
Toolbar::Resources m_toolbarRes;
|
2015-12-04 01:35:01 +00:00
|
|
|
std::unique_ptr<boo::IGraphicsData> m_fontData;
|
2015-12-02 01:32:15 +00:00
|
|
|
std::unique_ptr<boo::IGraphicsData> m_resData;
|
|
|
|
|
|
|
|
Specter::FontTag m_mainFont;
|
|
|
|
Specter::FontTag m_monoFont;
|
|
|
|
|
|
|
|
Specter::FontTag m_heading14;
|
|
|
|
Specter::FontTag m_heading18;
|
|
|
|
|
|
|
|
ViewResources() = default;
|
|
|
|
ViewResources(const ViewResources& other) = delete;
|
|
|
|
ViewResources(ViewResources&& other) = default;
|
|
|
|
ViewResources& operator=(const ViewResources& other) = delete;
|
|
|
|
ViewResources& operator=(ViewResources&& other) = default;
|
|
|
|
|
2015-12-04 01:35:01 +00:00
|
|
|
void init(boo::IGraphicsDataFactory* factory, FontCache* fcache, const ThemeData& theme, unsigned dpi);
|
|
|
|
void resetDPI(unsigned dpi);
|
|
|
|
void resetTheme(const ThemeData& theme);
|
2015-12-03 03:26:50 +00:00
|
|
|
|
|
|
|
float m_pixelFactor = 0;
|
|
|
|
float pixelFactor() const {return m_pixelFactor;}
|
2015-12-04 01:35:01 +00:00
|
|
|
|
|
|
|
ThemeData m_theme;
|
|
|
|
const ThemeData& themeData() const {return m_theme;}
|
2015-12-02 01:32:15 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SPECTER_VIEWRESOURCES_HPP
|