qmlfrontend/engine_instance.h
changeset 14854 aed75d439027
parent 14842 ef9630519491
child 15217 b32c52c76977
--- a/qmlfrontend/engine_instance.h	Mon Apr 29 23:13:52 2019 +0200
+++ b/qmlfrontend/engine_instance.h	Mon Apr 29 23:41:25 2019 +0200
@@ -10,7 +10,17 @@
 
 class EngineInstance : public QObject {
   Q_OBJECT
+
  public:
+  using SimpleEventType = Engine::SimpleEventType;
+  Q_ENUMS(SimpleEventType)
+  using LongEventType = Engine::LongEventType;
+  Q_ENUMS(LongEventType)
+  using LongEventState = Engine::LongEventState;
+  Q_ENUMS(LongEventState)
+  using PositionedEventType = Engine::PositionedEventType;
+  Q_ENUMS(PositionedEventType)
+
   explicit EngineInstance(const QString& libraryPath,
                           QObject* parent = nullptr);
   ~EngineInstance();
@@ -30,7 +40,9 @@
  public slots:
   void advance(quint32 ticks);
   void moveCamera(const QPoint& delta);
-  void controlEvent(bool isStart, int type);
+  void simpleEvent(SimpleEventType event_type);
+  void longEvent(LongEventType event_type, LongEventState state);
+  void positionedEvent(PositionedEventType event_type, qint32 x, qint32 y);
 
  private:
   Engine::EngineInstance* m_instance;
@@ -47,7 +59,15 @@
   Engine::render_frame_t* render_frame;
   Engine::advance_simulation_t* advance_simulation;
   Engine::move_camera_t* move_camera;
+  Engine::simple_event_t* simple_event;
+  Engine::long_event_t* long_event;
+  Engine::positioned_event_t* positioned_event;
   bool m_isValid;
 };
 
+Q_DECLARE_METATYPE(EngineInstance::SimpleEventType)
+Q_DECLARE_METATYPE(EngineInstance::LongEventType)
+Q_DECLARE_METATYPE(EngineInstance::LongEventState)
+Q_DECLARE_METATYPE(EngineInstance::PositionedEventType)
+
 #endif  // ENGINEINSTANCE_H