From 17a16a13779a4ded5822b7eec96f93fdb54d867e Mon Sep 17 00:00:00 2001 From: David Pires <79417054+Dacops@users.noreply.github.com> Date: Thu, 1 Feb 2024 23:44:06 +0000 Subject: [PATCH] feat(serialization): add serialization in cursor.[hpp/cpp] --- core/include/cubos/core/io/cursor.hpp | 4 ++++ core/src/cubos/core/io/cursor.cpp | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/core/include/cubos/core/io/cursor.hpp b/core/include/cubos/core/io/cursor.hpp index eea990e572..a35d8059f1 100644 --- a/core/include/cubos/core/io/cursor.hpp +++ b/core/include/cubos/core/io/cursor.hpp @@ -4,6 +4,8 @@ #pragma once +#include + #ifdef WITH_GLFW #define GLFW_INCLUDE_NONE #include @@ -43,3 +45,5 @@ namespace cubos::core::io #endif }; } // namespace cubos::core::io + +CUBOS_REFLECT_EXTERNAL_DECL(cubos::core::io::Cursor::Standard); diff --git a/core/src/cubos/core/io/cursor.cpp b/core/src/cubos/core/io/cursor.cpp index a0f4404bbf..165bb6a88b 100644 --- a/core/src/cubos/core/io/cursor.cpp +++ b/core/src/cubos/core/io/cursor.cpp @@ -1,6 +1,11 @@ #include +#include +#include using namespace cubos::core; +using cubos::core::io::Cursor; +using cubos::core::reflection::EnumTrait; +using cubos::core::reflection::Type; #ifdef WITH_GLFW io::Cursor::Cursor(GLFWcursor* handle) @@ -18,3 +23,19 @@ io::Cursor::~Cursor() } #endif } + +CUBOS_REFLECT_EXTERNAL_IMPL(Cursor::Standard) +{ + return Type::create("Standard") + .with(EnumTrait{} + .withVariant("Arrow") + .withVariant("IBeam") + .withVariant("Cross") + .withVariant("Hand") + .withVariant("EWResize") + .withVariant("NSResize") + .withVariant("NWSEResize") + .withVariant("NESWResize") + .withVariant("AllResize") + .withVariant("NotAllowed")); +}