aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform')
-rw-r--r--include/cru/platform/native/base.hpp (renamed from include/cru/platform/native/basic_types.hpp)20
-rw-r--r--include/cru/platform/native/cursor.hpp7
-rw-r--r--include/cru/platform/native/event.hpp15
-rw-r--r--include/cru/platform/native/ui_application.hpp9
-rw-r--r--include/cru/platform/native/window.hpp12
5 files changed, 23 insertions, 40 deletions
diff --git a/include/cru/platform/native/basic_types.hpp b/include/cru/platform/native/base.hpp
index 84cc61d1..d62dc56b 100644
--- a/include/cru/platform/native/basic_types.hpp
+++ b/include/cru/platform/native/base.hpp
@@ -1,8 +1,15 @@
#pragma once
#include "cru/common/base.hpp"
#include "cru/common/bitmask.hpp"
+#include "cru/platform/graph/base.hpp"
namespace cru::platform::native {
+struct ICursor;
+struct ICursorManager;
+struct IUiApplication;
+struct INativeWindow;
+struct INativeWindowResolver;
+
struct Dpi {
float x;
float y;
@@ -20,4 +27,17 @@ constexpr MouseButton middle{0b10};
constexpr MouseButton right{0b100};
} // namespace mouse_buttons
+enum class SystemCursorType {
+ Arrow,
+ Hand,
+};
+
+struct NativeMouseButtonEventArgs {
+ MouseButton button;
+ Point point;
+};
+
+enum class FocusChangeType { Gain, Lost };
+
+enum class MouseEnterLeaveType { Enter, Leave };
} // namespace cru::platform::native
diff --git a/include/cru/platform/native/cursor.hpp b/include/cru/platform/native/cursor.hpp
index cb8b7ed2..eae51ffe 100644
--- a/include/cru/platform/native/cursor.hpp
+++ b/include/cru/platform/native/cursor.hpp
@@ -1,17 +1,12 @@
#pragma once
-
#include "../resource.hpp"
+#include "base.hpp"
#include <memory>
namespace cru::platform::native {
struct ICursor : virtual INativeResource {};
-enum class SystemCursorType {
- Arrow,
- Hand,
-};
-
struct ICursorManager : virtual INativeResource {
virtual std::shared_ptr<ICursor> GetSystemCursor(SystemCursorType type) = 0;
diff --git a/include/cru/platform/native/event.hpp b/include/cru/platform/native/event.hpp
deleted file mode 100644
index 48e9cfca..00000000
--- a/include/cru/platform/native/event.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-#include "../graph_base.hpp"
-#include "basic_types.hpp"
-
-namespace cru::platform::native {
-struct NativeMouseButtonEventArgs {
- MouseButton button;
- Point point;
-};
-
-enum class FocusChangeType { Gain, Lost };
-
-enum class MouseEnterLeaveType { Enter, Leave };
-} // namespace cru::platform::native
diff --git a/include/cru/platform/native/ui_application.hpp b/include/cru/platform/native/ui_application.hpp
index e02904bb..0825251e 100644
--- a/include/cru/platform/native/ui_application.hpp
+++ b/include/cru/platform/native/ui_application.hpp
@@ -1,20 +1,13 @@
#pragma once
#include "../resource.hpp"
+#include "base.hpp"
#include <chrono>
#include <functional>
#include <memory>
#include <vector>
-namespace cru::platform::graph {
-struct IGraphFactory;
-}
-
namespace cru::platform::native {
-struct INativeWindow;
-struct INativeWindowResolver;
-struct ICursorManager;
-
// The entry point of a ui application.
struct IUiApplication : public virtual INativeResource {
public:
diff --git a/include/cru/platform/native/window.hpp b/include/cru/platform/native/window.hpp
index 9f2e2e71..85f809e5 100644
--- a/include/cru/platform/native/window.hpp
+++ b/include/cru/platform/native/window.hpp
@@ -1,19 +1,9 @@
#pragma once
#include "../resource.hpp"
-
-#include "../graph_base.hpp"
-#include "basic_types.hpp"
+#include "base.hpp"
#include "cru/common/event.hpp"
-#include "cursor.hpp"
-#include "event.hpp"
-
-namespace cru::platform::graph {
-struct IPainter;
-}
namespace cru::platform::native {
-struct INativeWindowResolver;
-
// Represents a native window, which exposes some low-level events and
// operations.
//