diff --git a/Tactility/Include/Tactility/app/AppContext.h b/Tactility/Include/Tactility/app/AppContext.h index 6f90b8fd..c31eab48 100644 --- a/Tactility/Include/Tactility/app/AppContext.h +++ b/Tactility/Include/Tactility/app/AppContext.h @@ -51,11 +51,6 @@ public: */ virtual std::string getDataDirectory() const = 0; - /** - * @see getDataDirectory(), but with LVGL prefix. - */ - virtual std::string getDataDirectoryLvgl() const = 0; - /** * Returns the full path for an entry inside the data location for an app. * The data directory is intended to survive OS upgrades. @@ -64,11 +59,6 @@ public: */ virtual std::string getDataPath(const std::string& childPath) const = 0; - /** - * @see getDataPath(), but with LVGL prefix. - */ - virtual std::string getDataPathLvgl(const std::string& childPath) const = 0; - /** * Returns the directory path for the system location for an app. * The system directory is not intended to survive OS upgrades. @@ -78,11 +68,6 @@ public: */ virtual std::string getSystemDirectory() const = 0; - /** - * @see getSystemDirectory(), but with LVGL prefix. - */ - virtual std::string getSystemDirectoryLvgl() const = 0; - /** * Returns the full path for an entry inside the system location for an app. * The data directory is not intended to survive OS upgrades. @@ -91,11 +76,6 @@ public: * @param[in] childPath the path without a "/" prefix */ virtual std::string getSystemPath(const std::string& childPath) const = 0; - - /** - * @see getSystemPath(), but with LVGL prefix. - */ - virtual std::string getSystemPathLvgl(const std::string& childPath) const = 0; }; } diff --git a/Tactility/Include/Tactility/service/ServiceContext.h b/Tactility/Include/Tactility/service/ServiceContext.h index fc1cd86a..235ef44e 100644 --- a/Tactility/Include/Tactility/service/ServiceContext.h +++ b/Tactility/Include/Tactility/service/ServiceContext.h @@ -43,11 +43,6 @@ public: */ virtual std::string getDataDirectory() const = 0; - /** - * @see getDataDirectory(), but with LVGL prefix. - */ - virtual std::string getDataDirectoryLvgl() const = 0; - /** * Returns the full path for an entry inside the data location for a service. * The data directory is intended to survive OS upgrades. @@ -56,11 +51,6 @@ public: */ virtual std::string getDataPath(const std::string& childPath) const = 0; - /** - * @see getDataPath(), but with LVGL prefix. - */ - virtual std::string getDataPathLvgl(const std::string& childPath) const = 0; - /** * Returns the directory path for the system location for a service. * The system directory is not intended to survive OS upgrades. @@ -70,11 +60,6 @@ public: */ virtual std::string getSystemDirectory() const = 0; - /** - * @see getSystemDirectory(), but with LVGL prefix. - */ - virtual std::string getSystemDirectoryLvgl() const = 0; - /** * Returns the full path for an entry inside the system location for an app. * The data directory is not intended to survive OS upgrades. @@ -83,11 +68,6 @@ public: * @param[in] childPath the path without a "/" prefix */ virtual std::string getSystemPath(const std::string& childPath) const = 0; - - /** - * @see getSystemPath(), but with LVGL prefix. - */ - virtual std::string getSystemPathLvgl(const std::string& childPath) const = 0; }; } // namespace diff --git a/Tactility/Private/Tactility/app/AppInstancePaths.h b/Tactility/Private/Tactility/app/AppInstancePaths.h index 46ca3b62..6583610c 100644 --- a/Tactility/Private/Tactility/app/AppInstancePaths.h +++ b/Tactility/Private/Tactility/app/AppInstancePaths.h @@ -14,13 +14,9 @@ public: ~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; }; } \ No newline at end of file diff --git a/Tactility/Private/Tactility/service/ServiceInstancePaths.h b/Tactility/Private/Tactility/service/ServiceInstancePaths.h index a491a285..d491bb85 100644 --- a/Tactility/Private/Tactility/service/ServiceInstancePaths.h +++ b/Tactility/Private/Tactility/service/ServiceInstancePaths.h @@ -6,23 +6,17 @@ namespace tt::service { class ServiceInstancePaths final : public Paths { -private: - std::shared_ptr manifest; public: explicit ServiceInstancePaths(std::shared_ptr manifest) : manifest(std::move(manifest)) {} - ~ServiceInstancePaths() final = default; + ~ServiceInstancePaths() override = 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; + std::string getDataDirectory() const override; + std::string getDataPath(const std::string& childPath) const override; + std::string getSystemDirectory() const override; + std::string getSystemPath(const std::string& childPath) const override; }; } \ No newline at end of file diff --git a/Tactility/Source/app/AppInstancePaths.cpp b/Tactility/Source/app/AppInstancePaths.cpp index 5d57f336..d00e94f9 100644 --- a/Tactility/Source/app/AppInstancePaths.cpp +++ b/Tactility/Source/app/AppInstancePaths.cpp @@ -12,11 +12,10 @@ namespace tt::app { std::string AppInstancePaths::getDataDirectory() const { - return PARTITION_PREFIX + file::DATA_PARTITION_NAME + "/app/" + manifest.appId; -} + if (manifest.appLocation.isInternal()) { -std::string AppInstancePaths::getDataDirectoryLvgl() const { - return LVGL_PATH_PREFIX + file::DATA_PARTITION_NAME + "/app/" + manifest.appId; + } + return PARTITION_PREFIX + file::DATA_PARTITION_NAME + "/app/" + manifest.appId; } std::string AppInstancePaths::getDataPath(const std::string& childPath) const { @@ -24,26 +23,14 @@ std::string AppInstancePaths::getDataPath(const std::string& childPath) const { return PARTITION_PREFIX + file::DATA_PARTITION_NAME + "/app/" + manifest.appId + '/' + childPath; } -std::string AppInstancePaths::getDataPathLvgl(const std::string& childPath) const { - assert(!childPath.starts_with('/')); - return LVGL_PATH_PREFIX + file::DATA_PARTITION_NAME + "/app/" + manifest.appId + '/' + childPath; -} std::string AppInstancePaths::getSystemDirectory() const { return PARTITION_PREFIX + file::SYSTEM_PARTITION_NAME + "/app/" + manifest.appId; } -std::string AppInstancePaths::getSystemDirectoryLvgl() const { - return LVGL_PATH_PREFIX + file::SYSTEM_PARTITION_NAME + "/app/" + manifest.appId; -} - std::string AppInstancePaths::getSystemPath(const std::string& childPath) const { assert(!childPath.starts_with('/')); return PARTITION_PREFIX + file::SYSTEM_PARTITION_NAME + "/app/" + manifest.appId + '/' + childPath; } -std::string AppInstancePaths::getSystemPathLvgl(const std::string& childPath) const { - return LVGL_PATH_PREFIX + file::SYSTEM_PARTITION_NAME + "/app/" + manifest.appId + '/' + childPath; -} - } diff --git a/Tactility/Source/app/boot/Boot.cpp b/Tactility/Source/app/boot/Boot.cpp index b4c14212..82cebd5b 100644 --- a/Tactility/Source/app/boot/Boot.cpp +++ b/Tactility/Source/app/boot/Boot.cpp @@ -167,7 +167,7 @@ public: } else { logo = hal::usb::isUsbBootMode() ? "assets/logo_usb.png" : "assets/logo.png"; } - const auto logo_path = paths->getSystemPathLvgl(logo); + const auto logo_path = "A:" + paths->getSystemPath(logo); TT_LOG_I(TAG, "%s", logo_path.c_str()); lv_image_set_src(image, logo_path.c_str()); } diff --git a/Tactility/Source/app/launcher/Launcher.cpp b/Tactility/Source/app/launcher/Launcher.cpp index 730b4bb6..447176d4 100644 --- a/Tactility/Source/app/launcher/Launcher.cpp +++ b/Tactility/Source/app/launcher/Launcher.cpp @@ -112,9 +112,9 @@ public: const int32_t margin = is_landscape_display ? std::min(available_width / 16, button_size) : 0; const auto paths = app.getPaths(); - const auto apps_icon_path = paths->getSystemPathLvgl("assets/icon_apps.png"); - const auto files_icon_path = paths->getSystemPathLvgl("assets/icon_files.png"); - const auto settings_icon_path = paths->getSystemPathLvgl("assets/icon_settings.png"); + const auto apps_icon_path = "A:" + paths->getSystemPath("assets/icon_apps.png"); + const auto files_icon_path = "A:" + paths->getSystemPath("assets/icon_files.png"); + const auto settings_icon_path = "A:" + paths->getSystemPath("assets/icon_settings.png"); createAppButton(buttons_wrapper, ui_scale, apps_icon_path.c_str(), "AppList", margin); createAppButton(buttons_wrapper, ui_scale, files_icon_path.c_str(), "Files", margin); diff --git a/Tactility/Source/app/timezone/TimeZone.cpp b/Tactility/Source/app/timezone/TimeZone.cpp index fee64710..72564405 100644 --- a/Tactility/Source/app/timezone/TimeZone.cpp +++ b/Tactility/Source/app/timezone/TimeZone.cpp @@ -200,7 +200,7 @@ public: lv_obj_set_style_image_recolor_opa(icon, 255, 0); lv_obj_set_style_image_recolor(icon, lv_theme_get_color_primary(parent), 0); - std::string icon_path = app.getPaths()->getSystemPathLvgl("search.png"); + std::string icon_path = "A:" + app.getPaths()->getSystemPath("search.png"); lv_image_set_src(icon, icon_path.c_str()); lv_obj_set_style_image_recolor(icon, lv_theme_get_color_primary(parent), 0); diff --git a/Tactility/Source/service/ServiceInstancePaths.cpp b/Tactility/Source/service/ServiceInstancePaths.cpp index c60ff123..dc8ce653 100644 --- a/Tactility/Source/service/ServiceInstancePaths.cpp +++ b/Tactility/Source/service/ServiceInstancePaths.cpp @@ -16,35 +16,18 @@ std::string ServiceInstancePaths::getDataDirectory() const { return PARTITION_PREFIX + file::DATA_PARTITION_NAME + "/service/" + manifest->id; } -std::string ServiceInstancePaths::getDataDirectoryLvgl() const { - return LVGL_PATH_PREFIX + file::DATA_PARTITION_NAME + "/service/" + manifest->id; -} - std::string ServiceInstancePaths::getDataPath(const std::string& childPath) const { assert(!childPath.starts_with('/')); return PARTITION_PREFIX + file::DATA_PARTITION_NAME + "/service/" + manifest->id + '/' + childPath; } -std::string ServiceInstancePaths::getDataPathLvgl(const std::string& childPath) const { - assert(!childPath.starts_with('/')); - return LVGL_PATH_PREFIX + file::DATA_PARTITION_NAME + "/service/" + manifest->id + '/' + childPath; -} - std::string ServiceInstancePaths::getSystemDirectory() const { return PARTITION_PREFIX + file::SYSTEM_PARTITION_NAME + "/service/" + manifest->id; } -std::string ServiceInstancePaths::getSystemDirectoryLvgl() const { - return LVGL_PATH_PREFIX + file::SYSTEM_PARTITION_NAME + "/service/" + manifest->id; -} - std::string ServiceInstancePaths::getSystemPath(const std::string& childPath) const { assert(!childPath.starts_with('/')); return PARTITION_PREFIX + file::SYSTEM_PARTITION_NAME + "/service/" + manifest->id + '/' + childPath; } -std::string ServiceInstancePaths::getSystemPathLvgl(const std::string& childPath) const { - return LVGL_PATH_PREFIX + file::SYSTEM_PARTITION_NAME + "/service/" + manifest->id + '/' + childPath; -} - } diff --git a/Tactility/Source/service/statusbar/Statusbar.cpp b/Tactility/Source/service/statusbar/Statusbar.cpp index 3f430f77..30c535b7 100644 --- a/Tactility/Source/service/statusbar/Statusbar.cpp +++ b/Tactility/Source/service/statusbar/Statusbar.cpp @@ -163,7 +163,7 @@ class StatusbarService final : public Service { bool show_icon = (gps_state == gps::State::OnPending) || (gps_state == gps::State::On); if (gps_last_state != show_icon) { if (show_icon) { - auto icon_path = paths->getSystemPathLvgl(STATUSBAR_ICON_GPS); + auto icon_path = "A:" + paths->getSystemPath(STATUSBAR_ICON_GPS); lvgl::statusbar_icon_set_image(gps_icon_id, icon_path); lvgl::statusbar_icon_set_visibility(gps_icon_id, true); } else { @@ -179,7 +179,7 @@ class StatusbarService final : public Service { const char* desired_icon = getWifiStatusIcon(radio_state, is_secure); if (wifi_last_icon != desired_icon) { if (desired_icon != nullptr) { - auto icon_path = paths->getSystemPathLvgl(desired_icon); + auto icon_path = "A:" + paths->getSystemPath(desired_icon); lvgl::statusbar_icon_set_image(wifi_icon_id, icon_path); lvgl::statusbar_icon_set_visibility(wifi_icon_id, true); } else { @@ -193,7 +193,7 @@ class StatusbarService final : public Service { const char* desired_icon = getPowerStatusIcon(); if (power_last_icon != desired_icon) { if (desired_icon != nullptr) { - auto icon_path = paths->getSystemPathLvgl(desired_icon); + auto icon_path = "A:" + paths->getSystemPath(desired_icon); lvgl::statusbar_icon_set_image(power_icon_id, icon_path); lvgl::statusbar_icon_set_visibility(power_icon_id, true); } else { @@ -212,7 +212,7 @@ class StatusbarService final : public Service { if (state != hal::sdcard::SdCardDevice::State::Timeout) { auto* desired_icon = getSdCardStatusIcon(state); if (sdcard_last_icon != desired_icon) { - auto icon_path = paths->getSystemPathLvgl(desired_icon); + auto icon_path = "A:" + paths->getSystemPath(desired_icon); lvgl::statusbar_icon_set_image(sdcard_icon_id, icon_path); lvgl::statusbar_icon_set_visibility(sdcard_icon_id, true); sdcard_last_icon = desired_icon; diff --git a/TactilityC/Include/tt_app.h b/TactilityC/Include/tt_app.h index 371dd529..6c0c840d 100644 --- a/TactilityC/Include/tt_app.h +++ b/TactilityC/Include/tt_app.h @@ -31,14 +31,6 @@ bool tt_app_has_result(AppHandle handle); */ void tt_app_get_data_directory(AppPathsHandle handle, char* buffer, size_t* size); -/** Get the path to the data directory of this app, with LVGL drive letter prefix applied. - * The recommended buffer size is 256 bytes. - * @param[in] handle the app handle - * @param[out] buffer the output buffer (recommended size is 256 bytes) - * @param[inout] size used as input for maximum buffer size (including null terminator) and is set with the path string length by this function - */ -void tt_app_get_data_directory_lvgl(AppPathsHandle handle, char* buffer, size_t* size); - /** * Start an app by id. * @param[in] appId the app manifest id diff --git a/TactilityC/Source/tt_app.cpp b/TactilityC/Source/tt_app.cpp index 26bed03a..59f009c8 100644 --- a/TactilityC/Source/tt_app.cpp +++ b/TactilityC/Source/tt_app.cpp @@ -51,22 +51,4 @@ void tt_app_get_data_directory(AppPathsHandle handle, char* buffer, size_t* size *size = data_path.length(); } -void tt_app_get_data_directory_lvgl(AppPathsHandle handle, char* buffer, size_t* size) { - assert(buffer != nullptr); - assert(size != nullptr); - assert(*size > 0); - auto paths = HANDLE_AS_APP_CONTEXT(handle)->getPaths(); - auto data_path = paths->getDataDirectoryLvgl(); - auto expected_length = data_path.length() + 1; - if (*size < expected_length) { - TT_LOG_E(TAG, "Path buffer not large enough (%d < %d)", *size, expected_length); - *size = 0; - buffer[0] = 0; - return; - } - - strcpy(buffer, data_path.c_str()); - *size = data_path.length(); -} - } \ No newline at end of file diff --git a/TactilityC/Source/tt_init.cpp b/TactilityC/Source/tt_init.cpp index 32b6c2e8..34d5dfdc 100644 --- a/TactilityC/Source/tt_init.cpp +++ b/TactilityC/Source/tt_init.cpp @@ -185,7 +185,6 @@ const esp_elfsym elf_symbols[] { ESP_ELFSYM_EXPORT(tt_app_alertdialog_start), ESP_ELFSYM_EXPORT(tt_app_alertdialog_get_result_index), ESP_ELFSYM_EXPORT(tt_app_get_data_directory), - ESP_ELFSYM_EXPORT(tt_app_get_data_directory_lvgl), ESP_ELFSYM_EXPORT(tt_bundle_alloc), ESP_ELFSYM_EXPORT(tt_bundle_free), ESP_ELFSYM_EXPORT(tt_bundle_opt_bool),