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/context.h

38 lines
737 B
C
Raw Normal View History

2019-12-04 15:51:46 +08:00
#ifndef CONTEXT_H
#define CONTEXT_H
2021-02-02 20:42:37 +08:00
#include <QVariant>
2019-12-04 16:44:30 +08:00
2021-01-28 17:06:40 +08:00
#include "interface_driver.h"
2021-02-02 20:42:37 +08:00
#include "shader/root_node.h"
2019-12-04 15:51:46 +08:00
class Context
{
private:
2021-01-28 17:06:40 +08:00
QString mContextId;
2021-02-04 14:55:36 +08:00
QMap<QString, QObject*> mPluginMap;
2021-02-02 20:42:37 +08:00
RootNode *mRootNode;
2021-01-28 17:06:40 +08:00
QString source;
QString script;
QString extra;
2021-02-02 20:42:37 +08:00
QVariant initParams;
2021-01-28 18:08:13 +08:00
InterfaceDriver *driver = NULL;
2019-12-04 15:51:46 +08:00
public:
2021-01-28 17:06:40 +08:00
Context(QString contextId, QString source, QString extra);
2019-12-04 16:44:30 +08:00
2021-01-28 20:31:06 +08:00
static Context* create(QString script, QString source, QString extra);
2021-02-02 20:42:37 +08:00
void init(QString initData);
void build(int width, int height);
void callEntity(QString methodName, QVariantList args);
2021-01-28 17:06:40 +08:00
InterfaceDriver* getDriver();
2021-02-04 14:55:36 +08:00
QObject* obtainPlugin(QString name);
2019-12-04 15:51:46 +08:00
};
#endif // CONTEXT_H