aboutsummaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-09-15 00:03:11 +0800
committer杨宇千 <crupest@outlook.com>2019-09-15 00:03:11 +0800
commit73f13dd60f51ff05e31a64fba89fe31ab3ab185d (patch)
treed674041629f328c2357ed85e3e564dec06757f3a /src/platform
parent401ca68f7d9d62d195c558edfeda4ece985805e1 (diff)
downloadcru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.tar.gz
cru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.tar.bz2
cru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.zip
...
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/CMakeLists.txt14
-rw-r--r--src/platform/graph/CMakeLists.txt12
-rw-r--r--src/platform/native/CMakeLists.txt12
-rw-r--r--src/platform/native/cursor.cpp10
4 files changed, 48 insertions, 0 deletions
diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt
new file mode 100644
index 00000000..c9eef482
--- /dev/null
+++ b/src/platform/CMakeLists.txt
@@ -0,0 +1,14 @@
+set(CRU_PLATFORM_BASE_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/platform)
+add_library(cru_platform_base INTERFACE)
+target_sources(cru_platform_base INTERFACE
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/exception.hpp
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/graphic_base.hpp
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/heap_debug.hpp
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/matrix.hpp
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/native_resource.hpp
+ ${CRU_PLATFORM_BASE_INCLUDE_DIR}/string_util.hpp
+)
+target_link_libraries(cru_platform_base INTERFACE cru_base)
+
+add_subdirectory(graph)
+add_subdirectory(native)
diff --git a/src/platform/graph/CMakeLists.txt b/src/platform/graph/CMakeLists.txt
new file mode 100644
index 00000000..da76d296
--- /dev/null
+++ b/src/platform/graph/CMakeLists.txt
@@ -0,0 +1,12 @@
+set(CRU_PLATFORM_GRAPH_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/platform/graph)
+add_library(cru_platform_graph INTERFACE)
+target_sources(cru_platform_graph INTERFACE
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/brush.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/font.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/geometry.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/graph_factory.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/painter.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/text_layout.hpp
+ ${CRU_PLATFORM_GRAPH_INCLUDE_DIR}/util/painter_util.hpp
+)
+target_link_libraries(cru_platform_graph INTERFACE cru_platform_base)
diff --git a/src/platform/native/CMakeLists.txt b/src/platform/native/CMakeLists.txt
new file mode 100644
index 00000000..0e44fd55
--- /dev/null
+++ b/src/platform/native/CMakeLists.txt
@@ -0,0 +1,12 @@
+set(CRU_PLATFORM_NATIVE_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/platform/native)
+add_library(cru_platform_native STATIC
+ cursor.cpp
+)
+target_sources(cru_platform_native PUBLIC
+ ${CRU_PLATFORM_NATIVE_INCLUDE_DIR}/basic_types.hpp
+ ${CRU_PLATFORM_NATIVE_INCLUDE_DIR}/cursor.hpp
+ ${CRU_PLATFORM_NATIVE_INCLUDE_DIR}/native_event.hpp
+ ${CRU_PLATFORM_NATIVE_INCLUDE_DIR}/native_window.hpp
+ ${CRU_PLATFORM_NATIVE_INCLUDE_DIR}/ui_application.hpp
+)
+target_link_libraries(cru_platform_native PUBLIC cru_platform_graph)
diff --git a/src/platform/native/cursor.cpp b/src/platform/native/cursor.cpp
new file mode 100644
index 00000000..b12aec40
--- /dev/null
+++ b/src/platform/native/cursor.cpp
@@ -0,0 +1,10 @@
+#include "cru/platform/native/cursor.hpp"
+
+#include "cru/platform/native/ui_application.hpp"
+
+namespace cru::platform::native {
+std::shared_ptr<Cursor> GetSystemCursor(SystemCursor type) {
+ return UiApplication::GetInstance()->GetCursorManager()->GetSystemCursor(
+ type);
+}
+} // namespace cru::platform::native