aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/ThemeResourceDictionary.cpp4
-rw-r--r--src/ui/controls/Control.cpp2
-rw-r--r--src/ui/controls/TextHostControlService.cpp12
-rw-r--r--src/ui/helper/ClickDetector.cpp4
-rw-r--r--src/ui/helper/ShortcutHub.cpp16
-rw-r--r--src/ui/host/RoutedEventDispatch.h10
-rw-r--r--src/ui/host/WindowHost.cpp2
-rw-r--r--src/ui/render/BorderRenderObject.cpp4
-rw-r--r--src/ui/render/FlexLayoutRenderObject.cpp2
-rw-r--r--src/ui/render/RenderObject.cpp10
-rw-r--r--src/ui/render/TextRenderObject.cpp2
11 files changed, 34 insertions, 34 deletions
diff --git a/src/ui/ThemeResourceDictionary.cpp b/src/ui/ThemeResourceDictionary.cpp
index c5986962..fff25e09 100644
--- a/src/ui/ThemeResourceDictionary.cpp
+++ b/src/ui/ThemeResourceDictionary.cpp
@@ -47,10 +47,10 @@ void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) {
resource_map_[entry.name] = std::move(entry);
} else {
- CRU_LOG_DEBUG(u"Ignore unknown element {} of theme.", c->GetTag());
+ CRU_LOG_TAG_DEBUG(u"Ignore unknown element {} of theme.", c->GetTag());
}
} else {
- CRU_LOG_DEBUG(u"Ignore text or comment node of theme.");
+ CRU_LOG_TAG_DEBUG(u"Ignore text or comment node of theme.");
}
}
}
diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp
index 17633e3d..d6770684 100644
--- a/src/ui/controls/Control.cpp
+++ b/src/ui/controls/Control.cpp
@@ -30,7 +30,7 @@ Control::Control() {
Control::~Control() {
if (host::WindowHost::IsInEventHandling()) {
- CRU_LOG_ERROR(
+ CRU_LOG_TAG_ERROR(
u"Control destroyed during event handling. Please use DeleteLater.");
}
diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp
index 3e885bd3..bc562e88 100644
--- a/src/ui/controls/TextHostControlService.cpp
+++ b/src/ui/controls/TextHostControlService.cpp
@@ -227,7 +227,7 @@ void TextHostControlService::SetText(String text, bool stop_composition) {
void TextHostControlService::InsertText(Index position, StringView text,
bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text insert position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text insert position.");
return;
}
this->text_.insert(this->text_.cbegin() + position, text);
@@ -240,7 +240,7 @@ void TextHostControlService::InsertText(Index position, StringView text,
void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text delete position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete position.");
return;
}
if (position == static_cast<Index>(this->text_.size())) return;
@@ -253,7 +253,7 @@ void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
Index TextHostControlService::DeleteCharPrevious(Index position,
bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text delete position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete position.");
return 0;
}
if (position == 0) return 0;
@@ -269,11 +269,11 @@ void TextHostControlService::DeleteText(TextRange range,
if (range.count == 0) return;
range = range.Normalize();
if (!Utf16IsValidInsertPosition(this->text_, range.GetStart())) {
- CRU_LOG_ERROR(u"Invalid text delete start position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete start position.");
return;
}
if (!Utf16IsValidInsertPosition(this->text_, range.GetStart())) {
- CRU_LOG_ERROR(u"Invalid text delete end position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete end position.");
return;
}
this->text_.erase(this->text_.cbegin() + range.GetStart(),
@@ -465,7 +465,7 @@ void TextHostControlService::UpdateInputMethodPosition() {
right_bottom.y += 5;
if constexpr (debug_flags::text_service) {
- CRU_LOG_DEBUG(u"Calculate input method candidate window position: {}.",
+ CRU_LOG_TAG_DEBUG(u"Calculate input method candidate window position: {}.",
right_bottom);
}
diff --git a/src/ui/helper/ClickDetector.cpp b/src/ui/helper/ClickDetector.cpp
index de39f14e..b7e800a8 100644
--- a/src/ui/helper/ClickDetector.cpp
+++ b/src/ui/helper/ClickDetector.cpp
@@ -58,7 +58,7 @@ ClickDetector::ClickDetector(controls::Control* control) {
this->state_ == ClickState::Hover) {
if (!this->control_->CaptureMouse()) {
if constexpr (debug_flags::click_detector) {
- CRU_LOG_DEBUG(u"Failed to capture mouse when begin click.");
+ CRU_LOG_TAG_DEBUG(u"Failed to capture mouse when begin click.");
}
return;
}
@@ -137,7 +137,7 @@ void ClickDetector::SetState(ClickState state) {
UnreachableCode();
}
};
- CRU_LOG_DEBUG(u"Click state changed, new state: {}.", to_string(state));
+ CRU_LOG_TAG_DEBUG(u"Click state changed, new state: {}.", to_string(state));
}
state_ = state;
diff --git a/src/ui/helper/ShortcutHub.cpp b/src/ui/helper/ShortcutHub.cpp
index 30a563ed..c413ab2a 100644
--- a/src/ui/helper/ShortcutHub.cpp
+++ b/src/ui/helper/ShortcutHub.cpp
@@ -64,7 +64,7 @@ const std::vector<ShortcutInfo>& ShortcutHub::GetShortcutByKeyBind(
void ShortcutHub::Install(controls::Control* control) {
if (!event_guard_.IsEmpty()) {
- CRU_LOG_ERROR(u"Shortcut hub is already installed. Failed to install.");
+ CRU_LOG_TAG_ERROR(u"Shortcut hub is already installed. Failed to install.");
return;
}
@@ -74,7 +74,7 @@ void ShortcutHub::Install(controls::Control* control) {
void ShortcutHub::Uninstall() {
if (event_guard_.IsEmpty()) {
- CRU_LOG_WARN(u"Shortcut hub is not installed. Failed to uninstall.");
+ CRU_LOG_TAG_WARN(u"Shortcut hub is not installed. Failed to uninstall.");
return;
}
@@ -89,9 +89,9 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
if constexpr (debug_flags::shortcut) {
if (shortcut_list.empty()) {
- CRU_LOG_DEBUG(u"No shortcut for key bind {}.", key_bind.ToString());
+ CRU_LOG_TAG_DEBUG(u"No shortcut for key bind {}.", key_bind.ToString());
}
- CRU_LOG_DEBUG(u"Begin to handle shortcut for key bind {}.",
+ CRU_LOG_TAG_DEBUG(u"Begin to handle shortcut for key bind {}.",
key_bind.ToString());
}
@@ -99,7 +99,7 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
auto is_handled = shortcut.handler();
if (is_handled) {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(u"Handle {} handled it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG(u"Handle {} handled it.", shortcut.name);
}
handled = true;
@@ -108,21 +108,21 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
break;
} else {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(u"Handle {} didn't handle it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG(u"Handle {} didn't handle it.", shortcut.name);
}
}
}
if constexpr (debug_flags::shortcut) {
if (!shortcut_list.empty()) {
- CRU_LOG_DEBUG(u"End handling shortcut for key bind {}.",
+ CRU_LOG_TAG_DEBUG(u"End handling shortcut for key bind {}.",
key_bind.ToString());
}
}
if (!handled) {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Raise fallback event for unhandled shortcut of key bind {}.",
key_bind.ToString());
}
diff --git a/src/ui/host/RoutedEventDispatch.h b/src/ui/host/RoutedEventDispatch.h
index 207e1ee6..6677deea 100644
--- a/src/ui/host/RoutedEventDispatch.h
+++ b/src/ui/host/RoutedEventDispatch.h
@@ -34,7 +34,7 @@ void DispatchEvent(
if (original_sender == last_receiver) {
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event {} no need to dispatch (original_sender == "
"last_receiver). Original sender is {}.",
event_name, original_sender->GetControlType());
@@ -64,7 +64,7 @@ void DispatchEvent(
log += u" -> ";
}
log += i->Resolve()->GetControlType();
- CRU_LOG_DEBUG(log);
+ CRU_LOG_TAG_DEBUG(log);
}
auto handled = false;
@@ -82,7 +82,7 @@ void DispatchEvent(
if (event_args.IsHandled()) {
handled = true;
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event is short-circuit in TUNNEL at {}-st control (count "
u"from parent).",
count);
@@ -102,7 +102,7 @@ void DispatchEvent(
->Raise(event_args);
if (event_args.IsHandled()) {
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event is short-circuit in BUBBLE at {}-st control "
u"(count from parent).",
count);
@@ -121,7 +121,7 @@ void DispatchEvent(
}
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(u"Routed event dispatch finished.");
+ CRU_LOG_TAG_DEBUG(u"Routed event dispatch finished.");
WindowHost::LeaveEventHandling();
}
diff --git a/src/ui/host/WindowHost.cpp b/src/ui/host/WindowHost.cpp
index 616803b6..9d0e2006 100644
--- a/src/ui/host/WindowHost.cpp
+++ b/src/ui/host/WindowHost.cpp
@@ -202,7 +202,7 @@ void WindowHost::RelayoutWithSize(const Size& available_size,
for (auto& action : after_layout_stable_action_) action();
after_layout_event_.Raise(AfterLayoutEventArgs{});
after_layout_stable_action_.clear();
- if constexpr (debug_flags::layout) CRU_LOG_DEBUG(u"A relayout is finished.");
+ if constexpr (debug_flags::layout) CRU_LOG_TAG_DEBUG(u"A relayout is finished.");
}
void WindowHost::Repaint() {
diff --git a/src/ui/render/BorderRenderObject.cpp b/src/ui/render/BorderRenderObject.cpp
index 81a1aa60..0e97c5e8 100644
--- a/src/ui/render/BorderRenderObject.cpp
+++ b/src/ui/render/BorderRenderObject.cpp
@@ -81,7 +81,7 @@ RenderObject* BorderRenderObject::HitTest(const Point& point) {
void BorderRenderObject::Draw(platform::graphics::IPainter* painter) {
if constexpr (debug_flags::draw) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"BorderRenderObject draw, background: {}, foreground: {}.",
background_brush_ == nullptr ? u"NONE"
: background_brush_->GetDebugString(),
@@ -95,7 +95,7 @@ void BorderRenderObject::Draw(platform::graphics::IPainter* painter) {
if (is_border_enabled_) {
if (border_brush_ == nullptr) {
- CRU_LOG_WARN(u"Border is enabled but border brush is null.");
+ CRU_LOG_TAG_WARN(u"Border is enabled but border brush is null.");
} else {
painter->FillGeometry(geometry_.get(), border_brush_.get());
}
diff --git a/src/ui/render/FlexLayoutRenderObject.cpp b/src/ui/render/FlexLayoutRenderObject.cpp
index 7bbf9d57..588c379b 100644
--- a/src/ui/render/FlexLayoutRenderObject.cpp
+++ b/src/ui/render/FlexLayoutRenderObject.cpp
@@ -300,7 +300,7 @@ Size FlexLayoutMeasureContentImpl(
if (max_main_length.IsSpecified() &&
total_length > max_main_length.GetLengthOrUndefined()) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"(Measure) Children's main axis length exceeds required max length.");
total_length = max_main_length.GetLengthOrUndefined();
} else if (min_main_length.IsSpecified() &&
diff --git a/src/ui/render/RenderObject.cpp b/src/ui/render/RenderObject.cpp
index 64411036..b3a28d6d 100644
--- a/src/ui/render/RenderObject.cpp
+++ b/src/ui/render/RenderObject.cpp
@@ -119,7 +119,7 @@ void RenderObject::Measure(const MeasureRequirement& requirement,
preferred_size.OverrideBy(preferred_size_);
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Measure begins :\nrequirement: {}\npreferred size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Measure begins :\nrequirement: {}\npreferred size: {}",
this->GetDebugPathInTree(), requirement.ToDebugString(),
preferred_size.ToDebugString());
}
@@ -127,7 +127,7 @@ void RenderObject::Measure(const MeasureRequirement& requirement,
desired_size_ = OnMeasureCore(merged_requirement, merged_preferred_size);
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Measure ends :\nresult size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Measure ends :\nresult size: {}",
this->GetDebugPathInTree(), desired_size_);
}
@@ -144,7 +144,7 @@ Size RenderObject::Measure1(const BoxConstraint& constraint) {
void RenderObject::Layout(const Point& offset) {
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Layout :\noffset: {} size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Layout :\noffset: {} size: {}",
this->GetDebugPathInTree(), offset, desired_size_);
}
offset_ = offset;
@@ -192,13 +192,13 @@ Size RenderObject::OnMeasureCore1(const BoxConstraint& constraint) {
if (space_size.width > merged_constraint.max.width) {
space_size.width = merged_constraint.max.width;
- CRU_LOG_WARN(u"{} space width is over constraint.max.width",
+ CRU_LOG_TAG_WARN(u"{} space width is over constraint.max.width",
this->GetDebugPathInTree());
}
if (space_size.height > merged_constraint.max.height) {
space_size.height = merged_constraint.max.height;
- CRU_LOG_WARN(u"{} space height is over constraint.max.height",
+ CRU_LOG_TAG_WARN(u"{} space height is over constraint.max.height",
this->GetDebugPathInTree());
}
diff --git a/src/ui/render/TextRenderObject.cpp b/src/ui/render/TextRenderObject.cpp
index 14e45080..8a579041 100644
--- a/src/ui/render/TextRenderObject.cpp
+++ b/src/ui/render/TextRenderObject.cpp
@@ -177,7 +177,7 @@ RenderObject* TextRenderObject::HitTest(const Point& point) {
void TextRenderObject::Draw(platform::graphics::IPainter* painter) {
if constexpr (debug_flags::draw) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Begin to paint, total_offset: {}, size: {}, text_layout: "
u"{}, brush: {}.",
this->GetTotalOffset(), this->GetDesiredSize(),