aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/ThemeManager.cpp2
-rw-r--r--src/ui/ThemeResourceDictionary.cpp8
-rw-r--r--src/ui/mapper/ColorMapper.cpp2
-rw-r--r--src/ui/mapper/CursorMapper.cpp2
-rw-r--r--src/ui/mapper/MapperRegistry.cpp4
-rw-r--r--src/ui/mapper/PointMapper.cpp2
-rw-r--r--src/ui/mapper/SizeMapper.cpp2
-rw-r--r--src/ui/mapper/ThicknessMapper.cpp2
-rw-r--r--src/ui/mapper/style/CheckedConditionMapper.cpp2
-rw-r--r--src/ui/mapper/style/ClickStateConditionMapper.cpp2
-rw-r--r--src/ui/mapper/style/FocusConditionMapper.cpp4
-rw-r--r--src/ui/mapper/style/HoverConditionMapper.cpp2
-rw-r--r--src/ui/mapper/style/StyleRuleMapper.cpp2
-rw-r--r--src/ui/mapper/style/StyleRuleSetMapper.cpp2
-rw-r--r--src/ui/render/RenderObject.cpp2
-rw-r--r--src/ui/style/StyleRuleSet.cpp2
16 files changed, 21 insertions, 21 deletions
diff --git a/src/ui/ThemeManager.cpp b/src/ui/ThemeManager.cpp
index c1b2167e..a95900b4 100644
--- a/src/ui/ThemeManager.cpp
+++ b/src/ui/ThemeManager.cpp
@@ -21,7 +21,7 @@ ThemeManager::ThemeManager() {
cru::io::GetResourceDir() / "cru/ui/DefaultResources.xml";
if (!std::filesystem::exists(resourses_file)) {
- throw Exception(u"Default resources file not found.");
+ throw Exception("Default resources file not found.");
}
PrependThemeResourceDictionary(
diff --git a/src/ui/ThemeResourceDictionary.cpp b/src/ui/ThemeResourceDictionary.cpp
index 421723f5..4bf3d691 100644
--- a/src/ui/ThemeResourceDictionary.cpp
+++ b/src/ui/ThemeResourceDictionary.cpp
@@ -10,7 +10,7 @@ std::unique_ptr<ThemeResourceDictionary> ThemeResourceDictionary::FromFile(
const String& file_path) {
io::CFileStream stream(file_path.ToUtf8().c_str(), "r");
auto xml_string = stream.ReadToEndAsUtf8String();
- auto parser = xml::XmlParser(xml_string);
+ auto parser = xml::XmlParser(String::FromUtf8(xml_string));
return std::make_unique<ThemeResourceDictionary>(parser.Parse(), false);
}
@@ -25,7 +25,7 @@ ThemeResourceDictionary::~ThemeResourceDictionary() = default;
void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) {
if (!xml_root->GetTag().CaseInsensitiveEqual(u"Theme")) {
- throw Exception(u"Root tag of theme must be 'Theme'.");
+ throw Exception("Root tag of theme must be 'Theme'.");
}
for (auto child : xml_root->GetChildren()) {
@@ -34,10 +34,10 @@ void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) {
if (c->GetTag().CaseInsensitiveEqual(u"Resource")) {
auto key_attr = c->GetOptionalAttributeValueCaseInsensitive(u"key");
if (!key_attr) {
- throw Exception(u"'key' attribute is required for resource.");
+ throw Exception("'key' attribute is required for resource.");
}
if (c->GetChildElementCount() != 1) {
- throw Exception(u"Resource must have only one child element.");
+ throw Exception("Resource must have only one child element.");
}
ResourceEntry entry;
diff --git a/src/ui/mapper/ColorMapper.cpp b/src/ui/mapper/ColorMapper.cpp
index 6f7de7fb..72ea1ce2 100644
--- a/src/ui/mapper/ColorMapper.cpp
+++ b/src/ui/mapper/ColorMapper.cpp
@@ -8,7 +8,7 @@ bool ColorMapper::XmlElementIsOfThisType(xml::XmlElementNode* node) {
Color ColorMapper::DoMapFromString(String str) {
auto c = Color::Parse(str);
if (!c) {
- throw Exception(u"Invalid color value.");
+ throw Exception("Invalid color value.");
}
return *c;
}
diff --git a/src/ui/mapper/CursorMapper.cpp b/src/ui/mapper/CursorMapper.cpp
index ed3c91ec..4f59439f 100644
--- a/src/ui/mapper/CursorMapper.cpp
+++ b/src/ui/mapper/CursorMapper.cpp
@@ -24,7 +24,7 @@ std::shared_ptr<ICursor> CursorMapper::DoMapFromString(String str) {
} else if (str.CaseInsensitiveCompare(u"ibeam") == 0) {
return cursor_manager->GetSystemCursor(SystemCursorType::IBeam);
} else {
- throw Exception(u"Unsupported cursor type.");
+ throw Exception("Unsupported cursor type.");
}
}
diff --git a/src/ui/mapper/MapperRegistry.cpp b/src/ui/mapper/MapperRegistry.cpp
index a542bfca..d877f14a 100644
--- a/src/ui/mapper/MapperRegistry.cpp
+++ b/src/ui/mapper/MapperRegistry.cpp
@@ -74,7 +74,7 @@ MapperRegistry::~MapperRegistry() {
void MapperRegistry::RegisterMapper(MapperBase *mapper) {
if (std::find(mapper_list_.cbegin(), mapper_list_.cend(), mapper) !=
mapper_list_.cend()) {
- throw Exception(u"This mapper is already registered.");
+ throw Exception("This mapper is already registered.");
}
mapper_list_.push_back(mapper);
@@ -83,7 +83,7 @@ void MapperRegistry::RegisterMapper(MapperBase *mapper) {
void MapperRegistry::UnregisterMapper(MapperBase *mapper) {
auto it = std::find(mapper_list_.begin(), mapper_list_.end(), mapper);
if (it == mapper_list_.end()) {
- throw Exception(u"This mapper is not registered.");
+ throw Exception("This mapper is not registered.");
}
mapper_list_.erase(it);
diff --git a/src/ui/mapper/PointMapper.cpp b/src/ui/mapper/PointMapper.cpp
index 4b0104d0..1bf7defb 100644
--- a/src/ui/mapper/PointMapper.cpp
+++ b/src/ui/mapper/PointMapper.cpp
@@ -12,7 +12,7 @@ Point PointMapper::DoMapFromString(String str) {
} else if (values.size() == 1) {
return {values[0], values[0]};
} else {
- throw Exception(u"Invalid Point string.");
+ throw Exception("Invalid Point string.");
}
}
diff --git a/src/ui/mapper/SizeMapper.cpp b/src/ui/mapper/SizeMapper.cpp
index 4cbe2d38..7e1bbd91 100644
--- a/src/ui/mapper/SizeMapper.cpp
+++ b/src/ui/mapper/SizeMapper.cpp
@@ -12,7 +12,7 @@ Size SizeMapper::DoMapFromString(String str) {
} else if (values.size() == 1) {
return {values[0], values[0]};
} else {
- throw Exception(u"Invalid Point string.");
+ throw Exception("Invalid Point string.");
}
}
diff --git a/src/ui/mapper/ThicknessMapper.cpp b/src/ui/mapper/ThicknessMapper.cpp
index 23be89b4..eed7c651 100644
--- a/src/ui/mapper/ThicknessMapper.cpp
+++ b/src/ui/mapper/ThicknessMapper.cpp
@@ -15,7 +15,7 @@ Thickness ThicknessMapper::DoMapFromString(String str) {
} else if (values.size() == 1) {
return Thickness(values[0], values[0], values[0], values[0]);
} else {
- throw Exception(u"Invalid Thickness string.");
+ throw Exception("Invalid Thickness string.");
}
}
diff --git a/src/ui/mapper/style/CheckedConditionMapper.cpp b/src/ui/mapper/style/CheckedConditionMapper.cpp
index 74e0a3c5..e33c1113 100644
--- a/src/ui/mapper/style/CheckedConditionMapper.cpp
+++ b/src/ui/mapper/style/CheckedConditionMapper.cpp
@@ -16,7 +16,7 @@ ClonablePtr<ui::style::CheckedCondition> CheckedConditionMapper::DoMapFromXml(
} else if (value.CaseInsensitiveEqual(u"false")) {
return ui::style::CheckedCondition::Create(false);
} else {
- throw Exception(u"Invalid value for CheckedCondition: " + value);
+ throw Exception("Invalid value for CheckedCondition: " + value.ToUtf8());
}
}
} // namespace cru::ui::mapper::style
diff --git a/src/ui/mapper/style/ClickStateConditionMapper.cpp b/src/ui/mapper/style/ClickStateConditionMapper.cpp
index d6b403c9..ca1f09c6 100644
--- a/src/ui/mapper/style/ClickStateConditionMapper.cpp
+++ b/src/ui/mapper/style/ClickStateConditionMapper.cpp
@@ -24,7 +24,7 @@ ClickStateConditionMapper::DoMapFromXml(xml::XmlElementNode *node) {
} else if (value_attr->CaseInsensitiveEqual(u"pressinactive")) {
state = helper::ClickState::PressInactive;
} else {
- throw Exception(u"Unknown click state: " + *value_attr);
+ throw Exception("Unknown click state: " + value_attr->ToUtf8());
}
}
diff --git a/src/ui/mapper/style/FocusConditionMapper.cpp b/src/ui/mapper/style/FocusConditionMapper.cpp
index dfefb921..9aa1d6ce 100644
--- a/src/ui/mapper/style/FocusConditionMapper.cpp
+++ b/src/ui/mapper/style/FocusConditionMapper.cpp
@@ -1,5 +1,5 @@
-#include "cru/base/ClonablePtr.h"
#include "cru/ui/mapper/style/FocusConditionMapper.h"
+#include "cru/base/ClonablePtr.h"
#include "cru/ui/style/Condition.h"
#include "cru/xml/XmlNode.h"
@@ -16,7 +16,7 @@ ClonablePtr<ui::style::FocusCondition> FocusConditionMapper::DoMapFromXml(
} else if (value.CaseInsensitiveEqual(u"false")) {
return ui::style::FocusCondition::Create(false);
} else {
- throw Exception(u"Invalid value for FocusCondition: " + value);
+ throw Exception("Invalid value for FocusCondition: " + value.ToUtf8());
}
}
} // namespace cru::ui::mapper::style
diff --git a/src/ui/mapper/style/HoverConditionMapper.cpp b/src/ui/mapper/style/HoverConditionMapper.cpp
index 0110edd9..27565192 100644
--- a/src/ui/mapper/style/HoverConditionMapper.cpp
+++ b/src/ui/mapper/style/HoverConditionMapper.cpp
@@ -17,7 +17,7 @@ ClonablePtr<HoverCondition> HoverConditionMapper::DoMapFromXml(
} else if (value.CaseInsensitiveEqual(u"false")) {
return ui::style::HoverCondition::Create(false);
} else {
- throw Exception(u"Invalid value for HoverCondition: " + value);
+ throw Exception("Invalid value for HoverCondition: " + value.ToUtf8());
}
}
} // namespace cru::ui::mapper::style
diff --git a/src/ui/mapper/style/StyleRuleMapper.cpp b/src/ui/mapper/style/StyleRuleMapper.cpp
index 2eb5b0a2..f80d27db 100644
--- a/src/ui/mapper/style/StyleRuleMapper.cpp
+++ b/src/ui/mapper/style/StyleRuleMapper.cpp
@@ -49,7 +49,7 @@ ClonablePtr<ui::style::StyleRule> StyleRuleMapper::DoMapFromXml(
}
if (!resolved) {
- throw Exception(u"Unknown element in StyleRule: " + c->GetTag());
+ throw Exception("Unknown element in StyleRule: " + c->GetTag().ToUtf8());
}
}
}
diff --git a/src/ui/mapper/style/StyleRuleSetMapper.cpp b/src/ui/mapper/style/StyleRuleSetMapper.cpp
index d014edc7..1067f8f8 100644
--- a/src/ui/mapper/style/StyleRuleSetMapper.cpp
+++ b/src/ui/mapper/style/StyleRuleSetMapper.cpp
@@ -25,7 +25,7 @@ std::shared_ptr<ui::style::StyleRuleSet> StyleRuleSetMapper::DoMapFromXml(
auto style_rule = style_rule_mapper->MapFromXml(c);
result->AddStyleRule(*style_rule);
} else {
- throw Exception(u"StyleRuleSet can only contain StyleRule.");
+ throw Exception("StyleRuleSet can only contain StyleRule.");
}
}
}
diff --git a/src/ui/render/RenderObject.cpp b/src/ui/render/RenderObject.cpp
index 1803a131..521e88c2 100644
--- a/src/ui/render/RenderObject.cpp
+++ b/src/ui/render/RenderObject.cpp
@@ -239,7 +239,7 @@ void RenderObject::OnLayoutCore() {
}
Size RenderObject::OnMeasureContent1(const BoxConstraint& constraint) {
- throw Exception(u"Not implemented.");
+ throw Exception("Not implemented.");
}
Rect RenderObject::GetPaddingRect() const {
diff --git a/src/ui/style/StyleRuleSet.cpp b/src/ui/style/StyleRuleSet.cpp
index 5468949a..b7a82577 100644
--- a/src/ui/style/StyleRuleSet.cpp
+++ b/src/ui/style/StyleRuleSet.cpp
@@ -27,7 +27,7 @@ StyleRuleSet::StyleRuleSet(std::shared_ptr<StyleRuleSet> parent) {
void StyleRuleSet::SetParent(std::shared_ptr<StyleRuleSet> parent) {
if (parent == parent_) return;
if (CheckCycle(this, parent.get())) {
- throw Exception(u"Cycle detected in StyleRuleSet parent.");
+ throw Exception("Cycle detected in StyleRuleSet parent.");
}
parent_change_event_guard_.Reset();
parent_ = std::move(parent);