- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
48 lines
1.0 KiB
C++
48 lines
1.0 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 {
|
|
|
|
#define TAG "files_app"
|
|
|
|
extern const AppManifest manifest;
|
|
|
|
class FilesApp : 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(parent);
|
|
}
|
|
|
|
void onResult(AppContext& appContext, Result result, std::unique_ptr<Bundle> bundle) override {
|
|
view->onResult(result, std::move(bundle));
|
|
}
|
|
};
|
|
|
|
extern const AppManifest manifest = {
|
|
.id = "Files",
|
|
.name = "Files",
|
|
.icon = TT_ASSETS_APP_ICON_FILES,
|
|
.type = Type::Hidden,
|
|
.createApp = create<FilesApp>
|
|
};
|
|
|
|
void start() {
|
|
service::loader::startApp(manifest.id);
|
|
}
|
|
|
|
} // namespace
|