2024-04-13 11:52:42 +02:00
|
|
|
/*
|
2024-04-10 16:53:18 +02:00
|
|
|
* Mirai. Copyright (C) 2024 Vyn
|
|
|
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
|
|
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
|
|
|
*/
|
|
|
|
|
2024-08-16 21:35:12 +02:00
|
|
|
#include "UiState.h"
|
|
|
|
#include "mirai-core/Config.h"
|
|
|
|
#include "mirai-core/Mirai.h"
|
|
|
|
#include "mirai-core/StdFileResource.h"
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <string>
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-08-16 21:35:12 +02:00
|
|
|
int main(int argc, char **argv)
|
2024-04-10 16:53:18 +02:00
|
|
|
{
|
2024-08-16 21:35:12 +02:00
|
|
|
mirai::Config config(std::string(getenv("HOME")) + "/.config/mirai/config.json");
|
2024-04-13 11:52:42 +02:00
|
|
|
|
2024-08-16 21:35:12 +02:00
|
|
|
mirai::Mirai mirai;
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-08-16 21:35:12 +02:00
|
|
|
for (const auto &sourceFilePath : config.sources()) {
|
|
|
|
auto file = std::make_unique<mirai::StdFileResource>(
|
|
|
|
mirai::BaseFileResourceConstructor{.name = sourceFilePath, .path = sourceFilePath}
|
2024-04-14 14:11:41 +02:00
|
|
|
);
|
2024-08-16 21:35:12 +02:00
|
|
|
mirai.loadResource(std::move(file));
|
2024-04-10 16:53:18 +02:00
|
|
|
}
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
UiState uiState{&mirai};
|
|
|
|
uiState.run();
|
|
|
|
|
|
|
|
return 0;
|
2024-04-10 16:53:18 +02:00
|
|
|
}
|