blob: 9ac7f4167cf41bce22d0cbd7b53010c082613e46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#pragma once
#include "Base.hpp"
#include "controls/Base.hpp"
#include "cru/platform/graphics/Brush.hpp"
#include "cru/ui/helper/ClickDetector.hpp"
#include "style/StyleRuleSet.hpp"
#include <gsl/pointers>
#include <memory>
#include <string>
#include <unordered_map>
namespace cru::ui {
struct ThemeResources {
String default_font_family;
std::shared_ptr<platform::graphics::IFont> default_font;
std::shared_ptr<platform::graphics::IBrush> text_brush;
std::shared_ptr<platform::graphics::IBrush> text_selection_brush;
std::shared_ptr<platform::graphics::IBrush> caret_brush;
};
class CRU_UI_API UiManager : public Object {
public:
static UiManager* GetInstance();
private:
UiManager();
public:
UiManager(const UiManager& other) = delete;
UiManager(UiManager&& other) = delete;
UiManager& operator=(const UiManager& other) = delete;
UiManager& operator=(UiManager&& other) = delete;
~UiManager() override;
ThemeResources* GetThemeResources() { return &theme_resource_; }
void ReadResourcesFile(const String& file_path);
private:
ThemeResources theme_resource_;
};
} // namespace cru::ui
|