-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremglkprocess.h
122 lines (99 loc) · 2.95 KB
/
remglkprocess.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef REMGLKPROCESS_H
#define REMGLKPROCESS_H
#include <QObject>
#include <QProcess>
#include <QMainWindow>
#include <QMap>
#include <QPointer>
#include <QProcess>
#include <QTextStream>
#include <QJsonObject>
#include <QJsonArray>
#include <QTextEdit>
#include <remglkoutputlayout.h>
QT_BEGIN_NAMESPACE
class QAction;
class QComboBox;
class QFontComboBox;
class RemGlkCompleterTextEdit;
class QTextCharFormat;
class QMenu;
class QPrinter;
class QCompleter;
QT_END_NAMESPACE
class RemGlkProcess : public QObject
{
Q_OBJECT
public:
explicit RemGlkProcess(QObject *parent = nullptr, RemGlkCompleterTextEdit *textEditOutput = nullptr);
void setOutputTextEdit(RemGlkCompleterTextEdit *textEditOutput);
void setDataFilePath(QString dataFilePath);
void setRemGlkEngine(int engineCode);
signals:
public slots:
// assistant/remotecontrol.cpp
void engineProcessClosed();
void launchRemGlkEngine();
void launchRemGlkEngineGo();
void stopRunningEngine();
void resetForNewLaunch();
void sendCommand(const QString &cmd);
void processStandardOutputFromRemGlk();
void processStateChange(const QProcess::ProcessState newState);
void processRemGlkStanza(QJsonObject incomingStanza);
void stanzaRemGlkInput(QJsonArray input);
void stanzaRemGlkTimer(QJsonValue timer);
void storyRespondTimer();
void storyRespond(const QString storyInput);
void storyRespond_returnPressed(const QString storyInput);
void inlineOutputRemGlkDebug(int format, QString debugOutput);
QString toStringJsonObject(const QJsonObject jsonObj);
void storyRespondChar(const QString storyInput);
public:
// assistant/remotecontrol.cpp
QProcess *process;
RemGlkCompleterTextEdit *textEdit;
//RemGlkOutputLayout outputLayout;
protected:
//
// INLINE WINDOW OUTPUT - DEBUG CONTROLS
//
bool remGlkDebug_process_steps = false;
bool remGlkDebug_JSON_in_raw = false;
bool remGlkDebug_JSON_parsing = false;
protected:
QString dataTempBuffer;
QTextStream dataTempStream;
QString dataFilePath = "";
QString appRemGlkBinaryPath = "remglk_glulxe";
public:
// 0 = not started, 1 = just started, 2 = first stanza, 4 = closed
int storyEngineState = 0;
protected:
int engineInputMode = -1;
int engineInputCharGen = -1;
int engineInputLineGen = -1;
int engineInputLineMaxLen = -1;
int engineInputLineWindowId = -1;
int engineInputCharWindowId = -1;
int processCycle = 0;
int incomingRemGlkStanzaCount = 0;
QString rawIncomingPileJSON = "";
int rawIncomingPileAdditions = 0;
long updateGeneration = -1;
volatile bool stanzaIncomingFlag = false;
int engineInputLineGenPreviousSent = -1;
int engineInputCharGenPreviousSent = -1;
public:
RemGlkOutputLayout outputLayout;
#ifdef Q_OS_ANDROID
#ifdef HOST_ANDROID_ARM
int enginePickA = 2;
#else
int enginePickA = 1;
#endif
#else
int enginePickA = 0;
#endif
};
#endif // REMGLKPROCESS_H