qmlfrontend/hwengine.h
author unc0rr
Tue, 26 Dec 2017 01:36:58 +0100
branchqmlfrontend
changeset 12861 488782d9aba9
parent 12858 0c6fb706f747
child 12863 fe16fa088b69
permissions -rw-r--r--
Recreate uFLRunQueue in Qt, render previews
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     1
#ifndef HWENGINE_H
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     2
#define HWENGINE_H
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     3
12858
0c6fb706f747 More refactoring in attempt to move away from frontlib
unc0rr
parents: 12857
diff changeset
     4
#include <QList>
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     5
#include <QObject>
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     6
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     7
#include "flib.h"
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     8
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
     9
class QQmlEngine;
12861
488782d9aba9 Recreate uFLRunQueue in Qt, render previews
unc0rr
parents: 12858
diff changeset
    10
class PreviewImageProvider;
488782d9aba9 Recreate uFLRunQueue in Qt, render previews
unc0rr
parents: 12858
diff changeset
    11
class RunQueue;
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    12
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    13
class HWEngine : public QObject {
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    14
    Q_OBJECT
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    15
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    16
public:
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    17
    explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr);
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    18
    ~HWEngine();
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    19
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    20
    static void exposeToQML();
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    21
12858
0c6fb706f747 More refactoring in attempt to move away from frontlib
unc0rr
parents: 12857
diff changeset
    22
    Q_INVOKABLE void getPreview();
0c6fb706f747 More refactoring in attempt to move away from frontlib
unc0rr
parents: 12857
diff changeset
    23
    Q_INVOKABLE void runQuickGame();
0c6fb706f747 More refactoring in attempt to move away from frontlib
unc0rr
parents: 12857
diff changeset
    24
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    25
signals:
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    26
    void previewIsRendering();
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    27
    void previewImageChanged();
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    28
    void previewHogCountChanged(int count);
12861
488782d9aba9 Recreate uFLRunQueue in Qt, render previews
unc0rr
parents: 12858
diff changeset
    29
    void gameFinished();
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    30
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    31
public slots:
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    32
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    33
private:
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    34
    QQmlEngine* m_engine;
12861
488782d9aba9 Recreate uFLRunQueue in Qt, render previews
unc0rr
parents: 12858
diff changeset
    35
    PreviewImageProvider* m_previewProvider;
488782d9aba9 Recreate uFLRunQueue in Qt, render previews
unc0rr
parents: 12858
diff changeset
    36
    RunQueue* m_runQueue;
12857
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    37
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    38
    static void guiMessagesCallback(void* context, MessageType mt, const char* msg, uint32_t len);
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    39
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    40
private slots:
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    41
    void engineMessageHandler(MessageType mt, const QByteArray& msg);
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    42
};
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    43
90f927b4b9e1 Start hacking new frontend
unc0rr
parents:
diff changeset
    44
#endif // HWENGINE_H