Ken Van Hoeylandt 86010186d8
Improve Terminal, App List, app starting, and more (#658)
app-module:

- Implement `AppStartContext` to reduce amount of `app_start_` and `app_exec` functions: replace them with `app_start_with_context()`
- Add support for environment variables when starting apps
- Implement support for environment variables for apps

graphics-module:

- Add this new module
- Move font-module code into this module
- Implement pixel_buffer

apps:

- Terminal app: reduce memory usage by only buffering a single row of characters, and try to buffer in IRAM when possible. Implement new pixel_buffer.
- App List: Mark apps as favourite to pin them on top. Use touch or press "x" key.
- App List: Add toolbar button that shows alert dialog with info about using favourites
2026-09-24 00:44:28 +02:00

58 lines
1.3 KiB
C++

#include "tactility/memory.h"
#include <Tactility/app/terminal/Terminal.h>
#include <tactility/log.h>
#include <app/event.h>
#include <app/manager.h>
#include <app/manifest.h>
#include <app/scheduler.h>
#include <tactility/device.h>
#include <tactility/drivers/display.h>
#include <tactility/module.h>
#include <lvgl/module.h>
constexpr auto* TAG = "terminal";
namespace tt::app::terminal {
int main(int argc, char* argv[]) {
Device* display_device = nullptr;
if (device_get_first_active_by_type(&DISPLAY_TYPE, &display_device) != ERROR_NONE) {
LOG_E(TAG, "No display device found");
return 0;
}
// Stop LVGL, because terminal has custom rendering
auto lvgl_active = module_is_started(&lvgl_module);
if (lvgl_active) {
module_stop(&lvgl_module);
}
runTerminal(display_device);
device_put(display_device);
// If needed, restart LVGL
if (lvgl_active && !module_is_started(&lvgl_module)) {
LOG_I(TAG, "Restarting LVGL");
module_start(&lvgl_module);
}
return 0;
}
extern const ::AppManifest manifest = {
.id = "tactility.terminal",
.name = "Terminal",
.category = APP_CATEGORY_SYSTEM,
.location = { .type = APP_LOCATION_MEMORY, .location = reinterpret_cast<void*>(main) },
.flags = 0,
.stack = { .depth = 4096, .desired_memory_capability = 0 },
};
}