qmlfrontend/engine_interface.h
changeset 15238 b32c52c76977
parent 14875 aed75d439027
child 15919 d52f5d8e75e6
--- a/qmlfrontend/engine_interface.h	Fri Jul 05 23:40:03 2019 +0300
+++ b/qmlfrontend/engine_interface.h	Sat Jul 06 00:31:54 2019 +0200
@@ -6,10 +6,23 @@
 
 #ifdef __cplusplus
 #define ENUM_CLASS enum
+
+#ifndef Q_NAMESPACE
+#define Q_NAMESPACE
+#endif
+
+#ifndef Q_ENUM_NS
+#define Q_ENUM_NS(x)
+#endif
+
+#ifndef Q_DECLARE_METATYPE
+#define Q_DECLARE_METATYPE(x)
+#endif
+
 namespace Engine {
 extern "C" {
 #else
-#define ENUM_CLASS enum
+#define ENUM_CLASS enum class
 #endif
 
 typedef struct _EngineInstance EngineInstance;
@@ -68,9 +81,22 @@
 typedef void positioned_event_t(EngineInstance* engine_state,
                                 PositionedEventType event_type, int32_t x,
                                 int32_t y);
+}  // extern "C"
+
 #ifdef __cplusplus
-}
-};
+Q_NAMESPACE
+
+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)
 #endif
 
 #endif  // ENGINE_H