This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/engine/js_engine.h
2021-05-20 18:27:45 +08:00

30 lines
657 B
C++

#ifndef JSENGINE_H
#define JSENGINE_H
#include <QJSValue>
#include <QThreadPool>
#include "interface_jse.h"
class JSEngine : public QObject
{
Q_OBJECT
private:
InterfaceJSE *mJSE;
void loadBuiltinJS(QString assetName);
void prepareContext(QString contextId, QString script, QString source);
QString packageContextScript(QString contextId, QString content);
QString packageModuleScript(QString moduleName, QString content);
public:
QThreadPool mJSThreadPool;
explicit JSEngine(QObject *parent = nullptr);
QJSValue invokeDoricMethod(QString method, QJSValueList arguments);
~JSEngine();
};
#endif // JSENGINE_H