aboutsummaryrefslogtreecommitdiff
path: root/include/cru
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-06-14 23:23:09 +0800
committercrupest <crupest@outlook.com>2019-06-14 23:23:09 +0800
commitbf7e486b8908ed494925ff9643b55ccafbfdc434 (patch)
tree87b512202a10cbf97224ab1ef670be168fe317ca /include/cru
parent5ec370e5f91ad8b5ed7717eb93f4e3240ea4e784 (diff)
downloadcru-bf7e486b8908ed494925ff9643b55ccafbfdc434.tar.gz
cru-bf7e486b8908ed494925ff9643b55ccafbfdc434.tar.bz2
cru-bf7e486b8908ed494925ff9643b55ccafbfdc434.zip
...
Diffstat (limited to 'include/cru')
-rw-r--r--include/cru/common/event.hpp3
-rw-r--r--include/cru/platform/native/native_window.hpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/cru/common/event.hpp b/include/cru/common/event.hpp
index af282c30..144513b6 100644
--- a/include/cru/common/event.hpp
+++ b/include/cru/common/event.hpp
@@ -79,6 +79,9 @@ inline EventRevoker details::EventBase::CreateRevoker(EventHandlerToken token) {
return EventRevoker(resolver_, token);
}
+// int -> int
+// Point -> const Point&
+// int& -> int&
template <typename TRaw>
using DeducedEventArgs = std::conditional_t<
std::is_lvalue_reference_v<TRaw>, TRaw,
diff --git a/include/cru/platform/native/native_window.hpp b/include/cru/platform/native/native_window.hpp
index 3e83a531..bb97ef21 100644
--- a/include/cru/platform/native/native_window.hpp
+++ b/include/cru/platform/native/native_window.hpp
@@ -11,6 +11,14 @@ struct IPainter;
}
namespace cru::platform::native {
+// Represents a native window, which exposes some low-level events and
+// operations.
+//
+// Although you can always retain an instance of this class, the real window
+// associated with it might be have already been destroyed by explicitly calling
+// Close or closed by the user, which leads to an invalid instance. You can
+// check the validity by IsValid. When you call perform native operations on the
+// invalid instance, there is no effect.
struct INativeWindow : public virtual Interface {
// Return if the window is still valid, that is, hasn't been closed or
// destroyed.