TerminalEmbed
This commit is contained in:
31
src/example_apps/TerminalEmbed/TerminalEmbed.cpp
Normal file
31
src/example_apps/TerminalEmbed/TerminalEmbed.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "TerminalEmbed.h"
|
||||
|
||||
void TerminalEmbed::run() {
|
||||
|
||||
for(auto m : runOrder)
|
||||
modules[m]->onLoad();
|
||||
|
||||
// Main loop
|
||||
while (!done && !runOrder.empty()) {
|
||||
|
||||
for(auto m : runOrder) {
|
||||
modules[m]->run();
|
||||
}
|
||||
|
||||
for(auto m : toClose) {
|
||||
unload(m);
|
||||
}
|
||||
toClose.clear();
|
||||
|
||||
for(auto m : toOpen) {
|
||||
if(std::holds_alternative<std::string>(m)) {
|
||||
load(std::get<std::string>(m))->onLoad();
|
||||
} else {
|
||||
load(std::get<Archimedes::Module*>(m))->onLoad();
|
||||
}
|
||||
}
|
||||
toOpen.clear();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
27
src/example_apps/TerminalEmbed/TerminalEmbed.h
Normal file
27
src/example_apps/TerminalEmbed/TerminalEmbed.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#define ENTRYPOINT
|
||||
#include "Archimedes.h"
|
||||
|
||||
#include "modules/Terminal/src/Terminal.h"
|
||||
|
||||
class TerminalEmbed : public Archimedes::App {
|
||||
|
||||
private:
|
||||
|
||||
void printHelp() {};
|
||||
|
||||
public:
|
||||
TerminalEmbed() {
|
||||
Archimedes::Module* m = (Archimedes::Module*) new Terminal(Get(), nullptr);
|
||||
|
||||
load(m);
|
||||
};
|
||||
~TerminalEmbed() {};
|
||||
|
||||
void handleArgs(const int& argc, char* argv[]) {};
|
||||
|
||||
void run();
|
||||
|
||||
};
|
||||
|
||||
#define APP_TYPE TerminalEmbed
|
||||
#include "endApp.h"
|
||||
Reference in New Issue
Block a user