#include #include "javascript/engine/AtlasJsEngine.hpp" #include #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { // application informations QApplication application(argc, argv); QApplication::setOrganizationDomain("faraphel.fr"); QApplication::setApplicationName("Atlas-Launcher"); QApplication::setApplicationVersion("1.0.0"); // create a restricted virtual file system const auto fileSystem = std::make_shared(); // mount the cache directory fileSystem->mountDirectory( QDir("/cache/"), QDir("/home/faraphel/Documents/Projects/Atlas-Launcher/source/") ); // mount the temporary directory const auto temporaryDir = QTemporaryDir(); fileSystem->mountDirectory( QDir("/tmp/"), QDir(temporaryDir.path()) ); // create a small window auto mainWindow = std::make_shared(); auto widget = std::make_shared(); mainWindow->setCentralWidget(widget.get()); auto layout = std::make_shared(); widget->setLayout(layout.get()); auto input = std::make_shared(); layout->addWidget(input.get()); auto submit = std::make_shared(); layout->addWidget(submit.get()); submit->setText("Run"); auto output = std::make_shared(); layout->addWidget(output.get()); output->setEnabled(false); QObject::connect(submit.get(), &QPushButton::clicked, [&]() { auto engine = std::make_shared(nullptr); QJSValue value = engine->evaluate(input->toPlainText()); output->setText(value.toString()); }); mainWindow->show(); return QApplication::exec(); }