aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/native_window.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-31 17:14:47 +0800
committercrupest <crupest@outlook.com>2019-03-31 17:14:47 +0800
commitfbfd90255731954fb80483f4ba7188d3611fafec (patch)
tree8e3283c911d7aec76130d6a1dc7f5d8a85512b59 /include/cru/platform/native_window.hpp
parent877f65e2e2c40eecc7cfeb194dc9d391af60711b (diff)
downloadcru-fbfd90255731954fb80483f4ba7188d3611fafec.tar.gz
cru-fbfd90255731954fb80483f4ba7188d3611fafec.tar.bz2
cru-fbfd90255731954fb80483f4ba7188d3611fafec.zip
...
Diffstat (limited to 'include/cru/platform/native_window.hpp')
-rw-r--r--include/cru/platform/native_window.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/cru/platform/native_window.hpp b/include/cru/platform/native_window.hpp
new file mode 100644
index 00000000..1ed9a25e
--- /dev/null
+++ b/include/cru/platform/native_window.hpp
@@ -0,0 +1,31 @@
+#pragma once
+#include "cru/common/base.hpp"
+#include "cru/common/ui_base.hpp"
+
+namespace cru::platform {
+struct Painter;
+
+struct NativeWindow : public virtual Interface {
+ virtual bool IsValid() = 0;
+
+ virtual void Close() = 0;
+
+ virtual NativeWindow* GetParent() = 0;
+
+ virtual bool IsVisible() const = 0;
+ virtual void SetVisible(bool is_visible) = 0;
+
+ virtual ui::Size GetClientSize() = 0;
+ virtual void SetClientSize(const ui::Size& size) = 0;
+
+ // Get the rect of the window containing frame.
+ // The lefttop of the rect is relative to screen lefttop.
+ virtual ui::Rect GetWindowRect() = 0;
+
+ // Set the rect of the window containing frame.
+ // The lefttop of the rect is relative to screen lefttop.
+ virtual void SetWindowRect(const ui::Rect& rect) = 0;
+
+ virtual Painter* GetPainter() = 0;
+};
+} // namespace cru::platform