This repository was archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathILVM.h
More file actions
84 lines (61 loc) · 1.86 KB
/
ILVM.h
File metadata and controls
84 lines (61 loc) · 1.86 KB
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
#pragma once
#include <QObject>
#include <QList>
#include "LThread.h"
#include "Infinity_global.h"
#include "Infinity_Events.h"
#include <QMessageBox>
#include "ILLibs.h"
#include "DMH.h"
#define ILVM_COPYRIGHT "Infinity Studio Script Interpreter 1.0.0" " Copyright (C) 2019-2022 Infinity Synthesis Team"
class ILVM : public QObject
{
Q_OBJECT
ILVM(QObject *parent);
~ILVM();
static ILVM vm;
QList<LThread*> threads;
QList<LThread*> threads_bin;
LThread* mainThread = nullptr;
const QString mainId = "_main";
const QString destoryId = "_destory";
static QString outStrTemp;
bool isSafeMode = false;
void VMPushOptionalFunctions(LThread* thread);
void VMPushAllFunctions(LThread* thread);
public:
static ILVM& getVM();
static void lStdOut(lua_State* L, const char* data, size_t size);
static void lStdOutLine(lua_State* L);
static void lStdOutErr(lua_State* L, const char* format, const char* data);
void mainCritical();
bool findThread(QString id);
QStringList getThreadList();
bool createThread(QString id);
bool removeThread(QString id);
bool destoryThread(QString id);
bool doStringOnThread(QString id, QString str);
bool doFileOnThread(QString id, QString file);
bool threadIsRunning(QString id);
void flushBin();
bool checkShare(QString id, QString key);
void* newShare(QString id, QString key, size_t size);
bool removeShare(QString id, QString key);
void* getShare(QString id, QString key);
size_t sizeShare(QString id, QString key);
bool clearShare(QString id);
QStringList listShare(QString id);
void lockShare(QString id);
void unlockShare(QString id);
public slots:
void on_commandsIn(QString command);
private slots:
void on_threadStart(QString id);
void on_threadStop(QString id);
signals:
void errorMessage(QString message);
void normalMessage(QString message);
void clearMessage();
void mainStart();
void mainStop();
};