qmlfrontend/engine_interface.h
changeset 16016 4933920eba89
parent 15893 5b3beb90e1a6
--- a/qmlfrontend/engine_interface.h	Sun May 19 15:55:26 2024 +0200
+++ b/qmlfrontend/engine_interface.h	Mon May 20 14:58:30 2024 +0200
@@ -42,25 +42,51 @@
 using long_event_t = decltype(hwengine::long_event);
 using positioned_event_t = decltype(hwengine::positioned_event);
 
+}  // extern "C"
+
+Q_NAMESPACE
+
+/*
 using SimpleEventType = hwengine::SimpleEventType;
 using LongEventType = hwengine::LongEventType;
 using LongEventState = hwengine::LongEventState;
 using PositionedEventType = hwengine::PositionedEventType;
+*/
 
-}  // extern "C"
+// NOTE: have to copy these to be able to register then in Qt meta object system
+enum class LongEventState {
+  Set,
+  Unset,
+};
 
-Q_NAMESPACE
+enum class LongEventType {
+  ArrowUp,
+  ArrowDown,
+  ArrowLeft,
+  ArrowRight,
+  Precision,
+  Attack,
+};
+
+enum class PositionedEventType {
+  CursorMove,
+  CursorClick,
+};
+
+enum class SimpleEventType {
+  SwitchHedgehog,
+  Timer,
+  LongJump,
+  HighJump,
+  Accept,
+  Deny,
+};
 
 Q_ENUM_NS(SimpleEventType)
 Q_ENUM_NS(LongEventType)
 Q_ENUM_NS(LongEventState)
 Q_ENUM_NS(PositionedEventType)
 
-};  // namespace
-
-Q_DECLARE_METATYPE(Engine::SimpleEventType)
-Q_DECLARE_METATYPE(Engine::LongEventType)
-Q_DECLARE_METATYPE(Engine::LongEventState)
-Q_DECLARE_METATYPE(Engine::PositionedEventType)
+};  // namespace Engine
 
 #endif  // ENGINE_H