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.cpp

28 lines
621 B
C++
Raw Normal View History

2019-12-14 10:04:17 +08:00
#include "context.h"
2021-01-28 17:06:40 +08:00
#include "native_driver.h"
2021-01-28 20:31:06 +08:00
#include "context_manager.h"
2019-12-14 10:04:17 +08:00
2021-01-28 17:06:40 +08:00
Context::Context(QString contextId, QString source, QString extra)
{
this->mContextId = contextId;
2019-12-14 10:04:17 +08:00
this->source = source;
2021-01-28 17:06:40 +08:00
this->extra = extra;
2019-12-14 10:04:17 +08:00
}
2021-01-28 20:31:06 +08:00
Context* Context::create(QString script, QString source, QString extra)
{
Context *context = ContextManager::getInstance()->createContext(script, source, extra);
context->script = script;
return context;
}
2021-01-28 17:06:40 +08:00
InterfaceDriver* Context::getDriver()
{
if (driver == NULL)
{
driver = NativeDriver::getInstance();
return driver;
}
return driver;
2019-12-14 10:04:17 +08:00
}