aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-03 20:04:52 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-03 20:04:52 +0800
commit06f16479ae1b727252404b763b60c924e3fe7903 (patch)
tree09cdf8e5e90ac85ea19840fad1a2cd149c1fc3f6
parent5b46d14997c2ff2244f303216e4e286665ac8a42 (diff)
downloadcru-06f16479ae1b727252404b763b60c924e3fe7903.tar.gz
cru-06f16479ae1b727252404b763b60c924e3fe7903.tar.bz2
cru-06f16479ae1b727252404b763b60c924e3fe7903.zip
Remove Object2.
-rw-r--r--demos/platform/graphics/Base.h2
-rw-r--r--include/cru/base/Base.h14
-rw-r--r--include/cru/base/PropertyTree.h2
-rw-r--r--include/cru/base/Timer.h2
-rw-r--r--include/cru/base/io/Stream.h3
-rw-r--r--include/cru/base/log/Logger.h4
-rw-r--r--include/cru/base/platform/unix/EventLoop.h4
-rw-r--r--include/cru/parse/Grammar.h4
-rw-r--r--include/cru/parse/Production.h4
-rw-r--r--include/cru/parse/Symbol.h4
-rw-r--r--include/cru/parse/TokenType.h4
-rw-r--r--include/cru/platform/graphics/NullPainter.h4
-rw-r--r--include/cru/platform/graphics/cairo/Base.h4
-rw-r--r--include/cru/platform/graphics/direct2d/Resource.h3
-rw-r--r--include/cru/platform/graphics/direct2d/WindowRenderTarget.h4
-rw-r--r--include/cru/platform/graphics/web_canvas/WebCanvasResource.h4
-rw-r--r--include/cru/platform/gui/win/GodWindow.h4
-rw-r--r--include/cru/platform/gui/win/InputMethod.h2
-rw-r--r--include/cru/platform/gui/win/Resource.h3
-rw-r--r--include/cru/platform/gui/win/WindowClass.h4
-rw-r--r--include/cru/platform/gui/win/WindowNativeMessageEventArgs.h5
-rw-r--r--include/cru/ui/ThemeManager.h3
-rw-r--r--include/cru/ui/ThemeResourceDictionary.h4
-rw-r--r--include/cru/ui/components/Component.h4
-rw-r--r--include/cru/ui/controls/Control.h4
-rw-r--r--include/cru/ui/controls/TextHostControlService.h11
-rw-r--r--include/cru/ui/controls/TreeView.h3
-rw-r--r--include/cru/ui/events/FocusChangeEventArgs.h5
-rw-r--r--include/cru/ui/events/KeyEventArgs.h5
-rw-r--r--include/cru/ui/events/MouseButtonEventArgs.h5
-rw-r--r--include/cru/ui/events/MouseEventArgs.h5
-rw-r--r--include/cru/ui/events/MouseWheelEventArgs.h5
-rw-r--r--include/cru/ui/events/PaintEventArgs.h5
-rw-r--r--include/cru/ui/events/UiEventArgs.h6
-rw-r--r--include/cru/ui/helper/ClickDetector.h4
-rw-r--r--include/cru/ui/helper/ShortcutHub.h4
-rw-r--r--include/cru/ui/host/WindowHost.h4
-rw-r--r--include/cru/ui/mapper/Mapper.h4
-rw-r--r--include/cru/ui/render/RenderObject.h2
-rw-r--r--include/cru/ui/render/ScrollBar.h8
-rw-r--r--include/cru/ui/render/TreeRenderObject.h2
-rw-r--r--include/cru/ui/style/StyleRule.h7
-rw-r--r--include/cru/ui/style/StyleRuleSet.h4
-rw-r--r--src/platform/gui/osx/ClipboardPrivate.h4
-rw-r--r--src/platform/gui/win/TimerManager.h4
-rw-r--r--src/platform/gui/win/WindowManager.h4
46 files changed, 13 insertions, 187 deletions
diff --git a/demos/platform/graphics/Base.h b/demos/platform/graphics/Base.h
index 6f4f4929..f3f2bb72 100644
--- a/demos/platform/graphics/Base.h
+++ b/demos/platform/graphics/Base.h
@@ -8,7 +8,7 @@
#include <memory>
#include <string>
-class CruPlatformGraphicsDemo : public cru::Object2 {
+class CruPlatformGraphicsDemo : public cru::Object {
public:
CruPlatformGraphicsDemo(std::string file_name, int width, int height);
~CruPlatformGraphicsDemo() override;
diff --git a/include/cru/base/Base.h b/include/cru/base/Base.h
index 28983469..6dfe995a 100644
--- a/include/cru/base/Base.h
+++ b/include/cru/base/Base.h
@@ -67,21 +67,11 @@ namespace cru {
class CRU_BASE_API Object {
public:
Object() = default;
- CRU_DEFAULT_COPY(Object)
- CRU_DEFAULT_MOVE(Object)
+ CRU_DELETE_COPY(Object)
+ CRU_DELETE_MOVE(Object)
virtual ~Object() = default;
};
-class CRU_BASE_API Object2 {
- public:
- Object2() = default;
- Object2(const Object2&) = delete;
- Object2& operator=(const Object2&) = delete;
- Object2(Object2&&) = delete;
- Object2& operator=(Object2&&) = delete;
- virtual ~Object2() = default;
-};
-
struct CRU_BASE_API Interface {
Interface() = default;
CRU_DELETE_COPY(Interface)
diff --git a/include/cru/base/PropertyTree.h b/include/cru/base/PropertyTree.h
index 8eecc3b9..47055c2a 100644
--- a/include/cru/base/PropertyTree.h
+++ b/include/cru/base/PropertyTree.h
@@ -33,7 +33,7 @@ class CRU_BASE_API PropertySubTreeRef {
std::string path_;
};
-class CRU_BASE_API PropertyTree : public Object2 {
+class CRU_BASE_API PropertyTree : public Object {
public:
static std::string CombineKey(std::string_view left, std::string_view right);
diff --git a/include/cru/base/Timer.h b/include/cru/base/Timer.h
index 6e34d9cb..7b467f18 100644
--- a/include/cru/base/Timer.h
+++ b/include/cru/base/Timer.h
@@ -12,7 +12,7 @@
namespace cru {
template <typename D>
-class TimerRegistry : public Object2 {
+class TimerRegistry : public Object {
private:
struct TimerData {
int id;
diff --git a/include/cru/base/io/Stream.h b/include/cru/base/io/Stream.h
index f082b490..54801f05 100644
--- a/include/cru/base/io/Stream.h
+++ b/include/cru/base/io/Stream.h
@@ -64,9 +64,6 @@ class CRU_BASE_API Stream : public Object {
public:
enum class SeekOrigin { Current, Begin, End };
- CRU_DELETE_COPY(Stream)
- CRU_DELETE_MOVE(Stream)
-
~Stream() override = default;
public:
diff --git a/include/cru/base/log/Logger.h b/include/cru/base/log/Logger.h
index f44bad72..8f7c32e0 100644
--- a/include/cru/base/log/Logger.h
+++ b/include/cru/base/log/Logger.h
@@ -30,7 +30,7 @@ struct CRU_BASE_API ILogTarget : virtual Interface {
virtual void Write(LogLevel level, std::string s) = 0;
};
-class CRU_BASE_API Logger : public Object2 {
+class CRU_BASE_API Logger : public Object {
public:
static Logger* GetInstance();
@@ -76,7 +76,7 @@ class CRU_BASE_API Logger : public Object2 {
std::vector<std::unique_ptr<ILogTarget>> target_list_;
};
-class CRU_BASE_API LoggerCppStream : public Object2 {
+class CRU_BASE_API LoggerCppStream : public Object {
public:
explicit LoggerCppStream(Logger* logger, LogLevel level, std::string tag);
~LoggerCppStream() override = default;
diff --git a/include/cru/base/platform/unix/EventLoop.h b/include/cru/base/platform/unix/EventLoop.h
index 697c6f37..0bc68138 100644
--- a/include/cru/base/platform/unix/EventLoop.h
+++ b/include/cru/base/platform/unix/EventLoop.h
@@ -17,7 +17,7 @@
#include <utility>
namespace cru::platform::unix {
-class UnixTimerFile : public Object2 {
+class UnixTimerFile : public Object {
public:
template <class Rep, class Period>
explicit UnixTimerFile(std::chrono::duration<Rep, Period> time) {
@@ -45,7 +45,7 @@ class UnixTimerFile : public Object2 {
std::thread thread_;
};
-class UnixEventLoop : public Object2 {
+class UnixEventLoop : public Object {
CRU_DEFINE_CLASS_LOG_TAG("cru::platform::unix::UnixEventLoop")
public:
using PollEvents = decltype(std::declval<pollfd>().events);
diff --git a/include/cru/parse/Grammar.h b/include/cru/parse/Grammar.h
index 522cc0fd..2bf79fe6 100644
--- a/include/cru/parse/Grammar.h
+++ b/include/cru/parse/Grammar.h
@@ -9,10 +9,6 @@ namespace cru::parse {
class CRU_PARSE_API Grammar : public Object {
public:
Grammar();
-
- CRU_DELETE_COPY(Grammar)
- CRU_DELETE_MOVE(Grammar)
-
~Grammar() override;
public:
diff --git a/include/cru/parse/Production.h b/include/cru/parse/Production.h
index 81236020..eb127893 100644
--- a/include/cru/parse/Production.h
+++ b/include/cru/parse/Production.h
@@ -9,10 +9,6 @@ class CRU_PARSE_API Production : public Object {
public:
Production(Grammar* grammar, std::string name, Nonterminal* left,
std::vector<Symbol*> right);
-
- CRU_DELETE_COPY(Production)
- CRU_DELETE_MOVE(Production)
-
~Production() override;
public:
diff --git a/include/cru/parse/Symbol.h b/include/cru/parse/Symbol.h
index d40243e7..d2691cdd 100644
--- a/include/cru/parse/Symbol.h
+++ b/include/cru/parse/Symbol.h
@@ -11,10 +11,6 @@ class Grammar;
class CRU_PARSE_API Symbol : public Object {
public:
explicit Symbol(Grammar* grammar, std::string name);
-
- CRU_DELETE_COPY(Symbol)
- CRU_DELETE_MOVE(Symbol)
-
~Symbol() override;
public:
diff --git a/include/cru/parse/TokenType.h b/include/cru/parse/TokenType.h
index a015a49b..44c515da 100644
--- a/include/cru/parse/TokenType.h
+++ b/include/cru/parse/TokenType.h
@@ -8,10 +8,6 @@ namespace cru::parse {
class CRU_PARSE_API TokenType : public Object {
public:
explicit TokenType(std::string name);
-
- CRU_DELETE_COPY(TokenType)
- CRU_DELETE_MOVE(TokenType)
-
~TokenType() override;
public:
diff --git a/include/cru/platform/graphics/NullPainter.h b/include/cru/platform/graphics/NullPainter.h
index 29ed8a3e..f335e16d 100644
--- a/include/cru/platform/graphics/NullPainter.h
+++ b/include/cru/platform/graphics/NullPainter.h
@@ -7,10 +7,6 @@ namespace cru::platform::graphics {
class NullPainter : public Object, public virtual IPainter {
public:
NullPainter() = default;
-
- CRU_DELETE_COPY(NullPainter)
- CRU_DELETE_MOVE(NullPainter)
-
~NullPainter() override = default;
public:
diff --git a/include/cru/platform/graphics/cairo/Base.h b/include/cru/platform/graphics/cairo/Base.h
index 4338d7f7..350c9ea4 100644
--- a/include/cru/platform/graphics/cairo/Base.h
+++ b/include/cru/platform/graphics/cairo/Base.h
@@ -26,10 +26,6 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoResource
public virtual IGraphicsResource {
public:
explicit CairoResource(CairoGraphicsFactory* factory);
-
- CRU_DELETE_COPY(CairoResource)
- CRU_DELETE_MOVE(CairoResource)
-
~CairoResource() override;
std::string GetPlatformId() const override;
diff --git a/include/cru/platform/graphics/direct2d/Resource.h b/include/cru/platform/graphics/direct2d/Resource.h
index ca67a463..b8dd42ab 100644
--- a/include/cru/platform/graphics/direct2d/Resource.h
+++ b/include/cru/platform/graphics/direct2d/Resource.h
@@ -18,9 +18,6 @@ class CRU_WIN_GRAPHICS_DIRECT_API DirectResource
DirectResource() = default;
public:
- CRU_DELETE_COPY(DirectResource)
- CRU_DELETE_MOVE(DirectResource)
-
~DirectResource() override = default;
public:
diff --git a/include/cru/platform/graphics/direct2d/WindowRenderTarget.h b/include/cru/platform/graphics/direct2d/WindowRenderTarget.h
index f77ce471..19b32df9 100644
--- a/include/cru/platform/graphics/direct2d/WindowRenderTarget.h
+++ b/include/cru/platform/graphics/direct2d/WindowRenderTarget.h
@@ -6,10 +6,6 @@ namespace cru::platform::graphics::direct2d {
class CRU_WIN_GRAPHICS_DIRECT_API D2DWindowRenderTarget : public Object {
public:
D2DWindowRenderTarget(DirectGraphicsFactory* factory, HWND hwnd);
-
- CRU_DELETE_COPY(D2DWindowRenderTarget)
- CRU_DELETE_MOVE(D2DWindowRenderTarget)
-
~D2DWindowRenderTarget() override = default;
public:
diff --git a/include/cru/platform/graphics/web_canvas/WebCanvasResource.h b/include/cru/platform/graphics/web_canvas/WebCanvasResource.h
index e3866f38..dbe83225 100644
--- a/include/cru/platform/graphics/web_canvas/WebCanvasResource.h
+++ b/include/cru/platform/graphics/web_canvas/WebCanvasResource.h
@@ -11,10 +11,6 @@ class WebCanvasResource : public Object, public virtual IPlatformResource {
static const std::string kPlatformId;
explicit WebCanvasResource(WebCanvasGraphicsFactory* factory);
-
- CRU_DELETE_COPY(WebCanvasResource)
- CRU_DELETE_MOVE(WebCanvasResource)
-
~WebCanvasResource() override;
public:
diff --git a/include/cru/platform/gui/win/GodWindow.h b/include/cru/platform/gui/win/GodWindow.h
index ceb6fe2d..439c0125 100644
--- a/include/cru/platform/gui/win/GodWindow.h
+++ b/include/cru/platform/gui/win/GodWindow.h
@@ -12,10 +12,6 @@ class CRU_WIN_GUI_API GodWindow : public Object {
public:
explicit GodWindow(WinUiApplication* application);
-
- CRU_DELETE_COPY(GodWindow)
- CRU_DELETE_MOVE(GodWindow)
-
~GodWindow() override;
HWND GetHandle() const { return hwnd_; }
diff --git a/include/cru/platform/gui/win/InputMethod.h b/include/cru/platform/gui/win/InputMethod.h
index a69490c7..ab11aafa 100644
--- a/include/cru/platform/gui/win/InputMethod.h
+++ b/include/cru/platform/gui/win/InputMethod.h
@@ -11,7 +11,7 @@
#include <imm.h>
namespace cru::platform::gui::win {
-class CRU_WIN_GUI_API AutoHIMC : public Object {
+class CRU_WIN_GUI_API AutoHIMC {
CRU_DEFINE_CLASS_LOG_TAG("AutoHIMC")
public:
diff --git a/include/cru/platform/gui/win/Resource.h b/include/cru/platform/gui/win/Resource.h
index 2e2a225c..98853ed7 100644
--- a/include/cru/platform/gui/win/Resource.h
+++ b/include/cru/platform/gui/win/Resource.h
@@ -13,9 +13,6 @@ class CRU_WIN_GUI_API WinNativeResource : public Object,
WinNativeResource() = default;
public:
- CRU_DELETE_COPY(WinNativeResource)
- CRU_DELETE_MOVE(WinNativeResource)
-
~WinNativeResource() override = default;
public:
diff --git a/include/cru/platform/gui/win/WindowClass.h b/include/cru/platform/gui/win/WindowClass.h
index 50729887..900595e6 100644
--- a/include/cru/platform/gui/win/WindowClass.h
+++ b/include/cru/platform/gui/win/WindowClass.h
@@ -7,10 +7,6 @@ namespace cru::platform::gui::win {
class CRU_WIN_GUI_API WindowClass : public Object {
public:
WindowClass(std::wstring name, WNDPROC window_proc, HINSTANCE h_instance);
-
- CRU_DELETE_COPY(WindowClass)
- CRU_DELETE_MOVE(WindowClass)
-
~WindowClass() override = default;
const wchar_t* GetName() const { return name_.c_str(); }
diff --git a/include/cru/platform/gui/win/WindowNativeMessageEventArgs.h b/include/cru/platform/gui/win/WindowNativeMessageEventArgs.h
index 1b5a233c..3a89b786 100644
--- a/include/cru/platform/gui/win/WindowNativeMessageEventArgs.h
+++ b/include/cru/platform/gui/win/WindowNativeMessageEventArgs.h
@@ -11,13 +11,10 @@ struct CRU_WIN_GUI_API WindowNativeMessage {
LPARAM l_param;
};
-class CRU_WIN_GUI_API WindowNativeMessageEventArgs : public Object {
+class CRU_WIN_GUI_API WindowNativeMessageEventArgs {
public:
WindowNativeMessageEventArgs(const WindowNativeMessage& message)
: message_(message) {}
- CRU_DEFAULT_COPY(WindowNativeMessageEventArgs)
- CRU_DEFAULT_MOVE(WindowNativeMessageEventArgs)
- ~WindowNativeMessageEventArgs() override = default;
const WindowNativeMessage& GetWindowMessage() const { return message_; }
diff --git a/include/cru/ui/ThemeManager.h b/include/cru/ui/ThemeManager.h
index 5e24a159..ab9efcff 100644
--- a/include/cru/ui/ThemeManager.h
+++ b/include/cru/ui/ThemeManager.h
@@ -15,9 +15,6 @@ class CRU_UI_API ThemeManager : public Object {
ThemeManager();
public:
- CRU_DELETE_COPY(ThemeManager)
- CRU_DELETE_MOVE(ThemeManager)
-
~ThemeManager() override;
std::vector<ThemeResourceDictionary*> GetThemeResourceDictionaryList() const;
diff --git a/include/cru/ui/ThemeResourceDictionary.h b/include/cru/ui/ThemeResourceDictionary.h
index e7463b12..f28a61db 100644
--- a/include/cru/ui/ThemeResourceDictionary.h
+++ b/include/cru/ui/ThemeResourceDictionary.h
@@ -32,10 +32,6 @@ class CRU_UI_API ThemeResourceDictionary : public Object {
explicit ThemeResourceDictionary(xml::XmlElementNode* xml_root,
bool clone = true);
-
- CRU_DELETE_COPY(ThemeResourceDictionary)
- CRU_DELETE_MOVE(ThemeResourceDictionary)
-
~ThemeResourceDictionary() override;
public:
diff --git a/include/cru/ui/components/Component.h b/include/cru/ui/components/Component.h
index ae742aae..d44e6728 100644
--- a/include/cru/ui/components/Component.h
+++ b/include/cru/ui/components/Component.h
@@ -14,10 +14,6 @@ class CRU_UI_API Component : public Object,
public DeleteLaterImpl {
public:
Component() = default;
-
- CRU_DELETE_COPY(Component)
- CRU_DELETE_MOVE(Component)
-
~Component() = default;
virtual controls::Control* GetRootControl() = 0;
diff --git a/include/cru/ui/controls/Control.h b/include/cru/ui/controls/Control.h
index 7301ecd8..d70854fe 100644
--- a/include/cru/ui/controls/Control.h
+++ b/include/cru/ui/controls/Control.h
@@ -29,10 +29,6 @@ class CRU_UI_API Control : public Object,
Control();
public:
- Control(const Control& other) = delete;
- Control(Control&& other) = delete;
- Control& operator=(const Control& other) = delete;
- Control& operator=(Control&& other) = delete;
~Control() override;
public:
diff --git a/include/cru/ui/controls/TextHostControlService.h b/include/cru/ui/controls/TextHostControlService.h
index a945e427..529225a7 100644
--- a/include/cru/ui/controls/TextHostControlService.h
+++ b/include/cru/ui/controls/TextHostControlService.h
@@ -30,7 +30,7 @@ struct CRU_UI_API ITextHostControl : virtual Interface {
class TextHostControlService;
-class TextControlMovePattern : public Object {
+class TextControlMovePattern {
public:
static TextControlMovePattern kLeft;
static TextControlMovePattern kRight;
@@ -57,11 +57,6 @@ class TextControlMovePattern : public Object {
key_bind_(key_bind),
move_function_(move_function) {}
- CRU_DEFAULT_COPY(TextControlMovePattern)
- CRU_DEFAULT_MOVE(TextControlMovePattern)
-
- ~TextControlMovePattern() override = default;
-
public:
std::string GetName() const { return name_; }
helper::ShortcutKeyBind GetKeyBind() const { return key_bind_; }
@@ -81,10 +76,6 @@ class CRU_UI_API TextHostControlService : public Object {
public:
TextHostControlService(Control* control);
-
- CRU_DELETE_COPY(TextHostControlService)
- CRU_DELETE_MOVE(TextHostControlService)
-
~TextHostControlService();
public:
diff --git a/include/cru/ui/controls/TreeView.h b/include/cru/ui/controls/TreeView.h
index dc74750a..f4938259 100644
--- a/include/cru/ui/controls/TreeView.h
+++ b/include/cru/ui/controls/TreeView.h
@@ -14,9 +14,6 @@ class CRU_UI_API TreeViewItem : public Object {
~TreeViewItem() override;
public:
- CRU_DELETE_COPY(TreeViewItem)
- CRU_DELETE_MOVE(TreeViewItem)
-
TreeView* GetTreeView() { return tree_view_; }
TreeViewItem* GetParent() { return parent_; }
diff --git a/include/cru/ui/events/FocusChangeEventArgs.h b/include/cru/ui/events/FocusChangeEventArgs.h
index aaef25b4..922803b9 100644
--- a/include/cru/ui/events/FocusChangeEventArgs.h
+++ b/include/cru/ui/events/FocusChangeEventArgs.h
@@ -8,11 +8,6 @@ class CRU_UI_API FocusChangeEventArgs : public UiEventArgs {
FocusChangeEventArgs(Object* sender, Object* original_sender,
const bool is_window = false)
: UiEventArgs(sender, original_sender), is_window_(is_window) {}
- FocusChangeEventArgs(const FocusChangeEventArgs& other) = default;
- FocusChangeEventArgs(FocusChangeEventArgs&& other) = default;
- FocusChangeEventArgs& operator=(const FocusChangeEventArgs& other) = default;
- FocusChangeEventArgs& operator=(FocusChangeEventArgs&& other) = default;
- ~FocusChangeEventArgs() override = default;
// Return whether the focus change is caused by the window-wide focus change.
bool IsWindow() const { return is_window_; }
diff --git a/include/cru/ui/events/KeyEventArgs.h b/include/cru/ui/events/KeyEventArgs.h
index bf6c8c0f..b0d6b769 100644
--- a/include/cru/ui/events/KeyEventArgs.h
+++ b/include/cru/ui/events/KeyEventArgs.h
@@ -12,11 +12,6 @@ class CRU_UI_API KeyEventArgs : public UiEventArgs {
: UiEventArgs(sender, original_sender),
key_code_(key_code),
key_modifier_(key_modifier) {}
- KeyEventArgs(const KeyEventArgs& other) = default;
- KeyEventArgs(KeyEventArgs&& other) = default;
- KeyEventArgs& operator=(const KeyEventArgs& other) = default;
- KeyEventArgs& operator=(KeyEventArgs&& other) = default;
- ~KeyEventArgs() override = default;
platform::gui::KeyCode GetKeyCode() const { return key_code_; }
platform::gui::KeyModifier GetKeyModifier() const { return key_modifier_; }
diff --git a/include/cru/ui/events/MouseButtonEventArgs.h b/include/cru/ui/events/MouseButtonEventArgs.h
index 57a84cfb..99e95020 100644
--- a/include/cru/ui/events/MouseButtonEventArgs.h
+++ b/include/cru/ui/events/MouseButtonEventArgs.h
@@ -20,11 +20,6 @@ class CRU_UI_API MouseButtonEventArgs : public MouseEventArgs {
: MouseEventArgs(sender, original_sender),
button_(button),
key_modifier_(key_modifier) {}
- MouseButtonEventArgs(const MouseButtonEventArgs& other) = default;
- MouseButtonEventArgs(MouseButtonEventArgs&& other) = default;
- MouseButtonEventArgs& operator=(const MouseButtonEventArgs& other) = default;
- MouseButtonEventArgs& operator=(MouseButtonEventArgs&& other) = default;
- ~MouseButtonEventArgs() override = default;
platform::gui::MouseButton GetButton() const { return button_; }
platform::gui::KeyModifier GetKeyModifier() const { return key_modifier_; }
diff --git a/include/cru/ui/events/MouseEventArgs.h b/include/cru/ui/events/MouseEventArgs.h
index 1320002d..081b3a6d 100644
--- a/include/cru/ui/events/MouseEventArgs.h
+++ b/include/cru/ui/events/MouseEventArgs.h
@@ -11,11 +11,6 @@ class CRU_UI_API MouseEventArgs : public UiEventArgs {
MouseEventArgs(Object* sender, Object* original_sender,
const std::optional<Point>& point = std::nullopt)
: UiEventArgs(sender, original_sender), point_(point) {}
- MouseEventArgs(const MouseEventArgs& other) = default;
- MouseEventArgs(MouseEventArgs&& other) = default;
- MouseEventArgs& operator=(const MouseEventArgs& other) = default;
- MouseEventArgs& operator=(MouseEventArgs&& other) = default;
- ~MouseEventArgs() override = default;
// This point is relative to window client lefttop.
Point GetPoint() const { return point_.value_or(Point{}); }
diff --git a/include/cru/ui/events/MouseWheelEventArgs.h b/include/cru/ui/events/MouseWheelEventArgs.h
index 9ed63924..3287122c 100644
--- a/include/cru/ui/events/MouseWheelEventArgs.h
+++ b/include/cru/ui/events/MouseWheelEventArgs.h
@@ -12,11 +12,6 @@ class CRU_UI_API MouseWheelEventArgs : public MouseEventArgs {
: MouseEventArgs(sender, original_sender, point),
delta_(delta),
key_modifier_(key_modifier) {}
- MouseWheelEventArgs(const MouseWheelEventArgs& other) = default;
- MouseWheelEventArgs(MouseWheelEventArgs&& other) = default;
- MouseWheelEventArgs& operator=(const MouseWheelEventArgs& other) = default;
- MouseWheelEventArgs& operator=(MouseWheelEventArgs&& other) = default;
- ~MouseWheelEventArgs() override = default;
// Positive means down; Negative means up.
float GetDelta() const { return delta_; }
diff --git a/include/cru/ui/events/PaintEventArgs.h b/include/cru/ui/events/PaintEventArgs.h
index 934c6c8c..823bb222 100644
--- a/include/cru/ui/events/PaintEventArgs.h
+++ b/include/cru/ui/events/PaintEventArgs.h
@@ -11,11 +11,6 @@ class CRU_UI_API PaintEventArgs : public UiEventArgs {
PaintEventArgs(Object* sender, Object* original_sender,
platform::graphics::IPainter* painter)
: UiEventArgs(sender, original_sender), painter_(painter) {}
- PaintEventArgs(const PaintEventArgs& other) = default;
- PaintEventArgs(PaintEventArgs&& other) = default;
- PaintEventArgs& operator=(const PaintEventArgs& other) = default;
- PaintEventArgs& operator=(PaintEventArgs&& other) = default;
- ~PaintEventArgs() = default;
platform::graphics::IPainter* GetPainter() const { return painter_; }
diff --git a/include/cru/ui/events/UiEventArgs.h b/include/cru/ui/events/UiEventArgs.h
index fff84edd..bf8937ca 100644
--- a/include/cru/ui/events/UiEventArgs.h
+++ b/include/cru/ui/events/UiEventArgs.h
@@ -7,12 +7,6 @@ class CRU_UI_API UiEventArgs : public Object {
UiEventArgs(Object* sender, Object* original_sender)
: sender_(sender), original_sender_(original_sender), handled_(false) {}
- UiEventArgs(const UiEventArgs& other) = default;
- UiEventArgs(UiEventArgs&& other) = default;
- UiEventArgs& operator=(const UiEventArgs& other) = default;
- UiEventArgs& operator=(UiEventArgs&& other) = default;
- ~UiEventArgs() override = default;
-
Object* GetSender() const { return sender_; }
Object* GetOriginalSender() const { return original_sender_; }
diff --git a/include/cru/ui/helper/ClickDetector.h b/include/cru/ui/helper/ClickDetector.h
index b83f0e20..037b015e 100644
--- a/include/cru/ui/helper/ClickDetector.h
+++ b/include/cru/ui/helper/ClickDetector.h
@@ -45,10 +45,6 @@ class ClickDetector : public Object {
public:
explicit ClickDetector(controls::Control* control);
-
- CRU_DELETE_COPY(ClickDetector)
- CRU_DELETE_MOVE(ClickDetector)
-
~ClickDetector() override = default;
controls::Control* GetControl() const { return control_; }
diff --git a/include/cru/ui/helper/ShortcutHub.h b/include/cru/ui/helper/ShortcutHub.h
index a5973ab5..d2c9952b 100644
--- a/include/cru/ui/helper/ShortcutHub.h
+++ b/include/cru/ui/helper/ShortcutHub.h
@@ -97,10 +97,6 @@ class CRU_UI_API ShortcutHub : public Object {
CRU_DEFINE_CLASS_LOG_TAG("ShortcutHub")
public:
ShortcutHub() = default;
-
- CRU_DELETE_COPY(ShortcutHub)
- CRU_DELETE_MOVE(ShortcutHub)
-
~ShortcutHub() override = default;
int RegisterShortcut(std::string name, ShortcutKeyBind bind,
diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h
index e2391125..6e7a0f2e 100644
--- a/include/cru/ui/host/WindowHost.h
+++ b/include/cru/ui/host/WindowHost.h
@@ -31,10 +31,6 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable<WindowHost> {
public:
explicit WindowHost(controls::Control* root_control);
-
- CRU_DELETE_COPY(WindowHost)
- CRU_DELETE_MOVE(WindowHost)
-
~WindowHost() override;
public:
diff --git a/include/cru/ui/mapper/Mapper.h b/include/cru/ui/mapper/Mapper.h
index 709288f5..a4507fc9 100644
--- a/include/cru/ui/mapper/Mapper.h
+++ b/include/cru/ui/mapper/Mapper.h
@@ -17,10 +17,6 @@ class BasicMapper;
class CRU_UI_API MapperBase : public Object {
public:
explicit MapperBase(std::type_index type_index);
-
- CRU_DELETE_COPY(MapperBase)
- CRU_DELETE_MOVE(MapperBase)
-
~MapperBase() override = default;
public:
diff --git a/include/cru/ui/render/RenderObject.h b/include/cru/ui/render/RenderObject.h
index 266045e3..34761b51 100644
--- a/include/cru/ui/render/RenderObject.h
+++ b/include/cru/ui/render/RenderObject.h
@@ -66,8 +66,6 @@ class CRU_UI_API RenderObject : public Object {
RenderObject() = default;
public:
- CRU_DELETE_COPY(RenderObject)
- CRU_DELETE_MOVE(RenderObject)
~RenderObject() override = default;
controls::Control* GetAttachedControl() const { return control_; }
diff --git a/include/cru/ui/render/ScrollBar.h b/include/cru/ui/render/ScrollBar.h
index fbe14244..8c531489 100644
--- a/include/cru/ui/render/ScrollBar.h
+++ b/include/cru/ui/render/ScrollBar.h
@@ -45,10 +45,6 @@ std::string CRU_UI_API GenerateScrollBarThemeColorKey(ScrollBarBrushUsageKind us
class CRU_UI_API ScrollBar : public Object {
public:
ScrollBar(ScrollRenderObject* render_object, Direction direction);
-
- CRU_DELETE_COPY(ScrollBar)
- CRU_DELETE_MOVE(ScrollBar)
-
~ScrollBar() override;
public:
@@ -213,10 +209,6 @@ class CRU_UI_API VerticalScrollBar : public ScrollBar {
class CRU_UI_API ScrollBarDelegate : public Object {
public:
explicit ScrollBarDelegate(ScrollRenderObject* render_object);
-
- CRU_DELETE_COPY(ScrollBarDelegate)
- CRU_DELETE_MOVE(ScrollBarDelegate)
-
~ScrollBarDelegate() override = default;
public:
diff --git a/include/cru/ui/render/TreeRenderObject.h b/include/cru/ui/render/TreeRenderObject.h
index 9cb8581e..de6e6f9b 100644
--- a/include/cru/ui/render/TreeRenderObject.h
+++ b/include/cru/ui/render/TreeRenderObject.h
@@ -13,8 +13,6 @@ class CRU_UI_API TreeRenderObjectItem : public Object {
TreeRenderObjectItem* parent);
public:
- CRU_DELETE_COPY(TreeRenderObjectItem)
- CRU_DELETE_MOVE(TreeRenderObjectItem)
~TreeRenderObjectItem() override;
RenderObject* GetRenderObject() { return render_object_; }
diff --git a/include/cru/ui/style/StyleRule.h b/include/cru/ui/style/StyleRule.h
index e7f4d390..382cd664 100644
--- a/include/cru/ui/style/StyleRule.h
+++ b/include/cru/ui/style/StyleRule.h
@@ -9,7 +9,7 @@ namespace cru::ui::style {
* \brief An immutable style rule contains a condition and a styler.
* \remarks This class is immutable and has value semantics.
*/
-class CRU_UI_API StyleRule : public Object {
+class CRU_UI_API StyleRule {
public:
static ClonablePtr<StyleRule> Create(ClonablePtr<Condition> condition,
ClonablePtr<Styler> styler,
@@ -21,11 +21,6 @@ class CRU_UI_API StyleRule : public Object {
StyleRule(ClonablePtr<Condition> condition, ClonablePtr<Styler> styler,
std::string name = {});
- CRU_DEFAULT_COPY(StyleRule)
- CRU_DEFAULT_MOVE(StyleRule)
-
- ~StyleRule() override = default;
-
public:
std::string GetName() const { return name_; }
Condition* GetCondition() const { return condition_.get(); }
diff --git a/include/cru/ui/style/StyleRuleSet.h b/include/cru/ui/style/StyleRuleSet.h
index fae9ab5f..0b7a237d 100644
--- a/include/cru/ui/style/StyleRuleSet.h
+++ b/include/cru/ui/style/StyleRuleSet.h
@@ -17,10 +17,6 @@ class CRU_UI_API StyleRuleSet : public Object, public model::IListChangeNotify {
public:
StyleRuleSet() = default;
explicit StyleRuleSet(std::shared_ptr<StyleRuleSet> parent);
-
- CRU_DELETE_COPY(StyleRuleSet)
- CRU_DELETE_MOVE(StyleRuleSet)
-
~StyleRuleSet() override = default;
public:
diff --git a/src/platform/gui/osx/ClipboardPrivate.h b/src/platform/gui/osx/ClipboardPrivate.h
index 5019ba17..7078e24e 100644
--- a/src/platform/gui/osx/ClipboardPrivate.h
+++ b/src/platform/gui/osx/ClipboardPrivate.h
@@ -10,10 +10,6 @@ class OsxClipboardPrivate : public Object {
CRU_DEFINE_CLASS_LOG_TAG("OsxClipboardPrivate")
public:
explicit OsxClipboardPrivate(NSPasteboard* pasteboard);
-
- CRU_DELETE_COPY(OsxClipboardPrivate)
- CRU_DELETE_MOVE(OsxClipboardPrivate)
-
~OsxClipboardPrivate();
public:
diff --git a/src/platform/gui/win/TimerManager.h b/src/platform/gui/win/TimerManager.h
index 2492a048..d5a07f7f 100644
--- a/src/platform/gui/win/TimerManager.h
+++ b/src/platform/gui/win/TimerManager.h
@@ -30,10 +30,6 @@ struct TimerInfo {
class TimerManager : public Object {
public:
TimerManager(GodWindow* god_window);
-
- CRU_DELETE_COPY(TimerManager)
- CRU_DELETE_MOVE(TimerManager)
-
~TimerManager() override = default;
// Period is in milliseconds. When type is immediate, it is not checked and
diff --git a/src/platform/gui/win/WindowManager.h b/src/platform/gui/win/WindowManager.h
index 062f2002..1bbcd25e 100644
--- a/src/platform/gui/win/WindowManager.h
+++ b/src/platform/gui/win/WindowManager.h
@@ -15,10 +15,6 @@ class WindowClass;
class WindowManager : public Object {
public:
WindowManager(WinUiApplication* application);
-
- CRU_DELETE_COPY(WindowManager)
- CRU_DELETE_MOVE(WindowManager)
-
~WindowManager() override;
// Get the general window class for creating ordinary window.