aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/controls/Button.h2
-rw-r--r--include/cru/ui/controls/IconButton.h5
-rw-r--r--include/cru/ui/controls/RootControl.h2
-rw-r--r--include/cru/ui/controls/TextHostControlService.h4
-rw-r--r--include/cru/ui/events/RoutedEvent.h2
-rw-r--r--include/cru/ui/helper/ClickDetector.h6
-rw-r--r--include/cru/ui/helper/ShortcutHub.h2
-rw-r--r--include/cru/ui/host/WindowHost.h2
-rw-r--r--include/cru/ui/render/ScrollBar.h2
-rw-r--r--include/cru/ui/render/ScrollRenderObject.h2
-rw-r--r--include/cru/ui/style/StyleRuleSet.h4
11 files changed, 17 insertions, 16 deletions
diff --git a/include/cru/ui/controls/Button.h b/include/cru/ui/controls/Button.h
index 3c01be32..e8fa50f1 100644
--- a/include/cru/ui/controls/Button.h
+++ b/include/cru/ui/controls/Button.h
@@ -33,7 +33,7 @@ class CRU_UI_API Button : public SingleChildControl<render::BorderRenderObject>,
return click_detector_.StateChangeEvent();
}
- IEvent<helper::ClickEventArgs>* ClickEvent() {
+ IEvent<const helper::ClickEventArgs&>* ClickEvent() {
return click_detector_.ClickEvent();
}
diff --git a/include/cru/ui/controls/IconButton.h b/include/cru/ui/controls/IconButton.h
index 9e7572e0..e52d2a26 100644
--- a/include/cru/ui/controls/IconButton.h
+++ b/include/cru/ui/controls/IconButton.h
@@ -39,7 +39,7 @@ class CRU_UI_API IconButton : public NoChildControl,
return click_detector_.StateChangeEvent();
}
- IEvent<helper::ClickEventArgs>* ClickEvent() {
+ IEvent<const helper::ClickEventArgs&>* ClickEvent() {
return click_detector_.ClickEvent();
}
@@ -87,7 +87,8 @@ class CRU_UI_API IconButton : public NoChildControl,
void SetIconWithSvgPathDataString(std::string_view icon_svg_path_data_string,
const Rect& view_port);
void SetIconWithSvgPathDataStringResourceKey(
- std::string_view icon_svg_path_data_string_resource_key, const Rect& view_port);
+ std::string_view icon_svg_path_data_string_resource_key,
+ const Rect& view_port);
std::shared_ptr<platform::graphics::IBrush> GetContentBrush() const override {
return GetIconFillBrush();
diff --git a/include/cru/ui/controls/RootControl.h b/include/cru/ui/controls/RootControl.h
index 5fa8090e..e662b655 100644
--- a/include/cru/ui/controls/RootControl.h
+++ b/include/cru/ui/controls/RootControl.h
@@ -28,7 +28,7 @@ class CRU_UI_API RootControl
Control* attached_control_;
- EventRevokerListGuard
+ EventHandlerRevokerListGuard
gain_focus_on_create_and_destroy_when_lose_focus_event_guard_;
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/TextHostControlService.h b/include/cru/ui/controls/TextHostControlService.h
index 529225a7..a9f4f22b 100644
--- a/include/cru/ui/controls/TextHostControlService.h
+++ b/include/cru/ui/controls/TextHostControlService.h
@@ -187,8 +187,8 @@ class CRU_UI_API TextHostControlService : public Object {
Event<std::nullptr_t> text_change_event_;
- EventRevokerListGuard event_guard_;
- EventRevokerListGuard input_method_context_event_guard_;
+ EventHandlerRevokerListGuard event_guard_;
+ EventHandlerRevokerListGuard input_method_context_event_guard_;
std::string text_;
TextRange selection_;
diff --git a/include/cru/ui/events/RoutedEvent.h b/include/cru/ui/events/RoutedEvent.h
index a01839a6..9a07e1e9 100644
--- a/include/cru/ui/events/RoutedEvent.h
+++ b/include/cru/ui/events/RoutedEvent.h
@@ -16,7 +16,7 @@ class CRU_UI_API RoutedEvent {
using RawEventArgs = TEventArgs;
using IEventType = IEvent<TEventArgs&>;
- using EventArgs = typename IEventType::EventArgs;
+ using EventArgs = typename IEventType::Args;
RoutedEvent() = default;
RoutedEvent(const RoutedEvent& other) = delete;
diff --git a/include/cru/ui/helper/ClickDetector.h b/include/cru/ui/helper/ClickDetector.h
index eaf1f4af..2eb453d9 100644
--- a/include/cru/ui/helper/ClickDetector.h
+++ b/include/cru/ui/helper/ClickDetector.h
@@ -57,7 +57,7 @@ class ClickDetector : public Object {
// deactivated.
void SetTriggerButton(MouseButton trigger_button);
- IEvent<ClickEventArgs>* ClickEvent() { return &event_; }
+ IEvent<const ClickEventArgs&>* ClickEvent() { return &event_; }
IEvent<ClickState>* StateChangeEvent() { return &state_change_event_; }
@@ -72,10 +72,10 @@ class ClickDetector : public Object {
bool enable_ = true;
MouseButton trigger_button_ = MouseButtons::Left | MouseButtons::Right;
- Event<ClickEventArgs> event_;
+ Event<const ClickEventArgs&> event_;
Event<ClickState> state_change_event_;
- std::vector<EventRevokerGuard> event_rovoker_guards_;
+ std::vector<EventHandlerRevokerGuard> event_rovoker_guards_;
Point down_point_;
MouseButton button_;
diff --git a/include/cru/ui/helper/ShortcutHub.h b/include/cru/ui/helper/ShortcutHub.h
index d2c9952b..1b600c48 100644
--- a/include/cru/ui/helper/ShortcutHub.h
+++ b/include/cru/ui/helper/ShortcutHub.h
@@ -131,6 +131,6 @@ class CRU_UI_API ShortcutHub : public Object {
Event<events::KeyEventArgs&> fallback_event_;
- EventRevokerListGuard event_guard_;
+ EventHandlerRevokerListGuard event_guard_;
};
} // namespace cru::ui::helper
diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h
index 6e7a0f2e..889665d5 100644
--- a/include/cru/ui/host/WindowHost.h
+++ b/include/cru/ui/host/WindowHost.h
@@ -156,7 +156,7 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable<WindowHost> {
Event<AfterLayoutEventArgs> after_layout_event_;
std::vector<std::function<void()> > after_layout_stable_action_;
- std::vector<EventRevokerGuard> event_revoker_guards_;
+ std::vector<EventHandlerRevokerGuard> event_revoker_guards_;
controls::Control* mouse_hover_control_ = nullptr;
diff --git a/include/cru/ui/render/ScrollBar.h b/include/cru/ui/render/ScrollBar.h
index 8c531489..50b21386 100644
--- a/include/cru/ui/render/ScrollBar.h
+++ b/include/cru/ui/render/ScrollBar.h
@@ -136,7 +136,7 @@ class CRU_UI_API ScrollBar : public Object {
std::optional<ScrollBarAreaKind> mouse_hover_;
std::optional<ScrollBarAreaKind> mouse_press_;
- EventRevokerListGuard event_guard_;
+ EventHandlerRevokerListGuard event_guard_;
Event<Scroll> scroll_attempt_event_;
diff --git a/include/cru/ui/render/ScrollRenderObject.h b/include/cru/ui/render/ScrollRenderObject.h
index 63a49aa3..348d7af1 100644
--- a/include/cru/ui/render/ScrollRenderObject.h
+++ b/include/cru/ui/render/ScrollRenderObject.h
@@ -95,6 +95,6 @@ class CRU_UI_API ScrollRenderObject : public SingleChildRenderObject {
bool is_mouse_wheel_enabled_ = true;
- EventRevokerListGuard guard_;
+ EventHandlerRevokerListGuard guard_;
};
} // namespace cru::ui::render
diff --git a/include/cru/ui/style/StyleRuleSet.h b/include/cru/ui/style/StyleRuleSet.h
index 0b7a237d..d89c3ae1 100644
--- a/include/cru/ui/style/StyleRuleSet.h
+++ b/include/cru/ui/style/StyleRuleSet.h
@@ -63,7 +63,7 @@ class CRU_UI_API StyleRuleSet : public Object, public model::IListChangeNotify {
Event<model::ListChange> list_change_event_;
std::shared_ptr<StyleRuleSet> parent_ = nullptr;
- EventRevokerGuard parent_change_event_guard_;
+ EventHandlerRevokerGuard parent_change_event_guard_;
std::vector<StyleRule> rules_;
};
@@ -90,6 +90,6 @@ class CRU_UI_API StyleRuleSetBind {
// child first, parent last.
std::vector<StyleRuleSet*> ruleset_chain_cache_;
- EventRevokerListGuard guard_;
+ EventHandlerRevokerListGuard guard_;
};
} // namespace cru::ui::style