| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef DEKKO_H |
| 19 |
#define DEKKO_H |
| 20 |
|
| 21 |
#include <QObject> |
| 22 |
#include <QLoggingCategory> |
| 23 |
|
| 24 |
#include <QApplication> |
| 25 |
#include <QPointer> |
| 26 |
#include <QProcess> |
| 27 |
#include <QtQuick/QQuickView> |
| 28 |
#include <QQmlApplicationEngine> |
| 29 |
#include <MsgPartQNAMFactory.h> |
| 30 |
#include <QCommandLineParser> |
| 31 |
#include <QQmlApplicationEngine> |
| 32 |
#include <ServiceRegistry.h> |
| 33 |
|
| 34 |
#ifdef SERVER_AS_QTHREAD |
| 35 |
#include <messageserver.h> |
| 36 |
#endif |
| 37 |
|
| 38 |
Q_DECLARE_LOGGING_CATEGORY(DEKKO_MAIN) |
| 39 |
|
| 40 |
class Dekko : public QApplication |
| 41 |
{ |
| 42 |
Q_OBJECT |
| 43 |
public: |
| 44 |
Dekko(int &argc, char **argv); |
| 45 |
~Dekko(); |
| 46 |
|
| 47 |
bool setup(); |
| 48 |
bool isServerRunning(); |
| 49 |
bool startServer(); |
| 50 |
|
| 51 |
bool isWorkerRunning(); |
| 52 |
bool startWorker(); |
| 53 |
|
| 54 |
Q_INVOKABLE void trimCache(); |
| 55 |
|
| 56 |
signals: |
| 57 |
|
| 58 |
public slots: |
| 59 |
|
| 60 |
private slots: |
| 61 |
void serverProcessError(QProcess::ProcessError error); |
| 62 |
void workerProcessError(QProcess::ProcessError error); |
| 63 |
|
| 64 |
protected: |
| 65 |
void loadPlugins(); |
| 66 |
|
| 67 |
private: |
| 68 |
ServiceRegistry *m_serviceRegistry; |
| 69 |
#ifdef SERVER_AS_QTHREAD |
| 70 |
MessageServerThread *m_serverThread; |
| 71 |
#else |
| 72 |
QProcess *m_server; |
| 73 |
QProcess *m_worker; |
| 74 |
#endif |
| 75 |
MsgPartQNAMFactory m_partqnam; |
| 76 |
bool devMode; |
| 77 |
bool m_verboseLogging; |
| 78 |
QCommandLineParser parser; |
| 79 |
QQmlApplicationEngine m_engine; |
| 80 |
|
| 81 |
}; |
| 82 |
|
| 83 |
#endif |