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"
This commit is contained in:
committed by
GitHub
parent
a4d15b2a1e
commit
bab3eb19bc
@@ -41,10 +41,10 @@ class AppInstance : public AppContext {
|
||||
static std::shared_ptr<App> createApp(
|
||||
const std::shared_ptr<AppManifest>& manifest
|
||||
) {
|
||||
if (manifest->location.isInternal()) {
|
||||
if (manifest->appLocation.isInternal()) {
|
||||
assert(manifest->createApp != nullptr);
|
||||
return manifest->createApp();
|
||||
} else if (manifest->location.isExternal()) {
|
||||
} else if (manifest->appLocation.isExternal()) {
|
||||
if (manifest->createApp != nullptr) {
|
||||
TT_LOG_W("", "Manifest specifies createApp, but this is not used with external apps");
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
std::shared_ptr<const Bundle> getParameters() const override;
|
||||
|
||||
std::unique_ptr<Paths> getPaths() const override;
|
||||
std::unique_ptr<AppPaths> getPaths() const override;
|
||||
|
||||
std::shared_ptr<App> getApp() const override { return app; }
|
||||
};
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/app/AppInstance.h"
|
||||
|
||||
namespace tt::app {
|
||||
|
||||
class AppInstancePaths final : public Paths {
|
||||
|
||||
const AppManifest& manifest;
|
||||
|
||||
public:
|
||||
|
||||
explicit AppInstancePaths(const AppManifest& manifest) : manifest(manifest) {}
|
||||
~AppInstancePaths() override = default;
|
||||
|
||||
std::string getDataDirectory() const override;
|
||||
std::string getDataDirectoryLvgl() const override;
|
||||
std::string getDataPath(const std::string& childPath) const override;
|
||||
std::string getDataPathLvgl(const std::string& childPath) const override;
|
||||
std::string getSystemDirectory() const override;
|
||||
std::string getSystemDirectoryLvgl() const override;
|
||||
std::string getSystemPath(const std::string& childPath) const override;
|
||||
std::string getSystemPathLvgl(const std::string& childPath) const override;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace tt::app {
|
||||
|
||||
bool isValidId(const std::string& id);
|
||||
|
||||
bool parseManifest(const std::map<std::string, std::string>& map, AppManifest& manifest);
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "./State.h"
|
||||
|
||||
#include <Tactility/app/AppContext.h>
|
||||
#include <Tactility/app/AppPaths.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
@@ -13,7 +14,7 @@ class View final {
|
||||
|
||||
Bindings* bindings;
|
||||
State* state;
|
||||
std::unique_ptr<Paths> paths;
|
||||
std::unique_ptr<AppPaths> paths;
|
||||
lv_obj_t* root = nullptr;
|
||||
lv_obj_t* enable_switch = nullptr;
|
||||
lv_obj_t* enable_on_boot_switch = nullptr;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/service/ServiceContext.h"
|
||||
#include "Tactility/service/Service.h"
|
||||
#include <Tactility/service/ServiceContext.h>
|
||||
#include <Tactility/service/Service.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
@@ -21,7 +24,7 @@ public:
|
||||
const ServiceManifest& getManifest() const override;
|
||||
|
||||
/** Retrieve the paths that are relevant to this service */
|
||||
std::unique_ptr<Paths> getPaths() const override;
|
||||
std::unique_ptr<ServicePaths> getPaths() const override;
|
||||
|
||||
std::shared_ptr<Service> getService() const { return service; }
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/service/ServiceInstance.h"
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
class ServiceInstancePaths final : public Paths {
|
||||
|
||||
private:
|
||||
|
||||
std::shared_ptr<const ServiceManifest> manifest;
|
||||
|
||||
public:
|
||||
|
||||
explicit ServiceInstancePaths(std::shared_ptr<const ServiceManifest> manifest) : manifest(std::move(manifest)) {}
|
||||
~ServiceInstancePaths() final = default;
|
||||
|
||||
std::string getDataDirectory() const final;
|
||||
std::string getDataDirectoryLvgl() const final;
|
||||
std::string getDataPath(const std::string& childPath) const final;
|
||||
std::string getDataPathLvgl(const std::string& childPath) const final;
|
||||
std::string getSystemDirectory() const final;
|
||||
std::string getSystemDirectoryLvgl() const final;
|
||||
std::string getSystemPath(const std::string& childPath) const final;
|
||||
std::string getSystemPathLvgl(const std::string& childPath) const final;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user