aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/host
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-20 22:43:30 +0800
committercrupest <crupest@outlook.com>2021-11-20 22:43:30 +0800
commita60910cb3db6f47fd8f3b7f31648a9d0514d4f2c (patch)
tree32c01c22e21742ae0c9febb2cbc26339f99eec1d /include/cru/ui/host
parent1a53ed0791d9793ed8030d3a44e833e5e7c4542b (diff)
downloadcru-a60910cb3db6f47fd8f3b7f31648a9d0514d4f2c.tar.gz
cru-a60910cb3db6f47fd8f3b7f31648a9d0514d4f2c.tar.bz2
cru-a60910cb3db6f47fd8f3b7f31648a9d0514d4f2c.zip
...
Diffstat (limited to 'include/cru/ui/host')
-rw-r--r--include/cru/ui/host/WindowHost.hpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp
index f3caeeef..6fb853b6 100644
--- a/include/cru/ui/host/WindowHost.hpp
+++ b/include/cru/ui/host/WindowHost.hpp
@@ -30,7 +30,7 @@ class WindowHost : public Object {
CRU_DEFINE_CLASS_LOG_TAG(u"cru::ui::host::WindowHost")
public:
- WindowHost(controls::Control* root_control);
+ WindowHost(controls::Control* root_control, CreateWindowParams params);
CRU_DELETE_COPY(WindowHost)
CRU_DELETE_MOVE(WindowHost)
@@ -40,10 +40,6 @@ class WindowHost : public Object {
public:
platform::gui::INativeWindow* GetNativeWindow() { return native_window_; }
- // Do nothing if native window is already created.
- gsl::not_null<platform::gui::INativeWindow*> CreateNativeWindow(
- CreateWindowParams create_window_params = {});
-
// Mark the layout as invalid, and arrange a re-layout later.
// This method could be called more than one times in a message cycle. But
// layout only takes place once.
@@ -112,18 +108,13 @@ class WindowHost : public Object {
return &native_window_change_event_;
}
- // If window exist, return window actual size. Otherwise if saved rect exists,
- // return it. Otherwise return 0.
- Rect GetWindowRect();
-
- void SetSavedWindowRect(std::optional<Rect> rect);
-
- void SetWindowRect(const Rect& rect);
-
std::shared_ptr<platform::gui::ICursor> GetOverrideCursor();
void SetOverrideCursor(std::shared_ptr<platform::gui::ICursor> cursor);
private:
+ gsl::not_null<platform::gui::INativeWindow*> CreateNativeWindow(
+ CreateWindowParams params);
+
//*************** region: native messages ***************
void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t);
void OnNativePaint(platform::gui::INativeWindow* window, std::nullptr_t);
@@ -178,8 +169,6 @@ class WindowHost : public Object {
Event<platform::gui::INativeWindow*> native_window_change_event_;
- std::optional<Rect> saved_rect_;
-
std::shared_ptr<platform::gui::ICursor> override_cursor_;
};
} // namespace cru::ui::host