Ken Van Hoeylandt bab3eb19bc
Merge develop into main (#343)
- Refactor `AppManifest`: add new fields and rename existing ones
- Parse and validate the manifest from an app that is being installed.
- Remove deprecated `scoped()` from `Lock`
- Create `Tactility/Paths.h`
- App loading at boot now properly parses the manifest files of external apps
- Properly lock both source and destination locations during app install
- Remove LVGL path variants from `AppPaths` and `ServicePaths`
- Removed `xPath` base classes for apps and services. There's now `AppPaths` and `ServicePaths`.
- Renamed app and service paths: "data" and "system" paths are now "user data" and "assets"
2025-09-22 08:03:21 +02:00

49 lines
1.1 KiB
C++

#include <Tactility/app/files/View.h>
#include <Tactility/app/files/State.h>
#include <Tactility/app/AppContext.h>
#include <Tactility/Assets.h>
#include <Tactility/service/loader/Loader.h>
#include <memory>
namespace tt::app::files {
extern const AppManifest manifest;
class FilesApp final : public App {
std::unique_ptr<View> view;
std::shared_ptr<State> state;
public:
FilesApp() {
state = std::make_shared<State>();
view = std::make_unique<View>(state);
}
void onShow(AppContext& appContext, lv_obj_t* parent) override {
view->init(appContext, parent);
}
void onResult(AppContext& appContext, TT_UNUSED LaunchId launchId, Result result, std::unique_ptr<Bundle> bundle) override {
view->onResult(launchId, result, std::move(bundle));
}
};
extern const AppManifest manifest = {
.appId = "Files",
.appName = "Files",
.appIcon = TT_ASSETS_APP_ICON_FILES,
.appCategory = Category::System,
.appFlags = AppManifest::Flags::Hidden,
.createApp = create<FilesApp>
};
void start() {
service::loader::startApp(manifest.appId);
}
} // namespace